/* ============================================================
   Zain Naqvi — Portfolio
   Minimal, classy, monochrome-dark. Colour appears on hover.
   ============================================================ */

:root {
    --bg: #0a0a0b;
    --bg-elev: #111113;
    --bg-elev-2: #161618;
    --text: #f3f2ef;
    --muted: #9b9a96;
    --faint: #6a6966;
    --line: rgba(255, 255, 255, 0.08);
    --line-2: rgba(255, 255, 255, 0.14);
    --accent: #c9c7c1;          /* per-card override sets this  */
    --radius: 14px;
    --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'Consolas', monospace;
    --nav-h: 68px;
    --max: 1080px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.mono { font-family: var(--mono); }

.container { width: min(var(--max), 90%); margin: 0 auto; }
::selection { background: var(--text); color: var(--bg); }

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2c; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3d; }

/* ============================================================
   Header
   ============================================================ */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--nav-h);
    z-index: 100;
    background: rgba(10, 10, 11, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); background: rgba(10, 10, 11, 0.9); }
.nav-inner {
    width: min(var(--max), 90%);
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    font-family: var(--serif);
    font-size: 25px;
    letter-spacing: 0.3px;
    color: var(--text);
}
.nav-right { display: flex; align-items: center; gap: 26px; }
.nav-links { display: flex; gap: 22px; }
.nav-link {
    font-size: 14px;
    color: var(--muted);
    position: relative;
    transition: color .2s;
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 0; bottom: -5px;
    width: 0; height: 1px;
    background: var(--text);
    transition: width .25s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--text); }

/* socials */
.socials { display: flex; align-items: center; gap: 6px; }
.social {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    border-radius: 9px;
    color: var(--muted);
    border: 1px solid transparent;
    transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.social svg { width: 17px; height: 17px; }
.social:hover {
    color: var(--text);
    border-color: var(--line-2);
    background: var(--bg-elev);
    transform: translateY(-2px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span { width: 22px; height: 1.5px; background: var(--text); transition: transform .25s, opacity .25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
    min-height: 92vh;
    min-height: 92svh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-h) + 40px) 0 60px;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.5fr 0.9fr;
    gap: 60px;
    align-items: center;
}
.eyebrow {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--muted);
    text-transform: lowercase;
    margin-bottom: 22px;
}
.hero-name {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(64px, 11vw, 132px);
    line-height: 0.92;
    letter-spacing: -1px;
    cursor: pointer;
    user-select: none;
    width: fit-content;
}
.hero-name.egg-shake { animation: eggShake .3s; }
@keyframes eggShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
.hero-role {
    margin-top: 28px;
    max-width: 540px;
    font-size: 19px;
    color: var(--muted);
}
.hero-actions { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }

.hero-portrait { display: flex; justify-content: center; }
.hero-portrait img {
    width: min(300px, 100%);
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .2s, background .2s, border-color .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-solid { background: var(--text); color: var(--bg); }
.btn-solid:hover { transform: translateY(-2px); background: #fff; }
.btn-line { border-color: var(--line-2); color: var(--text); }
.btn-line:hover { border-color: var(--text); transform: translateY(-2px); }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: 100px 0; }
.section-head { margin-bottom: 48px; }
.section-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(34px, 5vw, 52px);
    letter-spacing: -0.5px;
    line-height: 1.05;
}
.section-note { margin-top: 14px; color: var(--muted); max-width: 480px; font-size: 15.5px; }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   Selected Work — 2 per row, colour on hover
   ============================================================ */
.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 26px;
}
.work-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .35s cubic-bezier(.2,.7,.3,1), border-color .35s, box-shadow .35s;
}
.work-card::after {
    /* coloured glow ring, revealed on hover */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 1px transparent, 0 0 0 0 transparent;
    pointer-events: none;
    transition: box-shadow .35s, opacity .35s;
    opacity: 0;
}
.work-card:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.work-card:hover::after {
    opacity: 1;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent),
                0 22px 50px -20px color-mix(in srgb, var(--accent) 55%, transparent);
}

.work-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background:
        radial-gradient(120% 120% at 70% 10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
        var(--bg-elev-2);
    overflow: hidden;
}
.work-media img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: grayscale(1) brightness(.82);
    transform: scale(1.01);
    transition: filter .45s ease, transform .55s ease;
}
.work-card:hover .work-media img { filter: grayscale(0) brightness(1); transform: scale(1.05); }

/* placeholder grid shown when no image file exists yet */
.work-media.no-img::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: .5;
}
.work-media.no-img::after {
    content: "no image yet";
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-family: var(--mono);
    font-size: 11px; letter-spacing: 2px;
    color: var(--faint);
}
.media-tag {
    position: absolute;
    top: 12px; left: 14px;
    font-size: 12px;
    color: var(--text);
    background: rgba(10,10,11,.55);
    border: 1px solid var(--line-2);
    padding: 2px 8px;
    border-radius: 6px;
    backdrop-filter: blur(6px);
    z-index: 1;
}

.work-body { padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.work-title {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.2px;
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
    transition: color .3s;
}
.work-card:hover .work-title { color: var(--accent); }
.badge {
    font-family: var(--mono);
    font-style: normal;
    font-size: 10.5px;
    letter-spacing: .5px;
    color: var(--muted);
    border: 1px solid var(--line-2);
    padding: 2px 7px;
    border-radius: 5px;
}
.work-desc { color: var(--muted); font-size: 14.5px; flex: 1; }
.work-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 3px 9px;
    border-radius: 999px;
    transition: color .3s, border-color .3s;
}
.work-card:hover .tags li { border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); }
.work-arrow {
    font-size: 18px;
    color: var(--muted);
    transition: transform .3s, color .3s;
}
.work-card:hover .work-arrow { transform: translate(4px, -4px); color: var(--accent); }

/* ---- "coming soon" card: visible but inert, no hover jump ---- */
.work-card.is-soon { opacity: .55; cursor: default; }
.work-card.is-soon:hover { transform: none; border-color: var(--line); }
.work-card.is-soon:hover::after { opacity: 0; box-shadow: none; }
.work-card.is-soon:hover .work-media img { filter: grayscale(1) brightness(.82); transform: scale(1.01); }
.work-card.is-soon:hover .work-title { color: var(--text); }
.work-card.is-soon:hover .tags li { border-color: var(--line); color: var(--muted); }
.work-soon {
    font-size: 11.5px;
    letter-spacing: .5px;
    color: var(--muted);
    border: 1px solid var(--line-2);
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

/* ============================================================
   About
   ============================================================ */
.about-inner { display: grid; grid-template-columns: 0.6fr 1.4fr; gap: 48px; align-items: start; }
.about-body p { font-size: 17px; color: var(--muted); }
.about-body p + p { margin-top: 18px; }
.about-body strong { color: var(--text); font-weight: 600; }
.about-skills {
    margin-top: 30px;
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}
.about-skills li {
    font-family: var(--mono);
    font-size: 13.5px;
    color: var(--text);
    padding: 13px 2px;
    border-bottom: 1px solid var(--line);
}

/* ============================================================
   Contact
   ============================================================ */
.contact { text-align: center; padding: 120px 0; }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(40px, 7vw, 76px);
    line-height: 1;
    letter-spacing: -1px;
}
.contact-note { margin-top: 22px; max-width: 460px; color: var(--muted); font-size: 16px; }
.contact-email {
    margin-top: 30px;
    font-family: var(--serif);
    font-size: clamp(22px, 3.4vw, 32px);
    color: var(--text);
    border-bottom: 1px solid var(--line-2);
    padding-bottom: 3px;
    transition: border-color .3s, opacity .3s;
}
.contact-email:hover { border-color: var(--text); }
.contact-socials { margin-top: 36px; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
    border-top: 1px solid var(--line);
    padding: 26px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: min(var(--max), 90%);
    margin: 0 auto;
}
.footer span { font-size: 12px; color: var(--faint); }
.footer-hint { opacity: .6; }

/* ============================================================
   Easter-egg game modal
   ============================================================ */
.game-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.game-modal[hidden] { display: none; }
.game-backdrop { position: absolute; inset: 0; background: rgba(5,5,6,.85); backdrop-filter: blur(6px); }
.game-window {
    position: relative;
    background: var(--bg-elev);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.8);
    width: min(680px, 100%);
    overflow: hidden;
    animation: gameIn .35s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes gameIn { from { opacity:0; transform: scale(.93) translateY(14px);} to { opacity:1; transform:none;} }
.game-titlebar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 14px;
    font-size: 12.5px;
    color: var(--muted);
    background: var(--bg-elev-2);
    border-bottom: 1px solid var(--line);
}
.game-close {
    background: none; border: 1px solid var(--line-2); border-radius: 6px;
    color: var(--muted); width: 26px; height: 26px; cursor: pointer;
    transition: color .2s, border-color .2s;
}
.game-close:hover { color: #ff6b6b; border-color: #ff6b6b; }
#game-canvas { display: block; width: 100%; height: auto; background: var(--bg); touch-action: manipulation; }
.game-help { text-align: center; font-size: 11px; color: var(--faint); padding: 9px; letter-spacing: 1px; border-top: 1px solid var(--line); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; gap: 40px; }
    .hero-portrait { order: -1; justify-content: flex-start; }
    .hero-portrait img { width: min(220px, 60%); }
    .about-inner { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 720px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
    .nav-right { gap: 14px; }
    .nav-links.open {
        display: flex;
        position: fixed;
        inset: var(--nav-h) 0 auto 0;
        flex-direction: column;
        gap: 0;
        background: rgba(10,10,11,.97);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--line);
        padding: 8px 5%;
    }
    .nav-links.open .nav-link { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
    .nav-links.open .nav-link::after { display: none; }

    .work-grid { grid-template-columns: 1fr; }
    .section { padding: 72px 0; }
    .footer { flex-direction: column; gap: 8px; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .reveal { opacity: 1; transform: none; }
}
