/* /dissertation: the cover, the scroll-told opening, and the contents. Paper, pencil and one blue. */

.opening {
  --paper: #fffff0;
  --sheet: #fffdf6;
  --ink: #1b1b20;
  --ink-2: #4a4a55;
  --ink-3: #8a8a93;
  --rule: rgba(20, 20, 30, 0.1);
  --accent: #1f3fd0;
  --warm: #b4461f;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.3  0 0 0 0 0.2  0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color: var(--ink);
  background: var(--grain);
}
.dark .opening {
  --paper: #1f2022;
  --sheet: #25262a;
  --ink: #ecedf1;
  --ink-2: #b2b3bc;
  --ink-3: #7c7d86;
  --rule: rgba(255, 255, 255, 0.12);
  --accent: #8fb0ff;
  --warm: #ee8a5e;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.opening a { color: inherit; }

/* ---------------------------------------------------------------- the cover */
.cover { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.cover .shocks { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ink); }
.cover .shocks path { fill: none; stroke: currentColor; stroke-linecap: round; }
.cover .shocks path.accent { stroke: var(--accent); }
.cover-text { position: relative; z-index: 1; width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding-top: 3rem; }
.cover .eyebrow { font: 0.74rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 1.2rem; }
.cover .big { font-family: Newsreader, "Iowan Old Style", Georgia, serif; font-weight: 400; font-size: clamp(3.4rem, 11vw, 9.5rem);
  line-height: 0.92; letter-spacing: -0.035em; margin: 0 0 1.8rem; max-width: 11ch; }
.cover .big span { display: inline-block; opacity: 0; transform: translateY(0.35em) rotate(var(--r, 0deg)); transition: opacity 0.9s ease, transform 1.1s cubic-bezier(.2,.7,.2,1); }
.cover.in .big span { opacity: 1; transform: none; }
.cover .big span:nth-child(1) { --r: -4deg; transition-delay: 0.05s; }
.cover .big span:nth-child(2) { --r: 3deg; transition-delay: 0.3s; }
.cover .big span:nth-child(3) { --r: -2deg; transition-delay: 0.55s; }
.cover .big span:nth-child(4) { --r: 5deg; transition-delay: 0.85s; }
.cover .title { font-family: Newsreader, Georgia, serif; font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.3; max-width: 30ch; margin: 0 0 0.35rem;
  opacity: 0; transition: opacity 0.5s 0.1s; }   /* title, byline and buttons arrive at once; the big words keep their entrance */
.cover .by { font: 0.95rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); margin: 0 0 1.8rem; opacity: 0; transition: opacity 0.5s 0.15s; }
.cover .cta { display: flex; flex-wrap: wrap; gap: 10px; opacity: 0; transition: opacity 0.5s 0.2s; }
.cover.in .title, .cover.in .by, .cover.in .cta { opacity: 1; }
.cover .cta a { font: 600 0.9rem ui-sans-serif, system-ui, sans-serif; padding: 0.6rem 1.05rem; border-radius: 999px; border: 1px solid var(--rule);
  text-decoration: none; background: color-mix(in srgb, var(--sheet) 80%, transparent); backdrop-filter: blur(4px); }
.cover .cta a:hover { border-color: var(--accent); color: var(--accent); }
.cover .cta a.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.dark .cover .cta a.primary { color: #10131f; }
.cover .scrollhint { position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%); font: 0.72rem ui-monospace, Menlo, monospace;
  letter-spacing: 0.2em; color: var(--ink-3); margin: 0; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translate(-50%, 0); opacity: 0.5; } 50% { transform: translate(-50%, 6px); opacity: 1; } }

/* ---------------------------------------------------------------- the story: text on the left, a drawing that stays */
.story { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(1100px, calc(100% - 40px)); margin: 0 auto; }
.stage { grid-column: 2; grid-row: 1; position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; justify-content: center; }
.stage > svg { width: min(100%, 78vh); height: auto; overflow: visible; }
.steps { grid-column: 1; grid-row: 1; padding: 30vh 0 40vh; }
.step { min-height: 88vh; display: flex; flex-direction: column; justify-content: center; max-width: 30rem; opacity: 0.22; transition: opacity 0.5s; }
.step.on { opacity: 1; }
.step p { font-family: Newsreader, Georgia, serif; font-size: clamp(1.45rem, 2.6vw, 2.05rem); line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 0.8rem; }
.step p.small { font-size: clamp(1.05rem, 1.7vw, 1.25rem); color: var(--ink-2); }
.step p.src { font: 0.8rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-3); letter-spacing: 0.02em; }
.step em { font-style: italic; color: var(--accent); }

/* the drawing's inks */
:is(#stage, #stage2) { color: var(--ink); font-family: Newsreader, Georgia, serif; }
:is(#stage, #stage2) .pencil { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
:is(#stage, #stage2) .soft { opacity: 0.35; }
:is(#stage, #stage2) .accent { stroke: var(--accent); }
:is(#stage, #stage2) .warm { stroke: var(--warm); }
:is(#stage, #stage2) .fillacc { fill: var(--accent); }
:is(#stage, #stage2) .fillink { fill: var(--ink-2); }
:is(#stage, #stage2) .fillwarm { fill: var(--warm); }
:is(#stage, #stage2) text { fill: currentColor; font-size: 17px; }
:is(#stage, #stage2) text.label { font-size: 15px; }
:is(#stage, #stage2) text.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; letter-spacing: 0.08em; fill: var(--ink-3); }
:is(#stage, #stage2) text.quote { font-family: Newsreader, Georgia, serif; font-style: italic; font-size: 14px; fill: var(--ink-2); }
:is(#stage, #stage2) text.src { font: 11px ui-sans-serif, system-ui, sans-serif; fill: var(--ink-3); }
:is(#stage, #stage2) text.acc { fill: var(--accent); }
:is(#stage, #stage2) text.warmt { fill: var(--warm); }
:is(#stage, #stage2) text.halo { paint-order: stroke; stroke: var(--paper); stroke-width: 6px; stroke-linejoin: round; }
:is(#stage, #stage2) .box { fill: var(--sheet); }
:is(#stage, #stage2) .headfill { fill: var(--sheet); }
:is(#stage, #stage2) .sunmid { fill: #f6b53d; }
:is(#stage, #stage2) .suncore { fill: #fff6d8; }

/* ---------------------------------------------------------------- contents */
.contents { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 6rem 0 2rem; }
.contents h2 { font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.02em; margin: 0 0 0.8rem; }
.contents .lede { font-size: 1.08rem; color: var(--ink-2); max-width: 40rem; margin: 0 0 2.4rem; }
.contents .lede a { color: var(--accent); text-decoration: none; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card a { position: relative; display: flex; flex-direction: column; gap: 0.35rem; height: 100%; padding: 1.2rem 1.25rem 1.3rem;
  background: var(--sheet) var(--grain); border: 1px solid var(--rule); border-radius: 4px; text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 10px 26px -18px rgba(40, 30, 10, 0.3); transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; }
.card a:hover { transform: translateY(-3px) rotate(-0.25deg); border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 16px 34px -18px rgba(31, 63, 208, 0.35); }
.card .num { position: absolute; right: 1rem; top: 0.4rem; font-family: Newsreader, Georgia, serif; font-size: 3.4rem; line-height: 1; color: var(--rule); }
.card.chapter .num { color: color-mix(in srgb, var(--accent) 22%, transparent); }
.card .what { font: 600 0.7rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.card .t { font-family: Newsreader, Georgia, serif; font-size: 1.28rem; line-height: 1.22; padding-right: 2.2rem; }
.card .d { font-size: 0.9rem; line-height: 1.5; color: var(--ink-2); }
.cite { margin-top: 2.2rem; font: 0.9rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); }
.cite summary { cursor: pointer; }
.cite p { margin: 0.7rem 0 0; line-height: 1.5; }
.cite .cite-copy { margin-top: 0.8rem; font: inherit; font-size: 0.82rem; padding: 4px 11px; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); color: var(--ink); cursor: pointer; }
.cite .cite-copy:hover { border-color: var(--accent); }
.cite pre { background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; padding: 0.9rem 1rem; overflow-x: auto; font-size: 0.8rem; margin-top: 0.8rem; }

/* ---------------------------------------------------------------- phones: the drawing on top, the text scrolls under it */
@media (max-width: 820px) {
  .story { grid-template-columns: 1fr; width: 100%; }
  .stage { grid-column: 1; height: 52vh; height: 52svh; top: 3.5rem; z-index: 1; background: linear-gradient(var(--paper) 88%, transparent); }
  .dark .stage { background: linear-gradient(#1f2022 88%, transparent); }
  .stage > svg { width: min(92vw, 46vh); }
  .steps { grid-column: 1; grid-row: 1; padding: 58vh 20px 30vh; position: relative; z-index: 2; pointer-events: none; }
  .step { min-height: 70vh; justify-content: flex-end; padding-bottom: calc(6vh + 3rem); }
  .step p { font-size: 1.3rem; background: color-mix(in srgb, var(--paper) 92%, transparent); padding: 0.4rem 0.2rem; border-radius: 4px; }
  .step p.small { font-size: 1.02rem; }
}
/* the dissertation's own story pages (home, idea, wedge, afterword) put the text below the drawing instead: it passes
   under the drawing, never over it, and a step's text goes out at once as the next fades in. :where() keeps these at
   the specificity of the rules above, so the foldable layouts of css/fold.css still win. */
@media (max-width: 820px) {
  :where(#opening, #paper, #wedgepage, .idea:not([id])) .stage { height: calc(3.5rem + 44vh); height: calc(3.5rem + 44svh); top: 0; padding-top: 3.5rem;
    box-sizing: border-box; z-index: 3; background: linear-gradient(var(--paper) 94%, transparent); }
  .dark :where(#opening, #paper, #wedgepage, .idea:not([id])) .stage { background: linear-gradient(#1f2022 94%, transparent); }
  :where(#opening, #paper, #wedgepage, .idea:not([id])) .stage > svg { width: min(92vw, 42vh); width: min(92vw, 42svh); }
  :where(#opening, #paper, #wedgepage, .idea:not([id])) .steps { z-index: 1; }
  /* each step is as tall as the room under the drawing, its text centred there, where readLine() picks the active one */
  :where(#opening, #paper, #wedgepage, .idea:not([id])) .step { min-height: calc(56vh - 3.5rem); min-height: calc(56svh - 3.5rem); justify-content: center;
    padding: 2vh 0; opacity: 0; transition: none; }
  :where(#opening, #paper, #wedgepage, .idea:not([id])) .step.on { opacity: 1; transition: opacity 0.35s; }
}
@media (max-width: 820px) and (max-height: 700px) {   /* css/fold.css shrinks the stage on short screens; keep room for the header */
  html:not(.fold-book):not(.fold-table) main:where(#opening, #paper, #wedgepage, .idea:not([id])) .story .stage { height: calc(3.5rem + 42vh); height: calc(3.5rem + 42svh); }
}
@media (prefers-reduced-motion: reduce) {
  .cover .big span, .cover .title, .cover .by, .cover .cta { transition: none; opacity: 1; transform: none; }
  .cover .scrollhint { animation: none; }
}

/* ---------------------------------------------------------------- a chapter told as a story (the afterword) */
.told { padding-top: 5.5rem; }
.told .toldhead, .told .toldfoot { width: min(1100px, calc(100% - 40px)); margin: 0 auto; }
.told .kicker { font: 0.72rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.told .kicker a { text-decoration: none; }
.told .story { display: grid; }
.told .toldbody { grid-column: 1; grid-row: 1; font-family: Newsreader, Georgia, serif; }
/* the fragment is <section><h1/><div.steps/>footnotes</section>; the section is laid out as the story's left column */
.told .toldbody section { padding: 0; margin: 0; }
.told .toldbody h1 { font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: clamp(3rem, 8vw, 6rem); letter-spacing: -0.03em; line-height: 1; margin: 3rem 0 0; }
.told .toldbody .steps { padding: 18vh 0 20vh; }
.told .step p { font-size: clamp(1.2rem, 1.75vw, 1.45rem); line-height: 1.5; letter-spacing: 0; }
.told .step a { color: var(--accent); text-decoration: none; font-size: 0.85em; }
.told .step .footnote-ref { vertical-align: super; font-size: 0.6em; }
.told aside.footnotes { font: 0.9rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); max-width: 30rem; }
.told aside.footnotes hr { width: 5rem; border: 0; border-top: 1px solid var(--rule); margin: 0 0 0.8rem; }
.told aside.footnotes a { color: var(--accent); text-decoration: none; }
.told .pager { margin: 4rem 0 0; }
@media (max-width: 820px) {
  .told .stage { height: calc(3.5rem + 38vh); height: calc(3.5rem + 38svh); }   /* long paragraphs: more room below */
  .told .stage > svg { width: min(92vw, 36vh); width: min(92vw, 36svh); }
  .told .step { min-height: calc(62vh - 3.5rem); min-height: calc(62svh - 3.5rem); }
  .told .toldbody { position: relative; padding: 0 20px; }
  .told .toldbody h1 { position: relative; z-index: 4; }
  .told .toldbody .steps { padding: 58vh 0 20vh; }
  .told .step p { font-size: 1.12rem; }
}

/* ---------------------------------------------------------------- /dissertation/idea */
.idea .ideahead { width: min(1100px, calc(100% - 40px)); margin: 0 auto; padding: 8rem 0 0; }
.idea .ideahead .eyebrow { font: 0.74rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 1rem; }
.idea .ideahead .eyebrow a { text-decoration: none; }
.idea .ideahead h1 { font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: clamp(2.6rem, 6.5vw, 5.2rem); line-height: 1; letter-spacing: -0.03em;
  max-width: 14ch; margin: 0 0 1.4rem; }
.idea .ideahead .lede { font-family: Newsreader, Georgia, serif; font-size: 1.3rem; line-height: 1.5; color: var(--ink-2); max-width: 36rem; margin: 0; }
.idea .fx { margin: 0.4rem 0 1rem; color: var(--ink); }
.idea .fx svg { display: block; max-width: 100%; height: auto; width: 23rem; }
.idea .step a { color: var(--accent); text-decoration: none; }
.idea .ideafoot { width: min(1100px, calc(100% - 40px)); margin: 0 auto; padding: 2rem 0 3rem; max-width: 44rem; }
.idea .ideafoot > p:first-child { font-family: Newsreader, Georgia, serif; font-size: 1.3rem; line-height: 1.5; }
.idea .ideafoot a { color: var(--accent); text-decoration: none; }
.idea .ideafoot .cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.4rem 0 2rem; }
.idea .ideafoot .cta a { font: 600 0.9rem ui-sans-serif, system-ui, sans-serif; padding: 0.6rem 1.05rem; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink); }
.idea .ideafoot .cta a.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.dark .idea .ideafoot .cta a.primary { color: #10131f; }
.idea .ideafoot .note { font: 0.84rem/1.55 ui-sans-serif, system-ui, sans-serif; color: var(--ink-3); }
.idea .progress { background: var(--accent); }
@media (max-width: 820px) {
  .idea .ideahead { padding-top: 6rem; }
  .idea .fx { background: color-mix(in srgb, var(--paper) 92%, transparent); padding: 0.3rem; border-radius: 4px; }
  .idea .fx svg { width: 100%; }
}
.idea ~ .progress, .progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: #1f3fd0; z-index: 60; }
.dark .progress { background: #8fb0ff; }
.idea .solvestate { display: block; margin-top: 0.8rem; font: 0.82rem ui-monospace, Menlo, monospace; color: var(--ink-3); }
.idea .solvestate.ok { color: var(--accent); }

/* ---------------------------------------------------------------- the detour map (detour.js) */
.detour { position: relative; }
.detour.js { height: 720vh; }
.dt-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center;
  width: min(1180px, calc(100% - 24px)); margin: 0 auto; padding: 3.2rem 0 3.6rem; box-sizing: border-box; }
.dt-map { width: 100%; flex: 1 1 0; min-height: 0; color: var(--ink); font-family: Newsreader, Georgia, serif; overflow: visible; }
.dt-caps { position: relative; flex: 0 0 auto; display: grid; max-width: 40rem; margin: 0 auto; width: 100%; }
.dt-cap { font-family: Newsreader, Georgia, serif; font-size: clamp(1.25rem, 2.3vw, 1.75rem); line-height: 1.3; letter-spacing: -0.01em;
  margin: 0; text-align: center; }
.detour.js .dt-cap { grid-area: 1 / 1; opacity: 0; transform: translateY(6px); transition: opacity 0.5s, transform 0.5s; }
.detour.js .dt-cap.on { opacity: 1; transform: none; }
.dt-map .pn { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.dt-map .soft { opacity: 0.35; }
.dt-map .soft2 { opacity: 0.4; }
.dt-map .dash { stroke-dasharray: 3 5 !important; }
.dt-map .hatch { color: var(--ink-3); opacity: 0; }
.dt-map .road { color: var(--ink-2); }
.dt-map .acc { stroke: var(--accent); }
.dt-map .dot { fill: var(--warm); }
.dt-map text { fill: var(--ink-2); }
.dt-map .lab { font: 12.5px ui-sans-serif, system-ui, sans-serif; fill: var(--ink-3); }
.dt-map .lab .who { font: 15px Newsreader, Georgia, serif; fill: var(--ink); }
.dt-map .accl, .dt-map .accl .who { fill: var(--accent); }
.dt-map .bandname { font-size: 19px; font-style: italic; fill: var(--ink); }
.dt-map .mono { font: 11px ui-monospace, Menlo, monospace; letter-spacing: 0.2em; fill: var(--ink-3); }
.dt-map .halo { paint-order: stroke; stroke: var(--paper); stroke-width: 7px; stroke-linejoin: round; }
@media (max-width: 760px) {
  .dt-sticky { width: 100%; padding: 3.6rem 12px 3.4rem; }
  .dt-caps { padding: 0 8px; }
  .dt-cap { font-size: 1.02rem; line-height: 1.35; }
  .dt-map .lab { font-size: 11px; } .dt-map .lab .who { font-size: 15px; }
}

/* the bookmark ribbon (bookmark.js): hangs on the chapter where the reader stopped */
.cards a.ribbon { position: relative; }
.cards a.ribbon::after { content: ""; position: absolute; top: -1px; left: 14px; width: 11px; height: 26px;
  background: #b8322a; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%); pointer-events: none; }

/* ---------------------------------------------------------------- /dissertation/spike */
.spike .lives { width: min(1100px, calc(100% - 32px)); margin: 3rem auto 0; }
.spike .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; position: sticky; top: 3.5rem; z-index: 2; padding: 0.7rem 0;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule);
  font: 0.85rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); }
.spike .controls button { font: 600 0.85rem ui-sans-serif, system-ui, sans-serif; padding: 0.45rem 0.95rem; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--sheet); color: var(--ink); cursor: pointer; }
.spike .modes { display: inline-flex; gap: 6px; }
.spike .modes button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.spike .hint { color: var(--ink-3); flex: 1 1 18rem; }
.spike .one { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; flex: 1 1 30rem; }
.spike .one[hidden], .spike .hint[hidden] { display: none; }
.spike .scrub { display: flex; align-items: center; gap: 10px; }
.spike .scrub input { flex: 1; min-width: 6rem; accent-color: var(--accent); }
.spike .scrub.age { flex: 3 1 16rem; color: var(--ink); font-weight: 600; }
.spike .scrub.when { flex: 2 1 12rem; }
.spike .scrub small { color: var(--ink-3); font-weight: 400; }
.spike .clock { font-variant-numeric: tabular-nums; min-width: 2.6em; }
.spike .howto { font: 0.8rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-3); margin: 0.6rem 0 0; }
.spike .strip { display: grid; grid-template-columns: minmax(0, 19rem) minmax(0, 1fr); gap: 10px 32px; padding: 1.6rem 0; border-bottom: 1px solid var(--rule); }
.spike .strip h2 { font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: 1.55rem; line-height: 1.1; margin: 0 0 0.45rem; }
.spike .strip h2 small { display: block; font: 0.7rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.35rem; }
.spike .strip p { font-family: Newsreader, Georgia, serif; font-size: 1.05rem; line-height: 1.45; color: var(--ink-2); margin: 0; }
.spike .strip p.model { font: 0.8rem/1.5 ui-sans-serif, system-ui, sans-serif; color: var(--ink-3); margin-top: 0.7rem; }
.spike .strip p.model b { font-weight: 600; color: var(--ink-2); }
.spike .plot { min-width: 0; cursor: ew-resize; touch-action: pan-y; user-select: none; }
.spike .plot svg { width: 100%; display: block; overflow: visible; font: 11px ui-sans-serif, system-ui, sans-serif; }
.spike .plot .axis { stroke: var(--rule); stroke-width: 1; }
.spike .plot .zero { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.6; }
.spike .plot .curve { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.spike .plot .curve.old { stroke-width: 1.5; }
.spike .plot .perm { fill: none; stroke-width: 1.6; stroke-dasharray: 6 4; opacity: 0.75; }
.spike .variants { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; font: 0.8rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); }
.spike .variants span { margin-right: 4px; }
.spike .variants button { font: 600 0.78rem ui-sans-serif, system-ui, sans-serif; padding: 0.25rem 0.7rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); cursor: pointer; }
.spike .variants button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.spike .plot .wall { fill: var(--ink); opacity: 0.06; }
.spike .plot .wall.old { opacity: 0.025; }
.spike .plot .wall.old { opacity: 0.025; }
.spike .plot .mark { stroke: var(--ink-3); stroke-dasharray: 2 3; opacity: 0.45; }
.spike .plot .mark.lit { stroke: var(--ink); opacity: 0.7; }
.spike .plot .mark.never { opacity: 0.25; }
.spike .plot .cursor { stroke: var(--ink); stroke-width: 1; opacity: 0.35; }
.spike .plot .ahead { fill: none; stroke-width: 1.3; opacity: 0.22; stroke-dasharray: 1 3; stroke-linecap: round; }
.spike .plot .dot { stroke: var(--paper); stroke-width: 1.5; }
.spike .plot .bolt { stroke: var(--warm); stroke-width: 3; stroke-linecap: round; }
.spike .plot text { fill: var(--ink-3); }
.spike .plot .walllab { fill: var(--ink-2); }
.spike .plot .marklab { fill: var(--ink-3); transition: fill 0.25s; }
.spike .plot .marklab.lit { fill: var(--ink); font-weight: 600; }
.spike .plot .marklab.never { text-decoration: line-through; opacity: 0.6; }
.spike .legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font: 0.8rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); }
.spike .legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.spike .legend b { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.spike .legend .when { flex-basis: 100%; color: var(--ink-3); }
.spike .legend em { font-style: normal; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.spike .legend .key { flex-basis: 100%; color: var(--ink-3); }
.spike .legend i.dash { background: none; border-top: 2px dashed var(--ink-3); height: 0; width: 16px; }
.spike .note { font: 0.85rem/1.5 ui-sans-serif, system-ui, sans-serif; color: var(--ink-3); max-width: 44rem; margin: 1.4rem 0 0; }
.spike .note a { color: var(--accent); }
@media (max-width: 720px) { .spike .strip { grid-template-columns: 1fr; } .spike .strip h2 { font-size: 1.35rem; } .spike .scrub.age, .spike .scrub.when { flex-basis: 100%; } }

.spike .lemma { width: min(1100px, calc(100% - 32px)); margin: 3.5rem auto 0; }
.spike .lemma h2 { font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: clamp(1.7rem, 3.4vw, 2.3rem); line-height: 1.1; margin: 0 0 0.6rem; }
.spike .lemma .lede2 { font-family: Newsreader, Georgia, serif; font-size: 1.12rem; line-height: 1.5; color: var(--ink-2); max-width: 40rem; margin: 0 0 1.4rem; }
.spike .lemma-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.spike .lemma .build { margin: 0 0 2.2rem; }
.spike .lemma .bowls { max-width: 720px; }
.spike .build-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 10px; font: 0.85rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); }
.spike .build-controls .scrub { flex: 1 1 16rem; }
.spike .build-controls button { font: 600 0.85rem ui-sans-serif, system-ui, sans-serif; padding: 0.4rem 0.9rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); cursor: pointer; }
.spike .build-controls .modes button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.spike .lemma .target { fill: none; stroke-width: 2; stroke-dasharray: 5 4; }
.spike .lemma .sum { fill: none; stroke-width: 2.6; stroke-linecap: round; }
.spike .lemma .piece { fill: none; stroke-width: 1; opacity: 0.35; }
.spike .lemma figure { margin: 0; min-width: 0; }
.spike .lemma svg { width: 100%; display: block; overflow: visible; font: 11px ui-sans-serif, system-ui, sans-serif; }
.spike .lemma svg text { fill: var(--ink-3); }
.spike .lemma .axis { stroke: var(--rule); }
.spike .lemma .zero { stroke: var(--ink-3); stroke-dasharray: 2 3; opacity: 0.6; }
.spike .lemma .curve { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.spike .lemma .tangent { stroke-width: 1.2; stroke-dasharray: 4 3; }
.spike .lemma .comb { stroke: var(--warm); stroke-width: 2; stroke-linecap: round; }
.spike .lemma .dot { stroke: var(--paper); stroke-width: 1.5; }
.spike .lemma figcaption { font: 0.85rem/1.5 ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); margin-top: 0.6rem; }
.spike .lemma-scrub { margin-top: 6px; font: 0.8rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); }
@media (max-width: 720px) { .spike .lemma-grid { grid-template-columns: 1fr; } }
.spike .lemma h3 { font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: 1.45rem; margin: 2rem 0 0.5rem; }

/* ---------------------------------------------------------------- /noisestate/risk */
.risk .rsec { width: min(1100px, calc(100% - 32px)); margin: 3rem auto 0; }
.risk .rsec h2 { font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: clamp(1.7rem, 3.4vw, 2.3rem); line-height: 1.1; margin: 0 0 0.6rem; }
.risk .lede2 { font-family: Newsreader, Georgia, serif; font-size: 1.12rem; line-height: 1.5; color: var(--ink-2); max-width: 42rem; margin: 0 0 1rem; }
.risk .rcontrols { position: sticky; top: 3.5rem; z-index: 2; padding: 0.6rem 0; margin-bottom: 0.8rem; background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); font: 0.9rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); }
.risk .scrub { display: flex; align-items: center; gap: 12px; max-width: 40rem; }
.risk .scrub input { flex: 1; accent-color: var(--accent); }
.risk .clock { font-variant-numeric: tabular-nums; min-width: 9em; }
.risk .rgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 28px; }
.risk .rgrid .wide { grid-column: 1 / -1; }
.risk figure { margin: 0; min-width: 0; }
.risk svg { width: 100%; display: block; overflow: visible; font: 11px ui-sans-serif, system-ui, sans-serif; }
.risk svg text { fill: var(--ink-3); }
.risk .axis { stroke: var(--rule); }
.risk .zero { stroke: var(--ink-3); stroke-dasharray: 2 3; opacity: 0.6; }
.risk .bar0 { fill: var(--ink-3); opacity: 0.45; }
.risk .bar1 { fill: var(--accent); opacity: 0.55; }
.risk .curve { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.risk .mark { stroke-width: 2; }
.risk .dot { stroke: var(--paper); stroke-width: 1.5; }
.risk .legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font: 0.8rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); }
.risk .legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.risk .legend b { font-variant-numeric: tabular-nums; color: var(--ink); }
.risk figcaption { font: 0.85rem/1.5 ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); margin-top: 0.5rem; }
.risk .rnote { font: 0.85rem/1.5 ui-sans-serif, system-ui, sans-serif; color: var(--ink-3); max-width: 44rem; margin: 1.2rem 0 0; }
.risk .rnote code { font-size: 0.8rem; }
@media (max-width: 720px) { .risk .rgrid { grid-template-columns: 1fr; } }
.risk .rcontrols { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.risk .rcontrols .scrub { flex: 1 1 18rem; }
.risk .toyfig svg { max-width: 560px; margin: 0 auto; }
.risk .nw { white-space: nowrap; }
.risk .legend i.dash { background: none; border-top: 2px dashed; height: 0; width: 16px; border-radius: 0; }
.spike .loadfail, .risk .loadfail { font: 0.9rem ui-sans-serif, system-ui, sans-serif; color: var(--warm); margin: 0.4rem 0; }
.risk .scrub { flex-wrap: wrap; min-width: 0; } .risk .scrub input { min-width: 8rem; } .risk .rcontrols .scrub { min-width: 0; }
.spike .controls, .risk .rcontrols { -webkit-backdrop-filter: blur(6px); background: color-mix(in srgb, var(--paper) 96%, transparent); }

/* the abstract, shortened by cuts only, after the stories and before the contents (a cover button jumps to it) */
.opening .abstract { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 1rem 0 3rem; }
.opening .abstract h2 { font: 0.74rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 1rem; font-weight: 400; }
.opening .abstract p { font-family: Newsreader, Georgia, serif; font-size: 1.15rem; line-height: 1.55; color: var(--ink-2); max-width: 40rem; margin: 0 0 0.9rem; }
.opening .abstract { scroll-margin-top: 4rem; padding-top: 3rem; }
.spike .jumplab { font: 600 0.72rem ui-sans-serif, system-ui, sans-serif; }
.spike .watchfig { margin: 1.4rem 0 0; max-width: 46rem; } .spike .watchfig svg { width: 100%; display: block; }
.opening .abstract .abs-full { font: 0.85rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-3); }
.risk .routes .route { display: flex; align-items: center; gap: 6px 10px; margin: 0 0 18px; flex-wrap: nowrap; }
.risk .routes .rname { font: 600 0.85rem ui-sans-serif, system-ui, sans-serif; color: var(--ink); width: 8.5rem; flex: none; margin: 0; }
.risk .routes .rstep { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.risk .routes .rstep span { font: 0.78rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-3); }
.risk .routes .rarrow { font: 0.78rem ui-sans-serif, system-ui, sans-serif; color: var(--ink-2); text-align: center; flex: 1 1 6rem; max-width: 9rem; margin: 0; }
.risk .routes .rarrow::after { content: " \2192"; }
.risk .routes svg text { font-size: 10px; }
@media (max-width: 760px) {
  .risk .routes .route { flex-direction: column; }
  .risk .routes .rname { width: auto; }
  .risk .routes .rarrow { max-width: none; flex: none; }
  .risk .routes .rarrow::after { content: " \2193"; }
}
.risk .routes .rname small { display: block; font-weight: 400; color: var(--ink-3); font-size: 0.74rem; margin-top: 2px; }
.risk .legend i.dot { background: none; border-top: 3px dotted; height: 0; width: 16px; border-radius: 0; }
