/* ========================================
   KARTIK SAHU — PORTFOLIO v6
   Monochrome / Interstellar Cinematic
   ======================================== */

:root {
    --bg-deep:       #000000;
    --bg-dark:       rgba(9, 9, 11, 0.4);
    --bg-section:    rgba(24, 24, 27, 0.4);
    --surface:       #27272a;
    --border:        rgba(255, 255, 255, 0.1);
    --text-primary:  #ffffff;
    --text-secondary:#a1a1aa;
    --text-dim:      #71717a;
    --accent:        #ffffff;
    --accent-glow:   #d4d4d8;
    --accent-warm:   #a1a1aa;
    --accent-purple: #e4e4e7;
    --font-heading:  'Space Grotesk', sans-serif;
    --font-body:     'Inter', sans-serif;
    --font-mono:     'JetBrains Mono', monospace;
}

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

html {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-deep);
    overscroll-behavior: none;
    overflow-x: hidden;
    width: 100%;
    scroll-padding-top: 90px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    overflow-x: hidden;
    width: 100%;
    position: relative;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeSpeed;
    -webkit-tap-highlight-color: transparent;
}
body.nav-open { overflow: hidden; }
a, button { -webkit-tap-highlight-color: transparent; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 60px); }

/* ======== SCROLL PROGRESS ======== */
.scroll-progress {
    position: fixed; top: 0; left: 0; width: 100%; height: 2px;
    z-index: 10001; background: transparent;
}
.scroll-progress-bar {
    height: 100%; width: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-purple), var(--accent-warm));
    transform-origin: left;
    transform: scaleX(0);
}

/* ======== LOADER ======== */
#loader {
    position: fixed; inset: 0; z-index: 20000;
    background: var(--bg-deep);
    display: flex; align-items: center; justify-content: center;
}
.loader-content { text-align: center; }
.loader-text { margin-bottom: 40px; }
.loader-line {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(18px, 3vw, 28px);
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateY(20px);
}
.loader-bar {
    width: 200px; height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0 auto 16px;
    border-radius: 1px;
    overflow: hidden;
}
.loader-bar-fill {
    width: 0%; height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-purple));
}
.loader-percent {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.1em;
}

/* ======== NAV — manga masthead ======== */
:root {
    --nav-ink:   #17150F;
    --nav-paper: #E3DCCB;
    --nav-blood: #B8202A;
}

#mainNav {
    position: fixed;
    top: 18px; left: 50%;
    transform: translateX(-50%) translateY(-180%);
    z-index: 10000;
    padding: 10px 12px 10px 22px;
    display: flex;
    align-items: center;
    gap: 32px;
    background: var(--nav-paper);
    border: 3px solid var(--nav-ink);
    border-radius: 0;
    box-shadow: 6px 6px 0 var(--nav-ink);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
#mainNav.visible { transform: translateX(-50%) translateY(0); }

.nav-logo {
    font-family: 'Anton', 'Arial Black', sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    color: var(--nav-ink);
    text-decoration: none;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
    font-family: 'Zen Kaku Gothic New', 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--nav-ink);
    text-decoration: none;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding-bottom: 3px;
    border-bottom: 3px solid transparent;
    transition: color 0.18s ease, border-color 0.18s ease;
}
.nav-links a:hover { color: var(--nav-blood); border-color: var(--nav-blood); transform: none; }

.nav-resume-link {
    font-family: 'Anton', 'Arial Black', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--nav-paper);
    background: var(--nav-ink);
    border: 3px solid var(--nav-ink);
    border-radius: 0;
    padding: 8px 18px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--nav-blood);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.nav-resume-link:hover {
    background: var(--nav-blood);
    border-color: var(--nav-blood);
    color: #fff;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--nav-ink);
}

/* hamburger — inked bars */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 48px; height: 48px;
    padding: 12px;
    background: transparent;
    border: 0;
    cursor: pointer;
    border-radius: 0;
}
.nav-toggle span {
    display: block;
    width: 24px; height: 3px;
    border-radius: 0;
    background: var(--nav-ink);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
}
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-backdrop {
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(10, 9, 6, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
    #mainNav, .nav-toggle span, .nav-resume-link { transition: none; }
}

/* ======== HERO — manga splash page ======== */
#hero {
    --ink:      #17150F;   /* warm near-black line work */
    --paper:    #E3DCCB;   /* dimmed newsprint, easy on the eyes */
    --paper-dk: #D3CAB5;   /* recessed fields */
    --blood:    #B8202A;   /* muted print red, no glare */
    --mg-display: 'Anton', 'Arial Black', sans-serif;
    --mg-body:    'Zen Kaku Gothic New', 'Inter', sans-serif;

    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100svh;
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    overflow: hidden;
    border-bottom: 6px solid var(--ink);
}

/* --- the video, inked into a screentoned manga frame --- */
#hero .hero-frame {
    position: absolute;
    top: clamp(84px, 13vh, 128px);
    right: 0;
    bottom: clamp(64px, 10vh, 104px);
    left: 42%;
    z-index: 1;
    border: 5px solid var(--ink);
    border-right: 0;
    overflow: hidden;
    box-shadow: -10px 10px 0 var(--ink);
}
#hero .hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* high-contrast black and white so it reads as inked artwork */
    filter: grayscale(1) contrast(1.75) brightness(1.06);
    pointer-events: none;
}
/* halftone screentone laid over the footage */
#hero .hero-tone {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(11,11,11,0.55) 1.5px, transparent 1.7px),
        radial-gradient(circle at 50% 50%, rgba(11,11,11,0.3) 1.1px, transparent 1.3px);
    background-size: 7px 7px, 7px 7px;
    background-position: 0 0, 3.5px 3.5px;
    mix-blend-mode: multiply;
    opacity: 0.75;
}

/* --- nav --- */
#hero .hero-nav {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 80rem;
    margin: 0 auto;
    padding: 26px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
#hero .hero-nav-logo {
    font-family: var(--mg-display);
    font-size: 26px;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
}
#hero .hero-nav-links { display: none; gap: 26px; align-items: center; }
#hero .hero-nav-links a {
    font-family: var(--mg-body);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    padding-bottom: 3px;
    border-bottom: 3px solid transparent;
    transition: border-color 0.18s ease, color 0.18s ease;
}
#hero .hero-nav-links a:hover,
#hero .hero-nav-links a.is-active { color: var(--blood); border-color: var(--blood); transform: none; }
#hero .hero-nav-cta {
    font-family: var(--mg-display);
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--ink);
    border: 3px solid var(--ink);
    border-radius: 0;
    padding: 9px 22px;
    cursor: pointer;
    box-shadow: 5px 5px 0 var(--blood);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
#hero .hero-nav-cta:hover {
    background: var(--blood);
    border-color: var(--blood);
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 var(--ink);
}

/* --- headline block, set over the paper on the left --- */
#hero .hero-content {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    max-width: 80rem;
    width: 100%;
    margin: 0 auto;
    padding: 20px 32px clamp(48px, 9vh, 96px);
}
#hero .hero-kicker {
    display: inline-block;
    font-family: var(--mg-body);
    font-weight: 900;
    font-size: 12px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--blood);
    padding: 5px 12px;
    margin-bottom: 18px;
    transform: rotate(-1.4deg);
}
#hero .hero-title {
    margin: 0;
    max-width: 12ch;
    font-family: var(--mg-display);
    font-weight: 400;
    font-size: clamp(46px, 8.4vw, 122px);
    line-height: 0.9;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    color: var(--ink);
    text-shadow: 5px 5px 0 var(--blood);
}
#hero .hero-title em {
    font-style: normal;
    color: var(--blood);
    text-shadow: 5px 5px 0 var(--ink);
}
#hero .hero-subtext {
    margin: 26px 0 0;
    max-width: 34ch;
    font-family: var(--mg-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.85;
    letter-spacing: 0;
    color: #1B1B1B;
    background: var(--paper);
    box-shadow: 0 0 0 10px var(--paper);
}
#hero .hero-cta-glass {
    display: inline-block;
    margin-top: 40px;
    font-family: var(--mg-display);
    font-size: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--ink);
    border: 3px solid var(--ink);
    border-radius: 0;
    padding: 14px 34px;
    text-decoration: none;
    box-shadow: 6px 6px 0 var(--blood);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
#hero .hero-cta-glass:hover {
    background: var(--blood);
    border-color: var(--blood);
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 var(--ink);
}

/* --- entrance --- */
@keyframes fade-rise {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-rise         { animation: fade-rise 0.8s ease-out both; }
.animate-fade-rise-delay   { animation: fade-rise 0.8s ease-out 0.2s both; }
.animate-fade-rise-delay-2 { animation: fade-rise 0.8s ease-out 0.4s both; }

@media (min-width: 768px) { #hero .hero-nav-links { display: flex; } }

/* stack the frame under the type on small screens */
@media (max-width: 899px) {
    #hero { min-height: auto; }
    #hero .hero-frame {
        position: relative;
        top: auto; right: auto; bottom: auto; left: auto;
        height: 46svh;
        margin: 0 0 0 24px;
        border-right: 0;
        box-shadow: -8px 8px 0 var(--ink);
        order: 3;
    }
    #hero .hero-content { padding-bottom: 36px; }
    #hero .hero-subtext { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
    .animate-fade-rise,
    .animate-fade-rise-delay,
    .animate-fade-rise-delay-2 { animation: none; }
    #hero .hero-cta-glass, #hero .hero-nav-cta { transition: none; }
}

/* ======== STATEMENT ======== */
#statement {
    padding: 160px 0;
    background: var(--bg-deep);
    content-visibility: auto;
    contain-intrinsic-size: auto 600px;
}
.statement-text {
    font-family: var(--font-heading);
    font-size: clamp(24px, 4vw, 48px);
    font-weight: 300;
    line-height: 1.4;
    color: var(--text-dim);
    max-width: 900px;
}
.statement-text strong { color: var(--text-primary); font-weight: 500; }
.statement-text .word { display: inline-block; transition: color 0.3s ease-out; }
.statement-text .word.active { color: var(--text-primary); }

/* ======== SECTION SHARED ======== */
.section-header { margin-bottom: 80px; }
.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.section-title {
    font-family: var(--font-heading);
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
}

/* ======== PROJECTS (video showcase) ======== */
#projects {
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --pj-accent: #F598F2;
    --font-figtree: 'Figtree', var(--font-body), sans-serif;

    position: relative;
    width: 100%;
    min-height: 100svh;
    padding: 0;
    background: #000;
    overflow-x: clip;
    isolation: isolate;
}

/* --- crossfading project screenshots as the backdrop --- */
#projects .pj-bgs { position: absolute; inset: 0; z-index: 0; }
#projects .pj-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 1200ms ease-in-out;
    pointer-events: none;
}
#projects .pj-bg.is-active { opacity: 1; }

/* keeps the overlaid type legible on top of bright UI screenshots */
#projects .pj-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.55) 45%, rgba(0,0,0,0.45) 100%);
    pointer-events: none;
}

/* --- content shell --- */
#projects .pj-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1340px;
    min-height: 100svh;
    margin: 0 auto;
    padding: clamp(110px, 16vh, 190px) 15px 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: clamp(40px, 9vh, 150px);
    font-family: var(--font-figtree);
}

/* --- top row: switcher + status --- */
#projects .pj-top { display: flex; align-items: flex-start; gap: 24px; }
#projects .pj-switcher { flex: 4; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

#projects .pj-role {
    display: flex;
    align-items: baseline;
    gap: 8px;
    background: none;
    border: 0;
    padding: 0;
    color: #fff;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.3s ease, transform 0.3s var(--ease-spring);
}
#projects .pj-role:hover { opacity: 0.75; transform: translateX(4px); }
#projects .pj-role.is-active { opacity: 1; }
#projects .pj-idx {
    font-size: 8px;
    line-height: 12px;
    letter-spacing: -0.08px;
    font-weight: 500;
    text-transform: uppercase;
}
#projects .pj-sep { font-size: 10px; opacity: 0.6; }
#projects .pj-role-label {
    font-size: 12px;
    line-height: 16px;
    letter-spacing: -0.12px;
    font-weight: 500;
    text-transform: uppercase;
}

#projects .pj-aside {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    min-width: 0;
}
#projects .pj-preview {
    width: 100%;
    max-width: 360px;
    aspect-ratio: 16 / 10;
    border: 1px solid rgba(255, 255, 255, 0.35);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
}
#projects .pj-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease;
}
#projects .pj-preview-img.is-loaded { opacity: 1; }

#projects .pj-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: -0.12px;
    font-weight: 500;
    text-transform: uppercase;
    color: #fff;
    align-self: flex-end;
}
#projects .pj-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: none;
    background: var(--pj-accent);
    box-shadow: 0 0 10px 2px rgba(245, 152, 242, 0.7);
    animation: dotPulse 1.6s ease-in-out infinite;
}
/* slides 2-3 use a white dot */
#projects.pj-white .pj-dot {
    background: #fff;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.7);
}

/* --- bottom row: name + detail --- */
#projects .pj-bottom { display: flex; align-items: flex-end; padding-bottom: clamp(32px, 6vh, 60px); }
#projects .pj-name-col { flex: 2; min-width: 0; }
#projects .pj-detail-col { flex: 1; padding-left: 50px; }

#projects .pj-name {
    margin: 0;
    font-family: var(--font-figtree);
    font-size: 200px;           /* JS shrinks this to fit long names */
    line-height: 81%;
    letter-spacing: -6px;
    font-weight: 500;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}
#projects .pj-accent { color: var(--pj-accent); }
#projects.pj-white .pj-accent { color: #fff; }

#projects .pj-desc {
    margin: 0;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: -0.16px;
    font-weight: 500;
    color: #fff;
}
#projects .pj-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
#projects .pj-tags span {
    font-size: 11px;
    line-height: 16px;
    letter-spacing: 0.02em;
    font-weight: 500;
    text-transform: uppercase;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    padding: 5px 12px;
}

#projects .pj-cta {
    position: relative;
    display: inline-block;
    overflow: hidden;
    margin-top: 28px;
    padding: 14px 32px;
    border: 1px solid #fff;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.14px;
    color: #fff;
    text-decoration: none;
    text-transform: lowercase;
    transition: color 0.45s var(--ease-spring), border-color 0.45s var(--ease-spring);
}
#projects .pj-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--pj-accent);
    transform: translateY(101%);
    transition: transform 0.45s var(--ease-spring);
    z-index: 0;
}
#projects .pj-cta span { position: relative; z-index: 1; }
#projects .pj-cta:hover { color: #000; border-color: var(--pj-accent); }
#projects .pj-cta:hover::before { transform: translateY(0); }

/* --- reveal animations (triggered by .is-revealed) --- */
@keyframes revealUp {
    from { opacity: 0; transform: translateY(80px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes revealRight {
    from { opacity: 0; transform: translateX(100px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(1.45); }
}

#projects .reveal-up,
#projects .reveal-right { opacity: 0; }
#projects.is-revealed .reveal-up {
    animation: revealUp 0.9s var(--ease-spring) both;
}
#projects.is-revealed .reveal-right {
    animation: revealRight 0.9s var(--ease-spring) both;
}
#projects.is-revealed .pj-tags.reveal-right { animation-delay: 0.05s; }
#projects.is-revealed .pj-cta.reveal-right  { animation-delay: 0.08s; }

/* --- tablet 810-1199 --- */
@media (min-width: 810px) and (max-width: 1199.98px) {
    #projects .pj-inner { padding: 150px 18px 0; gap: 90px; }
    #projects .pj-name { font-size: 129.6px; line-height: 113.4px; letter-spacing: -7.7px; }
    #projects .pj-bottom { gap: 28px; padding-bottom: 52px; }
    #projects .pj-detail-col { padding-left: 24px; }
    #projects .pj-preview { max-width: 280px; }
}

/* --- mobile < 810 --- */
@media (max-width: 809.98px) {
    #projects .pj-inner {
        justify-content: flex-end;
        align-items: flex-start;
        gap: 72px;
        padding: 140px 18px 0;
    }
    #projects .pj-top { flex-direction: column; gap: 28px; }
    #projects .pj-aside { align-items: flex-start; width: 100%; }
    #projects .pj-preview { max-width: 100%; }
    #projects .pj-status { align-self: flex-start; }
    #projects .pj-bottom { flex-direction: column; align-items: flex-start; gap: 32px; padding-bottom: 44px; }
    #projects .pj-detail-col { padding-left: 0; }
    #projects .pj-name {
        font-size: clamp(48px, 21vw, 80px);
        line-height: 96%;
        letter-spacing: -4.8px;
    }
    #projects .pj-desc { max-width: 420px; }
}

@media (prefers-reduced-motion: reduce) {
    #projects .pj-bg { transition: none; }
    #projects .pj-preview-img { transition: none; opacity: 1; }
    #projects .pj-dot { animation: none; }
    #projects .reveal-up,
    #projects .reveal-right { opacity: 1; }
    #projects.is-revealed .reveal-up,
    #projects.is-revealed .reveal-right { animation: none; }
}

/* ======== ABOUT ======== */
#about {
    padding: 120px 0;
    background: var(--bg-dark);
    content-visibility: auto;
    contain-intrinsic-size: auto 800px;
}
.about-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.about-bio { font-size: 16px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 20px; }
.about-stats { display: flex; gap: 40px; margin-top: 40px; }
.stat { text-align: left; }
.stat-number {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}
.stat-plus { font-family: var(--font-heading); font-size: 32px; font-weight: 300; color: var(--accent); }
.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 8px;
}
.about-right { display: flex; align-items: center; justify-content: center; }
.about-visual {
    position: relative;
    width: 320px; height: 320px;
    display: flex; align-items: center; justify-content: center;
}
.about-ring { position: absolute; border-radius: 50%; border: 1px solid; }
.about-ring-1 { width: 100%; height: 100%; border-color: rgba(255, 255, 255, 0.1); animation: orbitSpin 20s linear infinite; }
.about-ring-2 { width: 75%; height: 75%; border-color: rgba(123, 47, 255, 0.12); animation: orbitSpin 15s linear infinite reverse; }
.about-ring-3 { width: 50%; height: 50%; border-color: rgba(255, 107, 53, 0.1); animation: orbitSpin 10s linear infinite; }
@keyframes orbitSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* centre mark inside the orbital rings */
.about-core {
    position: relative;
    z-index: 1;
    width: 64%;
    height: 64%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.about-core img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    /* faint glow so the mark reads as lit, not pasted on */
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.16));
    animation: coreFloat 6s ease-in-out infinite;
}
@keyframes coreFloat {
    0%, 100% { transform: scale(1); opacity: 0.94; }
    50%      { transform: scale(1.04); opacity: 1; }
}
.about-core-fallback {
    display: none;
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 700;
    color: var(--text-primary);
}
.about-core.no-mark .about-core-fallback { display: block; }

/* ======== EXPERIENCE ======== */
#experience {
    padding: 120px 0;
    background: var(--bg-dark);
    content-visibility: auto;
    contain-intrinsic-size: auto 700px;
}
.timeline { position: relative; padding-left: 40px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-purple), transparent);
}
.timeline-item { position: relative; padding-bottom: 60px; opacity: 0; transform: translateX(-20px); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
    position: absolute;
    left: -44px; top: 6px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--accent);
}
.timeline-date { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.1em; }
.timeline-content h3 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 600;
    margin: 8px 0 12px;
}
.timeline-content p { font-size: 15px; color: var(--text-secondary); line-height: 1.7; max-width: 600px; }

/* ======== CONTACT ======== */
#contact {
    padding: 120px 0;
    background: var(--bg-deep);
    content-visibility: auto;
    contain-intrinsic-size: auto 700px;
}
.contact-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 80px; }
.contact-info p { font-size: 18px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 32px; }
.contact-links { display: flex; flex-direction: column; gap: 12px; }
.contact-links a {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color 0.3s;
}
.contact-links a:hover { color: #fff; }
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.form-group input,
.form-group textarea {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-primary);
    background: rgba(15, 0, 53, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
    outline: none;
    transition: border-color 0.3s;
}
.form-group input:focus,
.form-group textarea:focus { border-color: rgba(255, 255, 255, 0.3); }
.form-group textarea { resize: vertical; min-height: 120px; }
.submit-btn {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--bg-deep);
    background: var(--accent);
    border: none;
    border-radius: 100px;
    padding: 16px 36px;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.3s;
    align-self: flex-start;
}
.submit-btn:hover { background: #fff; }
.submit-btn span { margin-left: 8px; }

/* ======== FOOTER ======== */
footer { padding: 60px 0; background: var(--bg-deep); border-top: 1px solid var(--border); }
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-name { font-family: var(--font-heading); font-size: 16px; font-weight: 600; }
.footer-copy { font-size: 13px; color: var(--text-dim); }
.footer-quote { font-size: 12px; color: var(--text-dim); font-style: italic; }

/* ==================== RESUME MODAL ==================== */
.resume-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.resume-modal.active { display: flex; }
.resume-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 0, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.resume-modal.active .resume-modal-overlay { opacity: 1; }
.resume-modal-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95) translateY(30px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.resume-modal.active .resume-modal-container { opacity: 1; transform: none; }
.resume-modal-close {
    position: absolute;
    top: 8px; right: 10px;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    line-height: 1;
    font-weight: 300;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}
.resume-modal-close:hover { color: var(--text-primary); }
.resume-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 66px 16px 24px;
    background: rgba(6, 0, 26, 0.5);
    border-bottom: 1px solid var(--border);
}
.resume-print-btn {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--bg-deep);
    background: var(--accent);
    border: 1px solid var(--accent);
    padding: 10px 20px;
    border-radius: 100px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-height: 44px;
    transition: all 0.3s ease;
}
.resume-print-btn:hover {
    background: transparent;
    color: var(--accent);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.45);
}
.resume-paper {
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: clamp(24px, 6vw, 64px);
    background: #f8f9fa;
    color: #2c3e50;
}
.resume-header {
    text-align: center;
    border-bottom: 2px solid #cbd5e1;
    padding-bottom: 24px;
    margin-bottom: 32px;
}
.resume-header h1 {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #0f172a;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.resume-contact {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(12px, 3vw, 32px);
    font-size: 13px;
    color: #475569;
    font-family: var(--font-body);
    font-weight: 500;
}
.resume-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    text-decoration: none;
    transition: color 0.2s;
}
.resume-contact-link:hover { color: #0f172a; }
.resume-contact-icon { width: 14px; height: 14px; flex-shrink: 0; }
.resume-body-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; }
.resume-section { margin-bottom: 26px; }
.resume-section-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0f172a;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 6px;
    margin-bottom: 14px;
}
.resume-item { margin-bottom: 18px; }
.resume-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.resume-item-title { font-size: 15px; font-weight: 700; color: #0f172a; }
.resume-item-date { font-family: var(--font-mono); font-size: 12px; color: #64748b; white-space: nowrap; }
.resume-item-sub { font-size: 12.5px; color: #475569; font-weight: 600; font-style: italic; margin-top: 2px; }
.resume-item-loc { font-size: 12px; color: #64748b; }
.resume-bullets { margin: 8px 0 0 18px; }
.resume-bullets li { font-size: 12.5px; line-height: 1.55; color: #334155; margin-bottom: 5px; }
.resume-skills-table { width: 100%; border-collapse: collapse; }
.resume-skills-table td { font-size: 12.5px; color: #334155; padding: 4px 0; vertical-align: top; line-height: 1.5; }
.resume-skills-table td:first-child { width: 34%; color: #0f172a; padding-right: 8px; }

/* ======== RESPONSIVE ======== */

/* no sticky hover states on touch devices */
@media (hover: none) {
}

/* ---- tablet / below the desktop horizontal pin ---- */
@media (max-width: 1023px) {
    .about-layout { grid-template-columns: 1fr; gap: 48px; text-align: center; }
    .about-stats { justify-content: center; }
    .about-right { margin-top: 8px; }
    .contact-layout { grid-template-columns: 1fr; gap: 48px; }
    .footer-content { flex-direction: column; gap: 12px; text-align: center; }
    .resume-body-grid { grid-template-columns: 1fr; gap: 32px; }

    /* GSAP horizontal pin is desktop-only — native swipe carousel here */
    .projects-grid {
        width: max-content;
        padding: 24px 5vw;
        gap: 20px;
        transform: none !important;
    }
}

/* ---- phones ---- */
@media (max-width: 768px) {
    #mainNav {
        top: calc(env(safe-area-inset-top, 0px) + 10px);
        left: 12px; right: 12px;
        width: auto;
        transform: translateY(0);
        justify-content: space-between;
        gap: 0;
        padding: 8px 8px 8px 16px;
        box-shadow: 4px 4px 0 var(--nav-ink);
    }
    #mainNav.visible { transform: translateY(0); }
    .nav-logo { font-size: 20px; }
    .nav-toggle { display: flex; }

    .nav-links {
        position: fixed;
        top: 0; right: 0;
        height: 100vh;
        height: 100dvh;
        width: min(84vw, 360px);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: calc(env(safe-area-inset-top, 0px) + 96px) 26px
                 calc(env(safe-area-inset-bottom, 0px) + 32px);
        background: var(--nav-paper);
        border-left: 4px solid var(--nav-ink);
        box-shadow: none;
        transform: translateX(105%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 9999;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    body.nav-open .nav-links { transform: translateX(0); }

    .nav-links a {
        display: flex;
        align-items: center;
        min-height: 56px;              /* comfortable tap target */
        font-family: 'Anton', 'Arial Black', sans-serif;
        font-size: 26px;
        font-weight: 400;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--nav-ink);
        padding: 6px 0;
        width: 100%;
        border-bottom: 3px solid rgba(23, 21, 15, 0.18);
    }
    .nav-links a:active { color: var(--nav-blood); }
    .nav-links a:hover { transform: none; border-bottom-color: rgba(23, 21, 15, 0.18); }

    .nav-resume-link {
        margin-top: 24px;
        width: 100%;
        min-height: 56px;
        font-size: 18px;
        padding: 14px 24px;
        box-shadow: 5px 5px 0 var(--nav-blood);
    }

    /* the hero already carries its own nav on desktop — one bar is enough here */
    #hero .hero-nav-links { display: none; }
    #hero .hero-nav { padding: 20px 20px; }
    #hero .hero-nav-logo { font-size: 21px; }
    #hero .hero-nav-cta { font-size: 13px; padding: 10px 16px; min-height: 44px; }

    .form-row { grid-template-columns: 1fr; }
    .about-stats { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 28px 40px; }

    #statement { padding: 96px 0; }
    #projects, #about, #experience, #contact { padding: 80px 0; }
    .section-header { margin-bottom: 48px; }


    .form-group input, .form-group textarea { font-size: 16px; } /* no iOS zoom */
    .submit-btn { align-self: stretch; text-align: center; }

    .resume-modal { padding: 0; align-items: flex-end; }
    .resume-modal-container { width: 100%; max-width: none; max-height: 92vh; max-height: 92dvh; border-radius: 20px 20px 0 0; }
    .resume-contact { flex-direction: column; gap: 8px; align-items: flex-start; }
}

/* ---- small phones ---- */
@media (max-width: 480px) {
    .container { padding: 0 20px; }




    .about-visual { width: 240px; height: 240px; }
    .about-core { font-size: 32px; }
    .stat-number { font-size: 40px; }

    .timeline { padding-left: 28px; }
    .timeline-marker { left: -32px; }

    .resume-header h1 { font-size: 26px; }
}

/* ======== PRINT (résumé only) ======== */
@media print {
    body > *:not(.resume-modal) { display: none !important; }
    .resume-modal { position: static; display: block !important; padding: 0; }
    .resume-modal-overlay, .resume-modal-actions, .resume-modal-close { display: none !important; }
    .resume-modal-container {
        position: static; max-width: none; max-height: none;
        border: 0; border-radius: 0; box-shadow: none;
        opacity: 1; transform: none; background: #fff;
    }
    .resume-paper { overflow: visible; padding: 0; background: #fff; }
    .resume-body-grid { grid-template-columns: 1.5fr 1fr; gap: 28px; }
}

/* ==================================================================
   404 SCREEN
   ================================================================== */
@font-face {
    font-family: "Geist Mono:SemiBold";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("https://static.figma.com/font/GeistMono_wght__1") format("woff2");
}

main.nf-page {
    position: relative;
    display: block;
    width: 100%;
    min-height: 100svh;
    margin: 0;
    padding: 0;
    background: #000;
    overflow-x: hidden;
}

main.nf-page .nf-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    z-index: 0;
    pointer-events: none;
}

/* ---- header logo ---- */
main.nf-page .nf-brand {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    transform-origin: top center;
    z-index: 1;
    width: 233px;
    height: 40px;
}

main.nf-page .nf-brand-mark {
    position: absolute;
    left: 0;
    top: 0;
    width: 54px;
    height: 40px;
    display: block;
}

/* logotype sits 14px right of the mark (54 + 14 = 68) and fills the
   remaining 165px. Source viewBox is 0 0 164.311 100 while the glyphs
   only occupy y 34-56, so it is optically re-centred here. */
main.nf-page .nf-brand-type {
    position: absolute;
    left: 68px;
    top: 50%;
    width: 165px;
    height: 100.42px;
    display: block;
    overflow: visible;
    transform: translateY(-50%) translateY(5px);
}

/* ---- centred content ---- */
main.nf-page .nf-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 483px;
    max-width: calc(100% - 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 44px;
}

main.nf-page .nf-404 {
    margin: 0;
    font-family: "Geist Mono:SemiBold", ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-weight: 600;
    font-style: normal;
    font-size: 295.751px;
    line-height: 1.1;
    letter-spacing: -24.6459px;
    text-align: center;
    text-indent: 24.6459px;
    text-transform: none;
    padding-bottom: 0.14em;
    height: auto;
    min-height: 0;
    overflow: visible;
    background-image: linear-gradient(
        247.3282658084845deg,
        rgb(255, 255, 255) 2.5334%,
        rgba(255, 255, 255, 0.4) 93.612%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

main.nf-page .nf-divider {
    width: 425px;
    max-width: 100%;
    height: 1px;
    background-color: #fff;
    border: 0;
    border-radius: 0;
    margin: 0;
    flex: none;
}

main.nf-page .nf-message {
    margin: 0;
    width: 100%;
    max-width: none;
    font-family: "Geist Mono:SemiBold", ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-weight: 600;
    font-style: normal;
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: -2px;
    color: #fff;
    text-align: center;
}

@media (max-width: 640px) {
    main.nf-page .nf-brand {
        top: 32px;
        transform: translateX(-50%) scale(0.75);
    }
    main.nf-page .nf-content {
        width: min(100% - 40px, 360px);
        max-width: min(100% - 40px, 360px);
        gap: 28px;
    }
    main.nf-page .nf-404 {
        font-size: clamp(140px, 52vw, 200px);
        letter-spacing: -0.09em;
        text-indent: 0.09em;
        height: auto;
        min-height: 0;
        padding-bottom: 0.16em;
    }
    main.nf-page .nf-divider { width: 100%; }
    main.nf-page .nf-message {
        font-size: clamp(16px, 4.5vw, 20px);
        letter-spacing: -1.3px;
    }
}


/* ==================================================================
   404-SCREEN THEME — applied from #about through to the 404 page.
   Flat black, Geist Mono SemiBold, hairline white rules, gradient
   headings. No cards, glass, tinted fills or coloured surfaces.
   ================================================================== */
#about,
#experience,
#contact,
footer {
    --rule: rgba(255, 255, 255, 0.28);
    --dim: rgba(255, 255, 255, 0.62);
    --mono404: "Geist Mono:SemiBold", var(--font-mono), ui-monospace, monospace;

    background: #000;
    color: #fff;
    border-top: 1px solid var(--rule);
}

/* --- shared section headings --- */
#about .section-tag,
#experience .section-tag,
#contact .section-tag {
    font-family: var(--mono404);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 20px;
}
#about .section-title,
#experience .section-title,
#contact .section-title {
    font-family: var(--mono404);
    font-weight: 600;
    font-size: clamp(48px, 8vw, 96px);
    line-height: 1.1;
    letter-spacing: -0.06em;
    padding-bottom: 0.08em;
    background-image: linear-gradient(
        247.3282658084845deg,
        rgb(255, 255, 255) 2.5334%,
        rgba(255, 255, 255, 0.4) 93.612%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* --- ABOUT --- */
#about .about-bio {
    font-family: var(--mono404);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: -0.5px;
    color: var(--dim);
}
#about .about-stats { border-top: 1px solid var(--rule); padding-top: 32px; }
#about .stat-number,
#about .stat-plus {
    font-family: var(--mono404);
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.04em;
}
#about .stat-label {
    font-family: var(--mono404);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dim);
}
/* flat mark, no orbiting rings or glow */
#about .about-ring { display: none; }
#about .about-core {
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: 0;
    box-shadow: none;
    animation: none;
}
#about .about-core-fallback {
    font-family: var(--mono404);
    font-weight: 600;
    letter-spacing: -0.04em;
    color: #fff;
}

/* --- EXPERIENCE --- */
#experience { background: #000; }
#experience .timeline-marker {
    background: #fff;
    border: 0;
    border-radius: 0;
    width: 7px;
    height: 7px;
    box-shadow: none;
}
#experience .timeline { border-left: 1px solid var(--rule); }
#experience .timeline-date {
    font-family: var(--mono404);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dim);
}
#experience .timeline-content h3 {
    font-family: var(--mono404);
    font-weight: 600;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -1px;
    color: #fff;
}
#experience .timeline-content p {
    font-family: var(--mono404);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.7;
    letter-spacing: -0.4px;
    color: var(--dim);
}

/* --- CONTACT --- */
#contact .contact-info p {
    font-family: var(--mono404);
    font-weight: 600;
    font-size: 16px;
    line-height: 1.7;
    letter-spacing: -0.6px;
    color: var(--dim);
}
#contact .contact-links a {
    font-family: var(--mono404);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.4px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 2px;
    transition: border-color 0.3s ease;
}
#contact .contact-links a:hover { border-color: #fff; }

#contact .form-group label {
    font-family: var(--mono404);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--dim);
}
/* hairline underline fields instead of filled boxes */
#contact .form-group input,
#contact .form-group textarea {
    font-family: var(--mono404);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.4px;
    color: #fff;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--rule);
    border-radius: 0;
    padding: 12px 0;
    transition: border-color 0.3s ease;
}
#contact .form-group input::placeholder,
#contact .form-group textarea::placeholder { color: rgba(255, 255, 255, 0.35); }
#contact .form-group input:focus,
#contact .form-group textarea:focus {
    outline: none;
    border-bottom-color: #fff;
    background: transparent;
    box-shadow: none;
}
#contact .submit-btn {
    font-family: var(--mono404);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: transparent;
    border: 1px solid #fff;
    border-radius: 0;
    padding: 16px 40px;
    box-shadow: none;
    transition: background 0.3s ease, color 0.3s ease;
}
#contact .submit-btn:hover {
    background: #fff;
    color: #000;
    transform: none;
    box-shadow: none;
}

/* --- FOOTER --- */
footer { padding: 48px 0; }
footer .footer-name,
footer .footer-copy,
footer .footer-quote {
    font-family: var(--mono404);
    font-weight: 600;
    letter-spacing: -0.4px;
    font-style: normal;
}
footer .footer-name { font-size: 14px; color: #fff; }
footer .footer-copy,
footer .footer-quote { font-size: 12px; color: var(--dim); }

/* the 404 screen closes the run — keep the seam consistent */
main.nf-page { border-top: 1px solid rgba(255, 255, 255, 0.28); }

/* ==================================================================
   EXPERIENCE — Atelier treatment applied to the section itself
   ================================================================== */
#experience {
    position: relative;
    overflow: hidden;
    background: #000;
    padding: clamp(90px, 14vh, 140px) 0;
}
#experience .ex-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}
/* keeps the timeline legible over moving footage */
#experience .ex-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.62);
    pointer-events: none;
}
#experience > .container { position: relative; z-index: 10; }

/* --- heading: Instrument Serif, italic connector --- */
#experience .section-tag {
    font-family: 'Inter', var(--font-body), sans-serif;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}
#experience .section-title {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: 1.875rem;
    line-height: 1.1;
    letter-spacing: 0;
    color: #fff;
    background: none;
    -webkit-text-fill-color: #fff;
    padding-bottom: 0;
    max-width: 64rem;
}
#experience .section-title .ex-i {
    font-style: italic;
    font-family: 'Instrument Serif', serif;
}
#experience .ex-sub {
    margin: 20px 0 0;
    font-family: 'Inter', var(--font-body), sans-serif;
    font-weight: 300;
    font-size: 0.875rem;
    line-height: 1.625;
    color: rgba(255, 255, 255, 0.7);
    max-width: 28rem;
}
#experience .ex-br { display: none; }

/* --- timeline in the Atelier voice --- */
#experience .timeline { border-left: 1px solid rgba(255, 255, 255, 0.2); }
#experience .timeline-marker {
    background: #fff;
    border: 0;
    border-radius: 0;
    width: 7px;
    height: 7px;
    box-shadow: none;
}
#experience .timeline-date {
    font-family: 'Inter', var(--font-body), sans-serif;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}
#experience .timeline-content h3 {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: clamp(26px, 3.4vw, 40px);
    line-height: 1.15;
    letter-spacing: 0;
    color: #fff;
}
#experience .timeline-content p {
    font-family: 'Inter', var(--font-body), sans-serif;
    font-weight: 300;
    font-size: 0.9375rem;
    line-height: 1.7;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.7);
}

/* --- actions --- */
#experience .ex-actions {
    margin-top: 56px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}
#experience .ex-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', var(--font-body), sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
    border-radius: 9999px;
    padding: 12px 28px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
#experience .ex-btn-primary { background: #fff; color: #000; border: 1px solid #fff; }
#experience .ex-btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
#experience .ex-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
    transform: none;
    box-shadow: none;
}
#experience .ex-icon { width: 16px; height: 16px; flex: none; }
#experience .ex-icon-arrow { transition: transform 0.2s ease; }
#experience .ex-btn-primary:hover .ex-icon-arrow { transform: translateX(2px); }

@media (min-width: 640px) {
    #experience .section-title { font-size: 2.25rem; }
    #experience .ex-br { display: block; }
    #experience .ex-actions { flex-direction: row; align-items: center; }
}
@media (min-width: 768px) {
    #experience .section-title { font-size: 3rem; }
    #experience .ex-sub { font-size: 1rem; }
}
@media (min-width: 1024px) { #experience .section-title { font-size: 3.75rem; } }
@media (min-width: 1280px) { #experience .section-title { font-size: 4.5rem; } }


/* ==================================================================
   MANGA PANEL THEME — #statement, #about, #contact + footer
   Black-and-white ink, halftone screentone, speed lines, one red accent.
   All texture is CSS gradients — no image assets.
   ================================================================== */
#statement, #about, #contact, footer {
    --ink:      #17150F;   /* warm near-black line work */
    --paper:    #E3DCCB;   /* dimmed newsprint, easy on the eyes */
    --paper-dk: #D3CAB5;   /* recessed fields */
    --blood:    #B8202A;   /* muted print red, no glare */
    --mg-display: 'Anton', 'Arial Black', sans-serif;
    --mg-body:    'Zen Kaku Gothic New', 'Inter', sans-serif;

    position: relative;
    background: var(--paper);
    color: var(--ink);
    border-top: 6px solid var(--ink);
    overflow: hidden;
}
#statement, #about, #contact { padding: 110px 0; }

/* --- halftone screentone: two offset dot grids --- */
.mg-panel-tone::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(11,11,11,0.42) 1.4px, transparent 1.6px),
        radial-gradient(circle at 50% 50%, rgba(11,11,11,0.22) 1px, transparent 1.2px);
    background-size: 8px 8px, 8px 8px;
    background-position: 0 0, 4px 4px;
    -webkit-mask-image: linear-gradient(150deg, #000 0%, transparent 62%);
    mask-image: linear-gradient(150deg, #000 0%, transparent 62%);
    opacity: 0.85;
}

/* --- radiating speed lines behind a section --- */
.mg-speedlines {
    position: absolute;
    inset: -20% -10%;
    z-index: 0;
    pointer-events: none;
    background: repeating-conic-gradient(
        from 0deg at 50% 45%,
        rgba(11, 11, 11, 0.16) 0deg 0.55deg,
        transparent 0.55deg 2.6deg
    );
    -webkit-mask-image: radial-gradient(ellipse at 50% 45%, transparent 26%, #000 72%);
    mask-image: radial-gradient(ellipse at 50% 45%, transparent 26%, #000 72%);
}
.mg-speedlines-alt {
    background: repeating-conic-gradient(
        from 0deg at 82% 12%,
        rgba(11, 11, 11, 0.14) 0deg 0.5deg,
        transparent 0.5deg 3.2deg
    );
    -webkit-mask-image: radial-gradient(ellipse at 82% 12%, transparent 12%, #000 66%);
    mask-image: radial-gradient(ellipse at 82% 12%, transparent 12%, #000 66%);
}
#statement > .container,
#about > .container,
#contact > .container,
footer > .container { position: relative; z-index: 2; }

/* --- the panel: hard ink border with a hand-inked offset shadow --- */
.mg-panel {
    position: relative;
    background: var(--paper);
    border: 4px solid var(--ink);
    border-radius: 0;
    padding: 34px 32px;
    box-shadow: 9px 9px 0 var(--ink);
    overflow: hidden;
}
.mg-panel-ink {
    background: var(--ink);
    color: var(--paper);
    box-shadow: 9px 9px 0 var(--blood);
}
.mg-panel-strip { padding: 26px 32px; }

/* gutter corners — the little ink ticks on a manga page */
.mg-corner {
    position: absolute;
    width: 14px;
    height: 14px;
    z-index: 3;
    pointer-events: none;
}
.mg-corner-tl { top: 8px; left: 8px; border-top: 3px solid currentColor; border-left: 3px solid currentColor; }
.mg-corner-br { bottom: 8px; right: 8px; border-bottom: 3px solid currentColor; border-right: 3px solid currentColor; }
.mg-panel .mg-corner { color: var(--ink); }
.mg-panel-ink .mg-corner { color: var(--paper); }

/* --- panel spreads --- */
.mg-spread { display: grid; gap: 34px; }
#about .about-layout.mg-spread { grid-template-columns: 1fr; align-items: stretch; }
#contact .contact-layout.mg-spread { grid-template-columns: 1fr; }
@media (min-width: 900px) {
    #about .about-layout.mg-spread { grid-template-columns: 1.55fr 1fr; }
    #about .about-stats.mg-panel-strip { grid-column: 1 / -1; }
    #contact .contact-layout.mg-spread { grid-template-columns: 1fr 1.25fr; align-items: start; }
}

/* --- typography --- */
#statement .statement-text,
#about .about-bio, #about .stat-label,
#contact .contact-info p, #contact .form-group label,
footer .footer-name, footer .footer-copy, footer .footer-quote {
    -webkit-text-fill-color: currentColor;
    background: none;
}

#about .section-tag,
#contact .section-tag {
    display: inline-block;
    font-family: var(--mg-body);
    font-weight: 900;
    font-size: 12px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--blood);
    padding: 5px 12px;
    margin-bottom: 16px;
    transform: rotate(-1.4deg);
}
#about .section-title,
#contact .section-title {
    font-family: var(--mg-display);
    font-weight: 400;
    font-size: clamp(44px, 8vw, 96px);
    line-height: 0.92;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--ink);
    background: none;
    -webkit-text-fill-color: var(--ink);
    padding-bottom: 0;
    margin-bottom: 22px;
    text-shadow: 4px 4px 0 var(--blood);
}

#statement .statement-text {
    font-family: var(--mg-display);
    font-weight: 400;
    font-size: clamp(26px, 3.6vw, 50px);
    line-height: 1.18;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    color: var(--ink);
    position: relative;
    z-index: 2;
}
#statement .statement-text strong {
    font-weight: 400;
    color: var(--blood);
    -webkit-text-stroke: 0;
}
#statement .statement-text .word.active { color: var(--ink); }

#about .about-bio,
#contact .contact-info p {
    font-family: var(--mg-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.85;
    letter-spacing: 0;
    color: #1B1B1B;
    position: relative;
    z-index: 2;
}
#about .about-bio + .about-bio { margin-top: 16px; }

/* --- portrait panel --- */
.mg-portrait {
    position: relative;
    z-index: 2;
    height: 100%;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mg-portrait img {
    width: 62%;
    max-width: 200px;
    height: auto;
    display: block;
    /* the source is a white mark on a black plate — screen drops the black
       out against the ink panel so the mark reads instead of vanishing */
    filter: grayscale(1) contrast(1.35) brightness(1.15);
    mix-blend-mode: screen;
    animation: none;
}
#about .mg-portrait .about-core-fallback {
    display: none;
    font-family: var(--mg-display);
    font-size: 72px;
    color: var(--paper);
}
#about .mg-portrait.no-mark .about-core-fallback { display: block; }

/* --- stats strip --- */
#about .about-stats.mg-panel-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0;
    margin: 0;
    border-top: 4px solid var(--ink);
}
#about .about-stats .stat {
    position: relative;
    z-index: 2;
    padding: 6px 22px;
    text-align: left;
}
#about .about-stats .stat + .stat { border-left: 3px solid var(--ink); }
#about .stat-number {
    font-family: var(--mg-display);
    font-weight: 400;
    font-size: 52px;
    line-height: 1;
    color: var(--ink);
}
#about .stat-plus {
    font-family: var(--mg-display);
    font-size: 30px;
    color: var(--blood);
}
#about .stat-label {
    display: block;
    font-family: var(--mg-body);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #3A3A3A;
    margin-top: 8px;
}

/* --- contact links: ink underline that fills red --- */
#contact .contact-links {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 26px;
}
#contact .contact-links a {
    font-family: var(--mg-body);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.02em;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 3px solid var(--ink);
    padding-bottom: 2px;
    transition: color 0.18s ease, border-color 0.18s ease;
}
#contact .contact-links a:hover { color: var(--blood); border-color: var(--blood); }

/* --- form: ruled manuscript fields --- */
#contact .contact-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
#contact .form-row { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 640px) { #contact .form-row { grid-template-columns: 1fr 1fr; } }
#contact .form-group { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
#contact .form-group label {
    font-family: var(--mg-body);
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink);
}
#contact .form-group input,
#contact .form-group textarea {
    font-family: var(--mg-body);
    font-weight: 400;
    font-size: 16px;
    letter-spacing: 0;
    color: var(--ink);
    background: var(--paper-dk);
    border: 3px solid var(--ink);
    border-radius: 0;
    padding: 12px 14px;
    box-shadow: none;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}
#contact .form-group input::placeholder,
#contact .form-group textarea::placeholder { color: #7A756B; }
#contact .form-group input:focus,
#contact .form-group textarea:focus {
    outline: none;
    background: var(--paper);
    box-shadow: 5px 5px 0 var(--blood);
}

/* --- submit: inked action button --- */
#contact .submit-btn {
    align-self: flex-start;
    position: relative;
    z-index: 2;
    font-family: var(--mg-display);
    font-weight: 400;
    font-size: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--ink);
    border: 3px solid var(--ink);
    border-radius: 0;
    padding: 14px 34px;
    box-shadow: 6px 6px 0 var(--blood);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
#contact .submit-btn:hover {
    background: var(--blood);
    border-color: var(--blood);
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 var(--ink);
}
#contact .submit-btn:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--ink); }

/* --- footer: inked colophon bar --- */
footer {
    background: var(--ink);
    color: var(--paper);
    padding: 46px 0;
    border-top: 6px solid var(--blood);
}
footer .footer-name {
    font-family: var(--mg-display);
    font-weight: 400;
    font-size: 20px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--paper);
}
footer .footer-copy,
footer .footer-quote {
    font-family: var(--mg-body);
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: rgba(244, 241, 234, 0.72);
    font-style: normal;
}

@media (max-width: 640px) {
    .mg-panel { padding: 26px 20px; box-shadow: 6px 6px 0 var(--ink); }
    .mg-panel-ink { box-shadow: 6px 6px 0 var(--blood); }
    #about .about-stats .stat + .stat { border-left: 0; border-top: 3px solid var(--ink); }
    #about .stat-number { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) {
    #contact .submit-btn,
    #contact .form-group input,
    #contact .form-group textarea { transition: none; }
}


/* ==================================================================
   MANGA — WARM PLATE
   Same light print, toned down: newsprint cream instead of white,
   softer screentone, muted ink so long reads stay comfortable.
   ================================================================== */

/* panels sit a touch lighter than the page, not stark white */
.mg-panel { background: #EAE4D5; }
.mg-panel-ink { background: var(--ink); color: #EAE4D5; }

/* softer screentone — less optical buzz */
.mg-panel-tone::after {
    background-image:
        radial-gradient(circle at 50% 50%, rgba(23,21,15,0.30) 1.4px, transparent 1.6px),
        radial-gradient(circle at 50% 50%, rgba(23,21,15,0.16) 1px, transparent 1.2px);
    opacity: 0.7;
}
.mg-speedlines {
    background: repeating-conic-gradient(
        from 0deg at 50% 45%,
        rgba(23, 21, 15, 0.11) 0deg 0.55deg,
        transparent 0.55deg 2.6deg
    );
}
.mg-speedlines-alt {
    background: repeating-conic-gradient(
        from 0deg at 82% 12%,
        rgba(23, 21, 15, 0.10) 0deg 0.5deg,
        transparent 0.5deg 3.2deg
    );
}

/* body copy: warm charcoal rather than pure black */
#about .about-bio,
#contact .contact-info p,
#hero .hero-subtext { color: #33302A; }
#about .stat-label { color: #4A463E; }
footer .footer-copy,
footer .footer-quote { color: rgba(234, 228, 213, 0.7); }

/* the hero frame shouldn't glare either */
#hero .hero-video { filter: grayscale(1) contrast(1.5) brightness(0.94) sepia(0.12); }
#hero .hero-tone { opacity: 0.6; }
#hero .hero-subtext { background: transparent; box-shadow: none; }

/* ==================================================================
   MOBILE POLISH — smaller phones
   ================================================================== */
@media (max-width: 480px) {
    #mainNav { padding: 7px 7px 7px 14px; }
    .nav-logo { font-size: 18px; }
    .nav-links { width: min(88vw, 320px); padding-left: 22px; padding-right: 22px; }
    .nav-links a { font-size: 23px; min-height: 52px; }

    #hero .hero-nav { padding: 16px 16px; }
    #hero .hero-content { padding-left: 20px; padding-right: 20px; }
    #hero .hero-title { font-size: clamp(38px, 12vw, 60px); text-shadow: 3px 3px 0 var(--blood); }
    #hero .hero-cta-glass { font-size: 17px; padding: 13px 26px; min-height: 48px; }

    .mg-panel { padding: 22px 16px; box-shadow: 5px 5px 0 var(--blood); }
    #about .section-title,
    #contact .section-title { font-size: clamp(34px, 12vw, 52px); text-shadow: 3px 3px 0 var(--blood); }
    #statement .statement-text { font-size: clamp(21px, 6.4vw, 30px); }

    #contact .submit-btn { width: 100%; text-align: center; min-height: 52px; }
    #contact .form-group input,
    #contact .form-group textarea { font-size: 16px; }   /* stops iOS zoom-on-focus */

    footer .footer-content { text-align: center; }
}

/* keep the drawer from scrolling the page behind it */
body.nav-open { overflow: hidden; touch-action: none; }

/* ==================================================================
   ABOUT PORTRAIT — sizing + mobile
   ================================================================== */
/* on wide screens the panel matches the bio column height */
@media (min-width: 900px) {
    #about .about-right.mg-panel { align-self: stretch; }
    .mg-portrait { min-height: 300px; }
}

/* tablets and phones: a short landscape plate, not a tall empty square */
@media (max-width: 899px) {
    .mg-portrait { min-height: 0; }
    #about .about-right.mg-panel { padding: 20px; }
}
@media (max-width: 480px) {
    #about .about-right.mg-panel { padding: 16px; }
    #about .mg-portrait .about-core-fallback { font-size: 46px; }
}

/* fallback initials sit on the ink plate, so keep them light */
#about .mg-portrait .about-core-fallback { color: #EAE4D5; }


/* ==================================================================
   MOBILE OPTIMISATION PASS  —  v32
   Everything below is phone/tablet-only. Desktop is untouched.
   ================================================================== */

/* ---- 0. safety: nothing may push the page sideways ---- */
@media (max-width: 1023px) {
    html, body { max-width: 100%; overflow-x: hidden; }
    img, video, svg, canvas { max-width: 100%; }
}

/* ---- 1. dynamic-viewport fallback for older iOS/Android ---- */
@supports not (height: 100svh) {
    #hero, #projects, #projects .pj-inner, main.nf-page { min-height: 100vh; }
    .nav-links { height: 100vh; }
}

/* the drawer must still scroll on iOS — `touch-action:none` on <body>
   killed it, so the lock is scoped to the page instead */
body.nav-open { overflow: hidden; touch-action: auto; }
.nav-links { touch-action: pan-y; }
.nav-backdrop { touch-action: none; }

/* ---- 2. performance: the conic-gradient speed lines and halftone
   dot grids repaint every frame on mobile GPUs. Drop them on phones. ---- */
@media (max-width: 768px) {
    .mg-speedlines { display: none; }
    .mg-panel-tone::after { opacity: 0.4; background-size: 10px 10px, 10px 10px; }
    #hero .hero-tone { background-size: 9px 9px, 9px 9px; opacity: 0.45; }
}

/* ---- 3. tap targets: 44px minimum on anything interactive ---- */
@media (hover: none) and (pointer: coarse) {
    .nav-links a,
    .nav-resume-link,
    #hero .hero-nav-cta,
    #hero .hero-cta-glass,
    #projects .pj-cta,
    #experience .ex-btn,
    #contact .contact-links a,
    #contact .submit-btn,
    .resume-print-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

    #contact .contact-links a,
    .nav-links a { justify-content: flex-start; }

    /* no sticky :hover states after a tap on touch screens */
    #projects .pj-role:hover { opacity: inherit; transform: none; }
    #projects .pj-cta:hover::before { transform: translateY(101%); }
    #contact .submit-btn:hover,
    #hero .hero-cta-glass:hover,
    #hero .hero-nav-cta:hover,
    .nav-resume-link:hover { transform: none; }
    #contact .submit-btn:active,
    #hero .hero-cta-glass:active { transform: translate(3px, 3px); }
}

/* ==================== HERO ==================== */
@media (max-width: 899px) {
    #hero { min-height: 100svh; justify-content: space-between; }

    #hero .hero-nav { padding: 18px 20px; gap: 12px; }
    #hero .hero-nav-logo { font-size: clamp(18px, 5.4vw, 24px); }

    #hero .hero-content {
        padding: 8px 20px 28px;
        flex: 0 1 auto;
    }
    #hero .hero-kicker { font-size: 11px; letter-spacing: 0.2em; margin-bottom: 14px; }
    #hero .hero-title {
        max-width: 14ch;
        font-size: clamp(40px, 11.5vw, 68px);
        /* Anton's caps nearly fill the em box, so the red offset of one line
           lands on the next unless the leading is opened up */
        line-height: 1.14;
        text-shadow: 3px 3px 0 var(--blood);
    }
    #hero .hero-title em { text-shadow: 3px 3px 0 var(--ink); }
    #hero .hero-subtext {
        margin-top: 18px;
        max-width: 42ch;
        font-size: 14.5px;
        line-height: 1.7;
    }
    #hero .hero-cta-glass { margin-top: 26px; font-size: 17px; padding: 13px 28px; }

    #hero .hero-frame {
        height: clamp(200px, 38svh, 320px);
        margin-left: 20px;
        border-width: 4px;
        box-shadow: -7px 7px 0 var(--ink);
        flex: none;
    }
}

/* very short screens / landscape phones: the stacked frame eats the fold */
@media (max-width: 899px) and (max-height: 560px) {
    #hero { min-height: auto; }
    #hero .hero-frame { height: 200px; }
    #hero .hero-title { font-size: clamp(34px, 7vw, 48px); }
    #hero .hero-subtext { display: none; }
}

@media (max-width: 380px) {
    #hero .hero-title { font-size: 37px; letter-spacing: 0; line-height: 1.16; }
    #hero .hero-subtext { font-size: 14px; }
    #hero .hero-cta-glass { width: 100%; text-align: center; }
}

/* ==================== STATEMENT ==================== */
@media (max-width: 768px) {
    #statement { padding: 72px 0; }
    #statement .statement-text { font-size: clamp(22px, 6.6vw, 34px); line-height: 1.24; }
}

/* ==================== PROJECTS ==================== */
@media (max-width: 809.98px) {
    /* the screenshots are desktop-shaped — centre the crop instead of
       slicing off everything but the top strip */
    /* a desktop screenshot behind phone-width type was pure noise — the
       backdrop is knocked back to a texture and the preview carries it */
    #projects .pj-bg {
        object-position: center center;
        filter: blur(2px) saturate(0.5) brightness(0.5);
        transform: scale(1.06);
    }
    #projects .pj-scrim {
        background: linear-gradient(to top,
            rgba(0,0,0,0.96) 0%, rgba(0,0,0,0.90) 40%,
            rgba(0,0,0,0.84) 75%, rgba(0,0,0,0.80) 100%);
    }

    /* #projects is a full-bleed showcase — the shared 80px section padding
       was stacking on top of its own 100svh shell and adding 160px of void */
    #projects { padding: 0; }
    #projects .pj-inner {
        justify-content: center;
        padding: clamp(92px, 13svh, 116px) 20px clamp(48px, 8svh, 76px);
        gap: clamp(24px, 4svh, 40px);
    }

    /* switcher becomes a horizontally scrollable chip row — four stacked
       rows of 12px text was both cramped and hard to hit */
    #projects .pj-top { gap: 22px; }
    #projects .pj-switcher {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        width: 100%;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
        margin-inline: -20px;
        padding-inline: 20px;
        scroll-padding-inline: 20px;
    }
    #projects .pj-switcher::-webkit-scrollbar { display: none; }
    #projects .pj-role {
        flex: none;
        scroll-snap-align: start;
        align-items: center;
        min-height: 40px;
        padding: 8px 14px;
        border: 1px solid rgba(255, 255, 255, 0.28);
        border-radius: 100px;
        white-space: nowrap;
        opacity: 0.6;
    }
    #projects .pj-role.is-active {
        opacity: 1;
        border-color: #fff;
        background: rgba(255, 255, 255, 0.12);
    }
    #projects .pj-idx { font-size: 9px; }
    #projects .pj-role-label { font-size: 11.5px; }

    #projects .pj-preview { max-width: 220px; }
    #projects .pj-status { font-size: 11px; }

    #projects .pj-bottom { gap: 20px; padding-bottom: 0; }
    #projects .pj-name {
        font-size: clamp(44px, 19vw, 78px);
        line-height: 0.94;
        letter-spacing: -0.055em;   /* em, not px — px was crushing small sizes */
    }
    #projects .pj-desc { font-size: 15px; line-height: 1.55; max-width: 46ch; }
    #projects .pj-tags { gap: 6px; margin-top: 16px; }
    #projects .pj-tags span { font-size: 10.5px; padding: 5px 10px; }
    #projects .pj-cta { margin-top: 22px; padding: 13px 28px; }
}

@media (max-width: 480px) {
    #projects .pj-inner { padding-left: 18px; padding-right: 18px; gap: 26px; }
    #projects .pj-switcher { margin-inline: -18px; padding-inline: 18px; }
    #projects .pj-preview { max-width: 180px; }
}

/* ==================== ABOUT ==================== */
@media (max-width: 768px) {
    #about { padding: 76px 0; }
    /* the tablet rule centres this; ragged-centre body copy over 5+ lines
       is hard to read on a narrow column */
    #about .about-layout { text-align: left; }
    #about .section-title { margin-bottom: 16px; }
    #about .about-bio { font-size: 15px; line-height: 1.75; }
    #about .about-stats.mg-panel-strip { padding: 0; }
    #about .about-stats .stat { padding: 16px 20px; }
    #about .stat-number { font-size: 44px; }
    #about .stat-plus { font-size: 26px; }
    #about .stat-label { font-size: 10px; letter-spacing: 0.14em; }
}

/* three stats side by side is unreadable on a phone — go one per row.
   640 matches the breakpoint where the dividers flip to border-top. */
@media (max-width: 640px) {
    #about .about-stats.mg-panel-strip { grid-template-columns: 1fr; }
    #about .about-stats .stat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; }
    #about .about-stats .stat .stat-label { margin-top: 0; flex: 1 0 auto; }
}

/* ==================== EXPERIENCE ==================== */
@media (max-width: 768px) {
    #experience { padding: 76px 0; }
    #experience .section-header { margin-bottom: 36px; }
    #experience .ex-sub { font-size: 14px; max-width: 100%; }
    #experience .ex-sub .ex-br { display: none; }

    #experience .timeline { padding-left: 26px; }
    #experience .timeline-marker { left: -29.5px; top: 8px; }
    #experience .timeline-item { padding-bottom: 40px; }
    #experience .timeline-content h3 { font-size: 24px; margin: 6px 0 10px; }
    #experience .timeline-content p { font-size: 14.5px; line-height: 1.65; }

    #experience .ex-actions { margin-top: 40px; align-self: stretch; gap: 12px; }
    #experience .ex-btn { width: 100%; padding: 15px 24px; font-size: 15px; }

    /* background video is the single heaviest thing in this section */
    #experience .ex-scrim {
        background: linear-gradient(to bottom,
            rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.80) 55%, rgba(0,0,0,0.86) 100%);
    }
}

/* ==================== CONTACT ==================== */
@media (max-width: 768px) {
    #contact { padding: 76px 0; }
    #contact .section-header { margin-bottom: 32px; }
    #contact .contact-info p { font-size: 15px; }
    #contact .contact-links { gap: 4px; margin-top: 22px; }
    #contact .contact-links a { font-size: 15px; padding: 10px 0; }
    #contact .contact-form { gap: 18px; }
    #contact .form-group textarea { min-height: 130px; }
    #contact .submit-btn { width: 100%; font-size: 18px; padding: 15px 24px; }
}

/* ==================== FOOTER ==================== */
@media (max-width: 768px) {
    footer { padding: 36px 0; }
    footer .footer-content { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
    footer .footer-quote { font-size: 11.5px; line-height: 1.6; max-width: 30ch; }
}

/* ==================== RESUME MODAL (bottom sheet) ==================== */
@media (max-width: 768px) {
    .resume-modal-container { max-height: 90dvh; }
    .resume-modal-actions { padding: 12px 60px 12px 18px; }
    .resume-paper { padding: 22px 20px 40px; }
    .resume-header { padding-bottom: 18px; margin-bottom: 24px; }
    .resume-header h1 { font-size: clamp(22px, 6.4vw, 30px); letter-spacing: 0.05em; }
    .resume-contact { flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; }
    .resume-body-grid { gap: 26px; }
    .resume-item-header { flex-direction: column; align-items: flex-start; gap: 2px; }
    .resume-item-date { white-space: normal; }
    .resume-bullets li { font-size: 13px; line-height: 1.6; }
    /* a grab handle so it reads as a sheet you can dismiss */
    .resume-modal-container::before {
        content: '';
        position: absolute;
        top: 7px; left: 50%;
        transform: translateX(-50%);
        width: 40px; height: 4px;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.28);
        z-index: 11;
    }
    .resume-modal-close { top: 14px; }
    .resume-modal-actions { padding-top: 20px; }
}

/* ==================== 404 SCREEN ==================== */
@media (max-width: 640px) {
    main.nf-page .nf-content {
        position: relative;
        top: auto; left: auto;
        transform: none;
        margin: 0 auto;
        min-height: 100svh;
        padding: 120px 0 60px;
        justify-content: center;
    }
    main.nf-page .nf-404 { font-size: clamp(120px, 44vw, 180px); }
    main.nf-page .nf-message { font-size: clamp(15px, 4.2vw, 18px); letter-spacing: -0.9px; line-height: 1.35; }
}
@media (max-width: 640px) and (max-height: 560px) {
    main.nf-page .nf-content { min-height: auto; padding: 90px 0 50px; gap: 20px; }
    main.nf-page .nf-404 { font-size: 110px; }
}

/* ==================== LOADER ==================== */
@media (max-width: 480px) {
    .loader-text { margin-bottom: 28px; padding: 0 24px; }
    .loader-line { font-size: 17px; }
    .loader-bar { width: min(200px, 60vw); }
}

/* if the hero footage is skipped (save-data) or fails, the frame still
   reads as an inked panel rather than an empty box */
#hero .hero-frame {
    background-color: var(--paper-dk);
    background-image:
        radial-gradient(circle at 50% 50%, rgba(23,21,15,0.30) 1.4px, transparent 1.6px),
        radial-gradient(circle at 50% 50%, rgba(23,21,15,0.16) 1px, transparent 1.2px);
    background-size: 8px 8px, 8px 8px;
    background-position: 0 0, 4px 4px;
}

/* the drawer (z-index 9999) is a child of #mainNav, so it painted over the
   hamburger and swallowed the tap that should close it */
.nav-toggle { position: relative; z-index: 10001; }
body.nav-open .nav-toggle span { background: var(--nav-ink); }

/* ---- final mobile polish ---- */
@media (max-width: 640px) {
    /* white-on-bright-sky had almost no contrast at phone sizes */
    main.nf-page::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 0;
        pointer-events: none;
        background: radial-gradient(ellipse at 50% 55%,
            rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.38) 55%, rgba(0,0,0,0.18) 100%);
    }
    main.nf-page .nf-brand,
    main.nf-page .nf-content { z-index: 2; }
    main.nf-page .nf-message { text-shadow: 0 1px 10px rgba(0,0,0,0.55); }
}

/* ==================================================================
   ABOUT PLATE — the source art is a full-bleed illustration, not a
   small logo mark, so it fills the ink panel instead of floating in it.
   ================================================================== */
.mg-portrait { overflow: hidden; }
.mg-portrait picture { display: contents; }
.mg-portrait img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    display: block;
    /* matched to the hero footage so both plates read as the same print run */
    filter: grayscale(1) contrast(1.28) brightness(0.98) sepia(0.1);
    mix-blend-mode: normal;
    animation: none;
}
/* the panel's own padding would leave a paper-coloured gutter around the art */
#about .about-right.mg-panel { padding: 0; }
#about .about-right.mg-panel .mg-corner { z-index: 4; }

/* halftone laid over the plate so it matches the rest of the page */
.mg-portrait::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(11,11,11,0.42) 1.4px, transparent 1.6px),
        radial-gradient(circle at 50% 50%, rgba(11,11,11,0.22) 1px, transparent 1.2px);
    background-size: 8px 8px, 8px 8px;
    background-position: 0 0, 4px 4px;
    mix-blend-mode: multiply;
    opacity: 0.5;
}
.mg-portrait.no-mark::after { display: none; }

@media (min-width: 900px) { .mg-portrait { min-height: 320px; } }
/* 16:10 matches the source art, so phones get the whole frame uncropped */
@media (max-width: 899px) {
    .mg-portrait { aspect-ratio: 16 / 10; }
    .mg-portrait img { object-position: center 42%; }
}
@media (max-width: 768px) { .mg-portrait::after { opacity: 0.3; } }


/* ==================================================================
   RÉSUMÉ — MANGA PLATE
   Restyled from the slate/glass palette onto the newsprint theme the
   rest of the page uses: ink line work, cream stock, one red accent.
   ================================================================== */
.resume-modal {
    --ink:      #17150F;
    --paper:    #EAE4D5;
    --paper-dk: #DDD5C1;
    --blood:    #B8202A;
    --charcoal: #33302A;
    --mg-display: 'Anton', 'Arial Black', sans-serif;
    --mg-body:    'Zen Kaku Gothic New', 'Inter', sans-serif;
}

.resume-modal-overlay {
    background: rgba(23, 21, 15, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.resume-modal-container {
    background: var(--paper);
    border: 4px solid var(--ink);
    border-radius: 0;
    box-shadow: 14px 14px 0 var(--blood);
}

/* --- masthead bar --- */
.resume-modal-actions {
    background: var(--ink);
    border-bottom: 4px solid var(--ink);
    padding: 14px 70px 14px 22px;
    align-items: center;
}
/* an inked title on the bar so it reads as a document header, not a toolbar */
.resume-modal-actions::before {
    content: 'Curriculum Vitae';
    margin-right: auto;
    font-family: var(--mg-display);
    font-size: 15px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--paper);
}
.resume-print-btn {
    font-family: var(--mg-display);
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--paper);
    border: 3px solid var(--paper);
    border-radius: 0;
    padding: 9px 20px;
    box-shadow: 4px 4px 0 var(--blood);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.resume-print-btn:hover {
    background: var(--blood);
    border-color: var(--blood);
    color: var(--paper);
    box-shadow: 2px 2px 0 var(--paper);
    transform: translate(2px, 2px);
}
.resume-modal-close {
    top: 0; right: 0;
    width: 52px; height: 52px;
    font-family: var(--mg-display);
    font-size: 26px;
    color: var(--paper);
    background: var(--blood);
    border-left: 4px solid var(--ink);
    border-bottom: 4px solid var(--ink);
}
.resume-modal-close:hover { background: var(--paper); color: var(--ink); }

/* --- the page itself --- */
.resume-paper {
    position: relative;
    background: var(--paper);
    color: var(--charcoal);
}
/* faint screentone in the top corner, same trick as the site panels */
.resume-paper::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(23,21,15,0.26) 1.3px, transparent 1.5px),
        radial-gradient(circle at 50% 50%, rgba(23,21,15,0.14) 1px, transparent 1.2px);
    background-size: 8px 8px, 8px 8px;
    background-position: 0 0, 4px 4px;
    -webkit-mask-image: linear-gradient(155deg, #000 0%, transparent 34%);
    mask-image: linear-gradient(155deg, #000 0%, transparent 34%);
    opacity: 0.6;
    z-index: 0;
}
.resume-paper > * { position: relative; z-index: 1; }

/* --- name block --- */
.resume-header {
    text-align: center;
    border-bottom: 4px solid var(--ink);
    padding-bottom: 20px;
    margin-bottom: 28px;
}
.resume-header h1 {
    font-family: var(--mg-display);
    font-weight: 400;
    font-size: clamp(34px, 5.4vw, 54px);
    line-height: 0.95;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink);
    text-shadow: 4px 4px 0 var(--blood);
    margin-bottom: 16px;
}
.resume-contact {
    font-family: var(--mg-body);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.01em;
    color: var(--charcoal);
    gap: 10px 22px;
}
.resume-contact-link { color: var(--charcoal); gap: 7px; }
.resume-contact-link:hover { color: var(--blood); }
.resume-contact-icon { width: 13px; height: 13px; color: var(--blood); }

/* --- section headings: inked rule with a red tick --- */
.resume-section-title {
    position: relative;
    font-family: var(--mg-display);
    font-weight: 400;
    font-size: 17px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
    border-bottom: 3px solid var(--ink);
    padding-bottom: 5px;
    margin-bottom: 16px;
}
.resume-section-title::after {
    content: '';
    position: absolute;
    left: 0; bottom: -3px;
    width: 46px; height: 3px;
    background: var(--blood);
}

/* --- entries --- */
.resume-item { margin-bottom: 20px; }
.resume-item-title {
    font-family: var(--mg-display);
    font-weight: 400;
    font-size: 17px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink);
}
.resume-item-date {
    font-family: var(--mg-body);
    font-weight: 900;
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--blood);
    padding: 3px 8px;
}
.resume-item-sub {
    font-family: var(--mg-body);
    font-weight: 700;
    font-style: normal;
    font-size: 11.5px;
    letter-spacing: 0.02em;
    color: #5C564A;
    margin-top: 5px;
}
.resume-item-loc,
.resume-item-degree {
    font-family: var(--mg-body);
    font-weight: 700;
    font-size: 12px;
    color: #5C564A;
    margin-top: 3px;
}
.resume-item-degree { color: var(--ink); font-size: 13px; }

/* --- bullets: red ink squares, not browser discs --- */
.resume-bullets { list-style: none; margin: 9px 0 0; padding: 0; }
.resume-bullets li {
    position: relative;
    padding-left: 16px;
    font-family: var(--mg-body);
    font-weight: 400;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--charcoal);
    margin-bottom: 6px;
}
.resume-bullets li::before {
    content: '';
    position: absolute;
    left: 0; top: 0.62em;
    width: 6px; height: 6px;
    background: var(--blood);
}
.resume-bullets li strong { color: var(--ink); font-weight: 900; }
.resume-bullets-flush { margin-left: 0; }

/* --- skills: ruled ledger --- */
.resume-skills-table { border-collapse: collapse; }
.resume-skills-table tr + tr td { border-top: 1px solid rgba(23, 21, 15, 0.22); }
.resume-skills-table td {
    font-family: var(--mg-body);
    font-weight: 400;
    font-size: 12px;
    line-height: 1.55;
    color: var(--charcoal);
    padding: 7px 0;
}
.resume-skills-table td:first-child { width: 36%; padding-right: 10px; }
.resume-skills-table td strong {
    font-family: var(--mg-body);
    font-weight: 900;
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
}

/* --- gutter between the two columns, like a panel divider --- */
@media (min-width: 1024px) {
    .resume-body-grid { gap: 44px; }
    .resume-col-right { border-left: 3px solid var(--ink); padding-left: 44px; }
}

/* --- mobile sheet --- */
@media (max-width: 768px) {
    .resume-modal-container { border-radius: 0; border-bottom: 0; box-shadow: none; }
    .resume-modal-container::before { background: rgba(234, 228, 213, 0.5); }
    .resume-modal-actions { padding: 22px 60px 14px 18px; }
    .resume-modal-actions::before { font-size: 13px; letter-spacing: 0.14em; }
    .resume-print-btn { font-size: 13px; padding: 9px 16px; }
    .resume-modal-close { width: 46px; height: 46px; font-size: 22px; }
    .resume-header h1 { text-shadow: 3px 3px 0 var(--blood); }
    .resume-contact { gap: 8px 16px; font-size: 12px; }
    .resume-section-title { font-size: 16px; }
    .resume-item-title { font-size: 16px; }
}

/* ======== PRINT — flatten to ink on white, no shadows or tone ======== */
@media print {
    .resume-modal-container { background: #fff; border: 0; box-shadow: none; }
    .resume-modal-container::before { display: none; }
    .resume-paper { background: #fff; color: #1a1a1a; }
    .resume-paper::before { display: none; }
    .resume-header h1 { color: #000; text-shadow: none; }
    .resume-header { border-bottom-width: 3px; border-color: #000; }
    .resume-section-title { color: #000; border-color: #000; }
    .resume-section-title::after { background: #000; }
    .resume-item-title { color: #000; }
    .resume-item-date {
        color: #000; background: transparent; padding: 0;
        border-bottom: 1.5px solid #000;
    }
    .resume-bullets li { color: #1a1a1a; }
    .resume-bullets li::before { background: #000; }
    .resume-contact, .resume-contact-link { color: #1a1a1a; }
    .resume-contact-icon { color: #000; }
    .resume-col-right { border-left: 0; padding-left: 0; }
}

/* close button: flush into the masthead corner, and a glyph that actually
   reads at size (Anton renders × very small) */
.resume-modal-close {
    top: 0 !important;
    right: 0;
    font-family: var(--mg-body), 'Inter', sans-serif;
    font-weight: 400;
    font-size: 30px;
    line-height: 1;
    padding-bottom: 3px;
    border: 0;
    border-left: 3px solid var(--paper);
    border-bottom: 3px solid var(--paper);
    box-shadow: none;
}
@media (max-width: 768px) {
    .resume-modal-close { width: 50px; height: 50px; font-size: 26px; }
}
