/* Case studies — editorial system, November 2026.
   One family (Inter, self-hosted), a 12-column grid, display type with a per-case accent,
   light and dark themes from the same tokens. */
@font-face { font-family: "Inter Cases"; src: url("/assets/fonts/inter-cyrillic.woff2") format("woff2"); font-style: normal; font-weight: 400 700; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter Cases"; src: url("/assets/fonts/inter-latin.woff2") format("woff2"); font-style: normal; font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --paper: #ffffff; --ink: #15161a; --ink-2: #3c3e45; --muted: #6b6d75; --line: #e4e4e8; --wash: #f4f4f6; --stage: #f1f0f4;
  --accent: #c4119f; --accent-soft: #f7e6f3; --on-accent: #ffffff;
  --shot-shadow: 0 1px 2px rgb(20 22 28 / .06), 0 24px 60px -28px rgb(20 22 28 / .28);
  --gutter: clamp(20px, 4vw, 64px); --col-gap: clamp(16px, 2vw, 32px);
  --measure: 62ch; --radius: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
body[data-case="tracio"] { --accent: #0b84a8; --accent-soft: #e2f3f8; --stage: #ebf1f4; }
body[data-case="tradebar"] { --accent: #6a4ff2; --accent-soft: #ece8ff; --stage: #121420; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; --paper: #0e0f12; --ink: #ececef; --ink-2: #c5c6cc; --muted: #9a9ca5; --line: #25272d; --wash: #16171b; --stage: #17181d; --accent: #f05ccc; --accent-soft: #2a1726; --shot-shadow: 0 1px 2px rgb(0 0 0 / .4), 0 24px 60px -28px rgb(0 0 0 / .8); } }
:root[data-theme="dark"] { color-scheme: dark; --paper: #0e0f12; --ink: #ececef; --ink-2: #c5c6cc; --muted: #9a9ca5; --line: #25272d; --wash: #16171b; --stage: #17181d; --accent: #f05ccc; --accent-soft: #2a1726; --shot-shadow: 0 1px 2px rgb(0 0 0 / .4), 0 24px 60px -28px rgb(0 0 0 / .8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body[data-case="tracio"] { --accent: #4cc3e6; --accent-soft: #10252d; --stage: #141a1e; } :root:not([data-theme="light"]) body[data-case="tradebar"] { --accent: #a091ff; --accent-soft: #1d1a33; --stage: #121420; } }
:root[data-theme="dark"] body[data-case="tracio"] { --accent: #4cc3e6; --accent-soft: #10252d; --stage: #141a1e; }
:root[data-theme="dark"] body[data-case="tradebar"] { --accent: #a091ff; --accent-soft: #1d1a33; --stage: #121420; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Inter Cases", system-ui, sans-serif; font-size: 19px; line-height: 1.6; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; transition: background-color .3s var(--ease), color .3s var(--ease); }
::selection { background: var(--accent); color: var(--on-accent); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
button { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; height: auto; }
figure, dl, dd, p, h1, h2, h3, ul { margin: 0; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 40; padding: 10px 16px; background: var(--ink); color: var(--paper); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* Grid */
.frame { width: min(1440px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 86%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
.site-nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 64px; }
.wordmark { font-size: 16px; font-weight: 600; letter-spacing: -.02em; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a[aria-current] { color: var(--ink); }
.home-link { display: none !important; }
.theme-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-left: 4px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; color: var(--ink); transition: border-color .2s var(--ease); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; } :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; } }

/* Chapter rail — sticky under the header */
.chapters { position: sticky; top: 64px; z-index: 20; background: color-mix(in srgb, var(--paper) 86%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.chapters ol { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; font-size: 14px; white-space: nowrap; }
.chapters ol::-webkit-scrollbar { display: none; }
.chapters li { flex: 0 0 auto; }
.chapters a { display: block; padding: 14px 0 13px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s var(--ease), border-color .2s var(--ease); }
.chapters a[aria-current="location"] { color: var(--ink); border-color: var(--accent); }

/* Opening: one screen under the header and the rail — what the project is, the task, my area, key numbers */
.opening { padding-block: clamp(16px, 2vw, 28px) 0; }
.back { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: clamp(16px, 3svh, 36px); }
.back svg { width: 16px; height: 16px; }
.intro-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; font-size: 15px; line-height: 1.4; color: var(--muted); }
.intro-meta h1 { font-size: inherit; font-weight: 600; letter-spacing: 0; color: var(--ink); }
/* The separator trails each item (not leads), so a wrapped line ends with a dot instead of starting with one */
.intro-meta > :not(:last-child)::after { content: "·"; margin-inline: .6em; color: var(--muted); font-weight: 400; }
.intro-meta span { white-space: nowrap; }
.lede { max-width: 34em; margin-top: clamp(10px, 1.6svh, 16px); font-size: clamp(26px, min(2.9vw, 5.2svh), 44px); line-height: 1.14; letter-spacing: -.03em; color: var(--ink); text-wrap: balance; }
.intro-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--col-gap); margin-top: clamp(28px, 5svh, 56px); }
.intro-cols h2 { font-size: clamp(17px, 1.4vw, 21px); font-weight: 500; letter-spacing: -.01em; margin-bottom: 8px; }
.intro-cols p { max-width: 46ch; font-size: clamp(15px, 1.1vw, 17px); line-height: 1.5; color: var(--muted); }
.intro-wins { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); margin-top: clamp(28px, 5svh, 56px); }
.intro-wins h2 { grid-column: 1 / span 4; font-size: clamp(24px, 2.3vw, 36px); font-weight: 500; line-height: 1.1; letter-spacing: -.03em; }
.intro-wins dl { grid-column: 5 / -1; display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--col-gap); }
.intro-wins dl > div { padding-top: 14px; border-top: 1px solid var(--line); }
.intro-wins dt { font-size: clamp(28px, min(2.9vw, 5.2svh), 44px); line-height: 1; letter-spacing: -.04em; font-weight: 500; margin-bottom: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.intro-wins dd { max-width: 30ch; font-size: clamp(14px, 1.05vw, 16px); line-height: 1.45; color: var(--muted); }
/* The first chapter follows the brief closely, so screens show up on the next scroll */
.story > .chapter:first-child { padding-top: clamp(48px, 6vw, 88px); }

/* Plates: product screens on a calm stage */
.plate { margin-block: clamp(32px, 4vw, 56px); }
.plate.is-cover { margin-block: clamp(28px, 4.5svh, 56px) 0; }
.stage { position: relative; padding: clamp(16px, 4.2vw, 64px); background: var(--stage); border-radius: calc(var(--radius) + 8px); overflow: hidden; }
.stage.is-peek { padding-bottom: 0; }
.stage.is-peek .shot, .stage.is-peek .compare { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.stage.is-dark { --stage: #0f1119; }
.stage.is-bare { padding: 0; background: none; }
.shot { display: block; width: 100%; height: auto; border-radius: var(--radius); background: #fff; box-shadow: var(--shot-shadow); }
.stage.is-bare .shot, .stage.is-dark .shot { box-shadow: none; }
.peek { overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shot-shadow); aspect-ratio: var(--ratio, 16 / 9); }
.peek > img { width: 100%; height: auto; }
.plate figcaption, .caption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 32px; padding-top: 16px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.plate figcaption span { max-width: 72ch; }
.plate figcaption a, .caption a { flex: 0 0 auto; color: var(--muted); }

/* Story */
.story { padding-bottom: clamp(48px, 6vw, 96px); }
.chapter { padding-top: clamp(72px, 9vw, 144px); scroll-margin-top: 112px; }
.chapter:focus { outline: none; }
.chapter-head { align-items: start; margin-bottom: clamp(28px, 3vw, 44px); }
.chapter-head h2 { grid-column: 1 / span 5; font-size: clamp(36px, 4.6vw, 68px); line-height: 1.02; letter-spacing: -.038em; }
.chapter-head .chapter-lede { grid-column: 7 / span 6; padding-top: .55em; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.45; letter-spacing: -.012em; color: var(--ink-2); }
.prose { grid-column: 7 / span 6; }
.prose > * + * { margin-top: 1em; }
.prose ul { padding-left: 1.1em; }
.prose li + li { margin-top: .4em; }
.prose a { text-decoration-color: var(--accent); }
.note { font-size: 15px; line-height: 1.55; color: var(--muted); }

/* Before → after in words: two columns, hairline rules, accent labels (no side stripes) */
.contrast { grid-column: 7 / span 6; display: grid; grid-template-columns: 1fr 1fr; gap: var(--col-gap); margin-block: 8px clamp(28px, 3vw, 40px); }
.contrast > div { padding-top: 16px; border-top: 1px solid var(--line); }
.contrast > div:last-child { border-top-color: var(--accent); }
.contrast dt { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--muted); }
.contrast > div:last-child dt { color: var(--accent); }
.contrast dd { font-size: 17px; line-height: 1.55; }
.contrast .who { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); }

/* Scope chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 !important; list-style: none; }
.chips li { margin: 0 !important; padding: 7px 13px; border-radius: 99px; background: var(--wash); font-size: 14px; line-height: 1.3; }
.chips li.is-key { background: var(--ink); color: var(--paper); }

/* Pull quote */
.pull { grid-column: 3 / span 9; margin-block: clamp(48px, 6vw, 88px); font-size: clamp(28px, 3.2vw, 46px); line-height: 1.16; letter-spacing: -.03em; font-weight: 500; }
.pull em { font-style: normal; color: var(--accent); }

/* Result */
.outcomes { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: var(--col-gap); margin-top: clamp(24px, 3vw, 40px); }
.outcomes > div { padding-top: 18px; border-top: 1px solid var(--line); }
.outcomes dt { font-size: clamp(34px, 3.8vw, 60px); line-height: 1; letter-spacing: -.04em; font-weight: 600; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.outcomes dd { font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 30ch; }

/* Video */
.flow { margin-block: clamp(32px, 4vw, 56px); }
.flow .stage video { width: 100%; border-radius: var(--radius); box-shadow: var(--shot-shadow); background: #fff; }
.flow-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; padding-top: 16px; font-size: 14px; color: var(--muted); }
.flow-square .stage { max-width: 760px; }

/* Before / after slider */
.compare { position: relative; overflow: hidden; border-radius: var(--radius); background: #fff; box-shadow: var(--shot-shadow); user-select: none; -webkit-user-select: none; touch-action: pan-y; cursor: ew-resize; --pos: 50%; }
.stage.is-dark .compare { box-shadow: none; background: #0f1119; }
.compare img { display: block; width: 100%; height: auto; pointer-events: none; }
.compare-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.compare-after img { width: 100%; height: 100%; object-fit: cover; object-position: 0 0; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgb(20 22 28 / .16); pointer-events: none; }
.compare-handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' stroke='%2315161a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6 3 11l5 5M14 6l5 5-5 5'/%3E%3C/svg%3E") center / 22px no-repeat; box-shadow: 0 6px 20px rgb(20 22 28 / .25); }
.compare-label { position: absolute; top: 14px; padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; line-height: 1.2; background: rgb(21 22 26 / .82); color: #fff; pointer-events: none; transition: opacity .2s; }
.compare-label.is-before { left: 14px; }
.compare-label.is-after { right: 14px; background: var(--accent); }
.compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Carousel */
.carousel { position: relative; }
.carousel { overflow: hidden; border-radius: calc(var(--radius) + 8px); }
.carousel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.carousel-track { --i: 0; display: flex; gap: 24px; transform: translateX(calc(var(--i) * -1 * (100% + 24px))); transition: transform .55s var(--ease); touch-action: pan-y; will-change: transform; }
.carousel-slide { flex: 0 0 100%; min-width: 0; }
.carousel-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px 28px; padding-top: 16px; min-height: 3.4em; font-size: 14px; line-height: 1.5; color: var(--muted); }
.carousel-meta [data-carousel-caption] { max-width: 76ch; }
.carousel-count { flex: 0 0 auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 100%; padding: 4px; margin-bottom: 16px; border-radius: 22px; background: var(--wash); font-size: 14px; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 0 0 auto; min-height: 36px; padding: 0 16px; border: 0; border-radius: 99px; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgb(20 22 28 / .14); }

/* Next case + footer */
.next-case { display: block; padding-block: clamp(48px, 6vw, 88px); border-top: 1px solid var(--line); text-decoration: none; }
.next-case span { display: block; font-size: 15px; color: var(--muted); }
.next-case strong { display: block; margin-block: 10px 12px; font-size: clamp(48px, 8vw, 120px); line-height: .95; letter-spacing: -.045em; font-weight: 600; transition: color .25s var(--ease); }
.case-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; padding-block: 28px 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.case-footer a { text-decoration: none; }

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover, .back:hover, .case-footer a:hover, .chapters a:hover { color: var(--ink); }
  .theme-toggle:hover { border-color: var(--ink); }
  .next-case:hover strong { color: var(--accent); }
  .seg button:hover { color: var(--ink); }
}

@media (max-width: 1100px) {
  .intro-wins h2 { grid-column: 1 / -1; margin-bottom: 20px; }
  .intro-wins dl { grid-column: 1 / -1; }
  .chapter-head h2 { grid-column: 1 / -1; }
  .chapter-head .chapter-lede, .prose, .contrast { grid-column: 3 / -1; }
  .chapter-head .chapter-lede { padding-top: 20px; }
  .outcomes { --cols: 2 !important; }
  .pull { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  html { scroll-padding-top: 64px; }
  body { font-size: 17px; padding-bottom: 92px; }
  .site-header { position: fixed; inset: auto 0 0; padding: 0 16px max(14px, env(safe-area-inset-bottom)); background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-nav { min-height: 0; padding: 4px; border-radius: 99px; background: color-mix(in srgb, var(--wash) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 0 0 1px var(--line); }
  .site-nav.frame { padding-inline: 4px; }
  .wordmark { display: none; }
  .home-link { display: flex !important; }
  .nav-links { flex: 1; gap: 2px; font-size: 14px; }
  .nav-links a { flex: 1; display: flex; justify-content: center; min-height: 44px; align-items: center; border-radius: 99px; }
  .nav-links a[aria-current] { background: var(--paper); }
  .theme-toggle { width: 44px; height: 44px; border: 0; }
  .chapters { top: 0; }
  .grid { display: block; }
  .opening { padding-top: 16px; }
  .back { margin-bottom: 20px; }
  .lede { font-size: 24px; }
  .intro-cols { grid-template-columns: 1fr; gap: 20px; margin-top: 28px; }
  .intro-wins { display: block; margin-top: 32px; }
  .intro-wins h2 { margin-bottom: 16px; }
  .intro-wins dl { grid-template-columns: 1fr 1fr; gap: 20px 16px; }
  .intro-wins dt { font-size: 28px; }
  .stage { border-radius: 14px; padding: 12px; }
  .stage.is-peek { padding-bottom: 0; }
  .shot, .compare, .peek { border-radius: 8px; }
  .chapter { padding-top: 64px; }
  .chapter-head h2 { font-size: 34px; }
  .chapter-head .chapter-lede { padding-top: 16px; font-size: 19px; }
  .contrast { grid-template-columns: 1fr; gap: 18px; }
  .outcomes { gap: 24px 16px; }
  .outcomes dt { font-size: 32px; }
  .plate figcaption, .caption, .flow-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
      .compare-label { top: 8px; font-size: 11px; padding: 4px 9px; }
  .compare-label.is-before { left: 8px; } .compare-label.is-after { right: 8px; }
  .compare-handle::after { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
  .seg button { padding: 0 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .carousel-track { transition: none; } * { transition: none !important; } }

/* Chapter rail: the list sits on the content edge (the .frame gutter was zeroed by "padding: 0"), and fades where it scrolls. */
.chapters ol { margin-inline: auto; padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); gap: 24px; }
.chapters ol.is-clipped-end { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 72px), transparent); }
.chapters ol.is-clipped-start.is-clipped-end { -webkit-mask-image: linear-gradient(90deg, transparent, #000 72px, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(90deg, transparent, #000 72px, #000 calc(100% - 72px), transparent); }
.chapters ol.is-clipped-start:not(.is-clipped-end) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 72px); mask-image: linear-gradient(90deg, transparent, #000 72px); }

/* ===== Same header and grid as the home page ===== */
@font-face { font-family: "Inter UI"; src: url("/assets/fonts/inter-cyrillic.woff2") format("woff2"); font-style: normal; font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter UI"; src: url("/assets/fonts/inter-latin.woff2") format("woff2"); font-style: normal; font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root { --gutter: 2.4rem; }
.frame { width: min(1728px, 100%); }
.site-nav { font-family: "Inter UI", system-ui, sans-serif; min-height: 64px; }
.wordmark { font-size: clamp(14px, 1.2svw, 20px); font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
@media (min-width: 768px) {
  .nav-links { gap: 8px; font-size: clamp(14px, 1.2svw, 20px); }
  .nav-links a { display: flex; align-items: center; min-height: 64px; padding: 0 16px; font-weight: 400; color: var(--ink); transition: opacity .16s var(--ease); }
  .nav-links a:hover { opacity: .65; }
  .theme-toggle { margin-left: 12px; }
}
@media (max-width: 767px) { :root { --gutter: 1rem; } }

/* ===== Screens fit the viewport =====
   A plate (switch + stage + caption) fits under the sticky header and chapter rail. The stage keeps its full width
   and padding (the safe area); the screen inside scales down and centres when the window is short. */
@media (min-width: 768px) {
  :root { --fit-h: max(320px, calc(100svh - 255px)); }
  .stage { --pad: clamp(16px, 4.2vw, 64px); padding: var(--pad); }
  .stage.is-peek { padding-bottom: 0; }
  .stage.is-bare { padding: 0; }
  .stage > .shot, .stage .compare > img:first-child, .flow .stage video { width: auto; max-width: 100%; max-height: calc(var(--fit-h) - 2 * var(--pad)); margin-inline: auto; }
  .stage.is-bare > .shot { max-height: var(--fit-h); }
  .stage .compare { width: fit-content; max-width: 100%; margin-inline: auto; }
}

/* Navigation film: carries its own light stage and margins. */
.flow-nav .stage.is-bare video { border-radius: calc(var(--radius) + 8px); box-shadow: none; background: #f1f0f4; }
@media (min-width: 768px) { .stage.is-bare video { max-height: var(--fit-h); } }

/* ===== VTB and Yandex Messenger cases (November 2026) ===== */
body[data-case="vtb"] { --accent: #2347df; --accent-soft: #e6ebff; --stage: #13132a; }
body[data-case="yandex"] { --accent: #d6331a; --accent-soft: #fdebe7; --stage: #f3f1ef; }
:root[data-theme="dark"] body[data-case="vtb"] { --accent: #8aa2ff; --accent-soft: #171c38; --stage: #13132a; }
:root[data-theme="dark"] body[data-case="yandex"] { --accent: #ff7a5c; --accent-soft: #2c1712; --stage: #17181d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-case="vtb"] { --accent: #8aa2ff; --accent-soft: #171c38; --stage: #13132a; }
  :root:not([data-theme="light"]) body[data-case="yandex"] { --accent: #ff7a5c; --accent-soft: #2c1712; --stage: #17181d; }
}
/* Slides that carry their own dark stage */
.stage.is-bare > .shot.is-own-stage { border-radius: calc(var(--radius) + 8px); background: #13132a; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Key numbers in a row (same rhythm as .outcomes, sits in the chapter body) */
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: var(--col-gap); margin-block: 8px clamp(32px, 4vw, 56px); }
.stats > div { padding-top: 18px; border-top: 1px solid var(--line); }
.stats dt { font-size: clamp(30px, 3.2vw, 48px); line-height: 1; letter-spacing: -.04em; font-weight: 600; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.stats dd { font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 32ch; }
.source { grid-column: 1 / -1; margin-top: 16px; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* Single-series bar chart: one hue, values on hover, direct labels on first / peak / last only */
.chart { margin-block: clamp(32px, 4vw, 56px); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.chart-head h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.chart-head span { font-size: 14px; color: var(--muted); }
.bars { --h: clamp(180px, 24vw, 280px); display: grid; grid-template-columns: repeat(var(--n, 12), minmax(0, 1fr)); gap: 2px clamp(4px, 1vw, 12px); align-items: end; height: calc(var(--h) + 56px); padding-top: 28px; border-bottom: 1px solid var(--line); }
.bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; outline: none; }
.bar i { display: block; height: calc(var(--v) / var(--max) * var(--h)); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .42; transition: opacity .16s var(--ease); }
.bar.is-key i { opacity: 1; }
.bar b { position: absolute; left: 50%; bottom: calc(var(--v) / var(--max) * var(--h) + 8px); transform: translateX(-50%); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); opacity: 0; transition: opacity .16s var(--ease); pointer-events: none; }
.bar.is-key b { opacity: 1; }
.bar:hover i, .bar:focus-visible i { opacity: 1; }
.bar:hover b, .bar:focus-visible b { opacity: 1; }
.bars:has(.bar:hover) .bar.is-key:not(:hover) b, .bars:has(.bar:focus-visible) .bar.is-key:not(:focus-visible) b { opacity: 0; }
.bar-x { display: grid; grid-template-columns: repeat(var(--n, 12), minmax(0, 1fr)); gap: 0 clamp(4px, 1vw, 12px); padding-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }

/* Rollout table */
.rollout { grid-column: 1 / -1; width: 100%; border-collapse: collapse; margin-block: 8px clamp(32px, 4vw, 56px); font-size: 16px; line-height: 1.45; }
.rollout th { padding: 0 16px 12px 0; font-size: 14px; font-weight: 600; text-align: left; color: var(--muted); border-bottom: 1px solid var(--ink); }
.rollout td { padding: 14px 16px 14px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.rollout td:first-child { font-weight: 600; }
.rollout small { display: block; font-size: 14px; font-weight: 400; color: var(--muted); }
.rollout .is-live { color: var(--accent); font-weight: 600; }
.rollout .is-wip { color: var(--muted); }

/* Work map: what was redesigned, what was new, what was localised */
.workmap { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--col-gap); margin-top: clamp(24px, 3vw, 40px); }
.workmap section { padding-top: 18px; border-top: 1px solid var(--ink); }
.workmap h3 { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.workmap h3 + p { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.workmap ul { margin: 0; padding: 0; list-style: none; }
.workmap li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.4; }
.workmap li span { flex: 0 0 auto; font-size: 13px; line-height: 1.6; color: var(--muted); }

@media (max-width: 1100px) { .stats { --cols: 2 !important; } .workmap { grid-template-columns: 1fr; } }
@media (max-width: 767px) {
  .stats { gap: 24px 16px; }
  .stats dt { font-size: 30px; }
  .bars { --h: 160px; }
  .bar b { font-size: 11px; }
  .bar-x { font-size: 10px; }
  .rollout { font-size: 15px; }
  .rollout thead { display: none; }
  .rollout tr { display: grid; grid-template-columns: 1fr 1fr; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .rollout td { padding: 2px 12px 2px 0; border: 0; }
  .rollout td:first-child { grid-column: 1 / -1; padding-bottom: 6px; }
}
@media (max-width: 767px) { .rollout td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 400; color: var(--muted); } }

/* Ranking diagram (VTB smart feed): one row, a segmented switch reorders it */
:root[data-theme="dark"] body[data-case="vtb"] { --on-accent: #0e1020; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body[data-case="vtb"] { --on-accent: #0e1020; } }
.rank { --g: clamp(8px, 1vw, 14px); padding: 26px 7px 34px; }
.rank-track { position: relative; }
.rank-list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--g); margin: 0; padding: 0; list-style: none; }
.rank-card { --p: var(--a); grid-row: 1; grid-column: 1; position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: clamp(96px, 8vw, 116px); margin: 0 !important; padding: 12px 14px 14px; border: 1px solid var(--line); background: var(--paper); font-size: clamp(14px, 1.05vw, 16px); line-height: 1.3; letter-spacing: -.005em; transform: translateX(calc((var(--p) - 1) * (100% + var(--g)))); transition: transform .7s var(--ease), border-color .3s var(--ease); }
[data-state="after"] .rank-card { --p: var(--b); }
.rank-card b { display: inline-grid; place-items: center; width: 24px; height: 24px; background: var(--wash); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.rank-card .n-b, [data-state="after"] .rank-card .n-a { display: none; }
[data-state="after"] .rank-card .n-b { display: inline; }
.rank-card.is-key { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.rank-card.is-key b { background: var(--accent); color: var(--on-accent); }
.rank-card.is-stack { box-shadow: 5px 5px 0 -1px var(--paper), 5px 5px 0 0 color-mix(in srgb, var(--accent) 40%, transparent), 10px 10px 0 -1px var(--paper), 10px 10px 0 0 color-mix(in srgb, var(--accent) 25%, transparent); }
.rank-card.is-moved { z-index: 2; }
[data-state="after"] .rank-card.is-moved { border-color: var(--ink); box-shadow: inset 0 0 0 .5px var(--ink); }
.rank-card.is-moved::after { content: "перешёл в конец"; position: absolute; left: 14px; top: calc(100% + 8px); font-size: 12px; line-height: 1.3; color: var(--muted); white-space: nowrap; opacity: 0; transition: opacity .3s var(--ease); }
[data-state="after"] .rank-card.is-moved::after { opacity: 1; transition-delay: .45s; }
/* Dashed frame around the five daily banners and the return path: only on the first show */
.rank-daily { grid-row: 1; grid-column: 1 / 6; position: relative; margin: -7px !important; border: 1.5px dashed color-mix(in srgb, var(--muted) 55%, transparent); pointer-events: none; transition: opacity .3s var(--ease); }
.rank-daily span { position: absolute; left: 12px; bottom: calc(100% + 6px); font-size: 13px; line-height: 1.3; color: var(--muted); white-space: nowrap; }
.rank-move { position: absolute; top: calc(100% + 8px); left: calc((100% - 6 * var(--g)) / 14); right: 0; height: 22px; border: 1.5px solid var(--ink-2); border-top: 0; transition: opacity .3s var(--ease); }
.rank-move::before { content: ""; position: absolute; left: -4.5px; top: -4px; width: 7.5px; height: 7.5px; border-radius: 50%; background: var(--ink-2); }
.rank-move::after { content: ""; position: absolute; right: -6px; top: -2px; border: 5.5px solid transparent; border-top: 0; border-bottom: 7px solid var(--ink-2); }
[data-state="after"] .rank-daily, [data-state="after"] .rank-move { opacity: 0; }
.rank-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0 7px; list-style: none; font-size: 13px; color: var(--muted); }
.rank-legend li { display: flex; align-items: center; gap: 8px; margin: 0 !important; }
.rank-legend i { width: 14px; height: 14px; border: 1px solid var(--line); background: var(--paper); }
.rank-legend .is-key i { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.rank-legend .is-dashed i { background: none; border: 1.5px dashed color-mix(in srgb, var(--muted) 55%, transparent); }
@media (max-width: 1100px) { .rank-card { padding: 10px 10px 12px; } .rank-card.is-moved::after { content: "в конце"; } }
@media (max-width: 767px) {
  .rank { --g: 8px; padding: 5px 5px 20px; }
  .rank-list { grid-template-columns: 1fr; grid-template-rows: repeat(7, 60px); }
  .rank-card { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; height: 60px; min-height: 0; padding: 0 12px; font-size: 14px; transform: translateY(calc((var(--p) - 1) * (100% + var(--g)))); }
  .rank-card b { flex: 0 0 auto; width: 22px; height: 22px; font-size: 11px; }
  .rank-card.is-stack { box-shadow: 3px 3px 0 -1px var(--paper), 3px 3px 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
  .rank-card.is-moved::after { position: static; margin-left: auto; content: "в конце"; }
  .rank-daily { grid-row: 1 / 6; grid-column: 1; margin: -5px !important; }
  .rank-daily span, .rank-move { display: none; }
  .rank-legend { flex-direction: column; gap: 6px; padding: 0; }
}

/* The ranking rule is the point of the figure: ink, lede size, changes with the switch */
.rank-rule { max-width: 44ch; min-height: 2.9em; margin: 4px 0 8px; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.45; letter-spacing: -.012em; color: var(--ink); text-wrap: balance; }
.rank-legend .is-stack i { box-shadow: 3px 3px 0 -1px var(--paper), 3px 3px 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
@media (max-width: 767px) { .rank-rule { min-height: 4.35em; font-size: 19px; } }
.rank-rule { margin-bottom: 20px; }

/* Scope chips: dark ones are chapters of this case and link to them */
.chips li.is-key { padding: 0; }
.chips li.is-key a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; color: inherit; text-decoration: none; }
.chips li.is-key a::after { content: "↓"; font-size: 12px; opacity: .6; }
@media (hover: hover) and (pointer: fine) { .chips li.is-key a:hover::after { opacity: 1; } }

/* WB screens are exported at 1366×800 @2x: never show them wider than 1366 CSS px, so they stay crisp on big screens */
@media (min-width: 768px) { body[data-case="wb"] .stage > .shot, body[data-case="wb"] .stage .compare, body[data-case="wb"] .flow .stage video { max-width: min(100%, 1366px); } body[data-case="wb"] .flow .stage video { display: block; margin-inline: auto; } }

/* New version sits on the left of the before/after slider */
.compare-label.is-new { background: var(--accent); }
.compare-label.is-old { background: rgb(21 22 26 / .82); }

/* Phones side by side (before/after, variants). Labels sit above each phone. */
.phones { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 300px)); justify-content: center; gap: clamp(16px, 5vw, 72px); }
.phones[hidden] { display: none; }
.phones figure { margin: 0; }
.phones img { display: block; width: 100%; height: auto; border-radius: 13% / 6%; box-shadow: var(--shot-shadow); background: #fff; }
.phone-label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: var(--muted); }
.phone-label.is-now { color: var(--ink); }
@media (max-width: 767px) { .phones { gap: 12px; } .phones[style*="--n:4"], .phones[style*="--n: 4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Phone videos: a pair of portrait loops in one row. */
.flow-phones { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: clamp(16px, 5vw, 72px); margin-block: clamp(32px, 4vw, 56px); }
.flow-phones .flow { margin: 0; }
.flow-phones .flow .stage, .flow.is-phone .stage { padding: 0; background: none; }
.flow-phones .flow .stage video, .flow.is-phone .stage video { width: 100%; max-height: none; border-radius: 13% / 6%; }
.flow.is-phone .stage { max-width: 340px; margin-inline: auto; }
@media (max-width: 767px) { .flow-phones { gap: 12px; } }

/* Decision logic: questions on the left, the resulting profile on the right. */
.logic { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: clamp(24px, 6vw, 96px); align-items: center; }
.logic-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: q; }
.logic-steps li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: clamp(16px, 1.4vw, 19px); color: var(--muted); transition: color .2s; }
.logic-steps li b { font-weight: 600; min-width: 3.2em; text-align: right; }
.logic-steps li.is-on { color: var(--ink); }
.logic-steps li.is-on b { color: var(--accent); }
.logic-steps li.is-off { opacity: .35; }
.logic-phone img { display: block; width: 100%; height: auto; border-radius: 13% / 6%; box-shadow: var(--shot-shadow); background: #fff; }
.logic-phone img[hidden] { display: none; }
@media (max-width: 767px) { .logic { grid-template-columns: 1fr; } .logic-phone { max-width: 280px; margin-inline: auto; } }

/* Rules list */
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 64px); margin: 0; padding: 0; list-style: none; counter-reset: rule; }
.rules li { padding: 18px 0; border-top: 1px solid var(--line); counter-increment: rule; }
.rules li::before { content: counter(rule, decimal-leading-zero); display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rules b { display: block; margin-bottom: 4px; font-size: 17px; }
.rules span { color: var(--ink-2); }
@media (max-width: 767px) { .rules { grid-template-columns: 1fr; } }
.logic-steps li { color: var(--ink); }
.logic-steps li b span[hidden] { display: none; }
[data-state="none"] .logic-steps .q2 { opacity: .3; }
.logic-steps li b { color: var(--accent); }
.grid > .rules { grid-column: 1 / -1; }

/* Duo: two equal squares side by side — controls or text in one, the screen in the other. One thing to look at per row. */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 24px); margin: clamp(24px, 3vw, 40px) 0 0; }
.duo + .duo { margin-top: clamp(12px, 1.6vw, 24px); }
.tile { position: relative; aspect-ratio: 1 / 1; margin: 0; overflow: hidden; border-radius: calc(var(--radius) + 8px); background: var(--stage); }
.tile-media { display: grid; place-items: center; }
.tile-media img, .tile-media video { display: block; height: 86%; width: auto; max-width: 92%; object-fit: contain; border-radius: clamp(18px, 2.6vw, 40px); box-shadow: var(--shot-shadow); background: #fff; }
.tile-media img[hidden] { display: none; }
.tile-text { display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: clamp(24px, 3.4vw, 56px); }
.tile-text h3 { margin: 0; font-size: clamp(24px, 2.4vw, 36px); line-height: 1.1; letter-spacing: -0.02em; }
.tile-text p { margin: 0; max-width: 30ch; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.45; color: var(--ink-2); }
.tile-text .seg { align-self: flex-start; margin: 0 auto 0 0; background: var(--paper); }
.tile-text .seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.tile-text .logic-steps { margin-top: auto; }
.tile-text .tile-caption { min-height: 2.9em; margin: 0; font-size: clamp(15px, 1.2vw, 17px); color: var(--ink-2); }
.duo .flow { margin: 0; }
.duo.is-flip > :first-child { order: 2; }
@media (max-width: 767px) {
  .duo { grid-template-columns: 1fr; }
  .duo.is-flip > :first-child { order: 0; }
  .tile-text { aspect-ratio: auto; }
  .tile-text .logic-steps { margin-top: 24px; }
}
.tile-text.is-logic { justify-content: space-between; } .tile-text.is-logic .logic-steps { margin-top: 0; }
/* Media sits absolutely so its height resolves against the square, not against its own content. */
.tile-media > img, .tile-media > video { position: absolute; inset: 0; margin: auto; height: 86%; width: auto; max-width: 92%; }
.tile-media > img, .tile-media > video { inset: auto; left: 50%; top: 50%; margin: 0; transform: translate(-50%, -50%); }
.tile-media > video { aspect-ratio: 750 / 1600; object-fit: cover; background: transparent; }
.tile-media > video[height="1624"] { aspect-ratio: 750 / 1624; }

.plate[data-states] > .flow { margin: 0; }
.plate[data-states] > .flow[hidden] { display: none; }

/* Dark theme is not finished: it stays behind a feature flag (?theme=1 turns it on for this browser, ?theme=0 off). */
:root:not([data-ff~="theme"]) .theme-toggle { display: none !important; }
.cv-download { display: inline-flex; align-items: center; flex: 0 0 auto; height: 36px; margin-left: 12px; padding: 0 16px; border: 1px solid var(--line); border-radius: 99px; color: inherit; font-size: 14px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; align-self: center; transition: border-color 160ms ease, background-color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .cv-download:hover { border-color: currentColor; } }
@media (max-width: 767px) { .cv-download { height: 34px; margin-left: 4px; padding: 0 12px; font-size: 13px; } }
.nav-links a.cv-download { flex: 0 0 auto; height: 36px; min-height: 0; padding: 0 16px; border-radius: 99px; color: var(--ink); justify-content: center; }
@media (max-width: 767px) { .nav-links a.cv-download { height: 40px; padding: 0 14px; background: var(--paper); } }

/* Compact work map: three columns, a big count and the work as one line of text — fits one screen */
.workmap.is-compact section { padding-top: 16px; }
.workmap.is-compact h3 { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; font-size: 17px; color: var(--ink); }
.workmap.is-compact h3 b { font-size: clamp(36px, 3.6vw, 56px); line-height: 1; font-weight: 500; letter-spacing: -.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.workmap.is-compact p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
@media (max-width: 1100px) { .workmap.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .workmap.is-compact { grid-template-columns: 1fr; gap: 20px; } }

/* CV button: text on wide screens, a download icon in the mobile bottom bar */
.cv-download { gap: 6px; }
.cv-download .cv-icon { display: none; width: 20px; height: 20px; flex: 0 0 auto; }
@media (max-width: 767px) {
  .cv-download, .nav-links a.cv-download { width: 44px; height: 44px; min-height: 0; padding: 0; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); }
  .cv-download .cv-icon { display: block; }
  .cv-download .cv-text { display: none; }
}

/* Alignment pass (impeccable): every text edge sits on a column of the 12-column grid.
   Key results: heading in cols 1–3, numbers start on cols 4 / 7 / 10, so the middle one lines up with
   «Зона ответственности» and with every chapter lede (col 7). Two results keep the same columns. */
.intro-wins h2 { grid-column: 1 / span 3; }
.intro-wins dl { grid-column: 4 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--col-gap); }
/* Duo tiles split on the same gutter as the grid, so the right tile starts exactly on col 7 */
.duo, .duo + .duo { gap: var(--col-gap); }
.duo + .duo { margin-top: var(--col-gap); }
@media (min-width: 768px) and (max-width: 1100px) { .chapter-head .chapter-lede, .prose, .contrast { grid-column: 4 / -1; } } /* tablet: ledes start on col 4, like the first key result */
@media (max-width: 767px) { .intro-wins dl { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) {
  /* Meta line: the case name gets its own line, so a wrapped line never starts with a separator dot */
  .intro-meta h1 { flex: 0 0 100%; }
  .intro-meta h1::after { content: none !important; }
}

/* WB accounts navigation: only the left column, as a card in the square tile */
.navcol-v[hidden] { display: none; }
.navcol-v { position: absolute; left: 50%; top: 50%; height: 86%; aspect-ratio: 700 / 1424; transform: translate(-50%, -50%); }
.navcol-v video { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: clamp(14px, 1.6vw, 22px); box-shadow: var(--shot-shadow); background: #f3f3f6; }
.duo .tile-text .tile-caption { max-width: 34ch; font-size: clamp(17px, 1.4vw, 21px); line-height: 1.45; color: var(--ink); }

/* ===== v4 (November 2026): type by role, neutral colour, compact rhythm, motion =====
   Five type roles only: title, head, body, small, micro. Weights 400 and 500. The case accent is kept for data
   (chart bars, live status, key cards, "new" label) and removed from chrome. */
:root {
  --ink: #181a1f; --ink-2: #33353b; --muted: #64666d; --line: #e9e9ec; --wash: #f4f4f5;
  --shot-shadow: 0 1px 2px rgb(20 22 28 / .05), 0 16px 40px -24px rgb(20 22 28 / .22);
  --t-title: clamp(28px, 3vw, 44px); --t-head: clamp(24px, 2.2vw, 32px); --t-body: 17px; --t-small: 14px; --t-micro: 12px;
}
@media (max-width: 767px) { :root { --t-title: 26px; --t-head: 24px; --t-body: 16px; } }
body { font-size: var(--t-body); line-height: 1.5; }
h1, h2, h3, b, strong { font-weight: 500; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible, .carousel:focus-visible { outline-color: var(--ink); }
.compare:has(input:focus-visible) { outline-color: var(--ink); }

/* Rail: the bottom line fills with ink as the case is read; the current chapter is ink, the rest muted */
.chapters a { padding: 14px 0; margin-bottom: 0; border-bottom: 0; font-size: var(--t-small); }
.chapters a[aria-current="location"] { border-color: transparent; }
.chapters::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--ink); transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); }

/* Opening */
.intro-meta { gap: 4px 20px; font-size: var(--t-small); }
.intro-meta > :not(:last-child)::after { content: none; }
.intro-meta h1 { font-weight: 500; }
.lede { max-width: 26em; font-size: var(--t-title); font-weight: 500; line-height: 1.12; letter-spacing: -.03em; }
.intro-cols, .intro-wins { margin-top: clamp(24px, 4svh, 44px); }
.intro-cols h2, .intro-wins h2, .chart-head h3 { margin-bottom: 4px; font-size: var(--t-body); font-weight: 500; line-height: 1.5; letter-spacing: 0; }
.intro-cols p { max-width: 44ch; font-size: var(--t-body); line-height: 1.5; color: var(--ink-2); }

/* Numbers: one role everywhere, no rule above each figure */
.intro-wins dl > div, .outcomes > div, .stats > div, .workmap section, .workmap.is-compact section { padding-top: 0; border-top: 0; }
.intro-wins dt, .outcomes dt, .stats dt, .workmap.is-compact h3 b { margin-bottom: 6px; font-size: var(--t-head); font-weight: 500; line-height: 1.15; letter-spacing: -.025em; color: var(--ink); font-variant-numeric: tabular-nums; }
.intro-wins dd, .outcomes dd, .stats dd { max-width: 30ch; font-size: var(--t-small); line-height: 1.45; color: var(--muted); }
.outcomes, .stats, .workmap { margin-top: 0; }
.workmap.is-compact h3 { display: block; margin-bottom: 4px; font-size: var(--t-body); font-weight: 500; color: var(--ink); }
.workmap.is-compact h3 b { display: block; }
.workmap.is-compact p { font-size: var(--t-small); line-height: 1.5; color: var(--muted); }

/* Chapters */
.story > .chapter:first-child { padding-top: clamp(40px, 5vw, 72px); }
.chapter { padding-top: clamp(56px, 6.5vw, 104px); }
.chapter-head { align-items: baseline; margin-bottom: clamp(20px, 2.4vw, 32px); }
.chapter-head h2 { grid-column: 1 / span 6; font-size: var(--t-head); line-height: 1.15; letter-spacing: -.025em; }
.chapter-head .chapter-lede { grid-column: 7 / span 6; max-width: 52ch; padding-top: 0; font-size: var(--t-body); line-height: 1.5; letter-spacing: 0; color: var(--ink-2); }
@media (max-width: 1100px) { .chapter-head h2, .chapter-head .chapter-lede { grid-column: 1 / -1; } .chapter-head .chapter-lede { margin-top: 8px; } }
.plate, .flow, .chart, .flow-phones { margin-block: clamp(20px, 2.4vw, 32px); }
.duo { margin-top: 0; }
.plate figcaption, .caption, .flow-bar, .carousel-meta { padding-top: 12px; font-size: var(--t-small); }
.prose a { text-decoration-color: currentColor; }
.note, .source, .phone-label, .seg, .contrast dt, .contrast .who, .rollout th, .rollout small, .chart-head span, .rank-card { font-size: var(--t-small); }
.seg button, .seg button[aria-pressed="true"], .phone-label, .contrast dt, .rollout th, .rollout td:first-child, .rollout .is-live, .compare-label, .bar b, .rank-card b { font-weight: 500; }
.compare-label, .bar b, .bar-x, .rank-card b, .rank-legend, .rank-daily span, .rank-card.is-moved::after { font-size: var(--t-micro); }
.contrast > div:last-child { border-top-color: var(--ink); }
.contrast > div:last-child dt { color: var(--ink); }
.contrast dd, .rollout, .rules b, .logic-steps li { font-size: var(--t-body); }
.pull { font-size: var(--t-title); line-height: 1.12; }
.pull em { color: inherit; }
.rank-rule { min-height: 3em; font-size: var(--t-body); line-height: 1.5; letter-spacing: 0; }
.rules li { padding: 14px 0; }
.rules li::before { content: none; }
.rules span { color: var(--ink-2); }
.logic-steps li b, .logic-steps li.is-on b { color: var(--ink); font-weight: 500; }
.tile-text h3 { font-size: var(--t-head); font-weight: 500; line-height: 1.15; letter-spacing: -.025em; }
.tile-text p, .tile-text .tile-caption, .duo .tile-text .tile-caption { font-size: var(--t-body); line-height: 1.5; color: var(--ink-2); }

/* Next case: one row on the page grid — label, name, what it is, arrow */
.next-case { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: baseline; padding-block: clamp(32px, 4vw, 56px); }
.next-case span:first-child { grid-column: 1 / span 3; font-size: var(--t-small); }
.next-case strong { grid-column: 4 / span 3; margin: 0; font-size: var(--t-title); font-weight: 500; line-height: 1.12; letter-spacing: -.03em; transition: transform .35s var(--ease); }
.next-case span:last-child { grid-column: 7 / span 5; font-size: var(--t-body); color: var(--ink-2); }
.next-case::after { content: "→"; grid-column: 12; justify-self: end; font-size: var(--t-head); line-height: 1; color: var(--ink); transition: transform .35s var(--ease); }
@media (hover: hover) and (pointer: fine) { .next-case:hover strong { color: var(--ink); transform: translateX(6px); } .next-case:hover::after { transform: translateX(8px); } }
@media (max-width: 767px) { .next-case { grid-template-columns: 1fr auto; row-gap: 6px; } .next-case span:first-child, .next-case span:last-child { grid-column: 1 / -1; } .next-case strong { grid-column: 1; } .next-case::after { grid-column: 2; grid-row: 2; } }

/* Motion. Content is visible without script; .js-motion is set only when motion is allowed. */
.js-motion [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js-motion [data-reveal="plate"] { transform: translateY(16px) scale(.985); }
.js-motion [data-reveal].is-in { opacity: 1; transform: none; }
/* Segmented switch: one thumb slides between the options */
.seg { position: relative; }
.seg button { position: relative; z-index: 1; transition: color .2s var(--ease), transform .15s var(--ease); }
.seg button:active, .cv-download:active { transform: scale(.97); }
.seg-thumb { position: absolute; left: 0; top: 0; width: var(--w, 0); height: var(--h, 0); border-radius: 99px; background: var(--paper); box-shadow: 0 1px 3px rgb(20 22 28 / .14); transform: translate(var(--x, 0), var(--y, 0)); transition: transform .35s var(--ease), width .35s var(--ease); pointer-events: none; }
.seg.has-thumb button[aria-pressed="true"], .tile-text .seg.has-thumb button[aria-pressed="true"] { background: none; box-shadow: none; }
.tile-text .seg .seg-thumb { background: var(--ink); box-shadow: none; }
