/* ══════════════════════════════════════════════════════════════
   DESIGN SYSTEM — CSS CUSTOM PROPERTIES
══════════════════════════════════════════════════════════════════ */
:root {
    --bg-paper:   #ECEAE3;
    --bg-ink:     #0B0E14;
    --accent:     #1F6FEB;
    --accent-2:   #E8B004;
    --line:       rgba(31, 111, 235, 0.18);
    --text-muted: #6B7280;

    --font-display: 'Anton', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;
    --font-body:    'Inter', sans-serif;
    --font-hand:    'Caveat', cursive;

    --topbar-h: 38px;
    --nav-h:    44px;
}

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

html {
    scroll-behavior: auto; /* Lenis owns smooth scroll */
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg-paper);
    color: var(--bg-ink);
    overflow-x: hidden;
    cursor: none; /* custom cursor replaces system cursor */
}

/* Restore cursor on touch / no-hover devices */
@media (hover: none) {
    body { cursor: auto; }
    .cursor-core,
    .cursor-label,
    #cursor-trails { display: none !important; }
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; border: none; background: none; }

/* Keyboard-visible focus ring — applies only to keyboard nav, not mouse clicks */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}


/* ══════════════════════════════════════════════════════════════
   REUSABLE VISUAL MOTIFS
══════════════════════════════════════════════════════════════════ */

/* Blueprint grid — repeating crosshatch */
.blueprint-grid {
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 44px 44px;
}

/* Paper-noise overlay — faint fractal texture */
.paper-noise {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
    opacity: 1;
}

/* Corner brackets — 4-corner drafting frame */
.corner-brackets {
    position: absolute;
    inset: 22px;
    pointer-events: none;
    z-index: 4;
}

.cb {
    position: absolute;
    width: 26px;
    height: 26px;
    border-color: rgba(31, 111, 235, 0.38);
    border-style: solid;
}
.cb-tl { top: 0;    left: 0;  border-width: 1.5px 0 0 1.5px; }
.cb-tr { top: 0;    right: 0; border-width: 1.5px 1.5px 0 0; }
.cb-bl { bottom: 0; left: 0;  border-width: 0 0 1.5px 1.5px; }
.cb-br { bottom: 0; right: 0; border-width: 0 1.5px 1.5px 0; }

/* Monospace tag labels */
.tag-mono {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Stamp component (reused in later phases) */
.stamp {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    border: 1.5px solid currentColor;
    padding: 3px 9px;
    transform: rotate(-2deg);
    opacity: 0.6;
}


/* ══════════════════════════════════════════════════════════════
   PRELOADER
══════════════════════════════════════════════════════════════════ */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Top-left brand stamp */
.pre-brand {
    position: absolute;
    top: 22px;
    left: 28px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    letter-spacing: 0.14em;
}

/* Skip button top-right */
.skip-btn {
    position: absolute;
    top: 18px;
    right: 28px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2;
    padding: 6px 0;
}
.skip-btn:hover { color: #fff; }

/* Counter */
.pre-center { text-align: center; z-index: 2; }

.pre-counter-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
    line-height: 1;
}

.pre-counter {
    font-family: var(--font-display);
    font-size: clamp(88px, 18vw, 220px);
    color: #fff;
    line-height: 0.9;
    will-change: transform;
}

.pre-pct {
    font-family: var(--font-display);
    font-size: clamp(32px, 6.5vw, 80px);
    color: rgba(255, 255, 255, 0.65);
    align-self: flex-end;
    padding-bottom: 0.05em;
}

/* Progress bar */
.pre-bar-track {
    width: clamp(200px, 38vw, 420px);
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    margin: 20px auto 0;
    overflow: hidden;
}

.pre-bar {
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 999px;
}

/* Boot log bottom-left */
.boot-log {
    position: absolute;
    bottom: 36px;
    left: 36px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.42);
    letter-spacing: 0.07em;
    line-height: 2;
    max-width: 340px;
}

.boot-line {
    display: block;
    opacity: 0;
    transform: translateY(5px);
    white-space: nowrap;
}


/* ══════════════════════════════════════════════════════════════
   CUSTOM CURSOR
══════════════════════════════════════════════════════════════════ */
.cursor-core {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    will-change: transform;
    transition: transform 0.15s; /* for scale changes */
}

.cursor-label {
    position: fixed;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.15em;
    color: var(--bg-ink);
    background: #fff;
    padding: 3px 9px;
    border-radius: 999px;
    pointer-events: none;
    z-index: 9997;
    opacity: 0;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
    will-change: transform, opacity;
}

#cursor-trails {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9996;
    overflow: hidden;
}

.trail {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    transform: translate(-50%, -50%);
    opacity: 0;
    will-change: transform, opacity;
}


/* ══════════════════════════════════════════════════════════════
   TOP BAR
══════════════════════════════════════════════════════════════════ */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-h);
    background: var(--bg-ink);
    border-bottom: 1px solid rgba(31, 111, 235, 0.18);
    z-index: 900;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 20px;
    transform: translateY(-100%); /* animated in by GSAP */
}

/* Left zone */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.topbar-name {
    color: rgba(255, 255, 255, 0.82);
    font-size: 10px;
    white-space: nowrap;
}

.topbar-dash {
    color: rgba(255, 255, 255, 0.22);
    font-size: 11px;
}

.topbar-role {
    color: rgba(255, 255, 255, 0.35);
    font-size: 9px;
    white-space: nowrap;
}

/* Centre zone — ticker */
.topbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: var(--topbar-h);
}

.ticker-text {
    color: rgba(255, 255, 255, 0.52);
    font-size: 9px;
    white-space: nowrap;
    will-change: opacity, transform;
}

/* Right zone — scroll progress */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.scan-lbl { color: rgba(255, 255, 255, 0.3); font-size: 9px; }

.scan-pct {
    color: var(--accent);
    font-size: 10px;
    min-width: 30px;
    text-align: right;
}

.scan-track {
    width: 58px;
    height: 1.5px;
    background: rgba(31, 111, 235, 0.22);
    border-radius: 999px;
    overflow: hidden;
}

.scan-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.12s linear;
}


/* ══════════════════════════════════════════════════════════════
   HERO SECTION — TOPOGRAPHIC LANDING
   Reference: contour-map poster (coordinates + contours + tagline).
   Beige paper background, blueprint-blue coordinates, contour lines
   drawn by js/hero.js on load. Grid of small numbers rendered on
   the canvas layer below the contours.
══════════════════════════════════════════════════════════════════ */
.hero {
    position: relative;
    min-height: 100vh;
    background: var(--bg-paper);
    color: var(--bg-ink);
    overflow: hidden;
}

/* Layer 1: elevation number grid (canvas — drawn by hero.js) */
.hero-grid {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Layer 2: contour lines (SVG — animated by hero.js) */
.hero-contours {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: visible;
}
.hero-contour {
    fill: none;
    stroke: rgba(11,14,20,0.50);
    stroke-width: 1.3;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    will-change: stroke-dashoffset, transform;
}
/* Index contours — every 5th line on a real topo map, drawn heavier */
.hero-contour--major {
    stroke: rgba(11,14,20,0.68);
    stroke-width: 1.9;
}
/* Intermediate contours between the plateau lines — lighter */
.hero-contour--minor {
    stroke: rgba(11,14,20,0.38);
    stroke-width: 1.0;
}
/* Closed peak loops — small ellipses at hilltops */
.hero-peak {
    fill: none;
    stroke: rgba(11,14,20,0.55);
    stroke-width: 1.2;
    vector-effect: non-scaling-stroke;
    will-change: stroke-dashoffset;
}

/* Top nav — brand left, links right */
.hero-topnav {
    position: absolute;
    top: clamp(24px, 3vw, 44px);
    left: clamp(24px, 4vw, 56px);
    right: clamp(24px, 4vw, 56px);
    z-index: 6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hero-monogram {
    font-family: var(--font-display);
    font-size: clamp(22px, 2vw, 30px);
    letter-spacing: -0.02em;
    color: var(--accent);
    line-height: 1;
}
.hero-toplinks {
    display: flex;
    gap: clamp(18px, 2vw, 30px);
}
.hero-toplinks a {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bg-ink);
    text-decoration: none;
    opacity: 0.70;
    transition: opacity 0.2s, color 0.2s;
}
.hero-toplinks a:hover { opacity: 1; color: var(--accent); }

/* Big coordinate typography — LEFT column, blueprint-blue */
.hero-coords {
    position: absolute;
    top: clamp(80px, 11vh, 120px);
    left: clamp(24px, 4vw, 56px);
    z-index: 4;
    display: flex; flex-direction: column;
    color: var(--accent);
    font-family: var(--font-display);
    line-height: 0.90;
    letter-spacing: -0.02em;
}
.hero-coord-line {
    font-size: clamp(60px, 9vw, 138px);
    line-height: 0.92;
    color: var(--accent);
}
/* Caption beneath the coord stack — says what the numbers mean */
.hero-coords-caption {
    margin-top: 14px;
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--bg-ink);
    opacity: 0.72;
    text-transform: uppercase;
    display: flex; gap: 8px; align-items: baseline;
}
.hero-cap-lbl { color: var(--accent); opacity: 0.85; }

/* Compass — center */
.hero-compass {
    position: absolute;
    top: 44%;
    left: 58%;
    transform: translate(-50%, -50%);
    z-index: 4;
    display: flex; flex-direction: column; align-items: center;
    gap: 8px;
}
.hero-compass-n {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.28em;
    color: var(--bg-ink);
    font-weight: 700;
}
.hero-compass svg {
    width: clamp(46px, 3.5vw, 58px);
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.18));
}

/* Bold NAME as hero tagline — right side, dominant */
.hero-tagline {
    position: absolute;
    bottom: clamp(180px, 22vh, 250px);
    right: clamp(24px, 4vw, 56px);
    z-index: 4;
    text-align: right;
    max-width: min(560px, 46vw);
}
.hero-eyebrow {
    font-size: 12px;
    letter-spacing: 0.20em;
    color: var(--bg-ink);
    opacity: 0.65;
    margin: 0 0 14px;
    text-transform: uppercase;
}
.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(72px, 9vw, 158px);      /* bumped from 54-108 → 72-158 */
    line-height: 0.86;
    letter-spacing: -0.01em;
    color: var(--bg-ink);
    margin: 0;
    text-transform: uppercase;
}
.hero-manifesto {
    font-family: var(--font-body);
    font-size: clamp(13px, 1.05vw, 16px);
    line-height: 1.5;
    color: var(--bg-ink);
    opacity: 0.72;
    margin: 20px 0 0;
    max-width: 40ch;
    margin-left: auto;                        /* right-align inside container */
}

/* Small mono meta line — bottom-right, one row of dot-separated bits */
.hero-footer {
    position: absolute;
    bottom: clamp(28px, 4vh, 48px);
    right: clamp(24px, 4vw, 56px);
    z-index: 4;
    display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
    justify-content: flex-end;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bg-ink);
    opacity: 0.75;
}
.hero-footer-dot { color: var(--accent); }

/* Narrow-screen: coords compact at top, tagline dominates centre-bottom,
   compass tucks into the free corner. Everything is sized off vh so it
   still fits on a 375×667 phone without collisions. */
@media (max-width: 720px) {
    .hero { min-height: 100svh; } /* svh avoids the URL-bar jump on iOS */

    .hero-toplinks { display: none; }

    .hero-coords { top: clamp(64px, 9vh, 88px); left: clamp(20px, 4vw, 40px); }
    .hero-coord-line { font-size: clamp(30px, 8.5vw, 52px); line-height: 0.94; }
    .hero-coords-caption { margin-top: 8px; font-size: 9.5px; letter-spacing: 0.16em; }

    .hero-compass { top: clamp(72px, 10vh, 96px); left: auto;
                    right: clamp(20px, 5vw, 34px); transform: none; }
    .hero-compass svg { width: 34px; }
    .hero-compass-n { font-size: 11px; }

    .hero-tagline {
        bottom: clamp(118px, 16vh, 160px);
        text-align: left; right: auto;
        left: clamp(20px, 4vw, 40px);
        max-width: calc(100vw - clamp(40px, 8vw, 80px));
    }
    .hero-eyebrow   { margin-bottom: 8px; font-size: 10.5px; letter-spacing: 0.18em; }
    .hero-title     { font-size: clamp(48px, 13vw, 84px); line-height: 0.9; }
    .hero-manifesto { margin: 12px 0 0; font-size: 12.5px; max-width: 100%; line-height: 1.55; }

    .hero-footer {
        right: auto; left: clamp(20px, 4vw, 40px);
        justify-content: flex-start; font-size: 9.5px;
        letter-spacing: 0.14em; gap: 8px;
        bottom: clamp(78px, 10vh, 96px); /* clear the floating nav pill */
    }
}

/* Very narrow phones — coord block shrinks further, keep tagline legible */
@media (max-width: 400px) {
    .hero-coord-line { font-size: clamp(26px, 7.8vw, 42px); }
    .hero-coords-caption { font-size: 9px; }
    .hero-title  { font-size: clamp(42px, 13vw, 68px); }
    .hero-footer { font-size: 9px; gap: 6px; }
    .hero-compass svg { width: 30px; }
    .hero-compass-n   { font-size: 10px; }
}

/* Short viewports (landscape phones, small windows) — squeeze the
   tagline block a touch so it doesn't crash into the coords. */
@media (max-height: 680px) and (max-width: 720px) {
    .hero-coord-line { font-size: clamp(24px, 7vw, 40px); }
    .hero-tagline    { bottom: clamp(96px, 14vh, 130px); }
    .hero-title      { font-size: clamp(38px, 11vw, 62px); }
    .hero-manifesto  { display: none; } /* keep the block short */
}


/* ══════════════════════════════════════════════════════════════
   FLOATING NAV
══════════════════════════════════════════════════════════════════ */
#floating-nav {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    z-index: 890;
    background: var(--bg-paper);
    border-radius: 999px;
    padding: 5px;
    box-shadow:
        0 4px 32px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(0, 0, 0, 0.07);
    opacity: 0;
    will-change: transform, opacity;
}

.nav-track {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    z-index: 0;
    pointer-events: none;
    will-change: transform, width;
}

.nav-link {
    position: relative;
    z-index: 1;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--bg-ink);
    padding: 7px 15px;
    border-radius: 999px;
    white-space: nowrap;
    transition: color 0.22s;
    cursor: pointer;
}

.nav-link.active { color: #fff; }

.nav-link:not(.active):hover { color: var(--accent); }


/* ══════════════════════════════════════════════════════════════
   SOUND TOGGLE
══════════════════════════════════════════════════════════════════ */
.sound-toggle {
    position: fixed;
    bottom: 26px;
    right: 26px;
    z-index: 891;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-ink);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: color 0.2s, border-color 0.2s;
    will-change: transform, opacity;
}

.sound-toggle:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
}

.sound-toggle svg { width: 16px; height: 16px; }


/* ══════════════════════════════════════════════════════════════
   PHASE 2 STUBS
══════════════════════════════════════════════════════════════════ */
.phase-stub {
    min-height: 60vh;
    background: var(--bg-paper);
}

/* Alternate stub colours so sections are visually distinct while empty */
.phase-stub:nth-child(even) { background: var(--bg-ink); }


/* ══════════════════════════════════════════════════════════════
   REDUCED MOTION
══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    /* Hero elements — make everything visible instantly without GSAP */
    .hero-nav   { opacity: 1 !important; }
    .hero-title-word { transform: none !important; }
    .hero-copy  { opacity: 0.65 !important; transform: none !important; }
    .hero-btn   { opacity: 1 !important; transform: none !important; }
    .hero-meta  { opacity: 1 !important; transform: none !important; }
    .sound-toggle  { opacity: 1 !important; }

    /* Nav + topbar — override GSAP hidden initial states */
    #top-bar      { transform: none !important; opacity: 1 !important; }
    #floating-nav { transform: translateX(-50%) !important; opacity: 1 !important; }

    /* Kill all CSS animation and transition durations */
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — 768 px (tablet)
══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root { --topbar-h: 44px; }

    #top-bar {
        grid-template-columns: 1fr 1fr;
        padding: 0 14px;
        gap: 8px;
    }

    .topbar-center { display: none; } /* ticker hidden on mobile */

    .topbar-role,
    .topbar-dash { display: none; } /* drop the dangling em-dash too */

    .scan-track { width: 40px; }

    /* Hero responsive — tablet */
    .hero-copy { max-width: 100%; }

    /* Nav compact */
    #floating-nav { max-width: calc(100vw - 40px); }
    .nav-link { font-size: 11px; padding: 6px 11px; }

    .boot-log { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — 480 px (mobile)
══════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .hero-copy { max-width: 100%; }
    .hero-title { font-size: clamp(64px, 26vw, 140px); }
    .hero-navlinks { display: none; }

    .nav-link { font-size: 10px; padding: 5px 8px; }

    #floating-nav { padding: 4px; }

    /* Nav pill scrolls horizontally so all 6 links remain reachable */
    .nav-track {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-track::-webkit-scrollbar { display: none; }
}

@media (max-width: 390px) {
    .hero-nav  { padding-top: calc(var(--topbar-h) + 12px); }
    .nav-link  { font-size: 9px; padding: 4px 7px; }
}


/* ══════════════════════════════════════════════════════════════
   ██████  PHASE 2 — ORIGIN SECTION  (Field Notebook Spread)
══════════════════════════════════════════════════════════════════ */

.nb-section {
    position: relative;
    height: auto;
    background: var(--bg-paper);
    background-image: linear-gradient(to bottom, var(--bg-ink) 0px, var(--bg-paper) 80px);
}

/* origin-pin: pinned by GSAP, has perspective for cover's 3D flip */
.origin-pin {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-paper);
    background-image:
        linear-gradient(rgba(31,111,235,0.042) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31,111,235,0.042) 1px, transparent 1px);
    background-size: 44px 44px;
    perspective: 2200px;
    perspective-origin: 50% 50%;
}

/* ── Corner labels + phase indicator ── */
.nb-corner-tl,
.nb-corner-tr,
.nb-corner-bl,
.nb-phase-label {
    position: absolute;
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0.14em;
    z-index: 10;
    pointer-events: none;
}
.nb-corner-tl  { top: calc(var(--topbar-h) + 22px); left: 36px; }
.nb-corner-tr  { top: calc(var(--topbar-h) + 22px); right: 36px; }
.nb-corner-bl  { bottom: 26px; left: 36px; }
.nb-corner-bl span { color: var(--accent); }
.nb-phase-label { bottom: 26px; right: 36px; color: var(--accent); opacity: 0.7; }

/* ── Clipping viewport: clips the overwide spread ── */
.nb-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

/* ── Two-page spread: 140vw wide so each page ≈ 70vw ── */
.nb-spread {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140vw;
    height: clamp(520px, 84vh, 720px);
    display: flex;
    box-shadow:
        0 4px 18px rgba(0,0,0,0.18),
        0 24px 80px rgba(0,0,0,0.38);
    will-change: transform;
}

/* ── Individual pages ── */
.nb-page {
    flex: 1;
    padding: 40px 48px 36px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background-color: #ECEAE3;
    background-image:
        linear-gradient(rgba(31,111,235,0.042) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31,111,235,0.042) 1px, transparent 1px);
    background-size: 24px 24px;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

/* ── Page-lift overlay: fades out after cover swings open, stagger effect ── */
.nb-page-lift {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.22);
    pointer-events: none;
    z-index: 2;
}

/* ── Outer-edge page curl: subtle folded-corner illusion ── */
.nb-page-left::after,
.nb-page-right::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 44px; height: 44px;
    pointer-events: none;
    z-index: 3;
}
.nb-page-left::after {
    left: 0;
    background: linear-gradient(
        135deg,
        transparent 50%,
        rgba(0,0,0,0.11) 50%,
        rgba(0,0,0,0.04) 72%,
        transparent 82%
    );
}
.nb-page-right::after {
    right: 0;
    background: linear-gradient(
        -135deg,
        transparent 50%,
        rgba(0,0,0,0.11) 50%,
        rgba(0,0,0,0.04) 72%,
        transparent 82%
    );
}

/* ── Center spine shadow ── */
.nb-spread-spine {
    width: 52px;
    flex-shrink: 0;
    background: linear-gradient(
        90deg,
        rgba(0,0,0,0.22) 0%,
        rgba(0,0,0,0.06) 40%,
        rgba(0,0,0,0.06) 60%,
        rgba(0,0,0,0.22) 100%
    );
    position: relative;
}
.nb-spread-spine::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: rgba(0,0,0,0.12);
}

/* ── Page meta row ── */
.nb-page-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
}

.nb-page-label {
    font-size: 8px;
    letter-spacing: 0.16em;
    color: var(--accent);
    text-transform: uppercase;
}

.nb-page-num {
    font-size: 9px;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    opacity: 0.45;
    font-family: var(--font-mono);
}

/* ── Left page: big headline ── */
.nb-headline {
    font-family: var(--font-display);
    font-size: clamp(28px, 3.8vw, 58px);
    line-height: 1.0;
    color: var(--bg-ink);
    letter-spacing: 0.01em;
    flex-shrink: 0;
}

.nb-hl {
    color: var(--accent);
    position: relative;
    display: inline-block;
}

.kw-underline {
    position: absolute;
    left: 0; bottom: -6px;
    width: 100%; height: 14px;
    overflow: visible;
    pointer-events: none;
}

#kw-path {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
}

.nb-sub-text {
    font-family: var(--font-body);
    font-size: clamp(12px, 1.4vw, 18px);
    color: var(--bg-ink);
    line-height: 1.65;
    opacity: 0.72;
    flex-shrink: 0;
}

.nb-coord-badge {
    font-size: 8px;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-top: auto;
    opacity: 0.55;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

/* ── Field notes ── */
.nb-fieldnotes {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.nb-fn-header {
    font-size: 8px;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

.nb-fn-line {
    font-family: var(--font-mono);
    font-size: clamp(9px, 1vw, 12px);
    color: var(--bg-ink);
    line-height: 1.85;
    display: flex;
    gap: 7px;
}

.nb-fn-p {
    color: var(--accent);
    flex-shrink: 0;
}

/* ── Polaroid photo ── */
.nb-polaroid {
    background: white;
    padding: 9px 9px 26px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.14);
    transform: rotate(-2deg);
    max-width: 130px;
    flex-shrink: 0;
}

.nb-polaroid-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #c4bfba;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nb-polaroid-img span {
    font-size: 7px;
    color: rgba(0,0,0,0.28);
    text-align: center;
    padding: 4px;
}

.nb-polaroid-cap {
    margin-top: 6px;
    font-size: 7px;
    color: var(--text-muted);
    line-height: 1.7;
}

.nb-polaroid-sub { opacity: 0.6; }

/* ── Right page: amber sticky note ── */
.nb-sticky {
    background: rgba(232,176,4,0.10);
    border: 1px solid rgba(232,176,4,0.25);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.nb-sticky-label {
    font-size: 8px;
    letter-spacing: 0.14em;
    color: var(--accent-2);
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

/* ── Closing quote ── */
.nb-closing {
    font-family: var(--font-body);
    font-size: clamp(14px, 2.2vw, 28px);
    font-weight: 600;
    color: var(--accent);
    line-height: 1.45;
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    flex-shrink: 0;
}

.nb-closing-meta {
    font-size: 9px;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding-left: 19px;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

/* ── Handwritten note ── */
.nb-hand-note {
    font-family: var(--font-hand);
    font-size: clamp(16px, 2.2vw, 28px);
    color: var(--bg-ink);
    opacity: 0.72;
    line-height: 1.3;
    flex-shrink: 0;
}

/* ── Role badge ── */
.nb-role-badge {
    font-size: 8px;
    letter-spacing: 0.14em;
    color: var(--accent-2);
    padding: 5px 9px;
    border: 1px solid var(--accent-2);
    width: fit-content;
    flex-shrink: 0;
    font-family: var(--font-mono);
    margin-top: auto;
}

/* ── Right page: methodology title with tape effect ── */
.nb-method-title {
    position: relative;
    padding: 16px 16px 14px;
    background: rgba(232,176,4,0.08);
    border: 1px solid rgba(232,176,4,0.22);
    flex-shrink: 0;
}

.nb-method-tape {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%) rotate(-1.5deg);
    width: 56px;
    height: 16px;
    background: rgba(232,176,4,0.38);
}

.nb-method-heading {
    font-family: var(--font-display);
    font-size: clamp(24px, 3.2vw, 48px);
    color: var(--bg-ink);
    line-height: 0.92;
    letter-spacing: 0.01em;
}

/* ── Philosophy paragraph ── */
.nb-philosophy {
    font-family: var(--font-body);
    font-size: clamp(13px, 1.4vw, 19px);
    color: var(--bg-ink);
    line-height: 1.7;
    opacity: 0.78;
    font-style: italic;
    flex-shrink: 0;
}

/* ── Cover overlay: full-screen blueprint cover, flips away on first scroll ── */
.nb-cover-overlay {
    position: absolute;
    inset: 0;
    z-index: 8;
    background-color: #0B0E14;
    background-image:
        linear-gradient(rgba(31,111,235,0.11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31,111,235,0.11) 1px, transparent 1px);
    background-size: 28px 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: left center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ── Cover curl shadow: sweeps across right edge as cover swings ── */
.nb-cover-curl {
    position: absolute;
    top: 0; right: 0;
    width: 32%;
    height: 100%;
    background: linear-gradient(
        to left,
        rgba(11,14,20,0.55) 0%,
        rgba(31,111,235,0.05) 55%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
}

.nb-cover-inner { text-align: center; padding: 24px; }

.nb-cover-badge {
    font-size: 8px;
    letter-spacing: 0.22em;
    color: var(--accent);
    margin-bottom: 18px;
    font-family: var(--font-mono);
}

.nb-cover-title {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 88px);
    color: #ECEAE3;
    line-height: 0.9;
    letter-spacing: -0.01em;
    margin-bottom: 22px;
}

.nb-cover-coord {
    font-size: 9px;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-family: var(--font-mono);
}

.nb-cover-scroll {
    font-size: 9px;
    letter-spacing: 0.16em;
    color: var(--accent);
    opacity: 0.7;
    font-family: var(--font-mono);
    animation: nb-scroll-pulse 2s ease-in-out infinite;
}

@keyframes nb-scroll-pulse {
    0%, 100% { opacity: 0.45; }
    50%       { opacity: 0.9; }
}

/* ════ Origin thread SVG ════ */
.origin-thread {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0.68;
    overflow: visible;
}

.origin-thread-dot {
    opacity: 0;
    transform-origin: center;
}

/* ════ Warm spotlight glow follows pan ════ */
.origin-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    overflow: hidden;
}

.origin-glow-ball {
    position: absolute;
    top:    calc(50% - 25vw);
    left:   calc(50% - 25vw);
    width:  50vw;
    height: 50vw;
    border-radius: 50%;
    background: radial-gradient(ellipse at center,
        rgba(232,176,4,0.28) 0%,
        rgba(255,240,180,0.07) 35%,
        transparent 70%
    );
    mix-blend-mode: soft-light;
    will-change: transform;
    pointer-events: none;
}

/* ════ Sticky note annotations (absolute inside .nb-spread) ════ */
.nb-sticky-note {
    position: absolute;
    font-family: var(--font-hand);
    font-size: 13px;
    line-height: 1.45;
    padding: 10px 14px 14px;
    box-shadow:
        0 2px 8px rgba(0,0,0,0.16),
        0 4px 16px rgba(0,0,0,0.10);
    pointer-events: none;
    z-index: 6;
    opacity: 0;
    will-change: transform, opacity;
}

.ns-tape {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
    width: 44px;
    height: 14px;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(0,0,0,0.08);
}

.ns-text {
    margin: 0;
    color: rgba(11,14,20,0.85);
}

#ns1 { background: #fef08a; top: 42%; left: 24%; }
#ns2 { background: #fefce8; top: 65%; left: 11%; border: 1px solid rgba(0,0,0,0.06); }
#ns3 { background: #e0f2fe; top: 28%; left: 50.5%; }
#ns4 { background: #f0fdf4; top: 55%; left: 65%; border: 1px solid rgba(0,0,0,0.06); }

/* ════ REDUCED MOTION — flat readable stack ════ */
@media (prefers-reduced-motion: reduce) {
    .nb-cover-scroll { animation: none !important; opacity: 0.7; }

    #kw-path,
    #origin-thread-path { stroke-dashoffset: 0 !important; }
    .origin-thread-dot  { opacity: 1 !important; transform: none !important; }
    .origin-thread      { opacity: 0.68; }
    .origin-glow        { display: none; }

    .nb-section { height: auto; }

    .origin-pin {
        height: auto;
        overflow: visible;
        padding: calc(var(--topbar-h) + 24px) 0 40px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        background-image: none;
        perspective: none;
    }

    .nb-corner-tl,
    .nb-corner-tr,
    .nb-corner-bl,
    .nb-phase-label { display: none; }

    .nb-cover-overlay { display: none; }

    .nb-viewport {
        position: relative;
        overflow: visible;
        height: auto;
    }

    .nb-spread {
        position: relative;
        top: auto; left: auto;
        width: 100%;
        height: auto;
        transform: none !important;
        flex-direction: column;
        box-shadow: none;
    }

    .nb-spread-spine { display: none; }
    .nb-page-lift    { display: none; }
    .nb-cover-curl   { display: none; }
    .nb-page-left::after,
    .nb-page-right::after { display: none; }

    .nb-page {
        min-height: 60vh;
        padding: 32px 24px 40px;
        border-bottom: 1px solid rgba(31,111,235,0.1);
    }

    .nb-method-title { margin-top: 8px; }
    .nb-beat { opacity: 1 !important; transform: none !important; }
}

/* ════ MOBILE ≤ 768px — vertical flat stack ════ */
@media (max-width: 768px) {
    .origin-thread,
    .origin-glow,
    .nb-sticky-note { display: none; }

    .nb-section { height: auto; }

    .origin-pin {
        height: auto;
        overflow: visible;
        padding: calc(var(--topbar-h) + 16px) 0 40px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        background-image: none;
        background-color: var(--bg-paper);
        perspective: none;
    }

    .nb-corner-tl,
    .nb-corner-tr,
    .nb-corner-bl,
    .nb-phase-label { display: none; }

    .nb-cover-overlay { display: none; }

    .nb-viewport {
        position: relative;
        overflow: visible;
        height: auto;
    }

    .nb-spread {
        position: relative;
        top: auto; left: auto;
        width: 100%;
        height: auto;
        transform: none !important;
        flex-direction: column;
        box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    }

    .nb-spread-spine { display: none; }
    .nb-page-lift    { display: none; }
    .nb-cover-curl   { display: none; }
    .nb-page-left::after,
    .nb-page-right::after { display: none; }

    .nb-page {
        padding: 28px 20px 36px;
        min-height: 0;
        gap: 16px;
    }

    .nb-beat { opacity: 1 !important; transform: none !important; }

    .nb-headline       { font-size: clamp(28px, 7vw, 44px); }
    .nb-sub-text       { font-size: 14px; }
    .nb-fn-line        { font-size: 12px; }
    .nb-closing        { font-size: clamp(15px, 4.5vw, 24px); }
    .nb-polaroid       { max-width: 160px; }
    .nb-method-heading { font-size: clamp(22px, 6vw, 38px); }
    .nb-philosophy     { font-size: 13px; }
}


/* ══════════════════════════════════════════════════════════════
   ██████  PHASE 2 — PROJECTS SECTION
══════════════════════════════════════════════════════════════════ */

.projects-section {
    position: relative;
    background: var(--accent);
    color: white;
    min-height: 100vh;
    padding: 72px 0 80px;
    overflow: visible; /* allow rotated/elevated cards to bleed past edges */
}

/* Blueprint grid lines in white on the blue background */
.proj-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
    z-index: 0;
}

.proj-brackets .cb { border-color: rgba(255, 255, 255, 0.22); }

/* ── Header ── */
.proj-header {
    position: relative;
    z-index: 2;
    padding: 0 56px;
    margin-bottom: 48px;
}

.proj-section-num {
    color: rgba(255, 255, 255, 0.45);
    font-size: 9px;
    letter-spacing: 0.16em;
    margin-bottom: 8px;
}

.proj-title {
    font-family: var(--font-display);
    font-size: clamp(64px, 11vw, 160px);
    color: white;
    line-height: 0.88;
    letter-spacing: 0.01em;
}

.proj-chip-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.proj-chip {
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 4px 11px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 9px;
    letter-spacing: 0.12em;
}

.blink-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-2);
    flex-shrink: 0;
    animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.1; }
}

.proj-quicknote {
    color: rgba(255, 255, 255, 0.38);
    font-size: 9px;
    letter-spacing: 0.1em;
}

.proj-ql-link {
    color: var(--accent-2);
    text-decoration: none;
    border-bottom: 1px solid rgba(232, 176, 4, 0.4);
    transition: border-color 0.2s;
}
.proj-ql-link:hover { border-color: var(--accent-2); }

/* ── Card stack: perspective container for 3D deck ── */
.proj-stack {
    position: relative;
    z-index: 2;
    margin: 0 56px;
    perspective: 1600px;
    /* GSAP sets absolute-positioned cards + min-height; container has no intrinsic height */
}

/* ── Individual card ── */
.proj-card {
    position: relative;         /* JS overrides to absolute on desktop */
    left: 0;
    right: 0;
    border: 2.67px solid;
    border-radius: 3px;
    cursor: pointer;
    box-sizing: border-box;
    will-change: transform, top, opacity;
    min-height: 217px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    transform-origin: center center;
    backface-visibility: hidden;
    transition: box-shadow 0.3s;  /* GSAP owns transform — no transition on transform */
    margin-bottom: 12px;          /* mobile flow spacing; ignored when position:absolute */
}

/* Cream cards (1st, 3rd) */
.proj-card:nth-child(odd) {
    background: var(--bg-paper);
    color: var(--bg-ink);
    border-color: #0B0E14;
}

/* Dark cards (2nd, 4th) */
.proj-card:nth-child(even) {
    background: var(--bg-ink);
    color: #fff;
    border-color: var(--accent);
}

/* Text overrides for dark cards */
.proj-card:nth-child(even) .proj-org,
.proj-card:nth-child(even) .proj-role-tag      { color: rgba(255,255,255,0.50); }
.proj-card:nth-child(even) .proj-title-text     { color: #fff; }
.proj-card:nth-child(even) .proj-duration       { color: var(--accent); border-color: rgba(31,111,235,0.45); }
.proj-card:nth-child(even) .proj-expand-hint    { color: rgba(255,255,255,0.38); }
.proj-card:nth-child(even) .proj-details-inner  { border-top-color: rgba(255,255,255,0.10); }
.proj-card:nth-child(even) .proj-role-display   { color: var(--accent); }
.proj-card:nth-child(even) .proj-bullets li     { color: rgba(255,255,255,0.65); }
.proj-card:nth-child(even) .proj-bullets .hl    { color: #fff; border-bottom-color: var(--accent); }
.proj-card:nth-child(even) .proj-card-footer    { border-top-color: rgba(255,255,255,0.08); }
.proj-card:nth-child(even) .proj-close-hint     { color: rgba(255,255,255,0.38); }
.proj-card:nth-child(even) .proj-stat           { border-left-color: rgba(31,111,235,0.45); }
.proj-card:nth-child(even) .proj-stat-num       { color: #fff; }
.proj-card:nth-child(even) .proj-stat-label     { color: rgba(255,255,255,0.45); }
.proj-card:nth-child(even) .stamp               { color: var(--accent); border-color: var(--accent); }

.proj-card.is-open {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.24);
    z-index: 10;
}

/* ── Custom project cursor ── */
.proj-cursor {
    position: fixed;
    left: 0; top: 0;
    width: 8px; height: 8px;
    border-radius: 9999px;
    background: white;
    mix-blend-mode: difference;
    z-index: 10002;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.proj-cursor.is-ring {
    background: transparent;
    border: 1.5px solid white;
}

.proj-cursor-label {
    position: fixed;
    left: 0; top: 0;
    z-index: 10003;
    pointer-events: none;
    font-family: var(--font-mono, monospace);
    font-size: 8px;
    letter-spacing: 0.14em;
    color: white;
    mix-blend-mode: difference;
    opacity: 0;
    transform: translate(-50%, 0);
    white-space: nowrap;
}

/* ── Card header (always visible) ── */
.proj-card-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 24px 32px;
}

.proj-org {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0.14em;
    margin-bottom: 5px;
}

.proj-title-text {
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 600;
    color: var(--bg-ink);
    line-height: 1.2;
}

.proj-role-tag {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-top: 5px;
}

.proj-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.proj-duration {
    font-size: 9px;
    letter-spacing: 0.12em;
    color: var(--accent);
    border: 1px solid rgba(31, 111, 235, 0.3);
    padding: 3px 9px;
}

.proj-expand-hint {
    font-size: 8px;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    transition: color 0.2s;
}

.proj-card.is-open .proj-expand-hint { color: var(--accent); }

/* ── Collapsed details pane (height animated by GSAP) ── */
.proj-details {
    height: 0;
    overflow: hidden;
    /* GSAP animates height to scrollHeight on expand */
}

.proj-details-inner {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 32px;
    padding: 20px 24px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.proj-details-main { min-width: 0; }

.proj-role-display {
    font-family: var(--font-display);
    font-size: clamp(28px, 4.5vw, 52px);
    color: var(--accent);
    line-height: 0.9;
    margin-bottom: 18px;
}

.proj-bullets {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.proj-bullets li {
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.55;
    padding-left: 18px;
    position: relative;
}

.proj-bullets li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 11px;
    top: 2px;
}

.proj-bullets .hl {
    color: var(--bg-ink);
    font-weight: 600;
    border-bottom: 1.5px solid var(--accent);
    padding-bottom: 1px;
}

.proj-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.proj-close-hint {
    font-size: 8px;
    color: var(--text-muted);
    letter-spacing: 0.12em;
}

/* GitHub-repo link on each card footer — inherits card color palette
   (odd cards = paper, even = white on ink) via .proj-card:nth-child rules */
.proj-repo-link {
    font-size: 9px;
    letter-spacing: 0.16em;
    text-decoration: none;
    color: var(--accent);
    border-bottom: 1px solid rgba(31,111,235,0.35);
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
}
.proj-repo-link:hover {
    color: var(--accent-2);
    border-bottom-color: var(--accent-2);
}
.proj-card:nth-child(even) .proj-repo-link {
    color: var(--accent-2);
    border-bottom-color: rgba(232,176,4,0.45);
}
.proj-card:nth-child(even) .proj-repo-link:hover {
    color: #fff;
    border-bottom-color: #fff;
}

.proj-stamp-wrap { transform: rotate(-3.5deg); }

.proj-stamp-wrap .stamp {
    color: var(--accent);
    border-color: var(--accent);
    font-size: 9px;
    opacity: 0.5;
}

/* ── Stats column ── */
.proj-stats {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 18px;
    padding-top: 4px;
}

.proj-stat {
    border-left: 2px solid rgba(31, 111, 235, 0.25);
    padding-left: 12px;
}

.proj-stat-num {
    font-family: var(--font-display);
    font-size: 48px;
    color: var(--bg-ink);
    line-height: 1;
}

.proj-stat-label {
    font-size: 7.5px;
    color: var(--text-muted);
    letter-spacing: 0.14em;
    margin-top: 3px;
}

/* ── Projects responsive ── */
@media (max-width: 768px) {
    .projects-section { padding: 56px 0 72px; }
    .proj-header { padding: 0 20px; margin-bottom: 32px; }
    .proj-title  { font-size: clamp(56px, 13vw, 108px); }
    .proj-stack  {
        margin: 0 20px;
        perspective: none;
        display: flex;
        flex-direction: column;
    }

    /* Cards revert to flow (GSAP only sets position:absolute on desktop) */
    .proj-card {
        position: relative !important;
        top: auto !important;
        transform: none !important;
        opacity: 1 !important;
        min-height: 0;
    }

    .proj-card-header { padding: 20px 22px; }
    .proj-details-inner { padding: 16px 22px 22px; }

    .proj-details-inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .proj-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 14px;
        border-top: 1px solid rgba(0,0,0,0.07);
        padding-top: 14px;
    }

    .proj-stat { border-left: none; border-top: 2px solid rgba(31,111,235,0.2); padding: 8px 0 0; flex: 1 1 30%; min-width: 90px; }

    .proj-stat-num { font-size: 32px; }

    .proj-bullets li { font-size: 13px; line-height: 1.6; }
}

@media (max-width: 480px) {
    .proj-title { font-size: clamp(48px, 15vw, 84px); }

    .proj-card-header {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .proj-card-right {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .proj-title-text { font-size: 15px; }
    .proj-org        { font-size: 8px; }
    .proj-duration   { font-size: 8px; padding: 2px 7px; }
    .proj-expand-hint{ font-size: 8px; }
}


/* ══════════════════════════════════════════════════════════════
   ██████  ORIGIN 2 — NOTEBOOK JOURNAL SPREAD
══════════════════════════════════════════════════════════════════ */

/* Fonts: Schoolbell + Gloria Hallelujah loaded in <head> */

/* ── Section wrapper (dark desk) ── */
.origin2-section {
    position:        relative;
    min-height:      100vh;
    background:      #010204;
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         clamp(52px, 9vh, 110px) clamp(16px, 5vw, 56px);
    overflow:        hidden;
}

/* ── Desk atmosphere ── */
/* subtle wood/paper grain on the desk surface */
.origin2-section::before {
    content:          '';
    position:         absolute;
    inset:            0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='dn'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.62' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23dn)' opacity='0.045'/%3E%3C/svg%3E");
    background-size:  400px 400px;
    pointer-events:   none;
    z-index:          0;
}
/* warm spotlight (lamp above desk) + blue accent tint */
.o2-glow {
    position:       absolute;
    inset:          0;
    background:
        radial-gradient(ellipse 80% 70% at 50% 48%, rgba(255,238,190,0.10) 0%, rgba(255,215,130,0.05) 38%, transparent 65%),
        radial-gradient(ellipse 52% 42% at 50% 52%, rgba(31,111,235,0.04) 0%, transparent 52%);
    pointer-events: none;
    z-index:        0;
}
.o2-vignette {
    position:         absolute;
    inset:            0;
    background:       radial-gradient(ellipse 110% 110% at 50% 50%, transparent 32%, rgba(0,0,0,0.72) 100%);
    pointer-events:   none;
    z-index:          0;
}

/* ── Notebook container ── */
.o2-wrap {
    position:    relative;
    width:       100%;
    max-width:   1120px;
    z-index:     1;
}

/* ── Desk drop-shadow behind notebook ── */
.o2-shadow {
    position:      absolute;
    inset:         10px -8px -24px;
    border-radius: 14px;
    box-shadow:    0 60px 130px rgba(0,0,0,0.92), 0 0 90px rgba(31,111,235,0.07);
    pointer-events: none;
    z-index:       0;
}

/* ── SVG pen trail (inside .o2-spread, absolute) ── */
.o2-pen-trail {
    position:       absolute;
    inset:          0;
    width:          100%;
    height:         100%;
    pointer-events: none;
    z-index:        10;
    overflow:       visible;
}
/* initial hidden state — JS sets exact dasharray then animates offset to 0 */
#o2-pen-path {
    stroke-dashoffset: 9999;
    stroke-dasharray:  9999;
}
.o2-dot {
    opacity:          0;
    transform:        scale(0);
    transform-origin: center;
    fill:             none;
    stroke:           var(--accent);
    stroke-width:     1.6;
}
.o2-dot--fill { fill: var(--accent); }

/* ── Pages spread ── */
.o2-spread {
    display:        flex;
    flex-direction: row;
    position:       relative;
    z-index:        1;
}

/* ── Shared page styles ── */
.o2-page {
    flex:       1 1 50%;
    background: var(--bg-paper);
    padding:    clamp(28px, 4.5vw, 56px);
    position:   relative;
    overflow:   hidden;
    min-height: 600px;
}
.o2-left  { border-radius: 12px 0 0 12px; }
.o2-right { border-radius: 0 12px 12px 0; }

/* paper grain overlay */
.o2-grain {
    position:            absolute;
    inset:               0;
    background-image:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.84' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.055'/%3E%3C/svg%3E");
    background-size:     280px 280px;
    pointer-events:      none;
    z-index:             0;
}
/* faint ruled lines */
.o2-lines {
    position:            absolute;
    inset:               0;
    background-image:    repeating-linear-gradient(transparent, transparent 27px, rgba(0,0,0,0.035) 28px);
    background-position: 0 70px;
    pointer-events:      none;
    z-index:             0;
}

/* ── Spine crease ── */
.o2-spine {
    width:      3px;
    flex-shrink: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(0,0,0,0.24) 44%, rgba(0,0,0,0.05));
    box-shadow: -6px 0 14px rgba(0,0,0,0.24), 6px 0 14px rgba(0,0,0,0.14);
}

/* ── Font helpers ── */
.o2-schoolbell { font-family: 'Schoolbell', cursive; }
.o2-gloria     { font-family: 'Gloria Hallelujah', cursive; }

/* ── Section label ── */
.o2-label {
    display:      flex;
    align-items:  center;
    gap:          10px;
    margin-bottom: 22px;
    position:     relative;
    z-index:      1;
}
.o2-label-num {
    font-weight:    700;
    font-size:      11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color:          var(--bg-ink);
}
.o2-dot-sep { color: var(--bg-ink); opacity: 0.28; font-size: 12px; }
.o2-label-sub {
    font-size:      10px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color:          var(--bg-ink);
    opacity:        0.5;
}

/* ── Reveal: opacity-only (for sticky note — rotation must not be clobbered) ── */
.o2-reveal-opacity {
    opacity:    0;
    transition: opacity 0.7s ease;
}
.o2-reveal-opacity.o2-in {
    opacity: 1;
}

/* ── Blue sticky-note annotation ── */
.o2-sticky {
    display:       inline-block;
    margin-bottom: 26px;
    position:      relative;
    z-index:       1;
}
.o2-sticky .o2-gloria {
    font-size:       13px;
    color:           var(--accent);
    display:         inline-block;
    transform:       rotate(-3deg);
    transform-origin: left center;
    animation:       o2GloriaWobble 5.5s ease-in-out infinite;
}
@keyframes o2GloriaWobble {
    0%, 100% { transform: rotate(-3deg); }
    33%      { transform: rotate(-2.4deg); }
    66%      { transform: rotate(-3.7deg); }
}

/* ── Headline ── */
.o2-headline { position: relative; z-index: 1; }
.o2-hl-line {
    font-family:    'Inter', sans-serif;
    font-weight:    900;
    font-size:      clamp(20px, 3vw, 39px);
    line-height:    1.0;
    letter-spacing: -0.015em;
    margin-bottom:  2px;
}
.o2-black { color: rgba(0,0,0,0.82); }
.o2-blue  { color: var(--accent); text-shadow: 2px 4px 26px rgba(31,111,235,0.32); }

/* SNEAKERS word + hand-drawn circle */
.o2-sneakers {
    position: relative;
    display:  inline-block;
    color:    rgba(5,16,36,0.82);
}
.o2-circle {
    position:       absolute;
    top:            -22%;
    left:           -8%;
    width:          116%;
    height:         144%;
    overflow:       visible;
    pointer-events: none;
}
#o2-circle-path {
    stroke-dashoffset: 400;
    stroke-dasharray:  400;
    transition:        stroke-dashoffset 1.15s ease-in-out;
}
.o2-wrap.o2-visible #o2-circle-path {
    stroke-dashoffset: 0;
    transition-delay:  1.45s;
}

/* ── Story paragraphs (right page) ── */
.o2-para {
    font-size:     13px;
    line-height:   1.92;
    color:         rgba(34,34,34,0.85);
    margin-bottom: 18px;
    max-width:     430px;
    position:      relative;
    z-index:       1;
}

/* ── Reflective closing block ── */
.o2-closing {
    border-left:  2.5px solid var(--accent);
    padding-left: 14px;
    margin-top:   22px;
    margin-bottom: 24px;
    position:     relative;
    z-index:      1;
}
.o2-closing-line {
    font-size:  12.5px;
    line-height: 1.88;
    color:      rgba(34,34,34,0.68);
    font-style: italic;
}

/* ── Polaroid ── */
.o2-polaroid {
    display:       inline-block;
    margin-bottom: 12px;
    position:      relative;
    z-index:       1;
    animation:     o2PolaroidFloat 7s ease-in-out infinite;
}
@keyframes o2PolaroidFloat {
    0%, 100% { transform: rotate(4deg) translateY(0); }
    25%      { transform: rotate(5deg) translateY(-5px); }
    60%      { transform: rotate(3deg) translateY(0); }
    80%      { transform: rotate(4.5deg) translateY(-3px); }
}
.o2-polaroid-inner {
    background:  #ffffff;
    padding:     10px 10px 38px;
    box-shadow:  8px 14px 40px rgba(0,0,0,0.42), 2px 4px 12px rgba(0,0,0,0.18), 0 1px 4px rgba(0,0,0,0.1);
    width:       134px;
    position:    relative;
}
.o2-polaroid-photo {
    width:           100%;
    height:          114px;
    background:      linear-gradient(135deg, #bfcfe8 0%, #9aaed0 42%, #c8bca8 100%);
    display:         flex;
    align-items:     center;
    justify-content: center;
}
.o2-polaroid-cap {
    position:   absolute;
    bottom:     7px;
    left:       0;
    right:      0;
    text-align: center;
    font-size:  9.5px;
    color:      #333;
    line-height: 1.45;
    margin:     0;
}
.o2-polaroid-cap span { opacity: 0.5; font-size: 8px; }

/* ── Scatter annotations ── */
.o2-annot {
    position:   absolute;
    z-index:    3;
}
.o2-spike {
    top:        52%;
    right:      9%;
    font-size:  11px;
    color:      var(--accent);
    opacity:    0.7;
    display:    block;
    transform:  rotate(-1.5deg);
    white-space: nowrap;
}
.o2-gods-plan {
    bottom:         10%;
    right:          7%;
    display:        inline-block;
    font-size:      9px;
    font-weight:    700;
    letter-spacing: 0.12em;
    color:          var(--bg-ink);
    border:         1px solid rgba(5,16,36,0.6);
    padding:        3px 7px;
    transform:      rotate(2deg);
    white-space:    nowrap;
}

/* ── Scroll-reveal ── */
.o2-reveal {
    opacity:    0;
    transform:  translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.o2-reveal.o2-in {
    opacity:   1;
    transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .o2-spread { flex-direction: column; }
    .o2-left   { border-radius: 12px 12px 0 0; min-height: auto; }
    .o2-right  { border-radius: 0 0 12px 12px; min-height: auto; }
    .o2-page   { padding: clamp(22px, 5vw, 32px); }
    .o2-spine  {
        width:      100%;
        height:     2px;
        background: linear-gradient(to right, rgba(0,0,0,0.04), rgba(0,0,0,0.2) 44%, rgba(0,0,0,0.04));
        box-shadow: 0 -4px 10px rgba(0,0,0,0.18), 0 4px 10px rgba(0,0,0,0.1);
    }
    .o2-pen-trail   { display: none; } /* pen path is calibrated for landscape spread */
    .o2-annot       { display: none; } /* scatter labels don't fit a stacked page */
    .o2-shadow      { inset: 6px -4px -12px; }

    /* Headline reads too small at desktop's clamp min (20px) — bump up */
    .o2-hl-line     { font-size: clamp(24px, 7.5vw, 36px); line-height: 1.05; }
    .o2-para        { font-size: 14px; line-height: 1.7; max-width: 100%; }
    .o2-closing     { margin-top: 18px; margin-bottom: 20px; }
    .o2-closing-line{ font-size: 13px; line-height: 1.7; }

    /* Center the polaroid + reduce its float amplitude so it sits nicely */
    .o2-polaroid           { display: block; margin: 8px auto 16px; text-align: center; }
    .o2-polaroid-inner     { margin: 0 auto; }

    /* NUST badge — a bit more breathing room */
    .o2-nust-badge  { position: relative; left: auto; right: auto; bottom: auto;
                      margin-top: 16px; padding-top: 12px;
                      border-top: 1px solid rgba(0,0,0,0.08); }
}


/* ══════════════════════════════════════════════════════════════
   SCROLL-ZOOM OVERRIDES — pinned 3-D journal camera
══════════════════════════════════════════════════════════════════ */

/* Tall scroll runway; sticky child handles the visible viewport */
.origin2-section {
    min-height:  12000px;
    display:     block;
    padding:     0;
    overflow-x:  hidden;
    overflow-y:  visible;  /* sticky must not be clipped by parent */
}

/* 100vh pane — GSAP ScrollTrigger handles pinning, not CSS sticky */
#about-sticky-wrap {
    position:        relative;
    width:           100%;
    height:          100vh;
    display:         flex;
    align-items:     center;
    justify-content: center;
    overflow:        visible;   /* allow tilted notebook to extend outside during open */
    perspective:     2200px;
    transform-style: preserve-3d;
    padding:         0 clamp(16px, 5vw, 56px);
    box-sizing:      border-box;
}

/* GSAP transform target */
#notebook-container {
    width:            100%;
    transform-origin: 50% 50%;
    will-change:      transform;
    transform-style:  preserve-3d;
}

/* Center notebook within container */
#notebook-container > .o2-wrap {
    margin: 0 auto;
}

/* GSAP drives these from hidden → crisp on scroll */
.focus-lift-target {
    opacity:     0;
    filter:      blur(10px);
    will-change: filter, opacity, transform;
}


/* ── 3D context for cover flip ── */
/* preserve-3d on flex containers is flattened by browsers */
/* cover uses its own inline perspective via GSAP transformPerspective */
.o2-wrap   { transform-style: preserve-3d; }

/* ── Notebook cover ── */
#o2-cover {
    position:            absolute;
    inset:               0 50% 0 0;
    transform-origin:    100% 50%;
    transform-style:     preserve-3d;
    backface-visibility: hidden;
    will-change:         transform;
    z-index:             20;
    background:          linear-gradient(160deg, #1c1a2e 0%, #0d0d20 100%);
    border-radius:       3px 0 0 3px;
    box-shadow:          inset -6px 0 18px rgba(0,0,0,0.5), 3px 0 10px rgba(0,0,0,0.3);
}
.o2-cover-texture {
    position:   absolute;
    inset:      0;
    border-radius: inherit;
    background: repeating-linear-gradient(
        180deg,
        transparent            0px,
        transparent            24px,
        rgba(255,255,255,0.03) 24px,
        rgba(255,255,255,0.03) 25px
    );
}
.o2-cover-label {
    position:        absolute;
    top:             50%;
    left:            50%;
    transform:       translate(-50%, -50%);
    text-align:      center;
    display:         flex;
    flex-direction:  column;
    gap:             6px;
    pointer-events:  none;
}
.o2-cover-label span {
    display:         block;
    font-family:     'Schoolbell', cursive;
    font-size:       clamp(13px, 2.2vw, 20px);
    color:           rgba(255,255,255,0.55);
    letter-spacing:  0.35em;
}

/* ── NUST degree badge ── */
.o2-nust-badge {
    display:     flex;
    align-items: center;
    gap:         10px;
    position:    absolute;
    bottom:      6%;
    left:        6%;
    right:       4%;
}
.o2-nust-crest   { width: 42px; height: 42px; flex-shrink: 0; object-fit: contain; }
.o2-nust-info    { display: flex; flex-direction: column; gap: 1px; }
.o2-nust-degree  { display: block; font-size: 9px;  color: var(--accent); }
.o2-nust-years   { display: block; font-size: 12px; font-weight: 700; color: var(--bg-ink); }
.o2-nust-full    { display: block; font-size: 7px;  color: rgba(5,16,36,0.5); line-height: 1.3; }

/* ── Education beat (right page, in-flow) ── */
.o2-edu       { display: flex; align-items: center; gap: 10px; margin: clamp(8px, 1.2vh, 14px) 0; }
.o2-edu-logo  { width: 44px; height: 44px; flex-shrink: 0; object-fit: contain; }
.o2-edu-text  { display: flex; flex-direction: column; gap: 1px; }
.o2-edu-year  { display: block; font-size: 12px; font-weight: 700; color: var(--accent); }
.o2-edu-deg   { display: block; font-size: 9px;  color: var(--bg-ink); }
.o2-edu-inst  { display: block; font-size: 7px;  color: rgba(5,16,36,0.5); line-height: 1.3; }

/* ── Polaroid real photo ── */
.o2-polaroid-photo          { overflow: hidden; }
.o2-polaroid-img            { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; display: block; }

/* ── Stickers ── */
.o2-sticker { position: absolute; z-index: 3; }
.o2-sticker-class {
    top:             6%;
    right:           5%;
    background:      rgba(31,111,235,0.08);
    border:          1.5px solid rgba(31,111,235,0.28);
    border-radius:   3px;
    padding:         3px 8px;
    font-size:       10px;
    color:           var(--accent);
    transform:       rotate(2.5deg);
    white-space:     nowrap;
}
.o2-sticker-class strong { font-weight: 800; }
.o2-sticker-loc {
    display:      flex;
    align-items:  center;
    gap:          4px;
    bottom:       28%;
    left:         6%;
    font-size:    9px;
    color:        var(--accent);
    transform:    rotate(-1.5deg);
    white-space:  nowrap;
}

/* Mobile: disable 3-D, restore normal layout */
@media (max-width: 768px) {
    .origin2-section {
        min-height: auto;
        overflow:   hidden;
    }
    #about-sticky-wrap {
        position:        relative;
        height:          auto;
        min-height:      100vh;
        perspective:     none;
        transform-style: flat;
        padding:         clamp(52px, 9vh, 110px) clamp(16px, 5vw, 56px);
    }
    #notebook-container {
        will-change: auto;
        transform:   none !important;
    }
    .focus-lift-target {
        filter:  none;
        opacity: 1;
    }
}


/* ══════════════════════════════════════════════════════════════
   ██████  ONYX — PADEL ANALYTICS SHOWCASE
   #showcase — book-style, CSS sticky pin, 320vh scroll height
══════════════════════════════════════════════════════════════════ */

.onyx-section {
    position:   relative;
    height:     320vh;      /* book open + rally + close scroll travel */
    background: #e9e6c8;    /* cream matches Three.js scene background */
}

.onyx-stage {
    position:        sticky;
    top:             0;
    width:           100%;
    height:          100vh;
    overflow:        hidden;
    background:      #e9e6c8;
    display:         flex;
    align-items:     center;
    justify-content: center;
}

/* 16:9 box — Three.js renderer appended here by JS */
#onyx-book {
    position:    relative;
    width:       100%;
    max-width:   1600px;
    height:      56.25vw;   /* 9/16 viewport-width = true 16:9 at any width */
    max-height:  900px;     /* cap at 1600×900 */
    overflow:    hidden;
    flex-shrink: 0;
    background:  #e9e6c8;   /* cream fallback while GL initialises */
}
#onyx-book canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Scroll hint */
.onyx-hint {
    position:       absolute;
    bottom:         6%;
    left:           50%;
    transform:      translateX(-50%);
    font-family:    ui-monospace, Menlo, monospace;
    font-size:      13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color:          #6b6a4e;
    opacity:        0.7;
    transition:     opacity 0.5s;
    pointer-events: none;
    white-space:    nowrap;
}

/* ── Overlay (section tag only, cream-on-cream toned) ── */
.onyx-overlay {
    position:       absolute;
    inset:          0;
    pointer-events: none;
    z-index:        10;
    display:        flex;
    flex-direction: column;
    padding:        32px 44px;
}

.onyx-top-bar {
    display:         flex;
    justify-content: space-between;
    align-items:     flex-start;
}

.onyx-section-tag {
    font-size:      9px;
    letter-spacing: 0.2em;
    color:          rgba(60, 55, 40, 0.38);
}

/* Spacer pushes panel to bottom */
.onyx-flex-spacer { flex: 1; }

/* ── Bottom text panel ── */
.onyx-panel     { max-width: 460px; }

/* ── World-locked annotation dots ── */
.onyx-annos { position: absolute; inset: 0; pointer-events: none; z-index: 12; }

.onyx-anno {
    position:    absolute;
    top:         0;
    left:        0;
    width:       0;
    height:      0;
    opacity:     0;
    transition:  opacity 0.5s ease;
    will-change: transform, opacity;
}

.onyx-anno.is-in { opacity: 1; }

/* amber dot — pops on blue court and cream background */
.onyx-anno-dot {
    position:      absolute;
    left:          -5px;
    top:           -5px;
    width:         11px;
    height:        11px;
    border-radius: 50%;
    background:    #e0a11a;
    box-shadow:    0 0 0 5px rgba(224,161,26,0.20), 0 0 0 1px rgba(26,42,56,0.40);
}

.onyx-anno-dot::after {
    content:       "";
    position:      absolute;
    left:          3.5px;
    top:           3.5px;
    width:         4px;
    height:        4px;
    border-radius: 50%;
    background:    #fff;
}

/* cream card keeps text legible over any background */
.onyx-anno-label {
    position:        absolute;
    top:             -14px;
    width:           236px;
    padding:         11px 15px;
    background:      rgba(233,230,200,0.94);
    border-radius:   3px;
    border-left:     3px solid #e0a11a;
    box-shadow:      0 6px 20px rgba(26,42,56,0.16);
    backdrop-filter: blur(2px);
    font:            400 12.5px/1.5 "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
    color:           #33475a;
    letter-spacing:  0.005em;
}

.onyx-anno-label b {
    display:        block;
    margin-bottom:  5px;
    font:           700 11px/1.25 "Space Mono", ui-monospace, monospace;
    color:          #1a2a38;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.onyx-anno[data-side="left"]  .onyx-anno-label { left: 30px; }

.onyx-anno[data-side="right"] .onyx-anno-label {
    right:        30px;
    border-left:  none;
    border-right: 3px solid #e0a11a;
    text-align:   right;
}

/* ── Overlay title block (top-left of stage) ── */
.onyx-title-block {
    position:       absolute;
    top:            9%;
    left:           6%;
    max-width:      32%;
    pointer-events: none;
}

.onyx-eyebrow {
    font:           700 11px/1 "Space Mono", ui-monospace, monospace;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color:          #3f74ba;
}

.onyx-title {
    margin:         0.28em 0 0.12em;
    font:           800 clamp(42px, 6vw, 92px)/0.92 "Space Grotesk", sans-serif;
    letter-spacing: -0.02em;
    color:          #1a2a38;
}

.onyx-subtitle {
    font:      400 14px/1.4 "Space Grotesk", sans-serif;
    color:     #33475a;
    max-width: 18ch;
}

/* ── (legacy panel — unused in new design) ── */
.onyx-panel-eyebrow {
    font-size:      9px;
    letter-spacing: 0.22em;
    color:          rgba(0, 229, 255, 0.55);
    margin-bottom:  10px;
}

.onyx-panel-title {
    font-family:    var(--font-display);
    font-size:      clamp(54px, 7.5vw, 104px);
    line-height:    0.92;
    color:          #fff;
    margin:         0 0 18px;
    font-weight:    900;
    letter-spacing: -0.02em;
}

.onyx-panel-copy {
    font-size:   13px;
    line-height: 1.65;
    color:       rgba(255, 255, 255, 0.50);
    max-width:   320px;
    margin:      0;
}

/* ── HUD widget container ── */
.onyx-hud {
    display:        flex;
    flex-direction: column;
    gap:            10px;
    align-items:    flex-end;
    pointer-events: auto;
    min-height:     0;
}

/* Scoreboard */
.onyx-scoreboard {
    background:      rgba(0, 0, 0, 0.68);
    border:          1px solid rgba(0, 229, 255, 0.22);
    border-radius:   2px;
    padding:         14px 18px;
    min-width:       200px;
    backdrop-filter: blur(8px);
}
.onyx-sb-label  { font-size: 8px; letter-spacing: 0.18em; color: rgba(0,229,255,0.5); margin-bottom: 8px; }
.onyx-sb-score  { display: flex; align-items: center; gap: 6px; }
.onyx-sb-team   { font-size: 9px; letter-spacing: 0.14em; color: rgba(255,255,255,0.45); }
.onyx-sb-num    { font-family: var(--font-display); font-size: 30px; color: #fff; line-height: 1; }
.onyx-sb-sep    { font-size: 18px; color: rgba(255,255,255,0.22); }
.onyx-sb-detail { font-size: 8px; letter-spacing: 0.14em; color: rgba(255,255,255,0.28); margin-top: 6px; }

/* Chips */
.onyx-chip-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.onyx-chip {
    font-size:      8px;
    letter-spacing: 0.14em;
    background:     rgba(0, 229, 255, 0.07);
    border:         1px solid rgba(0, 229, 255, 0.28);
    border-radius:  2px;
    padding:        4px 8px;
    color:          rgba(0, 229, 255, 0.75);
}
.onyx-stat-mini {
    font-size:      9px;
    color:          rgba(255, 255, 255, 0.38);
    letter-spacing: 0.12em;
    text-align:     right;
    margin-top:     2px;
}
.onyx-stat-mini strong { color: #fff; }

/* Trail panel */
.onyx-trail-panel {
    background:      rgba(0, 0, 0, 0.62);
    border:          1px solid rgba(0, 229, 255, 0.18);
    border-radius:   2px;
    padding:         12px 16px;
    backdrop-filter: blur(6px);
}
.onyx-tp-row { font-size: 9px; letter-spacing: 0.14em; color: rgba(255,255,255,0.42); padding: 3px 0; }
.onyx-tp-row strong { color: #fff; }

/* Classifier */
.onyx-classifier {
    background:      rgba(0, 0, 0, 0.68);
    border:          1px solid rgba(0, 229, 255, 0.22);
    border-radius:   2px;
    padding:         12px 16px;
    min-width:       160px;
    backdrop-filter: blur(6px);
}
.onyx-clf-badge  { font-size: 12px; letter-spacing: 0.2em; color: #00E5FF; margin-bottom: 4px; }
.onyx-clf-conf   { font-size: 8px; letter-spacing: 0.14em; color: rgba(255,255,255,0.32); margin-bottom: 8px; }
.onyx-clf-conf strong { color: rgba(255,255,255,0.65); }
.onyx-clf-grid   {
    display:        grid;
    grid-template-columns: 1fr 1fr;
    gap:            4px;
    font-size:      8px;
    letter-spacing: 0.12em;
    color:          rgba(255,255,255,0.28);
}
.onyx-clf-active { color: #00E5FF; }

/* Heatmap legend */
.onyx-heatmap-legend {
    background:      rgba(0, 0, 0, 0.62);
    border:          1px solid rgba(0, 229, 255, 0.18);
    border-radius:   2px;
    padding:         12px 16px;
    min-width:       180px;
    backdrop-filter: blur(6px);
}
.onyx-hm-title { font-size: 8px; letter-spacing: 0.18em; color: rgba(0,229,255,0.55); margin-bottom: 8px; }
.onyx-hm-bar   { display: flex; align-items: center; gap: 6px; }
.onyx-hm-lo, .onyx-hm-hi { font-size: 7px; letter-spacing: 0.12em; color: rgba(255,255,255,0.32); }
.onyx-hm-gradient {
    flex:          1;
    height:        6px;
    border-radius: 3px;
    background:    linear-gradient(to right, #0A1A2A, #00E5FF);
}

/* Dashboard panels */
.onyx-dash-panels { display: flex; gap: 8px; }
.onyx-dp {
    background:      rgba(0, 0, 0, 0.68);
    border:          1px solid rgba(0, 229, 255, 0.18);
    border-radius:   2px;
    padding:         10px 14px;
    text-align:      center;
    backdrop-filter: blur(6px);
    min-width:       72px;
}
.onyx-dp-val { font-family: var(--font-display); font-size: 22px; color: #fff; line-height: 1; margin-bottom: 4px; }
.onyx-dp-lbl { font-size: 7px; letter-spacing: 0.16em; color: rgba(0,229,255,0.5); }

/* CTA */
.onyx-cta     { text-align: right; }
.onyx-cta-sub { font-size: 8px; letter-spacing: 0.2em; color: rgba(255,255,255,0.28); margin: 0 0 12px; }
.onyx-cta-btn {
    display:        inline-block;
    font-size:      10px;
    letter-spacing: 0.2em;
    color:          #00E5FF;
    border:         1px solid rgba(0, 229, 255, 0.4);
    padding:        10px 20px;
    border-radius:  2px;
    pointer-events: auto;
    text-decoration:none;
    transition:     background 0.22s;
}
.onyx-cta-btn:hover { background: rgba(0, 229, 255, 0.10); }

/* ── Chapter-change animations (CSS, not GSAP — survives rapid scrubbing) ── */
@keyframes onyx-flash {
    from { opacity: 0.45; transform: translateY(6px); }
    to   { opacity: 1;    transform: translateY(0);   }
}
.onyx-flash { animation: onyx-flash 0.38s cubic-bezier(0.22, 1, 0.36, 1) both; }

@keyframes onyx-hud-slide {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0);    }
}
.onyx-hud-in { animation: onyx-hud-slide 0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ── Chapter progress dots ── */
.onyx-dots {
    position:  absolute;
    bottom:    36px;
    left:      50%;
    transform: translateX(-50%);
    display:   flex;
    gap:       8px;
    pointer-events: none;
}
.onyx-dot {
    width:         6px;
    height:        6px;
    border-radius: 50%;
    background:    rgba(255, 255, 255, 0.18);
    transition:    background 0.3s, transform 0.3s;
}
.onyx-dot.is-active {
    background: #00E5FF;
    transform:  scale(1.4);
}

/* ── Mobile / reduced-motion fallback ── */
.onyx-fallback {
    display:         none;   /* shown by JS on mobile */
    min-height:      100vh;
    align-items:     center;
    justify-content: center;
    background:      #e9e6c8;
    padding:         clamp(64px, 10vh, 120px) clamp(24px, 6vw, 80px);
}
.onyx-fallback-inner { max-width: 540px; }
.onyx-fallback-inner .onyx-section-tag {
    display:       block;
    margin-bottom: 20px;
    color:         rgba(60, 55, 40, 0.5);
}
.onyx-fallback-title {
    font-family:    var(--font-display);
    font-size:      clamp(72px, 16vw, 140px);
    line-height:    0.9;
    color:          #1a1810;
    margin:         0 0 24px;
    font-weight:    900;
    letter-spacing: -0.03em;
}
.onyx-fallback-sub  { font-size: 14px; line-height: 1.7; color: rgba(30,28,18,0.55); margin: 0 0 32px; }
.onyx-feature-list  { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.onyx-feature-list li {
    font-size:      10px;
    letter-spacing: 0.16em;
    color:          rgba(47, 111, 176, 0.75);
    padding-left:   18px;
    position:       relative;
}
.onyx-feature-list li::before { content: '→'; position: absolute; left: 0; color: rgba(47,111,176,0.45); }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .onyx-overlay { padding: 28px 32px 40px; }
    .onyx-panel-title { font-size: clamp(44px, 7vw, 80px); }
}

/* Portrait phones: keep the 3D scene, but shorten the scroll runway
   so the whole sequence fits inside a couple of swipes, and tighten
   the HUD padding so the callouts don't crowd the small viewport. */
@media (max-width: 600px) {
    .onyx-section { height: 220vh; }
    .onyx-hud     { padding: 16px 16px; }
    .onyx-eyebrow, .onyx-stage-name { font-size: 9px; letter-spacing: 0.14em; }
    .onyx-scroll-hint { font-size: 9px; padding: 6px 10px; letter-spacing: 0.16em; }
    /* Callout label — narrower + smaller type on portrait */
    .onyx-callout       { width: 180px; padding: 10px 12px 12px; border-left-width: 2px; }
    .onyx-callout-title { font-size: 16px; margin-bottom: 6px; }
    .onyx-callout-body  { font-size: 10.5px; line-height: 1.5; }
    .onyx-callout-kicker{ font-size: 9px; margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    .onyx-section  { height: auto; }
    .onyx-stage    { display: none; }
    .onyx-fallback { display: flex; }
}

/* ══════════════════════════════════════════════════════════════
     ONYX · CALLOUT HUD
     Editorial technical-drawing overlay. One callout visible at a
     time; hairline leader emerges from a live 3D anchor. Type uses
     the site tokens — JetBrains Mono kicker, Inter body, accent blue.
══════════════════════════════════════════════════════════════════ */

.onyx-hud {
    position: absolute; inset: 0;
    z-index: 8;
    pointer-events: none;
    display: flex; flex-direction: column;
    padding: 24px 32px;
}
.onyx-hud-top {
    display: flex; justify-content: space-between; align-items: baseline;
}
.onyx-hud-bot {
    margin-top: auto;
    display: flex; justify-content: center;
}
.onyx-eyebrow,
.onyx-stage-name {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bg-ink);
    opacity: 0.55;
}
.onyx-stage-name {
    color: var(--accent);
    opacity: 0.85;
    transition: opacity 0.28s ease;
}
.onyx-scroll-hint {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--bg-ink);
    padding: 8px 14px;
    border: 1px solid rgba(11,14,20,0.20);
    border-radius: 999px;
    background: rgba(236,234,227,0.65);
    opacity: 0.65;
    transition: opacity 0.6s ease;
}
.onyx-scroll-hint.is-hidden { opacity: 0; }

/* SVG line layer — sits above 3D canvas, below labels.
   Leader is a hairline polyline with a right-angle bend for a
   technical-drawing feel; small dot marks the 3D anchor. */
.onyx-lines {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    z-index: 6;
    pointer-events: none;
    overflow: visible;
}
/* Asymmetric fade: OUT fast (0.18s, no delay), IN slower with a
   0.20s wait so the previous callout fully clears the frame first —
   strictly one fact visible at a time. */
.onyx-lines polyline {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1;
    stroke-linecap: square;
    stroke-linejoin: miter;
    opacity: 0;
    transition: opacity 0.18s ease;
}
.onyx-lines polyline.is-in {
    opacity: 0.85;
    transition: opacity 0.35s ease 0.20s;
}
.onyx-lines circle {
    fill: var(--accent);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.onyx-lines circle.is-in {
    opacity: 1;
    transition: opacity 0.35s ease 0.20s;
}

/* Callout label layer — labels land in a single fixed reading zone
   on the right so the reader always knows where to look. Only the
   line's start (the 3D anchor) moves; the box stays put. */
.onyx-labels {
    position: absolute; inset: 0;
    z-index: 7;
    pointer-events: none;
}
.onyx-callout {
    position: absolute; top: 0; left: 0;
    width: 280px;
    padding: 16px 18px 18px;
    background: rgba(236,234,227,0.94);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
    border-top: 1px solid rgba(11,14,20,0.15);
    border-bottom: 1px solid rgba(11,14,20,0.15);
    border-left: 2px solid var(--accent);
    opacity: 0;
    will-change: transform, opacity;
    transition: opacity 0.18s ease;              /* fast fade OUT */
    box-shadow: 0 12px 32px -18px rgba(11,14,20,0.35);
}
.onyx-callout.is-in {
    opacity: 1;
    transition: opacity 0.35s ease 0.20s;        /* delayed fade IN */
}
.onyx-callout-kicker {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}
.onyx-callout-title {
    display: block;
    font-family: var(--font-display);
    font-size: 26px;
    line-height: 1.02;
    letter-spacing: 0.005em;
    color: var(--bg-ink);
    text-transform: uppercase;
    margin-bottom: 10px;
}
.onyx-callout-body {
    font-family: var(--font-body);
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--bg-ink);
    opacity: 0.72;
}

/* Narrow-desktop: tighten spacing */
@media (max-width: 1024px) {
    .onyx-hud { padding: 20px 20px; }
    .onyx-callout {
        width: 220px;
        padding: 12px 14px 14px;
    }
    .onyx-callout-title { font-size: 20px; }
    .onyx-callout-body  { font-size: 11.5px; }
}


/* ══════════════════════════════════════════════════════════════
     ██████  SKILLS · FILING CABINET
     Section: #skills  · JS: js/skills.js
     Photocopied-blueprint style. Manila folders stacked in a
     drawer; hover lifts, click pops into a boxed detail sheet.
══════════════════════════════════════════════════════════════════ */

.sk-section {
    position: relative;
    padding: 96px clamp(20px, 5vw, 56px) 140px;
    background: var(--bg-paper);
    color: var(--bg-ink);
    min-height: 100vh;
    overflow: hidden;
}

/* Faint blueprint grid — mirrors the Projects-section overlay, tinted to
   the ink instead of white so it reads on paper without demanding focus. */
.sk-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(11,14,20,0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11,14,20,0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
    z-index: 0;
}

/* ── Section header — mirrors .proj-header shape/tone, tinted for paper ── */
.sk-header {
    position: relative; z-index: 2;
    max-width: 1100px;
    margin: 0 auto 48px;
    padding: 0 8px;
}
.sk-section-num {
    color: rgba(11,14,20,0.45);
    font-size: 9px;
    letter-spacing: 0.16em;
    margin-bottom: 8px;
}
.sk-title {
    font-family: var(--font-display);
    font-size: clamp(64px, 11vw, 160px);
    color: var(--bg-ink);
    line-height: 0.88;
    letter-spacing: 0.01em;
    margin: 0;
    font-weight: 400;
}
.sk-chip-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.sk-chip {
    border: 1px solid rgba(11,14,20,0.28);
    padding: 4px 11px;
    color: rgba(11,14,20,0.60);
    font-size: 9px;
    letter-spacing: 0.12em;
}
.sk-quicknote {
    color: rgba(11,14,20,0.45);
    font-size: 9px;
    letter-spacing: 0.10em;
}

/* Stage that holds folders + drawer.
   Drawer follows the folder stack in normal flow but with a negative
   margin so it visually overlaps the folder bodies — folders read as
   sitting IN the drawer, only tabs and a thin front edge showing. */
.sk-stage {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    perspective: 1200px;
}
.sk-folders {
    position: relative;
    list-style: none;
    padding: 0;
    margin: 0;
    height: 320px;           /* fits 200 folder + 112 stagger for 7 gaps */
    transform-style: preserve-3d;
}
.sk-folder {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 780px;
    height: 200px;           /* 40 tab + 160 body — same as JS constants */
    transform: translate(-50%, 0);
    transform-origin: 50% 100%;
    will-change: transform, opacity;
    cursor: pointer;
    outline: none;
}
.sk-folder-svg {
    display: block;
    width: 100%; height: 100%;
    color: var(--bg-ink);
    overflow: visible;
}
.sk-folder-body {
    fill: var(--bg-paper);
    stroke: var(--bg-ink);
    stroke-width: 1.5;
}
.sk-folder-tabtext {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    fill: var(--bg-ink);
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}
/* Hover: tab inverts to blueprint accent + paper text — same accent used
   for section title highlight, so the whole page uses one accent language. */
.sk-folder.is-hover .sk-folder-tab-fill { fill: var(--accent); }
.sk-folder.is-hover .sk-folder-tabtext  { fill: var(--bg-paper); }

/* Tiny descriptor line beside tab on hover */
.sk-folder-descriptor {
    position: absolute;
    top: -6px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bg-ink);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.28s ease;
    padding-left: 12px;
    border-left: 1.5px solid var(--bg-ink);
}
.sk-folder.is-hover .sk-folder-descriptor { opacity: 0.75; }

/* Drawer panel — trapezoid with 3-line handle. Pulled up 92px so it
   overlaps the folder bodies; only tabs + ~8px front edge peek above. */
.sk-drawer {
    position: relative;
    margin-top: -118px;
    height: 130px;
    color: var(--bg-ink);
    pointer-events: none;
    z-index: 200;            /* draws above folder bodies */
}
.sk-drawer svg { width: 100%; height: 100%; overflow: visible; }

/* Boxed summary strip — quiet hairline border, accent labels */
.sk-caption {
    position: relative; z-index: 2;
    display: flex;
    justify-content: stretch;
    max-width: 900px;
    margin: 32px auto 0;
    border: 1px solid rgba(11,14,20,0.20);
    background: rgba(236,234,227,0.65);
}
.sk-cap-cell {
    flex: 1;
    display: flex; flex-direction: column;
    gap: 6px;
    padding: 14px 20px;
    font-size: 11px; letter-spacing: 0.16em;
}
.sk-cap-cell + .sk-cap-cell { border-left: 1px solid rgba(11,14,20,0.20); }
.sk-cap-cell span { color: var(--accent); opacity: 0.85; font-size: 9px; letter-spacing: 0.20em; }
.sk-cap-cell b { font-weight: 400; color: var(--bg-ink); }

/* ── CV download row ── same hairline + accent language as .sk-caption */
.sk-cv-row {
    position: relative; z-index: 2;
    max-width: 900px;
    margin: 18px auto 0;
    display: flex;
    justify-content: flex-end;
}
.sk-cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border: 1px solid var(--bg-ink);
    background: var(--bg-paper);
    color: var(--bg-ink);
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 0.20em;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
    position: relative;
}
.sk-cv-btn::before {
    /* small accent-blue tick in the top-left corner, mirrors .sk-chip vibe */
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 8px; height: 8px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
}
.sk-cv-btn:hover,
.sk-cv-btn:focus-visible {
    background: var(--bg-ink);
    color: var(--bg-paper);
    transform: translateY(-1px);
}
.sk-cv-btn:hover .sk-cv-meta,
.sk-cv-btn:focus-visible .sk-cv-meta { color: var(--accent-2); }
.sk-cv-label { font-weight: 500; }
.sk-cv-meta {
    font-size: 9px;
    letter-spacing: 0.18em;
    color: var(--accent);
    opacity: 0.9;
    transition: color 0.22s ease;
}
.sk-cv-arrow {
    width: 16px; height: 16px;
    flex-shrink: 0;
    color: var(--accent);
    transition: transform 0.22s ease, color 0.22s ease;
}
.sk-cv-btn:hover .sk-cv-arrow { transform: translateY(2px); color: var(--accent-2); }

/* ── Opened detail sheet (modal) ── */
.sk-sheet-wrap {
    position: fixed; inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.sk-sheet-wrap[hidden] { display: none; }
.sk-scrim {
    position: absolute; inset: 0;
    background: rgba(11,14,20,0.62);
    opacity: 0;
    transition: opacity 0.35s ease;
    cursor: pointer;
}
.sk-sheet-wrap.is-in .sk-scrim { opacity: 1; }
.sk-sheet {
    position: relative;
    width: min(740px, 100%);
    max-height: 84vh;
    background: var(--bg-paper);
    color: var(--bg-ink);
    border: 1.5px solid var(--bg-ink);
    display: flex; flex-direction: column;
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    outline: none;
}
.sk-sheet-wrap.is-in .sk-sheet {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.sk-close {
    position: absolute; top: 8px; right: 12px;
    z-index: 3;
    background: transparent; border: none;
    font-family: var(--font-mono);
    font-size: 22px; line-height: 1;
    color: var(--bg-paper);
    cursor: pointer;
    padding: 0;
}
.sk-close:hover { opacity: 0.75; }
.sk-sheet-inner {
    display: flex; flex-direction: column;
    height: 100%;
}

/* Sheet · header bar — blueprint blue to match the site accent language */
.sk-sh-header {
    background: var(--accent);
    color: var(--bg-paper);
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 22px;
}
.sk-sh-title {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin: 0;
}
.sk-sh-index {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.20em;
    opacity: 0.65;
}

/* Sheet · body (scrolls internally if long) */
.sk-sh-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
    display: flex; flex-direction: column;
    gap: 18px;
}

/* Sheet · sections stagger in */
.sk-sh-block { opacity: 0; transform: translateY(8px); }

.sk-sh-summary {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.65;
    margin: 0;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--bg-ink);
}

.sk-sh-level {
    display: flex; align-items: center; gap: 14px;
}
.sk-sh-level-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.9;
}
.sk-sq-row { display: flex; gap: 4px; }
.sk-sq {
    width: 16px; height: 16px;
    border: 1.5px solid var(--bg-ink);
}
.sk-sq.is-on { background: var(--accent); border-color: var(--accent); }

.sk-sh-tools {
    list-style: none;
    padding: 0; margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 24px;
}
.sk-tool {
    display: flex; align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(11,14,20,0.20);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateX(-6px);
}
.sk-tool-glyph {
    color: var(--accent);
    opacity: 0.85;
    margin-right: 10px;
    font-family: var(--font-mono);
}
.sk-tool-name { flex: 1; }
.sk-tool-lvl { display: flex; gap: 2px; margin-left: 10px; }
.sk-tool-lvl span {
    width: 6px; height: 6px;
    border: 1px solid var(--bg-ink);
}
.sk-tool-lvl span.is-on { background: var(--accent); border-color: var(--accent); }

/* Sheet · APPLIED IN box (weighted) */
.sk-sh-applied {
    border: 1.5px solid var(--bg-ink);
    padding: 14px 18px;
}
.sk-sh-applied-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.9;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(11,14,20,0.20);
}
.sk-sh-applied-text {
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.65;
    margin: 0;
}
.sk-sh-note {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    opacity: 0.5;
    text-align: right;
    margin: 0;
}

/* ── Mobile: swap 3D stack for vertical accordion tabs ── */
@media (max-width: 768px) {
    .sk-section { padding: 80px 20px 100px; }
    .sk-stage { padding-bottom: 60px; perspective: none; }
    .sk-folders {
        height: auto;
        display: flex; flex-direction: column;
        gap: 6px;
    }
    .sk-folder {
        position: relative;
        /* JS sets inline `bottom` (0-112px) for the desktop drawer stack;
           on mobile we're a flat accordion so force those offsets off. */
        left: 0 !important; bottom: 0 !important;
        width: 100%; height: auto;
        transform: none !important;
    }
    .sk-folder-svg { display: none; }
    .sk-folder::before {
        content: attr(data-tab);
        display: block;
        padding: 14px 18px;
        border: 1.5px solid var(--bg-ink);
        font-family: var(--font-mono);
        font-size: 11px;
        letter-spacing: 0.20em;
        text-transform: uppercase;
        background: var(--bg-paper);
    }
    .sk-folder.is-hover::before {
        background: var(--bg-ink);
        color: var(--bg-paper);
    }
    .sk-folder-descriptor { display: none; }
    .sk-drawer { height: 60px; }
    .sk-caption { flex-direction: column; }
    .sk-cap-cell + .sk-cap-cell { border-left: none; border-top: 1.5px solid var(--bg-ink); }
    .sk-sh-tools { grid-template-columns: 1fr; }

    /* CV button — full-width, centered, larger tap target */
    .sk-cv-row { margin-top: 14px; justify-content: stretch; }
    .sk-cv-btn { width: 100%; justify-content: center; padding: 16px 18px; font-size: 12px; }
}

/* Reduced motion: no lift / no spring / no scale */
@media (prefers-reduced-motion: reduce) {
    .sk-folder { transition: none !important; }
    .sk-sheet, .sk-scrim { transition: opacity 0.2s ease !important; transform: none !important; }
    .sk-sh-block, .sk-tool { opacity: 1 !important; transform: none !important; }
}
