@font-face {
  font-family: Outfit;
  src: url("../assets/fonts/Outfit.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Keen — mobile-first UI. Palette and type from Nova's brand pack. */
:root {
  --paper: #F6F7F9;
  --tint: #E8EBF2;
  --indigo: #2F3EF5;
  --indigo-deep: #2430C9;
  --indigo-soft: #EEF0FE;
  --ink: #12141A;
  --muted: #5C6170;
  --muted-2: #8A8F9C;
  --line: #D5DAE6;
  --white: #FFFFFF;
  --danger: #C0352B;
  --ok: #1F8A5B;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(18, 20, 26, 0.07);
  --header-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: Outfit, system-ui, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

body { padding: 0; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

button { cursor: pointer; background: none; border: none; }

.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;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: rgba(246, 247, 249, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.03em;
}
.brand:hover { text-decoration: none; }
.brand img, .brand svg, .brand .mark {
  width: 28px; height: 28px; flex: 0 0 28px;
}

.timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--tint);
  border-radius: 999px;
  padding: 6px 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.timer.warn { color: var(--danger); border-color: #f3c4c1; background: #fdf4f3; }
.timer svg { width: 14px; height: 14px; }

.progress {
  height: 3px;
  background: var(--tint);
  width: 100%;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--indigo);
  width: 0%;
  transition: width 0.25s ease;
}

/* ---------- Layout ---------- */
.main {
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 24px 20px calc(32px + var(--safe-bot));
}

.main.wide { max-width: 440px; }

.center { text-align: center; }

h1, h2, h3 { letter-spacing: -0.035em; font-weight: 650; line-height: 1.15; }
h1 { font-size: 36px; }
h2 { font-size: 26px; }
h3 { font-size: 18px; }

.lede {
  color: var(--muted);
  font-size: 17px;
  margin-top: 10px;
}

.kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo);
  margin-bottom: 8px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; color: var(--muted); line-height: 1.45; }
.legal-note { font-size: 12px; color: var(--muted-2); line-height: 1.45; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--indigo);
  color: var(--white);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--indigo-deep); text-decoration: none; }
.btn:active { transform: scale(0.99); }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--tint); }

.btn-soft {
  background: var(--indigo-soft);
  color: var(--indigo);
}
.btn-soft:hover { background: #e0e4fd; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.link-btn {
  display: inline-block;
  margin-top: 14px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  width: auto;
  min-height: auto;
  padding: 0;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--tint);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.hero-mark {
  width: 56px;
  height: 56px;
  margin: 12px auto 20px;
}

/* ---------- Landing ---------- */
.hero { padding-top: 20px; text-align: center; }
.hero h1 { margin-bottom: 8px; }
.hero .lede { margin-bottom: 28px; }

.section { margin-top: 48px; }
.section h2 { margin-bottom: 16px; }

.steps { display: flex; flex-direction: column; gap: 12px; }
.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--tint);
  border-radius: 16px;
  padding: 16px;
}
.step-num {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--indigo);
  color: #fff;
  font-weight: 650;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step strong { display: block; font-weight: 650; letter-spacing: -0.02em; }
.step p { color: var(--muted); font-size: 14px; margin-top: 2px; }

.skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.skill {
  background: var(--white);
  border: 1px solid var(--tint);
  border-radius: 16px;
  padding: 16px 14px;
  text-align: left;
}
.skill:last-child:nth-child(odd) { grid-column: 1 / -1; }
.skill .icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--indigo-soft);
  color: var(--indigo);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.skill .icon svg { width: 18px; height: 18px; }
.skill strong { display: block; font-size: 14px; letter-spacing: -0.02em; }
.skill p { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Reviews empty state */
.reviews-empty {
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
}
.stars-outline { letter-spacing: 4px; font-size: 22px; color: var(--line); margin-bottom: 8px; }
.reviews-list { display: flex; flex-direction: column; gap: 10px; }
.review-card {
  background: var(--white);
  border: 1px solid var(--tint);
  border-radius: 16px;
  padding: 16px;
  text-align: left;
}
.review-card .stars { color: var(--indigo); letter-spacing: 2px; font-size: 14px; }
.review-card p { margin-top: 6px; font-size: 14px; }
.review-card .meta { margin-top: 8px; font-size: 12px; color: var(--muted-2); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details {
  background: var(--white);
  border: 1px solid var(--tint);
  border-radius: 14px;
  padding: 0 16px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding: 14px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 14px; color: var(--muted); font-size: 14px; }

.footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--tint);
  text-align: center;
}
.footer-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 10px 0; }
.footer-links a, .footer-links button { color: var(--muted); font-size: 13px; }
.disclaimer {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.45;
}

/* ---------- Prep / interstitial ---------- */
.checklist { list-style: none; margin: 20px 0 28px; text-align: left; }
.checklist li {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--tint);
  font-size: 15px;
}
.checklist li:last-child { border-bottom: 0; }
.check {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--indigo-soft);
  color: var(--indigo);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  margin-top: 1px;
}

/* ---------- Test ---------- */
.prompt {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin: 8px 0 20px;
  text-align: center;
}

.memorise-word, .memorise-digits {
  background: var(--white);
  border: 1px solid var(--tint);
  border-radius: var(--radius);
  padding: 36px 16px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.memorise-word .word {
  font-size: 40px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.memorise-digits .digits {
  font-size: 32px;
  font-weight: 650;
  letter-spacing: 0.28em;
  font-variant-numeric: tabular-nums;
}

/* Matrix */
.matrix-wrap {
  background: var(--white);
  border: 1px solid var(--tint);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.m-cell {
  aspect-ratio: 1;
  background: var(--paper);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.m-cell svg { width: 86%; height: 86%; }
.m-cell.missing {
  background: var(--indigo-soft);
  color: var(--indigo);
  font-weight: 650;
  font-size: 28px;
}

.options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.opt {
  aspect-ratio: 1;
  background: var(--white);
  border: 2px solid var(--tint);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}
.opt svg { width: 88%; height: 88%; }
.opt:hover { border-color: #b8bfe0; }
.opt:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.opt.picked {
  border-color: var(--indigo);
  background: var(--indigo-soft);
  transform: scale(0.98);
}

/* Text / multiple choice options */
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 2px solid var(--tint);
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.choice:hover { border-color: #b8bfe0; }
.choice.picked { border-color: var(--indigo); background: var(--indigo-soft); }
.choice .label {
  display: inline-flex;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--tint);
  font-size: 12px;
  font-weight: 650;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  vertical-align: middle;
}
.choice.picked .label { background: var(--indigo); color: #fff; }

/* Spatial options also use .options */

.test-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 8px;
}
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}
.nav-back:disabled { opacity: 0.3; cursor: default; }
.q-count {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Halfway */
.halfway {
  text-align: center;
  padding-top: 48px;
}
.halfway .big {
  font-size: 48px;
  font-weight: 650;
  letter-spacing: -0.04em;
  color: var(--indigo);
  margin: 8px 0 12px;
}

/* ---------- Calculating ---------- */
.calc { text-align: center; padding-top: 24px; }
.calc h1 { font-size: 28px; margin-bottom: 8px; }
.skill-bars { margin-top: 28px; text-align: left; display: flex; flex-direction: column; gap: 16px; }
.skill-bar label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.skill-bar label span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.bar {
  height: 10px;
  background: var(--tint);
  border-radius: 999px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--indigo);
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Forms ---------- */
.field { margin: 18px 0; text-align: left; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  height: 52px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  padding: 0 14px;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(47, 62, 245, 0.15);
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.seg button, .seg-wide button {
  height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  font-weight: 550;
}
.seg button.on, .seg-wide button.on {
  border-color: var(--indigo);
  background: var(--indigo-soft);
  color: var(--indigo);
  font-weight: 650;
}
.seg-wide { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-wide button { padding: 0 12px; flex: 1 1 30%; min-width: 72px; }

/* ---------- Teaser / paywall / result ---------- */
.score-band {
  font-size: 42px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 8px 0 12px;
}
.iq-number {
  font-size: 88px;
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 8px 0;
}
.iq-blur {
  filter: blur(14px);
  user-select: none;
  pointer-events: none;
}
.blur-wrap {
  position: relative;
  margin: 16px 0 8px;
}
.blur-wrap .lock-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  font-weight: 650;
  font-size: 14px;
  color: var(--ink);
  background: linear-gradient(to bottom, transparent, rgba(246,247,249,0.2), transparent);
}

.pct { font-size: 16px; color: var(--muted); margin-bottom: 20px; }

.scale {
  position: relative;
  height: 8px;
  background: linear-gradient(90deg, #c9cde0, var(--indigo));
  border-radius: 999px;
  margin: 28px 0 8px;
}
.scale .tick {
  position: absolute;
  top: -6px;
  width: 3px;
  height: 20px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-50%);
}
.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.bump {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--white);
  border: 1.5px solid var(--tint);
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  margin: 16px 0;
  cursor: pointer;
}
.bump.on { border-color: var(--indigo); background: var(--indigo-soft); }
.bump input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--indigo); flex: 0 0 20px; }
.bump strong { display: block; font-size: 15px; letter-spacing: -0.02em; }
.bump p { font-size: 13px; color: var(--muted); margin-top: 2px; }

.price-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 650;
  margin: 12px 0 4px;
}
.price-line .amt { font-size: 22px; letter-spacing: -0.03em; }

.includes { list-style: none; margin: 12px 0 16px; text-align: left; }
.includes li {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
}
.includes li::before { content: "✓"; color: var(--indigo); font-weight: 700; }

/* Stripe stub modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 20, 26, 0.45);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--white);
  border-radius: 24px 24px 16px 16px;
  padding: 24px 20px calc(20px + var(--safe-bot));
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 50px rgba(18,20,26,.2);
}
.modal h2 { margin-bottom: 8px; }
.stripe-fake {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0 16px;
  font-size: 13px;
  color: var(--muted);
  background: var(--paper);
}

/* Result extras */
.share-preview {
  margin: 20px 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--tint);
  background: var(--ink);
}
.share-preview canvas, .share-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.stars-input { display: flex; gap: 6px; justify-content: center; margin: 12px 0; }
.stars-input button {
  font-size: 28px;
  color: var(--line);
  padding: 4px;
  line-height: 1;
}
.stars-input button.on { color: var(--indigo); }

textarea {
  width: 100%;
  min-height: 88px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  resize: vertical;
  background: var(--white);
}
textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(47, 62, 245, 0.15);
}

/* Legal */
.legal h1 { font-size: 28px; margin-bottom: 8px; }
.legal h2 { font-size: 18px; margin: 24px 0 8px; }
.legal p, .legal li { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.legal ul { padding-left: 18px; }
.placeholder {
  background: #fff7e6;
  border: 1px solid #f0d9a0;
  color: #6a4e00;
  border-radius: 8px;
  padding: 1px 6px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

/* Debug / preview bar */
.devbar {
  position: sticky;
  bottom: 0;
  background: #12141A;
  color: #fff;
  font-size: 11px;
  padding: 6px 10px;
  display: flex;
  gap: 8px;
  overflow: auto;
  z-index: 30;
}
.devbar a { color: #9db0ff; white-space: nowrap; }

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