:root {
  --ink: #0a0a0a;
  --paper: #fafaf8;
  --paper-raised: #ffffff;
  --red: #c1121f;
  --red-tint: #f3d9db;
  --petrol: #0d3b3e;
  --petrol-tint: #d7e3e2;
  --line: #dcdad4;
  --muted: #6b6a64;
  --focus: #0d3b3e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f2f1ec;
    --paper: #0c0c0b;
    --paper-raised: #171715;
    --red: #e0505d;
    --red-tint: #3a1518;
    --petrol: #6fa3a6;
    --petrol-tint: #10282a;
    --line: #2c2b27;
    --muted: #9c9a92;
    --focus: #6fa3a6;
  }
}

:root[data-theme="dark"] {
  --ink: #f2f1ec;
  --paper: #0c0c0b;
  --paper-raised: #171715;
  --red: #e0505d;
  --red-tint: #3a1518;
  --petrol: #6fa3a6;
  --petrol-tint: #10282a;
  --line: #2c2b27;
  --muted: #9c9a92;
  --focus: #6fa3a6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: "Space Grotesk", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  .stage-enter { animation: rise 0.5s ease both; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

button, input {
  font-family: inherit;
}

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: 560px;
}

.mark {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 28px;
}
.mark b { color: var(--ink); font-weight: 600; }

.stage { display: none; }
.stage.active { display: block; }

/* ---- intro ---- */
.intro h1 {
  font-size: clamp(30px, 6vw, 42px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
.intro p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 30px;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 3px;
  font-family: inherit;
  font-weight: 600;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  padding: 15px 26px;
  transition: transform 0.15s ease;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.meta-line {
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
  margin-top: 26px;
}
.meta-line span { display: flex; align-items: center; gap: 7px; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); flex: none; }

/* ---- question ---- */
.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 34px;
}
.progress-track {
  flex: 1;
  height: 2px;
  background: var(--line);
  position: relative;
  margin-right: 16px;
}
.progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--red);
  transition: width 0.35s ease;
}
.progress-count {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.q-text {
  font-size: clamp(22px, 4.4vw, 30px);
  line-height: 1.32;
  font-weight: 500;
  letter-spacing: -0.005em;
  margin: 0 0 40px;
  min-height: 110px;
}

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ans-btn {
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
  color: var(--ink);
  border-radius: 4px;
  padding: 20px 14px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ans-btn:hover { border-color: var(--ink); }
.ans-btn.yes:hover { border-color: var(--petrol); background: var(--petrol-tint); }
.ans-btn.no:hover { border-color: var(--red); background: var(--red-tint); }

.back-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-top: 30px;
}
.back-link:hover { color: var(--ink); }
.back-link[hidden] { display: none; }

/* ---- lead form ---- */
.lead h2 {
  font-size: clamp(26px, 5vw, 32px);
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.lead p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 28px;
  max-width: 42ch;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--paper-raised);
  color: var(--ink);
  font-size: 16px;
}
.field input:focus { border-color: var(--ink); }
.lead-error {
  color: var(--red);
  font-size: 13px;
  margin: -6px 0 16px;
  min-height: 16px;
}

/* ---- result ---- */
.result-eyebrow {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.result-name {
  font-size: clamp(38px, 8vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--red);
  margin: 0 0 16px;
  line-height: 1;
}
.result-lede {
  font-size: 18px;
  line-height: 1.55;
  max-width: 46ch;
  margin: 0 0 8px;
}
.result-body {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 32px;
}

.facts {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 40px;
}
.fact {
  border-left: 2px solid var(--line);
  padding-left: 16px;
}
.fact .fact-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}
.fact .fact-value {
  font-size: 15px;
  line-height: 1.55;
}

.chart-title {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 18px;
}
.bars { margin-bottom: 44px; }
.bar-row {
  display: grid;
  grid-template-columns: 108px 1fr 26px;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
}
.bar-track {
  height: 10px;
  background: var(--petrol-tint);
  border-radius: 2px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--petrol);
  opacity: 0.55;
  border-radius: 2px;
  transition: width 0.7s ease;
}
.bar-fill.top { background: var(--red); opacity: 1; }
.bar-score { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.bar-label.top { color: var(--ink); font-weight: 600; }

.divider {
  height: 1px;
  background: var(--line);
  margin: 0 0 36px;
}

.remar-quote {
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 16px;
}
.remar-question {
  font-size: 17px;
  line-height: 1.55;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 30px;
  max-width: 44ch;
}
.remar-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 36px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.remar-step {
  flex: 1 1 auto;
  min-width: 110px;
  padding: 16px 14px;
  border-right: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}
.remar-step:last-child { border-right: none; }
.remar-step small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  margin-top: 3px;
  font-size: 12.5px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}
.btn-cta {
  background: var(--petrol);
  color: #fdfdfb;
  padding: 16px 26px;
  font-size: 16px;
  text-decoration: none;
  border-radius: 3px;
  display: inline-block;
  transition: transform 0.15s ease;
}
.btn-cta:hover { transform: translateY(-1px); }

.restart {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.restart:hover { color: var(--ink); }

@media (max-width: 420px) {
  .answers { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 84px 1fr 22px; font-size: 12.5px; }
}
