:root {
  --bg: #0C0F1E;
  --surface: #131736;
  --surface2: #1A1F45;
  --border: #272D58;
  --text: #EEEEF2;
  --text-secondary: #C8C8D4;
  --text-dim: #9494A8;
  --text-muted: #6B6B82;
  --accent: #8B6CC1;
  --accent-light: #A78BDB;
  --accent-dim: rgba(139, 108, 193, 0.14);
  --coral: #D4A843;
  --coral-light: #E4BE6A;
  --coral-dim: rgba(212, 168, 67, 0.14);
  --green: #7C9A72;
  --nav-bg: rgba(12, 15, 30, 0.75);
  --nav-border: rgba(255, 255, 255, 0.06);
  --h1-color: #fff;
  --gradient-text: linear-gradient(135deg, var(--accent-light), var(--coral));
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.4);
  --transition-theme: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

html.light {
  --bg: #FAF8F5;
  --surface: #F3F0EB;
  --surface2: #EBE7E0;
  --border: #DDD8CE;
  --text: #1C1826;
  --text-secondary: #3B3548;
  --text-dim: #5C5470;
  --text-muted: #7A7490;
  --accent: #3D6B3D;
  --accent-light: #4A7A4A;
  --accent-dim: rgba(74, 122, 74, 0.10);
  --coral: #B8942E;
  --coral-light: #D4A843;
  --coral-dim: rgba(184, 148, 46, 0.10);
  --green: #4A7A4A;
  --nav-bg: rgba(250, 248, 245, 0.75);
  --nav-border: rgba(0, 0, 0, 0.06);
  --h1-color: #1C1826;
  --gradient-text: linear-gradient(135deg, var(--accent), var(--coral));
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 8px 32px rgba(0,0,0,0.1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  transition: var(--transition-theme);
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--coral);
  color: #2A1D06;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
  font-weight: 600;
}
.skip:focus { top: 12px; }

.container { width: min(920px, calc(100% - 40px)); margin: 0 auto; }
.container-wide { width: min(1100px, calc(100% - 40px)); margin: 0 auto; }

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); transform: scale(1.05); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html.light .theme-toggle .icon-sun { display: block; }
html.light .theme-toggle .icon-moon { display: none; }

nav {
  padding: 12px 0;
  border-bottom: 1px solid var(--nav-border);
  position: sticky;
  top: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  z-index: 20;
}
nav .container, nav .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  transition: opacity 0.2s;
}
.logo:hover { opacity: 0.8; }
.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  background: #0C0F1E;
  padding: 4px;
  flex-shrink: 0;
}
.logo-text { color: var(--text); }
.logo-text span { color: var(--accent-light); }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a:not(.cta-btn) {
  font-size: 14px;
  color: var(--text-dim);
  transition: color 0.2s;
}
.nav-links a:not(.cta-btn):hover { color: var(--text); }

.cta-btn, .btn-primary, .btn-secondary, .choice-btn, .text-btn {
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}

.cta-btn, .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  background: var(--coral);
  color: #2A1D06;
  border: 2px solid var(--coral-light);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.cta-btn:hover, .btn-primary:hover {
  transform: translateY(-1px);
  border-color: #fff;
  box-shadow: 0 4px 24px rgba(212, 168, 67, 0.4);
}
.cta-btn:active, .btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary, .text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.btn-secondary:hover, .text-btn:hover { border-color: var(--accent); background: var(--accent-dim); }
.text-btn { border: 0; color: var(--text-dim); min-height: 44px; }
.text-btn:hover { color: var(--text); background: var(--accent-dim); }
.text-btn:disabled { opacity: 0.4; cursor: not-allowed; }

main { padding: 32px 0 80px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--coral-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--coral); }

h1 {
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--h1-color);
  margin-bottom: 18px;
  max-width: 18ch;
}

.lead {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 62ch;
  margin-bottom: 24px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 28px;
}
.meta-row span { display: inline-flex; align-items: center; gap: 6px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.hero-grid {
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 36px;
  align-items: start;
  padding: 28px 0 48px;
}
.hero-copy {
  min-width: 0;
  transition: opacity 0.28s ease;
}
#startForm {
  justify-self: stretch;
  width: 100%;
  margin-left: 0;
  position: relative;
  z-index: 1;
  transition:
    width 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    margin-left 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s ease;
}

@media (min-width: 841px) {
  .hero-grid:has(#startForm:focus-within) #startForm,
  .hero-grid:has(#startForm.is-expanded) #startForm {
    width: 100cqi;
    margin-left: calc(100% - 100cqi);
    box-shadow: var(--shadow-card-hover);
  }
  .hero-grid:has(#startForm:focus-within) .hero-copy,
  .hero-grid:has(#startForm.is-expanded) .hero-copy {
    opacity: 0;
    pointer-events: none;
  }
}

@media (min-width: 841px) and (hover: hover) {
  .hero-grid:has(#startForm:hover) #startForm {
    width: 100cqi;
    margin-left: calc(100% - 100cqi);
    box-shadow: var(--shadow-card-hover);
  }
  .hero-grid:has(#startForm:hover) .hero-copy {
    opacity: 0;
    pointer-events: none;
  }
}

.dichotomy-grid, .steps {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.dichotomy-grid { grid-template-columns: 1fr 1fr; }
.steps { grid-template-columns: repeat(3, 1fr); }

.pair, .step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.pair strong, .step strong { display: block; margin-bottom: 6px; }
.pair p, .step p { color: var(--text-dim); font-size: 14px; }

.section { margin: 48px 0; }
.section h2 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 8px; }
.section > p { color: var(--text-dim); max-width: 62ch; }

.disclaimer {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 62ch;
  margin-top: 24px;
}

label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
textarea { min-height: 88px; resize: vertical; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-dim);
}
.check-row input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.error {
  color: #f87171;
  font-size: 14px;
  margin: 8px 0;
}

.continue-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--accent-dim);
}
.continue-banner[hidden] { display: none; }

/* Quiz */
.quiz-shell { max-width: 720px; margin: 0 auto; padding-top: 12px; }
.progress-wrap { margin-bottom: 28px; }
.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.progress-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--surface2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--coral));
  border-radius: 99px;
  transition: width 0.2s ease;
}
.prompt {
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
}
.choices { display: grid; gap: 12px; }
.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  min-height: 64px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.choice-label { min-width: 0; }
.choice-btn:hover { border-color: var(--accent); background: var(--accent-dim); }
.choice-btn:active { transform: scale(0.99); }
.choice-btn[aria-pressed="true"] {
  border-color: var(--coral);
  background: var(--coral-dim);
  box-shadow: inset 0 0 0 1px var(--coral);
}
.choice-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.choice-key {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  gap: 12px;
}
.quiz-save {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  justify-items: start;
}
.kbd-hint { font-size: 13px; color: var(--text-muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Result */
.reading {
  min-height: 40vh;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
}
.reading p { color: var(--text-dim); }
.dots { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  animation: pulse 1.2s ease-in-out infinite;
}
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
}

.result-hero { text-align: left; margin-bottom: 28px; }
.result-hero h1 { max-width: none; margin-bottom: 10px; }
.oa-pills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.oa-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text-dim);
}
.oa-pill strong { color: var(--text); font-size: 13px; }

.block { margin: 22px 0; }
.block h2 { font-size: 18px; margin-bottom: 8px; }
.block p { color: var(--text-secondary); max-width: 66ch; }
.industry-tip {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-dim);
  color: var(--text-secondary);
  font-size: 14px;
}
.fiction { color: var(--text-dim); font-size: 14px; }
.fiction ul { margin: 8px 0 0 18px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--text-dim);
  font-size: 13px;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a:hover { color: var(--text); }

@media (max-width: 840px) {
  .hero-grid, .dichotomy-grid, .steps, .field-row { grid-template-columns: 1fr; }
  h1 { max-width: none; }
  .hide-mobile { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .progress-fill { transition: none; }
}
