/* Layout: one calm column, one idea per screen; the widening path is the only ornament. */
:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --fg: #052c49;          /* logo navy: headings, body */
  --muted: #5b6472;       /* secondary text */
  --blue: #075a8e;        /* buttons, bars, links */
  --sky: #a2def8;         /* calm panels, motif */
  --sky-soft: #e8f6fd;    /* panel ground */
  --orange: #e87605;      /* logo orange: progress, chosen outline */
  --line: #dce3ec;
  --on-blue: #ffffff;
  --track: #e6edf4;
  --focus: #e87605;
  --btn: #052c49;         /* primary button: logo navy */
  --scene-sky: #eaf6fd; --scene-ink: #052c49; --scene-far: #d3eefb; --scene-snow: #a2def8;
  --scene-sun: #e87605; --scene-path: #ffffff; --scene-marker: #ffffff;
  --font-display: 'Lora', Georgia, 'Times New Roman', serif;
  --font-body: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --radius: 10px;
  --step: 1.5rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo { background: #ffffff; border-radius: 10px; padding: 3px; }
  :root:not([data-theme="light"]) {
    --bg: #071626; --surface: #0d2238; --fg: #eef4f9; --muted: #a9b2c6;
    --blue: #5fb3e8; --sky: #a2def8; --sky-soft: #142a52; --orange: #f39a3e;
    --line: #21405e; --on-blue: #06102a; --track: #1b3550; --focus: #f39a3e; --btn: #a2def8; --scene-sky: #0a1d33; --scene-ink: #123d63; --scene-far: #0f2a47; --scene-snow: #5aa9d6; --scene-sun: #e87605; --scene-path: #d8ecf8; --scene-marker: #d8ecf8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] .brand-logo { background: #ffffff; border-radius: 10px; padding: 3px; }
:root[data-theme="dark"] {
  --bg: #071626; --surface: #0d2238; --fg: #eef4f9; --muted: #a9b2c6;
  --blue: #5fb3e8; --sky: #a2def8; --sky-soft: #142a52; --orange: #f39a3e;
  --line: #21405e; --on-blue: #06102a; --track: #1b3550; --focus: #f39a3e; --btn: #a2def8; --scene-sky: #0a1d33; --scene-ink: #123d63; --scene-far: #0f2a47; --scene-snow: #5aa9d6; --scene-sun: #e87605; --scene-path: #d8ecf8; --scene-marker: #d8ecf8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--blue); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 3.6vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
}
.topbar-inner {
  max-width: 760px; margin: 0 auto;
  padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; text-decoration: none; color: var(--fg); min-width: 0; }
.brand { gap: 12px; }
.brand-logo { height: 56px; width: auto; display: block; }
.brand-word { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; line-height: 1.2; color: var(--fg); }
@media (max-width: 420px) { .brand-word { font-size: 0.88rem; } .brand-logo { height: 48px; } }
@media (max-width: 480px) { .topbar-name { display: none; } }
.topbar-name { font-size: 0.85rem; color: var(--muted); letter-spacing: 0.02em; text-align: right; }
.progress { max-width: 760px; margin: 0 auto; padding: 0 20px 10px; display: flex; align-items: center; gap: 12px; }
.progress-track { flex: 1; height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--orange); border-radius: 99px; transition: width 180ms ease; }
.progress-label { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Main column ---------- */
main { flex: 1; outline: none; }
.wrap { max-width: 680px; margin: 0 auto; padding: 40px 20px 56px; display: flex; flex-direction: column; gap: var(--step); }
.eyebrow { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); font-weight: 500; }
.lead { font-size: 1.15rem; color: var(--fg); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------- Welcome ---------- */
.hero { display: flex; flex-direction: column; gap: 18px; }
.hero h1 em { font-style: italic; color: var(--blue); }
.scene-frame { border-radius: 18px; overflow: hidden; background: var(--scene-sky); box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(5, 44, 73, 0.55); }
.scene-frame svg { display: block; width: 100%; height: auto; }
.scene-hero { aspect-ratio: 1200 / 560; }
.scene-compact { aspect-ratio: 1200 / 420; }
.scene-compact svg { height: 100%; }
@media (max-width: 520px) { .scene-frame { border-radius: 14px; } .scene-compact { aspect-ratio: 1200 / 520; } }
.facts { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact { display: flex; flex-direction: column; }
.fact strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.fact span { font-size: 0.85rem; color: var(--muted); }
.isnt { display: grid; gap: 8px; padding-left: 0; margin: 0; list-style: none; }
.isnt li { padding-left: 22px; position: relative; color: var(--muted); }
.isnt li::before { content: ''; position: absolute; left: 4px; top: 0.75em; width: 8px; height: 2px; background: var(--sky); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  font: inherit; font-weight: 500; font-size: 1rem;
  border-radius: var(--radius); padding: 14px 24px; cursor: pointer;
  border: 2px solid var(--btn); background: var(--btn); color: var(--on-blue);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px;
}
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--btn); }
.btn-quiet:hover { background: var(--sky-soft); filter: none; }
.btn-link { background: none; border: none; color: var(--muted); padding: 8px 4px; min-height: 0; text-decoration: underline; text-underline-offset: 3px; }
.nav { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; }
@media (max-width: 520px) {
  .nav { flex-direction: column-reverse; }
  .nav .btn, .actions .btn { width: 100%; }
}

/* ---------- Statements ---------- */
.screen-head { display: flex; flex-direction: column; gap: 10px; }
.instruction { background: var(--sky-soft); border-radius: var(--radius); padding: 12px 16px; font-size: 0.95rem; }
.statement { border: 0; margin: 0; padding: 20px 0 4px; border-top: 1px solid var(--line); min-width: 0; }
.statement legend { float: left; width: 100%; font-weight: 500; padding: 0; margin-bottom: 14px; font-size: 1.05rem; }
.statement legend + * { clear: both; }
.statement { padding-bottom: 18px; }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 620px) { .scale { grid-template-columns: 1fr; } }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt label {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; font-size: 0.92rem; line-height: 1.3;
  transition: border-color 120ms, background 120ms;
}
@media (max-width: 620px) { .opt label { justify-content: flex-start; text-align: left; padding: 10px 16px; } }
.opt label:hover { border-color: var(--blue); }
.opt input:checked + label { border-color: var(--orange); background: var(--sky-soft); font-weight: 500; box-shadow: inset 0 0 0 1px var(--orange); }
.opt input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.optouts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; }
.optout input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.optout { position: relative; }
.optout label { font-size: 0.88rem; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 4px 2px; display: inline-block; }
.optout input:checked + label { color: var(--fg); font-weight: 500; text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
.optout input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Choice cards (stage, scenarios, priorities) ---------- */
.choices { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.choices legend { padding: 0; margin-bottom: 12px; font-weight: 500; }
.card-opt { position: relative; }
.card-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.card-opt label {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: start;
  padding: 16px 18px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer;
}
.card-opt label:hover { border-color: var(--blue); }
.card-opt input:checked + label { border-color: var(--orange); background: var(--sky-soft); box-shadow: inset 0 0 0 1px var(--orange); }
.card-opt input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.card-opt input[type="checkbox"] + label .tick { border-radius: 5px; }
.tick { width: 22px; height: 22px; border: 2px solid var(--muted); border-radius: 50%; margin-top: 2px; display: grid; place-items: center; }
.card-opt input:checked + label .tick { border-color: var(--orange); background: var(--orange); }
.card-opt input:checked + label .tick::after { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--surface); }
.card-title { font-weight: 500; }
.card-text { grid-column: 2; color: var(--muted); font-size: 0.95rem; }
.stone { display: inline-flex; gap: 4px; margin-right: 8px; vertical-align: middle; }
.stone i { width: 9px; height: 9px; border-radius: 50%; background: var(--track); display: block; }
.stone i.on { background: var(--blue); }

.scenario-card { background: var(--sky-soft); border-radius: var(--radius); padding: 20px; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.45; }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 500; }
.field input[type="text"], .field input[type="email"], .field textarea {
  font: inherit; font-size: 1rem; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--fg); width: 100%;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--blue); outline: 3px solid var(--sky); outline-offset: 0; }
.hint { font-size: 0.85rem; color: var(--muted); }
.consents { display: grid; gap: 12px; border: 0; padding: 0; margin: 0; }
.consent { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.consent input { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--blue); }
.error { color: var(--fg); background: var(--sky-soft); border-left: 3px solid var(--orange); padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.95rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Results ---------- */
.results-head { display: flex; flex-direction: column; gap: 12px; }
.section { display: flex; flex-direction: column; gap: 14px; padding-top: 28px; border-top: 1px solid var(--line); }
.bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 14px; align-items: center; }
@media (max-width: 520px) { .bar-row { grid-template-columns: 1fr; gap: 6px; } }
.bar-name { font-weight: 500; font-size: 0.98rem; }
.bar-track { height: 14px; background: var(--track); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--fg); border-radius: 99px; transition: width 400ms ease; }
.bar-na { font-size: 0.88rem; color: var(--muted); font-style: italic; }
.prose-block { display: grid; gap: 10px; }
.prose-block strong { font-weight: 500; }
.map-wrap { max-width: 520px; }
.map-wrap svg { width: 100%; height: auto; display: block; }
.map-caption { font-size: 0.88rem; color: var(--muted); }
.reflections { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.reflections li { display: grid; gap: 2px; }
.reflections .tag { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); font-weight: 500; }
.steps { display: grid; gap: 12px; }
.step { display: grid; gap: 6px; padding: 18px 20px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.step:first-child { border-color: var(--blue); }
.step a { font-weight: 500; }
.prompt-box { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.5; padding: 4px 0 4px 18px; border-left: 3px solid var(--sky); }
.help { background: var(--sky-soft); border-radius: var(--radius); padding: 20px 22px; display: grid; gap: 10px; }
.help ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.status-line { font-size: 0.92rem; color: var(--muted); }
.pilot { font-size: 0.92rem; color: var(--muted); }
.share-fallback { font-size: 0.9rem; word-break: break-all; background: var(--surface); border: 1px solid var(--line); padding: 8px 10px; border-radius: 6px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: 760px; margin: 0 auto; padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; }
.credit, .footer-links { font-size: 0.82rem; color: var(--muted); }

/* ---------- Privacy page ---------- */
.legal h2 { margin-top: 12px; }
.legal ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; }

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

@media print {
  .scene-frame { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar, .footer, .nav, .no-print { display: none !important; }
  body { background: #fff; color: #060642; font-size: 12pt; }
  .wrap { padding: 0; max-width: none; gap: 14px; }
  .section { padding-top: 14px; break-inside: avoid; }
  .bar-track { border: 1px solid #c9d3df; }
  .bar-fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .help, .instruction { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #060642; }
}
