        /* Type system: Vahid Sora (Sora with its square dots redrawn as round
           beads) for every word people or parsers read, Geist Mono for labels
           and data, Geist Pixel Circle for the brand wordmark only. All SIL OFL,
           self-hosted. */
        @font-face { font-family: "Vahid Sora"; src: url("../fonts/VahidSora-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
        @font-face { font-family: "Vahid Sora"; src: url("../fonts/VahidSora-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
        @font-face { font-family: "Vahid Sora"; src: url("../fonts/VahidSora-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
        @font-face { font-family: "Vahid Sora"; src: url("../fonts/VahidSora-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
        @font-face { font-family: "Vahid Sora"; src: url("../fonts/VahidSora-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
        @font-face { font-family: "Geist Mono"; src: url("../fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
        @font-face { font-family: "Geist Pixel Circle"; src: url("../fonts/GeistPixel-Circle.woff2") format("woff2"); font-display: swap; }
        /* Cross-document view transitions: navigating between pages on this site
           cross-fades instead of blanking to white. Both documents must opt in;
           browsers without support simply navigate as before. */
        @view-transition { navigation: auto; }
        ::view-transition-old(root), ::view-transition-new(root) {
            animation-duration: var(--dur-base);
            animation-timing-function: var(--ease-move);
        }

        @property --border-angle {
            syntax: "<angle>";
            initial-value: 0deg;
            inherits: false;
        }

        :root {
            --font: "Vahid Sora", "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
            --font-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
            --font-display: "Vahid Sora", "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

            --black: #000000;
            --grey-900: #111111;
            --grey-800: #1a1a1a;
            --grey-700: #333333;
            --grey-600: #555555;
            --grey-500: #777777;
            --grey-400: #6e6e73;
            --grey-300: #bbbbbb;
            --grey-200: #dddddd;
            --grey-100: #f0f0f0;
            --grey-50:  #f8f8f8;
            --white:    #ffffff;

            /* Brand palette: red tones on white. One strong red for the point
               of a thing, a deep red for pressed and hover, a light red as the
               highlighter, and a blush tint for cards. Ink stays near-black.
               (Token names --rust and --blue are kept so components need no edit.) */
            --ink:       #1c1c1e;
            --rust:      #e0301e;
            --rust-deep: #b4200f;
            --mark:      #ffdcd6;
            --blue:      #c8261a;
            --blue-tile: #fff1ef;
            --paper:     #fff6f4;
            --red:       var(--rust);
            --red-light: var(--paper);

            --bg:           var(--white);
            --bg-subtle:    var(--grey-50);
            --bg-muted:     var(--grey-100);
            --border:       var(--grey-200);
            --border-strong: var(--grey-300);
            --text-primary: var(--ink);
            --text-secondary: var(--grey-600);
            --text-muted:   var(--grey-400);
            --accent:       var(--red);
            --accent-bg:    var(--red-light);

            --radius: 12px;

            /* Control system. Every button, chip and nav action is built from
               these: one radius, two heights, a hairline that darkens on hover,
               ink for the primary action. Red marks state, never decoration. */
            --ctl-radius: 8px;
            --ctl-h: 40px;
            --ctl-h-sm: 32px;
            --ctl-line: rgba(28,28,30,0.14);
            --ctl-line-hover: rgba(28,28,30,0.32);
            --ctl-tint: rgba(28,28,30,0.035);
            --ctl-ease: 160ms cubic-bezier(0.4, 0, 0.2, 1);

            /* Motion scale. Four durations and three curves cover the whole
               site; anything that does not fit one of them is a mistake.
               fast  - colour and opacity on small controls
               base  - the default state change
               slow  - card hover, larger moves
               enter - something arriving on screen */
            --dur-fast: 140ms;
            --dur-base: 220ms;
            --dur-slow: 420ms;
            --dur-enter: 560ms;
            --stagger: 90ms;
            --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
            --ease-move: cubic-bezier(0.4, 0, 0.2, 1);
            --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
            --transition: var(--dur-base) var(--ease-move);
        }


        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        /* First paint. The webfonts arrive after the markup, and the hero is set
           in a variable face, so the swap is visible. A hairline reports the wait
           instead of gating the page: the content is painted and readable the
           whole time, which a full-screen loader would not be. */
        .load-bar {
            position: fixed; top: 0; left: 0; right: 0; height: 2px;
            z-index: 200; pointer-events: none; overflow: hidden;
            opacity: 1; transition: opacity 0.3s var(--ease-out);
        }
        .load-bar.done { opacity: 0; }
        .load-bar span {
            display: block; height: 100%; width: 32%; background: var(--accent);
            animation: load-sweep 1.1s var(--ease-move) infinite;
        }
        @keyframes load-sweep {
            0%   { transform: translateX(-110%); }
            55%  { transform: translateX(140%); }
            100% { transform: translateX(320%); }
        }
        @media (prefers-reduced-motion: reduce) {
            .load-bar span { animation: none; width: 40%; transform: none; }
        }

        html { font-size: 16px; scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-font-smoothing: antialiased; }

        /* MONO 0.3 / 380: body: readable, less rigid */
        body {
            background: var(--bg); color: var(--text-primary);
            font-family: var(--font);
            font-variation-settings: "MONO" 0.3, "CASL" 0;
            font-weight: 380;
            line-height: 1.7; font-size: 0.875rem;
            transition: background var(--transition), color var(--transition);
        }

        /* Vahid Sora / 700 - headings: geometric, with bead full stops */
        h1, h2, h3 {
            font-family: var(--font-display);
            font-weight: 700; letter-spacing: -0.025em; line-height: 1.15;
            color: var(--text-primary);
        }
        h4 {
            font-variation-settings: "MONO" 0.5, "CASL" 0;
            font-weight: 500; color: var(--text-primary);
        }

        p { color: var(--text-secondary); line-height: 1.8; }
        a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
        a:hover { text-decoration: underline; }

        /* MONO 1 / 500: code chips: crisp, fully monospaced */
        code {
            font-family: var(--font);
            font-variation-settings: "MONO" 1, "CASL" 0;
            font-weight: 500; font-size: 0.8125rem;
            background: var(--accent-bg); color: var(--accent);
            padding: 0.15em 0.5em; border-radius: 4px;
            border: 1px solid rgba(224,48,30,0.12);
        }

        .container { max-width: 800px; margin: 0 auto; padding: 0 2rem; }
        section { padding: 4rem 0; border-bottom: 1px solid var(--border); }
        section:last-of-type { border-bottom: none; }
        .section-label {
            font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em;
            color: var(--blue); margin-bottom: 0.375rem;
            font-variation-settings: "MONO" 0.8, "CASL" 0; font-weight: 500;
        }
        .section-tagline {
            font-size: 0.9375rem; color: var(--accent); margin-bottom: 2rem;
            font-variation-settings: "MONO" 0.5, "CASL" 0; font-weight: 500;
        }

        /* Header. Quiet by default: transparent over the page, no border.
           Once the page moves it condenses into a frosted bar with a hairline,
           so it reads as furniture rather than decoration. One accent only:
           the indicator under the section in view. */
        .site-header {
            position: -webkit-sticky; position: sticky; top: 0; z-index: 50;
            background: rgba(255,255,255,0);
            border-bottom: 1px solid transparent;
            transition: background var(--dur-slow) var(--ease-out), border-color var(--dur-slow) var(--ease-out),
                        box-shadow var(--dur-slow) var(--ease-out), backdrop-filter var(--dur-slow) var(--ease-out);
        }
        .site-header.is-scrolled {
            background: rgba(255,255,255,0.82);
            backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
            border-bottom-color: rgba(28,28,30,0.08);
            
        }
        .site-nav {
            display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
            height: 64px; transition: height var(--dur-slow) var(--ease-out);
        }
        .site-header.is-scrolled .site-nav { height: 52px; }

        .brand {
            display: inline-flex; align-items: center; gap: 0.625rem; flex: none;
            color: var(--ink); text-decoration: none;
        }
        .brand:hover { text-decoration: none; }
        .brand-mark { width: 22px; height: 22px; flex: none; }
        .brand-mark .bead { transition: transform var(--dur-slow) var(--ease-spring); transform-box: view-box; }
        .brand:hover .brand-mark .b-1 { transform: translateX(9px); }
        .brand:hover .brand-mark .b-2 { transform: translateX(-5px); }
        .brand:hover .brand-mark .b-3 { transform: translateX(7px); }
        .brand-name { font-size: 0.875rem; font-weight: 650; letter-spacing: -0.015em; white-space: nowrap; }

        .nav-links {
            position: relative; display: flex; align-items: center; gap: 0.25rem;
            margin: 0 auto 0 0.5rem; list-style: none;
        }
        .nav-links a {
            display: block; padding: 0.4rem 0.625rem; border-radius: 8px;
            font-size: 0.8125rem; font-weight: 500; letter-spacing: -0.005em;
            color: var(--text-secondary); text-decoration: none;
            transition: color var(--dur-fast) var(--ease-move), background var(--dur-fast) var(--ease-move);
        }
        .nav-links a:hover { color: var(--ink); background: rgba(28,28,30,0.04); text-decoration: none; }
        .nav-links a.is-active { color: var(--ink); }
        .nav-indicator {
            position: absolute; left: 0; bottom: -2px; height: 2px; width: 0; border-radius: 2px;
            background: var(--rust); opacity: 0; pointer-events: none;
            transition: transform var(--dur-slow) var(--ease-out), width var(--dur-slow) var(--ease-out), opacity var(--dur-base) var(--ease-move);
        }

        .nav-actions { display: flex; align-items: center; gap: 0.5rem; flex: none; }
        /* hero: the hiring chip, built like the cards below it (wooden dowels, rod at the foot) */
        .hero-fit-row { margin-top: 1.25rem; }
        .hero-fit {
            position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.9rem;
            max-width: 34rem; padding: 0.9rem 1rem 1rem 0.9rem; border-radius: 6px; border: 1px solid rgba(28,28,30,0.12);
            background-color: #fff; color: var(--ink); text-decoration: none;
            
            background-image: linear-gradient(var(--rust), var(--rust)), linear-gradient(rgba(28,28,30,0.14), rgba(28,28,30,0.14));
            background-size: 0% 1px, calc(100% - 10px) 1px; background-position: 5px calc(100% - 6px), 5px calc(100% - 6px); background-repeat: no-repeat;
            transition: background-size 0.7s cubic-bezier(0.65, 0, 0.25, 1), transform var(--dur-slow) var(--ease-spring);
        }
        .hero-fit:hover { background-size: calc(100% - 10px) 1px, calc(100% - 10px) 1px; transform: translateY(-2px); text-decoration: none; }
        .hero-fit:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
        .hf-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-left: 0.35rem; border-radius: 12px; background: var(--paper); border: 1px solid rgba(224,48,30,0.2); color: var(--ink); }
        .hf-icon .fit-ic { width: 28px; height: 28px; }
        .hf-text { display: flex; flex-direction: column; gap: 0.15rem; line-height: 1.3; }
        .hf-k { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust); }
        .hf-text b { font-size: 1rem; font-weight: 700; letter-spacing: -0.015em; }
        .hf-text em { font-style: normal; font-size: 0.75rem; color: var(--text-secondary); line-height: 1.45; }
        .hf-go { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--rust); color: #fff; font-size: 0.875rem; transition: transform var(--dur-slow) var(--ease-spring); }
        .hero-fit:hover .hf-go { transform: translateX(3px); }
        @media (max-width: 480px) { .hero-fit { grid-template-columns: auto minmax(0, 1fr); } .hf-go { display: none; } }
        @media (prefers-reduced-motion: reduce) { .hero-fit, .hf-go { transition: none; } .hero-fit:hover { transform: none; } }

        /* "Fit check": the hiring chip. A job description whose rows are scored
           with beads, and a check; the beads slide along their rods on hover. */
        .nav-fit {
            display: inline-flex; align-items: center; gap: 0.4rem; height: var(--ctl-h-sm); padding: 0 0.8rem 0 0.5rem;
            border-radius: var(--ctl-radius, 8px); border: 1px solid rgba(224,48,30,0.45); background: var(--paper, #fff6f4);
            color: var(--ink, #1c1c1e); font-size: 0.8125rem; font-weight: 650; letter-spacing: -0.005em; white-space: nowrap; text-decoration: none;
            transition: background var(--dur-fast) var(--ease-move), border-color var(--dur-fast) var(--ease-move), box-shadow var(--dur-fast) var(--ease-move);
        }
        .nav-fit:hover { background: #ffece8; border-color: var(--rust, #e0301e); text-decoration: none;  }
        .nav-fit:focus-visible { outline: 2px solid var(--blue, #c8261a); outline-offset: 2px; }
        .nav-fit[aria-current="page"] { background: #ffece8; border-color: var(--rust, #e0301e); }
        .nav-fit .nf-long { color: var(--rust-deep, #b4200f); }
        .fit-ic { width: 20px; height: 20px; flex: none; }
        .fit-ic .fb { transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); transform-box: view-box; }
        .nav-fit:hover .fb-1, .hero-fit:hover .fb-1 { transform: translateX(4.5px); }
        .nav-fit:hover .fb-2, .hero-fit:hover .fb-2 { transform: translateX(2.5px); }
        @media (max-width: 460px) { .nav-fit { padding: 0 0.55rem 0 0.4rem; gap: 0.3rem; font-size: 0.75rem; } .nav-fit .fit-ic { width: 18px; height: 18px; } }
        @media (prefers-reduced-motion: reduce) { .fit-ic .fb { transition: none; } }
        /* small phones: tighter bar, CV without its arrow; the name yields to the logo below 340px */
        @media (max-width: 420px) { .site-nav { gap: 0.75rem; } .nav-actions { gap: 0.3rem; } .nav-btn-ghost { padding: 0 0.55rem; } .nav-btn-ghost svg { display: none; } }
        @media (max-width: 350px) { .brand-name { display: none; } }

        .nav-btn-ghost, .nav-btn-solid {
            display: inline-flex; align-items: center; gap: 0.375rem; height: var(--ctl-h-sm); padding: 0 0.875rem;
            border-radius: var(--ctl-radius); font-size: 0.8125rem; font-weight: 600; letter-spacing: -0.005em;
            text-decoration: none; white-space: nowrap;
            transition: background var(--dur-fast) var(--ease-move), border-color var(--dur-fast) var(--ease-move),
                        color var(--dur-fast) var(--ease-move), box-shadow var(--dur-fast) var(--ease-move);
        }
        .nav-btn-ghost { color: var(--ink); border: 1px solid var(--ctl-line); background: var(--bg); }
        .nav-btn-ghost:hover { border-color: var(--ctl-line-hover); background: var(--ctl-tint); text-decoration: none; }
        .nav-btn-ghost svg { width: 12px; height: 12px; opacity: 0.6; }
        .nav-btn-solid { color: #fff; background: var(--ink); border: 1px solid var(--ink);  }
        .nav-btn-solid:hover { background: #000; text-decoration: none;  }
        .nav-links a:focus-visible, .brand:focus-visible, .nav-btn-ghost:focus-visible,
        .nav-btn-solid:focus-visible, .nav-toggle:focus-visible {
            outline: 2px solid var(--blue); outline-offset: 2px;
        }

        .nav-toggle {
            display: none; width: 36px; height: 36px; border-radius: var(--ctl-radius); border: 1px solid var(--ctl-line);
            background: var(--bg); cursor: pointer; position: relative; flex: none;
        }
        .nav-toggle span {
            position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--ink); border-radius: 2px;
            transition: transform var(--dur-base) var(--ease-out), top var(--dur-base) var(--ease-out);
        }
        .nav-toggle span:nth-child(1) { top: 14px; }
        .nav-toggle span:nth-child(2) { top: 20px; }
        .site-header.menu-open .nav-toggle span:nth-child(1) { top: 17px; transform: rotate(45deg); }
        .site-header.menu-open .nav-toggle span:nth-child(2) { top: 17px; transform: rotate(-45deg); }
        .nav-sheet {
            display: none; border-top: 1px solid rgba(28,28,30,0.08); background: rgba(255,255,255,0.97);
            backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
        }
        .nav-sheet a {
            display: flex; justify-content: space-between; align-items: center; padding: 0.875rem 0;
            border-bottom: 1px solid rgba(28,28,30,0.06); color: var(--ink); text-decoration: none;
            font-size: 1rem; font-weight: 600; letter-spacing: -0.01em;
        }
        .nav-sheet a span { color: var(--text-muted); font-weight: 500; font-size: 0.8125rem; }
        .nav-sheet .container { padding-top: 0.25rem; padding-bottom: 1rem; }

        /* laptops: the recruiter toggle keeps its switch and drops its words */
        @media (max-width: 1279px) and (min-width: 1201px) { .nav-rec .rec-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
        @media (max-width: 1200px) {
            .nav-links { display: none; }
            .nav-toggle { display: inline-block; }
            .site-header.menu-open { background: rgba(255,255,255,0.97); border-bottom-color: rgba(28,28,30,0.08); }
            .site-header.menu-open .nav-sheet { display: block; animation: sheet-in var(--dur-base) var(--ease-out); }
            @keyframes sheet-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
        }
        @media (max-width: 640px) { .nav-btn-solid { display: none; } }
        @media (prefers-reduced-motion: reduce) {
            .brand:hover .brand-mark .bead { transform: none; }
        }

        /* Hero */
        .hero { padding: 4rem 0; position: relative; }

        @keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }

        /* Ticker: every word sits in the same grid cell, so the box is always as
           wide as the longest word and nothing beside it ever moves. The words
           slide past each other the same way the chips do. */
        .ticker { display: inline-grid; vertical-align: bottom; overflow: hidden; }
        /* Soft motion for text: a short travel, a long ease-out, and a little
           blur while moving, so one word dissolves into the next instead of
           being swapped. The outgoing word leaves slightly faster than the new
           one arrives, so the two never fight for the eye. */
        .ticker > .tk {
            grid-area: 1 / 1; white-space: nowrap;
            opacity: 0; transform: translateY(0.45em); filter: blur(5px);
            transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1), opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
                        filter 600ms cubic-bezier(0.16, 1, 0.3, 1);
        }
        .ticker > .tk.is-on { opacity: 1; transform: none; filter: blur(0); transition-delay: 90ms; }
        .ticker > .tk.is-off {
            opacity: 0; transform: translateY(-0.35em); filter: blur(4px);
            transition-duration: 420ms; transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
        }
        @media (prefers-reduced-motion: reduce) { .ticker > .tk, .chip-face { transition: none; filter: none; } }
        .hero-is {
            font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
            margin-bottom: 0.625rem; white-space: nowrap;
        }
        .hero-is-name { color: var(--rust); }
        /* Vahid Sora draws the full stop as a round bead; in the headline it is red. */
        .bead-stop { color: var(--rust); }
        .ticker > .tk { justify-self: start; }
        .hero-what > .tk { padding-bottom: 0.06em; background: linear-gradient(var(--mark), var(--mark)) left 88% / 100% 0.22em no-repeat; }
        .hero-is mark {
            color: inherit; padding: 0 0.2em; margin: 0 -0.05em; border-radius: 3px;
            background: linear-gradient(var(--mark), var(--mark)) left center / 100% 72% no-repeat;
        }
        .hero-is .tk.is-on mark { animation: mark-sweep 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both; }
        @keyframes mark-sweep {
            from { background-size: 0% 72%; }
            to   { background-size: 100% 72%; opacity: 1; }
        }
        .hero-icon-row { display: flex; align-items: center; gap: 1.75rem; margin-bottom: 1.25rem; }
        /* The hero mark is a pencil drawing of an abacus, hung the way a print
           is: a hairline frame, a paper mat, and a museum-style caption. */
        .hero-art { flex: none; width: 136px; margin: 0; }
        .hero-art-frame {
            padding: 7px; background: #f7f3ea;
            border: 1px solid var(--border-strong); border-radius: 2px;
            
            transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--transition);
        }
        .hero-art-frame img {
            display: block; width: 100%; height: auto; aspect-ratio: 560 / 572;
            outline: 1px solid rgba(0,0,0,0.08); outline-offset: -1px;
        }
        .hero-art:hover .hero-art-frame {
            transform: translateY(-2px) rotate(-0.6deg);
            
        }
        .hero-art figcaption {
            margin-top: 0.5rem; font-size: 0.75rem; line-height: 1.4; letter-spacing: 0.06em;
            text-transform: uppercase; color: var(--text-muted);
            font-variation-settings: "MONO" 1, "CASL" 0;
        }
        .hero-art figcaption em { font-style: normal; color: var(--accent); }
        @media (prefers-reduced-motion: reduce) { .hero-art:hover .hero-art-frame { transform: none; } }
        .hero-name { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }



        .hero-rule { display: block; width: 100%; height: 3px; background: var(--accent); border: none; margin: 1.25rem 0 1rem; }
        .hero-tagline {
            font-size: 1.125rem; color: var(--text-secondary); margin-bottom: 0;
            font-variation-settings: "MONO" 0.2, "CASL" 0.2; font-weight: 500;
            max-width: 34rem;
        }
        /* Chips are equal tiles on a grid, so the row reads as one set. Each
           has two faces stacked in the same box: the topic, and what it means in
           practice. Hover, focus or tap slides one face up and the other in, so
           the chip never changes size and nothing reflows. */
        .bio-tags {
            display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem;
            margin-top: 0.5rem; margin-bottom: 0.25rem;
        }
        .bio-tag {
            position: relative; height: var(--ctl-h); overflow: hidden; padding: 0 0.75rem;
            font-family: var(--font); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em;
            font-variation-settings: "MONO" 0.8, "CASL" 0;
            border-radius: var(--ctl-radius); border: 1px solid var(--ctl-line); background: var(--bg);
            color: var(--text-secondary); cursor: pointer; text-align: center;
            transition: border-color var(--dur-slow) var(--ease-out), color var(--dur-slow) var(--ease-out),
                        background var(--dur-slow) var(--ease-out), opacity var(--dur-slow) var(--ease-out);
        }
        .bio-tag.accent { color: var(--ink); }
        .bio-tag:hover { border-color: var(--ctl-line-hover); }
        .chip-face {
            position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
            padding: 0 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1), opacity 500ms cubic-bezier(0.16, 1, 0.3, 1),
                        filter 500ms cubic-bezier(0.16, 1, 0.3, 1);
        }
        .chip-face { gap: 0.4rem; }
        .chip-face .ab { width: 15px; height: 15px; flex: none; color: currentColor; }
        .chip-b { transform: translateY(60%); opacity: 0; filter: blur(4px); font-weight: 500; }
        .bio-tag.is-flipped .chip-a { transform: translateY(-60%); opacity: 0; filter: blur(4px); }
        .bio-tag.is-flipped .chip-b { transform: translateY(0); opacity: 1; filter: blur(0); transition-delay: 60ms; }
        .bio-tag.is-flipped { background: var(--paper); border-color: var(--rust); color: var(--rust); }
        .bio-tag:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
        .bio-tags.has-focus .bio-tag:not(.is-flipped) { opacity: 0.45; }


        /* ---- through-line: the problem, how I got here, the record ---------- */
        .problem {
            display: grid; grid-template-columns: 200px 1fr; gap: 2rem; align-items: center;
            margin: 1.5rem 0 2.5rem; padding: 1.5rem 1.75rem 1.75rem; position: relative;
            border-top: 1px solid var(--ctl-line); border-bottom: 1px solid var(--ctl-line);
            border-left: 3.5px solid rgba(28,28,30,0.8); border-right: 3.5px solid rgba(28,28,30,0.8); border-radius: 5px;
            background: radial-gradient(circle, rgba(224,48,30,0.14) 1px, transparent 1.6px) 0 0 / 14px 14px;
            -webkit-mask-image: none;
        }
        .problem::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 35%, rgba(255,255,255,0.86)); border-radius: inherit; z-index: 0; }
        .problem > * { position: relative; z-index: 1; }
        .problem .story-art { width: 100%; }
        .problem-big { margin: 0.5rem 0 0.75rem; font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; color: var(--ink); }
        .problem-note { margin: 0 0 1.125rem; font-size: 0.9375rem; line-height: 1.65; color: var(--text-secondary); max-width: 34rem; }
        .problem .story-domains { margin: 0; padding: 0; border: 0; }
        .arc-head { display: block; margin-bottom: -0.5rem; }
        @media (max-width: 640px) {
            .problem { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.25rem; }
            .problem .story-art { width: 150px; }
        }

        /* ---- the boxes below the hero share the abacus holder frame -------- */
        .hire-cta, .reel {
            border-left: 3.5px solid rgba(28,28,30,0.8); border-right: 3.5px solid rgba(28,28,30,0.8); border-radius: 6px;
            position: relative;
        }
        .hire-cta::after, .reel::after {
            content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: rgba(28,28,30,0.12); pointer-events: none;
        }
        .hire-cta:hover, .reel:hover { border-left-color: var(--rust); border-right-color: var(--rust); }

        /* ---- wide screens: use the room ------------------------------------- */
        @media (min-width: 1200px) {
            .container { max-width: 1120px; }
            .hero-name { font-size: 3.25rem; }
            .hero-identity { width: 240px; }
            .hero-portrait { width: 136px; height: 136px; }
            .hero-tagline { max-width: 44rem; }
            .hero-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; max-width: 52rem; }
            .hero-cards .hire-cta, .hero-cards .reel { max-width: none; margin-top: 1.125rem; }
            .section-tagline { max-width: 48rem; }
        }
        @media (min-width: 1600px) {
            .container { max-width: 1240px; }
            .hero-name { font-size: 3.75rem; }
        }
        /* external displays (Studio Display, Pro Display XDR, 4K and up):
           scale everything together, so type, controls and beads keep their
           proportions and the page fills about two thirds of the width */
        @media (min-width: 1880px) { .site-header, main.container, .site-footer > :not(.footer-wordmark) { zoom: 1.14; } }
        @media (min-width: 2300px) { .site-header, main.container, .site-footer > :not(.footer-wordmark) { zoom: 1.36; } }
        @media (min-width: 2900px) { .site-header, main.container, .site-footer > :not(.footer-wordmark) { zoom: 1.66; } }
        @media (min-width: 3600px) { .site-header, main.container, .site-footer > :not(.footer-wordmark) { zoom: 2.05; } }
        @media (min-width: 4800px) { .site-header, main.container, .site-footer > :not(.footer-wordmark) { zoom: 2.75; } }

        /* ---- abacus holder frames ------------------------------------------
           Chips and story cards share one minimal frame: two ink posts at the
           sides, a hairline rail along the bottom and a bead that travels the
           rail when the frame is touched. */
        .bio-tag, .arc-step {
            border-left: 3.5px solid rgba(28,28,30,0.8); border-right: 3.5px solid rgba(28,28,30,0.8);
            border-radius: 5px;
        }
        .bio-tag::after, .arc-step::after {
            content: ""; position: absolute; left: 0; right: 0; bottom: 5px; height: 1px;
            background: rgba(28,28,30,0.16); pointer-events: none;
        }
        .bio-tag::before {
            content: ""; position: absolute; bottom: 3px; left: 8px; width: 5px; height: 5px; z-index: 1;
            border-radius: 50%; background-color: var(--mark); pointer-events: none;
            --b2: var(--mark);
            background-image: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.8) 0 14%, rgba(255,255,255,0) 22%);
            
            transition: left 700ms var(--ease-spring, cubic-bezier(0.22, 1, 0.36, 1)), background-color 300ms;
        }
        .bio-tag.accent::before { background-color: var(--rust); }
        .bio-tag.accent::before { --b2: rgba(28,28,30,0.78); }
        .bio-tag:hover::before, .bio-tag.is-flipped::before { left: calc(100% - 24px); background-color: var(--rust); }
        .bio-tag:hover, .bio-tag.is-flipped { border-left-color: var(--ink); border-right-color: var(--ink); }
        .bio-tag.is-flipped { border-left-color: var(--rust); border-right-color: var(--rust); }
        @media (prefers-reduced-motion: reduce) { .bio-tag::before { transition: none; } }


        /* ---- book a call: two ways, and which one fits right now ------------ */
        .book-pick {
            position: absolute; z-index: 30; left: 0.5rem; top: calc(100% + 8px); width: min(22rem, calc(100vw - 2.5rem));
            padding: 0.625rem; border-radius: 12px; background: var(--bg); border: 1px solid var(--ctl-line);
            
            transform-origin: top left; animation: bp-in 0.38s cubic-bezier(0.22, 1, 0.36, 1);
        }
        .book-pick[hidden] { display: none; }
        @keyframes bp-in { from { opacity: 0; transform: translateY(-6px) scale(0.96); } to { opacity: 1; transform: none; } }
        .bp-fit { margin: 0.125rem 0.375rem 0.5rem; font-size: 0.75rem; line-height: 1.45; color: var(--text-secondary); }
        .bp-fit b { color: var(--ink); font-weight: 600; }
        @media (max-width: 640px) { .book-pick { right: 0; left: 0; width: auto; } }
        @media (prefers-reduced-motion: reduce) { .book-pick { animation: none; } }
        /* ---- the arc: languages, data products, applied AI ------------------ */
        .arc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin: 1.25rem 0 0.75rem; }
        .arc-step {
            position: relative; padding: 1rem 1rem 1.5rem; background: var(--bg);
            border-top: 1px solid var(--ctl-line); border-bottom: 1px solid var(--ctl-line);
            transition: border-color var(--dur-slow) var(--ease-out), background var(--dur-slow) var(--ease-out);
        }
        .arc-step:hover { border-left-color: var(--rust); border-right-color: var(--rust); background: var(--paper); }
        .arc-kicker { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rust-deep); }
        .arc-step h3 { margin: 0.375rem 0 0.375rem; font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
        .arc-step p { margin: 0; font-size: 0.8125rem; line-height: 1.6; color: var(--text-secondary); }
        .arc-step p b { font-weight: 600; color: var(--ink); }
        .arc-bridge { margin: 0.25rem 0 2rem; font-size: 0.875rem; color: var(--text-secondary); }
        .arc-bridge b { color: var(--ink); font-weight: 600; }
        @media (max-width: 760px) { .arc { grid-template-columns: 1fr; } }
        /* The caret is what makes a retype legible as typing rather than as
           text glitching. It only exists while a line is being written. */
        .is-typing::after {
            content: ""; display: inline-block;
            width: 0.5em; height: 1em; margin-left: 1px;
            /* Negative margin cancels the caret's own width, so a line being
               typed occupies exactly the space its text will occupy. Without
               this the caret widens its container mid-type, which was enough to
               wrap the hire CTA onto a second line on a phone. */
            margin-right: calc(-0.5em - 1px);
            background: currentColor; vertical-align: -0.15em;
            animation: type-caret 1.05s steps(1, end) infinite;
        }
        @keyframes type-caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.1; } }
        /* The global reduced-motion rule below zeroes every duration, so
           components do not repeat it. These two are outside its reach: a
           pseudo-element that should not exist at all, and a view transition,
           which is neither a transition nor an animation on an element. */
        @media (prefers-reduced-motion: reduce) {
            .is-typing::after { display: none; }
            ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
        }

        .hero-identity {
            float: right; width: 208px; margin: 0.25rem 0 0.75rem 1.5rem;
            display: flex; flex-direction: column; align-items: center; text-align: center;
        }
        .identity-core .hero-is {
            margin: 0.875rem 0 0; font-size: 0.8125rem; line-height: 1.4; white-space: normal;
        }
        .identity-core .hero-is .ticker { display: grid; width: 100%; }
        .identity-core .hero-is .ticker > .tk { white-space: normal; justify-self: center; }
        .identity-core { display: contents; }
        /* phones: the portrait lives in About (a script moves it); keep it out of the hero from first paint so nothing jumps */
        @media (max-width: 640px) { #hero-identity > #identity-core { display: none; } }
        .about-identity { margin: 0 0 1.5rem; }
        .art-credit { color: inherit; text-decoration: none; border-bottom: 1px solid var(--ctl-line); transition: color .2s, border-color .2s; }
        .art-credit:hover { color: var(--rust); border-color: var(--rust); }
        /* The portrait is the halftone from Seven Portraits: one ink dot per
           cell of a 64x64 tone map, on paper. Under the pointer the dots swell,
           the same lens the piece uses. */
        .hero-portrait {
            position: relative; width: 112px; height: 112px; margin: 0;
            background: var(--paper); border-radius: 4px;
            
        }
        .hero-portrait canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
        /* a Figma-style cursor: arrow plus a name tag that reads the current portrait */
        .pm-cursor { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; color: var(--rust); opacity: 0; transition: opacity 0.15s ease; will-change: transform; }
        .pm-cursor svg { display: block; margin: -2px 0 0 -2px;  }
        .pm-cursor b { position: absolute; left: 12px; top: 12px; padding: 0.16rem 0.4rem; border-radius: 999px; background: var(--rust); color: #fff; font: 600 0.75rem/1 var(--font-sans, inherit); white-space: nowrap;  }
        @media (hover: hover) and (pointer: fine) {
            .hero-portrait.is-figma canvas { cursor: none; }
            .hero-portrait.is-figma .pm-cursor { opacity: 1; }
        }
        /* phones: the portrait lives in About, so the hero carries a small photo by the name */
        .hero-avatar { display: none; }
        @media (max-width: 640px) {
            /* phones: a framed portrait sits above the name, like the desktop one */
            .hero-avatar {
                display: block; width: 104px; height: 104px; margin: 0 0 1rem 6px;
                border-radius: 24px; object-fit: cover; object-position: 50% 22%; background: var(--paper);
                border: 4px solid #fff;
                outline: 5px solid #d8bb94; outline-offset: 0;
            }
            .hero { display: flex; flex-direction: column; }
            .hero > * { order: 3; }
            .hero > .hero-icon-row { order: 1; margin-bottom: 0.75rem; }
            .hero > .hero-identity { order: 2; margin: 0 0 0.5rem; }
        }

        .metrics-grid {
            display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin: 0 0 2.5rem;
        }
        .metric-card {
            padding: 1.125rem 1rem; background: var(--bg); text-align: center; cursor: pointer;
            border: 1px solid var(--ctl-line); border-radius: var(--radius);
            transition: border-color var(--ctl-ease), box-shadow var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
        }
        .metric-card:hover { border-color: var(--ctl-line-hover);  }
        .metric-card.flipped { border-color: var(--accent); background: var(--paper); }
        .metric-card.flipped .metric-label { color: var(--accent); font-weight: 500; }
        .metric-num {
            font-size: 1.625rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.03em;
            font-variation-settings: "MONO" 1, "CASL" 0;
            color: var(--accent);
            min-height: 2.75rem;
            display: flex; align-items: center; justify-content: center;
            
        }
        .metric-card.flipped .metric-num { font-size: 0.9375rem; }
        .metric-label {
            font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
            color: var(--text-muted); margin-top: 0.375rem;
            font-variation-settings: "MONO" 0.8, "CASL" 0; font-weight: 400;
            transition: color var(--transition);
            min-height: 1.75rem; display: flex; align-items: center; justify-content: center;
            line-height: 1.4;
        }

        /* Hero actions: one set. Same height, an abacus icon leading each,
           the CV as the single solid action. Icons count their beads on hover. */
        .hero-ctas { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
        .hero-ctas .btn { height: var(--ctl-h); padding: 0 0.875rem; gap: 0.5rem; }
        .hero-ctas .cta-go { color: var(--ink); }
        .hero-ctas .cta-go .ab { width: 17px; height: 17px; opacity: 1; color: var(--ink); }
        .hero-ctas .cta-go:hover .ab .bead-acc { transform: translateX(2.4px) scale(1.1); }
        .hero-ctas .cta-go:hover .ab .bead-ink { transform: translateX(1.6px); }
        .cta-label {
            font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
            color: var(--accent); font-variation-settings: "MONO" 1, "CASL" 0;
            display: flex; align-items: center; gap: 0.5rem;
        }
        /* ---- skills, compact: pills that fit their words, both faces in one grid cell ---- */
        #skills .bio-tags { display: flex; flex-wrap: wrap; align-self: stretch; width: 100%; gap: 0.5rem; margin: 0.15rem 0 0.75rem; padding: 0 0 0.9rem; overflow: visible; border-bottom: 1px dashed rgba(28,28,30,0.1); }
        #skills .bio-tag { display: inline-grid; flex: none; height: 2.125rem; padding: 0 0.875rem; border-radius: 999px; }
        #skills .chip-face { position: static; grid-area: 1 / 1; padding: 0; }
        #skills .stack-abacus { margin-top: 0.75rem; padding-top: 1.25rem; padding-bottom: 0.9rem; }
        #skills .sa-msg { margin-bottom: 0.75rem; }
        @media (max-width: 640px) {
            #skills .bio-tags { display: grid; grid-template-columns: 1fr 1fr; gap: 0.375rem; margin: 0 0 0.5rem; }
            #skills .bio-tag { width: 100%; height: auto; min-height: 2.25rem; padding: 0.3rem 0.6rem; font-size: 0.75rem; border-radius: 12px; }
            #skills .chip-face { white-space: normal; text-align: left; justify-content: flex-start; line-height: 1.2; }
        }
        #fit-input { width: 100%; resize: vertical; min-height: 7rem; padding: 0.875rem 1rem; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--ink); font: inherit; font-size: 0.9375rem; line-height: 1.5; }
        #fit-input:focus { outline: 2px solid var(--rust); outline-offset: 1px; }
        #fit-out:not(:empty) { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px dashed rgba(28,28,30,0.12); }
        .fit-score { margin: 0; font-size: 1.0625rem; color: var(--ink); } .fit-score b { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin-right: 0.25rem; }
        .fit-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.75rem; }
        .fit-chip { font-family: var(--font-mono); font-size: 0.75rem; padding: 0.3rem 0.6rem; border-radius: 999px; border: 1px dashed var(--border-strong); color: var(--text-secondary); background: var(--bg); }
        .fit-chip.on { border: 1px solid #16a34a; color: #0f6b32; background: #f0fdf4; }
        .fit-sub { margin: 1.125rem 0 0.375rem; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust-deep); }
        .fit-cases { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
        .fit-cases li { display: grid; gap: 0.125rem; padding: 0.625rem 0.875rem; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
        .fit-cases a { font-weight: 700; color: var(--ink); text-decoration: none; } .fit-cases a:hover { color: var(--rust-deep); }
        .fit-cases span { font-size: 0.75rem; color: var(--text-secondary); }
        .fit-receipt { margin: 1rem 0 0; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); }
        .fit-note { margin: 0; color: var(--text-secondary); }

        .sa-used { margin: 0.5rem 0 0; min-height: 1.4em; font-size: 0.8125rem; color: var(--text-secondary); }
        .sa-used b { color: var(--ink); } .sa-used a { color: var(--rust-deep); font-weight: 600; text-decoration: none; } .sa-used a:hover { text-decoration: underline; }
        #skills .sb { cursor: pointer; } #skills .sb:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; border-radius: 8px; }
        #skills .sb.is-picked .sb-bead { transform: translateY(-3px) scale(1.12); outline: 2px solid var(--rust); outline-offset: 0; }
        #skills .sb.is-picked .sb-name { color: var(--rust-deep); font-weight: 600; }
        .case-card.uses-tool {  }
        .case-card.is-pinged { animation: case-ping 1.4s var(--ease-out); }
        @keyframes case-ping { 0% {  } 100% { outline: 18px solid rgba(224,48,30,0); outline-offset: 0; } }

        .case-meta { align-items: center; }
        @media (prefers-reduced-motion: reduce) { .case-card.is-pinged { animation: none; } }

        .rc-make { margin-top: 0.5rem; font-size: 0.8125rem; color: var(--text-secondary); }
        .rc-make summary { cursor: pointer; width: fit-content; }
        .rc-make-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.625rem 0 0.5rem; }
        .rc-make input, .rc-make select { font: inherit; font-size: 0.8125rem; padding: 0.45rem 0.7rem; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--ink); }
        .rc-make code { font-size: 0.75rem; word-break: break-all; }
        /* ---- proof strip: four facts under the bio ---- */
        .proof-strip { list-style: none; margin: 1.25rem 0 0; padding: 0.75rem 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem 1.25rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
        .proof-strip li { display: flex; align-items: baseline; gap: 0.5rem; min-width: 0; }
        .proof-strip b { font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
        .proof-strip li:first-child b { color: var(--rust); }
        .proof-strip span { font-size: 0.75rem; line-height: 1.3; color: var(--text-secondary); }
        @media (max-width: 860px) { .proof-strip { grid-template-columns: 1fr 1fr; } }
        .bk-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
        /* ---- Applied AI, Simplified, featured before the case studies ----
           One compact card. The seven steps are seven beads on one rod, numbered 01 to 07:
           the red bead walks the rod on its own (or follows the pointer), the rod fills up
           to it and the caption under the rod says what that step holds. Under it, one strip
           of live numbers from the site's pulse.json. */
        .aai-feat-wrap { scroll-margin-top: 80px; }
        .aai-feat { position: relative; display: flex; flex-direction: column; gap: 0;
            padding: 1.75rem 2.25rem 1.75rem; border: 1px solid rgba(224,48,30,0.22); background-color: var(--paper, #fff6f4); overflow: hidden; isolation: isolate; }
        .aai-feat::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
            background-image: radial-gradient(circle, rgba(224,48,30,0.16) 1.1px, transparent 1.6px); background-size: 16px 16px;
            -webkit-mask-image: radial-gradient(90% 120% at 100% 0%, #000 0%, transparent 62%); mask-image: radial-gradient(90% 120% at 100% 0%, #000 0%, transparent 62%); }
        .aai-copy, .aai-rods { display: contents; }
        .aai-head { order: 1; display: flex; align-items: center; gap: 0.65rem; }
        .aai-logo { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--bg); border: 1px solid var(--border);  }
        .aai-logo svg { width: 28px; height: 28px; }
        .aai-feat-wrap.visible .aai-logo svg circle { animation: aai-spin 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both; transform-origin: 9.3px 12px; }
        @keyframes aai-spin { from { transform: translateX(-4px) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
        .aai-h { order: 2; font-size: clamp(1.7rem, 1.1rem + 2vw, 2.4rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 750; margin: 0.8rem 0 0.35rem; color: var(--ink); text-wrap: balance; }
        .aai-h .dot { color: var(--rust); display: inline-block; }
        .aai-feat-wrap.visible .aai-h .dot { animation: aai-drop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both; }
        @keyframes aai-drop { from { transform: translateY(-0.9em); opacity: 0; } to { transform: none; opacity: 1; } }
        .aai-lead { order: 3; font-size: 0.95rem; color: var(--text-secondary); margin: 0; max-width: 40rem; text-wrap: pretty; }
        .aai-c { display: contents; }
        /* the rod: seven beads, i to vii */
        .aai-steps { order: 4; position: relative; list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); --at: 0; }
        .aai-steps::before, .aai-steps::after { content: ""; position: absolute; left: calc(100% / (2 * var(--n, 7))); right: calc(100% / (2 * var(--n, 7))); top: 14px; height: 3px; border-radius: 3px; }
        .aai-steps::before { background: linear-gradient(#e9d3a8, #b88d52);  }
        .aai-steps::after { right: auto; width: calc((100% - 100% / var(--n, 7)) * var(--at) / (var(--n, 7) - 1)); background: linear-gradient(90deg, #ff7a66, #e0301e); transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
        .aai-steps li { position: relative; z-index: 1; min-width: 0; }
        .aai-steps a { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0 0.15rem; text-decoration: none; color: var(--ink); text-align: center; outline-offset: 4px; border-radius: 10px; }
        .aai-steps a::before { content: ""; width: 30px; height: 30px; border-radius: 50%; flex: none;
            background: radial-gradient(circle at 34% 30%, #6b6b70, #1c1c1e 55%, #000); 
            transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s; }
        .aai-steps li.on a::before, .aai-steps a:hover::before, .aai-steps a:focus-visible::before {
            background: radial-gradient(circle at 34% 30%, #ff9d8f, #e0301e 45%, #9e1a0c);  transform: translateY(-4px) scale(1.12); }
        .aai-steps li.done a::before { background: radial-gradient(circle at 34% 30%, #ffb4a8, #f0705f 50%, #c2402e); }
        .aai-n { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--text-tertiary, #8e8e93); transition: color 0.3s; }
        .aai-steps li.on .aai-n { color: var(--rust-deep); }
        .aai-steps b { font-size: 0.78rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; color: var(--text-secondary); transition: color 0.3s; }
        .aai-steps li.on b, .aai-steps a:hover b { color: var(--ink); }
        .aai-steps a:focus-visible { outline: 2px solid var(--rust); outline-offset: 6px; }
        .aai-steps em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
        .aai-feat-wrap .aai-steps li { opacity: 0; transform: translateY(-14px); }
        .aai-feat-wrap.visible .aai-steps li { animation: aai-bead 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--i) * 70ms + 200ms) both; }
        @keyframes aai-bead { from { opacity: 0; transform: translateY(-18px) scale(0.7); } to { opacity: 1; transform: none; } }
        .aai-cap { order: 5; display: flex; align-items: baseline; justify-content: center; gap: 0.6rem; min-height: 1.5rem; margin: 0.9rem 0 0; font-size: 0.875rem; color: var(--text-secondary); text-align: center; }
        .aai-cap span { transition: opacity 0.25s, transform 0.25s; } .aai-cap.swap span { opacity: 0; transform: translateY(4px); }
        .aai-cap a { font-weight: 650; color: var(--rust-deep); white-space: nowrap; text-decoration: none; }
        .aai-cap a::after { content: "→"; margin-left: 0.3em; display: inline-block; transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
        .aai-cap a:hover::after, .aai-cap a:focus-visible::after { transform: translateX(3px); }
        .aai-cap b { font-weight: 650; color: var(--ink); }
        /* one strip of live numbers */
        /* the live numbers: same type as the case-study metric cards (site font, MONO axis,
           uppercase muted labels), one tight row */
        .aai-pulse { order: 6; margin: 1rem 0 0; padding: 0.7rem 1rem 0.95rem; border-radius: var(--radius, 14px); background: var(--bg); border: 1px solid var(--ctl-line, var(--border)); }
        .ap-k { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted, var(--text-secondary)); font-variation-settings: "MONO" 0.8, "CASL" 0; }
        .ap-wk { margin-left: auto; white-space: nowrap; letter-spacing: 0.04em; }
        .ap-live { width: 6px; height: 6px; border-radius: 50%; background: var(--rust);  animation: ap-live 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
        @keyframes ap-live { 0% {  } 70%, 100% { outline: 7px solid rgba(224,48,30,0); outline-offset: 0; } }
        .ap-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 0.45rem; }
        .ap-cell { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; padding: 0 0.4rem; }
        .ap-cell + .ap-cell { border-left: 1px solid var(--ctl-line, var(--border)); }
        .ap-cell b { font-size: 1.25rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.03em; font-variation-settings: "MONO" 1, "CASL" 0; color: var(--ink); font-variant-numeric: tabular-nums; }
        .ap-cell:first-child b, .ap-cell.ap-map:nth-child(4) b { color: var(--accent, var(--rust-deep)); }
        .ap-cell span { margin-top: 0.15rem; font-size: 0.75rem; line-height: 1.35; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted, var(--text-secondary)); font-variation-settings: "MONO" 0.8, "CASL" 0; }
        [data-map][hidden] { display: none !important; }
        .ap-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
        .ap-live { cursor: help; }
        .aai-feat .cta-actions { order: 7; margin-top: 1rem; align-items: center; gap: 0.5rem 1.25rem; }
        .aai-feat .cta-actions .btn-outline { background: none; border-color: transparent;  padding-left: 0.25rem; padding-right: 0.25rem; color: var(--ink); text-decoration: underline; text-decoration-color: rgba(224,48,30,0.45); text-underline-offset: 4px; }
        .aai-feat .cta-actions .btn-outline:hover { color: var(--rust-deep); text-decoration-color: currentColor; transform: none; }
        @media (max-width: 760px) {
            .aai-feat { padding: 1.4rem 1.1rem 1.4rem; }
            .aai-steps b { display: none; } .aai-steps a::before { width: 28px; height: 28px; } .aai-steps::before, .aai-steps::after { top: 12px; }
            .ap-row { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 0.6rem; }
            .aai-cap { display: block; font-size: 0.8125rem; } .aai-cap a { margin-left: 0.4rem; }
            .ap-cell:nth-child(4) { border-left: 0; }
            .aai-feat .cta-actions .btn { flex: 1 1 auto; } }
        @media (prefers-reduced-motion: reduce) {
            .aai-feat-wrap .aai-steps li, .aai-feat-wrap.visible .aai-steps li { opacity: 1; transform: none; animation: none; }
            .aai-steps a::before, .aai-steps::after, .aai-cap span { transition: none; } .ap-live, .aai-feat-wrap.visible .aai-h .dot, .aai-feat-wrap.visible .aai-logo svg circle { animation: none; } }
        .cta-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; }
        /* Buttons are the nav beads at reading size: a pill with a hairline
           edge, filled only on hover, when it also slides a few pixels along
           its rod. */
        .btn {
            display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
            height: var(--ctl-h); padding: 0 1rem; border-radius: var(--ctl-radius);
            font-family: var(--font); font-size: 0.8125rem; font-weight: 600; letter-spacing: -0.005em;
            text-decoration: none; cursor: pointer; white-space: nowrap;
            border: 1px solid var(--ctl-line); background: var(--bg); color: var(--ink);
            transition: background var(--ctl-ease), border-color var(--ctl-ease), color var(--ctl-ease),
                        box-shadow var(--ctl-ease), transform 120ms var(--ease-move);
        }
        .btn:hover { text-decoration: none; border-color: var(--ctl-line-hover); background: var(--ctl-tint); }
        .btn:active { transform: scale(0.98); }
        .btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
        .btn svg { width: 13px; height: 13px; opacity: 0.7; }
        /* solid: the one primary action in a group */
        .btn-primary { background: var(--ink); border-color: var(--ink); color: #fff;  }
        .btn-primary:hover { background: #000; border-color: #000;  }
        .btn-primary svg { opacity: 1; }
        /* ghost: everything else */
        .btn-outline { color: var(--ink); }
        .btn-sm { height: var(--ctl-h-sm); padding: 0 0.75rem; font-size: 0.75rem; }

        .hero-links {
            display: flex; flex-wrap: nowrap; gap: 0.125rem;
            margin-top: 0.75rem; justify-content: center; align-items: center;
        }
        .hero-links a { display: flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; transition: opacity var(--transition), transform var(--transition); }
        .hero-links a:hover { opacity: 0.75; transform: translateY(-2px); text-decoration: none; }
        .hero-links svg { width: 18px; height: 18px; }

        /* Cards: a hairline frame, nothing glowing. On hover a field of tiny
           beads (the halftone of the portrait, the beads of the abacus) fades
           in around the pointer and nowhere else. */
        .hover-card {
            position: relative; overflow: hidden;
            border: 1px solid var(--ctl-line); border-radius: var(--radius); background-color: var(--bg);
            transition: border-color var(--dur-slow) var(--ease-out), box-shadow var(--dur-slow) var(--ease-out);
        }
        .hover-card::after {
            content: ""; position: absolute; inset: 0; pointer-events: none;
            background-image: radial-gradient(circle, rgba(224,48,30,0.32) 1.1px, transparent 1.6px);
            background-size: 14px 14px; background-position: 7px 7px;
            -webkit-mask-image: radial-gradient(170px circle at var(--glow-x, 50%) var(--glow-y, 50%), #000 0%, rgba(0,0,0,0.35) 45%, transparent 75%);
                    mask-image: radial-gradient(170px circle at var(--glow-x, 50%) var(--glow-y, 50%), #000 0%, rgba(0,0,0,0.35) 45%, transparent 75%);
            opacity: 0; transition: opacity var(--dur-slow) var(--ease-out);
        }
        .hover-card:hover::after { opacity: 1; }
        .hover-card:hover { border-color: var(--ctl-line-hover);  }
        /* Featured cards carry a faint bead field fading in from the top-right
           corner at rest, instead of a coloured frame. */
        .case-card.featured::before, .pub-card.acm::before, .gallery-card.featured::before {
            content: ""; position: absolute; inset: 0; pointer-events: none;
            background-image: radial-gradient(circle, rgba(224,48,30,0.26) 1.1px, transparent 1.6px);
            background-size: 14px 14px; background-position: 7px 7px;
            -webkit-mask-image: radial-gradient(85% 70% at 100% 0%, #000 0%, rgba(0,0,0,0.25) 45%, transparent 70%);
                    mask-image: radial-gradient(85% 70% at 100% 0%, #000 0%, rgba(0,0,0,0.25) 45%, transparent 70%);
        }
        .case-card.featured > .card-content, .pub-card.acm > *, .gallery-card.featured > * { position: relative; z-index: 1; }

        /* Case Cards */
        .case-grid { display: grid; gap: 1.75rem; }
        .case-card { padding: 2rem; }

        .case-card .card-content { position: relative; z-index: 1; }
        .case-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.875rem; flex-wrap: wrap; }
        .case-tag {
            font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
            font-variation-settings: "MONO" 1, "CASL" 0; font-weight: 500;
            background: var(--bg-muted); padding: 0.2rem 0.5rem; border-radius: 4px; color: var(--text-secondary);
        }
        .case-card.featured .case-tag { background: rgba(224,48,30,0.12); color: var(--accent); }
        .case-card .gallery-screenshot { margin-bottom: 1.25rem; background: var(--paper); }
        .case-actions { margin-top: 0.875rem; }
        .case-title {
            font-size: 1.125rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.02em;
            font-variation-settings: "MONO" 0.6, "CASL" 0;
        }
        .case-title a { color: inherit; }
        .case-card.featured .case-title { color: var(--accent); }

        .case-body { display: grid; gap: 0.625rem; }
        .case-row { display: grid; grid-template-columns: 80px 1fr; gap: 0.75rem; font-size: 0.8125rem; opacity: 0; transform: translateX(-10px); transition: opacity var(--dur-enter) var(--ease-out), transform var(--dur-enter) var(--ease-out); }
        .case-card.in-view .case-row { opacity: 1; transform: translateX(0); }
        .case-card.in-view .case-row:nth-child(1) { transition-delay: calc(var(--stagger) * 0); }
        .case-card.in-view .case-row:nth-child(2) { transition-delay: calc(var(--stagger) * 1); }
        .case-card.in-view .case-row:nth-child(3) { transition-delay: calc(var(--stagger) * 2); }
        .case-row-label {
            font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase;
            letter-spacing: 0.04em; padding-top: 0.15rem;
            font-variation-settings: "MONO" 0.8, "CASL" 0; font-weight: 400;
        }
        .case-row-val { color: var(--text-secondary); line-height: 1.7; }
        .case-row-val strong { color: var(--text-primary); font-weight: 600; }

        .case-note {
            font-size: 0.75rem; color: var(--text-muted); line-height: 1.6;
            margin-top: 0.75rem; padding-left: 0.75rem;
            border-left: 2px solid var(--border-strong);
            font-variation-settings: "MONO" 0.6, "CASL" 0;
        }
        .case-stack { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 1rem; }
        .case-stack span {
            font-size: 0.75rem; color: var(--text-muted);
            font-variation-settings: "MONO" 1, "CASL" 0;
        }
        .case-stats {
            display: flex; gap: 1.25rem; margin-top: 1rem; padding-top: 0.75rem;
            border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--text-muted);
            font-variation-settings: "MONO" 1, "CASL" 0;
        }
        .case-card.featured .case-stats { border-color: rgba(224,48,30,0.12); }
        .case-stats strong { color: var(--text-primary); font-weight: 600; }
        .case-stats .stat-live { color: var(--accent); }

        /* Publications */
        .pub-list { display: grid; gap: 0.875rem; }
        .pub-card {
            padding: 1.5rem; position: relative;
            opacity: 0; transform: translateY(16px);
            transition: opacity var(--dur-enter) var(--ease-out), transform var(--dur-enter) var(--ease-out);
        }
        .pub-card.in-view { opacity: 1; transform: translateY(0); }
        .pub-card.in-view:nth-child(1) { transition-delay: calc(var(--stagger) * 0); }
        .pub-card.in-view:nth-child(2) { transition-delay: calc(var(--stagger) * 1); }
        .pub-card.in-view:nth-child(3) { transition-delay: calc(var(--stagger) * 2); }
        .pub-card > * { position: relative; z-index: 1; }
        .pub-badge {
            font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em;
            font-variation-settings: "MONO" 1, "CASL" 0;
            padding: 0.15rem 0.5rem; border-radius: 3px; margin-right: 0.5rem;
        }
        .pub-badge.acm { background: rgba(224,48,30,0.12); color: var(--accent); }
        .pub-badge.arxiv { background: var(--bg-muted); color: var(--text-muted); }
        .pub-title {
            font-size: 0.9375rem; font-weight: 600; margin: 0.625rem 0 0.25rem;
            font-variation-settings: "MONO" 0.6, "CASL" 0;
        }
        .pub-title a { color: inherit; }
        .pub-title a:hover { color: var(--accent); }
        .pub-meta {
            font-size: 0.75rem; color: var(--text-muted);
            font-variation-settings: "MONO" 0.8, "CASL" 0;
        }

        /* Timeline */
        .timeline { display: flex; flex-direction: column; gap: 2rem; }
        .timeline-item {
            display: grid; grid-template-columns: 120px 1fr; gap: 1.5rem;
            opacity: 0; transform: translateY(16px);
            transition: opacity var(--dur-enter) var(--ease-out), transform var(--dur-enter) var(--ease-out);
        }
        .timeline-item.in-view { opacity: 1; transform: translateY(0); }
        .timeline-item.in-view:nth-child(1) { transition-delay: calc(var(--stagger) * 0); }
        .timeline-item.in-view:nth-child(2) { transition-delay: calc(var(--stagger) * 1); }
        .timeline-item.in-view:nth-child(3) { transition-delay: calc(var(--stagger) * 2); }
        .timeline-item.in-view:nth-child(4) { transition-delay: calc(var(--stagger) * 3); }
        .timeline-item.in-view:nth-child(5) { transition-delay: calc(var(--stagger) * 4); }
        .timeline-period {
            font-size: 0.75rem; color: var(--text-muted); padding-top: 0.25rem;
            font-variation-settings: "MONO" 0.8, "CASL" 0; font-weight: 400;
        }
        .timeline-header { display: flex; align-items: flex-start; gap: 0.75rem; }
        .timeline-logo {
            width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0;
            border: 1px solid var(--border); object-fit: contain;
            background: #fff; margin-top: 0.125rem;
        }
        .timeline-content h3 { font-size: 0.9375rem; font-weight: 600; }
        .timeline-content .org {
            font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.125rem;
            font-variation-settings: "MONO" 0.4, "CASL" 0;
        }
        .timeline-content .impact {
            display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.5rem;
            font-size: 0.75rem; color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase;
            font-variation-settings: "MONO" 1, "CASL" 0;
        }


        /* About */
        .about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
        .about-card { padding: 1.5rem; }
        .about-head { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 1rem; }
        .about-icon {
            width: 2rem; height: 2rem; border-radius: 8px; flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
            background: var(--paper); color: var(--ink);
            border: 1px solid var(--ctl-line);
        }
        .about-icon .ab { width: 20px; height: 20px; }
        .about-card:hover .ab .bead-acc { transform: translateX(2.4px) scale(1.1); }
        .about-card:hover .ab .bead-ink { transform: translateX(1.6px); }
        .about-head h4 {
            font-size: 0.75rem; font-weight: 500; color: var(--text-muted);
            text-transform: uppercase; letter-spacing: 0.08em;
            font-variation-settings: "MONO" 0.8, "CASL" 0;
        }
        .about-count {
            margin-left: auto; font-size: 0.75rem; font-weight: 700;
            color: var(--accent); font-variation-settings: "MONO" 1, "CASL" 0;
            background: var(--bg-muted); border: 1px solid var(--border);
            padding: 0.1rem 0.5rem; border-radius: 999px; line-height: 1.4;
        }
        .about-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
        .about-list li {
            font-size: 0.8125rem; color: var(--text-secondary);
            display: flex; gap: 0.625rem; line-height: 1.5;
        }
        .about-list li::before {
            content: ""; width: 7px; height: 7px; border-radius: 50%;
            background-color: var(--mark); outline: 1px solid rgba(224,48,30,0.45); outline-offset: -1px;
            margin-top: 0.42em; flex-shrink: 0;
        }
        .about-list li.hl { color: var(--accent); font-weight: 500; }
        .about-list li.hl::before { background-color: var(--rust);  }

        .site-footer { padding: 0 0 1.75rem; border-top: 1px solid var(--border); background: linear-gradient(var(--paper), var(--bg) 70%); }
        /* The big footer: five stations on one abacus rod, from counting to
           orchestrating agents. A single rust bead rests on the present and
           slides to whichever station is hovered or focused. */
        .footer-journey { padding-top: 4rem; padding-bottom: 3rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
        .jr-title { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; color: var(--ink); margin: 0.25rem 0 2.5rem; }
        .jr-track { position: relative; --jr-x: 90%; }
        .jr-rail {
            position: absolute; left: 0; right: 0; top: 74px; height: 1px;
            background: linear-gradient(90deg, transparent, var(--border-strong) 6%, var(--border-strong) 94%, transparent);
        }
        .jr-bead {
            position: absolute; top: 68px; left: 0; width: 13px; height: 13px; border-radius: 50%; z-index: 1;
            background: var(--rust); outline: 4px solid var(--paper); outline-offset: 0;
            transform: translateX(calc(var(--jr-x) - 6.5px)); transition: transform 0.7s var(--ease-spring);
        }
        .jr-stops { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; position: relative; }
        .jr-stop { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; cursor: default; outline: none; }
        .jr-icon {
            width: 54px; height: 54px; padding: 8px; margin-bottom: 2.25rem; color: var(--text-muted);
            background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
            transition: color var(--dur-slow) var(--ease-out), border-color var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out), box-shadow var(--dur-slow) var(--ease-out);
        }
        .jr-verb { font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
        .jr-sub { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.4; }
        .jr-skills { font-size: 0.75rem; color: var(--text-muted); line-height: 1.55; margin-top: 0.375rem; font-variation-settings: "MONO" 0.8, "CASL" 0; }
        .jr-stop.is-on .jr-icon { color: var(--ink); border-color: var(--border-strong); transform: translateY(-3px);  }
        .jr-stop.is-on .jr-skills { color: var(--text-secondary); }
        .jr-stop:focus-visible .jr-icon { outline: 2px solid var(--blue); outline-offset: 3px; }
        @media (max-width: 760px) {
            .jr-title { font-size: 1.5rem; margin-bottom: 1.75rem; }
            .jr-stops { grid-template-columns: 1fr; gap: 1.25rem; }
            .jr-stop { display: grid; grid-template-columns: 54px 1fr; column-gap: 1rem; row-gap: 0.15rem; }
            .jr-icon { grid-row: 1 / span 3; margin: 0; }
            .jr-rail { left: 27px; right: auto; top: 0; bottom: 0; width: 1px; height: auto;
                background: linear-gradient(180deg, transparent, var(--border-strong) 6%, var(--border-strong) 94%, transparent); }
            .jr-bead { display: none; }
        }

        /* Motion for the abacus icons: a bead being counted. Groups glide in with a
           short stagger; on hover the rust bead slides along its rail and the ink
           beads follow one after another. The active stop's bead drifts gently. */
        .ab circle { transform-box: fill-box; transform-origin: center; transition: transform 0.7s var(--ease-out), fill var(--dur-base) var(--ease-move); }
        .ab circle.bead-ink { transition-delay: calc(60ms + var(--k, 0) * 50ms); }
        .bio-tag:hover .ab .bead-acc, .bio-tag.is-flipped .ab .bead-acc,
        .jr-stop.is-on .ab .bead-acc { transform: translateX(2.4px) scale(1.1); }
        .bio-tag:hover .ab .bead-ink, .jr-stop.is-on .ab .bead-ink { transform: translateX(1.6px); }
        .jr-stop.is-on .ab .bead-acc { animation: bead-drift 2.8s ease-in-out 0.8s infinite; }
        @keyframes bead-drift { 0%, 100% { transform: translateX(2.4px) scale(1.1); } 50% { transform: translateX(-0.6px) scale(1.1); } }

        .js .pop-group > * { opacity: 0; transform: translateY(10px); filter: blur(4px); }
        .pop-group.is-popped > * {
            opacity: 1; transform: none; filter: none;
            transition: opacity 0.6s var(--ease-out), transform 0.8s var(--ease-out), filter 0.6s var(--ease-out);
        }
        .pop-group.is-popped > *:nth-child(1) { transition-delay: 0ms; }
        .pop-group.is-popped > *:nth-child(2) { transition-delay: 60ms; }
        .pop-group.is-popped > *:nth-child(3) { transition-delay: 120ms; }
        .pop-group.is-popped > *:nth-child(4) { transition-delay: 180ms; }
        .pop-group.is-popped > *:nth-child(5) { transition-delay: 240ms; }
        .pop-group.is-popped > *:nth-child(6) { transition-delay: 300ms; }
        .pop-group.is-popped > *:nth-child(7) { transition-delay: 360ms; }
        .pop-group.is-popped > *:nth-child(8) { transition-delay: 420ms; }
        .pop-group.is-popped > *:nth-child(9) { transition-delay: 480ms; }
        .jr-stops.is-popped .jr-icon { animation: icon-pop 0.7s var(--ease-spring) both; }
        .jr-stops.is-popped .jr-stop:nth-child(2) .jr-icon { animation-delay: 80ms; }
        .jr-stops.is-popped .jr-stop:nth-child(3) .jr-icon { animation-delay: 160ms; }
        .jr-stops.is-popped .jr-stop:nth-child(4) .jr-icon { animation-delay: 240ms; }
        .jr-stops.is-popped .jr-stop:nth-child(5) .jr-icon { animation-delay: 320ms; }
        @keyframes icon-pop { 0% { transform: translateY(6px); opacity: 0; } 100% { transform: none; opacity: 1; } }
        .jr-stop .jr-icon:hover { transform: translateY(-3px); }
        @media (prefers-reduced-motion: reduce) {
            .pop-group > * { opacity: 1 !important; transform: none !important; filter: none !important; }
            .ab circle, .jr-stops.is-popped .jr-icon { animation: none !important; transition: none !important; transform: none !important; }
        }

        /* The last thing on the page: the name at full width, set on an abacus
           rod. The full stop is a bead. Beads in the brand's red tones sit on
           the rod along the baseline and slide out of the pointer's way. */
        .site-footer { padding-bottom: 0; }
        .footer-wordmark {
            position: relative; margin-top: 2.5rem; overflow: hidden; user-select: none;
            background: linear-gradient(180deg, #fff 0%, var(--paper) 100%); border-top: 1px solid rgba(224,48,30,0.1);
            padding: 3.5vw 3vw 3vw;
        }
        /* a minimal wooden abacus: two beech dowels standing on the paper, two
           rods between them, matte beads you can grab and slide, the name above */
        .wm-frame { position: relative; padding: 1.5vw 7vw 2.5vw; }
        .wm-post {
            position: absolute; z-index: 2; top: 0; bottom: 0; width: 4.6vw; min-width: 16px; border-radius: 999px;
            background: linear-gradient(90deg, #b48a5c 0%, #d8bb94 24%, #f1e3cc 48%, #dcc29e 70%, #ad8455 100%);
            
        }
        .wm-post::after {   /* end grain catching the light */
            content: ""; position: absolute; left: 12%; right: 12%; top: 0.5vw; height: 1.2vw; border-radius: 50%;
            background: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,0.55), rgba(255,255,255,0) 70%);
        }
        .wm-post-l { left: 0; } .wm-post-r { right: 0; }
        .wm-word {
            position: relative; font-family: "Geist Pixel Circle", var(--font-mono); font-weight: 400;
            font-size: clamp(4.5rem, 22vw, 24rem); line-height: 0.8;
            letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; margin-bottom: 1.5vw;
        }
        .footer-wordmark .wm-dot {
            display: inline-block; width: 0.17em; height: 0.17em; margin-left: 0.04em; border-radius: 50%; vertical-align: baseline;
            background: radial-gradient(circle at 34% 30%, #ff9d8f 0%, #e0301e 42%, #a81a0b 100%);
            
            transition: transform 0.6s var(--ease-spring);
        }
        .footer-wordmark:hover .wm-dot { transform: translateY(-0.12em); }
        .wm-rod { position: relative; z-index: 3; height: 7.4vw; min-height: 26px; margin: 0 -2.4vw; pointer-events: none; }
        .wm-rod + .wm-rod { margin-top: 0.6vw; }
        .wm-line {
            position: absolute; left: -2.5vw; right: -2.5vw; top: 50%; height: 0.9vw; min-height: 5px; transform: translateY(-50%); border-radius: 999px;
            z-index: -1; background: linear-gradient(180deg, #e9d8bd 0%, #f4eadb 35%, #d2b48d 75%, #b8946a 100%);
            
        }
        .wm-bead {
            position: absolute; top: 50%; left: var(--x); width: 7.2vw; height: 7.2vw; min-width: 24px; min-height: 24px;
            border-radius: 50%; transform: translate(-50%, -50%);
            background: radial-gradient(circle at 34% 28%, var(--b1) 0%, var(--b2) 38%, var(--b3) 100%);
            
            transition: transform 0.9s var(--ease-spring);
            pointer-events: auto; cursor: grab; touch-action: none;
        }
        .wm-bead.t-white { --b1: #ffffff; --b2: #f4f1ee; --b3: #d9d3cd; }
        .wm-bead.t-red { --b1: #ff8f80; --b2: #e0301e; --b3: #9e1a0c; }
        .wm-bead.is-grabbed { cursor: grabbing;  }
        .footer-wordmark.wm-live .wm-bead { left: 0; transition: none; animation: none !important; opacity: 1; will-change: transform; }
        .js .footer-wordmark .wm-bead { opacity: 0; }
        .footer-wordmark.is-popped .wm-bead { opacity: 1; animation: wm-drop 0.9s var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 90ms); }
        @keyframes wm-drop { from { opacity: 0; transform: translate(-50%, -170%); } to { opacity: 1; transform: translate(-50%, -50%); } }
        @media (prefers-reduced-motion: reduce) {
            .wm-bead, .wm-dot { transition: none; }
            .js .footer-wordmark .wm-bead { opacity: 1; animation: none; }
        }

        /* ---- footer bar ---------------------------------------------------- */
        .footer-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
        .footer-brand .footer-role {
            font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.02em;
            color: var(--text-muted); padding-left: 0.625rem; margin-left: 0.125rem;
            border-left: 1px solid var(--ctl-line);
        }
        .footer-social { display: flex; gap: 0.375rem; }
        .footer-social-link {
            display: inline-flex; align-items: center; justify-content: center;
            width: var(--ctl-h-sm); height: var(--ctl-h-sm); border-radius: var(--ctl-radius);
            border: 1px solid var(--ctl-line); background: var(--bg); color: var(--text-secondary);
            transition: border-color var(--ctl-ease), color var(--ctl-ease), background var(--ctl-ease), transform 120ms var(--ease-move);
        }
        .footer-social-link:hover { border-color: var(--ctl-line-hover); color: var(--ink); background: var(--ctl-tint); }
        .footer-social-link:active { transform: scale(0.96); }
        .footer-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
        .footer-nav a { font-size: 0.8125rem; color: var(--text-secondary); text-decoration: none; }
        .footer-meta {
            display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
            padding-top: 1rem; border-top: 1px solid var(--ctl-line);
            font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.01em;
        }
        .footer-meta-end { margin-left: auto; display: inline-flex; align-items: center; gap: 0.875rem; }
        .to-top { color: var(--text-secondary); text-decoration: none; }
        @media (max-width: 640px) {
            .footer-meta { justify-content: center; text-align: center; }
            .footer-meta-end { margin-left: 0; width: 100%; justify-content: center; }
        }
        .to-top span { display: inline-block; transition: transform 0.5s var(--ease-spring); }
        .to-top:hover { color: var(--ink); text-decoration: none; }
        .to-top:hover span { transform: translateY(-3px); }

        /* ---- one bead for every dot ----------------------------------------
           Bullets, status dots, the switch, link markers and the name all use
           the same minimal bead: a round body, a pinpoint highlight top-left
           and a soft shade bottom-right. Each sets only its colour. */
        .about-list li::before, .rec-knob, .rc-status i, .live-bead, .tz-dot,
        .name-bead, .footer-nav a::before, .nav-sheet a::before, .story-count i, .wm-dot {
            background-image: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.8) 0 14%, rgba(255,255,255,0) 22%);
        }
        .rec-knob, .tz-dot, .live-bead {  }

        /* ---- the bead after the name --------------------------------------- */
        .name-bead {
            display: inline-block; width: 0.36em; height: 0.36em; margin-left: 0.12em;
            border-radius: 50%; background-color: var(--rust); vertical-align: baseline;
            
        }
        .brand:hover .name-bead { animation: bead-hop 0.9s var(--ease-out); }
        @keyframes bead-hop {
            0%   { transform: translateY(0); }
            45%  { transform: translateY(-0.32em); }
            100% { transform: translateY(0); }
        }

        /* ---- bead hover for text links: a red bead rolls in ahead of the word */
        .footer-nav a, .nav-sheet a { position: relative; transition: padding var(--dur-slow) var(--ease-out), color var(--ctl-ease); }
        .footer-nav a::before, .nav-sheet a::before {
            content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px;
            border-radius: 50%; background-color: var(--rust); transform: scale(0) translateX(-6px);
            transition: transform 0.55s var(--ease-spring);
        }
        .footer-nav a:hover, .nav-sheet a:hover { padding-left: 13px; color: var(--ink); text-decoration: none; }
        .footer-nav a:hover::before, .nav-sheet a:hover::before { transform: scale(1) translateX(0); }

        /* ---- CV: the arrow drops into its tray --------------------------------- */
        a[href$="vahid-faraji-cv.pdf"] svg { transition: transform 0.6s var(--ease-out); }
        a[href$="vahid-faraji-cv.pdf"]:hover svg { animation: cv-drop 0.9s var(--ease-out) 1; transform: translateY(1px); }
        @keyframes cv-drop {
            0%   { transform: translateY(-3px); opacity: 0; }
            35%  { transform: translateY(0); opacity: 1; }
            70%  { transform: translateY(1.5px); opacity: 1; }
            100% { transform: translateY(3px); opacity: 0; }
        }

        /* ---- Book a call: a live bead switches on ------------------------------ */
        .live-bead {
            display: inline-block; width: 0; height: 7px; margin-right: 0; border-radius: 50%;
            background-color: var(--rust); opacity: 0;
            transition: width var(--dur-slow) var(--ease-spring), margin var(--dur-slow) var(--ease-spring), opacity var(--ctl-ease);
        }
        .nav-btn-solid:hover .live-bead {
            width: 7px; margin-right: 0.45rem; opacity: 1;
            animation: live-ring 1.4s var(--ease-move) 0.3s infinite;
        }
        @keyframes live-ring {
            0%   {  }
            100% { outline: 7px solid rgba(224,48,30,0); outline-offset: 0; }
        }

        /* ---- labels and data in mono ------------------------------------------ */
        .section-label, .case-tag, .case-stack,
        .metric-label, .jr-skills, .hero-art figcaption, .gallery-screenshot-count, .about-count,
        .case-row-label, .facet-note { font-family: var(--font-mono); }

        @media (prefers-reduced-motion: reduce) {
            .brand:hover .name-bead, a[href$="vahid-faraji-cv.pdf"]:hover svg,
            .nav-btn-solid:hover .live-bead { animation: none; }
        }

        /* CV viewer: every CV link opens the pages first, full screen, with the
           download one click away. Page images are rendered from the PDF on each
           deploy, so the preview works on phones where embedded PDFs do not. */
        .cv-viewer {
            width: min(940px, calc(100vw - 32px)); height: calc(100vh - 48px); max-height: none; max-width: none;
            margin: auto; inset: 0; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: var(--bg);
            
        }
        .cv-viewer[open] { display: flex; flex-direction: column; animation: cvv-in 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
        .cv-viewer::backdrop { background: rgba(28,28,30,0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
        @keyframes cvv-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
        .cvv-bar {
            display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
            padding: 0.75rem 0.875rem 0.75rem 1.25rem; border-bottom: 1px solid var(--ctl-line); background: var(--bg);
        }
        .cvv-id { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
        .cvv-title { font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
        .cvv-title .name-bead { margin-right: 0.3em; }
        .cvv-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
        .cvv-actions { display: flex; align-items: center; gap: 0.5rem; }
        .cvv-close {
            width: var(--ctl-h-sm); height: var(--ctl-h-sm); border-radius: var(--ctl-radius); cursor: pointer;
            border: 1px solid var(--ctl-line); background: var(--bg); color: var(--ink); font-size: 1.25rem; line-height: 1;
        }
        .cvv-close:hover { border-color: var(--ctl-line-hover); background: var(--ctl-tint); }
        .cvv-pages {
            flex: 1; overflow: auto; padding: 1.5rem; background: #f3f2ef;
            display: flex; flex-direction: column; align-items: center; gap: 1.25rem; overscroll-behavior: contain;
        }
        .cvv-pages img {
            width: 100%; max-width: 760px; height: auto; background: #fff; border-radius: 4px;
            
        }
        html.cvv-lock { overflow: hidden; }
        @media (max-width: 640px) {
            .cv-viewer { width: 100vw; height: 100dvh; border-radius: 0; }
            .cvv-bar { padding: 0.625rem 0.75rem; }
            .cvv-meta { display: none; }
            .cvv-pages { padding: 0.75rem; gap: 0.75rem; }
        }
        @media (prefers-reduced-motion: reduce) { .cv-viewer[open] { animation: none; } }

        /* ---- the reel: watch the animated CV -------------------------------- */
        .reel {
            display: flex; align-items: center; gap: 0.875rem; width: 100%; max-width: 36rem; min-height: 80px; box-sizing: border-box; margin-top: 0.625rem;
            padding: 0.5rem 0.75rem 0.5rem 0.5rem; border-radius: 14px; cursor: pointer; text-align: left;
            border: 1px solid var(--ctl-line); background: var(--bg); color: var(--ink); font: inherit;
            transition: border-color var(--ctl-ease), box-shadow var(--dur-slow) var(--ease-out);
        }
        .reel:hover { border-color: var(--ctl-line-hover);  }
        .reel:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
        .reel-thumb { position: relative; flex: none; width: 112px; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; border: 1px solid var(--ctl-line); }
        .reel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease-out); }
        .reel:hover .reel-thumb img { transform: scale(1.06); }
        .reel-play {
            position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center; color: #fff; background-color: var(--rust);
            background-image: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.55) 0 14%, rgba(255,255,255,0) 24%);
             animation: live-ring 1.8s var(--ease-move) infinite;
        }
        .reel-play svg { width: 12px; height: 12px; margin-left: 2px; }
        .reel-time {
            position: absolute; right: 4px; bottom: 4px; padding: 0 0.3rem; border-radius: 4px;
            font-family: var(--font-mono); font-size: 0.75rem; color: #fff; background: rgba(28,28,30,0.72);
        }
        /* the storyboard: moving across the card scrubs the film, portrait first */
        .reel-story {
            position: absolute; inset: 0; opacity: 0; pointer-events: none;
            background: url(../video/vahid-cv-story.jpg?v=40) 0 0 / 900% 100% no-repeat;
            transition: opacity 0.25s var(--ease-out);
        }
        .reel.is-scrub .reel-story { opacity: 1; }
        .reel.is-scrub .reel-play { opacity: 0; transform: scale(0.6); }
        .reel-play { transition: opacity 0.25s, transform 0.4s var(--ease-spring); }
        .reel-ticks { position: absolute; left: 6px; right: 6px; bottom: 3px; display: flex; gap: 2px; opacity: 0; transition: opacity 0.25s; }
        .reel-ticks i { flex: 1; height: 2px; border-radius: 2px; background: rgba(255,255,255,0.55); }
        .reel-ticks i.on { background: var(--rust); }
        .reel.is-scrub .reel-ticks { opacity: 1; }
        .reel.is-scrub .reel-time { opacity: 0; }

        /* ---- the player: pops out of the card, an abacus for a timeline ---- */
        .reel-viewer {
            width: min(1080px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px);
            margin: auto; inset: 0; padding: 0; border: 0; border-radius: 18px; overflow: hidden;
            background: var(--bg); color: var(--ink); 
        }
        .reel-viewer[open] { display: flex; flex-direction: column; animation: rp-pop 0.62s cubic-bezier(0.22, 1, 0.36, 1) both; }
        .reel-viewer.is-closing { animation: rp-pop 0.34s cubic-bezier(0.5, 0, 0.75, 0) reverse both; }
        .reel-viewer::backdrop { background: rgba(28,28,30,0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
        @keyframes rp-pop {
            from { opacity: 0; transform: translate(var(--rp-dx, 0), var(--rp-dy, 24px)) scale(var(--rp-s, 0.9)); border-radius: 40px; }
            40% { opacity: 1; }
            to { opacity: 1; transform: none; border-radius: 18px; }
        }
        .rp-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0.875rem 0.75rem 1.25rem; }
        .rp-chapter { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); display: inline-flex; gap: 0.4rem; }
        .rp-chapter b { color: var(--rust); font-weight: 600; }
        .rp-chapter.flip { animation: rp-chap 0.5s var(--ease-out); }
        @keyframes rp-chap { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
        .reel-stage { position: relative; background: #0f0f10; margin: 0 0.75rem; border-radius: 12px; overflow: hidden; }
        .reel-stage video { width: 100%; height: auto; max-height: calc(100dvh - 210px); display: block; background: #0f0f10; cursor: pointer; }
        .rp-big {
            position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; border: 0; cursor: pointer;
            display: flex; align-items: center; justify-content: center; color: #fff; background-color: var(--rust);
            background-image: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.55) 0 14%, rgba(255,255,255,0) 24%);
             animation: live-ring 1.8s var(--ease-move) infinite;
            transition: opacity 0.3s, transform 0.45s var(--ease-spring);
        }
        .rp-big svg { width: 26px; height: 26px; margin-left: 4px; }
        .reel-viewer.is-playing .rp-big { opacity: 0; transform: scale(0.5); pointer-events: none; }
        .rp-deck { padding: 0.875rem 1.25rem 1rem; }
        .rp-rail { position: relative; height: 26px; cursor: pointer; touch-action: none; outline: none; }
        .rp-rod, .rp-fill { position: absolute; left: 0; top: 12px; height: 2px; border-radius: 2px; }
        .rp-rod { right: 0; background: rgba(28,28,30,0.16); }
        .rp-fill { width: 0; background: var(--ink); }
        .rp-marks { position: absolute; inset: 0; }
        .rp-mark {
            position: absolute; top: 7px; width: 12px; height: 12px; margin-left: -6px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
            background-color: var(--mark); 
            background-image: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.8) 0 14%, rgba(255,255,255,0) 22%);
            transition: transform 0.4s var(--ease-spring), background-color 0.3s;
        }
        .rp-mark.done { background-color: var(--ink); }
        .rp-mark.now { background-color: var(--rust); transform: scale(1.25); }
        .rp-mark:hover { transform: scale(1.4); }
        .rp-mark span {
            position: absolute; bottom: 18px; left: 50%; transform: translate(-50%, 4px); white-space: nowrap; pointer-events: none;
            font-family: var(--font-mono); font-size: 0.75rem; color: #fff; background: var(--ink); padding: 0.2rem 0.45rem; border-radius: 5px;
            opacity: 0; transition: opacity 0.2s, transform 0.3s var(--ease-out);
        }
        .rp-mark:hover span, .rp-mark:focus-visible span { opacity: 1; transform: translate(-50%, 0); }
        .rp-head-bead {
            position: absolute; top: 5px; left: 0; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; pointer-events: none;
            background-color: var(--rust); outline: 3px solid var(--bg); outline-offset: 0;
            background-image: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.75) 0 14%, rgba(255,255,255,0) 22%);
        }
        .rp-rail:focus-visible .rp-head-bead { outline: 3px solid var(--bg); outline-offset: 0; }
        .rp-controls { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; flex-wrap: wrap; }
        .rp-play, .rp-mute {
            width: var(--ctl-h); height: var(--ctl-h); border-radius: 50%; border: 1px solid var(--ctl-line); cursor: pointer;
            display: inline-flex; align-items: center; justify-content: center; background: var(--bg); color: var(--ink);
            transition: border-color var(--ctl-ease), background var(--ctl-ease), transform 0.3s var(--ease-spring);
        }
        .rp-play { background: var(--ink); color: #fff; border-color: var(--ink); }
        .rp-play:active, .rp-mute:active { transform: scale(0.92); }
        .rp-play svg { width: 15px; height: 15px; }
        .rp-play .i-play { margin-left: 2px; }
        .rp-play .i-pause, .reel-viewer.is-playing .rp-play .i-play { display: none; }
        .reel-viewer.is-playing .rp-play .i-pause { display: block; }
        .rp-mute svg { width: 17px; height: 17px; }
        .rp-mute .x, .rp-mute[aria-pressed="true"] .w1, .rp-mute[aria-pressed="true"] .w2 { display: none; }
        .rp-mute[aria-pressed="true"] .x { display: inline; }
        .rp-mute:hover { border-color: var(--ctl-line-hover); }
        .rp-time { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink); min-width: 6.5em; }
        .rp-time i { font-style: normal; color: var(--text-muted); }
        .rp-speed { display: inline-flex; margin-left: auto; padding: 3px; gap: 2px; border: 1px solid var(--ctl-line); border-radius: 999px; }
        .rp-speed button {
            height: 28px; padding: 0 0.6rem; border: 0; border-radius: 999px; cursor: pointer; background: transparent;
            font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary);
            transition: background 0.25s, color 0.25s;
        }
        .rp-speed button:hover { color: var(--ink); background: var(--ctl-tint); }
        .rp-speed button[aria-pressed="true"] { background: var(--rust); color: #fff; }
        @media (max-width: 640px) {
            .reel-viewer { width: 100vw; max-height: 100dvh; border-radius: 0; }
            .rp-head { padding: 0.625rem 0.75rem; }
            .reel-stage { margin: 0; border-radius: 0; }
            .rp-deck { padding: 0.75rem; }
            .rp-speed { margin-left: 0; order: 3; width: 100%; justify-content: space-between; }
            .rp-mute { margin-left: auto; }
            .rp-mark span { display: none; }
        }
        @media (prefers-reduced-motion: reduce) { .reel-viewer[open], .reel-viewer.is-closing { animation: none; } .rp-big { animation: none; } }

        /* ---- sound switch (off by default) ----------------------------------- */
        .sound-toggle {
            display: inline-flex; align-items: center; gap: 0.4rem; height: 24px; padding: 0 0.5rem; cursor: pointer;
            border: 1px solid var(--ctl-line); border-radius: 6px; background: var(--bg);
            font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary);
        }
        .sound-toggle .rec-track { transform: scale(0.8); transform-origin: left center; margin-right: -4px; }
        .sound-toggle[aria-pressed="true"] { color: var(--rust-deep); border-color: rgba(224,48,30,0.35); }
        .sound-toggle[aria-pressed="true"] .rec-knob { transform: translateX(18px); background-color: var(--rust); }
        .sound-toggle[aria-pressed="true"] .rec-track::before { background: rgba(224,48,30,0.35); }
        @media (max-width: 640px) {
            .reel-thumb { width: 104px; }
        }
        @media (prefers-reduced-motion: reduce) { .reel-play { animation: none; } }
        @media (prefers-reduced-motion: reduce) { .jr-bead { transition: none; } .jr-stop.is-on .jr-icon { transform: none; } }
        .footer-inner { display: flex; flex-direction: column; gap: 1.25rem; }
        .footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
        .footer-nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
        .footer-nav a {
            font-size: 0.75rem; color: var(--text-muted);
            font-variation-settings: "MONO" 0.6, "CASL" 0; font-weight: 420;
            transition: color var(--transition); text-decoration: none;
        }
        .footer-nav a:hover { color: var(--accent); }

        .footer-meta {
            display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
            padding-top: 1rem; border-top: 1px solid var(--border);
            font-size: 0.75rem; color: var(--text-muted);
            font-variation-settings: "MONO" 1, "CASL" 0; letter-spacing: 0.03em;
        }
        .footer-meta-sep { color: var(--border-strong); }
        /* A personal mark, in the same beads the site icon is built from. It sits
           at the muted weight and settles into the new ground on a theme change
           rather than snapping, which is why it carries the long duration. */
        .footer-sign {
            margin-left: auto; display: inline-flex; align-items: center;
            color: var(--text-muted); opacity: 0.62;
            transition: color var(--dur-enter) var(--ease-out),
                        opacity var(--dur-enter) var(--ease-out);
        }
        /* A grey mark loses weight against the dark ground, so it is given back. */
        .footer-sign:hover { color: var(--accent); opacity: 1; }
        .footer-sign svg { width: 21px; height: 28px; display: block; overflow: visible; }

        /* The tail flexes on hover, the same gesture the abacus beads make. */
        .footer-sign circle {
            transform-box: view-box;
            transition: transform var(--dur-slow) var(--ease-spring);
        }
        .footer-sign:hover .t1 { transform: translate(1.1px, -0.5px); }
        .footer-sign:hover .t2 { transform: translate(1.9px, -0.9px); }
        .footer-sign:hover .t3 { transform: translate(1.4px, -2.1px); }
        .footer-sign .t2 { transition-delay: 45ms; }
        .footer-sign .t3 { transition-delay: 90ms; }

        @media (max-width: 640px) { .footer-sign { margin-left: 0; } }
        @media (prefers-reduced-motion: reduce) {
            .footer-sign circle { transition: none; }
            .footer-sign:hover .t1,
            .footer-sign:hover .t2,
            .footer-sign:hover .t3 { transform: none; }
        }
        .gallery-card {
            padding: 2rem; display: grid; grid-template-columns: 340px 1fr; gap: 2rem; align-items: start;
            opacity: 0; transform: translateY(16px);
            transition: opacity var(--dur-enter) var(--ease-out), transform var(--dur-enter) var(--ease-out), border-color var(--dur-slow), box-shadow var(--dur-slow);
        }
        .gallery-card.in-view { opacity: 1; transform: translateY(0); }
        .gallery-card.in-view:nth-child(1) { transition-delay: calc(var(--stagger) * 0); }
        .gallery-card.in-view:nth-child(2) { transition-delay: calc(var(--stagger) * 1); }
        .gallery-card.in-view:nth-child(3) { transition-delay: calc(var(--stagger) * 2); }
        .gallery-card.in-view:nth-child(4) { transition-delay: calc(var(--stagger) * 3); }
        .gallery-screenshot { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); transition: border-color var(--transition); cursor: pointer; position: relative; }
        .gallery-screenshot img { width: 100%; height: auto; display: block; }
        .gallery-card:hover .gallery-screenshot { border-color: var(--accent); }
        .gallery-screenshot-count {
            position: absolute; top: 0.625rem; right: 0.625rem;
            background: rgba(255,255,255,0.92); color: var(--ink); font-size: 0.75rem; font-weight: 500;
            padding: 0.2rem 0.45rem; border-radius: 6px; border: 1px solid var(--ctl-line);
            backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none;
        }
        .gallery-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
        .gallery-actions a {
            display: inline-flex; align-items: center; height: var(--ctl-h-sm); padding: 0 0.75rem;
            border-radius: var(--ctl-radius); font-size: 0.75rem; font-weight: 600; letter-spacing: -0.005em;
            text-decoration: none; border: 1px solid var(--ctl-line); background: var(--bg); color: var(--ink);
            transition: background var(--ctl-ease), border-color var(--ctl-ease), box-shadow var(--ctl-ease), transform 120ms var(--ease-move);
        }
        .gallery-actions a:hover { text-decoration: none; border-color: var(--ctl-line-hover); background: var(--ctl-tint); }
        .gallery-actions a:active { transform: scale(0.98); }
        .gallery-actions .ga-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
        .gallery-actions .ga-primary:hover { background: #000; border-color: #000;  }

        /* Lightbox */
        .lightbox-overlay {
            position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.88);
            display: none; align-items: center; justify-content: center; padding: 2rem;
        }
        .lightbox-overlay.open { display: flex; }
        .lightbox-inner { position: relative; max-width: 900px; width: 100%; }
        .lightbox-img { width: 100%; height: auto; border-radius: 8px; display: block; }
        .lightbox-close {
            position: absolute; top: -2rem; right: 0; background: none; border: none;
            color: #fff; font-size: 1.5rem; cursor: pointer; opacity: 0.7; transition: opacity var(--transition);
        }
        .lightbox-close:hover { opacity: 1; }
        .lightbox-nav {
            position: absolute; top: 50%; transform: translateY(-50%);
            background: rgba(255,255,255,0.15); border: none; color: #fff;
            width: 2.5rem; height: 2.5rem; border-radius: 50%; cursor: pointer;
            font-size: 1.25rem; display: flex; align-items: center; justify-content: center;
            transition: background var(--transition);
        }
        .lightbox-nav:hover { background: rgba(255,255,255,0.3); }
        .lightbox-prev { left: -3.5rem; }
        .lightbox-next { right: -3.5rem; }
        .lightbox-counter {
            text-align: center; color: rgba(255,255,255,0.6); font-size: 0.75rem;
            margin-top: 0.75rem; font-variation-settings: "MONO" 1;
        }
        @media (max-width: 1024px) {
            .lightbox-prev { left: 0.5rem; }
            .lightbox-next { right: 0.5rem; }
            .lightbox-nav { background: rgba(0,0,0,0.5); }
        }

        /* Time strip */
        .time-strip {
            display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
            margin-top: 1.5rem; padding: 0.75rem 1rem; border-radius: var(--radius);
            background: var(--bg-subtle); border: 1px solid var(--border);
            font-size: 0.75rem; color: var(--text-muted);
            font-variation-settings: "MONO" 0.8, "CASL" 0; font-weight: 400;
        }
        .time-strip .time-dot {
            width: 6px; height: 6px; border-radius: 50%;
        }
        .time-dot.online { background: #22c55e; animation: pulse-dot 2s ease-in-out infinite; }
        .time-dot.away { background: var(--grey-400); }

        .reveal {
            opacity: 0; transform: translateY(18px);
            transition: opacity var(--dur-enter) var(--ease-out), transform var(--dur-enter) var(--ease-out);
        }
        .reveal.visible { opacity: 1; transform: translateY(0); }

        /* Booking modal */
        .booking-overlay {
            position: fixed; inset: 0; z-index: 1000;
            background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
            display: flex; align-items: center; justify-content: center;
            opacity: 0; pointer-events: none; transition: opacity var(--transition);
        }
        .booking-overlay.open { opacity: 1; pointer-events: auto; }
        .booking-box {
            background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
            padding: 2rem; width: 90%; max-width: 420px; position: relative;
            transform: translateY(12px); transition: transform var(--transition);
        }
        .booking-overlay.open .booking-box { transform: translateY(0); }
        .booking-close {
            position: absolute; top: 0.75rem; right: 0.75rem;
            background: none; border: none; color: var(--text-muted); cursor: pointer;
            font-size: 1.25rem; line-height: 1; padding: 0.25rem;
        }
        .booking-close:hover { color: var(--accent); }
        .booking-box h3 {
            font-size: 1.125rem; margin-bottom: 0.25rem;
            font-variation-settings: "MONO" 0.4, "CASL" 0;
        }
        .booking-sub {
            font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1.25rem;
        }
        .booking-tz {
            display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 0.75rem;
            background: var(--bg-subtle); border-radius: 6px; margin-bottom: 1rem;
            font-size: 0.75rem; color: var(--text-secondary);
            font-variation-settings: "MONO" 1;
        }
        .booking-tz .tz-dot { width: 8px; height: 8px; border-radius: 50%; background-color: var(--rust); flex-shrink: 0; }
        .booking-form { display: flex; flex-direction: column; gap: 0.75rem; }
        .booking-form label {
            font-size: 0.75rem; font-weight: 600; color: var(--text-secondary);
            font-variation-settings: "MONO" 1, "CASL" 0; letter-spacing: 0.03em;
            text-transform: uppercase;
        }
        .booking-form input, .booking-form select, .booking-form textarea {
            width: 100%; padding: 0.5rem 0.625rem; font-size: 0.8125rem;
            border: 1px solid var(--border); border-radius: 6px;
            background: var(--bg-subtle); color: var(--text-primary);
            font-family: inherit; transition: border-color var(--transition);
            box-sizing: border-box;
        }
        .booking-form input:focus, .booking-form select:focus, .booking-form textarea:focus {
            outline: none; border-color: var(--accent);
        }
        .booking-form textarea { resize: vertical; min-height: 48px; }
        .booking-form .field { display: flex; flex-direction: column; gap: 0.25rem; }
        .booking-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
        .booking-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
        .booking-actions .btn { flex: 1; justify-content: center; font-size: 0.8125rem; }
        .booking-actions .btn:disabled { opacity: 0.6; cursor: not-allowed; }
        .booking-error { font-size: 0.75rem; color: var(--accent); text-align: center; margin-top: 0.5rem; }



        /* Hiring CTA: phase-cycling role with scramble */
        .sr-only {
            position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
            overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
        }
        .hire-cta {
            display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
            width: 100%; max-width: 36rem; min-height: 80px; box-sizing: border-box;
            margin-top: 1.125rem; padding: 0.5rem 0.75rem 0.5rem 1rem;
            border: 1px solid var(--ctl-line); border-radius: 14px;
            background: var(--bg);
            font-size: 0.8125rem;
            font-variation-settings: "MONO" 0.6, "CASL" 0;
            transition: border-color var(--transition), background var(--transition);
        }
        .hire-cta:hover { border-color: var(--ctl-line-hover); }
        .hire-role {
            color: var(--accent); font-weight: 600;
            font-variation-settings: "MONO" 1, "CASL" 0;
            letter-spacing: -0.005em;
        }
        @keyframes ph-1 { 0%,18%{background-color:var(--accent);transform:scale(1.35)} 25%,100%{background-color:var(--border-strong);transform:scale(1)} }
        @keyframes ph-2 { 0%,25%{background-color:var(--border-strong);transform:scale(1)} 30%,43%{background-color:var(--accent);transform:scale(1.35)} 50%,100%{background-color:var(--border-strong);transform:scale(1)} }
        @keyframes ph-3 { 0%,50%{background-color:var(--border-strong);transform:scale(1)} 55%,68%{background-color:var(--accent);transform:scale(1.35)} 75%,100%{background-color:var(--border-strong);transform:scale(1)} }
        @keyframes ph-4 { 0%,75%{background-color:var(--border-strong);transform:scale(1)} 80%,93%{background-color:var(--accent);transform:scale(1.35)} 100%{background-color:var(--border-strong);transform:scale(1)} }
        .rec-toggle {
            display: inline-flex; align-items: center; gap: 0.5rem;
            height: var(--ctl-h-sm); padding: 0 0.75rem; border-radius: var(--ctl-radius); cursor: pointer;
            border: 1px solid var(--ctl-line); background: var(--bg);
            color: var(--text-secondary); font-family: var(--font);
            font-size: 0.75rem; font-weight: 500; letter-spacing: 0.03em;
            font-variation-settings: "MONO" 0.8, "CASL" 0;
            transition: border-color var(--transition), color var(--transition);
        }
        .rec-toggle:hover { border-color: var(--ctl-line-hover); color: var(--ink); }
        .rec-toggle[aria-pressed="true"] { border-color: rgba(224,48,30,0.35); color: var(--rust-deep); background: var(--paper); }
        /* The switch is an abacus rail: a bead slides from one end to the other. */
        .rec-track { order: -1; width: 30px; height: 12px; position: relative; flex: none; }
        .rec-track::before {
            content: ""; position: absolute; left: 1px; right: 1px; top: 50%; height: 2px; margin-top: -1px;
            border-radius: 2px; background: rgba(28,28,30,0.22); transition: background var(--dur-base) var(--ease-move);
        }
        .rec-toggle[aria-pressed="true"] .rec-track::before { background: rgba(224,48,30,0.35); }
        .rec-knob {
            position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%;
            background-color: #b9b6b0; transition: transform 0.55s var(--ease-spring), background-color var(--dur-base) var(--ease-move);
        }
        .rec-toggle[aria-pressed="true"] .rec-knob { transform: translateX(18px); background-color: var(--rust); }

        /* Recruiter view: one line that says what he is, three numbers that
           prove it, four facts a recruiter screens for, and the two actions
           that matter (an interview, the CV). The abacus counts the proofs in. */
        .recruiter-card {
            margin-top: 1rem; padding: 1.5rem; border-radius: 16px;
            border: 1px solid var(--ctl-line); background: var(--bg);
            
            animation: rc-in 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        }
        @keyframes rc-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }
        .recruiter-card[hidden] { display: none; }
        .rc-head { display: grid; grid-template-columns: 56px 1fr auto; gap: 1rem; align-items: start; }
        .rc-abacus { width: 56px; height: 56px; }
        .rc-b { transform-box: fill-box; transform-origin: center; }
        .recruiter-card:not([hidden]) .rc-b1 { animation: rc-count-1 0.9s var(--ease-spring) 0.2s both; }
        .recruiter-card:not([hidden]) .rc-b2 { animation: rc-count-2 0.9s var(--ease-spring) 0.35s both; }
        .recruiter-card:not([hidden]) .rc-b3 { animation: rc-count-3 0.9s var(--ease-spring) 0.5s both; }
        @keyframes rc-count-1 { to { transform: translateX(30px); } }
        @keyframes rc-count-2 { to { transform: translateX(22px); } }
        @keyframes rc-count-3 { to { transform: translateX(14px); } }
        .rc-eyebrow { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); margin: 0 0 0.375rem; }
        .rc-title { font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; color: var(--ink); margin: 0 0 0.375rem; }
        .rc-sub { font-size: 0.8125rem; color: var(--text-secondary); margin: 0; }
        .rc-status {
            display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
            height: 26px; padding: 0 0.625rem; border-radius: 999px;
            font-family: var(--font-mono); font-size: 0.75rem; color: var(--rust-deep);
            background: var(--paper); border: 1px solid rgba(224,48,30,0.25);
        }
        .rc-status i { width: 8px; height: 8px; border-radius: 50%; background-color: var(--rust); animation: live-ring 1.8s var(--ease-move) infinite; }
        .rc-proof { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.625rem; }
        @media (max-width: 1000px) and (min-width: 641px) { .rc-proof { grid-template-columns: 1fr 1fr; } }
        .rc-line { margin: 0.5rem 0 0; font-size: 0.9375rem; line-height: 1.5; color: var(--text-secondary); max-width: 46rem; }
        .rc-line b { font-weight: 800; color: var(--ink); } .rc-line .b-roi { color: #16a34a; } .rc-line .b-cost { color: var(--rust); }
        .rc-facts dd a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--mark); text-underline-offset: 3px; }
        .rc-proof li { padding: 0.875rem 1rem; border-radius: 12px; background: var(--paper); border: 1px solid rgba(224,48,30,0.12); }
        .rc-proof b { display: block; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; color: var(--rust); line-height: 1.1; }
        .rc-proof span { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--ink); margin-top: 0.125rem; }
        .rc-proof em { display: block; font-style: normal; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); margin-top: 0.375rem; }
        .rc-facts { margin: 1.125rem 0 0; display: grid; gap: 0.5rem; }
        .rc-facts > div { display: grid; grid-template-columns: 84px 1fr; gap: 1rem; }
        .rc-facts dt { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); padding-top: 0.1rem; }
        .rc-facts dd { margin: 0; font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.55; }
        .rc-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--ctl-line); }
        .rc-book:hover .live-bead { width: 7px; margin-right: 0.45rem; opacity: 1; animation: live-ring 1.4s var(--ease-move) 0.3s infinite; }
        .rc-copy {
            margin-left: 0.375rem; height: 22px; padding: 0 0.5rem; border-radius: 6px; cursor: pointer;
            border: 1px solid var(--ctl-line); background: var(--bg); color: var(--text-secondary);
            font-family: var(--font-mono); font-size: 0.75rem;
        }
        .rc-copy:hover { border-color: var(--ctl-line-hover); color: var(--ink); }
        @media (max-width: 640px) {
            .rc-head { grid-template-columns: 44px 1fr; }
            .rc-abacus { width: 44px; height: 44px; }
            .rc-status { grid-column: 1 / -1; justify-self: start; }
            .rc-proof { grid-template-columns: 1fr; }
            .rc-proof li { display: grid; grid-template-columns: 64px 1fr; column-gap: 0.75rem; align-items: baseline; }
            .rc-proof b { grid-row: 1 / span 2; font-size: 1.25rem; }
            .rc-facts > div { grid-template-columns: 1fr; gap: 0.1rem; }
            .rc-actions .btn { flex: 1 1 calc(50% - 0.5rem); }
        }
        @media (prefers-reduced-motion: reduce) {
            .recruiter-card, .recruiter-card .rc-b { animation: none !important; }
            .rc-b1 { transform: translateX(30px); } .rc-b2 { transform: translateX(22px); } .rc-b3 { transform: translateX(14px); }
        }
        .rec-share {
            font-size: 0.75rem; color: var(--text-muted); margin-top: 0.875rem;
            font-variation-settings: "MONO" 0.6, "CASL" 0;
        }
        .rec-share code { font-size: 0.75rem; }
        .story-step {
            display: grid; grid-template-columns: 92px 1fr; gap: 1rem;
            padding-bottom: 1.375rem; position: relative;
        }
        .story-step:last-child { padding-bottom: 0; }
        .story-step::after {
            content: ""; position: absolute; left: 0; top: 0.15rem;
            width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box;
            background: var(--mark); border: 2px solid var(--ink);
            
            transition: transform 0.6s var(--ease-spring), background var(--dur-slow) var(--ease-out);
        }
        .story-step:nth-child(even)::after { background: var(--rust-deep); }
        .story-step:last-child::after { background: var(--rust); animation: now-ring 2.4s var(--ease-move) 1.2s infinite; }
        @keyframes now-ring {
            0%   {  }
            70%  { outline: 9px solid rgba(224,48,30,0); outline-offset: 0; }
            100% {  }
        }
        .story-step:hover::after { transform: scale(1.22); background: var(--rust); }
        .story-count { display: inline-flex; gap: 3px; align-items: center; }
        .story-count::before {
            content: ""; width: 4px; height: 1px; background: var(--ctl-line-hover); margin-right: 1px;
        }
        .story-count i {
            width: 7px; height: 7px; border-radius: 50%; box-sizing: border-box;
            border: 1px solid rgba(28,28,30,0.45); background-color: transparent;
            transition: background-color var(--dur-base) var(--ease-move), border-color var(--dur-base) var(--ease-move), transform 0.5s var(--ease-spring);
        }
        .story-count i:nth-child(2) { transition-delay: 70ms; }
        .story-count i:nth-child(3) { transition-delay: 140ms; }
        .story-count i:nth-child(4) { transition-delay: 210ms; }
        .story-step:hover .story-count i { background-color: var(--rust); border-color: var(--rust); transform: translateX(2px); }
        .story-step:last-child .story-count i { background-color: var(--rust); border-color: var(--rust); }
        @media (prefers-reduced-motion: reduce) {
            .story-step:last-child::after { animation: none; }
        }
        .story-art { width: 140px; }


        .story-domains {
            display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
            margin-bottom: 2rem; padding-bottom: 1.5rem;
            border-bottom: 1px solid var(--border);
        }
        .domains-label {
            font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
            color: var(--text-muted); font-weight: 700; margin-right: 0.25rem;
            font-variation-settings: "MONO" 1, "CASL" 0;
        }
        .domain {
            font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em;
            font-variation-settings: "MONO" 0.8, "CASL" 0;
            padding: 0.25rem 0.625rem; border-radius: 999px;
            border: 1px solid var(--border); background: var(--bg-subtle);
            color: var(--text-secondary);
            transition: border-color var(--transition), color var(--transition);
        }
        .domain:hover { border-color: var(--accent); color: var(--accent); }
        .facet-num {
            font-size: 1.5rem; font-weight: 800; color: var(--accent); line-height: 1.1;
            font-variation-settings: "MONO" 1, "CASL" 0;
        }
        .facet-label {
            font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
            color: var(--text-primary); font-weight: 600;
            font-variation-settings: "MONO" 0.8, "CASL" 0;
        }
        .facet-note { font-size: 0.75rem; color: var(--text-muted); line-height: 1.6; margin-top: 0.125rem; }

        /* Engagement cards */
        .engage-lede {
            font-size: 0.8125rem; color: var(--text-primary); font-weight: 600;
            font-variation-settings: "MONO" 0.4, "CASL" 0;
            margin: -0.5rem 0 0.875rem;
        }

        /* The same control, used inline inside a card. */
        .disclose > summary {
            list-style: none; cursor: pointer; position: relative;
            display: inline-block; padding-left: 1.125rem;
            font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase;
            color: var(--text-muted); font-variation-settings: "MONO" 0.8, "CASL" 0;
            transition: color var(--transition);
        }
        .disclose > summary::-webkit-details-marker { display: none; }
        .disclose > summary:hover { color: var(--accent); }
        .disclose > summary::before, .disclose > summary::after {
            content: ""; position: absolute; left: 0; top: 50%;
            width: 9px; height: 1.5px; background: currentColor;
            transition: transform var(--dur-base) var(--ease-out);
        }
        .disclose > summary::before { transform: translateY(-50%); }
        .disclose > summary::after { transform: translateY(-50%) rotate(90deg); }
        .disclose[open] > summary::after { transform: translateY(-50%) rotate(0deg); }
        .disclose[open] > summary { color: var(--accent); }
        .case-disclose { margin: 0.25rem 0 0.75rem; }
        .case-disclose > summary { margin-bottom: 0.5rem; }
        .engage-disclose { margin-top: 0.5rem; }
        .engage-disclose > summary { margin-bottom: 0.375rem; }

        /* Respect the visitor's motion preference */
        @media (prefers-reduced-motion: reduce) {
            html { scroll-behavior: auto; }
            *, *::before, *::after {
                animation-duration: 0.001ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.001ms !important;
                scroll-behavior: auto !important;
            }
            .reveal, .case-card, .pub-card, .timeline-item, .gallery-card, .case-row {
                opacity: 1 !important; transform: none !important;
            }
        }

        /* Tablet: 641px – 1024px */
        @media (max-width: 1024px) and (min-width: 641px) {
            .container { max-width: 680px; }
            .hero-name { font-size: 2rem; }
            .hero-art { width: 112px; }
            .metrics-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
            .gallery-card { grid-template-columns: 280px 1fr; gap: 1.5rem; }
            .about-grid { grid-template-columns: repeat(2, 1fr); }
            .time-strip { font-size: 0.75rem; gap: 1rem; }
        }

        /* Mobile: ≤640px */
        @media (max-width: 640px) {
            .container { padding: 0 1.25rem; }
            .hero { padding: 1.5rem 0 2.5rem; }
            .hero-name { font-size: clamp(1.875rem, 8.4vw, 2.5rem); line-height: 1.08; }
            /* phones: the identity becomes a row above the headline */
            /* phones: one animation at a time. The headline keeps its ticker;
               the portrait and the "Vahid is" line move to the head of About. */
            .hero-identity { float: none; width: auto; margin: 0 0 1rem; display: block; }
            .hero-identity .hero-links { justify-content: flex-start; margin-top: 0; }
            .about-identity .identity-core {
                display: grid; grid-template-columns: 88px 1fr; column-gap: 1rem; align-items: center; text-align: left;
            }
            .about-identity .hero-portrait { width: 88px; height: 88px; }
            .about-identity .hero-is { margin: 0; align-self: end; }
            .about-identity .hero-is .ticker > .tk { justify-self: start; }
            .hero-portrait { width: 72px; height: 72px; margin: 0 auto; }
            .hero-links { gap: clamp(0.125rem, 1.6vw, 0.5rem); margin-top: 0.5rem; }
            .hero-links a { min-width: clamp(26px, 8.2vw, 32px); min-height: 32px; }
            .hero-links svg { width: 20px; height: 20px; }
            .hero-icon-row { gap: 1rem; }
            .story-art { width: 140px; }
            .bio-tags {
                display: flex; gap: 0.375rem; flex-wrap: nowrap; overflow-x: auto;
                -webkit-overflow-scrolling: touch; scrollbar-width: none;
                padding-bottom: 0.25rem; margin: 0.5rem -1.25rem 0.25rem;
                padding-left: 1.25rem; padding-right: 1.25rem;
            }
            .bio-tags::-webkit-scrollbar { display: none; }
            .bio-tag { flex: 0 0 11.5rem; height: 2.125rem; font-size: 0.75rem; }
            .hero-ctas { display: grid; grid-template-columns: 1fr 1fr; }
            .hero-ctas .cta-cv { grid-column: 1 / -1; }
            .hire-cta {
                width: 100%; border-radius: 14px;
                padding: 0.75rem 0.875rem; font-size: 0.75rem;
                justify-content: flex-start;
            }
            .hire-role { min-width: 0; flex: 1 1 auto; }
            .hire-cta, .reel { max-width: none; }
            .recruiter-card { padding: 1.25rem; }
            .hero-ctas .btn { width: 100%; justify-content: center; padding: 0 0.5rem; }
            .metrics-grid {
                display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
                scrollbar-width: none; gap: 0.5rem;
                margin: 0 -1.25rem 2rem; padding: 0 1.25rem;
            }
            .metrics-grid::-webkit-scrollbar { display: none; }
            .metric-card { min-width: 120px; flex-shrink: 0; padding: 0.75rem; }
            .metric-num { font-size: 1.125rem; }
            .metric-label { font-size: 0.75rem; }
            .time-strip { flex-direction: column; gap: 0.5rem; align-items: flex-start; font-size: 0.75rem; }
            .about-grid { grid-template-columns: 1fr; }
            .timeline-item { grid-template-columns: 1fr; gap: 0.25rem; }
            .timeline-logo { width: 28px; height: 28px; }
            .timeline-header { gap: 0.5rem; }
            .case-row { grid-template-columns: 1fr; gap: 0.25rem; }
            .case-card { padding: 1.5rem; }
            .gallery-card { grid-template-columns: 1fr; padding: 1.5rem; }
            .gallery-screenshot { max-width: 100%; }
            .story-step { grid-template-columns: 80px 1fr; gap: 0.75rem; }
            .booking-form .row { grid-template-columns: 1fr; }
            .booking-actions { flex-direction: column; }
            .booking-actions .btn { width: 100%; }
            .booking-tz { flex-wrap: wrap; }
            section { padding: 2.5rem 0; }
            .section-label { margin-bottom: 0.375rem; }
            .footer-inner { text-align: center; gap: 1rem; }
            .footer-top { flex-direction: column; gap: 0.75rem; }
            .footer-nav { flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
            .footer-meta { justify-content: center; }
        }
            /* ---- wooden abacus frames ------------------------------------------
           Frames are drawn, not dotted: two light beech dowels at the sides
           (shaded like a turned cylinder) and thin rods running between them.
           On hover the lower rod fills with red from left to right. */
        :root {
            --dowel: linear-gradient(90deg, #b88f62 0%, #dcc09c 30%, #f0e2cb 52%, #d2b38c 78%, #ac8457 100%);
        }
        .bio-tag, .arc-step, .hire-cta, .reel, .problem {
            border-left: 0; border-right: 0; border-radius: 6px;
            background-image: var(--dowel), var(--dowel) !important;
            background-size: 5px 100%, 5px 100% !important;
            background-position: left center, right center !important;
            background-repeat: no-repeat !important;
        }
        .problem { background-size: 6px 100%, 6px 100% !important; }
        .bio-tag.accent::before { background: rgba(28,28,30,0.14); }
        .bio-tag::before {
            content: ""; position: absolute; left: 5px; right: 5px; top: 5px; bottom: auto; width: auto; height: 1px; z-index: 0;
            border-radius: 0; background: rgba(28,28,30,0.14);  pointer-events: none; transition: none;
        }
        .bio-tag:hover::before, .bio-tag.is-flipped::before { left: 5px; background: rgba(28,28,30,0.14); }
        .bio-tag::after, .arc-step::after, .hire-cta::after, .reel::after {
            left: 5px; right: 5px; bottom: 5px; height: 1px;
            background: linear-gradient(var(--rust), var(--rust)) left center / 0% 100% no-repeat, rgba(28,28,30,0.16);
            transition: background-size 0.7s cubic-bezier(0.65, 0, 0.25, 1);
        }
        .bio-tag:hover::after, .bio-tag.is-flipped::after, .arc-step:hover::after, .hire-cta:hover::after, .reel:hover::after {
            background-size: 100% 100%, auto;
        }
        .bio-tag:hover, .bio-tag.is-flipped, .arc-step:hover, .hire-cta:hover, .reel:hover { border-left-color: transparent; border-right-color: transparent; }
        .bio-tag.is-flipped, .arc-step:hover { background-color: var(--paper); background-image: var(--dowel), var(--dowel); }
        .bio-tag:hover, .hire-cta:hover, .reel:hover { background-image: var(--dowel), var(--dowel); }
        .problem::before { left: 6px; right: 6px; }
        @media (prefers-reduced-motion: reduce) { .bio-tag::after, .arc-step::after, .hire-cta::after, .reel::after { transition: none; } }

    
        /* ---- hero, easier to read: who first, the promise under the rule ---- */
        h1.hero-is { white-space: normal; margin-bottom: 0; font-weight: 700; }
        h1.hero-is .ticker { display: grid; }
        h1.hero-is .ticker > .tk { white-space: normal; }
        .hero-count { margin: 0 0 0.5rem; font-size: clamp(1.25rem, 2.2vw, 1.75rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); }
        .hero-count .ticker { vertical-align: bottom; }
        @media (max-width: 640px) {
            /* phones: one moving line in the hero; the promise holds still */
            .hero-count .tk { opacity: 0 !important; transform: none !important; filter: none !important; }
            .hero-count .tk:first-child { opacity: 1 !important; }
        }

        /* hire card: a label, the role, the button */
        .hire-cta { flex-wrap: nowrap; gap: 0.75rem; }

        /* updates card */
        .upd-card {
            position: relative; display: flex; align-items: center; gap: 0.875rem; width: 100%; max-width: 36rem; min-height: 80px; box-sizing: border-box;
            margin-top: 0.625rem; padding: 0.5rem 0.875rem 0.5rem 0.75rem; border-top: 1px solid var(--ctl-line); border-bottom: 1px solid var(--ctl-line);
            border-radius: 6px; color: var(--ink); text-decoration: none; background-color: var(--bg);
            background-image: var(--dowel), var(--dowel); background-size: 5px 100%, 5px 100%; background-position: left center, right center; background-repeat: no-repeat;
        }
        .upd-card::after {
            content: ""; position: absolute; left: 5px; right: 5px; bottom: 5px; height: 1px;
            background: linear-gradient(var(--rust), var(--rust)) left center / 0% 100% no-repeat, rgba(28,28,30,0.16);
            transition: background-size 0.7s cubic-bezier(0.65, 0, 0.25, 1);
        }
        .upd-card:hover { text-decoration: none; }
        .upd-card:hover::after { background-size: 100% 100%, auto; }
        .upd-stack { position: relative; flex: none; width: 104px; height: 60px; margin-left: 4px; }
        .upd-stack img {
            position: absolute; top: 6px; left: 0; width: 72px; height: 48px; object-fit: cover; border-radius: 7px;
            border: 2px solid #fff; 
            transition: transform 0.5s var(--ease-spring);
        }
        .upd-stack img:nth-child(1) { transform: rotate(-6deg); z-index: 1; }
        .upd-stack img:nth-child(2) { left: 16px; transform: rotate(2deg); z-index: 2; }
        .upd-stack img:nth-child(3) { left: 32px; transform: rotate(8deg); z-index: 3; }
        .upd-card:hover .upd-stack img:nth-child(1) { transform: rotate(-12deg) translate(-4px, -2px); }
        .upd-card:hover .upd-stack img:nth-child(3) { transform: rotate(14deg) translate(6px, -2px); }
        .upd-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1; }
        .upd-k { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust-deep); }
        .upd-k .ab { width: 14px; height: 14px; }
        .upd-text b { font-size: 0.875rem; font-weight: 700; letter-spacing: -0.01em; }
        .upd-text em { font-style: normal; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
        .upd-go { flex: none; color: var(--text-muted); transition: transform 0.4s var(--ease-spring), color 0.3s; }
        .upd-card:hover .upd-go { transform: translateX(4px); color: var(--rust); }
        @media (min-width: 1200px) {
            .hero-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
            .hero-cards .upd-card { max-width: none; margin-top: 1.125rem; }
        }
        @media (max-width: 640px) { .upd-card { max-width: none; } .upd-stack { width: 88px; } .upd-stack img { width: 60px; height: 40px; } }
            .case-tag-concept { color: #fff; background: var(--ink); border-color: var(--ink); }
        .case-concept { font-weight: 500; color: var(--text-muted); font-size: 0.8em; }
            /* recruiter view lives in the navbar, beside the CV */
        .nav-rec { height: var(--ctl-h-sm); font-size: 0.8125rem; font-weight: 600; letter-spacing: -0.005em; color: var(--ink); white-space: nowrap; }
        @media (max-width: 1100px) { .nav-rec .rec-toggle-label { display: none; } .nav-rec { padding: 0 0.6rem; } }
        @media (max-width: 400px) { .nav-actions { gap: 0.3rem; } .nav-rec { padding: 0 0.4rem; } .nav-rec .rec-track { width: 24px; } .nav-rec[aria-pressed="true"] .rec-knob { transform: translateX(12px); } .nav-btn-ghost { padding: 0 0.6rem; } }
        .recruiter-card { margin-top: 1.25rem; }
    
        /* ---- the stack, strung as white beads on a wooden rod --------------- */
        .stack-abacus {
            position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 0.5rem; margin: 1rem 0 0.25rem;
            padding: 0.75rem 1.25rem 0.5rem 1.25rem; border-top: 1px solid var(--ctl-line); border-bottom: 1px solid var(--ctl-line); border-radius: 6px;
            background-image: var(--dowel), var(--dowel); background-size: 5px 100%, 5px 100%; background-position: left center, right center; background-repeat: no-repeat;
        }
        .sa-label { flex: none; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); writing-mode: horizontal-tb; }
        .sa-rod { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 0.25rem; margin: 0; padding: 0; list-style: none; flex: 1; min-width: 0; }
        .sb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; width: 74px; }
        .sb::before {   /* the rod runs through every bead */
            content: ""; position: absolute; left: -0.5rem; right: -0.5rem; top: 20px; height: 4px; margin-top: -2px; border-radius: 4px; z-index: 0;
            background: linear-gradient(180deg, #e9d8bd 0%, #f4eadb 35%, #d2b48d 75%, #b8946a 100%);
        }
        .sb-bead {
            position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
            background: radial-gradient(circle at 34% 28%, #ffffff 0%, #f6f3f0 40%, #dcd6d0 100%);
            
            transition: transform 0.55s var(--ease-spring);
        }
        .sb-bead svg { width: 19px; height: 19px; display: block; }
        .sb-bead { color: var(--ink); }
        .sb-name { font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.25; color: var(--text-secondary); text-align: center; }
        .sb:hover .sb-bead { transform: translateX(6px) rotate(25deg);  }
        .sb:hover .sb-name { color: var(--rust-deep); }
        .stack-abacus.is-popped .sb-bead { animation: sb-drop 0.8s var(--ease-spring) both; animation-delay: calc(var(--k) * 55ms); }
        @keyframes sb-drop { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
        @media (max-width: 760px) {
            .stack-abacus { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
            .sa-rod { justify-content: flex-start; gap: 0.5rem 0; }
            .sb { width: 25%; }
        }
        @media (max-width: 400px) { .sb { width: 33.33%; } }
        @media (prefers-reduced-motion: reduce) { .sb-bead, .stack-abacus.is-popped .sb-bead { transition: none; animation: none; } }
    
        /* bio and the film side by side; the film is only a thumbnail */
        .hero-bio { display: flex; align-items: center; gap: 1.5rem; }
        .hero-bio .hero-tagline { flex: 1; min-width: 0; margin: 0; }
        .reel-mini {
            flex: none; flex-direction: column; align-items: stretch; gap: 0.35rem; width: 200px; min-height: 0; max-width: none; margin: 0;
            padding: 0; border: 0 !important; background: none !important; 
        }
        .reel-mini::after { display: none; }
        .reel-mini .reel-thumb { width: 100%; border-radius: 10px;  }
        .reel-mini .reel-play { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
        .reel-mini .reel-play svg { width: 15px; height: 15px; }
        .reel-cap { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); text-align: center; }
        .reel-cap b { color: var(--rust-deep); font-weight: 500; }
        .reel-mini:hover .reel-cap { color: var(--ink); }
        @media (max-width: 640px) {
            .hero-bio { flex-direction: column; align-items: stretch; gap: 1rem; }
            .reel-mini { width: 100%; }
        }
        .hire-more { margin-left: 0.5rem; color: var(--rust-deep); letter-spacing: 0.04em; opacity: 0.75; transition: opacity 0.25s; }
        /* three cards in one row from tablets up */
        .hero-cards .cat-card { margin-top: 0.625rem; }
        @media (min-width: 641px) and (max-width: 1199px) {
            .hero-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 0.75rem; }
            .hero-cards .hire-cta, .hero-cards .cat-card { max-width: none; }
        }
        @media (min-width: 1200px) {
            .hero-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
            .hero-cards .cat-card { margin-top: 1.125rem; }
            .hero-cards .hire-cta { flex-wrap: wrap; }
            .hero-cards .hire-cta { flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 1rem 1rem 1.1rem 1.25rem; }
            .hire-more { display: block; margin: 0.35rem 0 0; }
        }
    
        /* category cards: a fan of images on top, the words below */
        @media (min-width: 641px) {
            .cat-card { flex-direction: column; align-items: stretch; gap: 0.625rem; padding: 0.75rem 0.875rem 1rem; }
            .cat-card .upd-stack { width: 100%; height: 104px; margin: 0; border-radius: 8px; background: var(--paper); overflow: hidden; }
            .cat-card .upd-stack img { top: 14px; width: 52%; height: 80px; border-radius: 6px; }
            .cat-card .upd-stack img:nth-child(1) { left: 4%; transform: rotate(-7deg); }
            .cat-card .upd-stack img:nth-child(2) { left: 24%; transform: rotate(1deg); top: 10px; }
            .cat-card .upd-stack img:nth-child(3) { left: 44%; transform: rotate(7deg); }
            .cat-card:hover .upd-stack img:nth-child(1) { transform: rotate(-11deg) translate(-6px, 2px); }
            .cat-card:hover .upd-stack img:nth-child(3) { transform: rotate(11deg) translate(6px, 2px); }
            .cat-card .upd-go { position: absolute; right: 0.875rem; bottom: 1rem; }
            .cat-card .upd-text { padding-right: 1.25rem; }
        }
    
        /* hero: smaller bio, a bigger film beside it */
        .hero-bio .hero-tagline { font-size: 1rem; line-height: 1.7; }
        .reel-mini { width: 300px; }
        .reel-mini .reel-play { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
        .reel-mini .reel-play svg { width: 18px; height: 18px; }
        @media (min-width: 1200px) { .reel-mini { width: 360px; } }
        /* the promise heads the stack */
        .sa-msg { margin: 0.25rem 0 0.25rem; font-size: clamp(1.125rem, 1.8vw, 1.5rem); }
        /* portrait picker: seven media, one bead each */
        .hero-portrait canvas { cursor: pointer; }
        .pm-beads { display: flex; justify-content: center; gap: 5px; margin-top: 0.625rem; }
        .pm-beads button {
            width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background-color: #d9d4ce;
            background-image: radial-gradient(circle at 34% 30%, rgba(255,255,255,0.8) 0 14%, rgba(255,255,255,0) 22%);
             transition: transform 0.4s var(--ease-spring), background-color 0.25s;
        }
        .pm-beads button:hover { transform: scale(1.35); }
        .pm-beads button[aria-pressed="true"] { background-color: var(--rust); transform: scale(1.3); }
        .pm-name { display: block; margin-top: 0.3rem; text-align: center; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); min-height: 1em; }
        @media (max-width: 640px) { .pm-beads { justify-content: flex-start; } .pm-name { text-align: left; } }
    
        /* phones and tablets: the film is a cover with one big play button */
        @media (hover: none), (max-width: 640px) {
            .reel-mini .reel-story, .reel-mini .reel-ticks { display: none !important; }
            .reel-mini .reel-play { width: 76px; height: 76px; margin: -38px 0 0 -38px; }
            .reel-mini .reel-play svg { width: 26px; height: 26px; margin-left: 4px; }
        }
    
        /* share the film */
        .reel-col { flex: none; display: flex; flex-direction: column; gap: 0.5rem; }
        .reel-share { display: flex; justify-content: center; gap: 0.5rem; }
        .reel-share a, .rp-share {
            display: inline-flex; align-items: center; gap: 0.4rem; height: 30px; padding: 0 0.7rem; border-radius: 999px;
            border: 1px solid var(--ctl-line); background: var(--bg); color: var(--ink); font-size: 0.75rem; font-weight: 600; text-decoration: none;
            transition: border-color 0.25s, color 0.25s, background 0.25s;
        }
        .reel-share svg, .rp-share svg { width: 13px; height: 13px; }
        .reel-share .rs-li svg { color: #0a66c2; }
        .reel-share a:hover, .rp-share:hover { border-color: var(--ctl-line-hover); background: var(--ctl-tint); text-decoration: none; }
        .rp-share { width: 32px; padding: 0; justify-content: center; border-radius: var(--ctl-radius); }
        @media (max-width: 640px) { .reel-col { width: 100%; } }

        /* experience, for the person deciding on an interview */
        .xp-sell { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin: 1.25rem 0 2.25rem; }
        .xp-sell > div { position: relative; display: flex; flex-direction: column; gap: 0.3rem; padding: 0.875rem 1rem 1rem 1.1rem; border-radius: 6px;
            border-top: 1px solid var(--ctl-line); border-bottom: 1px solid var(--ctl-line);
            background-image: var(--dowel), var(--dowel); background-size: 5px 100%, 5px 100%; background-position: left center, right center; background-repeat: no-repeat; }
        .xp-sell b { font-size: 0.875rem; font-weight: 700; color: var(--ink); }
        .xp-sell b::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 0.45rem; border-radius: 50%; background: var(--rust); vertical-align: 0.05em; }
        .xp-sell span { font-size: 0.75rem; line-height: 1.55; color: var(--text-secondary); }
        .xp-lead { margin: 0.6rem 0 0.4rem; font-size: 0.9375rem; line-height: 1.55; color: var(--ink); font-weight: 500; }
        .xp-points { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; }
        .xp-points li { position: relative; padding-left: 1.1rem; font-size: 0.8125rem; line-height: 1.6; color: var(--text-secondary); }
        .xp-points li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--mark); outline: 1px solid rgba(224,48,30,0.35); outline-offset: -1px; }
        .xp-points strong { color: var(--ink); font-weight: 600; }
        .xp-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.6rem; }
        .xp-links a, .xp-foot a { font-size: 0.8125rem; font-weight: 600; color: var(--rust-deep); text-decoration: none; border-bottom: 1px solid rgba(224,48,30,0.25); }
        .xp-links a:hover, .xp-foot a:hover { border-color: var(--rust); color: var(--rust); text-decoration: none; }
        .xp-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }
        .xp-tags span { padding: 0.15rem 0.5rem; border-radius: 999px; border: 1px solid var(--ctl-line); font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
        .xp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
        .xp-foot .xp-book { margin-left: auto; padding: 0.5rem 0.9rem; border-radius: var(--ctl-radius); background: var(--ink); color: #fff; border: 0; }
        .xp-foot .xp-book:hover { background: #000; color: #fff; }
        @media (max-width: 900px) { .xp-sell { grid-template-columns: 1fr 1fr; } }
        @media (max-width: 640px) { .xp-sell { grid-template-columns: 1fr; } .xp-foot .xp-book { margin-left: 0; } }
            .tl-init { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.875rem; color: var(--rust); background: var(--paper); }
    
        /* the stack as a three-rod abacus: one rod per discipline */
        .sa-row { display: grid; grid-template-columns: 150px 1fr; align-items: start; gap: 0.75rem; padding: 0.35rem 0; }
        .sa-row + .sa-row { border-top: 1px dashed rgba(28,28,30,0.08); }
        .sa-row-label { padding-top: 0.75rem; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rust-deep); }
        .sa-row .sa-rod { justify-content: flex-start; gap: 0.4rem 0.15rem; }
        .sa-row .sb { width: 74px; }
        .sa-row .sb-bead { width: 36px; height: 36px; }
        .sa-row .sb-bead svg { width: 18px; height: 18px; }
        .sa-row .sb::before { top: 18px; }
        /* wide screens: one rod per row, post to post, so every row is strung on the frame */
        @media (min-width: 761px) {
            .sa-row { position: relative; }
            .sa-row::before {
                content: ""; position: absolute; left: calc(5px - 1.25rem); right: calc(5px - 1.25rem); top: calc(0.35rem + 18px);
                height: 4px; margin-top: -2px; border-radius: 4px; z-index: 0;
                background: linear-gradient(180deg, #e9d8bd 0%, #f4eadb 35%, #d2b48d 75%, #b8946a 100%);
            }
            .sa-row .sb::before { display: none; }
            .sa-row-label { position: relative; z-index: 1; justify-self: start; background: var(--bg); padding-right: 0.6rem; }
        }
        /* phones: each group is one rod you swipe along, like a real abacus row,
           so the whole stack takes three short lines instead of a tall grid */
        @media (max-width: 760px) {
            .sa-row { grid-template-columns: 1fr; gap: 0.15rem; padding: 0.3rem 0; }
            .sa-row-label { padding-top: 0.25rem; display: flex; justify-content: space-between; }
            .sa-row-label::after { content: "swipe \2192"; color: var(--text-muted); letter-spacing: 0.04em; text-transform: none; }
            .sa-row .sa-rod {
                position: relative; flex-wrap: nowrap; justify-content: flex-start; gap: 0; overflow-x: auto; overscroll-behavior-x: contain;
                scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -1.25rem; padding: 0 1.25rem 0.15rem;
                -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
                        mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
            }
            .sa-row .sa-rod::-webkit-scrollbar { display: none; }
            .sa-row .sb { flex: 0 0 62px; width: 62px; gap: 0.2rem; scroll-snap-align: start; }
            .sa-row .sb::before { left: 0; right: 0; top: 16px; border-radius: 0; }
            .sa-row .sb-bead { width: 32px; height: 32px; }
            .sa-row .sb-bead svg { width: 16px; height: 16px; }
            .sa-row .sb-name { font-size: 0.75rem; max-width: 60px; }
            .sa-msg { font-size: 1.125rem; }
        }
    
        .rp-sound {
            position: absolute; z-index: 3; right: 16px; top: 16px; display: inline-flex; align-items: center; gap: 0.45rem;
            height: 38px; padding: 0 1rem; border: 0; border-radius: 999px; cursor: pointer;
            background: rgba(255,255,255,0.95); color: var(--ink); font: 600 0.8125rem var(--font);
             animation: rp-nudge 2.2s var(--ease-move) 0.8s 3;
        }
        .rp-sound[hidden] { display: none; }
        .rp-sound svg { width: 16px; height: 16px; color: var(--rust); }
        @keyframes rp-nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-3px) scale(1.04); } }
    
        /* the bio: three words, then one plain sentence */
        .bio { display: flex; flex-direction: column; gap: 0.6rem; }
        .bio-three { margin: 0; display: flex; flex-wrap: wrap; gap: 0.15rem 0.85rem; font-size: clamp(1.75rem, 3.2vw, 2.5rem); line-height: 1.05; letter-spacing: -0.035em; }
        .bio-three span { position: relative; display: inline-flex; }
        .bio-three b { font-weight: 800; color: var(--ink); padding: 0 0.08em;
            background: linear-gradient(var(--mark), var(--mark)) left 82% / 0% 38% no-repeat;
            animation: bio-mark 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
        .bio-three span:nth-child(2) b { animation-delay: 0.25s; }
        .bio-three span:nth-child(3) b { animation-delay: 0.5s; color: var(--rust); }
        .bio-three i { font-style: normal; font-weight: 800; color: var(--rust); }
        @keyframes bio-mark { to { background-size: 100% 38%; } }
        .bio-three span { font-weight: 800; color: var(--ink); }
        .bio-three b.b-roi { color: #16a34a; }
        .bio-three b.b-cost { color: var(--rust); }
        .bio-text { margin: 0; max-width: 36rem; font-size: 1.0625rem; line-height: 1.6; color: var(--text-secondary); }
        .bio-text strong { color: var(--ink); font-weight: 700; }
        .bio-text mark { color: var(--ink); background: linear-gradient(var(--mark), var(--mark)) left 75% / 100% 40% no-repeat; padding: 0 0.1em; }
        @media (prefers-reduced-motion: reduce) { .bio-three b { animation: none; background-size: 100% 38%; } }
    
        /* the portrait hangs in a minimal wooden frame */
        .hero-portrait {
            box-sizing: border-box; padding: 6px; border-radius: 6px;
            background:
                linear-gradient(90deg, rgba(120,80,40,0.12) 0 1px, transparent 1px 100%) 0 0 / 7px 100%,
                linear-gradient(135deg, #caa77c 0%, #ecdcc2 30%, #d2b48d 55%, #f0e3cd 75%, #bf9a6d 100%);
            outline: 1px solid rgba(90,60,30,0.28); outline-offset: -1px;
        }
        .hero-portrait canvas { background: var(--paper); border-radius: 2px; outline: 1px solid rgba(255,255,255,0.4); outline-offset: 0; cursor: pointer; }
        .hero-portrait:hover { outline: 1px solid rgba(90,60,30,0.28); outline-offset: -1px; }
            .pm-hint { color: var(--rust-deep); opacity: 0.75; }
    
        /* the film: a big cover with a play bead, two quiet share icons below */
        .reel-mini { width: 340px; }
        .reel-mini .reel-story, .reel-mini .reel-ticks { display: none !important; }
        .reel-mini .reel-play { width: 72px; height: 72px; margin: -36px 0 0 -36px; }
        .reel-mini .reel-play svg { width: 24px; height: 24px; margin-left: 4px; }
        .reel-mini .reel-thumb img { transition: transform 0.6s var(--ease-out); }
        .reel-mini:hover .reel-thumb img { transform: scale(1.04); }
        @media (min-width: 1200px) { .reel-mini { width: 420px; } }
        @media (max-width: 640px) { .reel-mini { width: 100%; } }
        .reel-share { gap: 0.4rem; }
        .reel-share a { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; }
        .reel-share svg { width: 14px; height: 14px; }
        .reel-share .rs-x svg { color: var(--ink); }
    
        /* before and after, as a ledger */
        .gains { margin: 1rem 0 0.25rem; border-top: 1px solid var(--border); }
        .gains-head, .gains-row { display: grid; grid-template-columns: 1.4fr 0.8fr 1fr; align-items: center; gap: 0.75rem; }
        .gains-head { padding: 0.5rem 0 0.35rem; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
        .gains-head span:last-child { color: var(--rust-deep); }
        .gains-row { padding: 0.45rem 0; border-top: 1px solid var(--border); font-size: 0.8125rem; }
        .gains-row span { color: var(--ink); }
        .gains-row s { color: var(--text-muted); text-decoration-thickness: 1.5px; }
        .gains-row b { justify-self: start; padding: 0.15rem 0.55rem; border-radius: 6px; background: var(--paper); border: 1px solid rgba(224,48,30,0.25); color: var(--rust); font-weight: 800; }
        @media (max-width: 640px) { .gains-head, .gains-row { grid-template-columns: 1.2fr 0.8fr 1fr; gap: 0.4rem; font-size: 0.75rem; } }
    
/* Abacus frames for cards, shared by every page and with Applied AI, Simplified.
   A card is a small wooden abacus: two rounded dowels standing just outside it and overhanging
   it, joined by a thin wooden rod top and bottom. The wood is the frame; never a shadow, never
   a field of dots. Hovering a card turns its top rod rust. */
:root {
  --dowel: linear-gradient(90deg, #b48a5c 0%, #d8bb94 24%, #f1e3cc 48%, #dcc29e 70%, #ad8455 100%);
  --rod-wood: linear-gradient(180deg, #e9d8bd 0%, #f4eadb 35%, #d2b48d 75%, #b8946a 100%);
  --rod-on: #e0301e;
}
.case-card, .pub-card, .about-card, .metric-card, .recruiter-card, .gallery-card,
.news-card, .principle-card, .result, .cite, .frame, .abacus-frame {
  position: relative; overflow: visible !important;
  border-color: transparent !important;
  border-radius: 4px !important;
  
  background-image: var(--rod-wood), var(--rod-wood) !important;
  background-size: 100% 3px, 100% 3px !important;
  background-position: center top, center bottom !important;
  background-repeat: no-repeat !important;
}
.case-card::before, .pub-card::before, .about-card::before, .metric-card::before, .recruiter-card::before, .gallery-card::before,
.news-card::before, .principle-card::before, .result::before, .cite::before, .frame::before, .abacus-frame::before,
.case-card::after, .pub-card::after, .about-card::after, .metric-card::after, .recruiter-card::after, .gallery-card::after,
.news-card::after, .principle-card::after, .result::after, .cite::after, .frame::after, .abacus-frame::after {
  content: "" !important; position: absolute !important; top: -5px !important; bottom: -5px !important; inset-inline: auto !important;
  width: 7px !important; height: auto !important; border-radius: 4px !important; pointer-events: none;
  background: var(--dowel) !important; opacity: 1 !important; -webkit-mask-image: none !important; mask-image: none !important; z-index: 1;
}
.case-card::before, .pub-card::before, .about-card::before, .metric-card::before, .recruiter-card::before, .gallery-card::before,
.news-card::before, .principle-card::before, .result::before, .cite::before, .frame::before, .abacus-frame::before { left: -4px !important; right: auto !important; }
.case-card::after, .pub-card::after, .about-card::after, .metric-card::after, .recruiter-card::after, .gallery-card::after,
.news-card::after, .principle-card::after, .result::after, .cite::after, .frame::after, .abacus-frame::after { right: -4px !important; left: auto !important; }
.case-card:hover, .pub-card:hover, .about-card:hover, .metric-card:hover, .gallery-card:hover,
.news-card:hover, .principle-card:hover, .result:hover, .cite:hover, .abacus-frame:hover {
  
  background-image: linear-gradient(var(--rod-on), var(--rod-on)), var(--rod-wood) !important;
}

/* Applied AI, Simplified as the featured banner, right after the hero: larger name, the four
   things it does as named beads on the rod (Map, Read, Explain, Source), this week's numbers
   from the tracker, and the weekly note. */
#applied-ai.aai-feat-wrap { padding-top: 0.5rem; }
#applied-ai .aai-h { font-size: clamp(2rem, 4.2vw, 3.1rem); letter-spacing: -0.035em; line-height: 1.04; }
#applied-ai .aai-lead { font-size: clamp(1rem, 1.5vw, 1.15rem); max-width: 40rem; }
#applied-ai .aai-steps { margin-top: 2rem; }
#applied-ai .aai-steps a::before { width: 34px; height: 34px; }
#applied-ai .aai-steps::before, #applied-ai .aai-steps::after { top: 16px; }
#applied-ai .aai-steps b { display: block; font-size: 0.95rem; font-weight: 700; color: var(--ink); }
#applied-ai .aai-steps em { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; font-style: normal; font-size: 0.76rem; line-height: 1.35; color: var(--text-muted); max-width: 12rem; }
#applied-ai .aai-cap { display: none; }
#applied-ai .aai-note-link { font-size: 0.9rem; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: rgba(224,48,30,0.45); text-underline-offset: 4px; }
#applied-ai .aai-note-link:hover { color: var(--rust-deep); text-decoration-color: currentColor; }
@media (max-width: 640px) {
    #applied-ai .aai-steps em { display: none; }
    #applied-ai .aai-steps b { font-size: 0.8rem; }
}

/* the hero's other two doors, under the hiring one: research labs, and people learning applied AI */
.hero-doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.5rem; max-width: 544px; }
.hero-door { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.65rem; padding: 0.6rem 0.75rem;
    border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none;
    transition: border-color var(--dur-fast) var(--ease-move), transform var(--dur-slow) var(--ease-spring); }
.hero-door:hover { border-color: var(--rust); transform: translateY(-2px); text-decoration: none; }
.hero-door:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.hero-door .hd-ic { width: 22px; height: 22px; }
.hero-door > span { display: flex; flex-direction: column; gap: 0.1rem; line-height: 1.3; min-width: 0; }
.hero-door .hd-k { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust); }
.hero-door b { font-size: 0.82rem; font-weight: 700; letter-spacing: -0.01em; }
.hero-door i { font-style: normal; color: var(--rust); transition: transform var(--dur-slow) var(--ease-spring); }
.hero-door:hover i { transform: translateX(3px); }
@media (max-width: 560px) { .hero-doors { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .hero-door, .hero-door i { transition: none; } .hero-door:hover { transform: none; } }

/* the research section points to the research page */
#publications .pub-more { margin: -0.4rem 0 1rem; font-size: 0.9rem; }
#publications .pub-more a { font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: rgba(224,48,30,0.45); text-underline-offset: 4px; }
#publications .pub-more a:hover { color: var(--rust-deep); text-decoration-color: currentColor; }
/* the recruiter switch, out of the bar: a small control beside the hiring door */
.hero-rec { margin: 0.5rem 0 0; }

        /* the result leads each case, outside the disclosure */
        .case-lead { margin: 0.75rem 0 0.25rem; }
        .case-lead .case-result { padding: 0.6rem 0.75rem 0.6rem 1rem; position: relative; border-radius: var(--r-tag, 4px); background: var(--paper, #fff6f4); box-shadow: inset 0 0 0 1px rgba(28,28,30,.08); }
        .case-lead .case-result::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: #e0301e; }
        .case-lead .case-row-val { color: var(--ink); }
        /* the two short cases sit side by side on wide screens */
        @media (min-width: 900px) {
            .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .case-grid > * { grid-column: 1 / -1; }
            .case-grid > #case-enterprise, .case-grid > #case-metadata { grid-column: auto; }
        }
