/* Warrantum demo site. Colour, type and radius values are copied from assets/brand/tokens.json;
   scripts/build.mjs fails if they drift from the token file. */

@font-face { font-family: Spectral; font-weight: 500; font-display: swap; src: url("fonts/spectral-500.woff2") format("woff2"); }
@font-face { font-family: Spectral; font-weight: 600; font-display: swap; src: url("fonts/spectral-600.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: Spectral, Georgia, serif;
  --radius: 0.375rem;
  --radius-chip: 0.25rem;

  --background: #f5f6f8; --foreground: #14171c;
  --card: #ffffff; --primary: #1a4d99; --primary-foreground: #ffffff;
  --muted: #e9ecf0; --muted-foreground: #596270;
  --accent: #e1e9f5; --destructive: #a8231f; --success: #1a6b3c;
  --warning: #fdefbf; --warning-foreground: #5a4300;
  --border: #d5dae1; --ring: #1a4d99;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0e1116; --foreground: #e9ecf0;
    --card: #161a21; --primary: #8fb9f0; --primary-foreground: #0e1116;
    --muted: #21272f; --muted-foreground: #9ba4b1;
    --accent: #1c2a3f; --destructive: #f3918a; --success: #74cf9b;
    --warning: #3d3200; --warning-foreground: #ffe08a;
    --border: #2a313b; --ring: #8fb9f0;
  }
}
/* The video stage is always the dark scheme, like the title cards. */
.stage, .dark {
  color-scheme: dark;
  --background: #0e1116; --foreground: #e9ecf0;
  --card: #161a21; --primary: #8fb9f0; --primary-foreground: #0e1116;
  --muted: #21272f; --muted-foreground: #9ba4b1;
  --accent: #1c2a3f; --destructive: #f3918a; --success: #74cf9b;
  --border: #2a313b; --ring: #8fb9f0;
  background: var(--background); color: var(--foreground);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { overflow-x: clip; margin: 0; background: var(--background); color: var(--foreground); font: 16px/1.6 var(--sans); }
img, video { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, p { margin: 0; }
.wrap { width: 85%; margin: 0 auto; }

/* Type */
.display { font-family: var(--display); font-weight: 500; letter-spacing: -0.01em; line-height: 1.12; text-wrap: balance; }
.h-hero { font-size: clamp(2.4rem, 6.2vw, 4.5rem); }
.h-page { font-size: clamp(1.9rem, 4vw, 3rem); }
.h-section { font-size: clamp(1.6rem, 3vw, 2.25rem); }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.25rem); max-width: 40em; }
.muted { color: var(--muted-foreground); }
.label { font-size: 0.875rem; color: var(--muted-foreground); }
.mono { font-family: var(--mono); font-size: 0.875em; }
.rule { width: 2.5rem; height: 2px; background: var(--primary); margin-bottom: 1rem; }
.measure { max-width: 40em; }

/* Prototype bar */
.proto { background: var(--warning); color: var(--warning-foreground); font-size: 0.8125rem; }
.proto .wrap { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; padding-top: 0.4rem; padding-bottom: 0.4rem; }
.proto a { color: inherit; }
.proto a[aria-current] { font-weight: 600; text-decoration: none; }

/* Header */
.top { border-bottom: 1px solid var(--border); }
.top .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.wordmark { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; font-size: 1.375rem; color: var(--foreground); text-decoration: none; }
.top nav { display: flex; gap: 0.5rem 1.25rem; margin-left: auto; align-items: center; font-size: 0.9375rem; flex-wrap: wrap; }
.top nav a { text-decoration: none; }
.top nav a[aria-current] { color: var(--foreground); font-weight: 600; }
.who { color: var(--muted-foreground); font-size: 0.8125rem; }

/* Buttons, chips, fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 1.25rem; border-radius: var(--radius); border: 1px solid var(--primary); background: var(--primary); color: var(--primary-foreground); font: 600 0.9375rem var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; color: var(--primary); border-color: var(--border); }
.btn.quiet:hover { background: var(--accent); filter: none; }
.btn.small { min-height: 2rem; padding: 0 0.75rem; font-size: 0.8125rem; }
.btn.danger { background: transparent; color: var(--destructive); border-color: var(--border); }
.chip { display: inline-block; padding: 0.1rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-chip); font-size: 0.8125rem; color: var(--muted-foreground); white-space: nowrap; background: var(--card); }
.chip.on { background: var(--foreground); color: var(--background); border-color: var(--foreground); font-weight: 600; }
.field { display: grid; gap: 0.375rem; }
.field label { font-weight: 600; font-size: 0.9375rem; }
.field input, .field select { min-height: 2.75rem; padding: 0 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--foreground); font: inherit; width: 100%; }
.hp { position: absolute; left: -100vw; }

/* Sections */
section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
section + section { border-top: 1px solid var(--border); }
.hero { padding: clamp(4rem, 11vw, 9rem) 0 clamp(3.5rem, 8vw, 6.5rem); }
.hero .lead { margin-top: 1.75rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; margin-top: 2.25rem; }
.sec-head { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.sec-head p { margin-top: 1rem; }

/* The loop */
.loop-row { display: grid; grid-template-columns: minmax(0, 34rem) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
@media (max-width: 880px) { .loop-row { grid-template-columns: minmax(0, 1fr); } }
.loop { position: relative; aspect-ratio: 1; width: 100%; max-width: 34rem; margin: 0 auto; }
.loop svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.loop .track { fill: none; stroke: var(--border); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.loop .arc { fill: none; stroke: var(--foreground); stroke-width: 2; vector-effect: non-scaling-stroke; transition: stroke-dasharray 0.6s ease; }
.loop .chev { fill: none; stroke: var(--muted-foreground); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.loop-node { all: unset; cursor: pointer; }
.loop-node .dot { position: absolute; width: 0.875rem; height: 0.875rem; border-radius: 50%; transform: translate(-50%, -50%); background: var(--background); border: 1.5px solid var(--muted-foreground); transition: width 0.25s, height 0.25s, background 0.25s; }
.loop-node .dot::after { content: ""; position: absolute; inset: -1rem; border-radius: 50%; }
.loop-node .name { position: absolute; transform: translate(-50%, -50%); font-size: 0.875rem; line-height: 1.25; text-align: center; color: var(--muted-foreground); max-width: 6.5em; }
.loop-node.done .dot { background: var(--foreground); border-color: var(--foreground); }
.loop-node[aria-pressed="true"] .dot { width: 1.375rem; height: 1.375rem; background: var(--foreground); border-color: var(--foreground); box-shadow: 0 0 0 5px var(--background), 0 0 0 6px var(--border); }
.loop-node[aria-pressed="true"] .name { color: var(--foreground); font-weight: 600; }
.loop-node:hover .name { color: var(--foreground); }
.loop-node:focus-visible .dot { outline: 2px solid var(--ring); outline-offset: 3px; }
.loop-centre { position: absolute; inset: 27%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0.35rem; }
.loop-centre .display { font-size: clamp(1.25rem, 3.4vw, 2rem); }
.loop.compact { max-width: 15rem; }
.loop.compact .name, .loop.compact .chev { display: none; }
.loop.compact .loop-centre .display { font-size: 1.125rem; }
@media (max-width: 480px) { .loop-node .name { font-size: 0.75rem; } }

.step-panel { min-height: 15rem; }
.step-panel h3 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin: 0.25rem 0 1.25rem; }
.step-q { padding: 1rem 0; border-top: 1px solid var(--border); }
.step-q .display { font-size: 1.375rem; line-height: 1.25; margin-top: 0.15rem; }
.tenets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--border); }
.tenets p { padding: 1.25rem 1.25rem 0 0; font-family: var(--display); font-weight: 500; font-size: 1.1875rem; line-height: 1.3; }
@media (max-width: 760px) { .tenets { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* Question list (public) */
.part { margin-top: 3rem; }
.part:first-of-type { margin-top: 0; }
.part-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--foreground); }
.part-head h3 { font: 600 1.125rem var(--sans); }
.q-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: 0.25rem 1rem; align-items: baseline; padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.q-row .n { font-family: var(--mono); font-size: 0.875rem; color: var(--muted-foreground); }
.q-row .q { font-family: var(--display); font-weight: 500; font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.25; letter-spacing: -0.01em; }
.q-row .meta { display: flex; gap: 0.75rem; align-items: baseline; font-size: 0.8125rem; color: var(--muted-foreground); }
@media (max-width: 640px) { .q-row { grid-template-columns: 2rem minmax(0, 1fr); } .q-row .meta { grid-column: 2; } }

/* Access */
.access { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 760px) { .access { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.panel h3 { font: 600 1.125rem var(--sans); margin-bottom: 0.5rem; }
.panel form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.note { font-size: 0.875rem; color: var(--muted-foreground); }
.reply { margin-top: 1.25rem; padding: 1rem; border-radius: var(--radius); background: var(--accent); }
.bot { border: 1px dashed var(--border); border-radius: var(--radius); padding: 0.6rem 0.75rem; font-size: 0.8125rem; color: var(--muted-foreground); }

footer { border-top: 1px solid var(--border); padding: 2rem 0 3rem; font-size: 0.875rem; color: var(--muted-foreground); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; align-items: baseline; }

/* Journey cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 2rem 1.5rem; margin-top: 1.75rem; }
.card { display: block; color: inherit; text-decoration: none; }
.card .poster { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #0e1116; aspect-ratio: 16 / 9; }
.card .poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .poster img { transform: scale(1.03); }
.card .meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: center; margin-top: 0.9rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.card .q { font-family: var(--display); font-weight: 500; font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.01em; margin-top: 0.4rem; }
.card:hover .q { color: var(--primary); text-decoration: underline; text-underline-offset: 0.18em; }
.watched { color: var(--success); font-weight: 600; }
.next-up { border-top: 1px solid var(--border); padding-top: 1.25rem; }
.next-up .display { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0.5rem 0 0.75rem; }
.progress { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 0.75rem 0 1.5rem; }
.progress i { display: block; height: 100%; background: var(--foreground); }

/* Chapter */
.stage { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.stage .bridge { max-width: 26em; margin: 0.5rem 0 2rem; }
.player { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; }
.player:fullscreen { border: 0; border-radius: 0; display: grid; place-items: center; }
.mark { position: absolute; inset: 0; pointer-events: none; overflow: hidden; opacity: 0.09; color: #fff; font: 0.8125rem var(--mono); display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; justify-items: center; }
.mark span { transform: rotate(-18deg); white-space: nowrap; }
.under { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; align-items: center; margin-top: 0.9rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.strip { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 1.75rem; }
.strip a { text-decoration: none; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
@media (max-width: 880px) { .cols { grid-template-columns: 1fr; } }
blockquote { margin: 2.5rem 0; padding-left: 1.5rem; border-left: 2px solid var(--foreground); }
blockquote p { font-family: var(--display); font-weight: 500; font-size: clamp(1.4rem, 2.6vw, 1.875rem); line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
blockquote footer { border: 0; padding: 0.75rem 0 0; }
details { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
summary { cursor: pointer; padding: 1rem 0; font-weight: 600; }
.cue { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.6rem 0; }
.cue button { all: unset; cursor: pointer; color: var(--primary); font: 0.875rem var(--mono); text-decoration: underline; text-underline-offset: 0.18em; }
.cue button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.aside { text-align: center; }
.aside .label { margin-top: 0.75rem; }
.onward .display { margin: 0.5rem 0 1rem; max-width: 22em; }
.onward .bridge { font-size: 1.125rem; max-width: 40em; margin-bottom: 1.5rem; }

/* Dialog */
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--foreground); padding: clamp(1.5rem, 4vw, 2.5rem); max-width: 34rem; width: calc(100% - 2rem); }
dialog::backdrop { background: rgb(14 17 22 / 0.72); }
dialog h2 { font-size: 1.75rem; margin-bottom: 1rem; }
dialog p + p { margin-top: 0.75rem; }

/* Portal */
.tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 2rem 0 1.5rem; }
.tabs a { padding: 0.6rem 0.9rem; text-decoration: none; color: var(--muted-foreground); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--foreground); font-weight: 600; border-bottom-color: var(--foreground); }
.scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
th, td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
th { font-size: 0.8125rem; font-weight: 600; color: var(--muted-foreground); }
tr:last-child td { border-bottom: 0; }
td .btn + .btn { margin-left: 0.375rem; }
.ok { color: var(--success); font-weight: 600; }
.bad { color: var(--destructive); font-weight: 600; }
.h-sub { font: 600 1.125rem var(--sans); margin: 2.5rem 0 1rem; }
.invite { display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 1rem; align-items: end; }
@media (max-width: 760px) { .invite { grid-template-columns: 1fr; } }
.bar { display: inline-block; width: 5rem; height: 4px; background: var(--border); border-radius: 2px; vertical-align: middle; margin-right: 0.5rem; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--foreground); }

/* ---- Second pass: the loop leads, chapter numbers recede ---- */

/* Public hero */
.dark .top { border-bottom-color: transparent; }
.hero-pub { min-height: min(50rem, 90vh); display: grid; align-items: center; padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 5.5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero-pub h1 { font-size: clamp(2.4rem, 4.7vw, 3.6rem); margin-top: 0.5rem; }
.hero-pub .lead { margin-top: 1.5rem; }
.hero-ring .loop-centre { inset: 25%; }
.hero-ring .loop-centre .display { font-size: clamp(0.95rem, 1.45vw, 1.2rem); line-height: 1.25; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } .hero-ring { max-width: 26rem; } .hero-ring .loop-centre .display { font-size: 1rem; } }
.dark .tenets { margin-top: clamp(2.5rem, 6vw, 4rem); }

/* The case in three numbers */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.stat b { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(4rem, 11vw, 8rem); line-height: 0.95; letter-spacing: -0.02em; }
.stat span { display: block; margin-top: 0.75rem; font-size: clamp(1rem, 1.6vw, 1.25rem); max-width: 12em; }
@media (max-width: 560px) { .stats { grid-template-columns: minmax(0, 1fr); gap: 2rem; } }

/* Scroll round the loop */
.scrolly { display: grid; grid-template-columns: 21rem minmax(0, 1fr); gap: clamp(2rem, 7vw, 6rem); align-items: start; }
.scrolly-rail { position: sticky; top: calc(50vh - 11.5rem); }
.scrolly-rail .loop-centre .display { font-size: 1.375rem; }
.scrolly-rail .name { font-size: 0.75rem; }
@media (max-width: 880px) { .scrolly { grid-template-columns: minmax(0, 1fr); } .scrolly-rail { display: none; } }
.qa { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--border); opacity: 0.45; transition: opacity 0.4s; }
.qa.on { opacity: 1; }
.qa:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 880px), (prefers-reduced-motion: reduce) { .qa { opacity: 1; } }
.qa h3 { font-size: clamp(1.75rem, 3.6vw, 2.75rem); margin: 0.5rem 0 1.5rem; max-width: 17em; }
.qa .label b { color: var(--foreground); font-weight: 600; }
.redact { display: grid; gap: 0.55rem; max-width: 34rem; }
.redact i { display: block; height: 0.8rem; border-radius: 2px; background: var(--border); }
.sealed { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: center; margin-top: 1rem; font-size: 0.875rem; color: var(--muted-foreground); }

/* Journey: the loop with a thumbnail at every step */
.orbit { position: relative; aspect-ratio: 1120 / 800; margin-top: clamp(2rem, 4vw, 3rem); }
.orbit svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.orbit .track { fill: none; stroke: var(--border); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.orbit .chev { fill: none; stroke: var(--muted-foreground); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.stop { position: absolute; width: 18%; text-align: center; transform: translate(-50%, -50%); margin: 0; background: var(--background); }
.stop .meta { margin-top: 0.6rem; justify-content: center; }
@media (min-width: 1001px) { .orbit .stop .q { display: none; } }
.stop .meta b { color: var(--foreground); font-size: 0.9375rem; }
.stop .q { font-size: 1rem; margin-top: 0.2rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stop.next .poster { outline: 2px solid var(--foreground); outline-offset: 3px; }
.orbit-centre { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 36%; text-align: center; }
.orbit-centre .display { font-size: clamp(1.4rem, 2.4vw, 1.875rem); margin: 0.5rem 0 0.75rem; }
.orbit-centre .btn { margin-top: 1.25rem; }
@media (max-width: 1000px) {
  .orbit { aspect-ratio: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 2rem 1.5rem; }
  .orbit svg { display: none; }
  .stop, .orbit-centre { position: static; transform: none; width: auto; text-align: left; }
  .stop .meta { justify-content: flex-start; }
  .orbit-centre { grid-column: 1 / -1; text-align: left; padding-bottom: 1rem; }
}

/* Chapter: the loop as the way around */
.map { position: sticky; top: 1.5rem; }
.map .loop { max-width: 14rem; }
.map-panel { margin-top: 1.25rem; text-align: left; }
.map-panel a, .map-panel .here { display: block; padding: 0.7rem 0; border-top: 1px solid var(--border); font-family: var(--display); font-weight: 500; font-size: 1.0625rem; line-height: 1.3; text-decoration: none; color: var(--foreground); }
.map-panel a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 0.18em; }
.map-panel small { display: block; font: 0.8125rem var(--sans); color: var(--muted-foreground); margin-top: 0.15rem; }
.fit-btn { font-family: var(--sans); cursor: pointer; margin-top: 0.75rem; }
.fit-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.cols { grid-template-columns: minmax(0, 1fr) 18rem; }
@media (max-width: 880px) { .cols { grid-template-columns: minmax(0, 1fr); } .map { position: static; } }

/* ---- Third pass ---- */
/* Public: the questions as a journey down one line */
.path { position: relative; }
.path::before, .path-fill { content: ""; position: absolute; left: 0.4375rem; top: 0.5rem; width: 2px; margin-left: -1px; }
.path::before { bottom: 0; background: var(--border); }
.path-fill { background: var(--foreground); height: 0; }
.leg { position: relative; display: grid; grid-template-columns: minmax(11rem, 0.42fr) minmax(0, 1fr); gap: 1rem clamp(1.5rem, 4vw, 4rem); padding: 0 0 clamp(3rem, 7vw, 5.5rem) clamp(2.25rem, 4vw, 4rem); align-items: start; }
.leg:last-child { padding-bottom: 0; }
.leg .dot { position: absolute; left: 0; top: 0.5rem; width: 0.875rem; height: 0.875rem; border-radius: 50%; background: var(--background); border: 1.5px solid var(--muted-foreground); transition: background 0.3s, border-color 0.3s; }
.leg.on .dot { background: var(--foreground); border-color: var(--foreground); }
.leg-name { position: sticky; top: 30vh; }
.leg-name h3 { font-size: clamp(1.75rem, 3.2vw, 2.75rem); margin-top: 0.15rem; color: var(--muted-foreground); transition: color 0.3s; }
.leg.on .leg-name h3 { color: var(--foreground); }
.leg .qa { opacity: 1; border-top: 0; padding: 0 0 2.5rem; }
.leg .qa:last-child { padding-bottom: 0; }
.leg .qa h4 { font-size: clamp(1.4rem, 2.5vw, 2.125rem); margin: 0 0 1.1rem; max-width: 20em; }
.leg.turn { display: block; padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.leg.turn .display { font-size: clamp(1.4rem, 2.5vw, 2.125rem); color: var(--muted-foreground); }
@media (max-width: 760px) { .leg { grid-template-columns: minmax(0, 1fr); } .leg-name { position: static; } }

/* Chapter: the loop beside the video */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: clamp(1.5rem, 3vw, 2.5rem); align-items: start; }
.watch .map { position: static; }
.watch .map .loop { max-width: 11rem; }
.watch .map-panel { margin-top: 1rem; }
@media (max-width: 1000px) { .watch { grid-template-columns: minmax(0, 1fr); } }
.orbit { max-width: 84rem; margin-left: auto; margin-right: auto; }
.watch .map .loop { max-width: 13rem; }
.watch .map .loop-centre { inset: 24%; }
.watch .map .loop-centre .display { font-size: 0.9375rem; line-height: 1.2; }

/* ---- Fourth pass ---- */
/* Chapter title: two thirds of the player's width on a wide screen */
.watch { --side: 17rem; --gap: clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: minmax(0, 1fr) var(--side); gap: var(--gap); }
@media (min-width: 1001px) { .stage .bridge { max-width: calc((100% - 17rem - clamp(1.5rem, 3vw, 2.5rem)) * 2 / 3); } }

/* Chapter: the answer and what comes next use the full width */
.answer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.answer .lead { max-width: none; margin-top: 1.25rem; }
.answer blockquote { margin: 0.5rem 0 0; }
.answer blockquote p { font-size: clamp(1.5rem, 2.8vw, 2.375rem); }
#cues { columns: 30rem 2; column-gap: clamp(2rem, 6vw, 6rem); padding-bottom: 1rem; }
.cue { break-inside: avoid; }
.onward-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.onward .bridge { max-width: none; margin: 0.75rem 0 1.25rem; font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
.onward .display { max-width: none; margin: 0; }
@media (max-width: 880px) { .answer, .onward-grid { grid-template-columns: minmax(0, 1fr); } }

/* Journey: later groups open like a section, with no ruled bar */
.part-intro { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.part-intro h2 { margin: 0.4rem 0 0.75rem; }
.part-intro .lead { max-width: none; }
#parts .part { margin-top: clamp(4rem, 8vw, 6.5rem); }
#parts .part:first-child { margin-top: 0; }
#parts .cards { margin-top: 0; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
.stage .bridge { text-wrap: pretty; }
#parts .cards { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }

.overview { max-width: 38rem; font-size: clamp(1rem, 1.3vw, 1.125rem); color: var(--muted-foreground); }
.leg.on .overview { color: var(--foreground); }
@media (max-width: 1000px) { .watch { grid-template-columns: minmax(0, 1fr); } }

/* ==== Refinements from the second design review ==== */
.top.stick { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border); }
textarea { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); color: var(--foreground); font: inherit; resize: vertical; }
.audience { margin-top: 1.5rem; padding-left: 1rem; border-left: 2px solid var(--foreground); max-width: 34em; }
.ring-ctl { text-align: center; margin-top: 0.5rem; }
.leg.turn .btn { margin-top: 1.25rem; }

/* Public: what sits behind the invitation, blurred in the file itself */
.veil { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(2.5rem, 7vw, 6rem) clamp(1.5rem, 5vw, 4.5rem); background: var(--background) url("gen/teaser-blur.jpg") center / cover; margin-bottom: clamp(2rem, 4vw, 3rem); }
.veil::before { content: ""; position: absolute; inset: 0; background: var(--background); opacity: 0.7; }
.veil > * { position: relative; }
.veil .lead { margin-top: 1rem; }
.next-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 0 0 clamp(2rem, 4vw, 3rem); padding: 0; list-style: none; counter-reset: n; }
.next-steps li { counter-increment: n; border-top: 1px solid var(--border); padding-top: 1rem; }
.next-steps li::before { content: counter(n); display: block; font-family: var(--display); font-weight: 500; font-size: 1.75rem; line-height: 1; margin-bottom: 0.5rem; }
.next-steps b { display: block; }
@media (max-width: 760px) { .next-steps { grid-template-columns: minmax(0, 1fr); } }
.access { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; }
@media (max-width: 760px) { .access { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 1.5rem; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 480px) { .two { grid-template-columns: minmax(0, 1fr); } }
.todo { border: 1px dashed var(--muted-foreground); border-radius: var(--radius); padding: 1.25rem; }
.todo b { display: block; margin-bottom: 0.25rem; }

/* Signed in: clearer progress, product stills as thumbnails */
.poster { background: var(--card); }
.seen-badge { position: absolute; left: 0.5rem; top: 0.5rem; padding: 0.1rem 0.5rem; border-radius: var(--radius-chip); background: #0e1116; color: #e9ecf0; font-size: 0.75rem; font-weight: 600; }
.card.seen .poster img { opacity: 0.55; }
.stop .after { display: block; font-size: 0.75rem; color: var(--muted-foreground); }
.routes { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.25rem; margin-top: 1rem; font-size: 0.875rem; }
@media (max-width: 1000px) { .routes { justify-content: flex-start; } }
.asks { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
@media (max-width: 880px) { .asks { grid-template-columns: minmax(0, 1fr); } }

/* Chapter: the whole player is visible on arrival */
.stage { padding-top: clamp(1.5rem, 3vw, 2.25rem); }
.stage .bridge { font-size: clamp(1.3rem, 2vw, 1.75rem); line-height: 1.2; margin: 0.4rem 0 1.25rem; }
@media (min-width: 1001px) { .watch .player { width: min(100%, max(30rem, calc((100vh - 21rem) * 16 / 9))); } }
.under .right { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.upnext { position: absolute; right: 1rem; bottom: 4.5rem; width: min(22rem, calc(100% - 2rem)); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.upnext .display { font-size: 1.125rem; line-height: 1.25; margin: 0.25rem 0 0.75rem; }
.upnext .actions { margin-top: 0; gap: 0.5rem; }
.moments { margin: 0; padding: 0; list-style: none; }
.moments .cue { border-top: 1px solid var(--border); padding: 0.85rem 0; font-size: 1.0625rem; }
.answer h2 { font: 600 1.125rem var(--sans); margin-bottom: 1rem; }

/* Portal */
.signals { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.signal { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.signal b { display: block; }
.signal .btn { margin-top: 0.75rem; }
.roomy td, .roomy th { white-space: normal; }
.roomy td:last-child { white-space: nowrap; width: 1%; }
.acts { display: flex; gap: 0.375rem; flex-wrap: wrap; }
td .chip { margin: 0.25rem 0.25rem 0 0; }
.acts { flex-wrap: nowrap; }
.acts .btn + .btn { margin-left: 0; }

.access { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .access { grid-template-columns: minmax(0, 1fr); } }
.answer { margin-bottom: 0; }

/* Privacy notice */
.policy { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3.5rem, 8vw, 6rem); }
.policy > * { max-width: 46rem; }
.policy > .scroll { max-width: 64rem; }
.policy h1 { margin: 0.5rem 0 1rem; }
.policy h2 { font: 600 1.125rem var(--sans); margin: 2.5rem 0 0.75rem; }
.policy p + p, .policy .scroll + p, .policy ul + p { margin-top: 0.9rem; }
.policy .scroll { margin: 1rem 0; }
.policy ul { margin: 0.75rem 0 0; padding-left: 1.25rem; }
.policy li + li { margin-top: 0.4rem; }
mark { background: var(--warning); color: var(--warning-foreground); padding: 0 0.2em; border-radius: 2px; }
footer a { color: inherit; }

/* ==== Running site ==== */
.access.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .access.two-up { grid-template-columns: minmax(0, 1fr); } }
.flash { margin-bottom: 1rem; padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--muted); }
.flash.bad-news { color: var(--destructive); font-weight: 600; }
.simple { padding: clamp(4rem, 12vw, 9rem) 0; }
.simple h1 { margin: 0.5rem 0 1rem; }
form.inline { display: inline; }
pre.mail { white-space: pre-wrap; font: 0.875rem/1.5 var(--mono); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0.5rem 0 1.5rem; }

/* Business or technical: the switch in the top bar, and the choice on the request form. */
.switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.switch button { all: unset; cursor: pointer; padding: 0.3rem 0.8rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.switch button + button { border-left: 1px solid var(--border); }
.switch button[aria-pressed="true"] { background: var(--foreground); color: var(--background); font-weight: 600; }
.switch button:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.two-ways { margin-top: 1rem; max-width: 52em; }
/* The public loop as an unruled table: step, question, the business answer, the technical answer. */
#loop .leg { grid-template-columns: minmax(8.5rem, 0.2fr) minmax(0, 1fr); gap: 1rem clamp(1.25rem, 2.5vw, 2.5rem); }
#loop .qa { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 1rem clamp(1.25rem, 2.5vw, 2.5rem); align-items: start; padding-bottom: clamp(2rem, 4vw, 3.25rem); }
#loop .leg .qa h4 { font-size: clamp(1.2rem, 1.75vw, 1.625rem); margin: 0; max-width: none; text-wrap: balance; }
#loop .leg-name h3 { font-size: clamp(1.4rem, 2.1vw, 2rem); }
#loop .overview { max-width: none; font-size: 1rem; }
#loop .sealed { margin-top: 0.6rem; font-size: 0.8125rem; }
#loop .ans-name { display: none; }
#loop .leg.heads { position: sticky; top: 4rem; z-index: 5; padding-bottom: 0; background-clip: content-box; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); background: var(--background); border-bottom: 1px solid var(--border); }
#loop .leg.heads .qa { padding: 0.85rem 0; }
#loop .leg.heads .label b { color: var(--foreground); font-weight: 600; }
@media (max-width: 1000px) {
  #loop .qa { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  #loop .leg.heads { display: none; }
  #loop .ans-name { display: block; font-weight: 600; color: var(--foreground); margin-bottom: 0.25rem; }
}
.two-ways b { color: var(--foreground); font-weight: 600; }
.pick { border: 0; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.pick legend { font-weight: 600; font-size: 0.9375rem; padding: 0; margin-bottom: 0.5rem; }
.pick label { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); cursor: pointer; }
.pick label:has(input:checked) { border-color: var(--primary); }
.pick input { margin-top: 0.25rem; accent-color: var(--primary); }
.pick label span { display: grid; gap: 0.1rem; font-size: 0.875rem; color: var(--muted-foreground); }
.pick label b { color: var(--foreground); font-size: 0.9375rem; }
.linkish { all: unset; cursor: pointer; color: var(--primary); text-decoration: underline; text-underline-offset: 0.18em; }
.linkish:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
form.label { margin-top: 1.25rem; }

/* Asking and entering: the request is the main panel, with its fields beside the choice; the code entry sits beside it. */
.gate { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 1.5rem; align-items: stretch; }
.gate > .panel { display: flex; flex-direction: column; }
.gate-side { display: flex; flex-direction: column; gap: 1.5rem; }
.gate-side .panel:last-child { flex: 1; }
.panel form.ask { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.25rem clamp(1.25rem, 2.5vw, 2rem); align-items: start; flex: 1; align-content: start; }
.ask-who { display: grid; gap: 1rem; }
.ask-send { grid-column: 1 / -1; display: grid; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.ask-row { display: flex; gap: 1rem 1.5rem; align-items: center; flex-wrap: wrap; }
.ask-row .btn { flex: none; }
.ask-row .note { flex: 1 1 16rem; }
.ask .pick legend { margin-bottom: 0.375rem; }
.ask .pick label { padding: 0.6rem 0.85rem; }
@media (max-width: 1000px) { .gate { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .panel form.ask { grid-template-columns: minmax(0, 1fr); } }

/* The loop's introduction sits over the table's three columns, and is as wide as they are. */
#loop .leg.lede { padding-bottom: 0; }
#loop .leg.lede .sec-head p { max-width: none; }
#loop .leg.heads .label { display: grid; gap: 0.1rem; align-content: end; }
#loop .leg.heads .label b { font-size: 0.9375rem; }
#loop .leg.heads .qa { align-items: end; }
#loop .leg.lede .sec-head { grid-column: 1 / -1; }
