/* ============================================================
   TOKENS — bright, deliberately not the steen.fyi identity.
   White ground, near-black ink (Apple's own text gray), and a
   single vivid accent per screen drawn from Apple's own system
   palette — cycled question to question rather than blended into
   a gradient hero.
   ============================================================ */

:root {
  --paper:      #FFFFFF;
  --paper-sunk: #F5F5F7;
  --ink:        #1D1D1F;
  --ink-muted:  #6E6E73;
  --hairline:   rgba(0,0,0,.08);

  --accent:     #0A84FF;
  --accent-ink: #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -12px rgba(0,0,0,.10);
  --shadow-lg: 0 24px 70px -24px rgba(0,0,0,.28);

  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-text:    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', system-ui, sans-serif;

  --ease-spring: cubic-bezier(.22,1,.36,1);
}

:root[data-accent="blue"]   { --accent: #0A84FF; }
:root[data-accent="pink"]   { --accent: #FF375F; }
:root[data-accent="orange"] { --accent: #FF9F0A; }
:root[data-accent="green"]  { --accent: #30D158; }
:root[data-accent="purple"] { --accent: #BF5AF2; }
:root[data-accent="teal"]   { --accent: #64D2FF; }
:root[data-accent="red"]    { --accent: #FF453A; }

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #000000;
    --paper-sunk: #1C1C1E;
    --ink:        #F5F5F7;
    --ink-muted:  #98989D;
    --hairline:   rgba(255,255,255,.12);
    --shadow-lg:  0 24px 70px -24px rgba(0,0,0,.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-text);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s ease, color .5s ease;
  position: relative;
}
h1, h2 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -.025em; }
p { margin: 0; }
button, input, select { font-family: inherit; }

/* Ambient color field — a single soft glow tied to the active
   accent, not a hero gradient. Reads as "Apple keynote lighting",
   not decoration for its own sake. */
.glow {
  position: fixed;
  inset: -20% -20% auto auto;
  width: 60vmax; height: 60vmax;
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  opacity: .16;
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
  transition: background 1.1s var(--ease-spring), opacity .6s ease;
}
@media (prefers-color-scheme: dark) { .glow { opacity: .28; } }

/* ============================================================
   STAGE / LAYOUT
   ============================================================ */

.stage {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.topbar {
  width: 100%;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: .5rem 0 clamp(1.5rem, 5vh, 3rem);
}
.topbar__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: -.01em;
  color: var(--ink-muted);
  flex-shrink: 0;
}
.progress {
  flex: 1;
  display: flex;
  gap: .3rem;
}
.progress__seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--hairline);
  overflow: hidden;
}
.progress__seg::after {
  content: '';
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .5s var(--ease-spring), background .4s ease;
}
.progress__seg.is-filled::after { width: 100%; }

.deck {
  width: 100%;
  max-width: 620px;
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}

.foot {
  padding-top: 1.5rem;
  font-size: .75rem;
  color: var(--ink-muted);
  letter-spacing: .01em;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.75rem;
  opacity: 0;
  transform: translateY(16px) scale(.98);
  transition: opacity .55s var(--ease-spring), transform .55s var(--ease-spring);
}
.card.is-active {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}
.card.is-leaving {
  opacity: 0;
  transform: translateY(-16px) scale(.98);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--accent);
  margin: 0;
  transition: color .4s ease;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  transition: background .4s ease;
}

/* Intro */
.intro-title {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 800;
  line-height: 1.02;
}
.intro-title em { font-style: normal; color: var(--accent); transition: color .4s ease; }
.intro-body {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 46ch;
}
.intro-anon { font-size: .8rem; color: var(--ink-muted); opacity: .8; }

/* About-you form */
.form-title { font-size: clamp(2rem, 5.5vw, 2.75rem); font-weight: 800; line-height: 1.05; }
.field-group { display: flex; flex-direction: column; gap: 1.1rem; width: 100%; }
.field { display: flex; flex-direction: column; gap: .4rem; width: 100%; }
.field label {
  font-size: .8rem; font-weight: 600; color: var(--ink-muted);
  letter-spacing: -.005em;
}
.field input[type="text"], .field input[type="email"] {
  font-size: 1.15rem; font-weight: 500;
  padding: .95rem 1.1rem;
  border-radius: 14px;
  border: 1.5px solid var(--hairline);
  background: var(--paper-sunk);
  color: var(--ink);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .4s ease;
  width: 100%;
}
.field input::placeholder { color: var(--ink-muted); opacity: .55; }
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
  background: var(--paper);
}

.chip-row { display: flex; flex-wrap: wrap; gap: .55rem; }
.chip {
  padding: .7rem 1.15rem;
  border-radius: 100px;
  border: 1.5px solid var(--hairline);
  background: var(--paper-sunk);
  color: var(--ink);
  font-size: .95rem; font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease-spring);
}
.chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.chip.is-selected {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

.field-error {
  font-size: .8rem; color: #FF453A; min-height: 1em;
}

/* Question */
.q-index {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.q-statement {
  font-size: clamp(1.6rem, 4.6vw, 2.35rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.02em;
  max-width: 20ch;
}

.scale {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: clamp(.4rem, 1.6vw, .65rem);
  width: 100%;
  margin-top: .5rem;
}
.scale__btn {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid var(--hairline);
  background: var(--paper-sunk);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 3.2vw, 1.3rem);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s var(--ease-spring), background .3s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.scale__btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.scale__btn:active { transform: scale(.92); }
.scale__btn.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent);
  transform: scale(1.1);
}
.scale-labels {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--ink-muted);
  margin-top: -.6rem;
}

/* Email / private ID (optional, last) */
.optional-tag {
  font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-muted); background: var(--paper-sunk);
  padding: .3rem .65rem; border-radius: 100px;
}
.field-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* Done */
.done-title { font-size: clamp(2.5rem, 7vw, 4rem); font-weight: 800; line-height: 1.02; }
.done-title em { font-style: normal; color: var(--accent); }
.done-body { font-size: 1.1rem; line-height: 1.6; color: var(--ink-muted); max-width: 46ch; }
.done-mark {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.done-mark svg { width: 28px; height: 28px; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: 1.05rem 2rem;
  font-size: 1rem; font-weight: 700; letter-spacing: -.005em;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: transform .2s var(--ease-spring), background .3s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn--primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--accent) 65%, transparent);
}
.btn--primary:hover { transform: translateY(-2px); }
.btn--primary:active { transform: translateY(0) scale(.98); }
.btn--primary:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn__arrow { transition: transform .2s var(--ease-spring); }
.btn--primary:hover .btn__arrow { transform: translateX(4px); }

.btn--ghost {
  background: none; color: var(--ink-muted);
  padding: 1.05rem 1rem;
}
.btn--ghost:hover { color: var(--ink); }

/* ============================================================
   MOTION PREFERENCE
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 420px) {
  .scale { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); }
}
