/* =====================================================================
   Visual identity: "stage & spotlight". Loaded after styles.css.
   ===================================================================== */
:root {
  --font-display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --grad: linear-gradient(120deg, #0f9f8f 0%, #16a3a0 35%, #f06a4f 100%);
  --glow-a: rgb(45 212 191 / 0.22);
  --glow-b: rgb(255 122 99 / 0.18);
  --stage-bg: #0d1117;
  --stage-text: #f5f5f4;
  --stage-muted: #a3a8b0;
  --stage-accent: #7ee8d8;
  --tint-teal: #0f766e;
  --tint-blue: #2563eb;
  --tint-coral: #d9472f;
  --tint-violet: #7c3aed;
  --tint-amber: #b45309;
  --tint-pink: #c0266d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glow-a: rgb(45 212 191 / 0.14);
    --glow-b: rgb(255 122 99 / 0.12);
    --stage-bg: #07090c;
    --tint-teal: #2dd4bf;
    --tint-blue: #60a5fa;
    --tint-coral: #ff7a63;
    --tint-violet: #a78bfa;
    --tint-amber: #fbbf24;
    --tint-pink: #f472b6;
  }
}
:root[data-theme="dark"] {
  --glow-a: rgb(45 212 191 / 0.14);
  --glow-b: rgb(255 122 99 / 0.12);
  --stage-bg: #07090c;
  --tint-teal: #2dd4bf;
  --tint-blue: #60a5fa;
  --tint-coral: #ff7a63;
  --tint-violet: #a78bfa;
  --tint-amber: #fbbf24;
  --tint-pink: #f472b6;
}

/* Ambient background glow */
body { position: relative; isolation: isolate; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40rem 28rem at 8% -6%, var(--glow-a), transparent 70%),
    radial-gradient(36rem 26rem at 100% 8%, var(--glow-b), transparent 70%);
  transition: background .6s;
}

h1, h2, .brand, .tile-value, .ring-label, .prompt-text, .daily-text, .stage-title, .streak strong, .tip-text {
  font-family: var(--font-display);
}
h1 { letter-spacing: -0.03em; }
h2 { letter-spacing: -0.015em; }

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

/* Brand */
.brand-mark { background: var(--grad); color: #fff; box-shadow: 0 4px 14px var(--glow-a); }

/* Buttons */
.btn-primary {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 8px 22px -8px rgb(240 106 79 / 0.6), 0 2px 6px -2px rgb(15 118 110 / 0.4);
}
.btn-primary:hover { background: var(--grad); border-color: transparent; filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

/* Page enter animation */
#app > * { animation: enter .45s cubic-bezier(.2, .7, .2, 1) both; }
#app > *:nth-child(2) { animation-delay: .05s; }
#app > *:nth-child(3) { animation-delay: .1s; }
#app > *:nth-child(4) { animation-delay: .15s; }
#app > *:nth-child(n+5) { animation-delay: .2s; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Hero ---------- */
.hero { margin: 20px 0 32px; gap: 40px; }
.hero h1 { font-size: clamp(2.7rem, 7.5vw, 4.6rem); line-height: 1; margin-bottom: .4em; }
.hero h1 .grad-text { display: inline-block; padding-bottom: .1em; }
.hero-text .eyebrow { background: var(--primary-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }

.stats-strip { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 28px; color: var(--text-2); font-size: .92rem; }
.stats-strip span { display: inline-flex; align-items: baseline; gap: 6px; }
.stats-strip strong { font-family: var(--font-display); font-size: 1.4rem; color: var(--text); }

/* The "stage" card: always dark, lit by a spotlight */
.stage-card {
  position: relative; overflow: hidden; border-radius: 24px; padding: 24px 24px 26px;
  color: var(--stage-text); background: var(--stage-bg);
  box-shadow: 0 30px 60px -24px rgb(10 20 30 / .55), inset 0 0 0 1px rgb(255 255 255 / .06);
}
.stage-card::before {
  content: ''; position: absolute; left: -20%; right: -20%; top: -60%; height: 130%;
  background: radial-gradient(closest-side, rgb(255 244 214 / .2), transparent 75%);
  pointer-events: none;
}
.stage-card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--grad); }
.stage-card > * { position: relative; }
.stage-card .eyebrow { color: var(--stage-accent); }
.stage-card .chip { background: rgb(255 255 255 / .1); color: var(--stage-text); }
.stage-card .daily-text { font-size: clamp(1.45rem, 3vw, 1.9rem); line-height: 1.22; margin: 12px 0 8px; letter-spacing: -0.015em; }
.stage-card .done-pill { color: var(--stage-accent); }
.stage-mic { font-size: .9rem; color: var(--stage-muted); display: flex; align-items: center; gap: 10px; }

.eq { display: flex; align-items: flex-end; gap: 4px; height: 34px; }
.eq i { width: 5px; border-radius: 3px; background: var(--grad); height: 30%; animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(2n) { animation-duration: .9s; }
.eq i:nth-child(3n) { animation-duration: 1.3s; }
.eq i:nth-child(4n) { animation-duration: .75s; }
.eq i:nth-child(5n) { animation-delay: -.4s; }
.eq i:nth-child(7n) { animation-delay: -.7s; }
@keyframes eq { 0%, 100% { height: 18%; } 50% { height: 100%; } }

/* ---------- Tinted cards ---------- */
.tint-teal   { --tint: var(--tint-teal); }
.tint-blue   { --tint: var(--tint-blue); }
.tint-coral  { --tint: var(--tint-coral); }
.tint-violet { --tint: var(--tint-violet); }
.tint-amber  { --tint: var(--tint-amber); }
.tint-pink   { --tint: var(--tint-pink); }

.mode-card, .topic-card { overflow: hidden; }
.topic-card { position: relative; }
.mode-card::after, .topic-card::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tint, var(--primary)) 24%, transparent), transparent);
  transition: transform .35s; pointer-events: none;
}
.mode-card:hover, .topic-card:hover {
  border-color: var(--tint, var(--primary));
  box-shadow: 0 16px 32px -20px color-mix(in srgb, var(--tint, var(--primary)) 80%, transparent);
}
.mode-card:hover::after, .topic-card:hover::after { transform: scale(1.6); }
.mode-icon, .topic-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 1.6rem;
  background: color-mix(in srgb, var(--tint, var(--primary)) 15%, var(--surface)); margin-bottom: 8px;
}
.topic-icon.big { width: 76px; height: 76px; border-radius: 20px; font-size: 2.4rem; margin: 0; }
.mode-card strong, .topic-card strong { font-size: 1.05rem; }
.mode-card.selectable:has(input:checked) {
  border-color: var(--tint, var(--primary));
  background: color-mix(in srgb, var(--tint, var(--primary)) 9%, var(--surface));
}
.mode-card.selectable:has(input:checked)::before {
  content: '✓'; position: absolute; top: 12px; right: 14px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--tint, var(--primary)); color: var(--surface);
  font-weight: 800; font-size: .8rem; z-index: 1;
}
.word-chip { border-left: 4px solid var(--tint, var(--primary)); }

/* How it works */
.steps li { background: var(--surface); border: 1px solid var(--border); }
.step-num { background: var(--grad); color: #fff; font-family: var(--font-display); width: 36px; height: 36px; font-size: 1.05rem; }

/* Cards & tiles */
.card { border-radius: 20px; }
.tile { border-radius: 18px; position: relative; overflow: hidden; }
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.tile-value { font-size: 1.9rem; letter-spacing: -0.02em; }
.tip { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 60%); }
.tip-text { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Session: the spotlight ---------- */
body.in-session::before {
  background:
    radial-gradient(60rem 36rem at 50% -12%, var(--glow-a), transparent 70%),
    radial-gradient(40rem 30rem at 50% 115%, var(--glow-b), transparent 70%);
}
.prompt-card {
  background: var(--stage-bg); color: var(--stage-text); border: 0; position: relative; overflow: hidden;
  box-shadow: 0 30px 60px -28px rgb(10 20 30 / .6);
}
.prompt-card::before {
  content: ''; position: absolute; left: 10%; right: 10%; top: -70%; height: 150%;
  background: radial-gradient(closest-side, rgb(255 244 214 / .18), transparent 75%);
}
.prompt-card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--grad); }
.prompt-card > * { position: relative; }
.prompt-card .chip { background: rgb(255 255 255 / .1); color: var(--stage-text); }
.prompt-card .prompt-sub { color: var(--stage-muted); }
.prompt-card .side { color: var(--stage-accent); }

/* Voice-reactive halo around the timer */
.ring { --level: 0; }
.ring::before {
  content: ''; position: absolute; inset: 4%; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--primary) 40%, transparent), transparent);
  transform: scale(calc(1 + var(--level) * 0.4)); opacity: calc(0.2 + var(--level));
  transition: transform .12s ease-out, opacity .12s ease-out;
}
.ring-fg { stroke: url(#ring-grad); }
.ring-fg.warn { stroke: var(--accent); }
.ring-label { font-size: 3.4rem; letter-spacing: -0.03em; }
.meter-fill { background: var(--grad); }

.nudge { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-family: var(--font-display); }
.nudge:empty { border: 0; box-shadow: none; }
.nudge.strong { background: var(--accent-soft); border-color: transparent; }

.anx { transition: transform .15s, border-color .15s; }
.anx:hover { transform: translateY(-3px); }
.anx-face { font-size: 2.2rem; transition: transform .2s; }
.anx:hover .anx-face { transform: scale(1.15); }

.breath-circle {
  background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / .45), transparent 45%), var(--grad);
  box-shadow: 0 0 80px -10px var(--glow-a), 0 0 120px -20px var(--glow-b);
}
.breath-label { color: #fff; text-shadow: 0 2px 10px rgb(0 0 0 / .3); }

/* ---------- Results ---------- */
.results-head h1 { font-size: clamp(2.3rem, 6vw, 3.4rem); }
.big-emoji { font-size: 4rem; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.badge-unlock {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
}
.badge { border: 1px solid var(--border); background: var(--surface); transition: transform .2s; }
.badge:not(.locked):hover { transform: translateY(-3px) rotate(-1deg); }
.badge-icon { font-size: 2.2rem; }
.badge-unlock .badge-icon { animation: pop .7s .2s cubic-bezier(.2, 1.6, .4, 1) both; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 20; }

@media (prefers-reduced-motion: reduce) {
  .eq i { animation: none; height: 60%; }
}
