/* Sikap public site. The plan is docs/DESIGN-REDO-2026-09-19.md.
   Order: fonts, tokens, base type, layout, the hero, sections, country pages, the plan builder, forms,
   dark theme, reduced motion, phones, print. */

@font-face {
  font-family: "Maragsa";
  src: url("/assets/fonts/Maragsa-Display.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2018-201A, U+201C-201E, U+2026;
}
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Tokens */
:root {
  --chalk: #FBFBF9;
  --ink: #0E1B2A;
  --slate: #5B6470;
  --sun: #E9A825;
  --bg: var(--chalk);
  --fg: var(--ink);
  --fg-2: var(--slate);
  --line: rgba(14, 27, 42, .12);
  --field: rgba(14, 27, 42, .045);
  --card: rgba(251, 251, 249, .88);
  --dot: var(--ink);
  --ok: #157A5B;
  --bad: #B42318;
  --display: "Maragsa", Georgia, "Times New Roman", serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --header: 56px;
  --max: 1120px;
  --gutter: 24px;
  --measure: 62ch;
  --edge: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  color-scheme: light;
}
:root.is-dark {
  --bg: #0E1B2A;
  --fg: #F3F1EA;
  --fg-2: #A9B0BA;
  --line: rgba(243, 241, 234, .16);
  --field: rgba(243, 241, 234, .07);
  --card: rgba(14, 27, 42, .88);
  --dot: #F3F1EA;
  --ok: #6FD3A8;
  --bad: #F0857A;
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.55 var(--sans);
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-weight: 400; }
h1, h2 { font-family: var(--display); letter-spacing: -.005em; }
h1 { font-size: clamp(53px, 7vw, 83px); line-height: 1; }
h2 { font-size: clamp(34px, 3.4vw, 42px); line-height: 1.1; }
h3 { font-family: var(--sans); font-weight: 600; font-size: 21px; line-height: 1.3; }
p, ul, ol { margin: 0; }
p { max-width: var(--measure); }
p + p { margin-top: 12px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .16em; }
a:hover { text-decoration-color: var(--sun); text-decoration-thickness: 2px; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(233, 168, 37, .35); }
time { white-space: nowrap; }
.small, .source, .legal, .muted, small { font-size: 15px; line-height: 1.5; }
.source, .muted { color: var(--fg-2); }
.legal { color: var(--fg-2); max-width: 70ch; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.mt { margin-top: 32px; }
.mt-s { margin-top: 12px; }

/* Layout */
.wrap { max-width: var(--max); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; padding: 8px 12px; background: var(--fg); color: var(--bg); border-radius: 8px; }
.skip:focus { top: 8px; }
.site-header {
  position: sticky; top: 0; z-index: 10;
  height: var(--header);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--bg);
}
.wordmark { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.wordmark svg { display: block; height: 22px; width: auto; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.nav a { text-decoration: none; }
.nav a:hover, .nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 2px; }
#theme-toggle {
  font: inherit; font-size: 15px; color: inherit;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; min-height: 30px;
}
#theme-toggle:hover { border-color: var(--fg); }

main { display: block; }
.section { padding-top: 88px; }
.section:last-child { padding-bottom: 96px; }
.section > h2 + p, .section > h1 + p { margin-top: 16px; }
.site-footer { padding: 56px 0 48px; font-size: 15px; color: var(--fg-2); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 12px; max-width: none; }
.site-footer a { color: inherit; }

/* Buttons and fields */
.button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px;
  border: 1px solid var(--fg); border-radius: 8px;
  background: var(--fg); color: var(--bg);
  font: 600 17px/1.2 var(--sans); text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.button:hover, .btn:hover { background: var(--fg-2); border-color: var(--fg-2); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--fg); }
.btn.secondary:hover { background: var(--field); color: var(--fg); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 15px; }
.button:disabled, .btn:disabled { opacity: .55; cursor: default; }
input[type="email"], input[type="text"], input[type="month"], select {
  width: 100%; max-width: 480px; min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--field); color: inherit;
  font: inherit;
}
input:focus-visible, select:focus-visible { outline-offset: 0; border-color: var(--fg); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--fg); width: 18px; height: 18px; margin: 0; flex: none; }

/* The hero: the world is the page */
.hero { position: relative; height: 280vh; }
.hero-stage { position: sticky; top: var(--header); height: calc(100vh - var(--header)); overflow: hidden; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.hero-copy {
  position: absolute; z-index: 2;
  left: var(--edge); top: clamp(24px, 8vh, 96px);
  max-width: 360px;
  transition: opacity .25s ease;
}
.hero-copy h1 { font-size: clamp(40px, 6.4vw, 83px); }
.hero-copy p { margin-top: 20px; font-size: 19px; line-height: 1.4; max-width: 22ch; }
.hero-copy .button { margin-top: 28px; }
#hero[data-stage-band="1"] .hero-copy,
#hero[data-stage-band="2"] .hero-copy,
#hero[data-stage-band="3"] .hero-copy { opacity: 0; pointer-events: none; }
.steps {
  position: absolute; z-index: 2;
  left: var(--edge); bottom: clamp(24px, 10vh, 120px);
  width: min(400px, calc(100vw - 2 * var(--gutter)));
  list-style: none; margin: 0; padding: 0;
}
.step { position: absolute; left: 0; bottom: 0; width: 100%; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.step h2 { font-size: clamp(34px, 3.8vw, 53px); }
.step p { margin-top: 12px; font-size: 19px; line-height: 1.4; }
#hero[data-stage-band="1"] .step[data-step="1"],
#hero[data-stage-band="2"] .step[data-step="2"],
#hero[data-stage-band="3"] .step[data-step="3"] { opacity: 1; pointer-events: auto; }
.globe-card {
  position: absolute; z-index: 3;
  width: max-content; max-width: 280px;
  padding: 16px 18px 14px;
  background: var(--card);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 2px 4px rgba(14, 27, 42, .06), 0 14px 32px -10px rgba(14, 27, 42, .28);
  font-size: 15px; line-height: 1.45;
  pointer-events: none;
}
.globe-card { max-width: 320px; }
.globe-card .card-name { display: block; font: 400 27px/1 var(--display); margin-bottom: 10px; }
.globe-card .card-line { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 0 10px; font-size: 14px; line-height: 1.4; }
.globe-card .card-line + .card-line { margin-top: 3px; }
.globe-card .card-k { color: var(--fg-2); }
.globe-card .card-v { color: var(--fg); }
.globe-card .card-v.none { color: var(--fg-2); }
.globe-card .card-open { display: inline-block; margin-top: 10px; font-weight: 600; }
/* The "At a glance" table on the country page: no borders, a hairline between rows, values right aligned */
.glance { width: 100%; max-width: 800px; margin-top: 24px; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.glance th, .glance td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.glance th { font-weight: 400; color: var(--fg-2); width: 34%; padding-right: 16px; }
.glance td { text-align: right; }
.glance td.src { width: 36%; padding-left: 16px; font-size: 13px; color: var(--fg-2); white-space: nowrap; }
.glance td.src a { color: inherit; }
@media (max-width: 760px) {
  .glance, .glance tbody, .glance tr, .glance th, .glance td { display: block; }
  .glance tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .glance th, .glance td { border: 0; padding: 0; width: auto; text-align: left; }
  .glance th { font-size: 13px; }
  .glance td.src { white-space: normal; padding-left: 0; }
}
.globe-card p { max-width: none; }
.globe-card a { pointer-events: auto; }
/* Without the canvas (no JavaScript, no canvas support, fetch failed): a plain page */
.hero.no-world, .hero.static { height: auto; }
.hero.no-world .hero-stage, .hero.static .hero-stage { position: static; height: auto; overflow: visible; padding: 32px var(--edge) 0; }
.hero.no-world #world, .hero.static #world { display: none; }
.hero.no-world .hero-copy, .hero.static .hero-copy,
.hero.no-world .steps, .hero.static .steps { position: static; width: auto; max-width: 560px; opacity: 1; pointer-events: auto; }
.hero.no-world .steps, .hero.static .steps { margin-top: 48px; display: grid; gap: 32px; }
.hero.no-world .step, .hero.static .step { position: static; opacity: 1; pointer-events: auto; }
.hero-fallback { margin-top: 24px; }

/* Figures, chains, names */
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 36px; }
.figure { display: block; font-family: var(--display); font-size: clamp(42px, 5vw, 66px); line-height: 1; }
.figure.none { font-family: var(--sans); font-size: 21px; color: var(--fg-2); padding-top: .4em; }
.figure-label { display: block; margin-top: 10px; }
.figures .source, .figures .small { display: block; margin-top: 8px; }
.chain { list-style: decimal; margin: 28px 0 0; padding-left: 1.7em; display: grid; gap: 14px; max-width: 800px; }
.chain.other { list-style: none; padding-left: 0; }
.chain li { padding-left: 6px; }
.chain.other li { padding-left: 0; }
.chain li::marker { font-family: var(--display); font-size: 21px; color: var(--fg-2); }
.chain .line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; align-items: baseline; }
.chain .line .source { text-align: right; }
.names { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 32px; }
.names a { display: inline-block; font-family: var(--display); font-size: clamp(27px, 2.6vw, 34px); line-height: 1.05; text-decoration: none; }
.names a:hover { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 3px; text-underline-offset: .12em; }
.names small { display: block; margin-top: 6px; color: var(--fg-2); }
.notes { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; max-width: 800px; }
.sources { margin: 20px 0 0; padding-left: 1.2em; display: grid; gap: 8px; font-size: 15px; color: var(--fg-2); max-width: 800px; }
.sources a { color: inherit; }
.status:empty { display: none; }
.status.err { color: var(--bad); }
.status.ok { color: var(--ok); }

/* The letter form */
.signup { display: grid; gap: 14px; max-width: 520px; margin-top: 28px; }
.signup label { font-weight: 600; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile:empty { display: none; }

/* The plan builder */
.ob { max-width: 720px; padding: 48px 0 96px; }
.ob-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; font-size: 15px; color: var(--fg-2); }
.ob-progress .bar { flex: 1; height: 2px; background: var(--line); }
.ob-progress .bar i { display: block; height: 100%; width: 0; background: var(--fg); transition: width .3s ease; }
.ob-screen h1 { font-size: clamp(42px, 5vw, 66px); }
.ob-screen h2 { font-size: clamp(34px, 4vw, 42px); }
.ob-screen h1 + p, .ob-screen h2 + p { margin-top: 12px; }
.ob-screen * + h2 { margin-top: 44px; }
.ob-screen h3 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.05; margin-top: 24px; }
.ob-screen .help { margin-top: 12px; color: var(--fg-2); }
.ob-screen .unlock { margin-top: 16px; font-size: 15px; color: var(--fg-2); }
.ob-screen input[type="month"], .ob-screen select { margin-top: 24px; }
.choices { display: grid; gap: 10px; margin-top: 28px; }
.choices label {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.choices label:hover { border-color: var(--fg-2); }
.choices label:has(:checked) { border-color: var(--fg); background: var(--field); }
.choices input { margin-top: 3px; }
.choices .sub { display: block; margin-top: 4px; font-size: 15px; color: var(--fg-2); }
.actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 36px; }
.actions > span { display: flex; flex-wrap: wrap; gap: 12px; }
.tip { position: relative; display: inline; }
.tip > button { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline dotted; text-underline-offset: .16em; cursor: help; }
.tip-body {
  display: none; position: absolute; left: 0; top: 100%; z-index: 5;
  width: min(320px, 80vw); margin-top: 6px; padding: 10px 12px;
  background: var(--card); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 8px; box-shadow: 0 8px 24px -8px rgba(14, 27, 42, .35);
  font-size: 15px; line-height: 1.45; color: var(--fg);
}
.tip.open .tip-body { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 12px; border-radius: 999px; background: var(--field); font-size: 15px; }
.chip button { border: 0; background: none; font: inherit; font-size: 17px; line-height: 1; color: var(--fg-2); padding: 0 2px; }
.chip button:hover { color: var(--fg); }
.card { padding: 8px 0; }
.card + .card { margin-top: 40px; }
.card h3 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.05; }
.pill { font-family: var(--sans); font-size: 15px; font-weight: 400; color: var(--fg-2); }
.timeline { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; align-items: baseline; }
.timeline .d { font-family: var(--display); font-size: 21px; line-height: 1.2; white-space: nowrap; }
.timeline .cite { display: block; font-size: 15px; color: var(--fg-2); }
.review { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 0; }
.review li { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); }
.review li:last-child { border-bottom: 1px solid var(--line); }
.plan { display: grid; gap: 40px; margin-top: 28px; }
/* Plan builder skin: the "?" toggle beside a word, and two columns of chips on wide screens */
.tip > button.tip-q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: 4px; vertical-align: middle;
  border: 1px solid var(--line); border-radius: 999px; background: none;
  font: 600 13px/1 var(--sans); color: var(--fg-2); text-decoration: none; cursor: help;
}
.tip > button.tip-q:hover, .tip.open > button.tip-q { border-color: var(--fg); color: var(--fg); }
.tip > .tip-word { text-decoration: underline dotted; text-underline-offset: .16em; }
.ob-screen .ob-skip { font-size: 15px; align-self: center; }
.ob-screen fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ob-screen .choices label span { min-width: 0; }
@media (min-width: 761px) { .choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.notice { padding: 12px 16px; border-radius: 8px; background: var(--field); font-size: 15px; max-width: 70ch; }
.notice.info { background: rgba(233, 168, 37, .14); }
.protect { font-size: 15px; color: var(--fg-2); }
.checklist {
  position: fixed; right: 16px; bottom: 16px; z-index: 6;
  width: min(300px, calc(100vw - 32px));
  padding: 16px 18px;
  background: var(--card); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 14px 32px -10px rgba(14, 27, 42, .28);
  font-size: 15px;
}
.checklist ol { margin: 8px 0 0; padding-left: 1.4em; }
.checklist li { padding: 2px 0; }
.checklist li.done { color: var(--fg-2); text-decoration: line-through; }
.checklist li.now, .checklist li.current { font-weight: 600; }
.checklist .close { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--fg-2); padding: 4px 8px; }
.checklist .close:hover { color: var(--fg); }

/* Reduced motion: no sticky choreography, everything visible */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
  .hero { height: auto; }
  .hero-stage { position: static; height: auto; overflow: visible; padding: 32px var(--edge) 0; }
  #world { position: relative; height: min(70vh, 640px); }
  .hero-copy, .steps { position: static; width: auto; max-width: 560px; opacity: 1 !important; pointer-events: auto !important; }
  .hero-copy { margin-bottom: 16px; }
  .steps { margin-top: 48px; display: grid; gap: 32px; }
  .step { position: static; opacity: 1 !important; pointer-events: auto !important; }
}

/* Phones and narrow screens */
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .nav { gap: 14px; font-size: 14px; }
  .wordmark svg { height: 20px; }
  /* The copy sits on top, the globe in a square box under it, nothing clipped. */
  .hero-stage { display: flex; flex-direction: column; overflow: visible; }
  .hero-copy { order: -1; position: static; max-width: none; padding: 12px var(--gutter) 0; }
  #world { order: 0; flex: none; position: relative; inset: auto; width: 94vw; height: 94vw; margin: 16px auto 0; }
  .hero-copy h1 { font-size: 40px; }
  .hero-copy p { margin-top: 12px; font-size: 17px; max-width: 26ch; }
  .hero-copy .button { margin-top: 18px; }
  .steps { bottom: 24px; width: calc(100vw - 2 * var(--gutter)); }
  .step h2 { font-size: 34px; }
  .step p { font-size: 17px; }
  .globe-card { max-width: min(280px, calc(100vw - 32px)); }
  .section { padding-top: 64px; }
  .section:last-child { padding-bottom: 72px; }
  .figures { grid-template-columns: 1fr; gap: 24px; }
  .names { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
  .chain .line { grid-template-columns: 1fr; gap: 2px; }
  .chain .line .source { text-align: left; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .review li { grid-template-columns: 1fr; gap: 4px; }
  .ob { padding-top: 32px; }
  /* On a phone the fixed checklist would cover the Next button, so it sits under the form instead. */
  .checklist { position: static; width: auto; margin: 24px var(--gutter) 0; }
}

/* Print: the plan on paper */
@media print {
  .site-header, .site-footer, .checklist, .actions, .ob-progress, #world, .steps, .skip, #theme-toggle { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a { text-decoration: none; }
  .hero { height: auto; }
}
