/* Despacho beta landing. Always dark: ivory lines on a void, one hot slash (accent) and one cold sliver.
 * Radius 0, hairlines, mono for anything the machine "measures". Colours are rgb channels, as in the app. */

:root {
  --canvas: 10 10 11;
  --surface: 20 19 18;
  --ink: 238 233 223;
  --ink-muted: 186 180 170;
  --ink-subtle: 128 123 115;
  --line: 52 50 47;
  --line-strong: 92 88 82;
  --accent: 224 65 12;
  --cold: 92 200 220;
  --font-display: 'Cormorant', Georgia, serif;
  --font-sans: 'Archivo', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.7, 0, .3, 1);
  --pad: clamp(1.25rem, 5vw, 4rem);
  color-scheme: dark;
}

/* Bright mode: paper and ink, same accent family, a deeper cyan so it still reads on paper. */
:root[data-theme='light'] {
  --canvas: 244 241 234;
  --surface: 234 229 219;
  --ink: 20 19 18;
  --ink-muted: 70 66 60;
  --ink-subtle: 112 106 98;
  --line: 214 207 195;
  --line-strong: 160 152 140;
  --accent: 206 54 4;
  --cold: 18 115 135;
  color-scheme: light;
}
:root[data-theme='light'] body::after { background: repeating-linear-gradient(0deg, rgb(var(--ink) / 0.018) 0 1px, transparent 1px 3px); }
:root[data-theme='light'] .slash-a { box-shadow: 0 0 18px rgb(var(--accent) / 0.35); }
:root[data-theme='light'] .slash-b { box-shadow: none; }
body { transition: background-color 0.4s, color 0.4s; }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
  background: rgb(var(--canvas));
  color: rgb(var(--ink));
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgb(var(--accent)); color: rgb(var(--ink)); }

/* A faint scanline veil over everything: the lab monitor. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(0deg, rgb(var(--ink) / 0.022) 0 1px, transparent 1px 3px);
}

.skip { position: absolute; left: -9999px; top: 0; z-index: 60; padding: 0.75rem 1rem; background: rgb(var(--ink)); color: rgb(var(--canvas)); font-family: var(--font-mono); }
.skip:focus { left: 1rem; top: 1rem; }
.mono { font-family: var(--font-mono); font-size: 0.9em; color: rgb(var(--ink)); }

/* ---------- slashes ---------- */
.slashes { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.slash { position: absolute; display: block; transform-origin: center; }
.slash-a {
  top: 14vh; right: -10vw; width: 70vw; height: 3px;
  background: linear-gradient(90deg, transparent, rgb(var(--accent)) 30%, rgb(var(--accent)) 70%, transparent);
  transform: rotate(-28deg);
  box-shadow: 0 0 24px rgb(var(--accent) / 0.6);
  animation: sweep 9s var(--ease) infinite;
}
.slash-b {
  top: 66vh; left: -20vw; width: 55vw; height: 1px;
  background: linear-gradient(90deg, transparent, rgb(var(--cold)), transparent);
  transform: rotate(-28deg);
  box-shadow: 0 0 14px rgb(var(--cold) / 0.7);
  animation: sweep 13s var(--ease) -4s infinite;
}
@keyframes sweep {
  0%, 100% { translate: 12vw 0; opacity: 0; }
  20%, 70% { opacity: 1; }
  50% { translate: -12vw 0; }
}
/* A slash that cuts in when its section scrolls into view. */
.slash-in {
  position: absolute; right: -4vw; bottom: 22%; width: 38vw; height: 9px;
  background: rgb(var(--accent));
  transform: rotate(-28deg) skewX(-28deg) scaleX(0);
  transform-origin: right;
  transition: transform 1.1s var(--ease) 0.25s;
  pointer-events: none;
}
.is-in > .slash-in, .is-in.manifesto .slash-in { transform: rotate(-28deg) skewX(-28deg) scaleX(1); }

/* ---------- top bar ---------- */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.5rem var(--pad);
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
}
.mark { font-weight: 500; letter-spacing: 0.42em; }
.tag { color: rgb(var(--ink-subtle)); }
.tag::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 0.6em; background: rgb(var(--accent)); vertical-align: 1px; animation: blink 1.6s steps(2) infinite; }
.top-link { margin-left: auto; color: rgb(var(--ink-muted)); text-decoration: none; border-bottom: 1px solid rgb(var(--line-strong)); }
.top-link:hover { color: rgb(var(--ink)); border-color: rgb(var(--ink)); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- hero ---------- */
.hero { position: relative; z-index: 1; min-height: 100svh; display: grid; align-items: center; padding: 7rem var(--pad) 5rem; }
.host { pointer-events: none; }
.hero-copy { max-width: 40rem; }
.kicker {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: rgb(var(--ink-subtle)); margin-bottom: 1.5rem;
}
.kicker::before { content: '//'; color: rgb(var(--accent)); margin-right: 0.75em; }
.h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.75rem, 6.2vw, 5.6rem); line-height: 0.98; letter-spacing: -0.02em;
}
.h1 .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.h1 .line > * { display: inline-block; transform: translateY(105%); animation: rise 1.1s var(--ease) forwards; }
.h1 .line:nth-child(2) > * { animation-delay: 0.14s; }
.h1 em { font-style: italic; color: rgb(var(--ink-muted)); }
@keyframes rise { to { transform: none; } }
.lede {
  margin-top: 1.75rem; max-width: 34rem; font-family: var(--font-serif); font-size: 1.125rem; line-height: 1.7; color: rgb(var(--ink-muted));
  opacity: 0; animation: fade 1s ease 0.5s forwards;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin-top: 2.25rem; opacity: 0; animation: fade 1s ease 0.7s forwards; }
@keyframes fade { to { opacity: 1; } }
.caption, .coords {
  position: absolute; right: var(--pad);
  font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--ink-subtle));
}
.caption { bottom: 3.4rem; color: rgb(var(--ink)); }
.caption-n { color: rgb(var(--accent)); }
.coords { bottom: 1.5rem; }

/* ---------- controls ---------- */
.cta {
  position: relative; display: inline-flex; align-items: center; gap: 0.9rem;
  padding: 1rem 1.6rem; border: 1px solid rgb(var(--ink));
  background: rgb(var(--ink)); color: rgb(var(--canvas));
  font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cta::after { content: ''; position: absolute; right: 0; bottom: 0; width: 17px; height: 2px; background: rgb(var(--accent)); transform: rotate(-45deg); transform-origin: right; }
.cta:hover { background: rgb(var(--accent)); border-color: rgb(var(--accent)); color: rgb(var(--ink)); }
.cta:disabled { opacity: 0.6; cursor: progress; }
.cta.ghost { background: transparent; color: rgb(var(--ink)); }
.cta.ghost:hover { background: rgb(var(--accent)); }
:is(.cta, .link, .chip, .top-link, a, button, input, select, textarea):focus-visible { outline: 2px solid rgb(var(--cold)); outline-offset: 3px; }
.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgb(var(--ink-muted)); text-decoration: none; border-bottom: 1px solid rgb(var(--line-strong));
}
.link:hover { color: rgb(var(--ink)); }


/* ---------- ticker ---------- */
.ticker { position: relative; z-index: 1; overflow: hidden; border-top: 1px solid rgb(var(--line)); border-bottom: 1px solid rgb(var(--line)); padding: 0.9rem 0; }
.ticker-track { display: flex; gap: 1.5rem; width: max-content; animation: ticker 38s linear infinite; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.3em; color: rgb(var(--ink-subtle)); }
.ticker-track b { font-weight: 400; color: rgb(var(--accent)); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- manifesto ---------- */
.manifesto { position: relative; z-index: 1; overflow: hidden; padding: clamp(5rem, 14vw, 10rem) var(--pad); }
.manifesto p { position: relative; z-index: 1; max-width: 62rem; font-family: var(--font-display); font-size: clamp(2rem, 4.6vw, 3.75rem); line-height: 1.08; letter-spacing: -0.01em; }
.accent { color: rgb(var(--accent)); font-style: italic; }

/* ---------- sections ---------- */
.section { position: relative; z-index: 1; padding: clamp(4rem, 10vw, 7rem) var(--pad); border-top: 1px solid rgb(var(--line)); }
.sec-head { display: flex; align-items: baseline; gap: 1.5rem; margin-bottom: 3rem; }
.sec-n { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.2em; color: rgb(var(--accent)); white-space: pre; }
.sec-head h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.05; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); border-left: 1px solid rgb(var(--line)); }
.card { position: relative; padding: 2rem 1.75rem 2.5rem; border: 1px solid rgb(var(--line)); border-left: 0; transition: background 0.3s; }
.card::before { content: ''; position: absolute; left: -1px; top: -1px; width: 0; height: 2px; background: rgb(var(--accent)); transition: width 0.45s var(--ease); }
.card:hover { background: rgb(var(--surface)); }
.card:hover::before { width: calc(100% + 2px); }
.card-n { font-family: var(--font-mono); font-size: 0.75rem; color: rgb(var(--ink-subtle)); letter-spacing: 0.2em; }
.card h3 { margin-top: 2.5rem; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.card p { margin-top: 0.75rem; font-family: var(--font-serif); line-height: 1.65; color: rgb(var(--ink-muted)); }

.steps { display: grid; max-width: 52rem; list-style: none; padding: 0; }
.steps li { display: grid; grid-template-columns: 5rem 1fr; gap: 1.5rem; padding: 1.75rem 0; border-bottom: 1px solid rgb(var(--line)); }
.step-n { font-family: var(--font-mono); font-size: 2.25rem; line-height: 1; color: rgb(var(--line-strong)); transition: color 0.3s; }
.steps li:hover .step-n { color: rgb(var(--cold)); }
.steps h3 { font-size: 1.25rem; font-weight: 600; }
.steps p { margin-top: 0.4rem; font-family: var(--font-serif); color: rgb(var(--ink-muted)); line-height: 1.6; }

.sec-lede { max-width: 42rem; margin-bottom: 2.5rem; font-family: var(--font-serif); font-size: 1.0625rem; line-height: 1.7; color: rgb(var(--ink-muted)); }
.corpus { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); border-left: 1px solid rgb(var(--line)); margin: 0; }
.corpus > div { display: flex; flex-direction: column; padding: 2rem 1.75rem 2.25rem; border: 1px solid rgb(var(--line)); border-left: 0; }
.corpus dd { order: -1; margin: 0; font-family: var(--font-display); font-size: clamp(2.5rem, 5vw, 3.75rem); line-height: 1; font-variant-numeric: tabular-nums; }
.corpus > div:first-child dd { color: rgb(var(--accent)); }
.corpus dt { margin-top: 1.25rem; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--ink-subtle)); }
.corpus p { margin-top: 0.75rem; font-family: var(--font-serif); line-height: 1.6; color: rgb(var(--ink-muted)); }
.corpus-list { list-style: none; padding: 0; margin-top: 2rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0.25rem 2rem; }
.corpus-list li { padding: 0.75rem 0; border-bottom: 1px solid rgb(var(--line)); font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.04em; color: rgb(var(--ink)); }
.corpus-list li::before { content: '/ '; color: rgb(var(--accent)); }
.waves { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.waves-copy p { font-family: var(--font-serif); font-size: 1.0625rem; line-height: 1.7; color: rgb(var(--ink-muted)); max-width: 30rem; }
.waves-copy p + p { margin-top: 1rem; }
.wave-list { list-style: none; padding: 0; display: grid; }
.wave-list li { display: grid; grid-template-columns: 7rem 1fr; align-items: baseline; gap: 1.5rem; padding: 1.25rem 0; border-bottom: 1px solid rgb(var(--line)); }
.wave-list li:first-child { border-top: 1px solid rgb(var(--line)); }
.wave-n { font-family: var(--font-display); font-size: clamp(2.5rem, 5vw, 3.75rem); line-height: 1; font-variant-numeric: tabular-nums; }
.wave-list li:first-child .wave-n { color: rgb(var(--accent)); }
.wave-l { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--ink-subtle)); }
@media (max-width: 860px) { .waves { grid-template-columns: 1fr; } }

/* ---------- forms ---------- */
.join-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(2rem, 6vw, 5rem); }
@media (max-width: 860px) { .join-grid { grid-template-columns: 1fr; } }
.join-copy p { font-family: var(--font-serif); font-size: 1.0625rem; line-height: 1.7; color: rgb(var(--ink-muted)); max-width: 28rem; }
.join-copy .fine { margin-top: 1.25rem; font-size: 0.875rem; color: rgb(var(--ink-subtle)); }
.form { display: grid; gap: 1.5rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem; }
.field { display: grid; gap: 0.5rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend {
  font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; color: rgb(var(--ink-subtle)); padding: 0;
}
.field em { font-style: normal; text-transform: none; letter-spacing: 0.02em; color: rgb(var(--ink-subtle) / 0.8); }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.8rem 0; background: transparent; color: rgb(var(--ink));
  border: 0; border-bottom: 1px solid rgb(var(--line-strong)); border-radius: 0;
  font-family: var(--font-sans); font-size: 1rem; outline: none; transition: border-color 0.2s;
}
.field select option { background: rgb(var(--surface)); color: rgb(var(--ink)); }
.field textarea { resize: vertical; font-family: var(--font-serif); }
.field :is(input, select, textarea):focus { border-bottom-color: rgb(var(--accent)); }
.field :is(input, select, textarea)[aria-invalid='true'] { border-bottom-color: rgb(var(--accent)); }
.hint { font-size: 0.8125rem; color: rgb(var(--ink-subtle)); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.chip {
  padding: 0.45rem 0.9rem; border: 1px solid rgb(var(--line-strong)); background: transparent; color: rgb(var(--ink-muted));
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { border-color: rgb(var(--ink)); color: rgb(var(--ink)); }
.chip[aria-pressed='true'] { background: rgb(var(--ink)); color: rgb(var(--canvas)); border-color: rgb(var(--ink)); }
.check { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 0.875rem; color: rgb(var(--ink-muted)); line-height: 1.5; cursor: pointer; }
.check input { margin-top: 0.2rem; accent-color: rgb(var(--accent)); width: 1rem; height: 1rem; flex: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.captcha:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }
.error { color: rgb(var(--accent)); font-size: 0.875rem; }
.done { padding: 2rem; border: 1px solid rgb(var(--accent)); display: grid; gap: 0.75rem; justify-items: start; animation: fade 0.6s ease both; outline: none; }
.done-title { font-family: var(--font-display); font-size: 2.25rem; line-height: 1; }
.done p:not(.done-title):not(.kicker) { font-family: var(--font-serif); color: rgb(var(--ink-muted)); line-height: 1.6; }

/* ---------- small pages (confirmado, baja, 404) ---------- */
.page { position: relative; z-index: 1; min-height: 100svh; display: grid; align-content: center; gap: 1.5rem; padding: 7rem var(--pad) 5rem; max-width: 52rem; }
.page p:not(.kicker) { font-family: var(--font-serif); font-size: 1.125rem; line-height: 1.7; color: rgb(var(--ink-muted)); max-width: 36rem; }
.page .actions { margin-top: 1rem; }

/* ---------- footer ---------- */
.foot {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; align-items: baseline;
  padding: 3rem var(--pad); border-top: 1px solid rgb(var(--line));
  font-size: 0.8125rem; color: rgb(var(--ink-subtle));
}
.foot .mark { font-family: var(--font-mono); font-size: 0.75rem; color: rgb(var(--ink)); }

/* ---------- scroll reveals: a clip-path wipe, staggered by --d ----------
 * The hidden state is opacity only: a fully clipped element has no area, so IntersectionObserver would never
 * see it arrive. The wipe runs as a keyframe once the element is in view. */
.js [data-reveal] { opacity: 0; }
.js [data-reveal].is-in { animation: wipe 0.9s var(--ease) calc(var(--d, 0) * 90ms) both; }
@keyframes wipe {
  from { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateY(12px); }
  to { opacity: 1; clip-path: inset(0 0 0 0); transform: none; }
}
/* Forms reveal with a fade only, so focus never lands on clipped content. */
.js .join-grid > [data-reveal].is-in:has(form) { animation-name: fade; }

@media (max-width: 760px) {
  .tag, .coords { display: none; }
  .caption { bottom: 1.5rem; }
  .hero { align-items: end; padding-top: 50svh; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slash, .tag::before, .ticker-track { animation: none; }
  .h1 .line > *, .lede, .hero-actions { animation: none; transform: none; opacity: 1; }
  .js [data-reveal].is-in { animation: fade 0.3s ease both; }
  .slash-in { transition: none; }
}
.top-home { color: inherit; text-decoration: none; }

/* ---------- stage: one sticky canvas behind the hero and the courtroom walk-in ---------- */
.stage { position: relative; }
.stage > .host { position: sticky; top: 0; display: block; width: 100%; height: 100svh; margin-bottom: -100svh; z-index: 0; }
.sala { position: relative; z-index: 1; padding: 0 var(--pad); }
.sala-step { min-height: 110svh; display: grid; align-content: center; max-width: 30rem; }
.sala-step:last-child { min-height: 160svh; }
.sala-step h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.25rem, 5vw, 4rem); line-height: 1.02; letter-spacing: -0.01em; }
.sala-step p:not(.kicker) { margin-top: 1rem; font-family: var(--font-serif); font-size: 1.125rem; line-height: 1.7; color: rgb(var(--ink-muted)); }
.sala-step > * { text-shadow: 0 0 18px rgb(var(--canvas)), 0 0 4px rgb(var(--canvas)); }

/* ---------- demo: the assistant on a monitor ---------- */
/* The whole monitor (bar + 16:10 video + caption) fits one screen, centred. */
.monitor { position: relative; margin: 0 auto; width: min(100%, calc((100svh - 11rem) * 1.6)); border: 1px solid rgb(var(--line-strong)); background: rgb(var(--surface)); }
.monitor::before { content: ''; position: absolute; left: -1px; top: -1px; width: 38%; height: 2px; background: rgb(var(--accent)); }
.monitor-bar { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1rem; border-bottom: 1px solid rgb(var(--line)); font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.14em; color: rgb(var(--ink-subtle)); }
.monitor-bar > span { display: inline-flex; align-items: center; gap: 0.7em; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.monitor-bar i { flex: none; width: 7px; height: 7px; background: rgb(var(--cold)); animation: blink 1.6s steps(2) infinite; }
.fs { flex: none; display: inline-flex; gap: 0.6em; align-items: center; padding: 0.35rem 0.7rem; border: 1px solid rgb(var(--line-strong)); background: none; color: rgb(var(--ink-muted)); font: inherit; letter-spacing: inherit; text-transform: uppercase; cursor: pointer; }
.fs:hover { color: rgb(var(--canvas)); background: rgb(var(--ink)); border-color: rgb(var(--ink)); }
.demo-video { cursor: zoom-in; }
.demo-video:fullscreen { cursor: auto; object-fit: contain; background: #000; }
.demo-video { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: rgb(var(--canvas)); }
.monitor figcaption { padding: 0.9rem 1rem; border-top: 1px solid rgb(var(--line)); font-size: 0.8125rem; line-height: 1.5; color: rgb(var(--ink-subtle)); }
@media (max-width: 760px) { .stage > .host { opacity: 0.75; } }

/* ---------- theme toggle ---------- */
.theme-toggle { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border: 1px solid rgb(var(--line-strong)); background: none; color: rgb(var(--ink)); cursor: pointer; }
.theme-toggle i { width: 0.8rem; height: 0.8rem; border-radius: 50%; border: 1.5px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); transition: transform 0.5s var(--ease); }
:root[data-theme='light'] .theme-toggle i { transform: rotate(180deg); }
.theme-toggle:hover { border-color: rgb(var(--accent)); color: rgb(var(--accent)); }

/* ---------- checkpoints: a rail of section ticks on the right edge ---------- */
.rail { position: fixed; right: clamp(0.5rem, 1.6vw, 1.5rem); top: 50%; translate: 0 -50%; z-index: 20; }
.rail ol { list-style: none; padding: 0; display: grid; gap: 0.35rem; }
.rail a { position: relative; display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; padding: 0.35rem 0; text-decoration: none; color: rgb(var(--ink-subtle)); font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.18em; text-transform: uppercase; }
.rail a::after { content: ''; width: 14px; height: 1px; background: currentColor; transition: width 0.35s var(--ease), background 0.35s; }
.rail span { opacity: 0; translate: 6px 0; transition: opacity 0.25s, translate 0.25s var(--ease); white-space: nowrap; padding: 0.15rem 0.4rem; background: rgb(var(--canvas) / 0.85); }
.rail a:hover, .rail a:focus-visible { color: rgb(var(--ink)); }
.rail a:hover span, .rail a:focus-visible span, .rail a[aria-current] span { opacity: 1; translate: 0 0; }
.rail a[aria-current] { color: rgb(var(--ink)); }
.rail a[aria-current]::after { width: 34px; height: 2px; background: rgb(var(--accent)); }
.rail:not(:hover):not(:focus-within) a[aria-current] span { opacity: 0.85; }
/* Top progress bar: how far down the page you are. */
.progress { position: fixed; left: 0; top: 0; z-index: 30; height: 2px; width: 100%; background: rgb(var(--accent)); transform-origin: left; transform: scaleX(var(--p, 0)); pointer-events: none; }
@media (max-width: 760px) {
  .rail { right: 2px; }
  .fs-l { display: none; }
  .fs { padding: 0.35rem 0.6rem; font-size: 0.9rem; }
  .rail a { padding: 0.3rem 0; }
  .rail span { display: none; }
  .rail a::after { width: 8px; }
  .rail a[aria-current]::after { width: 18px; }
  /* On a phone the recording is cropped to the conversation column (the left menu is cut), so the answer is legible. */
  .demo-video { aspect-ratio: 980 / 800; object-fit: cover; object-position: 100% 0; }
}
@media (prefers-reduced-motion: reduce) { .rail *, .theme-toggle i, body { transition: none; } }
