/* Civic broadsheet: newspaper credibility for MPs and press, poster energy for
   sharing. Eucalyptus green carries the campaign; wattle gold marks the ask. */
:root {
  --hue: 150;
  --paper: oklch(97.6% 0.008 95);
  --paper-2: oklch(94.5% 0.012 95);
  --line: oklch(86% 0.012 120);
  --ink: oklch(21% 0.025 160);
  --ink-2: oklch(38% 0.02 160);
  --ink-3: oklch(50% 0.018 160);
  --accent: oklch(43% 0.1 155);
  --accent-ink: oklch(99% 0.005 95);
  --accent-deep: oklch(27% 0.06 160);
  --gold: oklch(84% 0.15 88);
  --gold-ink: oklch(25% 0.05 80);
  --danger: oklch(50% 0.17 28);

  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Be Vietnam Pro", system-ui, sans-serif;

  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.45vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --step-3: clamp(1.9rem, 1.5rem + 1.8vw, 2.9rem);
  --step-4: clamp(2.4rem, 1.6rem + 4vw, 4.6rem);
  --leading-body: 1.62;
  --measure: 64ch;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --section-y: clamp(56px, 6vw + 24px, 128px);
  --gutter: clamp(16px, 4vw, 48px);
  --container: 1120px;

  --radius: 4px;
  --dur-state: 200ms;
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur-state: 0ms; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0) / var(--leading-body) var(--font-body);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
/* Components set display (flex, grid); the hidden attribute must still win. */
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--space-4); top: var(--space-4); background: var(--ink); color: var(--paper); padding: var(--space-2) var(--space-4); z-index: 10; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--ink); position: relative; z-index: 30; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 56px; }
.brand { min-height: 44px; font: 700 var(--step-0) / 1 var(--font-body); letter-spacing: 0.02em; color: var(--ink); text-decoration: none; display: flex; gap: var(--space-2); align-items: center; }
.brand-mark { width: 26px; height: 26px; }
/* Phones: the mark alone keeps the lawn link and both languages on one line;
   the name stays in the accessibility tree. */
@media (max-width: 479px) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.nav { display: flex; align-items: center; gap: var(--space-2); }
.nav-lawn { white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-3); font-weight: 600; font-size: var(--step--1); color: var(--ink); text-decoration: none; border: 1px solid var(--ink); border-radius: 999px; }
.nav-lawn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: var(--space-2); }
.nav-lawn:hover { background: var(--paper-2); }
.nav-lawn[aria-current="page"] { background: var(--ink); color: var(--paper); }
/* Language menu: a <details>, so it opens and closes without JS (app.js only adds close-on-outside-click). */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-3); font-weight: 600; font-size: var(--step--1); color: var(--ink); border-radius: var(--radius); }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.lang-menu[open] summary, .lang-menu summary:hover { background: var(--paper-2); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + var(--space-1)); z-index: 30; margin: 0; padding: var(--space-1); list-style: none; min-width: 200px; background: var(--paper); border: 1px solid var(--ink); border-radius: var(--radius); box-shadow: 0 8px 24px oklch(21% 0.025 160 / 0.18); }
.lang-menu a { display: flex; align-items: center; min-height: 44px; padding: 0 var(--space-3); color: var(--ink); text-decoration: none; font-weight: 500; border-radius: var(--radius); }
.lang-menu a:hover { background: var(--paper-2); }
.lang-menu a[aria-current] { background: var(--paper-2); font-weight: 700; }

.kicker { font: 600 var(--step--1) / 1.3 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--space-3); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-4); line-height: 1.02; }
h2 { font-size: var(--step-3); line-height: 1.08; margin-bottom: var(--space-5); }
h3 { font-size: var(--step-1); line-height: 1.25; margin-bottom: var(--space-2); }
p { margin: 0 0 var(--space-4); max-width: var(--measure); text-wrap: pretty; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); }
.muted { color: var(--ink-3); font-size: var(--step--1); }

/* Hero */
.hero { padding-block: var(--space-7) var(--section-y); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: var(--space-7); }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.35fr 1fr; align-items: end; } }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { margin-top: var(--space-5); }
.hero-lawn { margin: var(--space-5) 0 0; font-weight: 600; }
.counter { border-top: 4px solid var(--ink); padding-top: var(--space-4); }
.counter-n { font: 600 var(--step-4) / 1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.counter-label { color: var(--ink-2); margin-top: var(--space-2); }
.counter-sub { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-4); font-size: var(--step--1); color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-5); border: 2px solid var(--ink); border-radius: var(--radius); background: var(--ink); color: var(--paper); font: 600 var(--step-0) / 1 var(--font-body); text-decoration: none; cursor: pointer; transition: background var(--dur-state) var(--ease-out), color var(--dur-state) var(--ease-out), transform 120ms; }
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn-gold:hover { background: oklch(78% 0.15 88); border-color: oklch(78% 0.15 88); color: var(--gold-ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink); }
.btn-sm { min-height: 44px; padding: 0 var(--space-4); font-size: var(--step--1); }
.btn-on-dark { background: oklch(21% 0.025 160 / 0.55); color: var(--paper); border-color: oklch(97% 0.01 95 / 0.7); backdrop-filter: blur(6px); }
.btn-on-dark:hover { background: oklch(21% 0.025 160 / 0.8); border-color: var(--paper); color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

/* Sections */
section.block { padding-block: var(--section-y); border-bottom: 1px solid var(--line); }
section.block.dark { background: var(--accent-deep); color: var(--accent-ink); border-bottom: 0; }
section.block.dark .kicker { color: var(--gold); }
section.block.dark a { color: var(--gold); }
section.block.dark .muted, section.block.dark .lede { color: oklch(86% 0.02 140); }
.two-col { display: grid; gap: var(--space-6); }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1.6fr; gap: var(--space-8); } }

/* Before / after ledger: the signature element */
.ledger { display: grid; border: 1px solid var(--ink); }
@media (min-width: 720px) { .ledger { grid-template-columns: 1fr 1fr; } }
.ledger > div { padding: var(--space-5); }
.ledger > div + div { border-top: 1px solid var(--ink); }
@media (min-width: 720px) { .ledger > div + div { border-top: 0; border-left: 1px solid var(--ink); } }
.ledger .tag { font: 700 var(--step--1) / 1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; display: inline-block; padding: var(--space-1) var(--space-2); margin-bottom: var(--space-3); }
.ledger .before .tag { background: var(--paper-2); }
.ledger .after { background: oklch(96% 0.025 40); }
.ledger .after .tag { background: var(--danger); color: white; }
.ledger ul { margin: 0; padding-left: 1.1em; }
.ledger li + li { margin-top: var(--space-2); }

.facts { list-style: none; padding: 0; margin: var(--space-6) 0 0; display: grid; gap: var(--space-4); }
.facts li { border-left: 3px solid var(--accent); padding-left: var(--space-4); max-width: var(--measure); }
.facts .src { display: block; font-size: var(--step--1); color: var(--ink-3); margin-top: var(--space-1); }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--ink); }
.timeline li { position: relative; padding: 0 0 var(--space-5) var(--space-5); }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 0.45em; width: 12px; height: 12px; background: var(--paper); border: 2px solid var(--ink); border-radius: 50%; }
.timeline li.now::before { background: var(--danger); border-color: var(--danger); }
.timeline time { font-weight: 700; font-variant-numeric: tabular-nums; display: block; }

.ask { font: 500 var(--step-2) / 1.3 var(--font-display); max-width: 30ch; }
.ask mark { background: var(--gold); color: var(--gold-ink); padding: 0 0.15em; }

/* Action cards */
.actions { display: grid; gap: var(--space-4); }
@media (min-width: 720px) { .actions { grid-template-columns: 1fr 1fr; } }
.card { border: 1px solid var(--ink); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); background: var(--paper); }
.card .num { font: 600 var(--step-2) / 1 var(--font-display); color: var(--accent); }
.card p { margin: 0; }
.card .btn { align-self: flex-start; margin-top: auto; }

/* Forms */
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain legend { font-weight: 600; margin-bottom: var(--space-3); padding: 0; }
.chips-signs { flex-direction: column; align-items: stretch; }
.chips.chips-signs label { border-radius: var(--radius); padding-block: var(--space-2); font-family: var(--font-display); font-size: var(--step-0); line-height: 1.3; }
.chips-signs .tr { display: block; font: 400 var(--step--1) / 1.4 var(--font-body); opacity: 0.8; }
form { display: grid; gap: var(--space-4); max-width: 640px; }
label { font-weight: 600; display: grid; gap: var(--space-2); }
.hint { font-weight: 400; color: var(--ink-3); font-size: var(--step--1); }
input, select, textarea { font: inherit; color: var(--ink); background: white; border: 1px solid var(--ink-3); border-radius: var(--radius); padding: var(--space-3); min-height: 48px; width: 100%; }
textarea { min-height: 160px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--gold); outline-offset: 0; border-color: var(--ink); }
.check { display: flex; gap: var(--space-3); align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; min-height: 0; margin-top: 3px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { min-height: 1.5em; font-weight: 600; }
.status[data-kind="ok"] { color: var(--accent); }
.status[data-kind="err"] { color: var(--danger); }
section.block.dark .status[data-kind="ok"] { color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chips label { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-4); border: 1px solid currentColor; border-radius: 999px; font-weight: 500; cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips label:has(input:checked) { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.chips label:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }

.letter-box { white-space: pre-wrap; background: white; border: 1px solid var(--ink-3); border-radius: var(--radius); padding: var(--space-4); font-size: var(--step--1); line-height: 1.6; max-height: 420px; overflow: auto; }

/* Stories */
.stories { display: grid; gap: var(--space-4); }
@media (min-width: 720px) { .stories { grid-template-columns: repeat(2, 1fr); } }
.story { border-top: 3px solid var(--ink); padding-top: var(--space-4); }
.story blockquote { margin: 0 0 var(--space-3); font: 400 var(--step-1) / 1.45 var(--font-display); white-space: pre-line; }
.story footer { font-size: var(--step--1); color: var(--ink-3); }
.empty { border: 1px dashed var(--ink-3); padding: var(--space-6); color: var(--ink-2); }

details { border-top: 1px solid var(--line); padding-block: var(--space-4); }
details summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
details[open] summary { margin-bottom: var(--space-3); }

.sources { font-size: var(--step--1); }
.sources li { margin-bottom: var(--space-2); overflow-wrap: anywhere; }

.site-footer { padding-block: var(--space-7); font-size: var(--step--1); color: var(--ink-2); }
.site-footer p { max-width: 80ch; }

.share-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.share-row .btn { min-height: 44px; padding: 0 var(--space-4); font-size: var(--step--1); }
.toast { position: fixed; left: 50%; bottom: var(--space-5); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: var(--space-3) var(--space-5); border-radius: var(--radius); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity var(--dur-state); z-index: 20; }
.toast.show { opacity: 1; }

/* The lawn (lawn.js). The canvas fills the stage; text sits on gradients so it
   stays readable over any part of the 3D scene. */
.lawn-stage { position: relative; height: min(78svh, 820px); min-height: 460px; background: #1a3a2b; overflow: hidden; color: var(--paper); }
.lawn-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.lawn-stage canvas:active { cursor: grabbing; }
.lawn-stage.no-3d { height: auto; min-height: 0; padding-block: 160px var(--space-7); }
.lawn-top { position: absolute; inset: 0 0 auto; padding-block: var(--space-6) var(--space-8); background: linear-gradient(oklch(18% 0.03 160 / 0.82), oklch(18% 0.03 160 / 0)); pointer-events: none; }
.lawn-stage.no-3d .lawn-top { position: absolute; }
.lawn-top .kicker { color: var(--gold); }
.lawn-top h1 { font-size: var(--step-4); line-height: 1; }
.lawn-count { margin: var(--space-3) 0 0; font-size: var(--step-1); }
.lawn-count strong { font: 600 var(--step-3) / 1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--gold); }
.lawn-empty { margin-top: var(--space-4); pointer-events: auto; }
.lawn-empty p { margin-bottom: var(--space-3); }
.lawn-bottom { position: absolute; inset: auto 0 0; padding-block: var(--space-8) var(--space-5); background: linear-gradient(oklch(18% 0.03 160 / 0), oklch(18% 0.03 160 / 0.75)); pointer-events: none; }
.lawn-bottom .wrap { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3); }
.lawn-tools { display: flex; gap: var(--space-2); margin-left: auto; pointer-events: auto; }
.lawn-card { pointer-events: auto; background: var(--paper); color: var(--ink); border-left: 4px solid var(--gold); padding: var(--space-3) var(--space-4); border-radius: var(--radius); font-weight: 600; max-width: 520px; }
.lawn-fallback { position: relative; margin: 0 auto; max-width: var(--container); padding-inline: var(--gutter); color: oklch(88% 0.02 140); }

.tallies { display: grid; gap: var(--space-7); }
@media (min-width: 900px) { .tallies { grid-template-columns: repeat(3, 1fr); } }
.bars { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.bars li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-1) var(--space-3); font-size: var(--step--1); }
.bars .sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--ink); }
.bars li:not(:has(.sw)) .bar-l { grid-column: 1 / 3; }
.bars .bar-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.bars .bar { grid-column: 1 / -1; height: 6px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
.bars .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 600ms var(--ease-out); }
#bars-sign .bar-l { font-family: var(--font-display); font-size: var(--step-0); }
#lawn-me .ask { margin-bottom: var(--space-6); }
.lawn-stage.no-3d .lawn-bottom { display: none; }

/* Scripts Be Vietnam Pro and Newsreader do not cover. The Latin fonts stay first
   so Latin words and digits keep the site's look; the Noto families (loaded per
   page by scripts/build.mjs) take the other glyphs. These scripts have no
   italics, no tight display leading and no letter-spacing. */
:lang(zh) {
  --font-body: "Be Vietnam Pro", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: "Newsreader", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --measure: 38em;
}
:lang(hi), :lang(ne) {
  --font-body: "Be Vietnam Pro", "Noto Sans Devanagari", "Kohinoor Devanagari", "Nirmala UI", system-ui, sans-serif;
  --font-display: "Newsreader", "Noto Serif Devanagari", "Kohinoor Devanagari", "Nirmala UI", serif;
}
:lang(zh) .ask { max-width: 20em; }
:lang(zh) .hero h1 em, :lang(hi) .hero h1 em, :lang(ne) .hero h1 em { font-style: normal; }
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(zh) .kicker, :lang(zh) .counter-n,
:lang(hi) h1, :lang(hi) h2, :lang(hi) h3, :lang(hi) .kicker, :lang(hi) .counter-n,
:lang(ne) h1, :lang(ne) h2, :lang(ne) h3, :lang(ne) .kicker, :lang(ne) .counter-n { letter-spacing: 0; }
:lang(hi) h1, :lang(ne) h1, :lang(hi) .lawn-top h1, :lang(ne) .lawn-top h1 { line-height: 1.25; }
:lang(hi) h2, :lang(ne) h2 { line-height: 1.3; }
:lang(hi) h3, :lang(ne) h3, :lang(hi) .ask, :lang(ne) .ask { line-height: 1.45; }
:lang(zh) h1, :lang(zh) .lawn-top h1 { line-height: 1.2; }
:lang(zh) h2 { line-height: 1.3; }
