/* Layout: left-aligned editorial column; a name-led hero beside the portrait, a running band of platforms, then cases as full-width ruled rows that expand in place. */
:root {
  /* Colour: graphite taken from the portrait's blue cast; green marks status and outcomes.
     Dark is the default. Light applies when the visitor's system asks for it or they pick it. */
  --bg: #0f1418;
  --surface: #161d23;
  --rule: #29323b;
  --text: #ece8e0;
  --text-dim: #a4adb5;
  --status: #8fcfa6;
  --header-bg: rgba(15, 20, 24, 0.86);
  --glow: rgba(143, 207, 166, 0.45);

  /* Type: Newsreader for display and outcomes, IBM Plex Sans for reading and labels. */
  --display: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.375rem;
  --step-2: clamp(1.625rem, 1.2rem + 1.4vw, 2.25rem);
  --step-3: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);
  --step-4: clamp(3.25rem, 0.6rem + 12.5vw, 8.5rem);

  --gutter: clamp(16px, 4vw, 40px);
  --wrap: 1240px;
  --header-h: 64px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

/* Light palette: same graphite hue, cooled paper ground, a deeper green that keeps 4.5:1 on light. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f2f4f5;
    --surface: #e6eaed;
    --rule: #d0d7dc;
    --text: #0f1418;
    --text-dim: #4d5963;
    --status: #2a7349;
    --header-bg: rgba(242, 244, 245, 0.86);
    --glow: rgba(42, 115, 73, 0.35);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f2f4f5;
  --surface: #e6eaed;
  --rule: #d0d7dc;
  --text: #0f1418;
  --text-dim: #4d5963;
  --status: #2a7349;
  --header-bg: rgba(242, 244, 245, 0.86);
  --glow: rgba(42, 115, 73, 0.35);
  color-scheme: light;
}

/* Russian page (/ru/): Newsreader has no Cyrillic, so display text uses Literata,
   an editorial serif with the same optical-size axis. IBM Plex Sans covers Cyrillic already. */
html:lang(ru) { --display: "Literata", "Newsreader", Georgia, "Times New Roman", serif; }
/* Literata sets wider than Newsreader and Russian runs longer: one step down keeps the hero figures above the fold. */
html:lang(ru) .hero-value { font-size: clamp(2rem, 1rem + 2.6vw, 3.125rem); }
/* The Cyrillic name is wider, so on phones it may break onto two lines instead of pushing the header off screen. */
@media (max-width: 479px) {
  html:lang(ru) .brand { white-space: normal; font-size: 1.125rem; line-height: 1.05; }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  interpolate-size: allow-keywords;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}

/* Paints the phone's status-bar band so nothing scrolls under it. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: 30;
}

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

a { color: inherit; text-decoration-color: var(--text-dim); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--status); }

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

h1, h2, h3, h4, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 40;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: calc(16px + env(safe-area-inset-top, 0px)); }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 500 var(--step-0)/1 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}
.button:hover { border-color: var(--text-dim); }
.button-primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.button-primary:hover { background: transparent; color: var(--text); border-color: var(--text); }
.button-small { min-height: 40px; padding: 0 18px; font-size: var(--step--1); }

/* Header */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--header-bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px 32px;
  min-height: var(--header-h);
}
.brand {
  font-family: var(--display);
  font-size: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
}
.site-nav { display: none; gap: 28px; font-size: var(--step--1); }
.site-nav a { position: relative; text-decoration: none; color: var(--text-dim); padding-block: 6px; transition: color 0.25s; }
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--text); }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--status);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}
.site-nav a[aria-current="true"]::after { transform: scaleX(1); }
.clock { display: none; font-size: var(--step--1); color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock time { color: var(--text); margin-left: 4px; }

.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--status); transform: scaleX(0); transform-origin: left; }

@media (min-width: 760px) {
  .clock { display: block; }
}

/* Theme switch: a half-filled disc that turns over when the theme changes. */
.header-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.25s;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--text-dim); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; transition: transform 0.7s var(--ease-out); }
.theme-toggle .half { fill: currentColor; stroke: none; }
:root[data-theme="light"] .theme-toggle svg { transform: rotate(180deg); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle svg { transform: rotate(180deg); }
}
/* The switch animates with a circular reveal (main.js); the default cross-fade is turned off. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
@media (min-width: 960px) {
  .site-nav { display: flex; }
  .brand { margin-right: 0; }
  .site-nav { margin-right: auto; margin-left: 24px; }
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  grid-template-areas:
    "role  role"
    "value value"
    "focus focus"
    "name  name"
    "say   say"
    "photo body"
    "proof proof";
  column-gap: 20px;
  padding-top: clamp(36px, 5vw, 64px);
  padding-bottom: clamp(48px, 7vw, 88px);
}
.hero-role { grid-area: role; color: var(--text-dim); font-size: var(--step--1); margin-bottom: 20px; }
/* The value line is the hero's display text; the name sits under it at heading size. */
.hero-value {
  grid-area: value;
  font-family: var(--display);
  font-size: clamp(2.25rem, 1rem + 3.4vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 72;
  margin-bottom: clamp(20px, 2.5vw, 32px);
  text-wrap: balance;
}
.hero-value em { font-style: italic; font-weight: 300; color: var(--status); }
/* The mask that hides each line before it rises; padded so ascenders, i-dots and italic overhangs are never clipped. */
.hero-value .line { display: block; overflow: hidden; padding: 0.14em 0.08em 0.08em; margin: -0.14em -0.08em -0.08em; }
.hero-value .line > span { display: block; text-wrap: balance; }

.hero-focus { grid-area: focus; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: clamp(32px, 4vw, 48px); }
.hero-focus a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: var(--step--1);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.hero-focus a:hover, .hero-focus a:focus-visible { border-color: var(--status); color: var(--status); }

.hero-name {
  grid-area: name;
  font-size: var(--step-2);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 36;
  margin-bottom: 6px;
}
.hero-name i { font-weight: 300; }

/* How to say the name: respelling for everyone, IPA for those who read it. */
.hero-say {
  grid-area: say;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: clamp(24px, 3vw, 40px);
  color: var(--text-dim);
  font-size: var(--step--1);
}
.say-label { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.say-respell { color: var(--text); letter-spacing: 0.01em; }
.say-respell b { font-weight: 600; color: var(--status); }
.say-ipa { font-family: "Noto Serif", "Charis SIL", "Doulos SIL", "Gentium Plus", "Times New Roman", serif; font-size: 0.9375rem; }

.hero-photo { grid-area: photo; align-self: start; overflow: hidden; border-radius: 2px; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.hero-body { grid-area: body; display: grid; gap: 20px; align-content: start; min-width: 0; }
.lead {
  font-family: var(--display);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  line-height: 1.32;
  font-variation-settings: "opsz" 24;
}
.status { display: flex; gap: 12px; align-items: baseline; color: var(--text-dim); font-size: var(--step--1); max-width: 62ch; }
.status-dot {
  flex: none;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--status);
  transform: translateY(-1px);
  box-shadow: 0 0 0 0 var(--glow);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.proof-strip {
  grid-area: proof;
  /* Wrapping row: a figure wider than its share (Russian «Зелёный») moves down instead of overlapping the next one. */
  display: flex;
  flex-wrap: wrap;
  gap: 28px 20px;
  margin-top: clamp(40px, 4.5vw, 64px);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.proof-strip > div { flex: 1 1 9rem; }
.proof-strip dt, .metrics dt {
  font-family: var(--display);
  font-size: var(--step-3);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.02em;
}
.proof-strip dd, .metrics dd { margin-top: 8px; color: var(--text-dim); font-size: var(--step--1); line-height: 1.45; max-width: 26ch; }

@media (max-width: 559px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "role" "value" "focus" "name" "say" "photo" "body" "proof"; }
  .hero-photo { width: 64%; margin-bottom: 28px; }
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas:
      "role  photo"
      "value photo"
      "focus photo"
      "name  photo"
      "say   photo"
      "body  photo"
      "proof proof";
    column-gap: clamp(40px, 6vw, 96px);
  }
  .hero-photo { grid-row: 1 / 7; }
  .hero-body { max-width: 40rem; }
}

/* Platforms band */
.band { border-block: 1px solid var(--rule); overflow: hidden; padding-block: 18px; }
.band-track { display: flex; width: max-content; }
.band-list { display: flex; flex: none; align-items: center; color: var(--text-dim); font-size: var(--step--1); white-space: nowrap; }
.band-list li { display: flex; align-items: center; }
.band-list li::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--status); margin-inline: 28px; opacity: 0.8; }

/* Sections */
.section { padding-top: clamp(72px, 10vw, 140px); }
.section-head { display: grid; gap: 16px; align-content: start; max-width: 36rem; }
.section-head-wide { max-width: 44rem; }
.section-name { display: flex; align-items: baseline; gap: 10px; color: var(--text-dim); font-size: var(--step--1); }
.section-num { color: var(--status); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.section h2 { font-size: var(--step-3); line-height: 1.05; letter-spacing: -0.015em; font-variation-settings: "opsz" 60; }
.section-intro { color: var(--text-dim); max-width: 52ch; }

/* Expertise */
.expertise { display: grid; gap: 48px; }
.areas { display: grid; gap: 0 48px; }
.area { display: grid; gap: 10px; align-content: start; padding-block: 24px 28px; border-top: 1px solid var(--rule); min-width: 0; }
.area h3 { font-size: var(--step-1); line-height: 1.2; font-variation-settings: "opsz" 24; }
.area p { color: var(--text-dim); font-size: 1rem; }
.area .proof { font-size: var(--step--1); }
.area .effect { font-family: var(--display); font-size: var(--step-1); line-height: 1.3; color: var(--text); font-variation-settings: "opsz" 24; }
.area-budget { border-top-color: var(--status); }
.area-budget .metrics { margin-block: 8px; }
.savings { display: grid; gap: 10px; padding: 18px 20px; background: var(--surface); border-radius: 2px; }
.savings h4 { font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); font-weight: 500; }
.savings ul { display: grid; gap: 8px; }
.savings li { color: var(--text-dim); padding-left: 18px; position: relative; }
.savings li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 6px; height: 6px; border-radius: 50%; background: var(--status); }
.savings b { color: var(--text); font-weight: 500; }
.area .proof a { color: var(--text); }

@media (min-width: 760px) {
  .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .area-budget { grid-column: 1 / -1; }
  /* min-content: word figures such as «Зелёный» are wider than an equal share and must not overlap the next one. */
  .area-budget .metrics { grid-template-columns: repeat(4, minmax(min-content, 1fr)); gap: 0 24px; }
  .area-budget .metrics div { grid-template-columns: minmax(min-content, 1fr); gap: 8px; border-top: 0; padding-block: 0; }
}
@media (min-width: 1100px) {
  .expertise { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 64px; }
  .expertise .section-head { position: sticky; top: calc(var(--header-h) + 40px); }
}

/* Cases */
.cases { margin-top: clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--rule); }
.case {
  display: grid;
  gap: 28px 64px;
  padding-block: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--rule);
}
.case-summary { display: grid; gap: 14px; align-content: start; min-width: 0; }
.case-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.case-tags li { padding: 3px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--text-dim); font-size: 0.8125rem; }
.case h3 { font-size: var(--step-2); line-height: 1.12; letter-spacing: -0.01em; font-variation-settings: "opsz" 48; }
.case-outcome { font-family: var(--display); font-style: italic; font-size: var(--step-1); line-height: 1.35; font-variation-settings: "opsz" 24; }
.case-text { color: var(--text-dim); max-width: 60ch; }

.rag { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: var(--step--1); color: var(--text-dim); }
.rag li { display: flex; align-items: center; gap: 8px; }
.rag-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--status); }

.metrics { display: grid; align-content: start; }
.metrics div { display: grid; grid-template-columns: minmax(min-content, 0.9fr) minmax(0, 1fr); gap: 16px; align-items: baseline; padding-block: 16px; border-top: 1px solid var(--rule); }
.metrics div:first-child { border-top: 0; padding-top: 0; }
.metrics dt { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); }
.metrics dd { margin-top: 0; }

.case details { grid-column: 1 / -1; }
.case summary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  font-size: var(--step--1);
}
.case summary::-webkit-details-marker { display: none; }
.case summary:hover .toggle-icon { border-color: var(--text); }
.toggle-icon { position: relative; width: 28px; height: 28px; border: 1px solid var(--rule); border-radius: 50%; transition: border-color 0.25s, transform 0.4s var(--ease-out); }
.toggle-icon::before, .toggle-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1px; background: var(--text); transform: translate(-50%, -50%); }
.toggle-icon::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform 0.4s var(--ease-out); }
details[open] .toggle-icon { transform: rotate(180deg); }
details[open] .toggle-icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.when-open { display: none; }
details[open] .when-open { display: inline; }
details[open] .when-closed { display: none; }

.case-detail {
  display: grid;
  gap: 24px 48px;
  margin-top: 20px;
  padding: clamp(20px, 3vw, 32px);
  background: var(--surface);
  border-radius: 4px;
}
.case-detail h4 { font-size: var(--step--1); font-weight: 600; color: var(--text); margin: 0 0 6px; }
.case-detail p { color: var(--text-dim); font-size: 1rem; max-width: 62ch; }

@media (min-width: 760px) {
  .case-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .case { grid-template-columns: 88px minmax(0, 7fr) minmax(0, 5fr); column-gap: 48px; }
  .case details { grid-column: 2 / -1; }
}

/* Case icons: one schematic per case, drawn on a faint dot grid. Green marks the outcome in each. */
.case-icon {
  display: block;
  width: 64px;
  height: 64px;
  max-width: 100%;
  overflow: visible;
  color: var(--text-dim);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  background: radial-gradient(circle, var(--rule) 0 0.8px, transparent 1.2px) 0 0 / 12.5% 12.5%;
  transition: color 0.4s;
}
.case-icon .k { stroke: var(--text); }
.case-icon .n { fill: var(--bg); }
.case-icon .f { fill: currentColor; stroke: none; }
.case-icon .g { fill: var(--status); stroke: none; }
.case-icon .gs { stroke: var(--status); }
.case-icon .gt { fill: rgba(143, 207, 166, 0.16); fill: color-mix(in srgb, var(--status) 16%, transparent); stroke: var(--status); }
.case-icon .m { transform-box: view-box; transform-origin: 32px 32px; }
.case-icon .a { transform-box: fill-box; transform-origin: center; }
.case:hover .case-icon { color: var(--text); }
@media (min-width: 1000px) {
  .case-icon { width: 88px; height: 88px; }
}

/* Recognition */
.recognition { display: grid; gap: 32px; }
.awards { display: grid; border-top: 1px solid var(--rule); }
.awards li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-block: 22px; border-bottom: 1px solid var(--rule); }
.award-name { font-family: var(--display); font-size: var(--step-2); line-height: 1.15; font-variation-settings: "opsz" 48; }
.award-level { color: var(--text-dim); font-size: var(--step--1); }
@media (min-width: 1100px) {
  .recognition { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 64px; align-items: start; }
}

/* Contact */
.contact { display: grid; gap: 24px; padding-bottom: clamp(72px, 10vw, 140px); }
.contact .contact-title { font-size: var(--step-4); line-height: 0.95; letter-spacing: -0.025em; font-variation-settings: "opsz" 72; }
.contact-text { color: var(--text-dim); max-width: 48ch; }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.contact-email { font-family: var(--display); font-size: clamp(1.375rem, 1rem + 2vw, 2.5rem); overflow-wrap: anywhere; }
.contact-links { font-size: var(--step-0); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); color: var(--text-dim); font-size: var(--step--1); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); }

/* ------------------------------------------------------------------
   Motion. Everything below is an enhancement: with reduced motion,
   without JavaScript or if a script fails, the page is complete.
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  /* 1. Page-load sequence (CSS only, ends fully visible). */
  .hero-value .line > span { animation: rise 1.1s var(--ease-out) both; }
  .hero-value .line:nth-child(1) > span { animation-delay: 0.1s; }
  .hero-value .line:nth-child(2) > span { animation-delay: 0.22s; }
  .hero-focus, .hero-name { animation: fade 0.8s var(--ease-out) 0.4s both; }
  .hero-role { animation: fade 0.8s var(--ease-out) both; }
  .hero-say { animation: fade 0.8s var(--ease-out) 0.45s both; }
  .hero-photo img { animation: unveil 1.4s var(--ease-out) 0.25s both; }
  .hero-body > * { animation: fade-up 0.9s var(--ease-out) both; }
  .hero-body > :nth-child(1) { animation-delay: 0.55s; }
  .hero-body > :nth-child(2) { animation-delay: 0.68s; }
  .hero-body > :nth-child(3) { animation-delay: 0.8s; }
  .proof-strip { animation: fade 1s var(--ease-out) 0.9s both; }
  .status-dot { animation: pulse 2.6s ease-out 1.6s infinite; }

  /* 2. Running band of platforms. */
  .band-track { animation: marquee 48s linear infinite; }
  .band:hover .band-track, .band:focus-within .band-track { animation-play-state: paused; }

  /* 3. Scroll reveals: JS adds .will-reveal only to elements still below the fold. */
  .js .will-reveal { opacity: 0; transform: translateY(28px); }
  .js .will-reveal.is-in { opacity: 1; transform: none; transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }

  /* 4. Case icons draw themselves when their case scrolls in. The end state has no
        dash pattern, so a browser without pathLength support still ends with solid lines. */
  .js .will-reveal .case-icon .s { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .js .will-reveal .case-icon .d, .js .will-reveal .case-icon .a { opacity: 0; }
  .js .will-reveal.is-in .case-icon .s { stroke-dasharray: none; stroke-dashoffset: 0; animation: draw 1.3s var(--ease-out) 0.25s backwards; }
  .js .will-reveal.is-in .case-icon .d { opacity: 1; animation: fade 0.8s var(--ease-out) 0.8s backwards; }
  .js .will-reveal.is-in .case-icon .a { opacity: 1; animation: pop 0.7s var(--ease-out) 1.1s backwards; }
  .case-icon .m { transition: transform 0.8s var(--ease-out); }
  @media (hover: hover) {
    .case:hover .case-icon .m { transform: var(--to); }
  }

  /* 5. Opening a case. */
  details[open] > .case-detail { animation: fade-up 0.5s var(--ease-out) both; }
  details::details-content { transition: height 0.45s var(--ease-out), content-visibility 0.45s allow-discrete; height: 0; overflow: clip; }
  details[open]::details-content { height: auto; }

  .copy[data-state="done"] { border-color: var(--status); color: var(--status); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .band-track { width: auto; }
  .band-list { flex-wrap: wrap; white-space: normal; row-gap: 8px; padding-inline: var(--gutter); }
  .band-list[aria-hidden="true"] { display: none; }
}

@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes unveil { from { clip-path: inset(100% 0 0 0); transform: scale(1.08); } to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes draw { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: none; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--glow); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media print {
  .site-header, .band, .copy { display: none; }
  .js .will-reveal { opacity: 1 !important; transform: none !important; }
  details > .case-detail { display: grid; }
}
