:root {
  --bg: #121214;
  --bg-2: #18181c;
  --bg-3: #1f1f24;
  --text: #ecebe6;
  --muted: #b8b3a9;
  --line: #303036;
  --ember: #c2402a;
  --ember-btn: #b3361f;
  --ember-light: #ec8f78;
  --famine: #d4b36a;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --text-font: "Lexend", system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 80px);
  --measure: 60ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.125rem/1.65 var(--text-font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-intro { overflow: hidden; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--famine); outline-offset: 3px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; z-index: 60; background: var(--text); color: var(--bg); padding: 6px 10px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 800 1.15rem/1 var(--display); letter-spacing: .04em; text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn-give { background: var(--ember-btn); color: #fff; }
.btn-give:hover { background: #cf4127; color: #fff; }
.btn-ghost { border: 1px solid #5a5a62; color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }
.btn-big { min-height: 60px; padding: 0 36px; font-size: 1.5rem; }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 1rem; }
.btn:active { transform: scale(.97); }

/* Intro */
.intro {
  position: fixed; inset: 0; z-index: 50; background: #0b0b0d;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; cursor: pointer;
}
.intro-spark { width: 14px; height: 14px; border-radius: 50%; background: #ffd9b0; box-shadow: 0 0 24px 8px rgba(226, 92, 58, .8), 0 0 80px 30px rgba(194, 64, 42, .35); margin-bottom: 18px; }
.intro-title { font: 900 clamp(3rem, 12vw, 8rem)/.9 var(--display); margin: 0; }
.intro-line { color: var(--muted); font-size: clamp(1.1rem, 2.4vw, 1.5rem); margin: 0; font-style: italic; }
.intro-skip { position: absolute; bottom: 28px; color: var(--muted); font-size: .95rem; margin: 0; }

/* Header */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 12px var(--gutter);
  background: linear-gradient(to bottom, rgba(18, 18, 20, .92), rgba(18, 18, 20, 0));
}
.brand { font: 900 1.5rem/1 var(--display); text-decoration: none; letter-spacing: .01em; }
.top-nav { display: flex; gap: 22px; margin-left: auto; font-size: 1rem; }
.top-nav a { text-decoration: none; color: var(--muted); }
.top-nav a:hover { color: var(--text); }
.lang { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: 800 .95rem/1 var(--display); letter-spacing: .06em; }
.lang:hover { border-color: var(--muted); }
.top-give { min-height: 40px; padding: 0 18px; font-size: 1.05rem; }
@media (max-width: 899px) { .top-nav { display: none; } .lang { margin-left: auto; } }

/* Globe */
.globe { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block; }
html:not(.has-globe) .globe { display: none; }
main, .foot { position: relative; z-index: 1; }

/* Shared */
main > section, .chapter { padding: clamp(80px, 13vh, 150px) var(--gutter); }
.h-section { font: 900 clamp(2.6rem, 7.5vw, 6rem)/.92 var(--display); margin: 0 0 28px; max-width: 15ch; text-wrap: balance; }
.h-small { font: 800 1.6rem/1.1 var(--display); margin: 0 0 16px; }
.intro-text, .lede { max-width: var(--measure); color: var(--muted); margin: 0 0 40px; font-size: 1.25rem; }
.lede { color: var(--text); }
.ref { font-size: .7em; vertical-align: super; text-decoration: none; color: var(--muted); margin-left: 2px; }
.ref:hover { color: var(--text); }

/* Hero */
.hero { min-height: 100svh; display: flex; align-items: center; position: relative; }
.hero-inner { max-width: 760px; position: relative; }
.hero-lead { font-size: clamp(1.2rem, 2.3vw, 1.6rem); margin: 0 0 8px; color: var(--muted); font-style: italic; }
.hero-total {
  font: 900 clamp(5rem, 17vw, 15rem)/.82 var(--display); font-variant-numeric: tabular-nums;
  margin: 0; letter-spacing: -.01em; transition: color 1.2s ease;
  text-shadow: 0 0 60px rgba(18, 18, 20, .9);
}
.hero-total.tick { color: var(--ember-light); transition: none; }
#global-total.is-pending { visibility: hidden; }
.hero-unit { font: 600 clamp(1.5rem, 3.4vw, 2.6rem)/1.1 var(--display); margin: 12px 0 32px; }
.pulse { height: 3px; background: var(--line); max-width: 640px; margin-bottom: 18px; overflow: hidden; border-radius: 2px; }
.pulse-fill { height: 100%; width: 0; background: var(--ember); }
.hero-rate { font-size: 1.3rem; margin: 0 0 4px; max-width: var(--measure); text-wrap: pretty; }
.hero-since, .chapter-text, .intro-text, .lede, .entry-summary { text-wrap: pretty; }
.hero-since { color: var(--muted); margin: 0 0 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.hero-note { color: var(--muted); font-size: 1rem; max-width: var(--measure); margin: 0; }
.scroll-cue { position: absolute; left: 50%; bottom: 24px; margin: 0; width: 1px; height: 56px; background: var(--line); overflow: hidden; }
.scroll-cue span { position: absolute; left: 0; top: -50%; width: 1px; height: 50%; background: var(--text); animation: cue 2.2s infinite; }
@keyframes cue { to { top: 100%; } }
@media (max-width: 899px) {
  .hero { align-items: flex-end; padding-bottom: 96px; }
  .hero-inner::before { content: ""; position: absolute; inset: -40px -24px -40px; background: linear-gradient(to bottom, rgba(18,18,20,0), rgba(18,18,20,.88) 30%); z-index: -1; }
}

/* Chapters: transparent, the globe shows behind */
.chapter { min-height: 125vh; display: flex; align-items: center; }
.chapter.right { justify-content: flex-end; }
.chapter .panel, .constellation .panel, .finale .panel { position: relative; max-width: 560px; }
.chapter .panel::before, .constellation .panel::before, .finale .panel::before {
  content: ""; position: absolute; inset: -48px -56px; z-index: -1;
  background: radial-gradient(closest-side, rgba(18, 18, 20, .82), rgba(18, 18, 20, 0));
}
.chapter-index { font: 800 1.1rem/1 var(--display); color: var(--ember-light); letter-spacing: .08em; margin: 0 0 12px; }
.chapter-name { font: 900 clamp(3rem, 8vw, 6.5rem)/.9 var(--display); margin: 0 0 8px; text-wrap: balance; }
.chapter-since { color: var(--muted); margin: 0 0 20px; }
.chapter-num { font: 900 clamp(3.6rem, 9vw, 7.5rem)/.9 var(--display); font-variant-numeric: tabular-nums; margin: 0; color: #fff; }
.chapter-label { font-size: 1.15rem; margin: 6px 0 4px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--ember-light); font-size: .95rem; margin-left: 6px; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ember); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.chapter-kids { font: 700 1.35rem/1.3 var(--text-font); color: var(--ember-light); margin: 4px 0 0; }
.chapter-text { font-size: 1.2rem; margin: 20px 0 28px; }
.chapter-actions { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 899px) {
  .chapter { min-height: 110vh; align-items: flex-end; padding-bottom: 72px; }
  .chapter.right { justify-content: flex-start; }
  .chapter .panel::before, .constellation .panel::before, .finale .panel::before { inset: -60px -24px -40px; background: linear-gradient(to bottom, rgba(18,18,20,0), rgba(18,18,20,.9) 28%); }
}

.constellation, .finale { min-height: 130vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.constellation .panel, .finale .panel { max-width: 760px; }
.constellation .h-section, .finale .h-section, .constellation .lede, .finale .lede { margin-left: auto; margin-right: auto; }
.finale-line { font-style: italic; color: var(--muted); font-size: 1.4rem; margin: 0 0 16px; }
@media (max-width: 899px) { .constellation, .finale { align-items: flex-end; padding-bottom: 80px; } }

/* Solid sections after the story */
.alerts, .clock, .hunger, .register, .sources { background: var(--bg); }
.wall, .act, .method { background: var(--bg-2); }

.alerts { padding-top: 56px !important; padding-bottom: 56px !important; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.alerts-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 980px; }
.alerts-list li { display: grid; grid-template-columns: 8em 1fr; gap: 16px; font-size: 1.05rem; }
.alerts-list time { color: var(--ember-light); font: 800 1.1rem/1.5 var(--display); }
.alerts-list .org { color: var(--muted); }
@media (max-width: 560px) { .alerts-list li { grid-template-columns: 1fr; gap: 0; } }

/* Clock */
.clock-list { list-style: none; margin: 0; padding: 0; max-width: 1100px; }
.clock-list li {
  display: grid; grid-template-columns: minmax(0, 22rem) 1fr auto; gap: 8px 32px; align-items: center;
  padding: 20px 0; border-top: 1px solid var(--line);
}
.clock-every { font: 900 clamp(2rem, 4.6vw, 3.6rem)/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock-every small { display: block; font: 400 1rem/1.3 var(--text-font); color: var(--muted); margin-bottom: 6px; }
.clock-what { font-size: 1.2rem; }
.clock-what small { display: block; color: var(--muted); font-size: .95rem; }
.clock-next { display: inline-block; margin-top: 6px; font: 800 1.15rem/1 var(--display); color: var(--ember-light); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
@media (max-width: 720px) { .clock-list li { grid-template-columns: 1fr; } .clock-list .btn { justify-self: start; } }

/* Wall */
.wall-key { color: var(--muted); max-width: var(--measure); margin: 0 0 40px; font-size: 1.15rem; }
.wall-grid { display: grid; gap: 32px; max-width: 1200px; }
.wall-name { font: 800 1.4rem/1.2 var(--display); margin: 0 0 10px; }
.wall-name span { font: 400 1rem/1.2 var(--text-font); color: var(--muted); margin-left: 8px; }
.wall-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text); opacity: .85; }
.dot.c { background: var(--ember); opacity: 1; box-shadow: 0 0 6px rgba(226, 92, 58, .6); }
.dot.gap { background: none; box-shadow: inset 0 0 0 1px var(--muted); opacity: .6; }

/* Children */
.children { background: var(--bg); }
.kids-grid { display: grid; gap: 36px; max-width: 1200px; }
.kids-figs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.kids-figs strong { font: 900 1.6rem/1 var(--display); color: var(--ember-light); margin-right: 4px; font-variant-numeric: tabular-nums; }
.kids-note { color: var(--muted); font-size: .92rem; }
.kids-unknown { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--text); font-size: 1.05rem; }
.dot.unknown { flex: none; width: 18px; height: 18px; background: none; box-shadow: inset 0 0 0 2px var(--ember); opacity: 1; position: relative; }
.dot.unknown::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; font: 800 .75rem/1 var(--display); color: var(--ember-light); }
.dot.c.part { width: 6px; height: 6px; margin: 2px; }
.wall-kids { margin: -4px 0 10px; color: var(--ember-light); font-size: .98rem; }
.kids-none, .wall-kids .kids-none { color: var(--muted); font-style: italic; }
.kids-none-dd { font: 400 1rem/1.45 var(--text-font) !important; color: var(--ember-light); max-width: 30ch; }

/* Register (ledger) */
.filters { display: flex; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.filters button { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; cursor: pointer; font: 800 1.1rem/1.2 var(--display); letter-spacing: .04em; }
.filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--text); }
.entry { border-bottom: 1px solid var(--line); padding: 36px 0 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px 56px; }
.entry-head h3 { font: 900 clamp(2.2rem, 5vw, 3.8rem)/.95 var(--display); margin: 0 0 8px; }
.entry-since { color: var(--muted); font-size: 1rem; margin: 0 0 12px; }
.tags { display: flex; gap: 8px; }
.tag { font: 800 1rem/1 var(--display); padding: 6px 10px; border: 1px solid; border-radius: 999px; letter-spacing: .04em; }
.tag.war { color: var(--ember-light); }
.tag.famine { color: var(--famine); }
.entry-summary { margin: 0 0 24px; max-width: var(--measure); }
.figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 24px 32px; margin: 0 0 24px; }
.fig dt { color: var(--muted); font-size: 1rem; line-height: 1.35; margin-bottom: 6px; }
.fig dd { margin: 0; font: 900 clamp(1.9rem, 3.4vw, 2.6rem)/1 var(--display); font-variant-numeric: tabular-nums; }
.fig dd small { display: block; font: 400 .92rem/1.45 var(--text-font); color: var(--muted); margin-top: 6px; }
.fig.live dt::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ember); margin-left: 8px; vertical-align: middle; animation: blink 1.6s infinite; }
.stale { display: block; color: var(--famine); font: 400 .9rem/1.4 var(--text-font); margin-top: 4px; }
.entry-help { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.entry-help > span { font: 800 1.15rem/1 var(--display); margin-right: 4px; letter-spacing: .03em; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); text-decoration: none; font-size: .98rem; }
.chip:hover { border-color: var(--ember-light); color: #fff; }
.chip::after { content: "\2197"; margin-left: 6px; color: var(--muted); }
@media (max-width: 820px) { .entry { grid-template-columns: 1fr; } }

/* Hunger */
.hunger-rows { display: grid; border-top: 1px solid var(--famine); max-width: 1200px; }
.hunger-global { margin: 20px 0 !important; }
.hrow { display: grid; grid-template-columns: 13ch 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: center; }
.hrow h3 { font: 800 1.7rem/1 var(--display); margin: 0; }
.hbar { display: flex; height: 28px; background: var(--bg-3); min-width: 0; border-radius: 3px; overflow: hidden; }
.hbar span { display: block; height: 100%; }
.hbar .p5 { background: var(--famine); }
.hbar .p4 { background: #7d6a3f; }
.hmeta { grid-column: 2; color: var(--muted); font-size: 1rem; margin: 8px 0 0; }
.hmeta strong { color: var(--famine); font-weight: 700; }
.hlegend { color: var(--muted); font-size: 1rem; margin: 24px 0 0; }
.hlegend i { display: inline-block; width: 16px; height: 12px; margin: 0 8px 0 18px; vertical-align: middle; border-radius: 2px; }
@media (max-width: 560px) { .hrow { grid-template-columns: 1fr; gap: 10px; } .hmeta { grid-column: 1; } }

/* Act */
.act-warn { max-width: var(--measure); border-left: 3px solid var(--famine); padding-left: 16px; margin: 0 0 48px; }
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.act-block { background: var(--bg-3); border: 1px solid var(--line); border-radius: 14px; padding: 22px 22px 24px; }
.act-block h3 { font: 900 1.9rem/1 var(--display); margin: 0 0 16px; }
.act-block ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.give-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 46px; padding: 0 16px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); text-decoration: none; transition: border-color .2s, background-color .2s; }
.give-link::after { content: "\2197"; color: var(--ember-light); }
.give-link:hover { border-color: var(--ember-light); background: #241614; color: #fff; }

/* Method and sources */
.prose { max-width: var(--measure); margin-bottom: 48px; }
.prose p { margin: 0 0 1em; }
.prose code { font-size: .9em; background: var(--bg-3); padding: 2px 6px; border-radius: 4px; }
.selection { max-width: 900px; padding-left: 1.2em; color: var(--muted); }
.selection li { margin-bottom: 10px; }
.updated { color: var(--muted); margin: 0 0 24px; }
.source-list { max-width: 1000px; padding-left: 2.4em; font-size: 1rem; color: var(--muted); }
.source-list li { margin-bottom: 10px; padding-left: 4px; }
.source-list li:target { color: var(--text); }
.source-list a { color: var(--text); word-break: break-word; }

.foot { padding: 48px var(--gutter) 96px; color: var(--muted); font-size: 1rem; border-top: 1px solid var(--line); background: var(--bg); }
.foot p { margin: 0 0 6px; max-width: var(--measure); }

.give-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 15; box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .3s, transform .3s, background-color .2s;
}
.give-float.is-on { opacity: 1; transform: none; pointer-events: auto; }
html[data-motion="off"] .give-float { opacity: 1; transform: none; pointer-events: auto; }

.toast {
  position: fixed; left: var(--gutter); bottom: 20px; z-index: 30;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 10px; max-width: min(520px, calc(100vw - 32px)); font-size: 1rem;
}

/* Legal page */
.legal { padding: 64px var(--gutter); max-width: calc(var(--measure) + 2 * var(--gutter)); }
.legal h1 { font: 900 3rem/1 var(--display); }

[data-split] .line-mask, [data-split] [class*="-mask"] { padding-bottom: .08em; margin-bottom: -.08em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
