@layer reset, tokens, base, layout, components, motion, utils, responsive;

/* ============================================================ TOKENS */
@layer tokens {
  :root {
    color-scheme: light dark;

    /* palette lifted from the source photograph:
       fogged glass, cold daylight, opossum fur, cinnabar chop ink */
    --bg: #edf1f4;
    --bg-2: #ffffff;
    --bg-3: #e2eaf0;
    --ink: #0f1920;
    --ink-2: #586c7a;
    --ink-3: #8a9ca9;
    --line: #ccd8e0;
    --sky: #3f8cc4;
    --sky-soft: #c3dcee;
    --seal: #ab372a;

    --shadow-s: 0 1px 2px rgb(15 25 32 / 6%), 0 8px 24px -12px rgb(15 25 32 / 18%);
    --shadow-l: 0 2px 4px rgb(15 25 32 / 5%), 0 40px 80px -40px rgb(15 25 32 / 32%);

    --display: "Archivo", "Helvetica Neue", sans-serif;
    --body: "Newsreader", Georgia, "Times New Roman", serif;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
    --cjk: "Noto Serif SC", var(--body);

    /* fluid type scale, 1.25 ratio */
    --t--1: clamp(0.78rem, 0.75rem + 0.14vw, 0.86rem);
    --t-0: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
    --t-1: clamp(1.2rem, 1.1rem + 0.4vw, 1.44rem);
    --t-2: clamp(1.5rem, 1.3rem + 0.9vw, 2.1rem);
    --t-3: clamp(2rem, 1.5rem + 2.2vw, 3.6rem);
    --t-4: clamp(2.6rem, 1.4rem + 5.2vw, 6.4rem);

    --gut: clamp(1.25rem, 5vw, 5.5rem);
    --nav-h: 60px;
    --r-s: 10px;
    --r-m: 18px;
    --r-l: 28px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    --sp: 0; /* scroll progress 0 → 1, set from JS */
  }

  /* modern colour: one source of truth for both schemes */
  @supports (color: light-dark(white, black)) {
    :root {
      --bg: light-dark(#edf1f4, #0a1119);
      --bg-2: light-dark(#ffffff, #101a24);
      --bg-3: light-dark(#e2eaf0, #16222d);
      --ink: light-dark(#0f1920, #e6edf2);
      --ink-2: light-dark(#586c7a, #93a7b5);
      --ink-3: light-dark(#8a9ca9, #63788a);
      --line: light-dark(#ccd8e0, #223140);
      --sky: light-dark(#3f8cc4, #6fb4e6);
      --sky-soft: light-dark(#c3dcee, #1c3446);
      --seal: light-dark(#ab372a, #e0644c);
      --shadow-s: 0 1px 2px rgb(0 0 0 / 8%), 0 8px 24px -12px rgb(0 0 0 / 28%);
      --shadow-l: 0 2px 4px rgb(0 0 0 / 8%), 0 40px 80px -40px rgb(0 0 0 / 45%);
    }
  }

  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"] { color-scheme: dark; }

  /* night sections keep their own weather whatever the theme */
  .dead,
  .footer {
    color-scheme: dark;
    --bg: #0a1119;
    --bg-2: #101a24;
    --bg-3: #16222d;
    --ink: #e6edf2;
    --ink-2: #93a7b5;
    --ink-3: #63788a;
    --line: #223140;
    --sky: #6fb4e6;
    --sky-soft: #1c3446;
    --seal: #e0644c;
  }
}

/* ============================================================= RESET */
@layer reset {
  *,
  *::before,
  *::after { box-sizing: border-box; }

  * { margin: 0; }

  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 24px);
  }

  body {
    min-height: 100svh;
    overflow-x: clip;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }

  img,
  svg { display: block; max-width: 100%; height: auto; }

  button,
  input { font: inherit; color: inherit; }

  a { color: inherit; text-decoration: none; }

  ul, ol, dl { list-style: none; padding: 0; }

  :where(:focus-visible) {
    outline: 2px solid var(--sky);
    outline-offset: 3px;
    border-radius: 4px;
  }
}

/* ============================================================== BASE */
@layer base {
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--body);
    font-size: var(--t-0);
    font-optical-sizing: auto;
    line-height: 1.62;
  }

  h1, h2, h3 {
    font-family: var(--display);
    font-weight: 700;
    font-variation-settings: "wdth" 92;
    letter-spacing: -0.035em;
    line-height: 0.94;
    text-wrap: balance;
  }

  h2 { font-size: var(--t-3); }

  p { text-wrap: pretty; }

  ::selection { background: var(--sky); color: var(--bg-2); }

  :lang(zh),
  .cjk { font-family: var(--cjk); letter-spacing: 0.02em; }

  .eyebrow {
    display: flex;
    align-items: center;
    gap: 0.6em;
    margin-bottom: 1.4rem;
    font-family: var(--mono);
    font-size: var(--t--1);
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sky);
  }

  .eyebrow .cjk {
    display: grid;
    place-items: center;
    width: 2em;
    height: 2em;
    font-size: 0.95em;
    letter-spacing: 0;
    color: var(--seal);
    border: 1px solid currentColor;
    border-radius: 3px;
  }

  .fineprint {
    margin-top: 1.4rem;
    font-family: var(--mono);
    font-size: var(--t--1);
    color: var(--ink-3);
    line-height: 1.7;
  }
}

/* ============================================================ LAYOUT */
@layer layout {
  /* --- the window we are all standing at ------------------------- */
  .mullion {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0.18;
  }

  .mullion span {
    position: absolute;
    inset-block: 0;
    width: 1px;
    background: var(--line);
  }

  .mullion span:nth-child(1) { left: 26%; }
  .mullion span:nth-child(2) { left: 74%; }
  .mullion span:nth-child(3) { display: none; }

  .daylight {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }

  .daylight::before,
  .daylight::after {
    content: "";
    position: absolute;
    inset: 0;
  }

  /* morning light */
  .daylight::before {
    opacity: calc(1 - var(--sp));
    background:
      radial-gradient(120vw 80vh at 88% -12%, color-mix(in oklab, var(--sky) 22%, transparent), transparent 62%),
      radial-gradient(70vw 50vh at 2% 8%, color-mix(in oklab, var(--sky) 9%, transparent), transparent 60%);
  }

  /* dusk */
  .daylight::after {
    opacity: var(--sp);
    background:
      radial-gradient(110vw 70vh at 92% 4%, color-mix(in oklab, var(--seal) 12%, transparent), transparent 58%),
      radial-gradient(90vw 60vh at 10% 92%, color-mix(in oklab, var(--sky) 20%, transparent), transparent 62%);
  }

  .progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 60;
    height: 2px;
    pointer-events: none;
  }

  .progress i {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--sky);
    transform-origin: 0 50%;
    transform: scaleX(var(--sp));
  }

  main { position: relative; z-index: 1; }

  /* --- hero ------------------------------------------------------ */
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    align-items: center;
    min-height: 100svh;
    padding-top: calc(var(--nav-h) + 3vh);
  }

  .hero__copy {
    position: relative;
    z-index: 2;
    padding: 4vh var(--gut) 6vh;
    max-width: 44rem;
  }

  .hero__media {
    position: relative;
    align-self: stretch;
    margin: 0;
  }

  .hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 56% 44%;
    -webkit-mask-image: linear-gradient(to left, #000 72%, transparent 99%);
    mask-image: linear-gradient(to left, #000 72%, transparent 99%);
  }

  /* --- chapters: the image holds still, you move ----------------- */
  .chapter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--bg-2);
    border-block-start: 1px solid var(--line);
  }

  .chapter--flip .chapter__media { order: 2; }

  .chapter__media {
    position: sticky;
    top: 0;
    height: 100svh;
    overflow: clip;
  }

  .chapter__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .chapter__body {
    display: grid;
    align-content: center;
    gap: 1.1rem;
    min-height: 100svh;
    padding: 12vh var(--gut);
    font-size: var(--t-1);
    color: var(--ink-2);
  }

  .chapter__body h2 { color: var(--ink); margin-bottom: 0.4rem; }

  /* --- cz -------------------------------------------------------- */
  .cz {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: clamp(2rem, 6vw, 6rem);
    align-items: center;
    padding: clamp(5rem, 14vh, 10rem) var(--gut);
    background: var(--bg-3);
    border-block: 1px solid var(--line);
  }

  .cz__copy { max-width: 34rem; font-size: var(--t-1); color: var(--ink-2); }
  .cz__copy h2 { color: var(--ink); margin-bottom: 1rem; }

  /* --- memes ----------------------------------------------------- */
  .memes {
    padding: clamp(5rem, 12vh, 9rem) 0;
    background: var(--bg-2);
    border-block-end: 1px solid var(--line);
  }

  .memes__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 5vw, 5rem);
    align-items: end;
    padding-inline: var(--gut);
    margin-bottom: clamp(2rem, 5vh, 3.5rem);
  }

  .memes__head p { color: var(--ink-2); max-width: 36rem; }

  /* --- play dead ------------------------------------------------- */
  .dead {
    background: var(--bg);
    color: var(--ink);
    padding: clamp(5rem, 14vh, 10rem) var(--gut);
  }

  .dead__intro { max-width: 42rem; margin-bottom: clamp(2.5rem, 6vh, 4rem); }
  .dead__intro h2 { margin-bottom: 1.4rem; }
  .dead__intro p { color: var(--ink-2); font-size: var(--t-1); }

  /* --- outside --------------------------------------------------- */
  .outside {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 6vw, 6rem);
    padding: clamp(5rem, 14vh, 10rem) var(--gut);
    background: var(--bg-2);
  }

  .outside__copy { max-width: 34rem; }
  .outside__copy h2 { margin-bottom: 1.2rem; }
  .outside__copy p { color: var(--ink-2); font-size: var(--t-1); }

  /* --- footer ---------------------------------------------------- */
  .footer {
    background: var(--bg-2);
    color: var(--ink);
    padding: clamp(2.5rem, 6vh, 4rem) var(--gut) clamp(2rem, 5vh, 3rem);
  }

  .footer__top {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.6rem;
    border-bottom: 1px solid var(--line);
  }

  .footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    font-family: var(--mono);
    font-size: var(--t--1);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .footer__links a { color: var(--ink-2); transition: color 0.2s; }
  .footer__links a:hover { color: var(--sky); }

  .footer__legal {
    max-width: 46rem;
    margin-top: 1.6rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.8;
    color: var(--ink-3);
  }
}

/* ======================================================== COMPONENTS */
@layer components {
  /* --- nav ------------------------------------------------------- */
  .nav {
    position: fixed;
    z-index: 50;
    top: 12px;
    left: 50%;
    translate: -50% 0;
    width: min(1160px, calc(100% - 20px));
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 8px 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in oklab, var(--bg-2) 72%, transparent);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    transition: box-shadow 0.4s var(--ease), background 0.4s var(--ease),
      top 0.4s var(--ease);
  }

  .nav.is-stuck {
    top: 8px;
    background: color-mix(in oklab, var(--bg-2) 88%, transparent);
    box-shadow: var(--shadow-s);
  }

  .brand {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: #16222d;
  }

  .brand img { height: 20px; width: auto; }

  .brand--footer { background: color-mix(in oklab, var(--sky) 22%, transparent); }

  .nav__links {
    display: flex;
    gap: 2px;
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .nav__links a {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 9px 13px;
    border-radius: 999px;
    color: var(--ink-2);
    transition: color 0.2s, background 0.2s;
  }

  .nav__links a .cjk { color: var(--ink-3); transition: color 0.2s; }
  .nav__links a:hover { color: var(--ink); background: var(--bg-3); }
  .nav__links a.is-active { color: var(--ink); }
  .nav__links a.is-active .cjk { color: var(--seal); }

  .nav__end { display: flex; align-items: center; gap: 6px; }

  .icon-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
  }

  .icon-btn:hover { background: var(--bg-3); }

  .icon-btn__sun {
    position: relative;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--ink-2);
    transition: box-shadow 0.3s var(--ease), background 0.3s;
  }

  /* crescent when dark is active */
  :root[data-theme="dark"] .icon-btn__sun,
  :root:not([data-theme="light"]) .icon-btn__sun {
    box-shadow: inset -4px -2px 0 0 var(--bg-2);
  }

  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .icon-btn__sun { box-shadow: none; }
  }

  :root[data-theme="light"] .icon-btn__sun { box-shadow: none; }

  .nav__toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
  }

  .nav__toggle span {
    display: block;
    width: 15px;
    height: 1.5px;
    margin: 4px auto;
    background: var(--ink);
    transition: transform 0.3s var(--ease), opacity 0.2s;
  }

  .nav.is-open .nav__toggle span:first-child { transform: translateY(2.75px) rotate(45deg); }
  .nav.is-open .nav__toggle span:last-child { transform: translateY(-2.75px) rotate(-45deg); }

  /* --- buttons --------------------------------------------------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.25s var(--ease), background 0.25s, color 0.25s,
      border-color 0.25s;
  }

  .btn--solid { background: var(--ink); color: var(--bg-2); }
  .btn--solid:hover { background: var(--sky); color: #fff; }

  .btn--quiet { border-color: var(--line); color: var(--ink-2); }
  .btn--quiet:hover { border-color: var(--ink); color: var(--ink); }

  .btn:active { transform: translateY(1px); }

  .nav__cta { min-height: 40px; padding: 0 18px; font-size: 0.76rem; }

  /* --- hero bits ------------------------------------------------- */
  .kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.7em;
    margin-bottom: 1.6rem;
    padding: 6px 14px 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in oklab, var(--bg-2) 70%, transparent);
    font-family: var(--mono);
    font-size: var(--t--1);
    letter-spacing: 0.1em;
    color: var(--ink-2);
  }

  .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sky);
  }

  .hero__logo { margin-bottom: 1.5rem; }

  .hero__logo img {
    width: min(320px, 66vw);
    filter: drop-shadow(0 3px 5px rgb(0 0 0 / 32%));
  }

  .hero__title {
    font-family: var(--display);
    font-size: clamp(1.9rem, 4.2vw, 3.3rem);
    font-weight: 700;
    font-variation-settings: "wdth" 88;
    letter-spacing: -0.035em;
    line-height: 0.98;
    margin-bottom: 1.5rem;
    text-wrap: balance;
  }

  .hero__title em {
    display: block;
    font-style: normal;
    font-weight: 400;
    font-variation-settings: "wdth" 106;
    color: var(--ink-3);
  }

  .lede {
    max-width: 33rem;
    margin-bottom: 1.7rem;
    font-size: var(--t-1);
    color: var(--ink-2);
  }

  .hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1.6rem;
  }

  .ca {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(440px, 100%);
    padding: 7px 7px 7px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in oklab, var(--bg-2) 78%, transparent);
    backdrop-filter: blur(8px);
  }

  .ca__label {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    color: var(--ink-3);
  }

  .ca code {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--mono);
    font-size: 0.82rem;
  }

  .ca__copy {
    flex: none;
    padding: 9px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg-2);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
  }

  .ca__copy:hover { background: var(--sky); color: #fff; }
  .ca__copy.is-done { background: var(--sky); color: #fff; }

  .clock {
    display: flex;
    align-items: center;
    gap: 0.6em;
    margin-top: 1.2rem;
    font-family: var(--mono);
    font-size: var(--t--1);
    letter-spacing: 0.06em;
    color: var(--ink-3);
  }

  .clock time { color: var(--ink); font-variant-numeric: tabular-nums; }

  .clock__led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--seal);
    animation: pulse 4s ease-in-out infinite;
  }

  .tag {
    position: absolute;
    right: clamp(1rem, 3vw, 3rem);
    bottom: clamp(1.5rem, 6vh, 4rem);
    padding: 10px 16px;
    border: 1px solid color-mix(in oklab, #fff 40%, transparent);
    border-radius: 999px;
    background: rgb(10 17 25 / 45%);
    backdrop-filter: blur(10px);
    color: #fff;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  .seal {
    position: absolute;
    left: clamp(1rem, 3vw, 2.5rem);
    bottom: clamp(1.5rem, 6vh, 4rem);
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 2px solid var(--seal);
    border-radius: 6px;
    background: color-mix(in oklab, var(--seal) 12%, transparent);
    backdrop-filter: blur(4px);
    color: var(--seal);
    font-family: var(--cjk);
    font-size: 1.5rem;
    font-weight: 600;
    rotate: -8deg;
  }

  /* --- marquee band ---------------------------------------------- */
  .band {
    overflow: hidden;
    padding: 18px 0;
    border-block: 1px solid var(--line);
    background: var(--bg-3);
    user-select: none;
  }

  .band__track {
    display: flex;
    width: max-content;
    animation: drift 90s linear infinite;
  }

  .band__track span {
    padding-right: 2rem;
    font-family: var(--display);
    font-size: clamp(1.1rem, 2.4vw, 1.9rem);
    font-weight: 500;
    font-variation-settings: "wdth" 112;
    letter-spacing: -0.01em;
    color: var(--ink-2);
    white-space: nowrap;
  }

  .band__track i { font-style: normal; color: var(--sky); }

  /* --- chapter extras -------------------------------------------- */
  .pull {
    margin-top: 0.8rem;
    padding-left: 1.2rem;
    border-left: 2px solid var(--seal);
    font-family: var(--display);
    font-size: var(--t-2);
    font-weight: 500;
    font-variation-settings: "wdth" 96;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink);
  }

  .lies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0.6rem 0;
  }

  .lies li {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    font-size: 0.92rem;
    color: var(--ink-2);
    transition: border-color 0.25s, color 0.25s;
  }

  .lies li:hover { border-color: var(--seal); color: var(--ink); }

  /* --- cz shot ---------------------------------------------------- */
  .cz__shot {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-l);
    background: var(--bg-2);
    box-shadow: var(--shadow-l);
    rotate: 1.4deg;
    transition: rotate 0.6s var(--ease);
  }

  .cz__shot:hover { rotate: 0deg; }

  .cz__shot img {
    width: 100%;
    height: auto;
    border-radius: var(--r-m);
  }

  /* --- runway ----------------------------------------------------- */
  .runway__wrap { position: relative; }

  .runway {
    display: flex;
    gap: 16px;
    padding-inline: var(--gut);
    padding-bottom: 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    cursor: grab;
  }

  .runway::-webkit-scrollbar { display: none; }
  .runway.is-dragging { cursor: grabbing; scroll-snap-type: none; }

  .runway figure {
    flex: 0 0 clamp(215px, 23vw, 310px);
    margin: 0;
    scroll-snap-align: center;
  }

  .runway button {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-m);
    background: none;
    overflow: hidden;
    cursor: zoom-in;
  }

  .runway img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    transition: scale 0.7s var(--ease), filter 0.7s var(--ease);
    filter: saturate(0.82);
  }

  .runway button:hover img,
  .runway button:focus-visible img { scale: 1.05; filter: saturate(1); }

  .runway figcaption {
    margin-top: 12px;
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    color: var(--ink-3);
  }

  .runway__ui {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 26px var(--gut) 0;
  }

  .round {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
  }

  .round:hover { background: var(--ink); color: var(--bg-2); border-color: var(--ink); }

  .rail {
    flex: 1;
    height: 1px;
    background: var(--line);
  }

  .rail i {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--sky);
    transform-origin: 0 50%;
    transform: scaleX(var(--rail, 0.1));
    transition: transform 0.15s linear;
  }

  /* --- vitals: the signature ------------------------------------- */
  .vitals {
    padding: clamp(1.5rem, 4vw, 2.4rem);
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-l);
    background: var(--bg-2);
  }

  .vitals__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    font-family: var(--mono);
    font-size: var(--t--1);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
  }

  .vitals__bpm { color: var(--ink-2); }

  .vitals__bpm b {
    font-family: var(--display);
    font-size: var(--t-2);
    font-weight: 700;
    font-variation-settings: "wdth" 85;
    letter-spacing: -0.02em;
    color: var(--sky);
    font-variant-numeric: tabular-nums;
    transition: color 0.8s;
  }

  .vitals.is-flat .vitals__bpm b { color: var(--seal); }

  .vitals__svg {
    width: 100%;
    height: clamp(88px, 11vw, 140px);
    margin: 0.6rem 0 0.4rem;
    overflow: hidden;
  }

  .vitals__svg path {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
  }

  .vitals__sweep { animation: sweep 1.15s linear infinite; }

  .vitals__beat {
    stroke: var(--sky);
    transition: opacity 1s var(--ease);
  }

  .vitals__flat {
    stroke: var(--seal);
    stroke-dasharray: 1200 1200;
    stroke-dashoffset: 1200;
    opacity: 0;
  }

  .vitals.is-flat .vitals__beat { opacity: 0; }
  .vitals.is-flat .vitals__sweep { animation-play-state: paused; }

  .vitals.is-flat .vitals__flat {
    opacity: 1;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.1s var(--ease) 0.15s, opacity 0.3s;
  }

  .vitals__note {
    font-family: var(--mono);
    font-size: var(--t--1);
    color: var(--ink-3);
  }

  /* --- bento ------------------------------------------------------ */
  .bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .tile {
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 148px;
    padding: clamp(1.1rem, 2.4vw, 1.6rem);
    border: 1px solid var(--line);
    border-radius: var(--r-l);
    background: var(--bg-2);
    transition: border-color 0.3s, background 0.3s;
  }

  .tile:hover { border-color: color-mix(in oklab, var(--sky) 55%, var(--line)); }

  .tile dt {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-3);
  }

  .tile dd {
    margin: auto 0 0;
    font-family: var(--display);
    font-size: var(--t-2);
    font-weight: 700;
    font-variation-settings: "wdth" 88;
    letter-spacing: -0.03em;
  }

  .tile p {
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.7;
    color: var(--ink-3);
  }

  .tile--hero {
    grid-column: span 2;
    grid-row: span 2;
    justify-content: flex-end;
    min-height: 260px;
    background: linear-gradient(160deg, var(--bg-3), var(--bg-2));
  }

  .tile__ticker {
    font-family: var(--cjk);
    font-size: clamp(1.8rem, 7cqi, 3.4rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: var(--ink);
  }

  .tile__none { color: var(--ink-3); }

  /* --- link rows -------------------------------------------------- */
  .rows { display: grid; align-content: center; }

  .rows a {
    display: flex;
    align-items: baseline;
    gap: 1.2rem;
    padding: clamp(1rem, 2.6vh, 1.8rem) 0;
    border-top: 1px solid var(--line);
    font-family: var(--display);
    font-size: var(--t-3);
    font-weight: 700;
    font-variation-settings: "wdth" 90;
    letter-spacing: -0.035em;
    transition: color 0.3s, padding-left 0.4s var(--ease);
  }

  .rows a:last-child { border-bottom: 1px solid var(--line); }

  .rows a small {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.74rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--ink-3);
  }

  .rows a::after {
    content: "→";
    font-size: 0.6em;
    color: var(--sky);
    transition: translate 0.4s var(--ease);
  }

  .rows a:hover { color: var(--sky); padding-left: 0.6rem; }
  .rows a:hover::after { translate: 6px 0; }

  /* --- lightbox ---------------------------------------------------- */
  .lightbox {
    /* the global margin reset kills the UA's centring, so restore it */
    margin: auto;
    width: fit-content;
    max-width: min(92vw, 720px);
    max-height: 90svh;
    padding: 0;
    border: 0;
    border-radius: var(--r-l);
    background: transparent;
    overflow: visible;
  }

  .lightbox::backdrop {
    background: rgb(6 12 18 / 82%);
    backdrop-filter: blur(6px);
  }

  .lightbox img {
    display: block;
    width: auto;
    max-width: min(92vw, 720px);
    max-height: 90svh;
    border-radius: var(--r-l);
  }

  .lightbox__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border: 1px solid color-mix(in oklab, #fff 35%, transparent);
    border-radius: 999px;
    background: rgb(10 17 25 / 60%);
    backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
  }

  .lightbox__close:hover { background: rgb(10 17 25 / 88%); }
}

/* ============================================================ MOTION */
@layer motion {
  @keyframes drift {
    to { transform: translateX(-50%); }
  }

  @keyframes sweep {
    from { transform: translateX(0); }
    to { transform: translateX(120px); }
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
  }

  [data-reveal] {
    opacity: 0;
    translate: 0 18px;
    transition: opacity 0.8s var(--ease), translate 0.8s var(--ease);
    transition-delay: var(--d, 0ms);
  }

  [data-reveal].is-in { opacity: 1; translate: 0 0; }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }

    [data-reveal] { opacity: 1; translate: none; }
    .vitals__flat { opacity: 1; stroke-dashoffset: 0; }
  }
}

/* ============================================================= UTILS */
@layer utils {
  .skip {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg-2);
    font-family: var(--mono);
    font-size: 0.8rem;
    translate: 0 -160%;
    transition: translate 0.25s var(--ease);
  }

  .skip:focus-visible { translate: 0 0; }
}

/* ======================================================= RESPONSIVE */
@layer responsive {
  @media (max-width: 1080px) {
    :root { --nav-h: 56px; }

    .nav__links {
      position: absolute;
      top: calc(100% + 10px);
      left: 0;
      right: 0;
      display: none;
      flex-direction: column;
      gap: 2px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 24px;
      background: color-mix(in oklab, var(--bg-2) 94%, transparent);
      backdrop-filter: blur(20px);
      box-shadow: var(--shadow-l);
      font-size: 0.86rem;
    }

    .nav.is-open .nav__links { display: flex; }
    .nav__links a { padding: 13px 16px; }
    .nav__toggle { display: block; }
    .nav__cta { display: none; }

    .mullion span:nth-child(1) { left: 18%; }
    .mullion span:nth-child(2) { left: 82%; }

    .hero {
      display: flex;
      flex-direction: column;
      min-height: 0;
      padding-top: calc(var(--nav-h) + 18px);
    }

    .hero__media {
      order: -1;
      width: 100%;
      height: 46svh;
      min-height: 260px;
    }

    .hero__media img {
      -webkit-mask-image: linear-gradient(to bottom, #000 74%, transparent 99%);
      mask-image: linear-gradient(to bottom, #000 74%, transparent 99%);
    }

    .hero__copy { max-width: none; padding-top: 2.4rem; }
    .seal { bottom: 26%; }

    .chapter,
    .chapter--flip { grid-template-columns: 1fr; }
    .chapter--flip .chapter__media { order: 0; }

    .chapter__media { position: relative; height: 52svh; }

    .chapter__body {
      min-height: 0;
      padding-block: clamp(2.5rem, 8vh, 4.5rem);
      font-size: var(--t-0);
    }

    .cz,
    .outside { grid-template-columns: 1fr; }

    .cz__shot { rotate: 0deg; max-width: 30rem; }

    .memes__head { grid-template-columns: 1fr; gap: 1.2rem; }

    .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tile--hero { grid-column: span 2; grid-row: auto; min-height: 210px; }
  }

  @media (max-width: 560px) {
    .hero__actions { flex-direction: column; align-items: stretch; }
    .hero__actions .btn { width: 100%; }

    .ca {
      flex-wrap: wrap;
      border-radius: var(--r-m);
      padding: 12px;
      gap: 8px;
    }

    .ca code { flex: 1 0 100%; white-space: normal; word-break: break-all; }
    .ca__copy { width: 100%; }

    .tag { display: none; }
    .bento { grid-template-columns: 1fr; }
    .tile--hero { grid-column: auto; }
    .rows a { flex-wrap: wrap; gap: 0.4rem 0.8rem; }
    .rows a small { margin-left: 0; flex: 1 0 100%; }
  }
}

/* silky same-document navigation where supported */
@view-transition { navigation: auto; }
