/* ============================================
   CODEMASH.CO.UK - Portfolio
   ============================================ */

:root {
    --bg-primary: #1a1a1f;
    --bg-secondary: #222228;
    --bg-card: #2a2a30;
    --bg-card-hover: #323238;
    --text-primary: #eaeaee;
    --text-secondary: #a0a0b0;
    --text-muted: #707080;
    --accent: #f0882e;
    --accent-dim: rgba(240, 136, 46, 0.12);
    --accent-hover: #ff9a42;
    --border: #3a3a44;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --max-width: 1100px;
    --nav-height: 64px;
    --transition: 0.25s ease;
}

/* ---- Reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ---- Navigation ---- */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#nav.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#nav.hidden {
    transform: translateY(-100%);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo:hover {
    color: var(--text-primary);
}

.logo .accent {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    transition: all 0.3s ease;
}

/* ---- Hero ---- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-height) + 40px) 24px 80px;
}

.hero-content {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.hero-text {
    flex: 1;
}

.hero-greeting {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 12px;
}

#hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 8px;
}

.hero-role {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.hero-badges .badge {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.hero-tagline {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 460px;
    margin-bottom: 32px;
}

.hero-cta {
    display: flex;
    gap: 16px;
}

/* ---- Profile Picture ---- */
.hero-profile {
    flex-shrink: 0;
}

.profile-picture-wrapper {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    border: 3px solid var(--accent);
    box-shadow: 0 0 40px rgba(240, 136, 46, 0.1);
    transition: box-shadow var(--transition), transform var(--transition);
}

.profile-picture-wrapper:hover {
    box-shadow: 0 0 60px rgba(240, 136, 46, 0.15);
    transform: scale(1.02);
}

.profile-picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.profile-placeholder {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    font-family: var(--font-mono);
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent);
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 14px 28px;
    border-radius: 4px;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-primary:hover {
    background: var(--accent-dim);
    color: var(--accent);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-lg {
    padding: 18px 40px;
    font-size: 0.95rem;
}

/* ---- Sections ---- */
section {
    padding: 100px 24px;
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    max-width: 300px;
}

.title-number {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 400;
}

/* ---- About ---- */
.about-text {
    max-width: 640px;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 1.05rem;
    line-height: 1.7;
}

.about-text .now-playing {
    background: var(--accent-dim);
    border-left: 3px solid var(--accent);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 24px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.about-text .now-playing strong {
    color: var(--accent);
}

/* ---- Skills ---- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
    transition: border-color var(--transition), transform var(--transition);
}

.skill-category:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.skill-category h3 {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skill-category ul li {
    color: var(--text-secondary);
    padding: 4px 0;
    font-size: 0.95rem;
    position: relative;
    padding-left: 16px;
}

.skill-category ul li::before {
    content: '\25B8';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.75rem;
}

/* ---- Projects ---- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.project-card.featured {
    border-color: rgba(240, 136, 46, 0.3);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.project-icon {
    color: var(--accent);
}

.project-links {
    display: flex;
    gap: 12px;
}

.project-link {
    color: var(--text-muted);
    transition: color var(--transition);
    padding: 4px;
}

.project-link:hover {
    color: var(--accent);
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.project-card:hover .project-title {
    color: var(--accent);
}

.badge-coming-soon {
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 20px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tech li {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(240, 136, 46, 0.08);
    padding: 4px 10px;
    border-radius: 3px;
}

/* ---- Contact ---- */
.contact-section {
    text-align: center;
    max-width: 600px;
}

.contact-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 36px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 36px;
}

.social-links a {
    color: var(--text-muted);
    transition: color var(--transition), transform var(--transition);
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

/* ---- Footer ---- */
footer {
    padding: 24px;
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

footer p {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- Mobile ---- */
@media screen and (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 32px 24px;
        gap: 24px;
        border-bottom: 1px solid var(--border);
        overflow-y: auto;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        font-size: 1rem;
        padding: 8px 0;
    }

    .nav-toggle {
        display: flex;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }

    .nav-toggle.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.open span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    #hero {
        min-height: calc(100vh - var(--nav-height));
        padding-top: calc(var(--nav-height) + 24px);
        padding-bottom: 40px;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 32px;
    }

    .hero-tagline {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta {
        justify-content: center;
        flex-wrap: wrap;
    }

    .btn {
        padding: 12px 24px;
        min-height: 44px;
    }

    .profile-picture-wrapper {
        width: 180px;
        height: 180px;
    }

    .profile-placeholder {
        font-size: 2.5rem;
    }

    section {
        padding: 60px 16px;
    }

    .section-title {
        font-size: 1.4rem;
        margin-bottom: 32px;
    }

    .skills-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .skill-category {
        padding: 20px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        padding: 24px;
    }

    .contact-section {
        padding-left: 0;
        padding-right: 0;
    }

    .btn-lg {
        padding: 16px 32px;
        width: 100%;
        text-align: center;
    }

    .social-links a {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media screen and (max-width: 400px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Disable hover effects on touch devices */
@media (hover: none) {
    .project-card:hover {
        transform: none;
        box-shadow: none;
    }

    .skill-category:hover {
        transform: none;
    }

    .profile-picture-wrapper:hover {
        transform: none;
    }
}

/* ---- Animations ---- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Selection ---- */
::selection {
    background: var(--accent-dim);
    color: var(--accent);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- Image Modal ---- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: var(--text-primary);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

.modal-close:hover {
    color: var(--accent);
}

.profile-picture.clickable {
    cursor: pointer;
}
