/* static/diagnostic/diagnostic.css
   60-second false-fluency diagnostic — mobile-first, calm/paper aesthetic
   consistent with static/landing.html. Light-first with a dark @media block. */

:root {
  --bg: #F8F4ED;
  --panel: #FFFFFF;
  --tint: #EFE9DD;
  --ink: #1A1F2E;
  --ink-dim: #4A4F5C;
  --ink-faint: #8B8D94;
  --line: #E5DDD0;
  --purple: #5D4276;
  --purple-bright: #7A5BA0;
  --purple-soft: #ECE4F2;
  --gold: #B8915D;
  --gold-soft: #F3EADC;
  --good: #338A5A;
  --warn: #B15A2B;
  --maxw: 620px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161D;
    --panel: #1C1F29;
    --tint: #232733;
    --ink: #ECE7DD;
    --ink-dim: #B6B2A8;
    --ink-faint: #8A8778;
    --line: #2E3340;
    --purple: #B79BDA;
    --purple-bright: #C7B0E6;
    --purple-soft: #2A2440;
    --gold: #D0A96E;
    --gold-soft: #2B2519;
    --good: #6BC08E;
    --warn: #E0925F;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

.serif, .hook, .band-range { font-family: 'Fraunces', Georgia, serif; }

/* ---------------- topbar ---------------- */
.diag-topbar {
  padding: 18px 22px calc(18px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--line);
}
.diag-brand {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 21px; font-weight: 600; letter-spacing: .01em;
  color: var(--ink); text-decoration: none;
}
.diag-brand span { color: var(--purple); }

/* ---------------- stage / screens ---------------- */
.diag-stage {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 22px 64px;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}
.screen { display: none; animation: fade .22s ease both; }
.screen.is-active { display: block; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--purple); margin-bottom: 16px;
}
.hook {
  font-size: clamp(1.9rem, 7vw, 2.6rem); font-weight: 500;
  line-height: 1.12; letter-spacing: -.01em; color: var(--ink);
}
.hook-sm { font-size: clamp(1.6rem, 6vw, 2.1rem); }
.hook em { font-style: italic; color: var(--purple-bright); }
.prompt { font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.prompt em { font-style: italic; color: var(--purple-bright); }
.lede { margin-top: 18px; font-size: 1.05rem; color: var(--ink-dim); }
.lede strong { color: var(--ink); }
.hint { margin-top: 10px; font-size: .95rem; color: var(--ink-faint); }
.fineprint { margin-top: 16px; font-size: .82rem; color: var(--ink-faint); }

/* ---------------- buttons ---------------- */
.btn {
  font-family: inherit; font-size: 1rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; border-radius: 12px;
  padding: 15px 24px; transition: transform .12s, background .2s, border-color .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary {
  background: var(--purple); color: #fff; border-color: var(--purple);
  box-shadow: 0 10px 28px -14px rgba(93,66,118,.5);
  margin-top: 28px; width: 100%; max-width: 420px;
}
.btn-primary:hover { background: var(--purple-bright); border-color: var(--purple-bright); }
.btn-ghost {
  background: transparent; color: var(--purple); border-color: var(--purple);
  margin-top: 12px; width: 100%; max-width: 420px;
}
.btn-ghost:hover { background: var(--purple-soft); }
/* .btn sets display:inline-flex, which overrides the default [hidden] rule —
   without this, a hidden diag-share button would still render (footgun). */
#diag-share[hidden] { display: none; }

/* ---------------- screen 2 : passage ---------------- */
.passage {
  margin-top: 22px; padding: 22px 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  font-family: 'Fraunces', Georgia, serif; font-size: 1.28rem; line-height: 1.85;
  color: var(--ink);
}
.diag-word {
  font: inherit; color: inherit; background: transparent;
  border: none; border-radius: 6px; padding: 1px 3px; margin: 0 -1px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .1s, color .1s, box-shadow .1s;
}
.diag-word:hover { background: var(--tint); }
.diag-word.is-unknown {
  background: var(--gold-soft); color: var(--warn);
  box-shadow: inset 0 -2px 0 var(--gold);
}
.screen-actions { margin-top: 26px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.tap-count { font-size: .85rem; color: var(--ink-faint); }

/* ---------------- screen 3 : trap ---------------- */
.progress-dots { display: flex; gap: 7px; margin-bottom: 22px; }
.progress-dots .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--line); transition: background .2s;
}
.progress-dots .dot.done { background: var(--purple); }
.progress-dots .dot.current { background: var(--gold); }

.qcard {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 26px 22px;
}
.qword {
  font-family: 'Fraunces', Georgia, serif; font-size: 2rem; font-weight: 500;
  color: var(--ink); margin-bottom: 6px;
}
.qprompt { font-size: 1.1rem; color: var(--ink-dim); margin-bottom: 22px; }
.qprompt strong { color: var(--ink); font-weight: 600; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  font: inherit; text-align: left; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 18px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color .12s, background .12s, transform .1s;
}
.option:hover { border-color: var(--purple-bright); }
.option:active { transform: translateY(1px); }
.option.chosen { border-color: var(--purple); background: var(--purple-soft); }
.yesno { display: flex; gap: 12px; }
.yesno .option { flex: 1; text-align: center; font-weight: 600; }

/* ---------------- screen 4 : mirror ---------------- */
.mirror { margin-top: 8px; }
.band-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 22px; text-align: center;
}
.band-label { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--purple); }
.band-range { font-size: clamp(2.6rem, 12vw, 3.6rem); font-weight: 500; color: var(--ink); line-height: 1.05; margin: 8px 0 4px; }
.band-tag { font-size: .95rem; color: var(--ink-faint); }
.band-unreliable .band-range { font-size: 1.6rem; color: var(--warn); }

.coverage { margin-top: 22px; display: flex; flex-direction: column; gap: 18px; }
.cov-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .9rem; margin-bottom: 7px; }
.cov-name { font-weight: 600; color: var(--ink); }
.cov-name .cov-hint { font-weight: 400; color: var(--ink-faint); font-style: italic; }
.cov-pct { font-family: 'Fraunces', Georgia, serif; font-size: 1.15rem; color: var(--ink); }
.bar { height: 12px; border-radius: 6px; background: var(--tint); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 6px; }
.bar-claimed > span { background: var(--gold); }
.bar-verified > span { background: var(--purple); }

.caption {
  margin-top: 24px; padding: 16px 18px; border-radius: 12px;
  background: var(--purple-soft); color: var(--ink-dim); font-size: .95rem;
}

/* ---------------- overlay / toast ---------------- */
.diag-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(2px);
}
.diag-overlay[hidden] { display: none; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--purple);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.diag-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 110; max-width: 90vw;
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 10px; font-size: .9rem;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.5);
}
.diag-toast[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .screen, .spinner { animation: none; }
}
