/* cat-cantareste-un-nor: a day sky and a night sky, both AAA. */
@font-face {
  font-family: "Fraunces";
  src: url("./fonts/Fraunces-display.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson";
  src: url("./fonts/AtkinsonHyperlegibleNext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #edf3f9;
  --bg-2: #dde8f3;
  --surface: #ffffff;
  --text: #0e2a47;
  --text-2: #1d3a5e;
  --muted: #2e4c74;
  --accent: #084786;
  --accent-ink: #ffffff;
  --accent-soft: #d9e8f8;
  --hot: #6e3700;
  --ok: #0a5228;
  --ok-soft: #ddf0e3;
  --no: #891b1b;
  --no-soft: #f7dede;
  --line: #b9c9db;
  --cloud: #ffffff;
  --cloud-shadow: #c8d8ea;
  --sun: #e8a13a;
  --bar: 3.5rem;
  --radius: 14px;
  --font-d: "Fraunces", Georgia, serif;
  --font-b: "Atkinson", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0a1725;
  --bg-2: #0e2033;
  --surface: #12283f;
  --text: #edf4fb;
  --text-2: #d3e1f1;
  --muted: #b4c9e1;
  --accent: #a8d1ff;
  --accent-ink: #06233f;
  --accent-soft: #12395f;
  --hot: #f0b35e;
  --ok: #8fe0ab;
  --ok-soft: #0d3a22;
  --no: #f2a3a3;
  --no-soft: #471414;
  --line: #2c4a6b;
  --cloud: #dbe7f4;
  --cloud-shadow: #5a7899;
  --sun: #f2c063;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1725;
    --bg-2: #0e2033;
    --surface: #12283f;
    --text: #edf4fb;
    --text-2: #d3e1f1;
    --muted: #b4c9e1;
    --accent: #a8d1ff;
    --accent-ink: #06233f;
    --accent-soft: #12395f;
    --hot: #f0b35e;
    --ok: #8fe0ab;
    --ok-soft: #0d3a22;
    --no: #f2a3a3;
    --no-soft: #471414;
    --line: #2c4a6b;
    --cloud: #dbe7f4;
    --cloud-shadow: #5a7899;
    --sun: #f2c063;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 1.125rem;
  line-height: 1.62;
  overflow-x: clip;
}
img { width: 100%; height: auto; display: block; }
.num { font-variant-numeric: tabular-nums; }
.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--hot); outline-offset: 3px; border-radius: 4px; }
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 60;
  background: var(--surface); color: var(--text); padding: 0.75rem 1.25rem; border-radius: 0 0 10px 10px;
}
.skip:focus { top: 0; }
.wrap { max-width: 44rem; margin-inline: auto; padding-inline: 1.25rem; }
.wide { max-width: 62rem; margin-inline: auto; padding-inline: 1.25rem; }
section { scroll-margin-top: calc(var(--bar) + 0.75rem); }

/* top bar: one line, sideways scroll, sun/moon icon */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.75rem;
  min-height: var(--bar); padding: 0 1rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar .home { font-weight: 700; text-decoration: none; color: var(--text); white-space: nowrap; }
.topnav { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { padding: 0.6rem 0.7rem; text-decoration: none; color: var(--text-2); border-radius: 8px; }
.topnav a[aria-current="true"] { background: var(--accent-soft); color: var(--text); font-weight: 700; }
.spacer { flex: 1 1 auto; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.55rem 1rem;
  text-decoration: none; color: var(--text); white-space: nowrap; min-height: 44px;
  display: inline-flex; align-items: center;
}
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }

/* reading rail (desktop only) */
.rail {
  position: fixed; right: 1rem; top: 50%; transform: translateY(-50%); z-index: 40;
  display: flex; flex-direction: column; gap: 0.9rem;
}
.rail-dot { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.rail-label { font-size: 0.8rem; color: var(--muted); opacity: 0; transition: opacity 0.2s; }
.rail-dot:hover .rail-label { opacity: 1; }
.rail-dot .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); opacity: 0.55; }
@media (max-width: 70rem) { .rail { display: none; } }

/* hero: drifting clouds over the promise */
.hero { position: relative; overflow: clip; }
.scene {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #bcd7f0 0%, var(--bg) 78%);
}
:root[data-theme="dark"] .scene,
:root:not([data-theme="light"]) .scene { background: linear-gradient(180deg, #06121f 0%, var(--bg) 85%); }
.sun {
  position: absolute; top: 12%; right: 12%; width: 72px; height: 72px; border-radius: 50%;
  background: var(--sun); opacity: 0.9;
}
.cloud {
  position: absolute; background: var(--cloud); border-radius: 999px; opacity: 0.92;
  box-shadow: 0 10px 24px var(--cloud-shadow);
  animation: drift 46s linear infinite;
}
.cloud.c1 { width: 320px; height: 92px; top: 12%; left: -340px; animation-duration: 52s; }
.cloud.c2 { width: 210px; height: 62px; top: 36%; left: -230px; animation-duration: 38s; animation-delay: -14s; }
.cloud.c3 { width: 420px; height: 110px; top: 60%; left: -440px; animation-duration: 64s; animation-delay: -30s; opacity: 0.75; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.cloud::before { width: 45%; aspect-ratio: 1; left: 12%; top: -72%; }
.cloud::after { width: 30%; aspect-ratio: 1; right: 14%; top: -48%; }
@keyframes drift { to { transform: translateX(calc(100vw + 420px)); } }
.hero-copy { position: relative; padding: clamp(3rem, 9vw, 6rem) 1.25rem 2.5rem; }
.panel { max-width: 44rem; margin-inline: auto; background: var(--surface); background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem); }
.kicker { color: var(--hot); font-weight: 700; margin: 0 0 0.5rem; font-size: 1rem; }
h1, h2, h3 { font-family: var(--font-d); line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); margin: 0 0 1rem; font-weight: 650; }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 0.75rem; font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }
.deck { font-size: 1.2rem; margin: 0 0 1.5rem; }
.cta {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 48px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
  padding: 0.7rem 1.4rem; border-radius: 999px; text-decoration: none;
}
.byline { color: var(--muted); font-size: 0.95rem; margin: 1.25rem 0 0; }

/* share */
.share { margin-top: 1.5rem; }
.share-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.share-row .lab { color: var(--muted); margin-right: 0.25rem; }
.share-row a, .share-row button {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0.5rem 1rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--text); text-decoration: none; font: inherit; cursor: pointer;
}
.share-status { color: var(--muted); min-height: 1.5em; }
.share-status input { font: inherit; width: 100%; max-width: 24rem; padding: 0.5rem; }

/* chapters */
.chapter { padding: 3rem 0 0.5rem; }
.chapter-head { margin-bottom: 0.5rem; }
.lede { font-size: 1.2rem; }
.note { color: var(--muted); font-size: 0.98rem; }
figure { margin: 2rem auto; }
.fig-wide { max-width: 62rem; padding-inline: 1.25rem; }
figcaption { color: var(--muted); font-size: 0.95rem; margin-top: 0.6rem; }
figcaption .credit { display: block; font-size: 0.85rem; }
figure img { border-radius: var(--radius); border: 1px solid var(--line); }
.reveal.pre { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* controls */
.btn {
  min-height: 48px; padding: 0.7rem 1.5rem; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: none; font: inherit; font-weight: 700;
}
.pick, .vote, .ans-true, .ans-false {
  min-height: 48px; padding: 0.7rem 1.2rem; border-radius: var(--radius); cursor: pointer;
  background: var(--surface); color: var(--text); border: 2px solid var(--line); font: inherit;
}
.pick { display: flex; flex-direction: column; gap: 0.15rem; align-items: flex-start; text-align: left; }
.pick .pick-lwc { color: var(--muted); font-size: 0.95rem; }
.pick[aria-pressed="true"], .vote.picked { border-color: var(--accent); background: var(--accent-soft); }
.slider { margin: 1rem 0; }
.slider label { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-weight: 700; }
.slider output { font-weight: 400; }
.slider input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--accent); }

/* guess + vote verdicts */
.guess, .vote-box { display: grid; gap: 0.75rem; }
.vote-box { grid-template-columns: 1fr; }
.verdict {
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--ok);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-top: 0.5rem;
}
.verdict p { margin: 0; }

/* the scales */
.scale { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 3vw, 2rem); }
.scale-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.scale-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 52rem) { .scale-grid { grid-template-columns: 1fr; } .scale-pick { grid-template-columns: 1fr; } }
.readout .lab { color: var(--muted); margin: 1rem 0 0; font-size: 0.95rem; }
.readout .lab:first-child { margin-top: 0; }
.tonnes { font-family: var(--font-d); font-size: clamp(2.4rem, 6vw, 3.4rem); margin: 0; font-weight: 700; }
.tonnes .unit { font-size: 1.2rem; font-family: var(--font-b); font-weight: 400; }
.vol { font-size: 1.4rem; margin: 0; }
.eq { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.eq .n { font-weight: 700; font-size: 1.15rem; }

/* droplet strip + settling */
.strip { width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.strip .drop { fill: var(--accent); opacity: 0.8; }
.strip .d-name { fill: var(--text); font-family: var(--font-b); }
.strip .d-dia { fill: var(--muted); font-family: var(--font-b); }
.settle { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.settle li { display: flex; justify-content: space-between; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 1rem; }
.settle .n { font-weight: 700; white-space: nowrap; }

/* balance bars */
.balance { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 3vw, 2rem); }
.bar-row { display: grid; grid-template-columns: 12rem 1fr auto; gap: 0.75rem; align-items: center; margin: 0.6rem 0; }
@media (max-width: 40rem) { .bar-row { grid-template-columns: 1fr; gap: 0.25rem; } }
.bar { display: block; height: 22px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; }
.fill-cloud { width: 99.65%; background: var(--accent); }
.fill-dry { width: 100%; background: var(--muted); }
.bar-n { font-weight: 700; white-space: nowrap; }
.gap { font-weight: 700; color: var(--ok); font-size: 1.2rem; }

/* chart */
.chart { width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chart .bar { fill: var(--accent); opacity: 0.85; }
.chart .b-val { fill: var(--text); font-weight: 700; font-family: var(--font-b); }
.chart .b-name, .chart .b-unit { fill: var(--muted); font-family: var(--font-b); }
.cannot { background: var(--accent-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.5rem; margin-top: 2rem; }
.cannot h3 { margin-top: 0; }
.cannot ul { margin-bottom: 0; padding-left: 1.25rem; }

/* game */
.game { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 3vw, 2rem); }
.game-progress { list-style: none; display: flex; gap: 0.5rem; padding: 0; margin: 0 0 1rem; }
.game-progress li { width: 2rem; height: 0.5rem; border-radius: 999px; background: var(--line); }
.game-progress li.done { background: var(--ok); }
.game-progress li.now { background: var(--accent); }
.game .q { font-size: 1.25rem; font-weight: 700; }
.answers { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.explain { margin-top: 1rem; }
.explain .tag { font-weight: 700; padding: 0.2rem 0.8rem; border-radius: 999px; }
.explain .tag.t { background: var(--ok-soft); color: var(--ok); }
.explain .tag.f { background: var(--no-soft); color: var(--no); }
.all-answers { padding-left: 1.25rem; display: grid; gap: 0.75rem; }
.all-answers .tag { font-weight: 700; }
.result .score { font-size: 1.4rem; font-weight: 700; margin-bottom: 0; }
.result .rank { margin: 0.25rem 0; }

/* sources + footer */
.sources ul { padding-left: 1.25rem; }
.sources li { margin-bottom: 0.5rem; }
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 1.25rem 2.5rem; text-align: center; color: var(--muted); }
.nf { display: grid; place-items: center; min-height: 100vh; }
.nf-main { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal.pre { opacity: 1; transform: none; transition: none; }
  .cloud { animation: none; }
  .rail-label { transition: none; }
}
