  /* Pangram Pangram's personal-use weight, self-hosted so the opening
     statement reads the same for everyone, not just people who own it */
  @font-face {
    font-family: "Migra";
    src: url("fonts/Migra-Extralight.woff2") format("woff2");
    font-weight: 200;
    font-style: normal;
    font-display: swap;
  }

  :root {
    color-scheme: dark;

    /* ---- palette (dark) ---- */
    --paper: #080c0b;     /* page background — near-black */
    --ink: #ffffff;       /* labels, links */
    --lede: #dddddd;      /* the opening statement */
    --soft: #b5b5b5;      /* body prose */
    --muted: #7a7a7a;     /* colophon, quiet furniture — 4.5:1, quiet but legible */
    --rule: #1e2221;      /* hairlines */
    --hover: #7b3dff;     /* link hover at body sizes — electric violet */
    --hover-small: #9a6dff; /* hover for 12px text — same violet, lifted to 4.5:1 */
    --underline: #5f6663; /* resting link underlines */
    --selection: #26302d; /* text selection */
    --accent: #c98f54;    /* the crayon chrome — soft brass */
    --display: "Migra", "Iowan Old Style", Georgia, serif;
    --text: "Geist", ui-sans-serif, system-ui, sans-serif;
    --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

    /* ---- type scale: four styles, redefine here ----
       Fixed, never fluid. The column holds these sizes at every width it
       fits in; below --column-fits it steps down once, in the media query
       at the foot of this file. Nothing scales with the viewport. */
    --type-hero: 46px;    /* the opening statement */
    --type-title: 27px;   /* "uh oh", case-study headings */
    --type-lede: 21px;    /* clean-up button, crayon box, case-study subline */
    --type-body: 24px;    /* all prose */
    --type-label: 12px;   /* questions, footer links, colophon */

    /* ---- rhythm ---- */
    --gap-section: 200px; /* between the opening and each Q&A */
    --gap-answer: 52px;   /* question → its answer */
    --gap-para: 30px;     /* between paragraphs of one answer */

    /* ---- the column ---- */
    --column: 516px;      /* the measure, straight from the mock */
    --gutter: 30px;

    /* ---- motion ---- */
    --ease-ui: cubic-bezier(0.2, 0, 0, 1); /* the one UI curve — hover, press, fades */
    --dur-hover: .18s;    /* link / color / opacity transitions */
    --dur-fast:  .12s;    /* press feedback */
  }

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

  html, body {
    overflow-x: hidden;
    overflow-x: clip;
  }

  html { scrollbar-gutter: stable; }

  body {
    position: relative;
    background: var(--paper);
    color: var(--soft);
    font-family: var(--text);
    font-size: var(--type-body);
    line-height: 1.25;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  ::selection { background: var(--selection); }

  /* ---------- layout ---------- */

  .page {
    max-width: calc(var(--column) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 104px var(--gutter) 128px;
  }
  /* the home page is one long column of questions; case pages are not */
  .page.home {
    display: flex;
    flex-direction: column;
    padding-bottom: 240px;
    gap: var(--gap-section);
  }

  /* scroll-driven reveal — every value comes from the REVEAL storyboard
     object in the script; these custom properties are injected from it */
  .reveal-item {
    opacity: 0;
    transform: translateY(var(--rv-y, 18px));
    filter: blur(var(--rv-blur, 3px));
  }
  .reveal-item.revealed {
    opacity: 1;
    transform: none;
    filter: none;
    transition: opacity   var(--rv-dur, 650ms) var(--rv-ease, ease),
                transform var(--rv-dur, 650ms) var(--rv-ease, ease),
                filter    var(--rv-dur, 650ms) var(--rv-ease, ease);
  }

  /* ---------- the opening statement ---------- */

  .lede {
    font-family: var(--display);
    font-weight: 200;
    font-size: var(--type-hero);
    line-height: 1.22;
    letter-spacing: -0.01em;
    color: var(--lede);
    text-wrap: balance;
  }

  /* ---------- link hit areas ----------
     8px of reach on every side, as an overlay rather than real padding —
     padding would shove the footer gaps apart and drop the underlines away
     from the text. Nothing here changes what you see, only what you can hit. */

  .answer a, .ok, footer a, .site a, .study-next a { position: relative; }
  .answer a::after,
  .ok::after,
  footer a::after,
  .site a::after,
  .study-next a::after {
    content: "";
    position: absolute;
    inset: -8px;
  }

  /* ---------- question & answer ---------- */

  .qa {
    display: flex;
    flex-direction: column;
    gap: var(--gap-answer);
  }

  /* every question, footer link and the "ok..." button share one voice */
  .label {
    font-family: var(--mono);
    font-size: var(--type-label);
    font-weight: 400;
    line-height: 16px;
    letter-spacing: .06em; /* small caps need air between the letterforms */
    text-transform: uppercase;
    color: var(--ink);
  }

  .answer {
    display: flex;
    flex-direction: column;
    gap: var(--gap-para);
  }
  /* Q2's answer is one sentence split across paragraphs — half the usual
     gap so it reads as a single run, not independent thoughts */
  .answer-tight { gap: 14px; }

  .answer p {
    font-size: var(--type-body);
    line-height: 1.35;
    color: var(--soft);
    text-wrap: pretty;
  }

  .answer a {
    color: var(--lede);
    text-decoration: underline;
    text-decoration-color: var(--underline);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    text-decoration-skip-ink: auto;
    transition: color .25s ease, text-decoration-color .25s ease;
  }
  .answer a:hover { color: var(--hover); text-decoration-color: var(--hover); }

  /* ---------- "ok..." — the way in to the crayons ---------- */

  .ok {
    align-self: flex-start;
    margin-top: 22px;
    background: none;
    border: 0;
    padding: 0 0 3px;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    cursor: pointer;
    transition: color .25s ease, text-decoration-color .25s ease;
  }
  .ok:hover, .ok:focus-visible { color: var(--hover-small); text-decoration-color: var(--hover-small); }
  .ok:focus-visible { outline: none; }
  body.toddler .ok { visibility: hidden; } /* the crayons are already out */

  /* one dot out at a time, the gap marching left to right — each dot comes
     back at the exact moment the next one goes. steps(1, end) is what keeps
     this 8-bit: every dot is either on or off, with nothing in between. */
  .ok .dots span { opacity: 1; }
  .ok:hover .dots span,
  .ok:focus-visible .dots span {
    animation-duration: 1.8s;
    animation-timing-function: steps(1, end);
    animation-iteration-count: infinite;
  }
  .ok:hover .dots span:nth-child(1),
  .ok:focus-visible .dots span:nth-child(1) { animation-name: okdot1; }
  .ok:hover .dots span:nth-child(2),
  .ok:focus-visible .dots span:nth-child(2) { animation-name: okdot2; }
  .ok:hover .dots span:nth-child(3),
  .ok:focus-visible .dots span:nth-child(3) { animation-name: okdot3; }

  @keyframes okdot1 { 0% { opacity: 0; } 33.333% { opacity: 1; } }
  @keyframes okdot2 { 0% { opacity: 1; } 33.333% { opacity: 0; } 66.667% { opacity: 1; } }
  @keyframes okdot3 { 0% { opacity: 1; } 66.667% { opacity: 0; } }

  /* ---------- footer ---------- */

  footer .links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }
  footer a {
    font-family: var(--mono);
    font-size: var(--type-label);
    line-height: 16px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
    transition: color var(--dur-hover) var(--ease-ui), border-color var(--dur-hover) var(--ease-ui), opacity var(--dur-fast) var(--ease-ui);
  }
  footer a:hover { color: var(--hover-small); border-color: var(--hover-small); }
  /* once copied it's no longer a link — plain success text with one gentle pop */
  @keyframes copy-pop {
    0%   { transform: scale(.96); }
    60%  { transform: scale(1.02); }
    100% { transform: scale(1); }
  }
  #email-copy.copied {
    color: var(--ink);
    border-bottom-color: transparent;
    pointer-events: none;
    cursor: default;
    display: inline-block;
    transform-origin: center;
    animation: copy-pop .26s cubic-bezier(.3, 1.6, .5, 1);
  }
  #email-copy.copied::after { content: none; }
  @media (prefers-reduced-motion: reduce) {
    #email-copy.copied { animation: none; }
  }
  footer .colophon {
    font-family: var(--mono);
    font-size: var(--type-label);
    line-height: 16px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
  }

  /* ---------- paper grain ---------- */

  .grain {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
    opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  /* ---------- the toddler ---------- */

  #crayon {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 50;
    pointer-events: none;
    /* wax sits opaque and bright on dark paper — no blend mode */
  }

  #waxcrayon {
    /* the WebGL crayon layer — same paper, one sheet up */
    position: absolute;
    top: 0;
    left: 0;
    z-index: 51;
    pointer-events: none;
  }

  body.toddler, body.toddler * {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><g transform='rotate(40 16 16)'><polygon points='16 31 13.1 24 18.9 24' fill='%23b62f24'/><rect x='13.1' y='6.5' width='5.8' height='18' rx='1.4' fill='%23d8463a'/><rect x='13.1' y='10.6' width='5.8' height='2.7' fill='%23a32a20'/><rect x='13.1' y='19.4' width='5.8' height='2.7' fill='%23a32a20'/></g></svg>") 6 27, crosshair !important;
  }

  /* Touch: while the toddler is out, the page is frozen so a finger only draws
     (toddler.js also preventDefaults touchmove). Lifted when "Clean up" runs. */
  html.toddler-lock, body.toddler-lock {
    touch-action: none;
    overscroll-behavior: none;
  }

  /* the cursor heist: while the blast has the crayon, the real pointer hides
     and #fakecursor tumbles in its place (toddler.js flings it home again) */
  body.cursor-flung, body.cursor-flung * { cursor: none !important; }
  #fakecursor {
    position: fixed;
    left: 0;
    top: 0;
    margin: -27px 0 0 -6px;     /* the crayon tip sits where the hotspot was */
    transform-origin: 6px 27px; /* and it tumbles around that tip */
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    will-change: transform;
    transition: opacity .12s ease-out;
  }
  #fakecursor.show { opacity: 1; }

  /* the bouncy ball — arrives with the burst, bounces through, leaves */
  #bouncyball {
    position: fixed;
    left: 0;
    top: 0;
    width: 120px;
    height: 120px;
    z-index: 150;
    pointer-events: none;
    will-change: transform;
    display: none;
    filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45));
  }
  #bouncyball.show { display: block; }

  /* monster-truck stickers, slapped down mid-scribble */
  .sticker {
    position: absolute;
    height: auto;
    z-index: 60;
    pointer-events: none;
    opacity: 0;
    transform: rotate(var(--tilt, 0deg)) scale(1.3);
    transition: opacity .16s ease-out, transform .16s cubic-bezier(.2, .7, .3, 1);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .4));
    will-change: transform;
  }
  .sticker.stuck { opacity: 1; transform: rotate(var(--tilt, 0deg)) scale(1); }
  .sticker.peeling {
    opacity: 0;
    transform: rotate(var(--tilt, 0deg)) scale(.9);
    transition: opacity .45s ease, transform .45s ease;
  }

  [data-push] { will-change: auto; }
  body.toddler [data-push] { will-change: transform; transition: none !important; }
  .cleaning { transition: transform .85s cubic-bezier(.32, 1.45, .46, 1) !important; }

  #cleanup {
    position: fixed;
    right: 28px;
    bottom: 30px;
    z-index: 100;
    transform: translateY(14px) scale(.85);
    opacity: 0;
    pointer-events: none;
    background: var(--ink);
    color: var(--paper);
    border: 0;
    border-radius: 999px;
    padding: 14px 26px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: var(--type-label);
    line-height: 16px;
    font-weight: 400;
    letter-spacing: .06em;
    text-transform: uppercase;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
    transition: opacity .45s ease, transform .45s cubic-bezier(.3, 1.6, .5, 1),
                background-color .2s ease-out;
  }
  #cleanup.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
  #cleanup:hover { background: var(--hover-small); }
  #cleanup .cleanup-emoji {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
    margin: -4px 0; /* let the emoji sit taller than the label without growing the pill */
  }

  /* ---------- toddler dials (tuning panel — press D) ---------- */

  .dk-panel {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 300;
    width: 252px;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    background: rgba(18, 15, 9, .94);
    border: 1px solid var(--rule);
    border-radius: 12px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
    font: 11.5px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
    color: var(--soft);
    user-select: none;
  }
  .dk-panel.hidden { display: none; }
  .dk-panel .dk-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    color: var(--ink);
    border-bottom: 1px solid var(--rule);
    letter-spacing: .08em;
  }
  .dk-panel .dk-head kbd { color: var(--muted); }
  .dk-panel .dk-folder { padding: 9px 14px 4px; border-bottom: 1px solid var(--rule); }
  .dk-panel .dk-folder h5 {
    margin: 0 0 7px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .dk-panel .dk-row {
    display: grid;
    grid-template-columns: 84px 1fr 40px;
    gap: 8px;
    align-items: center;
    margin-bottom: 7px;
  }
  .dk-panel .dk-row output { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
  .dk-panel .dk-row-select { grid-template-columns: 84px 1fr; }
  .dk-panel select {
    width: 100%;
    background: #262013;
    color: var(--ink);
    border: 1px solid var(--rule);
    border-radius: 6px;
    font: inherit;
    padding: 3px 4px;
  }
  .dk-panel input[type="range"] {
    width: 100%;
    height: 3px;
    appearance: none;
    -webkit-appearance: none;
    background: #3a3322;
    border-radius: 2px;
    outline: none;
  }
  .dk-panel input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
  }
  .dk-panel input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
  }
  .dk-panel .dk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px 12px;
  }
  .dk-panel .dk-actions button {
    flex: 1 1 calc(50% - 6px);
    background: #262013;
    color: var(--ink);
    border: 1px solid var(--rule);
    border-radius: 7px;
    padding: 6px 0;
    font: inherit;
    letter-spacing: .04em;
    cursor: pointer;
  }
  .dk-panel .dk-actions button:hover { border-color: var(--accent); color: var(--accent); }
  .dk-panel .od-read {
    padding: 2px 0 8px;
    color: var(--ink);
    letter-spacing: .06em;
    font-variant-numeric: tabular-nums;
  }
  .dk-panel input[type="checkbox"] { accent-color: var(--hover); justify-self: start; }
  body.toddler .dk-panel, body.toddler .dk-panel * { cursor: default !important; }
  body.toddler .dk-panel input[type="range"], body.toddler .dk-panel button { cursor: pointer !important; }

  /* 576px is exactly where the 516px column plus its gutters stops fitting.
     Above it nothing moves; at it everything steps down once and then holds
     again, the column filling whatever width is left. */
  @media (max-width: 576px) {
    :root {
      --type-hero: 30px;
      --type-body: 18px;
      --gap-section: 56px;
      --gap-answer: 34px;
      --gap-para: 24px;
      --gutter: 24px;
    }
    .page { padding-top: 72px; padding-bottom: 112px; }
    .page.home { padding-bottom: 180px; }
    .answer-tight { gap: 12px; }
    /* one question-and-answer per screen: each set fills the viewport and
       centres, so you focus on a single Q&A at a time and scroll to the next */
    .page.home .qa {
      min-height: 100svh;
      justify-content: center;
    }
    /* the cleanup pill spans the bottom, centred, on mobile */
    #cleanup {
      left: 24px;
      right: 24px;
      width: auto;
      text-align: center;
    }
    /* reserve two lines so the copy confirmation can wrap without shoving the
       links below it (32px = 2 × the footer link's 16px line-height) */
    #email-copy {
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      min-height: 32px;
    }
  }

  /* 350px is where "principal product designer" at 30px stops fitting on one
     line — below that the hard breaks fight the natural wrap and orphan a
     word, so the lede lets go of its 3-line composition and wraps free. */
  @media (max-width: 349px) {
    .lede br { display: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    .reveal-item { opacity: 1 !important; transform: none !important; filter: none !important; }
    .ok .dots span { animation: none !important; opacity: 1 !important; }
    * { transition-duration: .01s !important; }
  }

  /* ---------- case study pages ----------
     The dark editorial layout from the Paper "layout-template": sticky mono
     sidebar + 800px article column. Pages opt in with <body class="case">.
     Three tokens re-tune for the case mood; everything else is shared. */

  body.case {
    --paper: #090b0b;
    --muted: #7a7a7a;   /* quiet but legible — 4.6:1 on this bg (was #5a5a5a, 2.86:1) */
    --rule: #2a2f2e;
    display: flex;
    align-items: flex-start;
    gap: 96px;
    padding: 104px 192px 104px 48px;
    color: var(--soft);
    /* allow italic (<em>) to synthesize — Geist ships no italic face — while
       still refusing faux-bold so Migra Extralight is never fattened */
    font-synthesis: style;
    -moz-osx-font-smoothing: grayscale;
  }
  body.case a { color: inherit; text-decoration: none; }

  body.case .mono {
    font-family: var(--mono);
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  /* ---- sidebar ---- */
  body.case .side {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 104px;
    display: flex;
    flex-direction: column;
    gap: 32px;
  }
  body.case .side .name { color: var(--ink); padding-left: 13px; display: block; position: relative; }
  body.case .side .name .name-label,
  body.case .side .name .name-hover { transition: opacity var(--dur-hover) var(--ease-ui); }
  body.case .side .name .name-hover {
    position: absolute;
    left: 0;
    top: 0;
    color: var(--muted);
    opacity: 0;
  }
  body.case .side .name .name-hover .arrow { display: inline-block; width: 13px; }
  body.case .side .name:focus-visible .name-label { opacity: 0; }
  body.case .side .name:focus-visible .name-hover { opacity: 1; }
  body.case .side nav { display: flex; flex-direction: column; gap: 12px; }
  body.case .side nav a {
    color: var(--muted);
    padding-left: 13px;
    position: relative;
    display: block;
    width: fit-content;
    transition: color var(--dur-hover) var(--ease-ui);
  }
  body.case .side nav a[aria-current="page"] { color: var(--ink); }
  body.case .side nav a[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ink);
  }

  /* ---- main column ---- */
  body.case .study {
    width: 800px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 40px;
  }
  body.case .study-head { display: flex; flex-direction: column; gap: 16px; }
  body.case .study-head .kicker { color: var(--muted); }
  body.case .study-head h1 {
    margin: 0;
    font-family: var(--display);
    font-weight: 200;
    font-size: 46px;
    line-height: 56px;
    letter-spacing: -0.01em;
    text-wrap: balance;
    color: var(--lede);
  }
  body.case .study-head .skills { color: var(--muted); }

  body.case .hero {
    width: 100%;
    aspect-ratio: 800 / 512;
    background-position: 50%;
    background-size: cover;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.1);
  }

  /* ---- article content ---- */
  body.case .study-body { display: flex; flex-direction: column; gap: 40px; }
  body.case .study-body p {
    margin: 0;
    max-width: 625px;
    font-size: 18px;
    line-height: 28px;
  }
  body.case .study-body strong { color: var(--lede); font-weight: 500; }
  body.case .study-body a {
    color: var(--lede);
    text-decoration: underline;
    text-decoration-thickness: from-font;
    text-underline-offset: 3px;
    transition: color var(--dur-hover) var(--ease-ui), text-decoration-color var(--dur-hover) var(--ease-ui);
  }
  body.case .study-body h2 {
    margin: 24px 0 -12px;
    font-family: var(--display);
    font-weight: 200;
    font-size: 46px;
    line-height: 56px;
    letter-spacing: -0.01em;
    text-wrap: balance;
    color: var(--lede);
  }
  body.case .study-body h3 {
    margin: 24px 0 -16px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
  }
  body.case .study-body h2 strong, body.case .study-body h3 strong { color: inherit; font-weight: inherit; }
  body.case .study-body ul, body.case .study-body ol {
    margin: 0;
    max-width: 625px;
    padding-left: 1.2em;
    font-size: 18px;
    line-height: 28px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  body.case .study-body li > ul, body.case .study-body li > ol { margin-top: 8px; }
  body.case .study-body blockquote {
    margin: 0;
    max-width: 625px;
    padding-left: 20px;
    border-left: 1px solid var(--rule);
    color: var(--muted);
    font-size: 15px;
    line-height: 24px;
  }
  body.case .study-body blockquote strong { color: var(--muted); }
  body.case .study-body img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.1);
  }
  /* ---- live prototype embeds (embeds/*.html, sized by embed.js) ---- */
  body.case .study-body .study-embed {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* so the iframe's fallback height can be stated in the column's own width */
    container-type: inline-size;
  }
  body.case .study-body .study-embed iframe {
    display: block;
    width: 100%;
    /* Height until the prototype reports its own: its 664×180 crop (27.11% of
       the column) plus the 36px toggle beneath it and the 12px gap. Stated in
       cqw rather than a magic px so the initial layout is already right and
       nothing reflows on load. The narrow case mirrors the prototype's
       tighter 390×175 crop, and switches at the same 620px it does. */
    height: calc(27.11cqw + 48px);
    border: 0;
    border-radius: 16px;
    color-scheme: dark;
  }
  @container (max-width: 620px) {
    body.case .study-body .study-embed iframe { height: calc(44.87cqw + 48px); }
  }
  body.case .study-body .study-embed figcaption {
    max-width: 625px;
    font-size: 15px;
    line-height: 24px;
    color: var(--muted);
  }
  body.case .study-body .study-embed figcaption strong { color: var(--lede); font-weight: 500; }
  /* ---- inline-database carousels (arrows/counter/keys added by carousel.js) ---- */
  body.case .study-body .study-carousel {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  body.case .study-body .carousel-viewport {
    width: 100%;
    aspect-ratio: 800 / 512;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.1);
  }
  body.case .study-body .carousel-track {
    display: flex;
    flex-direction: row; /* override the generic .study-body ul (column) */
    height: 100%;
    max-width: none;     /* override the 625px prose measure on ul */
    margin: 0;
    padding: 0;
    gap: 0;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  body.case .study-body .carousel-track::-webkit-scrollbar { display: none; }
  body.case .study-body .carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    margin: 0;
    list-style: none;
    scroll-snap-align: center;
  }
  body.case .study-body .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* the frame + rounding live on .carousel-viewport, not each slide */
    border-radius: 0;
    box-shadow: none;
  }
  /* prev — counter — next, centered under the media. display:contents lets the
     two arrow buttons order around the counter without touching the markup. */
  body.case .study-body .carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  body.case .study-body .carousel-arrows { display: contents; }
  body.case .study-body .carousel-prev { order: 1; }
  body.case .study-body .carousel-counter { order: 2; }
  body.case .study-body .carousel-next { order: 3; }
  body.case .study-body .carousel-prev,
  body.case .study-body .carousel-next {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--rule);
    border-radius: 999px;   /* pill silhouette — the hand presses it (DESIGN.md) */
    background: transparent; /* grayscale at rest — the Violet Whisper Rule */
    font: inherit;
    font-size: 20px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    transition: background-color .2s ease-out, border-color .2s ease-out, color .2s ease-out, opacity var(--dur-hover) var(--ease-ui), transform var(--dur-hover) var(--ease-ui);
  }
  /* hover: the surface shifts to Lifted Violet, gated to real pointers */
  @media (hover: hover) and (pointer: fine) {
    body.case .study-body .carousel-prev:hover:not([disabled]),
    body.case .study-body .carousel-next:hover:not([disabled]) {
      background: var(--hover-small);
      border-color: var(--hover-small);
      color: var(--paper);
    }
  }
  body.case .study-body .carousel-prev:focus-visible,
  body.case .study-body .carousel-next:focus-visible {
    outline: 2px solid var(--hover-small);
    outline-offset: 2px;
    color: var(--lede);
  }
  body.case .study-body .carousel-prev[disabled],
  body.case .study-body .carousel-next[disabled] { opacity: 0.3; cursor: default; color: var(--muted); border-color: var(--rule); background: transparent; }
  /* tactile press feedback on the media controls — only where motion is welcome */
  @media (prefers-reduced-motion: no-preference) {
    body.case .study-body .carousel-prev:active:not([disabled]),
    body.case .study-body .carousel-next:active:not([disabled]) { transform: scale(0.96); }
    #cleanup.show:active { transform: translateY(0) scale(0.96); transition: transform var(--dur-fast) var(--ease-ui); }
  }
  body.case .study-body .carousel-index { color: var(--lede); }
  body.case .study-body .study-carousel[data-single] .carousel-controls { display: none; }
  /* ---- case-study videos (repo-hosted, cued by [video]; autoplay via video.js) ---- */
  body.case .study-body .study-video {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  body.case .study-body .study-video video {
    display: block;
    width: 100%;
    height: auto;
    background: var(--paper);
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.1);
  }
  body.case .study-body .study-video figcaption {
    max-width: 625px;
    font-size: 15px;
    line-height: 24px;
    color: var(--muted);
  }
  body.case .study-body .study-video figcaption strong { color: var(--lede); font-weight: 500; }
  body.case .study-body hr { border: 0; border-top: 1px solid var(--rule); margin: 8px 0; width: 100%; }
  body.case .study-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 24px;
  }
  body.case .study-body th, body.case .study-body td {
    text-align: left;
    vertical-align: top;
    padding: 10px 18px 10px 0;
    border-bottom: 1px solid var(--rule);
  }
  body.case .study-body th,
  body.case .study-body td:first-child strong {
    font-family: var(--mono);
    font-size: 12px;
    line-height: 16px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
  }

  /* ---- footer ---- */
  body.case .study-foot {
    margin: 0; /* the homepage's global footer spacing doesn't apply here */
    border-top: 1px solid var(--rule);
    padding-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 90px;
  }
  body.case .study-foot .pager {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 24px;
  }
  body.case .study-foot .pager a { color: var(--ink); }
  /* the homepage footer shares these selectors — pin the case values */
  body.case .study-foot .links { display: flex; flex-direction: row; align-items: baseline; gap: 24px; }
  body.case .study-foot .links a { color: var(--ink); }
  body.case .study-foot a { padding-bottom: 0; border-bottom: 0; }
  body.case .study-foot .links .copyright { color: var(--muted); }
  body.case .study-foot .pager a, body.case .study-foot .links a { transition: color var(--dur-hover) var(--ease-ui); }

  /* hover is a mouse gesture — on touch, a tap would leave these states stuck */
  @media (hover: hover) and (pointer: fine) {
    body.case .side nav a:hover { color: var(--ink); }
    body.case .side .name:hover .name-label { opacity: 0; }
    body.case .side .name:hover .name-hover { opacity: 1; }
    body.case .study-body a:hover { color: var(--hover-small); text-decoration-color: var(--hover-small); }
    body.case .study-foot a:hover { color: var(--hover-small); }
  }

  /* Touch has no hover to reveal "← Back home", so show that resolved state
     persistently — the name link reads as the back affordance it already is. */
  @media (hover: none) {
    body.case .side .name .name-label { opacity: 0; }
    body.case .side .name .name-hover { opacity: 1; }
  }

  @media (max-width: 1200px) {
    body.case { padding: 64px 48px; gap: 64px; }
    body.case .side { top: 64px; }
  }
  @media (max-width: 900px) {
    body.case { flex-direction: column; padding: 48px 24px; gap: 48px; }
    body.case .side { position: static; width: auto; }
    body.case .study { width: 100%; }
    body.case .study-head h1, body.case .study-body h2 { font-size: 30px; line-height: 38px; }
    body.case .study-foot .links { flex-wrap: wrap; }
    /* stack the pager and left-align it so "Next" isn't pushed to the far edge */
    body.case .study-foot .pager { flex-direction: column; align-items: flex-start; }
  }
