/* ===== DESIGN TOKENS ===== */
/* The shimmer animations run on a few updates per second (steps; 12/s, 24/s for the big hero name) instead of every frame: they sweep soft gradients
   across text, which can't be composited on the GPU, so every frame is a full repaint. */

/* Theme colours are registered custom properties, so switching theme interpolates them (see :root transition). */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #101215; }
@property --panel { syntax: "<color>"; inherits: true; initial-value: #181b20; }
@property --panel-strong { syntax: "<color>"; inherits: true; initial-value: #1e2228; }
@property --footer { syntax: "<color>"; inherits: true; initial-value: #0c0e10; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #050505; }
@property --ink-solid { syntax: "<color>"; inherits: true; initial-value: #000000; }
@property --text { syntax: "<color>"; inherits: true; initial-value: #f4f5f7; }
@property --muted { syntax: "<color>"; inherits: true; initial-value: #c4c8d0; }
@property --accent-green { syntax: "<color>"; inherits: true; initial-value: #c6c6c6; }
@property --accent-pink { syntax: "<color>"; inherits: true; initial-value: #bdbdbd; }
@property --accent-gold { syntax: "<color>"; inherits: true; initial-value: #b4b4b4; }
@property --accent-orange { syntax: "<color>"; inherits: true; initial-value: #b0b0b0; }
@property --text-strong { syntax: "<color>"; inherits: true; initial-value: #e9e9e9; }
@property --muted-strong { syntax: "<color>"; inherits: true; initial-value: #d2d6dd; }
@property --white { syntax: "<color>"; inherits: true; initial-value: #ffffff; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #6c6c6c; }
@property --accent-2 { syntax: "<color>"; inherits: true; initial-value: #c6c6c6; }
@property --bg-grad-1 { syntax: "<color>"; inherits: true; initial-value: #121418; }
@property --bg-grad-2 { syntax: "<color>"; inherits: true; initial-value: #14171b; }
@property --bg-grad-3 { syntax: "<color>"; inherits: true; initial-value: #16191e; }
@property --bg-grad-4 { syntax: "<color>"; inherits: true; initial-value: #131619; }
@property --bg-grad-5 { syntax: "<color>"; inherits: true; initial-value: #101215; }
@property --bg-grad-6 { syntax: "<color>"; inherits: true; initial-value: #0e1013; }
@property --glass-01 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.01); }
@property --glass-03 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.03); }
@property --glass-04 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.04); }
@property --glass-05 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.05); }
@property --glass-08 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.08); }
@property --glass-10 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.1); }
@property --glass-12 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.12); }
@property --glass-15 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.15); }
@property --glass-16 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.16); }
@property --glass-20 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.2); }
@property --glass-25 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.25); }
@property --glass-55 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.55); }
@property --ink-16 { syntax: "<color>"; inherits: true; initial-value: rgba(0,0,0,0.16); }
@property --ink-25 { syntax: "<color>"; inherits: true; initial-value: rgba(0,0,0,0.25); }
@property --ink-40 { syntax: "<color>"; inherits: true; initial-value: rgba(0,0,0,0.4); }
@property --ink-45 { syntax: "<color>"; inherits: true; initial-value: rgba(0,0,0,0.45); }
@property --accent-gold-30 { syntax: "<color>"; inherits: true; initial-value: rgba(180, 180, 180, 0.3); }
@property --accent-gold-25 { syntax: "<color>"; inherits: true; initial-value: rgba(180, 180, 180, 0.25); }
@property --accent-gold-12 { syntax: "<color>"; inherits: true; initial-value: rgba(180, 180, 180, 0.12); }
@property --accent-gold-10 { syntax: "<color>"; inherits: true; initial-value: rgba(180, 180, 180, 0.1); }
@property --accent-gold-05 { syntax: "<color>"; inherits: true; initial-value: rgba(180, 180, 180, 0.05); }
@property --accent-gold-20 { syntax: "<color>"; inherits: true; initial-value: rgba(180, 180, 180, 0.2); }
@property --accent-2-08 { syntax: "<color>"; inherits: true; initial-value: rgba(200, 200, 200, 0.08); }
@property --accent-2-16 { syntax: "<color>"; inherits: true; initial-value: rgba(200, 200, 200, 0.16); }
@property --accent-2-20 { syntax: "<color>"; inherits: true; initial-value: rgba(200, 200, 200, 0.2); }
@property --nav-link { syntax: "<color>"; inherits: true; initial-value: rgba(205,210,220,0.75); }
@property --muted-trail { syntax: "<color>"; inherits: true; initial-value: rgba(191,191,191,0.35); }
@property --line { syntax: "<color>"; inherits: true; initial-value: rgba(255, 255, 255, 0.28); }
@property --ns0 { syntax: "<color>"; inherits: true; initial-value: #7c7c81; }
@property --ns1 { syntax: "<color>"; inherits: true; initial-value: #7383af; }
@property --ns2 { syntax: "<color>"; inherits: true; initial-value: #9faac8; }
@property --ns3 { syntax: "<color>"; inherits: true; initial-value: #bcc5d6; }
@property --ns4 { syntax: "<color>"; inherits: true; initial-value: #a2adbf; }
@property --ns5 { syntax: "<color>"; inherits: true; initial-value: #a09bb7; }
@property --ns6 { syntax: "<color>"; inherits: true; initial-value: #7d8ab3; }
@property --ns7 { syntax: "<color>"; inherits: true; initial-value: #7c7c81; }
@property --h2c0 { syntax: "<color>"; inherits: true; initial-value: rgba(124,124,129,0.10); }
@property --h2c1 { syntax: "<color>"; inherits: true; initial-value: rgba(115,131,175,0.30); }
@property --h2c2 { syntax: "<color>"; inherits: true; initial-value: rgba(159,170,200,0.40); }
@property --h2c3 { syntax: "<color>"; inherits: true; initial-value: rgba(188,197,214,0.45); }
@property --h2c4 { syntax: "<color>"; inherits: true; initial-value: rgba(162,173,191,0.38); }
@property --h2c5 { syntax: "<color>"; inherits: true; initial-value: rgba(160,155,183,0.32); }
@property --h2c6 { syntax: "<color>"; inherits: true; initial-value: rgba(125,138,179,0.28); }
@property --h2c7 { syntax: "<color>"; inherits: true; initial-value: rgba(124,124,129,0.10); }
@property --wmv { syntax: "<color>"; inherits: true; initial-value: #ffffff; }
@property --h2v { syntax: "<color>"; inherits: true; initial-value: #ffffff; }
@property --card-g0 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.10); }
@property --card-g1 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.03); }
@property --card-g2 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.06); }
@property --card-in { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.04); }
@property --card-in2 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.09); }
@property --card-drop { syntax: "<color>"; inherits: true; initial-value: rgba(0,0,0,0); }
@property --card-drop2 { syntax: "<color>"; inherits: true; initial-value: rgba(0,0,0,0); }
@property --card-fade { syntax: "<color>"; inherits: true; initial-value: rgba(6,6,6,0.85); }
@property --art-glow { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.16); }
@property --art-a { syntax: "<color>"; inherits: true; initial-value: #181818; }
@property --art-b { syntax: "<color>"; inherits: true; initial-value: #0a0a0a; }
@property --panel-g0 { syntax: "<color>"; inherits: true; initial-value: rgba(30,30,32,0.78); }
@property --panel-g1 { syntax: "<color>"; inherits: true; initial-value: rgba(14,14,15,0.86); }
@property --panel-sh { syntax: "<color>"; inherits: true; initial-value: rgba(0,0,0,0); }
@property --gb-g0 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.16); }
@property --gb-g1 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.05); }
@property --gb-g2 { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.09); }
@property --gb-in { syntax: "<color>"; inherits: true; initial-value: rgba(255,255,255,0.05); }
@property --gb-drop { syntax: "<color>"; inherits: true; initial-value: rgba(0,0,0,0.35); }
@property --wmf { syntax: "<number>"; inherits: true; initial-value: 0; }

:root {
    /* Shared cool shimmer colours: navbar links and the scroll thumb */
    --ns0: #7c7c81;
    --ns1: #7383af;
    --ns2: #9faac8;
    --ns3: #bcc5d6;
    --ns4: #a2adbf;
    --ns5: #a09bb7;
    --ns6: #7d8ab3;
    --ns7: #7c7c81;
    --nav-stops: var(--ns0) 0%, var(--ns1) 14%, var(--ns2) 28%, var(--ns3) 38%, var(--ns4) 50%, var(--ns5) 64%, var(--ns6) 80%, var(--ns7) 100%;
    --h2c0: rgba(124,124,129,0.10);
    --h2c1: rgba(115,131,175,0.30);
    --h2c2: rgba(159,170,200,0.40);
    --h2c3: rgba(188,197,214,0.45);
    --h2c4: rgba(162,173,191,0.38);
    --h2c5: rgba(160,155,183,0.32);
    --h2c6: rgba(125,138,179,0.28);
    --h2c7: rgba(124,124,129,0.10);
    --wmv: #ffffff;
    --h2v: #ffffff;
    --card-g0: rgba(255,255,255,0.10);
    --card-g1: rgba(255,255,255,0.03);
    --card-g2: rgba(255,255,255,0.06);
    --card-in: rgba(255,255,255,0.04);
    --card-in2: rgba(255,255,255,0.09);
    /* no outer shadow in dark mode: black on near-black only leaves a handful of 8-bit steps, which show up as bands */
    --card-drop: rgba(0,0,0,0);
    --card-drop2: rgba(0,0,0,0);
    --card-fade: rgba(6,6,6,0.85);
    --art-glow: rgba(255,255,255,0.16);
    --art-a: #181818;
    --art-b: #0a0a0a;
    --panel-g0: rgba(30,30,32,0.78);
    --panel-g1: rgba(14,14,15,0.86);
    --panel-sh: rgba(0,0,0,0);
    --gb-g0: rgba(255,255,255,0.16);
    --gb-g1: rgba(255,255,255,0.05);
    --gb-g2: rgba(255,255,255,0.09);
    --gb-in: rgba(255,255,255,0.05);
    --gb-drop: rgba(0,0,0,0.35);
    --wmf: 0;
    /* custom properties are not covered by `all`, so every registered one is listed */
    transition:
        --bg 0.6s ease,
        --panel 0.6s ease,
        --panel-strong 0.6s ease,
        --footer 0.6s ease,
        --ink 0.6s ease,
        --ink-solid 0.6s ease,
        --text 0.6s ease,
        --muted 0.6s ease,
        --accent-green 0.6s ease,
        --accent-pink 0.6s ease,
        --accent-gold 0.6s ease,
        --accent-orange 0.6s ease,
        --text-strong 0.6s ease,
        --muted-strong 0.6s ease,
        --white 0.6s ease,
        --accent 0.6s ease,
        --accent-2 0.6s ease,
        --bg-grad-1 0.6s ease,
        --bg-grad-2 0.6s ease,
        --bg-grad-3 0.6s ease,
        --bg-grad-4 0.6s ease,
        --bg-grad-5 0.6s ease,
        --bg-grad-6 0.6s ease,
        --glass-01 0.6s ease,
        --glass-03 0.6s ease,
        --glass-04 0.6s ease,
        --glass-05 0.6s ease,
        --glass-08 0.6s ease,
        --glass-10 0.6s ease,
        --glass-12 0.6s ease,
        --glass-15 0.6s ease,
        --glass-16 0.6s ease,
        --glass-20 0.6s ease,
        --glass-25 0.6s ease,
        --glass-55 0.6s ease,
        --ink-16 0.6s ease,
        --ink-25 0.6s ease,
        --ink-40 0.6s ease,
        --ink-45 0.6s ease,
        --accent-gold-30 0.6s ease,
        --accent-gold-25 0.6s ease,
        --accent-gold-12 0.6s ease,
        --accent-gold-10 0.6s ease,
        --accent-gold-05 0.6s ease,
        --accent-gold-20 0.6s ease,
        --accent-2-08 0.6s ease,
        --accent-2-16 0.6s ease,
        --accent-2-20 0.6s ease,
        --nav-link 0.6s ease,
        --muted-trail 0.6s ease,
        --line 0.6s ease,
        --ns0 0.6s ease,
        --ns1 0.6s ease,
        --ns2 0.6s ease,
        --ns3 0.6s ease,
        --ns4 0.6s ease,
        --ns5 0.6s ease,
        --ns6 0.6s ease,
        --ns7 0.6s ease,
        --h2c0 0.6s ease,
        --h2c1 0.6s ease,
        --h2c2 0.6s ease,
        --h2c3 0.6s ease,
        --h2c4 0.6s ease,
        --h2c5 0.6s ease,
        --h2c6 0.6s ease,
        --h2c7 0.6s ease,
        --wmv 0.6s ease,
        --h2v 0.6s ease,
        --card-g0 0.6s ease,
        --card-g1 0.6s ease,
        --card-g2 0.6s ease,
        --card-in 0.6s ease,
        --card-in2 0.6s ease,
        --card-drop 0.6s ease,
        --card-drop2 0.6s ease,
        --card-fade 0.6s ease,
        --art-glow 0.6s ease,
        --art-a 0.6s ease,
        --art-b 0.6s ease,
        --panel-g0 0.6s ease,
        --panel-g1 0.6s ease,
        --panel-sh 0.6s ease,
        --gb-g0 0.6s ease,
        --gb-g1 0.6s ease,
        --gb-g2 0.6s ease,
        --gb-in 0.6s ease,
        --gb-drop 0.6s ease,
        --wmf 0.6s ease;
        #7c7c81 100%;
    /* Surfaces */
    --bg: #101215;
    --panel: #181b20;
    --panel-strong: #1e2228;
    --footer: #0c0e10;
    --ink: #050505;
    --ink-solid: #000000;

    /* Text */
    --text: #f4f5f7;
    --muted: #c4c8d0;
    --accent-green: #c6c6c6;
    --accent-pink: #bdbdbd;
    --accent-gold: #b4b4b4;
    --accent-orange: #b0b0b0;
    --text-strong: #e9e9e9;
    --muted-strong: #d2d6dd;
    --white: #ffffff;
    --accent: #6c6c6c;
    --accent-2: #c6c6c6;

    /* Background gradients */
    --bg-grad-1: #121418;
    --bg-grad-2: #14171b;
    --bg-grad-3: #16191e;
    --bg-grad-4: #131619;
    --bg-grad-5: #101215;
    --bg-grad-6: #0e1013;

    /* Hero layers */
    --bg-layer-mid: color-mix(in srgb, var(--bg) 82%, #ffffff 18%);
    --bg-layer-back: color-mix(in srgb, var(--bg) 70%, #ffffff 30%);

    /* Glass layers */
    --glass-01: rgba(255,255,255,0.01);
    --glass-03: rgba(255,255,255,0.03);
    --glass-04: rgba(255,255,255,0.04);
    --glass-05: rgba(255,255,255,0.05);
    --glass-08: rgba(255,255,255,0.08);
    --glass-10: rgba(255,255,255,0.1);
    --glass-12: rgba(255,255,255,0.12);
    --glass-15: rgba(255,255,255,0.15);
    --glass-16: rgba(255,255,255,0.16);
    --glass-20: rgba(255,255,255,0.2);
    --glass-25: rgba(255,255,255,0.25);
    --glass-55: rgba(255,255,255,0.55);

    /* Ink shadows */
    --ink-16: rgba(0,0,0,0.16);
    --ink-25: rgba(0,0,0,0.25);
    --ink-40: rgba(0,0,0,0.4);
    --ink-45: rgba(0,0,0,0.45);

    /* Accents (alpha) */
    --accent-gold-30: rgba(180, 180, 180, 0.3);
    --accent-gold-25: rgba(180, 180, 180, 0.25);
    --accent-gold-12: rgba(180, 180, 180, 0.12);
    --accent-gold-10: rgba(180, 180, 180, 0.1);
    --accent-gold-05: rgba(180, 180, 180, 0.05);
    --accent-gold-20: rgba(180, 180, 180, 0.2);
    --accent-2-08: rgba(200, 200, 200, 0.08);
    --accent-2-16: rgba(200, 200, 200, 0.16);
    --accent-2-20: rgba(200, 200, 200, 0.2);

    /* UI states */
    --nav-link: rgba(205,210,220,0.75);
    --muted-trail: rgba(191,191,191,0.35);
        --line: rgba(255, 255, 255, 0.28);
    --border: var(--glass-08);
    --radius: 18px;
    --portrait-opacity: 0.8;
    --text-body-size: clamp(1rem, 0.45vw + 0.85rem, 1.35rem);
    --text-body-line: 1.6;
    --text-body-tracking: 0.01em;
    --text-heading-line: 1.2;
    --text-heading-tracking: -0.01em;
    --text-label-size: clamp(0.78rem, 0.35vw + 0.65rem, 1rem);
    --text-label-line: 1.45;
    --text-label-tracking: 0.08em;
}

/* ===== LIGHT THEME (set on <html data-theme="light">, see src/theme.js) =====
   Palette: Radix Colors (radix-ui.com/colors), an accessible 12-step system.
   Surfaces and the landscape are neutral "sand" greys; text, links, headings and buttons use the saturated
   warm accents. Text gradients mirror the dark theme's cool sheen: where dark mode shimmers toward near-white
   this one dips toward near-black, and its blues/violets become wine red, blood orange and camel beige. */
:root[data-theme="light"] {
    color-scheme: light;
    --ns0: #1f1c1b;
    --ns1: #8a2a18;
    --ns2: #9a3c14;
    --ns3: #151312;
    --ns4: #262221;
    --ns5: #8a2e1c;
    --ns6: #8a2a18;
    --ns7: #1f1c1b;
    --h2c0: #1d1a19;
    --h2c1: #4a1e1c;
    --h2c2: #4d211b;
    --h2c3: #191615;
    --h2c4: #201d1c;
    --h2c5: #4a1f1c;
    --h2c6: #4a1e1c;
    --h2c7: #1d1a19;
    --wmv: #21201c;
    --h2v: rgba(255,255,255,0);
    --card-g0: rgba(255,255,255,0.6);
    --card-g1: rgba(255,255,255,0.35);
    --card-g2: rgba(255,255,255,0.5);
    --card-in: rgba(255,255,255,0.3);
    --card-in2: rgba(255,255,255,0.45);
    --card-drop: rgba(33,32,28,0.14);
    --card-drop2: rgba(33,32,28,0.2);
    --card-fade: rgba(241,240,239,0.94);
    --art-glow: rgba(255,255,255,0.6);
    --art-a: #cfcecb;
    --art-b: #aeada8;
    --panel-g0: rgba(249,249,248,0.88);
    --panel-g1: rgba(233,232,230,0.92);
    --panel-sh: rgba(33,32,28,0.22);
    --gb-g0: rgba(255,255,255,0.6);
    --gb-g1: rgba(255,255,255,0.35);
    --gb-g2: rgba(255,255,255,0.5);
    --gb-in: rgba(255,255,255,0.3);
    --gb-drop: rgba(33,32,28,0.14);
    --wmf: 1;
        #1f1c1b 100%;
    --bg: #e9e8e6;          /* sand 4 */
    --panel: #f1f0ef;       /* sand 3 */
    --panel-strong: #f9f9f8; /* sand 2 */
    --footer: #e2e1de;      /* sand 5 */
    --ink: #dad9d6;
    --ink-solid: #f9f9f8;

    --text: #21201c;        /* sand 12 */
    --muted: #55544f;
    --accent-green: #55544f;
    --accent-pink: #55544f;
    --accent-gold: #63635e; /* sand 11 */
    --accent-orange: #63635e;
    --text-strong: #21201c;
    --muted-strong: #4a4944;
    --white: #21201c;
    --accent: #8d8d86;      /* sand 9 */
    --accent-2: #63635e;

    --bg-grad-1: #eceae8;
    --bg-grad-2: #e9e8e6;
    --bg-grad-3: #e7e6e3;
    --bg-grad-4: #eae9e7;
    --bg-grad-5: #e9e8e6;
    --bg-grad-6: #e5e4e1;

    --bg-layer-mid: color-mix(in srgb, var(--bg) 82%, #000000 18%);
    --bg-layer-back: color-mix(in srgb, var(--bg) 70%, #000000 30%);

    --glass-01: rgba(33,32,28,0.01);
    --glass-03: rgba(33,32,28,0.03);
    --glass-04: rgba(33,32,28,0.04);
    --glass-05: rgba(33,32,28,0.05);
    --glass-08: rgba(33,32,28,0.08);
    --glass-10: rgba(33,32,28,0.1);
    --glass-12: rgba(33,32,28,0.12);
    --glass-15: rgba(33,32,28,0.15);
    --glass-16: rgba(33,32,28,0.16);
    --glass-20: rgba(33,32,28,0.2);
    --glass-25: rgba(33,32,28,0.25);
    --glass-55: rgba(33,32,28,0.55);

    --ink-16: rgba(33,32,28,0.08);
    --ink-25: rgba(33,32,28,0.12);
    --ink-40: rgba(33,32,28,0.18);
    --ink-45: rgba(33,32,28,0.22);

    --accent-gold-30: rgba(99, 99, 94, 0.3);
    --accent-gold-25: rgba(99, 99, 94, 0.25);
    --accent-gold-12: rgba(99, 99, 94, 0.12);
    --accent-gold-10: rgba(99, 99, 94, 0.1);
    --accent-gold-05: rgba(99, 99, 94, 0.05);
    --accent-gold-20: rgba(99, 99, 94, 0.2);
    --accent-2-08: rgba(99, 99, 94, 0.08);
    --accent-2-16: rgba(99, 99, 94, 0.16);
    --accent-2-20: rgba(99, 99, 94, 0.2);

    --nav-link: rgba(33,32,28,0.75);
    --muted-trail: rgba(33,32,28,0.3);
    --line: rgba(33, 32, 28, 0.28);
}

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

html {
    background: var(--bg);
    overscroll-behavior: none; /* no rubber-band bounce past the top or bottom */
    scroll-behavior: smooth;
    scrollbar-width: none; /* replaced by .scroll-thumb (ScrollThumb.jsx) */
}
html::-webkit-scrollbar {
    display: none;
}
body {
    overscroll-behavior: none;
    margin: 0;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    cursor: url("/assets/cursor/arrow.svg") 4 4, auto;
}


a {
    color: inherit;
    text-decoration: none;
    cursor: url("/assets/cursor/hand.svg") 6 2, pointer;
}

button,
input,
select,
textarea,
.Link__github,
.Link__linkedin,
.Link__mail {
    cursor: url("/assets/cursor/hand-pointer.svg") 6 2, pointer;
}

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

.bg-gradient,
.bg-noise {
    position: fixed;
    inset: 0;
    width: 100%;
    pointer-events: none;
}

.bg-gradient {
    height: 100%;
    background: var(--bg);
    z-index: -3;
}

/* Very subtle vignette, just enough to keep the page from feeling flat */
.bg-gradient::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 120% 100% at 50% 45%,
        transparent 55%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
}


.bg-noise {
    z-index: -2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
}


.section {
    position: relative;
    z-index: 1;
    padding: clamp(80px, 10vw, 135px) 0;
}

.hero.section {
    padding-bottom: clamp(72px, 9vw, 120px);
}

.hero.section + .section {
    padding-top: clamp(72px, 9vw, 120px);
    margin-top: calc(-1 * clamp(40px, 7vw, 100px));
}

.container {
    width: min(1200px, 92vw);
    margin: 0 auto;
}

.section-head {
    margin-bottom: 32px;
    z-index: 3;
    width: fit-content;
    max-width: 100%;
    text-align: left;
}

.timeline .section-head {
    margin-bottom: 32px;
}

.section-subtitle {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: var(--text-label-tracking);
    font-weight: 600;
    line-height: var(--text-label-line);
    margin: 40px 0 8px;
    color: var(--muted-strong);
    position: relative;
}

.section-subtitle::after {
    content: "";
    display: block;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--line) 5%,
        var(--line) 95%,
        transparent 100%
    );
    width: 100%;
    margin: 8px 0 14px;
}

.section-subtitle + * {
    margin-left: 0;
    margin-right: 0;
}

.subsection-block + .subsection-block {
    margin-top: 40px;
}

.section--journey .subsection-block + .subsection-block {
    margin-top: 0;
}

.subsection-block .section-subtitle {
    margin-top: 40px;
}

.subsection-block .lede:last-child,
.subsection-block .body:last-child {
    margin-bottom: 0;
}

.section p.lede,
.section p.body {
    display: block;
    width: fit-content;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--bg) 32%, transparent);
    box-shadow: 0 0 18px 10px color-mix(in srgb, var(--bg) 35%, transparent);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(24px, 4vw, 40px);
    row-gap: 0;
    margin-top: 0;
}

.focus-item .section-subtitle {
    margin-top: 40px;
}

.focus-item .lede:last-child {
    margin-bottom: 0;
}

.subsection {
    margin-left: 0;
    margin-right: 0;
}

.lang-block {
    margin-top: 16px;
}

.lang-note {
    color: var(--muted);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: var(--text-label-tracking);
    font-weight: 700;
    color: var(--accent);
    font-size: var(--text-label-size);
    line-height: var(--text-label-line);
    margin: 0 0 12px;
}

.eyebrow--center {
    text-align: center;
}

/* Section headings use the same pearlescent shimmer as the navbar links */
.eyebrow {
    background-image: linear-gradient(100deg, var(--nav-stops));
    background-size: 200% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: nav-link-shimmer 2.6s steps(31) infinite;
}

.section--about .section-subtitle { color: rgba(74, 59, 255, 0.55); }
.section--journey .section-subtitle { color: rgba(110, 255, 82, 0.55); }
.section--focus .section-subtitle { color: rgba(255, 65, 80, 0.55); }
.section--work .section-subtitle { color: rgba(255, 193, 77, 0.55); }
.section--skills .section-subtitle { color: rgba(0, 186, 230, 0.55); }
.section--contact .section-subtitle { color: rgba(255, 97, 217, 0.55); }


h1, h2, h3, .eyebrow, .nav-links a {
    -webkit-user-select: none;
    user-select: none;
}

h1, h2, h3 {
    font-family: inherit;
    margin: 0;
    line-height: var(--text-heading-line);
    letter-spacing: var(--text-heading-tracking);
}

h1 { font-size: clamp(2.2rem, 3.6vw, 3.2rem); line-height: 1.1; }
h2 { font-size: clamp(1.8rem, 2.6vw, 2.4rem); }

/* Section headings share the hero name's soft glass colour and slow sheen (colour only, not the font) */
.section-head h2 {
    color: transparent;
    background: linear-gradient(100deg, var(--h2c0) 0%, var(--h2c1) 14%, var(--h2c2) 28%, var(--h2c3) 38%, var(--h2c4) 50%, var(--h2c5) 64%, var(--h2c6) 80%, var(--h2c7) 100%) 0% 50% / 200% 100% repeat-x,
        linear-gradient(180deg, color-mix(in srgb, var(--h2v) 15.0%, transparent) 0%, color-mix(in srgb, var(--h2v) 17.4%, transparent) 3.5%, color-mix(in srgb, var(--h2v) 20.3%, transparent) 7%, color-mix(in srgb, var(--h2v) 23.6%, transparent) 10.5%, color-mix(in srgb, var(--h2v) 27.4%, transparent) 14%, color-mix(in srgb, var(--h2v) 31.8%, transparent) 17.5%, color-mix(in srgb, var(--h2v) 37.0%, transparent) 21%, color-mix(in srgb, var(--h2v) 43.0%, transparent) 24.5%, color-mix(in srgb, var(--h2v) 50.0%, transparent) 28%, color-mix(in srgb, var(--h2v) 34.0%, transparent) 58%, color-mix(in srgb, var(--h2v) 14.0%, transparent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    animation: nav-link-shimmer 9s steps(108) infinite;
}
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

.lede {
    color: var(--muted);
    font-size: var(--text-body-size);
    line-height: var(--text-body-line);
    letter-spacing: var(--text-body-tracking);
    margin: 0 0 12px;
}

.body {
    color: var(--muted);
    font-size: var(--text-body-size);
    line-height: var(--text-body-line);
    letter-spacing: var(--text-body-tracking);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.8em 1.1em;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    color: #000000;
    background: #ffffff;
    box-shadow: rgba(50, 50, 93, 0.25) 0 2px 5px -1px,
                rgba(0, 0, 0, 0.3) 0 1px 3px -1px;
    transition: transform .2s ease-in-out, background .2s ease-in-out, color .2s ease-in-out;
    cursor: url("/assets/cursor/hand-pointer.svg") 6 2, pointer;
    position: relative;
}

.btn:hover {
    transform: scale(1.1);
    background: #000000;
    color: #ffffff;
}

.btn-primary {
    background: inherit;
    color: inherit;
    border: inherit;
}

.btn-ghost {
    background: inherit;
    border: inherit;
}

.btn:focus-visible {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

.Link__github {
    padding: 0.8em;
    outline: none;
    border: none;
    background: var(--accent);
    box-shadow: rgba(50, 50, 93, 0.25) 0 2px 5px -1px,
                rgba(0, 0, 0, 0.3) 0 1px 3px -1px;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 56px;
}

.Link__github:hover {
    cursor: url("/assets/cursor/hand-pointer.svg") 6 2, pointer;
    transform: scale(1.1);
    background-color: #171515;
}

.Link__github .github {
    fill: #000000;
    transition: fill 0.2s ease-in-out;
}

.Link__github:hover .github {
    fill: #ffffff;
}

.Link__linkedin {
    padding: 0.8em 1em;
    outline: none;
    border: none;
    background: var(--accent);
    color: #000000;
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: 0.04em;
    box-shadow: rgba(50, 50, 93, 0.25) 0 2px 5px -1px,
                rgba(0, 0, 0, 0.3) 0 1px 3px -1px;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 56px;
}

.Link__linkedin:hover {
    cursor: url("/assets/cursor/hand-pointer.svg") 6 2, pointer;
    transform: scale(1.1);
    background-color: #0a66c2;
    color: #ffffff;
}

.Link__mail {
    padding: 0.8em;
    outline: none;
    border: none;
    background: var(--accent);
    color: #000000;
    box-shadow: rgba(50, 50, 93, 0.25) 0 2px 5px -1px,
                rgba(0, 0, 0, 0.3) 0 1px 3px -1px;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 56px;
}

.Link__mail:hover {
    cursor: url("/assets/cursor/hand-pointer.svg") 6 2, pointer;
    transform: scale(1.1);
    background-color: #7FD6FF;
    color: #000000;
}

.Link__mail .mail-icon {
    width: 24px;
    height: 28px;
    fill: currentColor;
    transition: fill 0.2s ease-in-out;
}

.cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0;
    justify-content: flex-start;
}

.chip, .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--glass-05);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.92rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill-group h3 {
    margin-bottom: 8px;
}

.pill-groups {
    display: grid;
    gap: 22px;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: none;
    width: 100%;
    max-width: 100%;
    z-index: 10;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 16px;
}

.navbar::after {
    display: none;
}

.navbar::before {
    display: none;
}

.nav-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 4px 0;
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: none;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 32%, transparent);
    box-shadow: 0 0 18px 10px color-mix(in srgb, var(--bg) 35%, transparent);
    color: var(--nav-link);
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nav-toggle__icon {
    width: 26px;
    height: 16px;
    position: relative;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after,
.nav-toggle__icon span {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background-image: linear-gradient(120deg, var(--white) 0%, #5f5f5f 35%, #9a9a9a 70%, var(--white) 100%);
    background-size: 250% 250%;
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    animation: name-sheen 6s ease-in-out infinite;
}

.nav-toggle__icon::before { top: 0; }
.nav-toggle__icon::after { bottom: 0; }

.nav-toggle__icon span {
    top: 50%;
    transform: translateY(-50%);
}

.navbar.is-open .nav-toggle__icon::before {
    transform: translateY(6.5px) rotate(45deg);
}

.navbar.is-open .nav-toggle__icon::after {
    transform: translateY(-6.5px) rotate(-45deg);
}

.navbar.is-open .nav-toggle__icon span {
    opacity: 0;
}

.nav-links a {
    padding: 8px 12px;
    border-radius: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid;
    place-items: center;
    color: var(--ink);
    font-weight: 800;
    letter-spacing: 0.05em;
}

.brand-name { font-size: 0.95rem; color: var(--muted); }

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-weight: 600;
    width: 100%;
}

.navbar.nav-docked {
    width: auto;
    left: calc(100% - 24px);
    top: 50%;
    transform: translate(-100%, -50%);
    padding: 10px 12px;
}

.navbar.nav-docked .nav-inner {
    justify-content: flex-start;
}

.navbar.nav-docked .nav-links {
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    width: auto;
}

.nav-link--top {
    display: none !important;
    color: #ffffff;
}

.navbar.nav-docked .nav-link--top {
    display: inline-block !important;
}


.nav-links a {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    transition: transform .2s ease-in-out, background .25s ease, color .25s ease;
    color: var(--nav-link);
    position: relative;
    display: inline-block;
    white-space: nowrap;
    line-height: var(--text-label-line);
    letter-spacing: var(--text-label-tracking);
}

.nav-links a span {
    display: inline-block;
}

.nav-links a:hover,
.nav-links a.is-active {
    transform: scale(1.1);
}

/* Shimmering link text: one pearlescent sheen travels across the whole menu.
   --nav-tile, --ox and --oy are set per link in NavBar.jsx so every link samples the same gradient. */
@property --nav-p {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
}

.nav-links {
    --nav-tile: 600px;
    animation: nav-shimmer 8s steps(96) infinite;
}

.nav-links a span {
    background-image: linear-gradient(100deg, var(--nav-stops));
    background-size: var(--nav-tile) 100%;
    background-position: calc(var(--nav-p) * var(--nav-tile) - var(--ox, 0px)) 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.5;
    transition: opacity .35s ease-out;
}

/* Docked (vertical) menu: the sheen travels top to bottom */
.navbar.nav-docked .nav-links a span {
    background-image: linear-gradient(180deg, var(--nav-stops));
    background-size: 100% var(--nav-tile);
    background-position: 0 calc(var(--nav-p) * var(--nav-tile) - var(--oy, 0px));
}

/* Hover and active: the full effect plays on that one link alone, with its own faster sweep,
   far more saturated and fully opaque */
.nav-links a:hover span,
.nav-links a.is-active span,
.navbar.nav-docked .nav-links a:hover span,
.navbar.nav-docked .nav-links a.is-active span {
    background-image: linear-gradient(100deg, var(--nav-stops));
    background-size: 200% 100%;
    background-position: 0% 50%;
    animation: nav-link-shimmer 2.6s steps(31) infinite;
    opacity: 1;
}

/* While one link is hovered, or one is the current section, the others step back */
.navbar .nav-links:has(a:hover) a:not(:hover) span,
.navbar .nav-links:has(a.is-active) a:not(.is-active):not(:hover) span {
    opacity: 0.3;
}

@keyframes nav-link-shimmer {
    from { background-position: 0% 50%; }
    to { background-position: 200% 50%; }
}

@keyframes hero-shimmer {
    from { background-position-x: 0%; }
    to { background-position-x: 200%; }
}

@keyframes nav-shimmer {
    from { --nav-p: 0; }
    to { --nav-p: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .nav-links,
    .nav-links a:hover span,
    .nav-links a.is-active span { animation: none; }
}

.navbar.nav-docked .nav-links a:hover,
.navbar.nav-docked .nav-links a:hover.is-active {
    color: var(--nav-hover-color);
}

.nav-link--focus:hover,
.nav-link--focus.is-active { color: #FF4150; }
.nav-link--top:hover,
.nav-link--top.is-active { color: #ffffff; }
.nav-link--skills:hover,
.nav-link--skills.is-active { color: #00BAE6; }
.nav-link--journey:hover,
.nav-link--journey.is-active { color: #6EFF52; }
.nav-link--work:hover,
.nav-link--work.is-active { color: #FFC14D; }
.nav-link--about:hover,
.nav-link--about.is-active { color: #4A3BFF; }
.nav-link--contact:hover,
.nav-link--contact.is-active { color: #FF61D9; }



.nav-links a::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 6px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-gold-25), var(--muted-trail), transparent);
    opacity: 0;
    transform: scaleX(0.5);
    transition: opacity .25s ease, transform .25s ease;
}


/* ===== HERO ===== */
.hero {
    --hero-height: 112svh;
    --hero-shift: calc((var(--hero-height) - 100svh) / 2);
    min-height: var(--hero-height);
    padding: 80px 0 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.hero-layers {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-layer svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: hidden;
}

.hero-layer {
    display: flex;
    align-items: flex-start;
}

.hero-layer--l1 { z-index: 0; }
.hero-layer--l2 { z-index: 1; }
.hero-layer--l3 { z-index: 2; }
.hero-layer--l4 { z-index: 3; }
.hero-layer--l5 { z-index: 4; }
.hero-layer--l6 { z-index: 5; }
.hero-layer--l7 { z-index: 6; }
.hero-layer--l8 { z-index: 7; }

/* Lake, mountain and sky behind the hero (WebGL, see src/landscape/) */
.hero-landscape {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Vignette over the sky only (above the horizon, LAYOUT.horizon in params.js); water is left untouched.
   Eased stops plus a faint black noise layer keep the dark gradient from banding into rings. */
.hero-landscape--fixed {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--hero-height);
    will-change: transform, opacity;
}

.hero-landscape::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52%;
    pointer-events: none;
    background:
        radial-gradient(ellipse 90% 100% at 50% 80%,
            rgba(0, 0, 0, 0) 45%,
            rgba(0, 0, 0, 0.01) 55%,
            rgba(0, 0, 0, 0.03) 65%,
            rgba(0, 0, 0, 0.06) 75%,
            rgba(0, 0, 0, 0.1) 85%,
            rgba(0, 0, 0, 0.14) 100%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.16 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

.hero-landscape__ghost {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
}

.hero-landscape__canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.hero .container {
    position: relative;
    z-index: 3;
}

.hero-wordmark {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: fit-content;
    /* the hero is taller than the viewport; shift up so the name sits in the middle of the first screen */
    transform: translateY(calc(-1 * var(--hero-shift)));
    /* test: a thinner face (was Rubik 300) */
    font-family: 'Inter', -apple-system, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 200;
    text-transform: uppercase;
    line-height: 0.95;
    letter-spacing: -0.02em;
    /* Soft glass: near-white at the top fading to translucent, with a faint cool glow */
    color: transparent;
    /* Top layer: a faint, translucent take on the nav/hover sheen, drifting slowly over the glass */
    background-image: linear-gradient(100deg, color-mix(in srgb, var(--ns0) calc((0.085 * (1 - var(--wmf)) + 0.5 * var(--wmf)) * 100%), transparent) 0%, color-mix(in srgb, var(--ns1) calc((0.255 * (1 - var(--wmf)) + 0.5 * var(--wmf)) * 100%), transparent) 14%, color-mix(in srgb, var(--ns2) calc((0.34 * (1 - var(--wmf)) + 0.5 * var(--wmf)) * 100%), transparent) 28%, color-mix(in srgb, var(--ns3) calc((0.383 * (1 - var(--wmf)) + 0.5 * var(--wmf)) * 100%), transparent) 38%, color-mix(in srgb, var(--ns4) calc((0.323 * (1 - var(--wmf)) + 0.5 * var(--wmf)) * 100%), transparent) 50%, color-mix(in srgb, var(--ns5) calc((0.272 * (1 - var(--wmf)) + 0.5 * var(--wmf)) * 100%), transparent) 64%, color-mix(in srgb, var(--ns6) calc((0.238 * (1 - var(--wmf)) + 0.5 * var(--wmf)) * 100%), transparent) 80%, color-mix(in srgb, var(--ns7) calc((0.085 * (1 - var(--wmf)) + 0.5 * var(--wmf)) * 100%), transparent) 100%),
        linear-gradient(100deg, color-mix(in srgb, var(--ns0) calc((0.068 * (1 - var(--wmf)) + 0.4 * var(--wmf)) * 100%), transparent) 0%, color-mix(in srgb, var(--ns1) calc((0.204 * (1 - var(--wmf)) + 0.4 * var(--wmf)) * 100%), transparent) 14%, color-mix(in srgb, var(--ns2) calc((0.272 * (1 - var(--wmf)) + 0.4 * var(--wmf)) * 100%), transparent) 28%, color-mix(in srgb, var(--ns3) calc((0.306 * (1 - var(--wmf)) + 0.4 * var(--wmf)) * 100%), transparent) 38%, color-mix(in srgb, var(--ns4) calc((0.258 * (1 - var(--wmf)) + 0.4 * var(--wmf)) * 100%), transparent) 50%, color-mix(in srgb, var(--ns5) calc((0.218 * (1 - var(--wmf)) + 0.4 * var(--wmf)) * 100%), transparent) 64%, color-mix(in srgb, var(--ns6) calc((0.19 * (1 - var(--wmf)) + 0.4 * var(--wmf)) * 100%), transparent) 80%, color-mix(in srgb, var(--ns7) calc((0.068 * (1 - var(--wmf)) + 0.4 * var(--wmf)) * 100%), transparent) 100%),
        linear-gradient(180deg, color-mix(in srgb, var(--wmv) calc((0.128 * (1 - var(--wmf)) + 0.5 * var(--wmf)) * 100%), transparent) 0%, color-mix(in srgb, var(--wmv) calc((0.148 * (1 - var(--wmf)) + 0.5125 * var(--wmf)) * 100%), transparent) 3.5%, color-mix(in srgb, var(--wmv) calc((0.173 * (1 - var(--wmf)) + 0.525 * var(--wmf)) * 100%), transparent) 7%, color-mix(in srgb, var(--wmv) calc((0.201 * (1 - var(--wmf)) + 0.5375 * var(--wmf)) * 100%), transparent) 10.5%, color-mix(in srgb, var(--wmv) calc((0.233 * (1 - var(--wmf)) + 0.55 * var(--wmf)) * 100%), transparent) 14%, color-mix(in srgb, var(--wmv) calc((0.27 * (1 - var(--wmf)) + 0.5625 * var(--wmf)) * 100%), transparent) 17.5%, color-mix(in srgb, var(--wmv) calc((0.315 * (1 - var(--wmf)) + 0.575 * var(--wmf)) * 100%), transparent) 21%, color-mix(in srgb, var(--wmv) calc((0.365 * (1 - var(--wmf)) + 0.5875 * var(--wmf)) * 100%), transparent) 24.5%, color-mix(in srgb, var(--wmv) calc((0.425 * (1 - var(--wmf)) + 0.6 * var(--wmf)) * 100%), transparent) 28%, color-mix(in srgb, var(--wmv) calc((0.289 * (1 - var(--wmf)) + 0.55 * var(--wmf)) * 100%), transparent) 58%, color-mix(in srgb, var(--wmv) calc((0.276 * (1 - var(--wmf)) + 0.5 * var(--wmf)) * 100%), transparent) 61.1%, color-mix(in srgb, var(--wmv) calc((0.221 * (1 - var(--wmf)) + 0.4 * var(--wmf)) * 100%), transparent) 61.2%, color-mix(in srgb, var(--wmv) calc((0.095 * (1 - var(--wmf)) + 0.3 * var(--wmf)) * 100%), transparent) 100%);
    /* "Jacob" is the top 61.2% of the block and "Berggren" the rest; Berggren gets a little less opacity */
    background-size: 200% 61.2%, 200% 38.8%, 100% 100%;
    background-position-x: 0%, 0%, 0%;
    background-position-y: 0%, 100%, 0%;
    background-repeat: repeat-x, repeat-x, no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    animation: hero-shimmer 9s steps(216) infinite;
}

.hero-wordmark__first {
    font-size: clamp(3.6rem, 12.36vw, 9.27rem);
}

.hero-wordmark__last {
    font-size: clamp(2.2rem, 7.6vw, 5.7rem);
}

.hero-letter {
    --letter-glow: 0;
    display: inline-block;
    background-image: linear-gradient(100deg,
        color-mix(in srgb, var(--ns0) calc(var(--letter-glow) * calc((0.3 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 0%,
        color-mix(in srgb, var(--ns1) calc(var(--letter-glow) * calc((0.65 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 14%,
        color-mix(in srgb, var(--ns2) calc(var(--letter-glow) * calc((0.8 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 28%,
        color-mix(in srgb, var(--ns3) calc(var(--letter-glow) * calc((0.9 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 38%,
        color-mix(in srgb, var(--ns4) calc(var(--letter-glow) * calc((0.75 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 50%,
        color-mix(in srgb, var(--ns5) calc(var(--letter-glow) * calc((0.7 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 64%,
        color-mix(in srgb, var(--ns6) calc(var(--letter-glow) * calc((0.6 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 80%,
        color-mix(in srgb, var(--ns7) calc(var(--letter-glow) * calc((0.3 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: nav-link-shimmer 2.6s steps(31) infinite;
    animation-play-state: paused; /* invisible until hovered, so it should not repaint every frame meanwhile */
    transition: --letter-glow .5s ease;
}

.hero-letter:hover {
    animation-play-state: running;
    --letter-glow: 0.6;
}
:root[data-theme="light"] .hero-letter:hover { --letter-glow: 0.9; }
:root[data-theme="light"] .hero-landscape::after {
    background: radial-gradient(ellipse 90% 100% at 50% 80%, rgba(33,32,28,0) 50%, rgba(33,32,28,0.1) 100%);
}

@media (prefers-reduced-motion: reduce) {
    .hero-wordmark,
    .section-head h2,
    .hero-letter { animation: none; }
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: center;
    gap: clamp(28px, 4vw, 60px);
    justify-items: center;
    transform: translateY(calc(-1 * var(--hero-shift)));
}

.hero-copy {
    text-align: left;
    max-width: 640px;
    margin: 0 auto;
}

.hero-copy .hero-title {
    margin: 4px 0 10px;
}

.hero-name {
    font-size: clamp(2.5rem, 4vw, 3.4rem);
    line-height: 1.18;
    margin-bottom: 18px;
    color: var(--white);
    padding-bottom: 0.08em;
    overflow: visible;
}

@keyframes name-sheen {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes caret-blink {
    50% { opacity: 0; }
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}


@keyframes hero-halo {
    0%, 100% { transform: scale(0.92); opacity: 0.45; }
    50% { transform: scale(1.12); opacity: 0.85; }
}

@keyframes hero-rotate {
    to { transform: rotate(360deg); }
}

.floating-card {
    display: none;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    justify-content: flex-start;
}

.social {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--glass-04);
    display: grid;
    place-items: center;
    transition: transform .2s ease, border-color .2s ease;
}

.social--mail { font-weight: 800; font-size: 1.2rem; }
.social--linkedin img { width: 20px; height: 20px; }

/* ===== VALUE CARDS ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.card {
    background: linear-gradient(145deg, var(--glass-03), var(--glass-01));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.card p { color: var(--muted); line-height: 1.6; }

/* ===== SKILLS ===== */
.skills {
    background: transparent;
}

/* ===== TIMELINE ===== */
.timeline .container { display: grid; gap: 0; }

.edu-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.75fr 1fr;
    gap: 24px;
    width: 90%;
    justify-items: start;
    margin-left: 2%;
}

.edu-item {
    padding: 0;
    background: transparent;
    width: 100%;
}

.edu-item h4 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.edu-item p {
    margin: 0 0 6px;
}

.edu-item .meta {
    color: var(--muted);
    font-size: 0.92rem;
}

.focus-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    color: var(--muted);
}

.focus-list li {
    padding: 2px 0;
}

.focus-list li:last-child {
}

.career-list {
    position: relative;
    padding-left: 18px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.career-list::before {
    display: none;
}

.career-item {
    position: relative;
    padding-left: 22px;
    margin-bottom: 32px;
}

.career-item::before {
    content: "{";
    position: absolute;
    left: -22px;
    top: -14px;
    height: 100%;
    font-size: 2.6rem;
    line-height: 1;
    transform: scaleY(2.2);
    transform-origin: top;
    color: var(--line);
}

.career-item:last-child {
    margin-bottom: 0;
}

.career-title {
    margin: 0 0 10px;
    font-size: 1rem;
}

.career-meta {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 0.92rem;
}

.career-desc {
    margin: 0;
    color: var(--muted);
}

.timeline-progress {
    width: 100%;
    height: 6px;
    background: var(--glass-05);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    transition: width .2s ease;
}

.timeline-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 320px);
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
}

.timeline-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    scroll-snap-align: start;
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.badge {
    background: var(--glass-08);
    border-radius: 10px;
    padding: 6px 10px;
    font-weight: 700;
    color: var(--text);
}

.badge-work { background: var(--accent-2-16); }
.badge-project { background: var(--accent-gold-20); }

.timeline-card .meta {
    color: var(--muted);
    font-size: 0.95rem;
}

/* ===== PROJECTS ===== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.project-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
    display: grid;
    grid-template-rows: 200px 1fr;
}

.project-thumb {
    background-size: cover;
    background-position: center;
}

.placeholder-media {
    background: linear-gradient(135deg, var(--accent-2-20), var(--accent-gold-20));
}

.project-body {
    padding: 16px;
}

.project-body p { color: var(--muted); }

/* ===== ABOUT ===== */
.about {
    background: transparent;
}

.section--about {
    padding-top: 0;
}

.about .container,
.timeline .container {
    width: min(1200px, 75%);
    margin-left: 10vw;
    margin-right: auto;
}

.section--focus .container {
    width: min(1200px, 75%);
    margin-left: 10vw;
    margin-right: auto;
}

.section--work .container,
.section--skills .container,
.section--contact .container {
    width: min(1200px, 75%);
    margin-left: 10vw;
    margin-right: auto;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    align-items: start;
}

.lang-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.lang-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    color: var(--muted);
}

.lang-list li {
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-flag {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid currentColor;
    filter: grayscale(1);
}

/* ===== CV ===== */
.cv-section {
    text-align: left;
}

.cv-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0 22px;
}

.cv-preview {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
}

.cv-image {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    border-radius: 12px;
}

/* ===== CONTACT ===== */
.contact {
    background: transparent;
}

.contact-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    align-items: center;
}

.contact-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.contact-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

/* ===== FOOTER ===== */
.footer {
    border-top: none;
    padding: 72px 0 80px;
    background: transparent;
    position: relative;
}

.footer-inner {
    width: min(1200px, 92vw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-copy,
.footer-note { margin: 0; }

.footer-copy,
.footer-note,
.footer-links {
    font-size: 0.72rem;
    line-height: 1.4;
    letter-spacing: 0.06em;
}

.footer-inner { row-gap: 72px; }

.footer-links { display: flex; gap: 24px; }
.footer-copy,
.footer-note,
.footer-links a,
.footer-links button {
    background: none;
    border: 0;
    padding: 0;
    /* same pearlescent text as the navbar links: dim at rest, full sheen on hover */
    background-image: linear-gradient(100deg,
        color-mix(in srgb, var(--ns0) calc(var(--letter-glow) * calc((0.3 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 0%,
        color-mix(in srgb, var(--ns1) calc(var(--letter-glow) * calc((0.65 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 14%,
        color-mix(in srgb, var(--ns2) calc(var(--letter-glow) * calc((0.8 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 28%,
        color-mix(in srgb, var(--ns3) calc(var(--letter-glow) * calc((0.9 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 38%,
        color-mix(in srgb, var(--ns4) calc(var(--letter-glow) * calc((0.75 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 50%,
        color-mix(in srgb, var(--ns5) calc(var(--letter-glow) * calc((0.7 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 64%,
        color-mix(in srgb, var(--ns6) calc(var(--letter-glow) * calc((0.6 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 80%,
        color-mix(in srgb, var(--ns7) calc(var(--letter-glow) * calc((0.3 * (1 - var(--wmf)) + 1.0 * var(--wmf)) * 100%)), transparent) 100%);
    background-size: 200% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.25;
    transition: opacity .35s ease-out;
}
.footer-links a,
.footer-links button {
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}
.footer-links .footer-top {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgb(188, 197, 214); /* the arrow takes this; the word itself uses the sheen above */
}
.footer-links .footer-top svg { display: block; transform: translateY(-4px); }

.footer-links a:hover,
.footer-links button:hover,
.footer-links a:focus-visible,
.footer-links button:focus-visible {
    opacity: 1;
    animation: nav-link-shimmer 2.6s steps(31) infinite;
}

@media (prefers-reduced-motion: reduce) {
    .footer-links a:hover,
    .footer-links button:hover { animation: none; }
}

@media (max-width: 720px) {
    .footer-inner { flex-direction: column; text-align: center; }
}

/* Hairline with the navbar links' pearlescent sheen, fading out toward both edges */
.footer-line {
    flex: 1 1 100%;
    height: 1px;
    background-image: linear-gradient(100deg, var(--nav-stops));
    background-size: 200% 100%;
    animation: nav-link-shimmer 8s steps(96) infinite;
    opacity: 0.5;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 25%, #000 75%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 25%, #000 75%, transparent 100%);
}

@media (prefers-reduced-motion: reduce) {
    .footer-line { animation: none; }
}

/* ===== ANIMATION / REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 1600px) {
    .container {
        width: min(1500px, 78vw);
    }

    .about .container,
    .timeline .container,
    .section--focus .container,
    .section--work .container,
    .section--skills .container,
    .section--contact .container {
        width: min(1500px, 78vw);
        margin-left: auto;
        margin-right: auto;
    }

    .nav-links a {
        font-size: 1rem;
    }

    .hero-name {
        font-size: clamp(3rem, 3.5vw, 4.2rem);
    }
}

@media (min-width: 2200px) {
    .container {
        width: min(1800px, 70vw);
    }

    .about .container,
    .timeline .container,
    .section--focus .container,
    .section--work .container,
    .section--skills .container,
    .section--contact .container {
        width: min(1800px, 70vw);
        margin-left: auto;
        margin-right: auto;
    }

    h1 { font-size: clamp(3.2rem, 3vw, 4.6rem); }
    h2 { font-size: clamp(2.2rem, 2vw, 3rem); }
    h3 { font-size: clamp(1.4rem, 1.4vw, 2rem); }
    .lede,
    .body { font-size: clamp(1.2rem, 0.6vw + 0.8rem, 1.6rem); }
}

@media (max-width: 1200px) {
    .about .container,
    .timeline .container,
    .section--focus .container,
    .section--work .container,
    .section--skills .container,
    .section--contact .container {
        width: min(1200px, 92vw);
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 900px) {
    .nav-links { justify-content: flex-end; }
    .nav-links a { padding: 6px 10px; font-size: 0.85rem; }
    .edu-grid { grid-template-columns: 1fr; }
    .focus-grid { grid-template-columns: 1fr; }
    .timeline-track {
        grid-auto-flow: row;
        grid-auto-columns: unset;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        overflow: visible;
    }
    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .nav-inner { flex-direction: column; align-items: flex-start; }
    .nav-links { width: 100%; justify-content: space-between; gap: 10px; }
    .nav-links a { padding: 6px 8px; font-size: 0.8rem; }
    .hero { padding-top: 80px; }
    .floating-card { position: static; margin-top: 14px; }
}

@media (max-width: 720px) {
    .navbar {
        padding: 10px 14px;
        transition: background 0.35s ease, backdrop-filter 0.35s ease;
    }

    .nav-inner {
        align-items: center;
        gap: 10px;
        position: relative;
        min-height: 44px;
    }

    .nav-toggle {
        display: inline-flex;
        position: fixed;
        right: 18px;
        top: 22px;
        z-index: 12;
    }

    .nav-links {
        display: flex;
        opacity: 0;
        pointer-events: none;
    }

    .navbar.is-open .nav-links {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-link--top {
        display: inline-block !important;
    }

    .navbar.nav-docked {
        left: 50%;
        top: 0;
        transform: translateX(-50%);
        width: 100%;
        padding: 10px 14px;
    }

    .navbar.is-open {
        position: fixed;
        inset: 0;
        left: 0;
        top: 0;
        transform: none;
        padding: 22px 18px;
        background: color-mix(in srgb, var(--bg) 88%, transparent);
        backdrop-filter: blur(8px) saturate(120%);
        -webkit-backdrop-filter: blur(8px) saturate(120%);
    }

    .navbar.is-open .nav-inner {
        height: 100%;
        justify-content: center;
        align-items: center;
    }

    .navbar.is-open .nav-links {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        width: 100%;
        min-height: 100%;
        gap: 18px;
        padding: 0 12px;
    }

    .navbar.is-open .nav-links a {
        font-size: 1.5rem;
    }

    .nav-links a {
        opacity: 0;
        transform: translateX(28px);
        transition: transform 0.35s ease, opacity 0.35s ease, color 0.25s ease;
    }

    .navbar.is-open .nav-links a {
        opacity: 1;
        transform: translateX(0);
    }

    .navbar.is-open .nav-links a:nth-child(1) { transition-delay: 0.04s; }
    .navbar.is-open .nav-links a:nth-child(2) { transition-delay: 0.08s; }
    .navbar.is-open .nav-links a:nth-child(3) { transition-delay: 0.12s; }
    .navbar.is-open .nav-links a:nth-child(4) { transition-delay: 0.16s; }
    .navbar.is-open .nav-links a:nth-child(5) { transition-delay: 0.20s; }
    .navbar.is-open .nav-links a:nth-child(6) { transition-delay: 0.24s; }
    .navbar.is-open .nav-links a:nth-child(7) { transition-delay: 0.28s; }

    #projects {
        margin-top: 24px;
    }
}

@media (max-width: 480px) {
    .section { padding: clamp(60px, 14vw, 90px) 0; }
    .hero.section { padding-bottom: clamp(56px, 12vw, 80px); }
    .hero.section + .section { padding-top: clamp(56px, 12vw, 80px); }
    .cta-row { gap: 10px; }
    .Link__github,
    .Link__linkedin,
    .Link__mail {
        min-width: 48px;
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1 !important; transform: none !important; }
    .btn, .social { transition: none; }
    .eyebrow { animation: none; }
}


/* ===== SCROLL THUMB ===== */
/* Wider invisible track so the 2px thumb is easy to grab */
.scroll-track {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    z-index: 1000;
    touch-action: none;
}

.scroll-thumb {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px; /* the line is drawn by a clip-path in ScrollThumb.jsx so it can arc toward the mouse */
    height: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    opacity: 0.75;
    background-image: linear-gradient(180deg, var(--nav-stops));
    background-size: 100% 200%;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 80%, transparent 100%);
    animation: scroll-thumb-shimmer 6s steps(72) infinite;
    will-change: transform;
}

.scroll-track:hover .scroll-thumb,
.scroll-track.is-dragging .scroll-thumb {
    opacity: 1;
}

.is-scroll-dragging,
.is-scroll-dragging * {
    user-select: none;
    -webkit-user-select: none;
}

@keyframes scroll-thumb-shimmer {
    from { background-position: 0 0%; }
    to { background-position: 0 200%; }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-thumb { animation: none; }
}

/* ---------- Projects: card stage + expanding panel ---------- */
.proj-stage {
    --proj-gap: 16px;
    --proj-feat-h: clamp(260px, 32vw, 400px);
    --proj-cat-h: clamp(120px, 12vw, 150px);
    position: relative;
    display: grid;
    gap: var(--proj-gap);
    height: calc(var(--proj-feat-h) + var(--proj-cat-h) + var(--proj-gap));
    grid-template-rows: var(--proj-feat-h) var(--proj-cat-h);
}

.proj-row {
    display: grid;
    gap: var(--proj-gap);
    min-height: 0;
}
.proj-row--featured { grid-template-columns: repeat(2, 1fr); }
.proj-row--cats { grid-template-columns: repeat(var(--n, 4), 1fr); }

.proj-card {
    position: relative;
    display: block;
    padding: 0;
    overflow: hidden;
    text-align: left;
    font: inherit;
    color: var(--text);
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity .6s ease, box-shadow .4s ease;
    will-change: transform;
    /* liquid glass: frosted body, bright top edge, soft depth */
    background: linear-gradient(135deg, var(--card-g0), var(--card-g1) 55%, var(--card-g2));
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%);
    box-shadow:
        inset 0 0 22px var(--card-in),
        0 14px 34px var(--card-drop);
}
/* glass rim: light catches the top-left and bottom-right edges; the floor keeps it unbroken along the sides */
.proj-card::after,
.proj-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    padding: 1px;
    border-radius: inherit;
    pointer-events: none;
    /* the top highlight lives here, above the content, so the art column can't cover half of it */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.17) 30%, rgba(255, 255, 255, 0.17) 70%, rgba(255, 255, 255, 0.38));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.proj-card:hover,
.proj-card:focus-visible {
    box-shadow:
        inset 0 0 22px var(--card-in2),
        0 18px 42px var(--card-drop2);
}
.proj-card:focus-visible { outline: 2px solid var(--glass-55); outline-offset: 3px; }
.proj-stage.is-dim .proj-card:not(.is-origin) {
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s ease;
}
.proj-stage.is-closing .proj-card:not(.is-origin) {
    transition: opacity .5s ease .3s;
}
.proj-stage.is-closing .proj-card.is-origin { opacity: 1; }
.proj-card.is-origin { opacity: 0; transition: none; }

.proj-card__text {
    position: absolute;
    inset: auto 0 0 0;
    display: grid;
    gap: 4px;
    padding: clamp(16px, 2vw, 26px);
    background: linear-gradient(to top, var(--card-fade), transparent);
}
.proj-card--cat .proj-card__text { inset: 0; align-content: end; background: none; }
.proj-card__kicker {
    font-size: var(--text-label-size);
    letter-spacing: var(--text-label-tracking);
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
}
.proj-card__title {
    font-size: clamp(1.15rem, 1vw + 0.9rem, 1.8rem);
    font-weight: 600;
    letter-spacing: var(--text-heading-tracking);
    color: var(--text-strong);
}
.proj-card--featured .proj-card__title { font-size: clamp(1.4rem, 1.6vw + 1rem, 2.3rem); }
.proj-card__sub { color: var(--muted); font-size: 0.95rem; }
.proj-card--cat .proj-card__sub { font-size: 0.85rem; }

.proj-card__text { z-index: 2; }

/* Placeholder art: soft monochrome glows until real images are added */
.proj-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.proj-card:hover .proj-art { transform: scale(1.04); }
.proj-art--placeholder {
    --x: 30%; --y: 20%;
    background:
        radial-gradient(70% 90% at var(--x) var(--y), var(--art-glow), transparent 62%),
        linear-gradient(145deg, var(--art-a), var(--art-b));
}
.proj-art--placeholder[data-art="1"] { --x: 75%; --y: 15%; }
.proj-art--placeholder[data-art="2"] { --x: 20%; --y: 80%; }
.proj-art--placeholder[data-art="3"] { --x: 80%; --y: 75%; }
.proj-art--placeholder[data-art="4"] { --x: 50%; --y: 45%; }
.proj-art--placeholder[data-art="5"] { --x: 10%; --y: 35%; }

.proj-panel {
    position: absolute;
    inset: 0;
    z-index: 5;
    overflow: hidden;
    background: linear-gradient(135deg, var(--panel-g0), var(--panel-g1));
    -webkit-backdrop-filter: blur(28px) saturate(170%);
    backdrop-filter: blur(28px) saturate(170%);
    box-shadow: 0 24px 60px var(--panel-sh);
    border-radius: var(--radius);
    outline: none;
}
.proj-panel__inner { position: absolute; inset: 0; }

.proj-panel__bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    pointer-events: none;
}
.proj-panel__count {
    font-size: var(--text-label-size);
    letter-spacing: var(--text-label-tracking);
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
}

.proj-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--text);
    background: var(--glass-08);
    border: 1px solid var(--glass-12);
    border-radius: 50%;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
    pointer-events: auto;
    transition: background .25s ease, transform .25s ease;
}
.proj-btn:hover { background: var(--glass-20); }
.proj-btn:focus-visible { outline: 2px solid var(--glass-55); outline-offset: 2px; }
.proj-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.proj-nav {
    position: absolute;
    z-index: 6;
    width: 56px;
    height: 56px;
    animation: proj-nav-in .4s ease .5s backwards;
}
@keyframes proj-nav-in { from { opacity: 0; } to { opacity: 1; } }
/* wide screens: outside the card, in the page gutters */
.proj-btn--prev, .proj-btn--next { top: 50%; margin-top: -28px; }
.proj-btn--prev { right: 100%; }
.proj-btn--next { left: 100%; }
/* not enough gutter: a pair centred under the card */
@media (max-width: 1279px) {
    .proj-btn--prev, .proj-btn--next { top: calc(100% + 14px); margin-top: 0; }
    .proj-btn--prev { right: auto; left: calc(50% - 60px); }
    .proj-btn--next { left: calc(50% + 4px); }
}

/* arrows: just the glyph, no circle; grows on hover */
.proj-nav {
    background: none;
    border: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: var(--text-strong);
    transition: transform .3s cubic-bezier(.2, .7, .2, 1), color .25s ease;
}
.proj-nav:hover { background: none; transform: scale(1.35); }
/* the chevron is a mask over the same pearlescent gradient the nav links use */
.proj-nav__glyph {
    display: block;
    width: 40px;
    height: 40px;
    background-image: linear-gradient(100deg, var(--nav-stops));
    background-size: 200% 100%;
    background-position: 0% 50%;
    opacity: 0.5;
    transition: opacity .35s ease-out;
}
.proj-btn--prev .proj-nav__glyph {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.proj-btn--next .proj-nav__glyph {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.proj-nav:hover .proj-nav__glyph,
.proj-nav:focus-visible .proj-nav__glyph {
    opacity: 1;
    animation: nav-link-shimmer 2.6s steps(31) infinite;
}
@media (prefers-reduced-motion: reduce) {
    .proj-nav:hover .proj-nav__glyph { animation: none; }
}

/* close: larger; turns red only on hover */
.proj-btn--close {
    position: relative;
    width: 54px;
    height: 54px;
    border: 0;
    /* liquid glass, matching the cards */
    background: linear-gradient(135deg, var(--gb-g0), var(--gb-g1) 55%, var(--gb-g2));
    -webkit-backdrop-filter: blur(16px) saturate(170%);
    backdrop-filter: blur(16px) saturate(170%);
    box-shadow: inset 0 0 14px var(--gb-in), 0 8px 20px var(--gb-drop);
    transition: background .25s ease, transform .3s cubic-bezier(.2, .7, .2, 1), color .25s ease;
}
.proj-btn--close::after {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.17) 30%, rgba(255, 255, 255, 0.17) 70%, rgba(255, 255, 255, 0.38));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.proj-btn--close svg { width: 26px; height: 26px; }
.proj-btn--close:hover {
    color: #ff6b6b;
    background: linear-gradient(135deg, rgba(255, 110, 110, 0.26), rgba(255, 90, 90, 0.08) 55%, rgba(255, 110, 110, 0.14));
    transform: scale(1.15);
}

.proj-slide { position: absolute; inset: 0; animation: proj-in-next .5s cubic-bezier(.2, .7, .2, 1) both; }
.proj-slide[data-dir="prev"] { animation-name: proj-in-prev; }
@keyframes proj-in-next { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes proj-in-prev { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }

.proj-detail {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    height: 100%;
}
.proj-detail__art { position: relative; }
.proj-detail__art .proj-art { transition: none; }
.proj-detail__copy {
    display: grid;
    align-content: center;
    gap: 14px;
    padding: clamp(28px, 4vw, 64px) clamp(28px, 4vw, 56px);
    overflow-y: auto;
}
.proj-detail h3,
.proj-next h3 {
    margin: 0;
    font-size: clamp(1.8rem, 2.6vw + 0.8rem, 3.2rem);
    line-height: var(--text-heading-line);
    letter-spacing: var(--text-heading-tracking);
    color: var(--text-strong);
}
.proj-detail__lede { margin: 0; font-size: 1.15rem; color: var(--text); }
.proj-detail__body { margin: 0; color: var(--muted); line-height: var(--text-body-line); }
.proj-detail__meta { display: grid; gap: 10px; margin: 6px 0 0; }
.proj-detail__meta div { display: grid; gap: 2px; }
.proj-detail__meta dt { font-size: 0.75rem; letter-spacing: var(--text-label-tracking); text-transform: uppercase; color: var(--muted); }
.proj-detail__meta dd { margin: 0; color: var(--text-strong); }
.proj-detail__links { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 0; }
.proj-detail__links a {
    padding: 10px 18px;
    font: inherit;
    color: var(--text-strong);
    text-decoration: none;
    background: var(--glass-08);
    border: 1px solid var(--glass-15);
    border-radius: 999px;
    cursor: pointer;
    transition: background .25s ease;
}
.proj-detail__links a:hover { background: var(--glass-20); }

.proj-next {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 14px;
    height: 100%;
    padding: 0 28px;
    text-align: center;
}

@media (max-width: 900px) {
    .proj-row--cats { grid-template-columns: repeat(2, 1fr); }
    .proj-stage {
        height: auto;
        grid-template-rows: none;
        --proj-feat-h: 260px;
        --proj-cat-h: 120px;
    }
    .proj-row--featured { grid-template-columns: 1fr; grid-auto-rows: var(--proj-feat-h); }
    .proj-row--cats { grid-auto-rows: var(--proj-cat-h); }
}

@media (max-width: 720px) {
    .proj-panel { position: fixed; z-index: 1000; border-radius: 0; }
    .proj-panel::after { display: none; }
    .proj-detail { grid-template-columns: 1fr; grid-template-rows: 34% 1fr; }
    .proj-detail__copy { align-content: start; padding: 24px 22px 96px; }
    .proj-nav { position: fixed; z-index: 1001; }
    .proj-btn--prev, .proj-btn--next { top: auto; bottom: 20px; margin-top: 0; }
    .proj-btn--prev { left: 22px; right: auto; }
    .proj-btn--next { right: 22px; left: auto; }
    .proj-next { padding: 0 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .proj-card, .proj-art, .proj-slide { transition: none; animation: none; }
}

/* ---------- Scroll focus: content fades and drifts with how much of it is in view (values set by src/scrollFocus.js) ---------- */
.section:not(.hero) .container > :not(.section-head):not(.proj-stage),
.section:not(.hero) .proj-row {
    opacity: var(--focus, 1);
    translate: 0 calc(var(--shift, 0) * 28px);
    will-change: opacity, translate;
}

/* ===== LIGHT THEME OVERRIDES (surfaces that hard-code dark/white values) ===== */
:root[data-theme="light"] .nav-link--top.is-active { color: #21201c; }

/* Buttons: saturated fills with white text; dark ink on hover */
:root[data-theme="light"] .btn {
    background: #c0391a;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(192, 57, 26, 0.35);
}
:root[data-theme="light"] .btn:hover { background: #21201c; color: #ffffff; }
:root[data-theme="light"] .Link__github,
:root[data-theme="light"] .Link__linkedin,
:root[data-theme="light"] .Link__mail {
    background: #f9f9f8;
    color: #21201c;
    box-shadow: 0 2px 6px rgba(33, 32, 28, 0.2);
}
:root[data-theme="light"] .Link__github svg,
:root[data-theme="light"] .Link__github .github { fill: #21201c; }
:root[data-theme="light"] .Link__github:hover { background-color: #21201c; }
:root[data-theme="light"] .Link__github:hover .github { fill: #ffffff; }
:root[data-theme="light"] .Link__mail:hover { background-color: #8a2a3a; color: #ffffff; }

:root[data-theme="light"] .footer-copy,
:root[data-theme="light"] .footer-note,
:root[data-theme="light"] .footer-links a,
:root[data-theme="light"] .footer-links button { opacity: 0.85; }
:root[data-theme="light"] .footer-links a:hover,
:root[data-theme="light"] .footer-links button:hover { opacity: 1; }

/* Theme link: "Light" and "Dark" differ in length, which would make the menu change width (and everything shift)
   on every switch. The font is monospace, so the label simply reserves the width of five characters (including
   the letter-spacing) and keeps the shorter word against the edge the menu is aligned to. */
.nav-links a.nav-link--theme span {
    min-width: calc(5ch + 5 * var(--text-label-tracking));
    text-align: left;
}
.navbar.nav-docked .nav-links a.nav-link--theme span { text-align: right; }

/* Shimmering text that is scrolled out of view stops animating (src/pauseOffscreen.js) */
.anim-paused { animation-play-state: paused !important; }
