/* The pages to read: read.html and the guides under docs/. They stand on the film's stage:
   the same dark, the same warm lamp, the same grain, the same three typefaces. Colours and
   fonts come from base.css; this file names none of its own. */

:root {
  --bar: 3.75rem;
  --line-soft: color-mix(in srgb, var(--rim) 30%, transparent);
  --card: color-mix(in srgb, var(--floor) 82%, transparent);
  --lift: color-mix(in srgb, var(--light) 6%, transparent);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html { background: var(--dark); color: var(--ink); scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 1.5rem); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 1.0625rem/1.7 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }

/* The lamp over the page, and the film's finish: a vignette and a little grain. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background:
  radial-gradient(ellipse 60% 46% at 50% -8%, color-mix(in srgb, var(--light) 13%, transparent), transparent 70%),
  radial-gradient(ellipse 85% 42% at 72% 112%, color-mix(in srgb, var(--ember) 17%, transparent), transparent 72%),
  radial-gradient(ellipse 42% 38% at 0% 100%, color-mix(in srgb, var(--ember) 7%, transparent), transparent 70%); }
body::after { content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0.055; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"); }

a { color: var(--light); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--ember); transition: color 0.3s; }
a:hover { color: var(--ember); }
::selection { background: color-mix(in srgb, var(--ember) 45%, transparent); color: var(--light); }

h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 400; color: var(--light); text-wrap: balance; }
p, ul, ol, table, pre, blockquote, dl { margin: 0 0 1.3rem; }
p { text-wrap: pretty; }
strong { font-weight: 600; color: var(--light); }
img { max-width: 100%; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html:not(.js) .js-only { display: none !important; }
.skip { position: fixed; left: 1rem; top: -5rem; z-index: 50; padding: 0.7rem 1rem; background: var(--light); color: var(--dark); font-size: 0.85rem; text-decoration: none; border-radius: 0.3rem; }
.skip:focus { top: 0.7rem; color: var(--dark); }

/* The bar is the film's, with the stage behind it once the page moves under. */
.corner { z-index: 20; height: var(--bar); padding-top: 0; padding-bottom: 0; align-items: center; background: color-mix(in srgb, var(--dark) 78%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-soft); }
.corner nav a { padding: 0.6rem 0; }
.corner a[aria-current] { box-shadow: 0 1px 0 var(--ember); }
@media (max-width: 34rem) {
  .corner .mark span { display: none; }
}

/* ---------- Small parts used everywhere ---------- */

.kicker, thead th, .who { font: 500 0.7rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: 0.16em; color: var(--dim); }

.go { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 2rem 0 0; }
.go a { display: inline-block; padding: 0.85rem 1.4rem; font: 500 0.92rem/1 var(--sans); color: var(--light); text-decoration: none; background: var(--lift); border: 1px solid color-mix(in srgb, var(--light) 40%, transparent); border-radius: 999px; cursor: pointer; transition: background 0.3s, border-color 0.3s, color 0.3s; }
.go a:hover { background: color-mix(in srgb, var(--light) 14%, transparent); border-color: var(--light); color: var(--light); }
.go a.lit { color: var(--dark); background: var(--light); border-color: var(--light); }
.go a.lit:hover { background: var(--ember); border-color: var(--ember); color: var(--dark); }

/* ---------- Tables ---------- */

.scroll { overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--card); scrollbar-width: thin; scrollbar-color: var(--rim) transparent; }
.scroll:focus-visible { outline-offset: 2px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.93rem; line-height: 1.5; }
.scroll table { margin: 0; }
.body > table { border: 1px solid var(--line); border-radius: 0.7rem; background: var(--card); }
th, td { text-align: left; vertical-align: top; padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { padding-top: 0.9rem; padding-bottom: 0.8rem; border-bottom-color: var(--line); white-space: nowrap; }
tbody th { font-weight: 500; color: var(--light); }
td:first-child { color: var(--light); }
td code, th code { overflow-wrap: break-word; }
/* A short piece of code stays in one piece (tools/markdown.py marks it). */
code.whole { white-space: nowrap; }
tbody tr { transition: background 0.3s; }
tbody tr:hover { background: var(--lift); }

/* ---------- The opening of the reading page ---------- */

.stage { padding-top: var(--bar); }
.hero { padding: clamp(4rem, 13vh, 9rem) var(--edge) clamp(3rem, 8vh, 5.5rem); max-width: 62rem; }
.hero h1 { font-size: clamp(2.7rem, 6.4vw, 6.6rem); line-height: 1; letter-spacing: -0.025em; max-width: 13ch; }
.hero .name { display: block; margin-bottom: 1.7rem; font: 500 0.7rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: 0.16em; color: var(--ember); }
.lede { margin: 1.9rem 0 0; max-width: 37rem; font-size: clamp(1.1rem, 1.35vw, 1.28rem); line-height: 1.55; color: var(--ink); }
.standing { margin: 1.4rem 0 0; max-width: 35rem; font-size: 0.93rem; line-height: 1.6; color: var(--dim); }
.opening { position: relative; }
.hero-art { position: absolute; z-index: -1; right: var(--edge); top: calc(var(--bar) + clamp(1rem, 5vh, 4rem)); width: min(46vw, 44rem); height: auto; pointer-events: none; -webkit-mask-image: radial-gradient(ellipse 62% 56% at 50% 54%, #000 45%, transparent 98%); mask-image: radial-gradient(ellipse 62% 56% at 50% 54%, #000 45%, transparent 98%); }
.js .hero-art { animation: dawn 2.4s ease-out both; }
@keyframes dawn { from { opacity: 0; } }
@media (max-width: 68.74rem) { .hero-art { position: static; display: block; width: 100%; max-width: 34rem; margin: 0 auto -1rem; padding: calc(var(--bar) + 1rem) var(--edge) 0; } .hero-art + .hero, .hero-art + .docs-hero { padding-top: 0; } }
@media (max-width: 45rem) { .hero-art { max-width: 19rem; margin-bottom: 0.5rem; } }
.js .hero > *, .js .docs-hero > * { animation: arrive 1.2s var(--ease) both; }
.js .hero > :nth-child(2), .js .docs-hero > :nth-child(2) { animation-delay: 0.15s; }
.js .hero > :nth-child(3), .js .docs-hero > :nth-child(3) { animation-delay: 0.3s; }
.js .hero > :nth-child(n + 4), .js .docs-hero > :nth-child(n + 4) { animation-delay: 0.45s; }
@keyframes arrive { from { opacity: 0; filter: blur(14px); transform: translateY(1.4rem); } }

/* ---------- The bench: the definition on the slab, and what it produces ---------- */

.bench { padding: 0 var(--edge) clamp(4rem, 9vw, 7rem); }
.steps { display: flex; gap: 0.4rem; padding: 0.35rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; width: fit-content; }
.steps a { padding: 0.6rem 1.1rem; font: 500 0.72rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); text-decoration: none; border-radius: 999px; transition: color 0.3s, background 0.3s; }
.steps a:hover { color: var(--light); }
.steps a[aria-current] { color: var(--dark); background: var(--light); }

.doc { margin-bottom: 2.5rem; }
.doc h2 { font-size: clamp(1.6rem, 2.3vw, 2.1rem); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 0.7rem; }
.doc .caption { font-size: 0.97rem; line-height: 1.6; color: var(--dim); max-width: 36rem; min-height: 4.7rem; }
.doc pre { margin-bottom: 0.9rem; }
.doc pre > code { max-height: 34rem; }
.doc pre::after { content: "Rust"; }
#doc-http pre::after { content: "HTTP"; }
#doc-openapi pre::after { content: "OpenAPI 3.1"; }
#doc-mcp pre::after { content: "MCP"; }
#doc-definition pre { border-top-color: color-mix(in srgb, var(--ember) 60%, transparent); box-shadow: 0 2.5rem 5rem -2.6rem color-mix(in srgb, var(--ember) 42%, transparent), 0 1rem 2rem -1rem var(--dark); }
.line { display: block; margin: 0 -1.25rem; padding: 0 1.25rem; }
.line.fresh { background: color-mix(in srgb, var(--ember) 14%, transparent); box-shadow: inset 3px 0 var(--ember); animation: fresh 1.4s ease-out; }
@keyframes fresh { from { background: color-mix(in srgb, var(--ember) 42%, transparent); } }
.note { min-height: 2.6rem; padding-left: 0.9rem; border-left: 2px solid var(--ember); font-size: 0.86rem; line-height: 1.5; color: var(--dim); }
.aside { font-size: 0.86rem; line-height: 1.55; color: var(--dim); }

.controls { padding: 1.5rem 1.5rem 0.6rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.7rem; }
.matrix { width: auto; margin-bottom: 1.6rem; font-size: 0.8rem; }
.controls caption, .controls legend { text-align: left; padding: 0 0 0.7rem; font: 500 0.8rem/1.3 var(--mono); color: var(--ember); }
.matrix th, .matrix td { padding: 0; border: 0; vertical-align: middle; }
.matrix tbody tr:hover { background: none; }
.matrix thead th { width: 3.4rem; padding: 0 0.15rem 0.5rem; font-size: 0.58rem; letter-spacing: 0.08em; text-align: center; vertical-align: bottom; white-space: normal; }
.matrix tbody th { font: 0.8rem/1 var(--mono); padding-right: 1rem; white-space: nowrap; color: var(--ink); }
.matrix label { position: relative; display: grid; place-items: center; width: 3.4rem; height: 2.75rem; cursor: pointer; }
.matrix input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.box { width: 1.15rem; height: 1.15rem; border: 1px solid var(--dim); border-radius: 0.25rem; transition: background 0.2s, border-color 0.2s, box-shadow 0.2s; }
.matrix label:hover .box { border-color: var(--light); box-shadow: 0 0 0 4px var(--lift); }
.matrix input:checked + .box { background: var(--ember); border-color: var(--ember); box-shadow: inset 0 0 0 3px var(--floor), 0 0 0.9rem color-mix(in srgb, var(--ember) 55%, transparent); }
.matrix input:disabled { cursor: default; }
.matrix input:disabled + .box { border-color: var(--line); box-shadow: none; }
.matrix input:focus-visible + .box { outline: 2px solid var(--ember); outline-offset: 3px; }
.matrix .na::after { content: ""; display: block; width: 0.4rem; height: 1px; margin: 0 auto; background: var(--rim); }

.choice { border: 0; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.choice legend { float: left; width: 100%; }
.choice label { position: relative; cursor: pointer; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span { display: block; padding: 0.7rem 1rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.84rem; line-height: 1; color: var(--ink); transition: background 0.2s, color 0.2s, border-color 0.2s; }
.choice label:hover span { border-color: var(--light); }
.choice input:checked + span { background: var(--light); border-color: var(--light); color: var(--dark); }
.choice input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 3px; }
.controls .aside { margin: 0 0 0.7rem; }
.controls button { padding: 0; border: 0; background: none; font: inherit; color: var(--light); text-decoration: underline; text-decoration-color: var(--ember); text-underline-offset: 0.22em; cursor: pointer; }
.controls button:hover { color: var(--ember); }

/* A wide window: the definition and its form on the left, one of the three interfaces on the right. */
@media (min-width: 68.75rem) {
  .bench { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "definition steps" "definition output" "form output"; grid-template-rows: auto auto 1fr; column-gap: clamp(2rem, 4vw, 4rem); align-items: start; }
  .docs { display: contents; }
  .steps { grid-area: steps; margin-bottom: 1.6rem; }
  .steps a[data-doc-link="definition"] { display: none; }
  .doc { grid-area: output; display: none; margin: 0; }
  #doc-definition { grid-area: definition; display: block; margin-bottom: 1.5rem; }
  .exhibit[data-doc="definition"] #doc-http, .exhibit[data-doc="http"] #doc-http, .exhibit[data-doc="openapi"] #doc-openapi, .exhibit[data-doc="mcp"] #doc-mcp { display: block; }
  #doc-definition h2 { margin-top: 0.25rem; }
  #doc-definition .caption { margin-bottom: 2.05rem; }
  .controls { grid-area: form; display: grid; grid-template-columns: auto 1fr; column-gap: 2.5rem; }
  .controls .matrix { grid-row: span 2; }
  .controls .aside { grid-column: 1 / -1; }
}

/* A narrow window: one document at a time, kept in sight while the form is used. */
@media (max-width: 45rem) {
  .steps { position: sticky; top: calc(var(--bar) + 0.4rem); z-index: 6; width: auto; justify-content: space-between; gap: 0; background: var(--floor); }
  .steps a { flex: 1; padding: 0.8rem 0; text-align: center; font-size: 0.66rem; letter-spacing: 0.06em; }
  .doc { display: none; margin: 0; }
  .exhibit[data-doc="definition"] #doc-definition, .exhibit[data-doc="http"] #doc-http, .exhibit[data-doc="openapi"] #doc-openapi, .exhibit[data-doc="mcp"] #doc-mcp { display: block; }
  .doc h2 { font-size: 1.5rem; margin-top: 1.4rem; }
  .doc .caption { min-height: 0; }
  .doc pre { font-size: 0.72rem; }
  .doc pre > code { padding: 0.2rem 1rem 1rem; }
  .line { margin: 0 -1rem; padding: 0 1rem; }
  .controls { margin-top: 1.2rem; padding: 1.2rem 0.8rem 0.4rem; }
  .matrix thead th, .matrix label { width: 2.85rem; }
  .matrix thead th { font-size: 0.52rem; letter-spacing: 0.04em; }
  .matrix tbody th { padding-right: 0.5rem; font-size: 0.74rem; }
}
@media (max-width: 45rem) and (min-height: 40rem) {
  .docs { position: sticky; top: calc(var(--bar) + 3.4rem); z-index: 5; background: var(--dark); padding-bottom: 0.4rem; border-bottom: 1px solid var(--line); }
  .doc h2, .doc .caption { display: none; }
  .doc pre { margin-top: 0.8rem; }
  .doc pre > code { max-height: 30svh; }
  .note { margin-bottom: 0.5rem; }
}
@media (min-width: 45.01rem) and (max-width: 68.74rem) {
  .steps { margin-bottom: 2.5rem; }
  .controls { max-width: 40rem; }
}

/* ---------- The chapters: each one a scene, with its number and a small picture of its shot ---------- */

.chapter { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 46rem); justify-content: center; column-gap: clamp(2.5rem, 6vw, 6rem); padding: clamp(4.5rem, 10vw, 8.5rem) var(--edge); border-top: 1px solid var(--line-soft); background: radial-gradient(ellipse 50% 22rem at 22% 0%, color-mix(in srgb, var(--light) 5%, transparent), transparent 70%); }
.scene { position: sticky; top: calc(var(--bar) + 2rem); align-self: start; }
.scene .no { display: block; font: 400 clamp(4rem, 7vw, 6.2rem)/0.9 var(--serif); letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--light) 45%, transparent); }
.scene .kicker { margin: 1.1rem 0 0; color: var(--ember); }
.scene img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; margin-top: 1.6rem; border: 1px solid var(--line-soft); border-radius: 0.7rem; background: color-mix(in srgb, var(--dark) 60%, transparent); }
.chapter h2 { font-size: clamp(2.2rem, 4.2vw, 3.7rem); line-height: 1.04; letter-spacing: -0.022em; margin-bottom: 2rem; }
.chapter h3 { font-size: 1.55rem; line-height: 1.2; letter-spacing: -0.01em; margin: 3.2rem 0 1rem; }
.chapter h4 { font: 400 1.25rem/1.3 var(--serif); margin: 0 0 1rem; }
.body { min-width: 0; }
.body > :last-child { margin-bottom: 0; }
.body > p, .body > ul:not([class]) { max-width: 41rem; }
.body ul:not([class]), .body ol:not([class]) { padding-left: 1.2rem; }
.body li { margin-bottom: 0.55rem; }
.body li::marker { color: var(--ember); }
blockquote { margin-left: 0; padding: 0.2rem 0 0.2rem 1.1rem; border-left: 2px solid var(--ember); color: var(--dim); }
blockquote > :last-child { margin-bottom: 0; }

/* A chapter's title comes into focus as it arrives, as a shot's title does. */
.js .chapter:not(.on) .scene, .js .chapter:not(.on) h2 { opacity: 0; filter: blur(12px); transform: translateY(1.2rem); }
.js .chapter .scene, .js .chapter h2 { transition: opacity 0.9s ease, filter 1.1s ease, transform 1.3s var(--ease); }
.js .chapter.on h2 { transition-delay: 0.15s; }

/* Key numbers, as the film sets "45 MiB". */
.figures { display: grid; grid-template-columns: repeat(3, auto); gap: 1px; margin: 0 0 2.2rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--line-soft); overflow: hidden; }
.figures div { padding: 1.5rem 1.4rem 1.4rem; background: color-mix(in srgb, var(--floor) 88%, var(--dark)); }
.figures dt { font: 400 clamp(2.5rem, 4.2vw, 3.7rem)/0.95 var(--serif); letter-spacing: -0.035em; color: var(--light); white-space: nowrap; }
.figures dt small { font-size: 0.34em; letter-spacing: 0; color: var(--dim); }
.figures dd { margin: 0.8rem 0 0; font-size: 0.86rem; line-height: 1.45; color: var(--dim); }

/* The order of the checks: one line, and the status each check answers with. */
.plain, .order, .scenarios, .guides { list-style: none; padding: 0; }
.order { position: relative; margin: 2rem 0; }
.order::before { content: ""; position: absolute; left: 1.7rem; top: 1rem; bottom: 1rem; width: 1px; background: linear-gradient(var(--ember), var(--line)); }
.order li { position: relative; margin: 0; padding: 0.85rem 0 0.85rem 5rem; }
.code-status { font: 500 0.78rem/1 var(--mono); color: var(--ember); }
.order .code-status { position: absolute; left: 0; top: 0.95rem; width: 3.4rem; padding: 0.42rem 0; text-align: center; background: var(--dark); border: 1px solid color-mix(in srgb, var(--ember) 55%, transparent); border-radius: 999px; }

.plain li { position: relative; margin: 0; padding: 0.9rem 0 0.9rem 1.5rem; border-bottom: 1px solid var(--line-soft); }
.plain li:first-child { border-top: 1px solid var(--line-soft); }
.plain li::before { content: ""; position: absolute; left: 0.1rem; top: 1.55rem; width: 0.6rem; height: 1px; background: var(--ember); }

/* The same request asked both ways: two exchanges side by side. */
.scenario { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; margin: 0 0 1.2rem; padding: 1.4rem 1.4rem 0.4rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.7rem; }
.scenario h4, .scenario > p { grid-column: 1 / -1; }
.scenario .side { display: flex; flex-direction: column; margin-bottom: 1rem; }
.scenario .side p:not(.who), .scenario > p { font-size: 0.86rem; line-height: 1.5; color: var(--dim); margin: 0.2rem 0 1rem; }
.who { margin: 0 0 0.6rem; }
.who::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; margin-right: 0.55rem; border-radius: 50%; background: var(--light); box-shadow: 0 0 0.7rem var(--light); }
.side + .side .who::before { background: var(--ember); box-shadow: 0 0 0.7rem var(--ember); }
pre.ask, pre.answer { margin: 0; padding: 0; box-shadow: none; font-size: 0.76rem; line-height: 1.6; }
pre.ask::before, pre.answer::before { position: absolute; top: 0.75rem; left: 0.8rem; width: auto; height: auto; background: none; font: 0.76rem/1.6 var(--mono); }
pre.ask::before { content: "\2192"; color: var(--dim); }
pre.answer::before { content: "\2190"; color: var(--ember); }
pre.ask::after, pre.answer::after { content: none; }
pre.ask > code, pre.answer > code { padding: 0.75rem 0.9rem 0.75rem 2.2rem; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.ask { border-bottom: 0; border-radius: 0.6rem 0.6rem 0 0; background: color-mix(in srgb, var(--light) 5%, var(--dark)); }
pre.answer { flex: 1; border-top-color: var(--line-soft); border-radius: 0 0 0.6rem 0.6rem; background: var(--dark); }
.side pre.answer { margin-bottom: 0.5rem; }

/* The status: what is true today, each as a card. */
.state { display: inline-flex; align-items: center; gap: 0.7rem; margin: -0.6rem 0 2rem; padding: 0.55rem 1.1rem 0.55rem 0.9rem; font: 500 0.82rem/1.3 var(--sans); color: var(--light); border: 1px solid color-mix(in srgb, var(--ember) 55%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--ember) 8%, transparent); }
.state::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0.8rem var(--ember); animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.35; } }
#status .plain { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
#status .plain li { padding: 1.2rem 1.3rem 1.25rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--card); font-size: 0.93rem; line-height: 1.55; color: var(--dim); }
#status .plain li::before { content: none; }
#status .plain li:first-child { grid-column: 1 / -1; border-top-color: color-mix(in srgb, var(--ember) 55%, transparent); }
#status .plain strong { display: block; margin-bottom: 0.45rem; font: 400 1.22rem/1.25 var(--serif); color: var(--light); }

/* The guides, as tiles. */
.guides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; margin-bottom: 1.6rem; }
.guides li { margin: 0; }
.guides a, .tile { display: block; height: 100%; padding: 1rem 1.2rem 1.1rem; text-decoration: none; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--card); transition: border-color 0.3s, background 0.3s, transform 0.5s var(--ease); }
.guides a:hover, .tile:hover { border-color: color-mix(in srgb, var(--ember) 70%, transparent); background: color-mix(in srgb, var(--ember) 6%, var(--floor)); transform: translateY(-2px); color: var(--light); }
.guides b, .tile b { display: block; font: 400 1.22rem/1.25 var(--serif); color: var(--light); }
.guides span, .tile span { display: block; margin-top: 0.3rem; font-size: 0.84rem; line-height: 1.5; color: var(--dim); }
.guides span::first-letter, .tile span::first-letter { text-transform: uppercase; }
.guides code, .tile code { font-size: 0.82em; }

/* The questions. */
.qa { margin: 0 0 0.6rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--card); transition: border-color 0.3s; }
.qa[open] { border-color: color-mix(in srgb, var(--ember) 45%, transparent); }
.qa summary { position: relative; padding: 1.05rem 3.4rem 1.05rem 1.3rem; font: 400 1.22rem/1.3 var(--serif); color: var(--light); cursor: pointer; list-style: none; border-radius: 0.7rem; transition: color 0.3s; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: ""; position: absolute; right: 1.4rem; top: calc(50% - 0.4rem); width: 0.8rem; height: 0.8rem; background: linear-gradient(var(--ember), var(--ember)) center / 100% 1px no-repeat, linear-gradient(var(--ember), var(--ember)) center / 1px 100% no-repeat; transition: transform 0.4s var(--ease); }
.qa[open] summary::after { transform: rotate(45deg); }
.qa summary:hover { color: var(--ember); }
.qa summary code { font-size: 0.8em; }
.qa div { padding: 0 3rem 0.2rem 1.3rem; color: var(--ink); }

/* The marks at the right edge, as the film's: one per chapter. */
.progress { position: fixed; z-index: 15; right: calc(var(--edge) - 4.1rem); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; }
.progress a { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.9rem; font: 500 0.64rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: transparent; transition: color 0.4s; }
.progress a::after { content: ""; width: 0.7rem; height: 1px; background: var(--dim); opacity: 0.55; transition: width 0.5s, opacity 0.5s, background 0.5s; }
.progress a:hover, .progress a:focus-visible { color: var(--light); }
.progress a:hover::after { opacity: 1; }
.progress a[aria-current]::after { width: 1.8rem; background: var(--light); opacity: 1; }
@media (max-width: 80rem) { .progress { display: none; } }

.foot { padding: 3.5rem var(--edge) 4.5rem; border-top: 1px solid var(--line-soft); font-size: 0.86rem; line-height: 1.65; color: var(--dim); }
.foot p { max-width: 46rem; margin: 0 0 0.8rem; }
.foot .mark { display: block; margin-bottom: 1rem; font-size: 0.8rem; letter-spacing: 0.02em; text-decoration: none; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; margin-top: 1.4rem; }
.foot nav a { color: var(--dim); text-decoration: none; }
.foot nav a:hover { color: var(--ember); }

@media (max-width: 62.5rem) {
  .chapter { grid-template-columns: minmax(0, 46rem); }
  .scene { position: static; display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 1.2rem; margin-bottom: 2.2rem; }
  .scene .no { font-size: 4rem; }
  .scene .kicker { margin: 0 0 0.5rem; }
  .scene img { grid-column: 1 / -1; aspect-ratio: 16 / 7; object-fit: contain; }
}
@media (max-width: 45rem) {
  .figures, .guides, .scenario, #status .plain { grid-template-columns: minmax(0, 1fr); }
  .scenario { padding: 1.1rem 1rem 0.2rem; }
  .qa div { padding-right: 1.3rem; }
  th, td { padding: 0.7rem 0.9rem; }
  .body > table { display: block; overflow-x: auto; }
}

/* ---------- The guides under docs/ ---------- */

.shell { display: grid; grid-template-columns: 17.8rem minmax(0, 1fr); column-gap: clamp(2rem, 4vw, 4.5rem); max-width: 96rem; margin: 0 auto; padding: var(--bar) var(--edge) 0; }

.rail { position: sticky; top: var(--bar); align-self: start; height: calc(100vh - var(--bar)); overflow-y: auto; padding: 2rem 1rem 3rem 0.8rem; border-right: 1px solid var(--line-soft); scrollbar-width: thin; scrollbar-color: var(--rim) transparent; overscroll-behavior: contain; }
.rail h2 { margin: 1.8rem 0 0.5rem; font: 500 0.66rem/1.3 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail li a { display: block; margin: 1px 0 1px -0.8rem; padding: 0.45rem 0.8rem; font-size: 0.9rem; line-height: 1.35; color: var(--dim); text-decoration: none; border-radius: 0.4rem; transition: color 0.3s, background 0.3s; }
.rail li a:hover { color: var(--light); background: var(--lift); }
.rail li a[aria-current] { color: var(--light); background: color-mix(in srgb, var(--ember) 13%, transparent); box-shadow: inset 2px 0 var(--ember); }
.rail .home { display: block; margin: 0 0 1.2rem; font: 400 1.3rem/1.2 var(--serif); color: var(--light); text-decoration: none; }
.rail .home:hover { color: var(--ember); }
.rail-close { display: none; }

/* The filter over titles and headings. */
.search { position: relative; }
.search input { width: 100%; padding: 0.7rem 2.4rem 0.7rem 0.95rem; font: 0.9rem/1.3 var(--sans); color: var(--light); background: color-mix(in srgb, var(--dark) 70%, transparent); border: 1px solid var(--line); border-radius: 0.55rem; transition: border-color 0.3s, box-shadow 0.3s; }
.search input::placeholder { color: var(--dim); opacity: 1; }
.search input:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ember) 22%, transparent); }
.search kbd { position: absolute; right: 0.6rem; top: 0.62rem; padding: 0.15rem 0.45rem; font: 0.7rem/1.3 var(--mono); color: var(--dim); border: 1px solid var(--line); border-radius: 0.3rem; pointer-events: none; }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
@media (hover: none) { .search kbd { display: none; } }
.results { list-style: none; margin: 0.7rem 0 0; padding: 0; }
.results a { display: block; padding: 0.5rem 0.8rem; font-size: 0.9rem; line-height: 1.35; color: var(--light); text-decoration: none; border-radius: 0.4rem; }
.results a small { display: block; font-size: 0.74rem; color: var(--dim); }
.results a:hover, .results a.pick { background: color-mix(in srgb, var(--ember) 13%, transparent); box-shadow: inset 2px 0 var(--ember); color: var(--light); }
.results mark { background: none; color: var(--ember); }
.results .none { padding: 0.5rem 0.6rem; font-size: 0.88rem; color: var(--dim); }
.searching .rail-nav { display: none; }

.article { display: grid; grid-template-columns: minmax(0, 43rem) 13.5rem; justify-content: space-between; column-gap: clamp(2rem, 4vw, 4rem); padding: clamp(2.5rem, 6vw, 4.5rem) 0 5rem; min-width: 0; }
.article > * { grid-column: 1; min-width: 0; }
.article > .toc { grid-column: 2; grid-row: 1 / span 3; }
.crumb { margin: 0 0 1.4rem; font: 500 0.7rem/1.3 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.crumb a { color: var(--dim); text-decoration: none; }
.crumb a:hover { color: var(--light); }
.crumb b { font-weight: 500; color: var(--ember); }
.article h1 { font-size: clamp(2.5rem, 5vw, 4.3rem); line-height: 1.02; letter-spacing: -0.025em; }
.article .lede { margin: 1.4rem 0 0; color: var(--dim); }
.article .lede::first-letter { text-transform: uppercase; }
.article header { padding-bottom: 2.4rem; margin-bottom: 0.4rem; border-bottom: 1px solid var(--line-soft); animation: arrive 1.1s var(--ease) both; }
html:not(.js) .article header { animation: none; }

.prose h2 { font-size: clamp(1.75rem, 2.6vw, 2.2rem); line-height: 1.12; letter-spacing: -0.018em; margin: 3.4rem 0 1.1rem; padding-top: 0.2rem; }
.prose h3 { font-size: 1.4rem; line-height: 1.25; margin: 2.5rem 0 0.9rem; }
.prose h4 { font: 600 1.02rem/1.4 var(--sans); margin: 2rem 0 0.7rem; }
.prose > :first-child { margin-top: 2.2rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--ember); }
.prose li > ul, .prose li > ol { margin: 0.5rem 0 0; }
.prose pre { margin: 1.6rem 0 1.8rem; }
.prose pre > code { max-height: 38rem; }
.anchor { margin-left: 0.4em; font: 400 0.7em/1 var(--sans); color: var(--ember); text-decoration: none; opacity: 0; transition: opacity 0.3s; }
:is(h2, h3, h4):hover > .anchor, .anchor:focus-visible { opacity: 1; }
@media (hover: none) { .anchor { opacity: 0.55; } }

.toc { position: sticky; top: calc(var(--bar) + 2.5rem); align-self: start; max-height: calc(100vh - var(--bar) - 4rem); overflow-y: auto; scrollbar-width: none; }
.toc h2 { margin: 0 0 0.8rem; font: 500 0.66rem/1.3 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; margin-left: -1px; padding: 0.3rem 0 0.3rem 1rem; font-size: 0.82rem; line-height: 1.4; color: var(--dim); text-decoration: none; border-left: 1px solid transparent; transition: color 0.3s, border-color 0.3s; }
.toc .sub a { padding-left: 1.9rem; }
.toc a:hover { color: var(--light); }
.toc a[aria-current] { color: var(--light); border-left-color: var(--ember); }

.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; margin-top: 4.5rem; }
.pager a { display: block; padding: 1.1rem 1.3rem 1.2rem; text-decoration: none; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--card); transition: border-color 0.3s, background 0.3s, transform 0.5s var(--ease); }
.pager a:hover { border-color: color-mix(in srgb, var(--ember) 70%, transparent); background: color-mix(in srgb, var(--ember) 6%, var(--floor)); transform: translateY(-2px); }
.pager small { display: block; margin-bottom: 0.35rem; font: 500 0.66rem/1.3 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.pager b { font: 400 1.3rem/1.2 var(--serif); color: var(--light); }
.pager .next { grid-column: 2; text-align: right; }

.drawer-open { display: none; }
.scrim { display: none; }

/* The map of the guides. */
.docs-hero { padding: calc(var(--bar) + clamp(3.5rem, 10vh, 7rem)) var(--edge) 0; max-width: 78rem; margin: 0 auto; }
.docs-hero h1 { font-size: clamp(2.7rem, 5.6vw, 5.4rem); line-height: 1; letter-spacing: -0.025em; max-width: 14ch; }
.docs-hero .kicker { margin-bottom: 1.7rem; color: var(--ember); }
.docs-hero .search { max-width: 34rem; margin-top: 2.4rem; }
.docs-hero .search input { padding: 1rem 3rem 1rem 1.2rem; font-size: 1rem; border-radius: 0.7rem; background: var(--card); }
.docs-hero .search kbd { top: 0.95rem; right: 0.9rem; }
.docs-hero .results { max-width: 34rem; }
.docs-hero .results:not(:empty) { padding: 0.5rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--card); }
.docs-hero .results a { margin: 0; }
.map { max-width: 78rem; margin: 0 auto; padding: clamp(3rem, 7vw, 5rem) var(--edge) 2rem; }
.group { display: grid; grid-template-columns: 13rem minmax(0, 1fr); column-gap: clamp(1.5rem, 4vw, 4rem); padding: 2.6rem 0; border-top: 1px solid var(--line-soft); }
.group header .no { display: block; font: 400 3.4rem/0.9 var(--serif); letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--light) 45%, transparent); }
.group h2 { margin-top: 0.9rem; font-size: 1.7rem; line-height: 1.15; letter-spacing: -0.015em; }
.group header p { margin: 0.5rem 0 0; font-size: 0.88rem; line-height: 1.5; color: var(--dim); }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 0.7rem; }
.tiles li { margin: 0; }
.group.first .tiles li:first-child .tile { border-top-color: color-mix(in srgb, var(--ember) 60%, transparent); }
.map-more { max-width: 78rem; margin: 0 auto; padding: 0 var(--edge) 5rem; }
.map-more .prose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.map-more section { padding: 1.5rem 1.6rem 0.4rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--card); }
.map-more h2 { margin: 0 0 0.8rem; font-size: 1.5rem; }
.map-more .prose > :first-child { margin-top: 0; }
.map-more p { font-size: 0.95rem; }

@media (max-width: 75rem) {
  .article { grid-template-columns: minmax(0, 43rem); justify-content: start; }
  .article > .toc { grid-column: 1; grid-row: auto; position: static; max-height: none; margin-top: 1.8rem; padding: 1.1rem 1.3rem 1.2rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--card); }
  .toc .sub { display: none; }
}
@media (max-width: 62.5rem) {
  .shell { display: flex; flex-direction: column; }
  .article { order: 1; padding-top: 1.6rem; }
  /* Without JavaScript the list of guides follows the text. With it, it is a drawer. */
  .rail { order: 2; position: static; height: auto; padding: 2rem 0 3rem 0.8rem; border-right: 0; border-top: 1px solid var(--line-soft); }
  .js .rail { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: min(21rem, 88vw); height: auto; padding: 1.4rem 1.4rem 3rem; background: var(--floor); border: 0; border-right: 1px solid var(--line); visibility: hidden; transform: translateX(-102%); transition: transform 0.5s var(--ease), visibility 0s 0.5s; }
  .js.drawer .rail { visibility: visible; transform: none; transition: transform 0.5s var(--ease); box-shadow: 0 0 6rem var(--dark); }
  .js .scrim { display: block; position: fixed; inset: 0; z-index: 29; background: color-mix(in srgb, var(--dark) 72%, transparent); opacity: 0; visibility: hidden; transition: opacity 0.5s, visibility 0s 0.5s; }
  .js.drawer .scrim { opacity: 1; visibility: visible; transition: opacity 0.5s; }
  .js .drawer-open { display: flex; align-items: center; gap: 0.7rem; position: sticky; top: var(--bar); z-index: 10; margin: 0 calc(-1 * var(--edge)); padding: 0.85rem var(--edge); width: calc(100% + 2 * var(--edge)); font: 500 0.8rem/1.3 var(--sans); color: var(--light); text-align: left; background: color-mix(in srgb, var(--dark) 86%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
  .drawer-open::before { content: ""; width: 1rem; height: 0.6rem; border-top: 1px solid var(--light); border-bottom: 1px solid var(--light); }
  .drawer-open span { color: var(--dim); }
  .drawer-open:focus-visible { outline-offset: -3px; }
  .js .rail-close { display: block; margin: 0 0 1.2rem auto; padding: 0.45rem 0.9rem; font: 500 0.7rem/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); background: none; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
  .rail li a { padding: 0.55rem 0.8rem; font-size: 0.95rem; }
  .group { grid-template-columns: minmax(0, 1fr); row-gap: 1.4rem; }
  .group header { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: end; }
  .group header p { grid-column: 1 / -1; }
  .group h2 { margin: 0 0 0.2rem; }
  .map-more .prose { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 45rem) {
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
  .prose pre { font-size: 0.76rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .chapter:not(.on) .scene, .js .chapter:not(.on) h2 { opacity: 1; filter: none; transform: none; }
}
