/* rodna-1241: late-March snow on dark spruce, and parchment */
:root {
  --paper: #f4f1e8; --ink: #232b25; --card: #faf8f1; --line: #d6cfba;
  --muted: #55604f; --focus: #7a5b1e;
  --snow: #e8eef4; --frost: #b9c9d6; --spruce: #182420;
  --parchment: #f2e9d5; --parchment-ink: #2b2118;
  --tallow: #b98a2b; --tallow-ink: #6d5113;
  --blood: #8c2f1b; --ok: #2e6b34;
}
[data-theme="dark"] {
  --paper: #10140f; --ink: #e6e2d2; --card: #161c16; --line: #2c362c;
  --muted: #a9b39d; --focus: #e3b64f;
  --parchment: #241d12; --parchment-ink: #ecdfc2;
  --tallow: #e3b64f; --tallow-ink: #e3b64f;
  --blood: #d97a5e; --ok: #7cc184;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.125rem; line-height: 1.65;
}
h1, h2, h3, h4, .kicker, .figure-line {
  font-family: "Fraunces", Georgia, serif;
}
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); line-height: 1.15; font-weight: 700; }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); line-height: 1.25; font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
a { color: var(--tallow-ink); }
a.anchor { color: inherit; text-decoration: none; }
a.anchor:hover, a.anchor:focus-visible { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }
.block { padding: 2.5rem 0; }
.kicker { font-size: 0.95rem; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 0.5rem; }
.deck { font-size: 1.25rem; line-height: 1.5; }
.figure-line { font-size: 1.05rem; color: var(--tallow-ink); font-weight: 600; }
.lede { font-size: 1.2rem; }
/* topbar + rail */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1rem;
  padding: 0.5rem 1rem; background: var(--paper); border-bottom: 1px solid var(--line);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 0.95rem;
}
.topbar .home { font-weight: 700; text-decoration: none; color: var(--ink); }
.topnav { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.topnav a { text-decoration: none; color: var(--muted); white-space: nowrap; }
.topnav a:hover { color: var(--ink); }
.mobile-nav { display: none; position: relative; }
.mobile-nav summary { color: var(--ink); cursor: pointer; list-style: none; padding: .6rem .4rem; white-space: nowrap; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary::after { content: " ▾"; }
.mobile-nav[open] summary::after { content: " ▴"; }
.mobile-nav summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mobile-nav nav { position: absolute; top: calc(100% + .25rem); left: 0; width: max-content; max-width: calc(100vw - 1.2rem); padding: .35rem; display: grid; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.25); z-index: 60; }
.mobile-nav nav a { display: block; padding: .7rem .85rem; color: var(--ink); text-decoration: none; line-height: 1.25; white-space: nowrap; }
.mobile-nav nav a:hover { color: var(--focus); }
@media (max-width: 59.99rem) { .topnav { display: none; } .mobile-nav { display: block; }
  .topbar { gap: .5rem; padding: .5rem .75rem; }
  .topbar .home { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; } }
.spacer { flex: 1; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.7rem;
  text-decoration: none; color: var(--ink); font-weight: 600; min-height: 44px;
  display: inline-flex; align-items: center;
}
.icon-btn {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  width: 44px; height: 44px; cursor: pointer; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn svg circle { fill: none; stroke: currentColor; stroke-width: 2; }
[data-theme="dark"] .icon-btn svg circle { fill: currentColor; }
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: 3.2rem; z-index: 40;
  display: none; flex-direction: column; justify-content: center; gap: 0.4rem;
  padding-left: 0.6rem; font-family: system-ui, sans-serif; font-size: 0.72rem;
}
@media (min-width: 70rem) { .rail { display: flex; } }
.rail a { color: var(--muted); text-decoration: none; writing-mode: vertical-rl; transform: rotate(180deg); }
.rail a.on { color: var(--tallow-ink); font-weight: 700; }
.rail .drop { width: 8px; height: 8px; border-radius: 50%; background: var(--tallow); }
/* hero */
.hero-fig { margin: 1.5rem 0 0; }
.hero-fig img, .fig img { width: 100%; height: auto; display: block; border-radius: 6px; }
figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 0.5rem; font-family: system-ui, sans-serif; }
.fig { margin: 2rem 0; }
/* story: the march */
.story-grid { max-width: 76rem; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 60rem) {
  .story-grid { display: grid; grid-template-columns: minmax(20rem, 27rem) 1fr; gap: 2rem; align-items: start; }
  .steps { order: 1; } .stage { order: 2; position: sticky; top: 4rem; }
}
.stage {
  position: sticky; top: 3.2rem; z-index: 10; background: var(--spruce);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem;
}
#scene { width: 100%; height: 52vh; min-height: 300px; display: block; border-radius: 4px; touch-action: pan-y; }
@media (min-width: 60rem) { #scene { height: calc(100vh - 12rem); min-height: 420px; } }
#labels { position: absolute; inset: 0.5rem; overflow: hidden; pointer-events: none; }
#labels span {
  position: absolute; left: 0; top: 0; display: none; white-space: nowrap;
  font-family: system-ui, sans-serif; font-size: 0.82rem; font-weight: 600;
  color: #f2e9d5; text-shadow: 0 1px 3px rgba(0,0,0,0.85); padding: 0.1rem 0.35rem;
}
#labels span.dim { opacity: 0.55; font-weight: 400; }
#labels span.hot { color: var(--tallow); }
@media (max-width: 59.99rem) {
  .stage { max-height: 62vh; }
  #scene { height: 38vh; min-height: 240px; }
  #labels span { font-size: 0.95rem; }
}
.step { padding: 1.5rem 1rem; border-left: 3px solid var(--line); margin: 0 0 1rem; scroll-margin-top: 5rem; }
.step h3 { margin: 0 0 0.5rem; }
.step p { margin: 0; }
.skip {
  display: inline-block; margin: 0.4rem 0.2rem; font-family: system-ui, sans-serif;
  font-size: 0.95rem; min-height: 44px; line-height: 44px;
}
/* verdict panel */
.verdict-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  margin-top: 0.5rem; padding: 0.8rem 1rem; font-family: system-ui, sans-serif;
}
.verdict-panel h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.verdict-panel h3 .v-cap { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
.corr-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0; }
.corr-btns button {
  min-height: 48px; padding: 0 1rem; border-radius: 6px; cursor: pointer;
  border: 2px solid var(--line); background: var(--paper); color: var(--ink);
  font-family: system-ui, sans-serif; font-size: 1rem; font-weight: 600;
}
.corr-btns button.on { border-color: var(--tallow); }
.v-row { margin: 0.35rem 0; font-size: 0.98rem; }
.v-row strong::before {
  content: ""; display: inline-block; width: 0.7em; height: 0.7em; border-radius: 50%;
  background: var(--blood); margin-right: 0.45em; vertical-align: baseline;
}
.v-row.pass strong::before { background: var(--ok); }
.v-row span { color: var(--muted); }
.v-out { font-family: "Fraunces", serif; font-weight: 700; font-size: 1.15rem; color: var(--blood); margin: 0.5rem 0 0; }
.v-out.pass { color: var(--ok); }
.v-method { font-size: 0.9rem; margin: 0.3rem 0 0; }
.replay {
  min-height: 44px; padding: 0 1rem; border-radius: 6px; cursor: pointer;
  border: 2px solid var(--tallow); background: none; color: var(--tallow-ink);
  font-family: system-ui, sans-serif; font-size: 0.95rem; font-weight: 600; margin-top: 0.5rem;
}
/* day ruler */
.dayruler {
  display: flex; gap: 0.4rem; align-items: center; margin-top: 0.5rem;
  font-family: system-ui, sans-serif; font-size: 0.85rem; color: #b9beb0;
  list-style: none; padding: 0;
}
.dayruler li { display: flex; align-items: center; gap: 0.35rem; }
.dayruler li::before {
  content: ""; width: 0.7em; height: 0.7em; border-radius: 50%;
  border: 2px solid #8b9184; display: inline-block;
}
.dayruler li.done::before { background: var(--tallow); border-color: var(--tallow); }
.dayruler li.done { color: #f2e9d5; }
.stage > .skip { color: #e3b64f; }
/* static fallback (no WebGL / no JS) */
.stage-static { background: var(--card); border-radius: 4px; padding: 1rem; }
.stage-static svg.corridors { width: 100%; height: auto; display: block; }
.stage-static table { width: 100%; border-collapse: collapse; font-family: system-ui, sans-serif; font-size: 0.9rem; margin-top: 1rem; }
.stage-static th, .stage-static td { border-bottom: 1px solid var(--line); padding: 0.35rem 0.4rem; text-align: left; }
.stage-static td.num { text-align: right; font-variant-numeric: tabular-nums; }
.verdict-panel, .dayruler-wrap { display: none; }
.gl .verdict-panel, .gl .dayruler-wrap { display: block; }
.gl .stage-static.gui { display: none; }
.no-gl #scene, .no-gl #labels, .no-gl .verdict-panel, .no-gl .dayruler-wrap { display: none; }
.no-gl .stage-static.gui { display: block; }
/* quote cards */
.quotes { display: grid; gap: 1.2rem; margin: 1.5rem 0; }
.quote { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.quote .src { font-family: system-ui, sans-serif; font-size: 0.9rem; color: var(--muted); padding: 0.7rem 1rem 0; margin: 0; }
.quote blockquote {
  margin: 0.5rem 0 0; padding: 1rem 1.2rem; background: var(--parchment); color: var(--parchment-ink);
  font-style: italic; line-height: 1.6;
}
.quote .trans { padding: 0.8rem 1.2rem; margin: 0; }
.quote .shows { display: grid; gap: 0.3rem; padding: 0 1.2rem 1rem; margin: 0; font-size: 1rem; }
.quote .shows dt { font-family: system-ui, sans-serif; font-size: 0.85rem; color: var(--muted); }
.quote .shows dd { margin: 0 0 0.3rem; }
.credit { font-size: 0.95rem; color: var(--muted); font-family: system-ui, sans-serif; }
/* weekday ticks */
.weekdays { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.4rem; font-family: system-ui, sans-serif; }
.weekdays li { display: flex; gap: 0.6rem; align-items: baseline; }
.weekdays li::before {
  content: ""; width: 0.75em; height: 0.45em; flex: none;
  border-left: 3px solid var(--ok); border-bottom: 3px solid var(--ok);
  transform: rotate(-45deg) translateY(-0.1em);
}
/* defs, sources, ending, footer */
ul.defs { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.6rem; }
ul.defs li { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem 0.9rem; }
ul.sources { padding-left: 1.3rem; }
ul.sources li { margin-bottom: 0.7rem; font-size: 1rem; }
.ending { font-size: 1.25rem; border-top: 2px solid var(--tallow); padding-top: 1.2rem; margin-top: 2rem; }
.seealso { font-size: 1.05rem; }
footer.site { border-top: 1px solid var(--line); margin-top: 2rem; padding: 1.5rem 1.25rem 3rem; text-align: center; }
.share-block { padding-bottom: 0; }
@media (max-height: 740px) and (max-width: 59.99rem) {
  .stage { max-height: 56vh; } #scene { height: 32vh; min-height: 200px; }
  .verdict-panel { font-size: 0.92rem; }
}


/* share row (standards/v2/tools/share_row.py) */
.share-row{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}
.share-row .lab{font-size:.95rem;margin-inline-end:.3rem}
.share-row a,.share-row button{display:inline-grid;place-items:center;flex:none;width:2.5rem;height:2.5rem;padding:0;border-radius:50%;border:1px solid var(--sr-line,color-mix(in srgb,currentColor 28%,transparent));background:transparent;color:var(--sr-ink,inherit);text-decoration:none;cursor:pointer;font:inherit;transition:color .15s,border-color .15s}
.share-row a:hover,.share-row button:hover,.share-row a:focus-visible,.share-row button:focus-visible{color:var(--sr-acc,inherit);border-color:var(--sr-acc,currentColor)}
.share-row [hidden]{display:none}
@media (pointer:coarse){.share-row a,.share-row button{width:2.75rem;height:2.75rem}}
@media (max-width:30rem){.share-row .lab{flex-basis:100%;margin:0 0 .15rem}}
.share-status{font-size:.92rem;color:var(--sr-ok,inherit);min-height:1.2em;margin:.4rem 0 0}
.share-status:empty{display:none}
.share-field{display:block;width:100%;max-width:36rem;margin-top:.4rem;font:inherit;font-size:.9rem}
