@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("fonts/source-serif-4-normal-latin.woff2?v=2a24bad466") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("fonts/source-serif-4-normal-latin-ext.woff2?v=a0cd390d01") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; font-display: swap; src: url("fonts/source-serif-4-italic-latin.woff2?v=011e0ca2bd") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F; }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; font-display: swap; src: url("fonts/source-serif-4-italic-latin-ext.woff2?v=513549ab98") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F; }

:root {
  --paper: #f5f0e6; --paper-2: #ebe3d2; --ink: #1c1a17; --muted: #4d4639; --rule: #cdc1aa;
  --accent: #b3380e; --accent-ink: #ffffff; --link: #9a3009;
  --dot: #8a7f69; --dot-old: #bdb29b; --dot-live: #5a5243; --you: #d2410f;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --bar: 3rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111217; --paper-2: #1a1c23; --ink: #eee8dc; --muted: #c0b7a6; --rule: #343844;
    --accent: #ff8a5c; --accent-ink: #1a0c05; --link: #ffa37f;
    --dot: #857c68; --dot-old: #4a473f; --dot-live: #cfc6b4; --you: #ff7a45;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111217; --paper-2: #1a1c23; --ink: #eee8dc; --muted: #c0b7a6; --rule: #343844;
  --accent: #ff8a5c; --accent-ink: #1a0c05; --link: #ffa37f;
  --dot: #857c68; --dot-old: #4a473f; --dot-live: #cfc6b4; --you: #ff7a45;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.1875rem/1.6 var(--serif); }
a { color: var(--link); text-underline-offset: 0.15em; overflow-wrap: anywhere; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 50; }
.skip:focus { left: 0.5rem; }
b, strong { font-weight: 650; }
.num { font-variant-numeric: tabular-nums; }

/* one-line bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.9rem; height: var(--bar); padding: 0 1rem; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); font: 500 0.9rem/1 var(--sans); white-space: nowrap; }
.topbar a { color: var(--ink); text-decoration: none; }
.topbar .home { font-weight: 700; }
.topnav { display: flex; gap: 0.9rem; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1 1 auto; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { padding: 0.9rem 0.1rem; border-bottom: 2px solid transparent; }
.topnav a[aria-current] { border-bottom-color: var(--accent); }
.chip { border: 1px solid var(--rule); border-radius: 999px; padding: 0.35rem 0.7rem; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-right: -0.5rem; border: 0; background: none; color: var(--ink); border-radius: 50%; cursor: pointer; flex: none; }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }
@media (max-width: 560px) { .topbar .home { display: none; } }

/* reading rail */
.rail { position: fixed; right: 0.9rem; top: 50%; transform: translateY(-50%); z-index: 15; display: none; flex-direction: column; gap: 0.2rem; font: 500 0.78rem/1.2 var(--sans); }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; min-height: 1.9rem; color: var(--muted); text-decoration: none; }
.rail a span { opacity: 0; transition: opacity .2s; background: var(--paper); padding: 0.1rem 0.3rem; }
.rail a i { width: 0.55rem; height: 0.55rem; border-radius: 50%; border: 1.5px solid currentColor; }
.rail:hover a span, .rail a:focus-visible span, .rail a[aria-current] span { opacity: 1; }
.rail a[aria-current] { color: var(--accent); }
.rail a[aria-current] i { background: currentColor; }
@media (min-width: 1180px) { .rail { display: flex; } }

/* blocks */
main { display: block; }
.block { max-width: 40rem; margin: 0 auto; padding: 0 1rem; }
.block.wide { max-width: 62rem; }
section.block { padding-top: 3.5rem; padding-bottom: 1rem; scroll-margin-top: var(--bar); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 6.5vw, 3.6rem); font-weight: 700; margin: 0 0 0.8rem; }
h2 { font-size: clamp(1.55rem, 4vw, 2.1rem); font-weight: 680; margin: 0 0 1rem; }
h2 a.anchor { color: inherit; text-decoration: none; }
h2 a.anchor:hover::after { content: " #"; color: var(--muted); font-weight: 400; }
h3 { font-size: 1.2rem; margin: 1.8rem 0 0.5rem; }
p { margin: 0 0 1.05rem; }
.deck { font-size: 1.28rem; color: var(--muted); line-height: 1.45; }
/* footer */
.foot { max-width: 40rem; margin: 4rem auto 0; padding: 1.5rem 1rem 5rem; border-top: 1px solid var(--rule); font: 400 0.9rem/1.5 var(--sans); color: var(--muted); }
.sources .srcs { font: 400 0.92rem/1.5 var(--sans); padding-left: 1.1rem; }
.sources .srcs li { margin-bottom: 0.45rem; }
.sources .method { font-size: 1rem; }
.related { padding-left: 1.1rem; }
.stamp { font: 400 0.85rem/1.4 var(--sans); color: var(--muted); }


/* ---------- the story: a dark stage in both themes ---------- */
:root { --night: #05060b; --glass: rgba(9, 11, 20, 0.72); --glass-line: rgba(160, 175, 220, 0.18); --on-night: #eef0f7; --on-night-2: #b9c0d4; --gold: #ffc56b; --blue: #7fb2ff; }
.story { position: relative; background: var(--night); color: var(--on-night); }
.stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; }
#sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.steps { position: relative; margin-top: -100vh; margin-top: -100lvh; z-index: 2; pointer-events: none; }
.step { min-height: 120vh; display: flex; align-items: center; padding: 18vh 1rem; scroll-margin-top: var(--bar); }
.step .card { pointer-events: auto; max-width: 27rem; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 14px; padding: 1.3rem 1.4rem 0.4rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 10px 40px rgba(0,0,0,.35); font-size: 1.08rem; line-height: 1.55; }
.step .card h2 { font-size: clamp(1.35rem, 3.2vw, 1.7rem); margin-bottom: 0.8rem; }
.step .card a { color: var(--gold); }
.step .card h2 a.anchor { color: var(--on-night); }
.step b { color: #fff; font-weight: 650; }
.step .note { color: var(--on-night-2); }
.step.hero { min-height: 100vh; min-height: 100lvh; align-items: flex-end; padding-bottom: 12vh; }
.step.hero .card { background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; max-width: 36rem; }
.step.hero h1 { color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.8); }
.step.hero .deck { color: #dfe3ee; text-shadow: 0 1px 14px rgba(0,0,0,.95); font-size: 1.2rem; }
.step.hero .kicker { color: var(--gold); text-shadow: 0 1px 8px #000; }
.scroll-cue { font: 500 0.9rem/1.3 var(--sans); color: var(--on-night-2); text-shadow: 0 1px 8px #000; }
.scroll-cue::after { content: " \2193"; }
.c-em { color: var(--blue); font-weight: 650; }
.c-mu { color: var(--gold); font-weight: 650; }
.how { padding-left: 1.3rem; margin: 0 0 1rem; }
.how li { margin-bottom: 0.45rem; }
@media (min-width: 900px) {
  .step { padding-left: max(3rem, 6vw); }
  .step .card { max-width: 25rem; }
}
@media (max-width: 899px) {
  .step { align-items: flex-end; padding-bottom: 8vh; }
  .step .card { max-width: none; width: 100%; }
}

.hud { position: absolute; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 3; display: grid; gap: 0.1rem; text-align: right; font: 500 0.78rem/1.35 var(--sans); color: var(--on-night-2); opacity: 0; transition: opacity .6s; text-shadow: 0 1px 6px #000; }
.hud.on { opacity: 1; }
.hud b { color: var(--gold); font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.hud-l { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
@media (min-width: 1180px) { .hud { right: 9rem; } }
@media (max-width: 899px) { .hud { top: calc(var(--bar) + 0.6rem); bottom: auto; } }

/* without script: a still night, cards in normal flow */
html.no-js .stage { display: none; }
html.no-js .steps { margin-top: 0; }
html.no-js .step { min-height: 0; padding: 3rem 1rem; }
html.no-js .hud { display: none; }

.sources { padding-bottom: 2rem; }
