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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--step-0);
  background: var(--canvas);
  color: var(--ink);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* One gutter rule for every full-bleed band: content is centred in 72rem,
   never closer than 1.25rem to the edge. */
header,
section,
footer {
  --gutter: max(1.25rem, calc((100% - 72rem) / 2));
  padding-inline: var(--gutter);
}

a,
button,
summary {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  margin: 0 0 var(--space-4);
  line-height: var(--leading);
  text-wrap: pretty;
}

a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--link);
}

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

/* Site-only tokens, built from the app's tokens in tokens.css. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/static/fonts/bricolage-grotesque-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-display: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
  --section-pad: 7rem;
  --shadow-stage: 0 24px 60px -12px rgb(11 26 42 / 0.22);
  --wash-a: #c4dcfa;
  --wash-b: #e0d3f7;
  --wash-c: #fad9c6;
  --wash-d: #cdeee9;
  --swirl-1: #b4a0ee;
  --swirl-2: #f2a285;
  --swirl-3: #ee9dc2;
  --radius-panel: 0.75rem;
  --shadow-window: 0 24px 60px -12px rgb(11 26 42 / 0.22), 0 10px 40px rgb(11 26 42 / 0.08);
  --shadow-soft: 0 1px 2px rgb(11 26 42 / 0.05);
  --flag-red: #da291c;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --deep-a: #0b1a2a;
  --deep-b: #0d3463;
  --on-deep: #ffffff;
  --on-deep-muted: #c9d7e6;
  --deep-link: #9dccff;
  --lift: rgb(11 26 42 / 0.16);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wash-a: #123257;
    --wash-b: #2a2457;
    --wash-c: #4b2d33;
    --wash-d: #0f3e3b;
    --shadow-stage: 0 24px 60px -12px rgb(0 0 0 / 0.6);
    --swirl-1: #8f7de0;
    --swirl-2: #e58f74;
    --swirl-3: #d77fab;
    --shadow-window: 0 24px 60px -12px rgb(0 0 0 / 0.6), 0 10px 40px rgb(0 0 0 / 0.35);
    --shadow-soft: 0 1px 2px rgb(0 0 0 / 0.3);
    --deep-a: #0f1b29;
    --deep-b: #12396a;
    --lift: rgb(0 0 0 / 0.55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --wash-a: #123257;
  --wash-b: #2a2457;
  --wash-c: #4b2d33;
  --wash-d: #0f3e3b;
  --shadow-stage: 0 24px 60px -12px rgb(0 0 0 / 0.6);
  --swirl-1: #8f7de0;
  --swirl-2: #e58f74;
  --swirl-3: #d77fab;
  --shadow-window: 0 24px 60px -12px rgb(0 0 0 / 0.6), 0 10px 40px rgb(0 0 0 / 0.35);
  --shadow-soft: 0 1px 2px rgb(0 0 0 / 0.3);
  --deep-a: #0f1b29;
  --deep-b: #12396a;
  --lift: rgb(0 0 0 / 0.55);
}

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

/* ---------- Header: floating pill nav over the hero wash ---------- */

header {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-4);
  min-height: 4.5rem;
  border-bottom: 1px solid transparent;
}

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.5rem;
  line-height: 1.2;
}

header .wordmark {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--ink);
  text-decoration: none;
}

header .btn {
  justify-self: end;
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

header .wordmark,
.header-actions .btn {
  white-space: nowrap;
}

@media (max-width: 39.99rem) {
  header {
    gap: var(--space-1);
  }

  header .wordmark {
    font-size: 1.25rem;
  }

  .header-actions .btn-small {
    padding-inline: var(--space-2);
  }
}

@media (max-width: 25.35rem) {
  header > * {
    min-width: 0;
  }

  .header-actions .btn-small {
    display: none;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--target);
  height: var(--target);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  background: var(--surface);
}

.theme-toggle .icon {
  width: 1.25rem;
  height: 1.25rem;
  background: var(--ink);
}

.i-moon { --glyph: url("/static/img/icons/moon.svg"); }
.i-sun { --glyph: url("/static/img/icons/sun.svg"); }

/* nav: the inline links from 60rem, the details menu below it; the one not shown is display:none,
   so only one of them is ever in the accessibility tree. */
.nav-links {
  display: none;
  justify-self: center;
  gap: var(--space-1);
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 6.25rem;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.nav-links a,
.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 var(--space-3);
  border-radius: 6.25rem;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
}

.foot-links a {
  border-radius: 0.5rem;
}

.nav-links a:hover,
.foot-links a:hover {
  color: var(--ink);
}

.nav-links a:hover {
  background: var(--surface);
}

.nav-links a[aria-current="page"],
.nav-menu a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 620;
}

.nav-menu {
  justify-self: end;
}

.nav-menu summary {
  display: flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--ink);
  font-weight: 560;
  list-style: none;
  cursor: pointer;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu[open] summary {
  background: var(--surface);
}

.nav-menu nav {
  position: absolute;
  top: calc(100% - 0.5rem);
  inset-inline: var(--gutter);
  display: grid;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-window);
}

.nav-menu nav a {
  display: flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 var(--space-4);
  border-radius: 0.5rem;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
}

.nav-menu nav a:hover {
  background: var(--surface-sunk);
  color: var(--ink);
}

/* ---------- Sub-pages ---------- */

#page-head {
  position: relative;
  padding-top: 9rem;
  padding-bottom: var(--space-8);
}

#page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(48rem 30rem at 12% 8%, var(--wash-b), transparent 70%),
    radial-gradient(44rem 28rem at 88% 2%, var(--wash-c), transparent 70%),
    radial-gradient(60rem 26rem at 50% 38%, var(--wash-a), transparent 72%),
    radial-gradient(34rem 20rem at 78% 62%, var(--wash-d), transparent 70%);
}

.page-intro {
  max-width: 48rem;
}

.page-intro h1 {
  font-size: clamp(44px, 6.5vw, 88px);
  line-height: 1;
  letter-spacing: -0.035em;
}

.page-intro .lede {
  margin-top: var(--space-4);
  font-size: var(--step-1);
  color: var(--ink-muted);
}

.prose-row {
  border-top: 1px solid var(--line);
  padding-block: var(--space-7);
}

.prose-head h2 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
}

.prose-body p {
  max-width: 40rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* layout: page. Full-width bands for the inner pages; .prose-row stays for the legal pages and
   the guides, which keep their two-column rows. */

.band-page {
  padding-block: var(--space-7);
  border-top: 1px solid var(--line);
}

.band-page > h2 {
  margin-bottom: var(--space-5);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
}

.band-page p {
  max-width: 40rem;
}

.band-wide p {
  max-width: none;
}

.legend {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin: 0;
}

.legend > div {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.legend dt {
  margin-bottom: var(--space-2);
  color: var(--brand);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legend dd {
  margin: 0;
  color: var(--ink-muted);
  line-height: var(--leading);
}

/* cards: a grid that fills the container, and block-level card links */

.card-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.card-link {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  min-height: var(--target);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  text-decoration: none;
}

.card-link:hover {
  border-color: var(--brand);
}

.card-name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.2;
}

.card-desc {
  color: var(--ink-muted);
  line-height: var(--leading);
}

/* roadmap stages: three full-width stages, each a card grid; the track diagram carries the connector */

.road-stages {
  display: grid;
  gap: var(--space-7);
  grid-template-columns: minmax(0, 1fr);
  margin: var(--space-7) 0 0;
  padding: 0;
  list-style: none;
}

.road-stage {
  min-width: 0;
  scroll-margin-top: var(--space-6);
}

.road-stage > h2 {
  margin-bottom: var(--space-4);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
}

.road-card {
  scroll-margin-top: var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.road-card > .claim {
  margin-top: 0;
}

.road-card h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.2;
}

.road-card p,
.claim .road-card p {
  margin: 0 0 var(--space-3);
}

.road-stage > .claim {
  margin-top: 0;
}

.road-stage > .claim > p:not(.why) {
  max-width: 40rem;
  margin-bottom: var(--space-4);
}

.road-stage > .claim > .card-grid + p {
  margin-top: var(--space-5);
}

.why-label {
  margin-right: var(--space-2);
  color: var(--brand);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.how {
  margin-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.how summary {
  display: flex;
  align-items: center;
  min-height: var(--target);
  color: var(--ink);
  font-weight: 560;
  cursor: pointer;
}

.how p {
  margin-top: var(--space-2);
}

/* diagram kit: strokes in currentColor, the accent from var(--brand). The motion classes are in the
   Motion section below; without them every diagram is its finished state. */

.diagram-figure {
  margin: var(--space-6) 0;
}

.diagram {
  display: block;
  width: 100%;
  max-width: 72rem;
  height: auto;
  color: var(--ink);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diagram .accent {
  stroke: var(--brand);
}

.diagram .solid {
  fill: var(--brand);
  stroke: none;
}

.diagram-figure figcaption {
  max-width: 40rem;
  margin-top: var(--space-3);
  color: var(--ink-muted);
}

/* for clinics: a text column beside its picture, the hand-over on a wash, the steps as a timeline
   beside the You / We split, the FAQ, and the invitation on a deep band */

.split-media {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 60rem) {
  .split-media {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.diagram.v-art {
  justify-self: center;
  max-width: 26rem;
  overflow: visible;
}

#clinics-handover {
  background:
    radial-gradient(46rem 24rem at 8% 0%, var(--wash-b), transparent 70%),
    radial-gradient(40rem 26rem at 96% 35%, var(--wash-a), transparent 70%),
    radial-gradient(52rem 22rem at 55% 112%, var(--wash-d), transparent 72%);
}

#clinics-handover .stop-head p {
  color: var(--ink);
}

.hand-stops .stop-head p::before {
  content: counter(fstep) ". ";
  color: var(--brand);
  font-weight: 650;
}

#clinics-heba {
  background: radial-gradient(48rem 26rem at 92% 55%, var(--wash-d), transparent 70%);
}

/* the vignettes: raised cards and the shapes on them, all from the tokens */
.diagram .v-card,
.diagram .v-win,
.diagram .v-sheet {
  fill: var(--surface);
  stroke: var(--line);
}

.diagram .v-win {
  fill: var(--canvas);
}

.diagram .v-bar {
  stroke: var(--line-strong);
  stroke-width: 3;
  opacity: 0.45;
}

.diagram .v-dot {
  fill: var(--line-strong);
  stroke: none;
}

.diagram .v-panel { fill: var(--surface-sunk); stroke: none; }
.diagram .v-pick { fill: var(--kind-visit-bg); stroke: none; }
.diagram .v-dx { fill: var(--kind-diagnosis-bg); stroke: none; }
.diagram .v-lab { fill: var(--kind-lab-bg); stroke: none; }
.diagram .v-doc { fill: var(--kind-document-bg); stroke: none; }
.diagram .dotted { stroke-dasharray: 1 5; }
.lift { flood-color: var(--lift); }

.work-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 60rem) {
  .work-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.clinic-steps {
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: cstep;
}

.clinic-steps li {
  position: relative;
  min-height: 2.5rem;
  padding: 0.35rem 0 var(--space-6) 3.5rem;
  line-height: var(--leading);
  counter-increment: cstep;
}

.clinic-steps li::before {
  content: counter(cstep);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid var(--brand);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  font-weight: 650;
}

.clinic-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 2.25rem;
  bottom: 0;
  left: calc(1.125rem - 1px);
  width: 2px;
  background: linear-gradient(var(--brand), color-mix(in srgb, var(--brand) 20%, transparent));
}

.split {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.split-col {
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.split-col:last-child {
  border-color: transparent;
  background: linear-gradient(150deg, var(--deep-a), var(--deep-b));
  box-shadow: var(--shadow-window);
  color: var(--on-deep);
}

.split-col h3 {
  margin-bottom: var(--space-3);
  color: var(--brand);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.split-col:last-child h3 {
  color: var(--deep-link);
}

.split-col ul {
  margin: 0;
  padding-left: 1.25rem;
  line-height: var(--leading);
}

.counts {
  display: grid;
  gap: var(--space-5);
  max-width: 40rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.counts li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.counts .icon {
  margin-top: 0.15em;
}

.counts p {
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.35;
}

.faq {
  max-width: 48rem;
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.faq:hover {
  border-color: var(--line-strong);
}

.faq + .faq {
  margin-top: var(--space-3);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--target);
  font-weight: 560;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--brand);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

.faq[open] summary::after {
  content: "\2212";
}

.faq p {
  margin-bottom: var(--space-3);
}

#clinics-more {
  border-top: 0;
  background:
    radial-gradient(40rem 22rem at 92% 0%, color-mix(in srgb, var(--deep-link) 22%, transparent), transparent 70%),
    linear-gradient(135deg, var(--deep-a), var(--deep-b));
  color: var(--on-deep);
}

#clinics-more h2 {
  color: var(--on-deep);
}

#clinics-more .claim-label,
#clinics-more a {
  color: var(--deep-link);
}

#clinics-more p,
#clinics-more .claim p {
  color: var(--on-deep-muted);
}

/* ---------- Guides: body face, hub cards, the guide template ---------- */

.guides h1,
.guides h2,
.guides h3 {
  font-family: var(--font-body);
  letter-spacing: -0.02em;
}

.guides .page-intro h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
}

.guides .page-intro .lede {
  margin-top: var(--space-4);
}

.guide-group + .guide-group {
  margin-top: var(--space-6);
}

.guide-group h2 {
  margin-block: var(--space-5) var(--space-4);
  font-size: clamp(22px, 2.4vw, 28px);
}

.card-meta,
.guide-meta,
.stat-source,
.guide-crumbs {
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.chip {
  justify-self: start;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.guide-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.guide-crumbs li + li::before {
  content: "/";
  margin-right: var(--space-2);
}

@media (max-width: 39.99rem) {
  .guide-crumbs {
    position: relative;
  }

  .guide-crumbs li[aria-current] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .guide-crumbs li + li::before {
    content: none;
  }
}

.guide-meta {
  margin: var(--space-3) 0 0;
}

.guide-meta time::before {
  content: "\b7";
  margin-inline: var(--space-2);
}

.guide-layout {
  display: grid;
  gap: var(--space-5);
  max-width: 72rem;
  margin-inline: auto;
  padding: 0 1.25rem var(--space-7);
}

.guide-toc-wrap,
.guide-toc ol {
  counter-reset: toc;
}

.guide-toc li {
  counter-increment: toc;
}

.guide-toc li::before {
  content: counter(toc) ". ";
  margin-right: var(--space-2);
  color: var(--ink-muted);
}

.guide-toc li {
  display: flex;
  align-items: center;
}

.toc-rail {
  display: none;
}

.toc-fold {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.toc-fold summary {
  display: flex;
  align-items: center;
  min-height: var(--target);
  font-weight: 560;
  cursor: pointer;
}

.guide-main {
  min-width: 0;
  max-width: 44rem;
  counter-reset: sec;
}

.guide-takeaways,
.guide-more {
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.guide-takeaways h2,
.guide-related h2,
.guide-more h2 {
  margin-bottom: var(--space-3);
  font-size: 1.25rem;
}

.guide-takeaways li {
  max-width: 40rem;
  padding-left: var(--space-4);
  border-left: 3px solid var(--brand);
}

.guide-takeaways li + li {
  margin-top: var(--space-3);
}

.guide-strip {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.guide-strip li {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius-panel);
}

.strip-name {
  font-weight: 650;
}

.guide-print {
  margin-top: var(--space-4);
  color: var(--ink-muted);
}

.guide-section,
.guide-related,
.guide-more {
  margin-top: var(--space-6);
}

.guide-section {
  padding: 0;
}

.guide-section > h2 {
  margin-bottom: var(--space-3);
  font-size: clamp(22px, 2.4vw, 28px);
}

.guide-section > h2::before {
  counter-increment: sec;
  content: counter(sec) ". ";
  color: var(--brand);
}

.guide-section h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: 1.0625rem;
}

.guide-list {
  max-width: 40rem;
  margin-top: var(--space-3);
}

.guide-list li {
  position: relative;
  padding-left: 2rem;
}

.guide-list li + li {
  margin-top: var(--space-2);
}

.guide-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 0.25rem;
}

.stat-tiles {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  margin-top: var(--space-4);
}

@media (max-width: 39.99rem) {
  .stat-tiles li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

.stat-tiles li {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.stat-big {
  color: var(--brand);
  font-size: var(--step-2);
  font-weight: 650;
  line-height: 1.1;
}

.diagram-steps {
  padding-left: 1.25rem;
  list-style: decimal;
}

.diagram-figure figcaption:has(.diagram-steps) {
  max-width: none;
}

/* The steps sit under their nodes: the columns are equal, and the svgs place their nodes at the
   column centres (handover: 4 boxes at 12.5/37.5/62.5/87.5%, typing: 2 boxes and the arrows at
   16.7/50/83.3%). */
@media (min-width: 40rem) {
  .diagram-steps {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: var(--space-3);
    padding-left: 0;
    list-style: none;
    text-align: center;
    counter-reset: dstep;
  }

  .diagram-steps li {
    counter-increment: dstep;
  }

  .diagram-steps li::before {
    content: counter(dstep) ". ";
    color: var(--brand);
    font-weight: 650;
  }
}

/* the roadmap track: diagram 4. The items are a list below 60rem and a flex row of equal shares from
   60rem, each share centred under its node (the svg places the nodes at the share centres). */

.track-steps {
  display: block;
  padding: 0;
  list-style: none;
  text-align: start;
}

.track-steps li::before {
  content: none;
}

.track-steps li {
  margin-bottom: var(--space-3);
}

.track-steps .claim {
  margin-top: 0;
}

.track-later {
  margin: 0;
  padding: 0;
  list-style: none;
}

.track-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--ink);
}

#roadmap-track svg {
  display: none;
}

.diagram .track-solid,
.diagram .track-dashed,
.diagram .track-dotted {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
}

.diagram .track-dashed {
  stroke-dasharray: 10 8;
}

.diagram .track-dotted {
  stroke-dasharray: 1 8;
  stroke-width: 3;
}

.diagram .hollow {
  fill: var(--canvas);
  stroke: var(--brand);
  stroke-width: 2;
}

@media (min-width: 60rem) {
  #roadmap-track svg {
    display: block;
  }

  .track-steps {
    display: flex;
    text-align: center;
  }

  .track-steps > li {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    padding-inline: var(--space-1);
  }

  .track-steps > .track-group {
    flex: 4 1 0;
  }

  .track-later {
    display: flex;
  }

  .track-later > li {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: var(--space-2);
  }

  .track-steps .claim-label {
    margin-inline: auto;
  }

  .track-steps .track-link {
    justify-content: center;
    font-size: 0.9375rem;
    line-height: 1.3;
    text-align: center;
    text-wrap: balance;
    text-underline-offset: 0.2em;
  }
}

.guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

@media (min-width: 40rem) {
  .guide-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 60rem) {
  .guide-layout {
    grid-template-columns: 14rem minmax(0, 44rem);
    gap: var(--space-7);
  }

  .toc-fold {
    display: none;
  }

  .toc-rail {
    position: sticky;
    top: 6rem;
    display: block;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--target);
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: var(--cta);
  color: var(--on-cta);
  font: inherit;
  font-weight: 560;
  text-decoration: none;
}

.btn:hover {
  background: var(--cta-hover);
}

.btn-small {
  padding: var(--space-2) var(--space-5);
  font-size: var(--step--1);
}

.btn-ghost {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: var(--surface);
}

/* The pill is for the nav and the two calls to action only (ADR-025). */
header .btn,
#hero .btn,
#cta .btn {
  border-radius: 6.25rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ---------- Sections ---------- */

main {
  display: block;
}

section {
  padding-block: var(--section-pad);
  scroll-margin-top: var(--nav-height);
}

section .head {
  max-width: 44rem;
  margin-bottom: var(--space-6);
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(36px, 4.5vw, 60px);
  line-height: 1.02;
}

h3 {
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 620;
}

em {
  font-style: normal;
  color: var(--brand);
}

.kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand);
}

.dot {
  display: inline-block;
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--brand);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: 0.25rem;
  color: var(--ink-muted);
  font-size: var(--step--1);
  font-weight: 560;
}

/* A roadmap or direction passage: one small-caps tag in the accent colour,
   always first (register classes, landing S1). */
.claim {
  margin-top: var(--space-4);
}

.claim-label,
.stage-label {
  display: flex;
  align-items: center;
  width: fit-content;
  min-width: var(--target);
  min-height: var(--target);
  margin-block: -0.75rem calc(var(--space-2) - 0.75rem);
  color: var(--brand);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.claim-label:hover,
.stage-label:hover {
  text-decoration: underline;
}

.claim p {
  margin-bottom: 0;
  color: var(--ink-muted);
}

#approach > .lede,
#guides > .lede {
  max-width: 44rem;
  margin: 0 0 var(--space-6);
  font-size: var(--step-1);
}

#approach > .text-link,
#guides > .text-link {
  margin-top: var(--space-5);
}

#who {
  padding-top: 0;
}

/* ---------- What we are building: the three-stage roadmap flow ---------- */

#building > .text-link {
  margin-top: var(--space-5);
}

.road-item,
#building .claim,
#roadmap-next .claim {
  margin-top: var(--space-5);
}

.step-body > h3 + .road-item,
.step-body > h3 + .claim,
.prose-body > :first-child {
  margin-top: 0;
}

.road-item h3,
.road-item h4,
.claim h3,
.claim h4 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.2;
}

.road-item h4 a,
.claim h4 a {
  color: inherit;
  text-decoration: none;
}

.road-item h4 a:hover,
.claim h4 a:hover {
  text-decoration: underline;
}

.road-item p {
  margin-bottom: 0;
}

.claim > p {
  margin-top: var(--space-4);
}

.claim .road-item {
  margin-top: var(--space-4);
}

.claim .road-item:first-of-type {
  margin-top: 0;
}

.updated {
  margin: var(--space-3) 0 0;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

/* ---------- Hero: on an atmospheric wash; centred on the phone, left-aligned from the desktop breakpoint ---------- */

#hero {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  gap: var(--space-6);
  padding-block: 6.5rem var(--space-8);
  text-align: center;
  overflow-x: clip;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0 0 -6rem;
  z-index: -2;
  background:
    radial-gradient(48rem 30rem at 12% 8%, var(--wash-b), transparent 70%),
    radial-gradient(44rem 28rem at 88% 2%, var(--wash-c), transparent 70%),
    radial-gradient(60rem 26rem at 50% 38%, var(--wash-a), transparent 72%),
    radial-gradient(34rem 20rem at 78% 62%, var(--wash-d), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
}

/* The hero line is ONE stroke: page background, across the video window, page background. .swirl-anchor is a zero-height box at the
   height where the stroke enters the window (92.5% down the video frame: 2.25rem window bar + 1px border + 45.63% of the window
   width, less 1.04px for the video's 2px of border), and the svg is sized and offset in percent of the window width, so it holds at every
   width. The svg sits OVER the window; the video leaves a clear corridor there (medical-personal-vault-video scripts/hero-thread.mjs). */
.swirl-anchor {
  position: absolute;
  top: calc(1px + 2.25rem);
  left: 0;
  width: 100%;
  height: 0;
  padding-top: calc(45.631% - 1.04px);
  z-index: 1;
  pointer-events: none;
}

.swirl {
  position: absolute;
  top: 100%;
  left: -60%;
  width: 220%;
  height: auto;
  transform: translateY(-27.2727%);
}

.swirl .s1 { stop-color: var(--swirl-1); }
.swirl .s2 { stop-color: var(--swirl-2); }
.swirl .s3 { stop-color: var(--swirl-3); }

.hero-copy {
  max-width: 54rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
  padding: var(--space-1) var(--space-4);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--ink-muted);
  font-size: var(--step--1);
  font-weight: 560;
  line-height: 1.6;
}

#hero h1 {
  margin: 0 0 var(--space-5);
  font-size: clamp(2.75rem, 1rem + 5.5vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.hero-copy > p:not(.badge) {
  max-width: 42rem;
  margin: 0 auto var(--space-6);
  font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-muted);
}

.hero-copy > p.hero-trust {
  margin-bottom: var(--space-4);
  font-size: var(--step-0);
}

.hero-copy > .claim {
  max-width: 42rem;
  margin: 0 auto var(--space-6);
}

.hero-copy > .claim {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-copy .claim .claim-label {
  margin-block: -9px -1px;
  padding: var(--space-1) var(--space-3);
  border-block: 9px solid transparent;
  border-radius: var(--radius-sm) / calc(var(--radius-sm) + 9px);
  background: color-mix(in srgb, var(--brand) 12%, transparent) padding-box;
  font-size: 0.875rem;
}

.hero-copy .claim p {
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.5;
}

.hero-copy .actions {
  justify-content: center;
}

.hero-copy .btn {
  min-height: 3.25rem;
  padding-inline: var(--space-6);
}

@media (min-width: 60rem) {
  #hero {
    justify-items: start;
    text-align: left;
  }

  .hero-copy > p:not(.badge) {
    margin-inline: 0;
  }

  .hero-copy > .claim {
    margin-inline: 0;
    align-items: flex-start;
  }

  .hero-copy .actions {
    justify-content: flex-start;
  }
}

.hero-track {
  width: 100%;
  max-width: 72rem;
  margin: var(--space-5) 0 0;
}

.preview {
  width: 100%;
  margin: 0;
}

/* story.js adds .is-scrubbed where it scrubs the film (strong device, fine pointer, the pin query): the preview sticks
   below the header while a spacer supplies the scroll distance the film is scrubbed over. Without the class, nothing here. */
.hero-track.is-scrubbed {
  --hero-d: calc(var(--hero-scenes, 7) * 50vh);
}

.hero-track.is-scrubbed::after {
  content: "";
  display: block;
  height: var(--hero-d);
}

.hero-track.is-scrubbed .preview {
  position: sticky;
  top: 5rem;
}

.window {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-window);
  text-align: left;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.25rem;
  padding-inline: var(--space-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-sunk);
}

.window-bar span {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--line-strong);
  opacity: 0.45;
}

.window picture {
  display: block;
}

.window img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-video,
.hero-video-poster {
  display: block;
  width: 100%;
  height: auto;
}

.window .hero-video-poster-picture {
  display: none;
}

.hero-example-label {
  display: none;
}

.preview {
  position: relative;
}

.preview figcaption {
  margin-top: var(--space-4);
  color: var(--ink-muted);
  font-size: var(--step--1);
  text-align: center;
}

/* ---------- Icons ---------- */

.icon {
  display: block;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--brand);
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}

.i-lock { --glyph: url("/static/img/icons/lock.svg"); }
.i-source { --glyph: url("/static/img/icons/source.svg"); }
.i-agreed { --glyph: url("/static/img/icons/agreed.svg"); }
.i-nointerpret { --glyph: url("/static/img/icons/nointerpret.svg"); }
.i-store { --glyph: url("/static/img/icons/store.svg"); }
.i-compass { --glyph: url("/static/img/icons/compass.svg"); }
.i-pin { --glyph: url("/static/img/icons/pin.svg"); }
.i-shield { --glyph: url("/static/img/icons/shield.svg"); }

/* ---------- Stepper: radio inputs drive the stage, CSS only ---------- */

#sections {
  padding-top: var(--space-8);
}

.stepper {
  position: relative;
  display: grid;
  gap: var(--space-6);
}

.step-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.stage {
  order: -1;
  padding: var(--space-5);
  border-radius: var(--radius-panel);
  background:
    radial-gradient(34rem 24rem at 100% 0%, var(--wash-b), transparent 70%),
    var(--surface-sunk);
}

.shots {
  display: grid;
  max-width: 760px;
  margin-inline: auto;
}

.stage .window {
  box-shadow: var(--shadow-stage);
}

.shot {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
}

#step-1:checked ~ .stage .shot-1,
#step-2:checked ~ .stage .shot-2,
#step-3:checked ~ .stage .shot-3,
#step-4:checked ~ .stage .shot-4,
#step-5:checked ~ .stage .shot-5 {
  opacity: 1;
  visibility: visible;
}

.step-list {
  display: grid;
  align-content: start;
}

.step-row label {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  align-items: start;
  min-height: var(--target);
  padding: var(--space-5) var(--space-4) var(--space-5) var(--space-5);
  border-left: 2px solid var(--line);
  border-radius: 0 0.5rem 0.5rem 0;
  color: var(--ink-muted);
  cursor: pointer;
}

.step-row label:hover {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.num {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--brand);
}

.step-copy {
  display: grid;
  gap: var(--space-2);
}

.step-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  opacity: 0.6;
}

.step-text {
  display: none;
  max-width: 28rem;
  line-height: var(--leading);
}

#step-1:checked ~ .step-list .step-row:nth-child(1) label,
#step-2:checked ~ .step-list .step-row:nth-child(2) label,
#step-3:checked ~ .step-list .step-row:nth-child(3) label,
#step-4:checked ~ .step-list .step-row:nth-child(4) label,
#step-5:checked ~ .step-list .step-row:nth-child(5) label {
  border-left-color: var(--brand);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

#step-1:checked ~ .step-list .step-row:nth-child(1) label::after,
#step-2:checked ~ .step-list .step-row:nth-child(2) label::after,
#step-3:checked ~ .step-list .step-row:nth-child(3) label::after,
#step-4:checked ~ .step-list .step-row:nth-child(4) label::after,
#step-5:checked ~ .step-list .step-row:nth-child(5) label::after {
  content: "";
  display: block;
  grid-column: 1 / -1;
  margin-top: var(--space-4);
  width: 100%;
  height: 1px;
  background: var(--brand);
}

#step-1:checked ~ .step-list .step-row:nth-child(1) .step-text,
#step-2:checked ~ .step-list .step-row:nth-child(2) .step-text,
#step-3:checked ~ .step-list .step-row:nth-child(3) .step-text,
#step-4:checked ~ .step-list .step-row:nth-child(4) .step-text,
#step-5:checked ~ .step-list .step-row:nth-child(5) .step-text {
  display: block;
}

#step-1:checked ~ .step-list .step-row:nth-child(1) .step-title,
#step-2:checked ~ .step-list .step-row:nth-child(2) .step-title,
#step-3:checked ~ .step-list .step-row:nth-child(3) .step-title,
#step-4:checked ~ .step-list .step-row:nth-child(4) .step-title,
#step-5:checked ~ .step-list .step-row:nth-child(5) .step-title {
  opacity: 1;
}

.stepper:has(#step-1:focus-visible) .step-row:nth-child(1) label,
.stepper:has(#step-2:focus-visible) .step-row:nth-child(2) label,
.stepper:has(#step-3:focus-visible) .step-row:nth-child(3) label,
.stepper:has(#step-4:focus-visible) .step-row:nth-child(4) label,
.stepper:has(#step-5:focus-visible) .step-row:nth-child(5) label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Trust and approach: cards in a row ---------- */

.points {
  display: grid;
  gap: var(--space-5);
}

.point {
  display: grid;
  align-content: start;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.point-head {
  display: grid;
  justify-items: start;
  gap: var(--space-4);
}

.mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
}

.mark .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.point-head h3 {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.point-body p {
  color: var(--ink-muted);
}

.point-body p:last-child {
  margin-bottom: 0;
}

/* ---------- How it works: large serif numerals ---------- */

.flow {
  border-bottom: 1px solid var(--line-strong);
}

.step {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: var(--space-5);
  padding-block: var(--space-6);
  border-top: 1px solid var(--line-strong);
}

.node {
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 4.5rem;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.step-body {
  max-width: 42rem;
}

.step-body h3 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.step-body p:last-child {
  margin-bottom: 0;
}

.step-body .tag {
  margin-top: var(--space-4);
}

.step-muted h3,
.step-muted p {
  color: var(--ink-muted);
}

.step-muted .node {
  color: var(--ink-muted);
}

/* the clinic hand-over note under the How it works cards: not built, so muted */
.flow-clinic {
  max-width: 42rem;
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line-strong);
}

.flow-clinic h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
}

.flow-clinic p {
  margin: 0;
  color: var(--ink-muted);
}

.flow-clinic .tag {
  margin-top: var(--space-3);
}

/* ---------- Gallery: the app's screens ---------- */

.gallery {
  display: grid;
  gap: var(--space-6);
}

.gallery-item {
  --stage-w: min(76rem, 100vw - 2.5rem);
  margin: 0;
}

.gallery-item figcaption {
  margin-top: var(--space-4);
  padding-inline: calc((100% - var(--stage-w)) / 2 + 48px);
}

.gallery-stage {
  --stage-w: min(76rem, 100vw - 2.5rem);
  width: var(--stage-w);
  margin-inline: calc((100% - var(--stage-w)) / 2);
  padding: 48px;
  box-shadow: none;
  border-radius: var(--radius-panel);
}

.wash-a { background: var(--wash-a); }
.wash-c { background: var(--wash-c); }
.wash-d { background: var(--wash-d); }

.gallery-stage .window {
  max-width: 1120px;
  margin-inline: auto;
  box-shadow: var(--shadow-stage);
}

.cap-title {
  display: block;
  margin-bottom: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.cap-text {
  display: block;
  max-width: 36rem;
  color: var(--ink-muted);
  font-size: var(--step--1);
}

.step-visual {
  grid-column: 1 / -1;
  min-width: 0;
}

.step-visual {
  grid-column: 1 / -1;
  min-width: 0;
}

/* ---------- Flow: where your record goes ----------
   The pattern of the hand-over on /for-clinics: four raised cards, each showing its step, joined by
   connectors a square marker rides. Each card is a radio; hover or focus lifts it and lights its
   connectors; the switch scatters the documents and breaks the connectors. */

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.flow-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.flow-lead h3 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.1;
}

.flow-controls {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
  margin-bottom: var(--space-3);
}

.flow-switch {
  display: inline-flex;
  gap: var(--space-3);
  align-items: center;
  min-height: var(--target);
  min-width: 44px;
  cursor: pointer;
  font-weight: 560;
}

.switch-track {
  position: relative;
  display: inline-block;
  width: 2.75rem;
  height: 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  background: var(--surface-sunk);
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--ink-muted);
  transform: translateY(-50%);
}

#flow:has(#flow-toggle:checked) .switch-track {
  background: var(--brand);
}

#flow:has(#flow-toggle:checked) .switch-track::after {
  background: var(--surface);
  transform: translateY(-50%) translateX(1.25rem);
}

#flow-toggle:focus-visible + .flow-controls .flow-switch {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.flow-caption {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.1;
  color: var(--ink);
}

.flow-with {
  display: none;
}

#flow:has(#flow-toggle:checked) .flow-today {
  display: none;
}

#flow:has(#flow-toggle:checked) .flow-with {
  display: block;
}

.flow-lede {
  max-width: 40rem;
  margin: 0 0 var(--space-6);
  color: var(--ink-muted);
}

/* the cards: a column on a phone, four across from 48rem */
.flow-steps {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.flow-stops {
  --link-gap: 3.5rem;
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  counter-reset: fstep;
}

.flow-stop {
  position: relative;
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  column-gap: var(--space-4);
  align-items: start;
  padding-bottom: var(--link-gap);
  list-style: none;
}

.flow-stop:last-child {
  padding-bottom: 0;
}

.flow-cell {
  display: contents;
}

.flow-radio {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.flow-card {
  aspect-ratio: 184 / 200;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.diagram.flow-art {
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
}

.stop-head {
  grid-column: 2;
  min-width: 0;
  counter-increment: fstep;
}

.stop-head h3 {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 620;
}

.stop-head h3 label {
  cursor: pointer;
  display: inline-flex;
  gap: 0.3em;
  align-items: center;
  min-height: var(--target);
}

.stop-head h3 label::before {
  content: counter(fstep) ".";
  color: var(--brand);
  font-weight: 650;
}

.stop-head p {
  margin: 0;
  color: var(--ink-muted);
}

/* the connector: a straight line down the gap on a phone, an arc across it from 48rem */
.flow-link {
  position: absolute;
  bottom: 0;
  left: 3.25rem;
  width: 2.5rem;
  height: var(--link-gap);
  transform: translateX(-50%);
  pointer-events: none;
}

.flow-stop:last-child .flow-link {
  display: none;
}

.diagram.flow-link-h {
  display: none;
}

.diagram.flow-link-v {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.diagram .flow-arc {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
}

.diagram .flow-chip {
  opacity: 0;
}

.diagram .v-rx { fill: var(--kind-prescription-bg); stroke: none; }
/* the Swiss flag: a square red field, a white cross, and an outline that keeps it visible on dark */
.swiss-flag {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: var(--space-3);
}

.swiss-flag .flag-field {
  fill: var(--flag-red);
  stroke: var(--line-strong);
  stroke-width: 1;
}

.swiss-flag .flag-cross {
  fill: #fff;
  stroke: none;
}

.flow-note {
  position: relative;
  z-index: 3;
  margin: var(--space-3) 0 0;
  font-size: var(--step--1);
  color: var(--ink-muted);
}

.flow-note p {
  margin: 0;
}

.flow-note p a {
  display: inline;
  min-height: 0;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.flow-note a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.flow-doc,
.flow-row,
.flow-read-row,
.flow-marker {
  transform-box: fill-box;
  transform-origin: center;
}

.flow-doc-x {
  opacity: 0;
}

.flow-row-1 { --i: 0; }
.flow-row-2 { --i: 1; }
.flow-row-3 { --i: 2; }
.flow-row-4 { --i: 3; }
.flow-row-5 { --i: 4; }

/* selected, hovered or focused */
.flow-stop:has(.flow-radio:checked) .flow-card {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), var(--shadow-soft);
}

.flow-stop:has(.flow-radio:checked) .stop-head h3 {
  color: var(--brand);
}

.flow-stop:has(.flow-radio:focus-visible) .flow-card {
  border-color: var(--brand);
  box-shadow: var(--shadow-window);
  transform: translateY(-6px);
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.flow-stop:has(.flow-radio:active) .flow-card {
  transform: scale(0.98);
}

.flow-stop:has(.flow-radio:focus-visible) .flow-arc,
.flow-stop:has(+ .flow-stop .flow-radio:focus-visible) .flow-arc {
  stroke-width: 3.5;
}

#flow:has(.flow-radio:focus-visible) .flow-stop:not(:has(.flow-radio:focus-visible)) :is(.flow-card, .stop-head) {
  opacity: 0.7;
}

/* hover only where a pointer can hover: a tap must not leave the others dimmed */
@media (hover: hover) and (pointer: fine) {
  .flow-stop:has(.flow-radio:hover) .flow-card {
    border-color: var(--brand);
    box-shadow: var(--shadow-window);
    transform: translateY(-6px);
  }

  .flow-stop:has(.flow-radio:hover) .flow-arc,
  .flow-stop:has(+ .flow-stop .flow-radio:hover) .flow-arc {
    stroke-width: 3.5;
  }

  #flow:has(.flow-radio:hover) .flow-stop:not(:has(.flow-radio:hover)) :is(.flow-card, .stop-head) {
    opacity: 0.7;
  }

  #diagram-handover .flow-stop:hover .flow-card {
    border-color: var(--brand);
    box-shadow: var(--shadow-window);
    transform: translateY(-6px);
  }
}

/* the scattered state: documents adrift, every connector broken, the cards muted */
#flow:has(#flow-toggle:not(:checked)) .flow-card {
  border-style: dashed;
  background: var(--canvas);
  box-shadow: none;
}

#flow:has(#flow-toggle:not(:checked)) .flow-art {
  opacity: 0.8;
}

#flow:has(#flow-toggle:not(:checked)) .flow-arc {
  stroke: var(--line-strong);
  stroke-dasharray: 0.04 0.09;
}

#flow:has(#flow-toggle:not(:checked)) .flow-doc path:first-child { stroke: var(--line-strong); }
#flow:has(#flow-toggle:not(:checked)) .flow-doc-1 { transform: translate(-34px, 30px) rotate(-10deg); }
#flow:has(#flow-toggle:not(:checked)) .flow-doc-2 { transform: translate(46px, 50px) rotate(9deg); }
#flow:has(#flow-toggle:not(:checked)) .flow-doc-3 { transform: translate(26px, -22px) rotate(12deg); }
#flow:has(#flow-toggle:not(:checked)) .flow-doc-4 { transform: translate(-54px, -38px) rotate(-8deg); opacity: 1; }
#flow:has(#flow-toggle:not(:checked)) .flow-doc-5 { transform: translate(-6px, 56px) rotate(6deg); opacity: 1; }
#flow:has(#flow-toggle:not(:checked)) .flow-doc-6 { transform: translate(60px, 8px) rotate(-14deg); opacity: 1; }

#flow:has(#flow-toggle:not(:checked)) .flow-row {
  fill: var(--surface-sunk);
  stroke: var(--line-strong);
  stroke-dasharray: 4 3;
}

#flow:has(#flow-toggle:not(:checked)) .flow-row-1 { transform: translate(-60px, 52px) rotate(-7deg); }
#flow:has(#flow-toggle:not(:checked)) .flow-row-2 { transform: translate(-6px, 70px) rotate(4deg); }
#flow:has(#flow-toggle:not(:checked)) .flow-row-3 { transform: translate(-72px, -18px) rotate(8deg); }
#flow:has(#flow-toggle:not(:checked)) .flow-row-4 { transform: translate(-30px, 16px) rotate(-5deg); }
#flow:has(#flow-toggle:not(:checked)) .flow-row-5 { transform: translate(-60px, -64px) rotate(5deg); }

#flow:has(#flow-toggle:not(:checked)) .flow-arrow {
  stroke-dasharray: 3 5;
  opacity: 0.5;
}

#flow:has(#flow-toggle:not(:checked)) .flow-frame,
#flow:has(#flow-toggle:not(:checked)) .flow-slab {
  stroke: var(--line-strong);
  stroke-dasharray: 5 4;
}

#flow:has(#flow-toggle:not(:checked)) .flow-marker {
  transform: translate(38px, -58px) rotate(16deg);
}

#flow:has(#flow-toggle:not(:checked)) .flow-read-row {
  opacity: 0.5;
}

#flow:has(#flow-toggle:not(:checked)) .stop-head h3 label::before {
  color: var(--ink-muted);
}

/* the detail panel: without :has() every panel stays open */
.flow-panel {
  position: relative;
  z-index: 3;
  display: grid;
  grid-column: 1 / -1;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.flow-panel-text p {
  margin: 0 0 var(--space-3);
}

.flow-panel-text p:last-child {
  margin-bottom: 0;
}

.flow-panel .still {
  margin: 0;
}

@supports selector(:has(*)) {
  .flow-panel {
    display: none;
  }

  .flow-stop:has(.flow-radio:checked) .flow-panel {
    display: grid;
  }
}

@media (min-width: 48rem) {
  .flow-stops {
    --link-gap: clamp(2.25rem, 5vw, 4rem);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: var(--link-gap);
    row-gap: var(--space-5);
  }

  .flow-stop {
    display: contents;
  }

  .flow-cell {
    position: relative;
    display: block;
    grid-row: 1;
  }

  .stop-1 .flow-cell { grid-column: 1; }
  .stop-2 .flow-cell { grid-column: 2; }
  .stop-3 .flow-cell { grid-column: 3; }
  .stop-4 .flow-cell { grid-column: 4; }

  .flow-cardwrap {
    position: relative;
  }

  .flow-card {
    border-radius: var(--radius-panel);
  }

  .stop-head {
    margin-top: var(--space-4);
    text-align: center;
  }

  .flow-link {
    top: 50%;
    bottom: auto;
    left: 100%;
    width: var(--link-gap);
    height: auto;
    aspect-ratio: 64 / 40;
    transform: translateY(-75%);
  }

  .diagram.flow-link-h {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
  }

  .diagram.flow-link-v {
    display: none;
  }

  /* a shorter card keeps the chosen step's panel in view under the step texts */
  #flow .flow-card {
    aspect-ratio: 184 / 120;
  }

  #flow .stop-head {
    margin-top: var(--space-3);
  }

  .flow-shot {
    justify-self: end;
    width: 100%;
    max-width: 24rem;
  }

  .flow-panel {
    grid-row: 2;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1.1fr;
    align-items: start;
    margin-top: 0;
    padding: var(--space-5);
  }
}

/* ---------- Scroll spine ---------- */

.spine {
  position: fixed;
  top: 0;
  bottom: 0;
  left: max(0.5rem, calc((100% - 76rem) / 2 - 1rem));
  width: 1px;
  background: var(--line);
  pointer-events: none;
  z-index: 1;
  transform-origin: top;
  display: none;
}

.spine::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brand);
  transform-origin: top;
  scale: 1 0;
}

@media (min-width: 60rem) {
  .spine {
    display: block;
  }
}

/* ---------- Trust ---------- */

#trust {
  background: var(--surface-sunk);
}

/* ---------- Privacy: tiles on a wash ---------- */

#privacy {
  background: var(--wash-c);
}

.items {
  display: grid;
  gap: var(--space-4);
}

.item {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.item .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.item p {
  margin: 0;
  color: var(--ink-muted);
}

.privacy-never {
  max-width: 40rem;
  margin: var(--space-5) 0 0;
  font-size: var(--step-1);
}

/* ---------- Switzerland: a full-bleed band ---------- */

#switzerland {
  position: relative;
  overflow: hidden;
  max-width: none;
  margin-top: var(--space-7);
  padding: var(--space-7) var(--space-5);
  border-radius: var(--radius-panel);
  background:
    repeating-radial-gradient(circle at 92% 130%, transparent 0 4.5rem, color-mix(in srgb, var(--brand) 14%, transparent) 4.5rem calc(4.5rem + 1px)),
    var(--wash-d);
}

.band {
  display: grid;
  gap: var(--space-5);
  max-width: 58rem;
}

.band .icon {
  width: 2rem;
  height: 2rem;
}

.band h2 {
  font-size: clamp(2.25rem, 1rem + 4.4vw, 4.5rem);
  line-height: 1.02;
}

/* ---------- CTA: the hero wash, reversed ---------- */

#cta {
  background:
    radial-gradient(50rem 26rem at 20% 100%, var(--wash-b), transparent 70%),
    radial-gradient(44rem 26rem at 85% 100%, var(--wash-c), transparent 70%),
    radial-gradient(60rem 22rem at 50% 70%, var(--wash-a), transparent 72%);
  text-align: center;
  padding-block: var(--space-9);
}

#cta h2 {
  max-width: 44rem;
  margin: 0 auto var(--space-6);
  font-size: clamp(2.5rem, 1rem + 5vw, 4.75rem);
}

#cta .actions {
  justify-content: center;
}

#cta .btn {
  min-height: 3.25rem;
  padding-inline: var(--space-6);
  font-size: var(--step-1);
}

/* ---------- Footer ---------- */

footer {
  display: grid;
  gap: var(--space-6);
  align-items: start;
  padding-block: var(--space-7);
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-muted);
}

footer p {
  margin: 0 0 var(--space-2);
}

footer .wordmark {
  color: var(--ink);
}

.foot-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.foot-bar p {
  margin: 0;
}

.foot-bar nav {
  display: flex;
  gap: var(--space-5);
}

.foot-bar a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0;
  color: var(--ink-muted);
  text-decoration: none;
}

.foot-bar a:hover {
  color: var(--ink);
}

.foot-links {
  display: grid;
  gap: var(--space-5) var(--space-4);
  grid-template-columns: 1fr;
}

.foot-title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin: 0 0 var(--space-2);
}

.foot-col ul {
  margin: 0 0 0 calc(var(--space-4) * -1);
  padding: 0;
  list-style: none;
}

.foot-col:last-child li:last-child a {
  color: var(--link);
}

/* ---------- Wider screens ---------- */

@media (min-width: 40rem) {
  footer {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }

  .foot-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .items {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-video,
  .hero-video-poster {
    margin-top: -6.4%;
  }
}

@media (min-width: 60rem) {
  .nav-links {
    display: flex;
  }

  .nav-menu {
    display: none;
  }

  footer {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  }

  .foot-links {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .step {
    grid-template-columns: 4rem minmax(0, 1fr) 40rem;
    padding-block: var(--space-6);
  }

  .step-visual {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }

  .step-visual .window {
    box-shadow: var(--shadow-stage);
  }

  .prose-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr);
    gap: var(--space-6);
    align-items: start;
  }

  .prose-head {
    margin-bottom: 0;
  }

  .node {
    font-size: 7rem;
  }

  section {
    padding-block: var(--section-pad);
  }

  .stepper {
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    gap: var(--space-6);
    align-items: center;
  }

  .stage {
    order: 0;
    grid-column: 2;
    grid-row: 1;
    padding: var(--space-6);
    min-height: 640px;
  }

  .step-list {
    grid-column: 1;
    grid-row: 1;
  }

  .points {
    grid-template-columns: repeat(3, 1fr);
  }

  .points:has(> :nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
  }

  .point {
    padding: var(--space-7) var(--space-6);
  }

  .gallery-stage .window picture {
    aspect-ratio: 2240 / 1040;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent);
    mask-image: linear-gradient(to bottom, #000 78%, transparent);
  }

  .gallery-stage .window img {
    height: 100%;
    object-fit: cover;
    object-position: top;
  }
}

@media (max-width: 39.99rem) {
  section {
    padding-block: 4rem;
  }

  .gallery-item figcaption {
    padding-inline: calc((100% - var(--stage-w)) / 2 + 16px);
  }

  #page-head {
    padding-top: 7rem;
  }

  .gallery-stage {
    padding: 16px;
  }

  #hero .window video,
  #hero .window .hero-video-poster {
    aspect-ratio: 1;
    object-fit: cover;
    /* Changing this changes PHONE_WINDOW in the video repo (scripts/hero-thread.mjs): x 554-1634 of 1920. */
    object-position: 66% 0;
  }

  /* The phone crop cuts the film's own "Example data" pill to "Exa"; this opaque label sits over the fragment. */
  .hero-example-label {
    position: absolute;
    top: calc(2.25rem + 3%);
    /* flush with the window's right edge: the crop leaves the film's own pill cut to "Exa" against that edge, and this covers it */
    right: 0;
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding-inline: var(--space-3);
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 0.5rem 0 0 0.5rem;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.8125rem;
    line-height: 1;
  }

  .wordmark {
    font-size: 1.25rem;
  }

  #hero {
    padding-top: 7rem;
  }
}

/* ---------- Motion: CSS only ---------- */

/* Touch: #135 */
@media (hover: none) {
  html {
    scroll-behavior: smooth;
  }
}

.btn,
.nav-links a,
.nav-menu a,
.foot-links a,
.step-row label {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 1rem;
  }
}

@keyframes rise-big {
  from {
    opacity: 0;
    translate: 0 1.5rem;
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes dot-pulse {
  from {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent);
  }
  to {
    box-shadow: 0 0 0 0.6rem transparent;
  }
}

@keyframes fill-y {
  to {
    scale: 1 1;
  }
}

@keyframes fill {
  from {
    scale: 0 1;
  }
}

@keyframes bar-in {
  from {
    background-color: transparent;
    border-bottom-color: transparent;
  }
  to {
    background-color: var(--surface);
    border-bottom-color: var(--line);
  }
}

@keyframes flow-ride {
  from {
    offset-distance: 0%;
  }
  to {
    offset-distance: 100%;
  }
}

/* diagram kit: motion. The four primitives; the start state exists only here. The dot's path is
   set per diagram, in the SVG's own units, as .flow-dot does. */
.draw {
  stroke-dasharray: 1;
  animation: draw 1.2s var(--ease) both;
}

.rise {
  animation: rise 0.6s var(--ease) backwards;
}

.ride {
  offset-rotate: 0deg;
  transform-box: view-box;
  animation: flow-ride 3s var(--ease) both;
}

.fill {
  transform-box: fill-box;
  transform-origin: left;
  animation: fill 0.8s var(--ease) backwards;
}

.compare-panel {
  transition: translate 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.compare-panel:is(:hover, :focus-within) {
  translate: 0 -2px;
}

.panel-vault:is(:hover, :focus-within) {
  border-color: var(--brand);
}

.panel-chatbot:is(:hover, :focus-within) {
  border-color: var(--line-strong);
}

.hero-copy > * {
  animation: rise 0.7s var(--ease) backwards;
}

.hero-copy > :nth-child(2) { animation-delay: 0.08s; }
.hero-copy > :nth-child(3) { animation-delay: 0.16s; }
.hero-copy > :nth-child(4) { animation-delay: 0.24s; }
.hero-copy > :nth-child(5) { animation-delay: 0.32s; }
.hero-copy > :nth-child(6) { animation-delay: 0.4s; }

.preview {
  animation: rise-big 0.9s var(--ease) 0.3s backwards;
}

@keyframes flow-travel {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

@keyframes flow-hop {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  2% {
    opacity: 1;
  }
  21% {
    opacity: 1;
  }
  24%,
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

@keyframes sort-in {
  from {
    translate: -22px 0;
    opacity: 0;
  }
}

@keyframes settle {
  from {
    translate: 0 -44px;
    opacity: 0;
  }
}

/* the marker rides each connector in turn; with a scroll timeline it follows the scroll instead */
.flow-link-h .flow-chip,
.flow-link-v .flow-chip {
  transform-box: view-box;
  offset-rotate: 0deg;
  opacity: 0;
  animation: flow-hop 9.6s linear 1s 3 both;
}

.flow-link-h .flow-chip { offset-path: path("M 0 30 C 14 2, 50 2, 64 30"); }
.flow-link-v .flow-chip { offset-path: path("M 20 0 V 56"); }
.stop-2 .flow-chip { animation-delay: 3.4s; }
.stop-3 .flow-chip { animation-delay: 5.8s; }

#flow:has(#flow-toggle:not(:checked)) .flow-chip {
  animation: none;
}

/* the scatter morph is explanatory and rare, so it takes 0.7s; the hover and focus responses stay
   under 300ms */
.flow-card .flow-doc,
.flow-card .flow-row,
.flow-card .flow-marker,
.flow-card .flow-read-row,
.flow-art {
  transition: transform 0.7s var(--ease), opacity 0.3s var(--ease), stroke 0.3s var(--ease),
    fill 0.3s var(--ease);
}

.flow-card,
.flow-arc,
.flow-stop .stop-head {
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease), stroke-width 0.25s var(--ease),
    stroke 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.flow-stop:has(.flow-radio:focus-visible) .flow-card {
  transition: none;
}

.flow-stop:has(.flow-radio:checked) .flow-panel {
  animation: rise 0.3s var(--ease) both;
}

/* hover or focus replays the card's small story */
#flow:has(#flow-toggle:checked) .flow-stop:has(.flow-radio:is(:hover, :focus-visible)) .flow-row {
  animation: sort-in 0.45s var(--ease) backwards;
  animation-delay: calc(var(--i) * 60ms);
}

#flow:has(#flow-toggle:checked) .flow-stop:has(.flow-radio:is(:hover, :focus-visible)) .flow-marker {
  animation: settle 0.6s var(--ease) backwards;
}

#flow:has(#flow-toggle:checked) .flow-stop:has(.flow-radio:is(:hover, :focus-visible)) .flow-read-row {
  animation: rise 0.5s var(--ease) backwards;
}

.badge .dot,
.tag .dot {
  animation: dot-pulse 2s ease-out 3;
}

.shot {
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

#step-1:checked ~ .stage .shot-1,
#step-2:checked ~ .stage .shot-2,
#step-3:checked ~ .stage .shot-3,
#step-4:checked ~ .stage .shot-4,
#step-5:checked ~ .stage .shot-5 {
  transition: opacity 0.3s ease;
}

#step-1:checked ~ .step-list .step-row:nth-child(1) .step-text,
#step-2:checked ~ .step-list .step-row:nth-child(2) .step-text,
#step-3:checked ~ .step-list .step-row:nth-child(3) .step-text,
#step-4:checked ~ .step-list .step-row:nth-child(4) .step-text,
#step-5:checked ~ .step-list .step-row:nth-child(5) .step-text {
  animation: rise 0.4s var(--ease) backwards;
}

@supports (animation-timeline: view()) {
  /* A reveal starts once its element's top is above 85% of the viewport (17vh of scroll after the top meets the bottom
     edge) and is whole when that top is at the middle (50vh): `cover` offsets are plain scroll distances. */
  .swirl {
    view-timeline: --swirl block;
  }

  .swirl path {
    stroke-dasharray: 1;
    animation: draw linear both;
    animation-timeline: --swirl;
    animation-range: cover 17vh cover 50vh;
  }

  /* Where the film is scrubbed the preview is stuck, so the swirl's own timeline would freeze part-drawn: it draws over
     a fixed stretch of the track's scroll instead (the pin is sized per scene, so a share of it would stretch with the film). */
  .hero-track {
    view-timeline: --ht block;
  }

  .hero-track.is-scrubbed .swirl path {
    animation-timeline: --ht;
    animation-range: cover calc(100vh - 5rem) cover calc(100vh - 5rem + 70vh);
  }

  /* The diagram parts share one named timeline per diagram, since a small element's own range is only its height of scroll. */
  .diagram {
    view-timeline: --dg block;
  }

  .flow-cardwrap {
    view-timeline: --cw block;
  }

  .step-list {
    view-timeline: --sl block;
  }

  #roadmap-track {
    view-timeline: --rt block;
  }

  .diagram .draw {
    animation: draw linear both;
    animation-timeline: --dg;
    animation-range: cover 17vh cover 43vh;
  }

  .diagram .rise {
    animation: rise linear both;
    animation-timeline: --dg;
    animation-range: cover 17vh cover 37vh;
  }

  .diagram .ride {
    animation: flow-ride linear both;
    animation-timeline: --dg;
    animation-range: cover 17vh cover 50vh;
  }

  .diagram .fill {
    animation: fill linear both;
    animation-timeline: --dg;
    animation-range: cover 17vh cover 43vh;
  }

  /* the cards rise in one after another as the row scrolls in, whole before the row is fully on screen */
  @media (min-width: 48rem) {
    .flow-stops {
      view-timeline: --fr block;
    }

    :is(#flow, #diagram-handover) .flow-cell {
      animation: rise linear both;
      animation-timeline: --fr;
      animation-range: cover 17vh cover 34vh;
    }

    :is(#flow, #diagram-handover) .stop-2 .flow-cell { animation-range: cover 20vh cover 37vh; }
    :is(#flow, #diagram-handover) .stop-3 .flow-cell { animation-range: cover 24vh cover 40vh; }
    :is(#flow, #diagram-handover) .stop-4 .flow-cell { animation-range: cover 27vh cover 43vh; }
  }

  @media (max-width: 47.99rem) {
    .flow-stop {
      view-timeline: --fs block;
    }

    :is(#flow, #diagram-handover) .flow-cell {
      animation: rise linear both;
      animation-timeline: --fs;
      animation-range: cover 17vh cover 35vh;
    }
  }

  :is(#flow, #diagram-handover) .flow-card .v-bar {
    stroke-dasharray: 1;
    animation: draw linear both;
    animation-timeline: --cw;
    animation-range: cover 24vh cover 37vh;
  }

  #diagram-handover .flow-arc,
  #flow:has(#flow-toggle:checked) .flow-arc {
    stroke-dasharray: 1;
    animation: draw linear both;
    animation-timeline: --cw;
    animation-range: cover 27vh cover 40vh;
  }

  :is(#flow, #diagram-handover) .flow-chip {
    animation: flow-travel linear both;
    animation-timeline: --cw;
    animation-range: cover 27vh cover 37vh;
  }

  :is(#flow, #diagram-handover) .stop-2 .flow-chip { animation-range: cover 32vh cover 43vh; }
  :is(#flow, #diagram-handover) .stop-3 .flow-chip { animation-range: cover 37vh cover 50vh; }

  #flow:has(#flow-toggle:not(:checked)) .flow-chip {
    animation: none;
  }

  #step-1:checked ~ .step-list .step-row:nth-child(1) label::after,
  #step-2:checked ~ .step-list .step-row:nth-child(2) label::after,
  #step-3:checked ~ .step-list .step-row:nth-child(3) label::after,
  #step-4:checked ~ .step-list .step-row:nth-child(4) label::after,
  #step-5:checked ~ .step-list .step-row:nth-child(5) label::after {
    width: 100%;
    animation: fill linear both;
    animation-timeline: --sl;
    animation-range: cover 17vh cover 43vh;
    transform-origin: left;
  }
}

@supports (animation-timeline: scroll()) {
  header {
    position: sticky;
    margin-bottom: -4.5rem;
    animation: bar-in linear both;
    animation-timeline: scroll(root);
    animation-range: 0 8rem;
  }

  .spine::after {
    animation: fill-y linear both;
    animation-timeline: scroll(root);
  }
}

/* polish across the pages: one easing token (--ease), entrances staggered, nothing on body text */
@keyframes wipe {
  from {
    clip-path: inset(-6px 100% -6px 0);
  }
  to {
    clip-path: inset(-6px -6px -6px 0);
  }
}

.page-intro > * {
  animation: rise 0.7s var(--ease) backwards;
}

.page-intro > :nth-child(2) { animation-delay: 0.08s; }
.page-intro > :nth-child(3) { animation-delay: 0.16s; }

@supports (animation-timeline: view()) {
  #roadmap-track svg {
    animation: wipe linear both;
    animation-timeline: --rt;
    animation-range: cover 17vh cover 50vh;
  }
}

/* ---------- flow sequence ---------- */

/* How it works plays as one sequence scrubbed by scroll. From 48rem the whole row shares the --fr timeline and the
   sequence is a scrub while the cards cross the viewport (cover 10% to 43% of a row that is cards plus the panel,
   so it is over before the whole row is on screen and needs no exemption from the reveal probe): connector n
   draws while card n hands over to card n+1, each card is lit in turn and then settles back, and the sweep ends
   at the card the radios have chosen, which keeps its own selected style because every keyframe leaves its end
   state to the cascade. On a phone each step plays on its own --fs timeline and is whole before the step is fully
   on screen. */
@supports (animation-timeline: view()) {
  @keyframes flow-seq-card {
    50% {
      border-color: var(--brand);
      box-shadow: 0 0 0 1px var(--brand), var(--shadow-window);
      translate: 0 -6px;
    }
  }

  @keyframes flow-seq-title {
    from {
      opacity: 0.35;
      translate: 0 10px;
    }
  }

  @keyframes flow-seq-fan-lo {
    from {
      translate: 9px -7px;
      rotate: -3deg;
    }
  }

  @keyframes flow-seq-fan-hi {
    from {
      translate: -9px 7px;
      rotate: 3deg;
    }
  }

  @keyframes flow-seq-slide {
    from {
      translate: -14px 0;
      opacity: 0;
    }
  }

  @keyframes flow-seq-settle {
    from {
      translate: 0 -8px;
      opacity: 0;
    }
  }

  @keyframes flow-seq-pop {
    from {
      scale: 0.8;
      opacity: 0;
    }
  }

  @keyframes flow-seq-fill {
    from {
      scale: 0.25 1;
      opacity: 0;
    }
  }

  #flow {
    --tl: --fs;
    --rn: cover;
    --w: 6vh;
    --cl: 14vh;
    --aw: 6vh;
    --ap: 3vh;
    --tw: 8vh;
    --is: 1vh;
  }

  #flow .stop-1,
  #flow .stop-2,
  #flow .stop-3,
  #flow .stop-4 {
    --p: 28vh;
  }

  @media (min-width: 48rem) {
    #flow {
      --tl: --fr;
      --rn: cover;
      --w: 5%;
      --cl: 7%;
      --aw: 5%;
      --ap: 3%;
      --tw: 6%;
      --is: 1%;
    }

    #flow .stop-1 { --p: 15%; }
    #flow .stop-2 { --p: 22%; }
    #flow .stop-3 { --p: 29%; }
    #flow .stop-4 { --p: 36%; }
  }

  .flow-slab:nth-of-type(2) { --i: 0; }
  .flow-slab:nth-of-type(3) { --i: 1; }
  .flow-slab:nth-of-type(4) { --i: 2; }
  .flow-read-row-1 { --i: 0; }
  .flow-read-row-2 { --i: 1; }
  .flow-read-row-3 { --i: 2; }

  #flow .flow-card .flow-slab,
  #flow .flow-card .flow-read-row {
    transform-box: fill-box;
  }

  #flow .flow-card .flow-read-row {
    transform-origin: left center;
  }

  #flow .flow-card {
    animation: flow-seq-card linear both;
    animation-timeline: var(--tl);
    animation-range: var(--rn) calc(var(--p) - var(--w)) var(--rn) calc(var(--p) + var(--w));
  }

  #flow .stop-head {
    animation: flow-seq-title linear both;
    animation-timeline: var(--tl);
    animation-range: var(--rn) calc(var(--p) - var(--tw)) var(--rn) var(--p);
  }

  #flow:has(#flow-toggle:checked) .flow-arc {
    stroke-dasharray: 1;
    animation: draw linear both;
    animation-timeline: var(--tl);
    animation-range: var(--rn) var(--p) var(--rn) calc(var(--p) + var(--cl));
  }

  #flow:has(#flow-toggle:checked) .flow-doc-1,
  #flow:has(#flow-toggle:checked) .flow-doc-3,
  #flow:has(#flow-toggle:checked) .flow-row,
  #flow:has(#flow-toggle:checked) .flow-slab,
  #flow:has(#flow-toggle:checked) .flow-marker,
  #flow:has(#flow-toggle:checked) .flow-read-row {
    animation-duration: 1ms;
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-timeline: var(--tl);
    animation-range: var(--rn) calc(var(--p) - var(--aw) + var(--i, 0) * var(--is))
      var(--rn) calc(var(--p) + var(--ap) + var(--i, 0) * var(--is));
  }

  #flow:has(#flow-toggle:checked) .flow-doc-1 { animation-name: flow-seq-fan-lo; }
  #flow:has(#flow-toggle:checked) .flow-doc-3 { animation-name: flow-seq-fan-hi; }
  #flow:has(#flow-toggle:checked) .flow-row { animation-name: flow-seq-slide; }
  #flow:has(#flow-toggle:checked) .flow-slab { animation-name: flow-seq-settle; }
  #flow:has(#flow-toggle:checked) .flow-marker { animation-name: flow-seq-pop; }
  #flow:has(#flow-toggle:checked) .flow-read-row { animation-name: flow-seq-fill; }

  /* Pinned (with JavaScript off the page is unchanged): the card row sticks
     while the whole sequence plays. An empty ::before makes the first grid row --fd + 30rem tall and is the view timeline
     (--ft); the cells stick inside the grid. A sticky grid item is bounded by the whole grid, not its area, so the second
     row is a fixed 24rem (the tallest panel is 375px) and each cell's margin-bottom keeps it clear. Cells are 30rem tall so
     all four release together. Positions are scroll lengths from the moment the track's top meets the bottom edge: the
     sequence starts once the whole row is on screen (--fa) and q of it is --fa + --fl * q. CSS sticky, not a GSAP pin:
     a transform pin stops the elements moving, and with them every view timeline. */
  @media (scripting: enabled) and (pointer: fine) and (min-width: 64rem) and (min-height: 38rem) {
    #flow {
      timeline-scope: --ft;
      --fd: 140vh;
      --ftop: max(5.5rem, calc((100vh - 30rem) / 2));
      --fa: max(34rem, calc(100vh - 18.5rem));
      --fl: calc(100vh - var(--ftop) + var(--fd) * 0.95 - var(--fa));
      --tl: --ft;
      --w: calc(var(--fl) * 0.06);
      --cl: calc(var(--fl) * 0.14);
      --aw: calc(var(--fl) * 0.08);
      --ap: calc(var(--fl) * 0.04);
      --tw: calc(var(--fl) * 0.1);
      --is: calc(var(--fl) * 0.01);
    }

    /* the text beside the diagram it describes: the lead sticks in the left column while the cards play (the guide's toc-rail pattern) */
    #flow {
      display: grid;
      grid-template-columns: minmax(16rem, 17rem) minmax(0, 1fr);
      column-gap: var(--space-6);
      align-items: start;
    }

    #flow .flow-lead {
      position: sticky;
      top: var(--ftop);
    }

    #flow .flow-lede {
      margin-bottom: 0;
    }

    #flow .stop-1 { --p: calc(var(--fa) + var(--fl) * 0.22); }
    #flow .stop-2 { --p: calc(var(--fa) + var(--fl) * 0.4); }
    #flow .stop-3 { --p: calc(var(--fa) + var(--fl) * 0.58); }
    #flow .stop-4 { --p: calc(var(--fa) + var(--fl) * 0.76); }

    #flow .flow-stops::before {
      content: "";
      grid-row: 1;
      grid-column: 1 / -1;
      height: calc(var(--fd) + 30rem);
      view-timeline: --ft block;
      pointer-events: none;
    }

    #flow .flow-stops {
      grid-template-rows: auto 24rem;
    }

    #flow .flow-panel {
      align-self: start;
    }

    #flow .flow-cell {
      position: sticky;
      top: var(--ftop);
      align-self: start;
      height: 30rem;
      margin-bottom: calc(24rem + var(--space-5));
    }

    #flow .flow-cell {
      animation-timeline: --ft;
      animation-range: cover var(--fa) cover calc(var(--fa) + var(--fl) * 0.08);
    }

    #flow .stop-2 .flow-cell { animation-range: cover calc(var(--fa) + var(--fl) * 0.03) cover calc(var(--fa) + var(--fl) * 0.11); }
    #flow .stop-3 .flow-cell { animation-range: cover calc(var(--fa) + var(--fl) * 0.06) cover calc(var(--fa) + var(--fl) * 0.14); }
    #flow .stop-4 .flow-cell { animation-range: cover calc(var(--fa) + var(--fl) * 0.09) cover calc(var(--fa) + var(--fl) * 0.17); }

    #flow .stop-1 .flow-chip,
    #flow .stop-2 .flow-chip,
    #flow .stop-3 .flow-chip {
      animation-timeline: --ft;
      animation-range: cover calc(var(--p) + var(--fl) * 0.04) cover calc(var(--p) + var(--fl) * 0.16);
    }

    #flow .stop-4 .flow-card .v-bar {
      animation-timeline: --ft;
      animation-range: cover calc(var(--p) - var(--w)) cover calc(var(--p) + var(--w));
    }
  }
}

/* R3-P3 motion */
.card-link,
.point,
.road-card {
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.card-link::after,
.point::after,
.road-card::after,
.flow-card::after {
  transition: opacity 0.25s var(--ease);
}

.card-link:focus-visible,
.point:focus-within,
.road-card:focus-within {
  transform: translateY(-2px);
}

.card-link:focus-visible::after,
.point:focus-within::after,
.road-card:focus-within::after,
.flow-stop:has(.flow-radio:focus-visible) .flow-card::after {
  animation: lit-turn 1.6s var(--ease) 1 both;
}

@keyframes lit-turn {
  to {
    --lit-angle: 360deg;
  }
}

@media (hover: hover) and (pointer: fine) {
  .card-link:hover,
  .point:hover,
  .road-card:hover {
    transform: translateY(-2px);
  }

  .card-link:hover::after,
  .point:hover::after,
  .road-card:hover::after,
  .flow-stop:has(.flow-radio:hover) .flow-card::after {
    animation: lit-turn 1.6s var(--ease) 1 both;
  }
}

/* ---------- Forced colours: keep masked glyphs visible ---------- */

@media (forced-colors: active) {
  .icon,
  .dot {
    forced-color-adjust: none;
    background: CanvasText;
  }

  .swirl-anchor {
    display: none;
  }
}

/* ---------- D5: /approach, /estonia, /about ---------- */

.diagram .dashed {
  stroke-dasharray: 6 6;
}

.diagram .divider {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.band-page .diagram-lead {
  max-width: none;
  margin: 0 0 var(--space-2);
  color: var(--ink-muted);
  text-align: center;
}

.step-label {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--brand);
  font-size: 0.9375rem;
  font-weight: 650;
}

.diagram-steps li {
  min-width: 0;
}

.diagram-steps li p {
  margin: 0;
}

.diagram-steps .claim {
  margin-top: 0;
}

.diagram-steps .track-link {
  color: var(--ink);
}

@media (min-width: 40rem) {
  .diagram-steps .claim-label,
  .diagram-steps .stage-label {
    margin-inline: auto;
  }
}

/* five columns need 60rem; below it the five items stack under the picture */
@media (min-width: 40rem) and (max-width: 59.99rem) {
  .steps-5 {
    display: block;
    padding-left: 1.25rem;
    list-style: decimal;
    text-align: start;
  }

  .steps-5 li::before {
    content: none;
  }

  .steps-5 li {
    margin-bottom: var(--space-3);
  }

  .steps-5 .claim-label {
    margin-inline: 0;
  }
}

.does-table {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

.does-table th,
.does-table td {
  padding: var(--space-3) var(--space-4);
  line-height: var(--leading);
  text-align: start;
  vertical-align: top;
}

.does-table th {
  border-bottom: 1px solid var(--line);
  color: var(--brand);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.does-table th + th,
.does-table td + td {
  border-left: 1px solid var(--line);
}

.does-table tbody tr + tr td {
  border-top: 1px solid var(--line);
}

@media (max-width: 39.99rem) {
  .does-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .does-table thead tr,
  .does-table thead th {
    display: block;
    width: 1px;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  .does-table,
  .does-table tbody,
  .does-table tr,
  .does-table td {
    display: block;
  }

  .does-table td:empty {
    display: none;
  }

  .does-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--brand);
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .does-table td + td,
  .does-table tbody tr + tr td {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .does-table tbody tr + tr td:first-child {
    border-top: 3px double var(--line-strong);
  }
}

.report-example {
  margin: var(--space-5) 0;
}

.report-card {
  padding: var(--space-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.report-card .state {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 560;
}

.report-card h3 {
  margin-top: var(--space-3);
  font-family: var(--font-display);
  font-weight: 600;
}

.report-card h4 {
  margin: var(--space-5) 0 var(--space-3);
  font-size: 1rem;
}

.report-card .what {
  color: var(--ink-muted);
}

.report-example figcaption p {
  max-width: 40rem;
  margin: var(--space-2) 0 0;
  color: var(--ink-muted);
}

.band-page > h3 {
  margin: var(--space-6) 0 var(--space-3);
  font-family: var(--font-display);
  font-weight: 600;
}

.band-page .why-text {
  max-width: 46rem;
  font-size: var(--step-1);
  line-height: 1.5;
}

.pull-quote {
  max-width: 52rem;
  margin: var(--space-6) 0;
  padding-left: var(--space-5);
  border-left: 4px solid var(--brand);
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.25;
}

.team {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.person {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.person-name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
}

.person-role {
  color: var(--ink-muted);
  line-height: var(--leading);
}

.person .text-link {
  margin-top: var(--space-2);
}

.store-figure {
  display: grid;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.store-figure .still {
  margin: 0;
}

#about-stage .rail {
  margin-bottom: var(--space-5);
}

#about-stage .rail-card .claim > p {
  margin-top: var(--space-2);
}

/* ---------- Print: the guides, last so it wins over every earlier display rule ---------- */

@media print {
  header,
  footer,
  .nav-menu,
  .guide-toc-wrap,
  .diagram-figure,
  .guide-crumbs,
  .guide-meta,
  .guide-takeaways,
  .guide-strip,
  .guide-print,
  .guide-related,
  .guide-links,
  .stat-tiles,
  #next,
  .spine {
    display: none;
  }

  @page {
    margin: 12mm;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 10pt;
  }

  p,
  li {
    margin: 0 0 3pt;
    line-height: 1.35;
  }

  main section,
  .guide-layout {
    padding: 0;
  }

  .guide-main {
    max-width: none;
  }

  #page-head {
    padding-block: 0 6pt;
  }

  #page-head::before {
    display: none;
  }

  .guides .page-intro h1 {
    font-size: 18pt;
  }

  .guide-section,
  .guide-more {
    margin-top: 8pt;
    break-inside: avoid;
  }

  .guide-section > h2,
  .guide-more h2 {
    margin-bottom: 3pt;
    font-size: 12pt;
  }

  .guide-list,
  .guide-list li + li {
    margin-top: 0;
  }

  .guide-more {
    padding: 0;
    border: 0;
  }

  .guide-list li::before {
    top: 0.15em;
    width: 0.8em;
    height: 0.8em;
    border-color: #000;
  }
}

/* ---------- D6: the home page ---------- */

/* diagram 0: the annotated example row. The row and its callouts are three equal columns from 40rem,
   so each leader line and each callout sits under the middle of its cell. */

#diagram-row {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
}

#diagram-row svg {
  display: none;
}

#diagram-row .diagram-steps {
  text-align: start;
}

@media (max-width: 39.99rem) {
  #diagram-row .diagram-steps,
  #hero .swirl-anchor {
    display: none;
  }
}

.row-note {
  margin: 0 0 var(--space-3);
  color: var(--ink-muted);
  font-size: var(--step--1);
  text-align: center;
}

.example-row {
  display: grid;
  counter-reset: cell;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.example-cell {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--line);
  counter-increment: cell;
}

.example-cell:first-child {
  border-top: 0;
}

.cell-label::before {
  content: counter(cell) " \00b7\20 ";
}

.cell-label {
  color: var(--brand);
  font-size: 0.8125rem;
  font-weight: 650;
}

.example-cell::before {
  display: none;
  content: counter(cell);
  color: var(--brand);
  font-size: 0.8125rem;
  font-weight: 650;
}

.cell-main {
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.2;
  color: var(--ink);
}

.cell-sub {
  color: var(--ink-muted);
}

@media (min-width: 40rem) {
  .example-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .example-cell {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .example-cell:first-child {
    border-left: 0;
  }

  #diagram-row svg {
    display: block;
  }

  .example-cell::before {
    display: block;
  }

  .cell-label {
    display: none;
  }

  #diagram-row .diagram-steps {
    gap: 0;
    text-align: center;
  }
}

/* kit: the rail (kit.rail) and the status chip (kit.status_chip). The rail is one decorative SVG above equal
   columns from 60rem and a line down the left of stacked cards below it. The segment into a card is solid for Now,
   dashed for Next and dotted for Where we are going. */

.rail {
  margin-top: var(--space-6);
}

.rail-line {
  display: none;
}

.rail-items {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-item {
  position: relative;
  padding-left: 2.25rem;
}

.rail-item::before,
.rail-item::after {
  content: "";
  position: absolute;
  left: 0;
}

.rail-item::before {
  top: 1.5rem;
  width: 0.875rem;
  height: 0.875rem;
  box-sizing: border-box;
  border: 2px solid var(--brand);
  border-radius: 50%;
}

.rail-item[data-status="now"]::before {
  background: var(--brand);
}

.rail-item:not(:last-child)::after {
  top: 2.375rem;
  bottom: calc(-1 * var(--space-5));
  left: calc(0.4375rem - 1px);
  border-left: 2px solid var(--brand);
}

.rail-item:has(+ [data-status="next"])::after {
  border-left-style: dashed;
}

.rail-item:has(+ [data-status="later"])::after {
  border-left-style: dotted;
}

.rail-card {
  height: 100%;
  box-sizing: border-box;
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.rail-card:is(:hover, :focus-within) {
  border-color: var(--brand);
  box-shadow: 0 8px 24px var(--lift);
  transform: translateY(-2px);
}

.lane-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.lane-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.1;
}

.lane-head .mark {
  width: 2.25rem;
  height: 2.25rem;
}

.lane-head .mark .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.lane-shot {
  width: 10rem;
  max-width: 100%;
  margin: var(--space-4) 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}

.lane-thumb,
.lane-thumb img {
  display: block;
  width: 100%;
  height: auto;
}

#building .rail-card .claim,
.rail-card .road-item {
  margin-top: var(--space-4);
}

#building .rail-card .claim + .claim {
  margin-top: var(--space-5);
}

.rail-card .claim .road-item:first-of-type {
  margin-top: 0;
}

.rail-card h4 {
  margin: 0;
  font-size: var(--step-0);
}

.rail-card .claim > p {
  margin-top: var(--space-3);
  font-size: var(--step--1);
}

.rail-card .text-link {
  margin-top: var(--space-4);
}

/* the link is the full 44px target (A23); the 28px chip is drawn behind its text, and the negative margins keep the layout of a 28px chip */
.rail-card :is(.claim-label, .stage-label)[data-status] {
  position: relative;
  isolation: isolate;
  min-height: var(--target);
  margin: -0.5rem 0 calc(var(--space-2) - 0.5rem);
  padding: 0 var(--space-3);
  font-size: 0.75rem;
}

.rail-card :is(.claim-label, .stage-label)[data-status]::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0.5rem 0;
  border: 1px solid var(--brand);
  border-radius: 0.375rem;
}

.rail-card :is(.claim-label, .stage-label)[data-status="now"] {
  color: var(--on-brand);
}

.rail-card :is(.claim-label, .stage-label)[data-status="now"]::before {
  background: var(--brand);
}

.rail-card .claim-label[data-status="later"] {
  color: var(--ink-muted);
}

.rail-card .claim-label[data-status="later"]::before {
  border: 1px dotted var(--line-strong);
}

/* a phone gets the cards without the still and with tighter spacing, so the page does not grow (A48 baseline) */
@media (max-width: 59.99rem) {
  .lane-shot {
    display: none;
  }

  .rail-card {
    padding: var(--space-4);
  }

  .rail-items {
    gap: var(--space-4);
  }

  #building .rail-card .claim,
  .rail-card .road-item {
    margin-top: var(--space-3);
  }

  #building .rail-card .claim + .claim {
    margin-top: var(--space-4);
  }

  .rail-item:not(:last-child)::after {
    bottom: calc(-1 * var(--space-4));
  }
}

@media (min-width: 60rem) {
  .rail-line {
    display: block;
    margin-bottom: var(--space-3);
  }

  .rail-items {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0;
  }

  .rail-item {
    padding: 0 var(--space-3);
  }

  .rail-item::before,
  .rail-item::after {
    display: none;
  }
}

@supports (animation-timeline: view()) {
  /* Reveal: the cards rise in the middle band, like the diagrams (A50), 4vh of scroll apart. */
  .rail {
    view-timeline: --rl block;
  }

  .rail-item {
    animation: rise linear both;
    animation-timeline: --rl;
    animation-range: cover 17vh cover 37vh;
  }

  .rail-item:nth-child(2) { animation-range: cover 21vh cover 41vh; }
  .rail-item:nth-child(3) { animation-range: cover 25vh cover 45vh; }
  .rail-item:nth-child(4) { animation-range: cover 29vh cover 49vh; }
}

@media (max-width: 39.99rem) {
  .diagram-steps li {
    margin-bottom: var(--space-2);
  }
}

.guide-list + p {
  margin-top: var(--space-3);
}

/* stills */
.still-row { display: grid; gap: var(--space-5); align-items: center; }
.still { margin: var(--space-5) 0 0; }
.still-row .still { margin: 0; }
.still img { display: block; width: 100%; height: auto; border-radius: var(--radius-panel); box-shadow: var(--shadow-window); }
@media (min-width: 60rem) { .still-row { grid-template-columns: 1fr 1.1fr; } }

/* ---------- Phone type floor: no body-level label under 14px ---------- */

@media (max-width: 39.99rem) {
  .kicker,
  .foot-title,
  .claim-label,
  .stage-label,
  .step-label,
  .why-label,
  .cell-label,
  .example-cell::before,
  .does-table th,
  .legend dt,
  th,
  dt {
    font-size: 0.875rem;
  }
}

/* /approach: the chatbot comparison as two panels, and the import pipeline as five steps with
   their own small illustrations. Labels in sentence case, text left-aligned. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.compare-figure,
.pipe-figure {
  margin: var(--space-6) 0;
}

.compare {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 60rem) {
  .compare {
    grid-template-columns: 2fr 3fr;
  }
}

.compare-panel {
  --tile-bg: color-mix(in srgb, var(--brand) 11%, var(--surface));
  --tile-edge: color-mix(in srgb, var(--brand) 22%, var(--surface));
  --tile-ink: var(--brand);
  --tile-soft: color-mix(in srgb, var(--brand) 20%, transparent);
  --tile-hi: var(--brand);
  --tile-hi-soft: color-mix(in srgb, var(--brand) 26%, transparent);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-panel) + 0.25rem);
}

.compare-panel h3 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-5) var(--space-5) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.compare-panel h3::before {
  content: "";
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--tile-hi);
  box-shadow: 0 0 0 0.25rem var(--tile-hi-soft);
}

.panel-chatbot {
  --tile-bg: light-dark(#f2ede5, #231f1a);
  --tile-edge: light-dark(#e3dacb, #3a3329);
  --tile-ink: light-dark(#5a5146, #cbc1b3);
  --tile-soft: light-dark(rgb(90 81 70 / 0.14), rgb(203 193 179 / 0.16));
  --tile-hi: light-dark(#a8480a, #f2b04e);
  --tile-hi-soft: light-dark(rgb(184 90 12 / 0.18), rgb(242 176 78 / 0.2));
  border-style: dashed;
  border-color: color-mix(in srgb, var(--line-strong) 55%, transparent);
  background: var(--surface-sunk);
  color: var(--ink-muted);
}

.panel-chatbot h3 {
  color: var(--ink-muted);
  border-bottom: 1px dashed color-mix(in srgb, var(--line-strong) 40%, transparent);
}

.panel-vault {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 7%, var(--surface)), var(--surface) 9rem);
  box-shadow:
    0 22px 44px -22px color-mix(in srgb, var(--brand) 55%, transparent),
    0 2px 8px -2px color-mix(in srgb, var(--brand) 16%, transparent);
}

.panel-vault::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 0.25rem;
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 25%, var(--wash-d)));
}

.panel-vault h3 {
  color: var(--ink);
  border-bottom: 1px solid var(--tile-edge);
}

.compare-steps,
.pipe-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: cstep;
}

.panel-vault .compare-steps {
  counter-reset: cstep 2;
}

.compare-steps li,
.pipe-steps li {
  counter-increment: cstep;
  min-width: 0;
}

.compare-steps {
  display: grid;
  flex: 1;
  grid-auto-rows: 1fr;
  padding: 0 var(--space-5);
}

.compare-steps li {
  display: grid;
  align-content: center;
  padding-block: var(--space-4);
}

.compare-steps li + li {
  border-top: 1px dashed color-mix(in srgb, var(--line-strong) 40%, transparent);
}

.panel-vault .compare-steps li + li {
  border-top-style: solid;
  border-top-color: var(--tile-edge);
}

.compare-steps .cstep-row {
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.step-tile {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid var(--tile-edge);
  border-radius: 0.875rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tile-bg) 70%, var(--surface)), var(--tile-bg));
  color: var(--tile-ink);
}

.step-tile .tile-art {
  width: 2.5rem;
  max-width: none;
  stroke-width: 1.75;
}

.tile-art .soft { fill: var(--tile-soft); stroke: none; }
.tile-art .soft-top { fill: var(--tile-bg); }
.tile-art .hi { stroke: var(--tile-hi); }
.tile-art .hi-soft { fill: var(--tile-hi-soft); stroke: none; }
.tile-art .hi-solid { fill: var(--tile-hi); stroke: none; }
.tile-art .ink { stroke: var(--tile-ink); }

.cstep-row {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  text-align: start;
}

.step-art {
  width: 5rem;
  max-width: 5rem;
  height: auto;
}

.step-name {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--ink);
  font-weight: 650;
}

.pipe-steps .step-name::before {
  content: counter(cstep) ". ";
  color: var(--brand);
}

.compare-steps .step-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--step-0);
}

.compare-steps .step-name::before {
  content: counter(cstep);
  display: grid;
  flex: none;
  place-items: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  background: var(--tile-soft);
  color: var(--tile-ink);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1;
}

.panel-vault .step-name::before {
  background: var(--brand);
  color: var(--on-brand);
}

.cstep-text p {
  max-width: 40rem;
  margin: 0;
}

.panel-chatbot .cstep-text p {
  color: var(--ink-muted);
}

.pipe-steps {
  display: grid;
  gap: var(--space-3);
}

.pipe-steps li {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.pipe-steps .step-next {
  color: var(--ink-muted);
}

.pipe-steps .step-next .claim-label {
  margin-inline: 0;
}

.pipe-steps .claim {
  margin-top: 0;
}

@media (min-width: 60rem) {
  .pipe-steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: var(--space-5);
  }

  /* the rail between steps: solid while the step exists today, dashed into the one that is next */
  .pipe-steps li {
    position: relative;
  }

  .pipe-steps li + li::before {
    content: "";
    position: absolute;
    top: calc(var(--space-4) + 2.25rem);
    left: calc(-1 * var(--space-5));
    width: var(--space-5);
    border-top: 2px solid var(--brand);
  }

  .pipe-steps li.step-next::before {
    border-top-style: dashed;
  }

  .pipe-steps .cstep-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }
}

@media (max-width: 39.99rem) {
  .cstep-row {
    grid-template-columns: 4rem minmax(0, 1fr);
    gap: var(--space-3);
  }

  .step-art {
    width: 4rem;
    max-width: 4rem;
  }

  .compare-panel h3 {
    padding: var(--space-4) var(--space-4) var(--space-3);
    font-size: var(--step-1);
  }

  .compare-steps {
    grid-auto-rows: auto;
    padding: 0 var(--space-4);
  }

  .compare-steps .cstep-row {
    grid-template-columns: 2.75rem minmax(0, 1fr);
    gap: var(--space-3);
  }

  .step-tile {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
  }

  .step-tile .tile-art {
    width: 2rem;
  }
}

.pipe-steps .claim-label {
  font-size: 0.9375rem;
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- R3-P1 ---------- */

.gallery.is-pinned {
  display: grid;
  gap: 0;
}

.gallery.is-pinned > .gallery-item,
.gallery.is-carousel > .gallery-item {
  grid-area: 1 / 1;
}

/* The carousel (static/js/modules/carousel.js) runs where the pin does not: one figure at a time, the stage as tall as the tallest. */
.gallery.is-carousel {
  display: grid;
  gap: 0;
  touch-action: pan-y;
}

.gallery.is-carousel > .gallery-item {
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms var(--ease), visibility 0s linear 600ms;
}

.gallery.is-carousel > .gallery-item.is-current {
  opacity: 1;
  visibility: visible;
  transition: opacity 600ms var(--ease);
}

.gallery-dots {
  display: flex;
  justify-content: center;
  margin-top: var(--space-4);
}

.gallery-dots button {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.gallery-dots button::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background-color 300ms var(--ease), transform 300ms var(--ease);
}

.gallery-dots button[aria-current="true"]::before {
  background: var(--brand);
  transform: scale(1.3);
}

.gallery-dots button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -4px;
  border-radius: 8px;
}

/* ---------- R3-P2 ---------- */
/* The hero atmosphere: a pre-rendered still of the fog (the fallback, always there), and a WebGL canvas that fades in over it only once
   static/js/modules/atmosphere.js has proven the device (4+ cores, no performance caveat, 30 frames under 20 ms). */
#hero::after {
  content: "";
  position: absolute;
  inset: 0 0 -6rem;
  z-index: -2;
  background: url("/static/img/hero/atmosphere-light.webp") center / cover no-repeat;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
}

/* Where the canvas is not running (weak device, or it failed its probe) the still drifts slowly: compositor-only, finite. */
#hero:not(:has(.hero-atmosphere[data-atmosphere="on"]))::after {
  animation: fog-drift 24s ease-in-out 8 alternate both;
}

@keyframes fog-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1.04);
  }
  to {
    transform: translate3d(-2.5%, 1.5%, 0) scale(1.12);
  }
}

:root[data-theme="dark"] #hero::after {
  background-image: url("/static/img/hero/atmosphere-dark.webp");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #hero::after {
    background-image: url("/static/img/hero/atmosphere-dark.webp");
  }
}

.hero-atmosphere {
  position: absolute;
  inset: 0 0 -6rem;
  z-index: -1;
  width: 100%;
  height: calc(100% + 6rem);
  opacity: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
}

/* ---------- R3-P3 ---------- */
/* Lit conic border and a 2px lift on hover or keyboard focus (OfficeLabs visuals/kit/kit.css .sf-lit). CSS only; the
   ring is a finite single turn, never a loop. */
@property --lit-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.card-link,
.point,
.road-card,
.flow-card {
  position: relative;
}

.card-link::after,
.point::after,
.road-card::after,
.flow-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(from var(--lit-angle), transparent 0 40%, var(--brand) 62%, var(--cta-hover) 82%, transparent 94%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  pointer-events: none;
}

.card-link:focus-visible::after,
.point:focus-within::after,
.road-card:focus-within::after,
.flow-stop:has(.flow-radio:focus-visible) .flow-card::after {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .card-link:hover::after,
  .point:hover::after,
  .road-card:hover::after,
  .flow-stop:has(.flow-radio:hover) .flow-card::after {
    opacity: 1;
  }

  .point:hover,
  .road-card:hover {
    border-color: var(--brand);
  }
}

/* approach chapters: a lead line, the going links, and chapter 3's record window over its activity list */
.chapter-lead {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--ink);
}

.going-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.use-figure {
  margin: 0;
}

.activity {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.activity li {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.activity li p {
  margin: 0;
}

.activity .trail-next {
  border-style: dashed;
  background: transparent;
}

.use-figure figcaption {
  margin-top: var(--space-3);
  color: var(--ink-muted);
}

#approach-use .split-media {
  align-items: start;
}

/* direction: the four Later items as a care-path strip on the kit rail (#110). Lift is transform and box-shadow only. */
#direction .direction-group {
  max-width: 44rem;
  margin: var(--space-3) 0 0;
}

#direction .rail-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#direction .rail-card:is(:hover, :focus-within) {
  border-color: var(--line);
}

#direction .rail-card p {
  margin: 0;
  font-size: var(--step--1);
}

#direction .rail-card .moment {
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#direction .rail-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.2;
}

#direction .rail-card .clause {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

#direction .direction-still {
  margin: 0;
}

#direction .direction-still img {
  box-shadow: none;
  border: 1px solid var(--line);
}

#direction .still-note {
  display: block;
  margin-top: var(--space-2);
  color: var(--ink-muted);
  font-size: 0.75rem;
}

#direction .claim > p:last-of-type,
#direction .claim > .text-link {
  margin-top: var(--space-5);
}

#direction .claim > .text-link {
  display: inline-block;
}

#direction .claim > h2 {
  margin: var(--space-3) 0 0;
}
