/* ═══════════════════════════════════════════════════════════
   THE REFERRAL v2 — jaw-dropping cinematic experience
   Reflect and Restore · Culture is Infrastructure
   ═══════════════════════════════════════════════════════════ */

:root {
  --ink: #0c0b10;
  --ink-soft: #1a1824;
  --cream: #fff8ef;
  --cream-dim: #f3ebe0;
  --paper: #f7f0e4;
  --stamp: #c41e3a;
  --amber: #f5a524;
  --orange: #f97316;
  --rose: #fb7185;
  --violet: #8b5cf6;
  --sky: #0ea5e9;
  --emerald: #10b981;
  --parent-cream: #fffbeb;
  --parent-amber: #d97706;
  --muted: rgba(255, 248, 239, 0.55);
  --glass: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 248, 239, 0.14);
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Outfit", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Themes the shared impact stage's CTA (pitch-shared/impact.css). */
  --impact-cta-a: #f97316;
  --impact-cta-b: #fb7185;
  --impact-cta-glow: rgba(249,115,22,0.38);
  --impact-cta-ring: rgba(249,115,22,0.12);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body.locked { overscroll-behavior: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* ── Film grain canvas ─────────────────────────────────── */
#grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
  opacity: 0.055;
  mix-blend-mode: overlay;
}

/* ── Aurora meshes ─────────────────────────────────────── */
.aurora {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  z-index: 0;
  filter: blur(40px);
  opacity: 0.9;
  animation: auroraDrift 14s ease-in-out infinite alternate;
}

@keyframes auroraDrift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.06); }
}

.aurora-gate {
  background:
    radial-gradient(ellipse 50% 40% at 30% 20%, rgba(249,115,22,0.35), transparent 60%),
    radial-gradient(ellipse 45% 35% at 80% 70%, rgba(251,113,133,0.22), transparent 55%);
}

.aurora-student {
  background:
    radial-gradient(ellipse 55% 45% at 15% 10%, rgba(139,92,246,0.45), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 85%, rgba(14,165,233,0.35), transparent 55%);
}

.aurora-teacher {
  background:
    radial-gradient(ellipse 55% 45% at 70% 0%, rgba(249,115,22,0.42), transparent 55%),
    radial-gradient(ellipse 45% 35% at 10% 90%, rgba(251,113,133,0.28), transparent 50%);
}

.aurora-admin {
  background:
    radial-gradient(ellipse 50% 40% at 50% 0%, rgba(16,185,129,0.28), transparent 55%),
    radial-gradient(ellipse 40% 35% at 100% 60%, rgba(14,165,233,0.18), transparent 50%),
    radial-gradient(ellipse 35% 30% at 0% 80%, rgba(245,165,36,0.12), transparent 50%);
}

.aurora-parent {
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(251,191,36,0.35), transparent 55%),
    radial-gradient(ellipse 45% 40% at 20% 100%, rgba(251,113,133,0.12), transparent 50%);
  filter: blur(50px);
}

.aurora-close {
  background:
    radial-gradient(ellipse 55% 40% at 40% 0%, rgba(249,115,22,0.32), transparent 55%),
    radial-gradient(ellipse 45% 35% at 90% 90%, rgba(251,113,133,0.22), transparent 50%);
}

/* ── Stage ─────────────────────────────────────────────── */
#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.act {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.75s var(--ease-out), visibility 0.75s;
  padding: calc(52px + var(--safe-top)) 20px calc(28px + var(--safe-bot));
  /* clip, not hidden: focusing a field makes browsers auto-scroll the nearest
     clipped ancestor, which silently shoved the whole act up and clipped the
     Continue button. clip forbids that scroll — .reflect-inner and #act-close
     do their own scrolling. */
  overflow: hidden;
  overflow: clip;
}

.act.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.act.is-exit {
  opacity: 0;
  visibility: hidden;
  z-index: 1;
}

/* ── Atmosphere ────────────────────────────────────────── */
.atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.atmosphere .vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, transparent 0%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 30%, rgba(0,0,0,0.45) 100%);
}

.atmosphere.soft .vignette { display: none; }

.atmosphere .dust {
  position: absolute;
  inset: -20%;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,248,239,0.4), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(245,165,36,0.3), transparent),
    radial-gradient(1.5px 1.5px at 80% 20%, rgba(255,248,239,0.22), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(251,113,133,0.25), transparent);
  animation: dustDrift 28s linear infinite;
  opacity: 0.75;
}

.atmosphere .dust.warm {
  background-image:
    radial-gradient(1.5px 1.5px at 25% 40%, rgba(217,119,6,0.35), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(180,83,9,0.25), transparent);
}

@keyframes dustDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-4%, -6%, 0); }
}

.atmosphere .scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px, rgba(0,0,0,0.035) 2px, rgba(0,0,0,0.035) 4px
  );
  opacity: 0.45;
}

/* ── Role + progress rails ─────────────────────────────── */
.role-rail {
  position: fixed;
  top: calc(18px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  display: none;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
}

.role-rail.is-on { display: flex; }

.role-rail span {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  color: rgba(255,248,239,0.4);
  transition: all 0.35s var(--ease-out);
}

.role-rail span.is-active {
  color: #0c0b10;
  background: linear-gradient(135deg, #fff8ef, #fde68a);
  font-weight: 600;
}

.role-rail[data-active="teacher"] span.is-active {
  background: linear-gradient(135deg, #fdba74, #fb7185);
  color: #fff;
}

.role-rail[data-active="admin"] span.is-active {
  background: linear-gradient(135deg, #6ee7b7, #34d399);
  color: #064e3b;
}

.role-rail[data-active="parent"] span.is-active {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #78350f;
}

.progress-rail {
  position: absolute;
  top: calc(8px + var(--safe-top));
  left: 22px;
  right: 22px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.4s;
}

.progress-rail.is-on { opacity: 1; }

.progress-rail > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--sky), var(--orange), var(--amber));
  transition: width 0.55s var(--ease-out);
  box-shadow: 0 0 12px rgba(249,115,22,0.5);
}

/* ── Shared UI ─────────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
}

.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.display em {
  font-style: italic;
  background: linear-gradient(135deg, var(--emerald), #6ee7b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 28ch;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 54px;
  padding: 0 1.6rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange), var(--rose));
  color: #fff;
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.01em;
  box-shadow:
    0 10px 40px rgba(249, 115, 22, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
}

.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.4; pointer-events: none; }

.btn-student {
  background: linear-gradient(135deg, var(--violet), var(--sky));
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-parent {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  box-shadow: 0 10px 40px rgba(217, 119, 6, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  color: #fff;
}

.btn-ghost {
  min-height: 48px;
  padding: 0 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(12px);
  font-weight: 550;
  color: var(--cream);
}

.btn-chip {
  min-height: 48px;
  padding: 0.7rem 1.05rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
  font-weight: 550;
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease-spring), box-shadow 0.2s;
}

.btn-chip.is-selected {
  border-color: rgba(139, 92, 246, 0.85);
  background: linear-gradient(135deg, rgba(139,92,246,0.32), rgba(14,165,233,0.2));
  transform: scale(1.03);
  box-shadow: 0 0 24px rgba(139,92,246,0.25);
}

.field {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.28);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  color: var(--cream);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.45;
  resize: none;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field:focus {
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.field::placeholder { color: rgba(255,248,239,0.35); }

.glass-panel {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.minutes {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.sound-toggle {
  position: fixed;
  top: calc(14px + var(--safe-top));
  right: 16px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  opacity: 0.7;
}

.sound-toggle svg { width: 18px; height: 18px; }

/* ── ACT 0: Gate ───────────────────────────────────────── */
#act-gate {
  background: var(--ink);
  align-items: stretch;
  justify-content: flex-end;
  padding-top: calc(20px + var(--safe-top));
}

#act-gate .gate-card {
  position: relative;
  z-index: 2;
  margin-top: auto;
  background: linear-gradient(180deg, rgba(255,250,242,0.98), rgba(243,235,224,0.99));
  color: #1c1917;
  border-radius: 28px 28px 22px 22px;
  padding: 1.6rem 1.4rem 1.5rem;
  box-shadow: 0 -20px 80px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.4) inset;
  transform: translateY(12px);
  opacity: 0;
}

#act-gate.is-active .gate-card {
  animation: riseIn 0.9s var(--ease-out) 0.15s forwards;
}

@keyframes riseIn {
  to { transform: translateY(0); opacity: 1; }
}

.gate-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 2px solid var(--stamp);
  border-radius: 4px;
  padding: 0.35rem 0.65rem;
  transform: rotate(-2deg);
  margin-bottom: 1rem;
  box-shadow: 0 0 0 4px rgba(196,30,58,0.08);
}

#act-gate h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 0.7rem;
  color: #1c1917;
}

#act-gate .gate-sub {
  color: #57534e;
  font-size: 1rem;
  line-height: 1.45;
  margin-bottom: 1.4rem;
  max-width: 30ch;
}

#act-gate .btn-primary { width: 100%; }

.gate-fine {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.72rem;
  color: #a8a29e;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.gate-paper {
  position: absolute;
  inset: 8% 10% auto;
  height: 42%;
  z-index: 1;
  background: var(--paper);
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,0,0,0.06);
  transform: rotate(-4deg) scale(0.96);
  opacity: 0;
}

#act-gate.is-active .gate-paper {
  animation: paperDrop 1.1s var(--ease-out) forwards;
}

@keyframes paperDrop {
  0% { transform: rotate(-12deg) translateY(-40%) scale(0.9); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: rotate(-4deg) translateY(0) scale(0.96); opacity: 1; }
}

.gate-paper .fake-lines {
  position: absolute;
  inset: 30% 12% 20%;
  background: repeating-linear-gradient(
    transparent, transparent 18px, rgba(28,25,23,0.08) 18px, rgba(28,25,23,0.08) 19px
  );
}

.gate-paper .paper-head {
  position: absolute;
  top: 10%; left: 8%; right: 8%;
  font-family: var(--font-mono);
  font-size: clamp(0.55rem, 2.4vw, 0.78rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(28,25,23,0.55);
  border-bottom: 1px solid rgba(28,25,23,0.18);
  padding-bottom: 0.5em;
}

.gate-paper .paper-note {
  position: absolute;
  left: 8%; right: 32%; top: 46%;
  font-family: var(--font-mono), monospace;
  font-size: clamp(0.68rem, 2.8vw, 0.98rem);
  color: rgba(28,25,23,0.68);
  line-height: 1.45;
}

#act-gate .gate-sub em {
  font-style: italic;
  color: var(--orange, #f97316);
  font-weight: 600;
}

.gate-paper .red-x {
  position: absolute;
  right: 12%;
  top: 22%;
  font-family: var(--font-display);
  font-size: 3.2rem;
  color: var(--stamp);
  opacity: 0.85;
  transform: rotate(12deg);
  text-shadow: 0 4px 20px rgba(196,30,58,0.3);
}

/* ── ACT 1: Exile ──────────────────────────────────────── */
#act-exile {
  background: #07060a;
  justify-content: center;
  text-align: center;
  align-items: center;
  padding-top: calc(20px + var(--safe-top));
}

#act-exile .exile-copy {
  position: relative;
  z-index: 2;
  max-width: 20rem;
}

#act-exile .exile-line {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 7.5vw, 2.6rem);
  margin: 0.35rem 0;
  opacity: 0;
  transform: translateY(16px);
}

#act-exile .exile-sub {
  font-size: 1.25rem !important;
  color: var(--muted);
  font-family: var(--font-ui) !important;
}

#act-exile .exile-line.is-in {
  animation: lineIn 0.8s var(--ease-out) forwards;
}

@keyframes lineIn {
  to { opacity: 1; transform: translateY(0); }
}

#act-exile .clock-wrap {
  margin: 1.8rem auto 0;
  opacity: 0;
}

#act-exile .clock-wrap.is-in {
  animation: lineIn 0.7s var(--ease-out) forwards;
}

#act-exile .clock {
  font-family: var(--font-mono);
  font-size: 3.4rem;
  font-weight: 500;
  color: var(--amber);
  text-shadow: 0 0 40px rgba(245,165,36,0.45), 0 0 80px rgba(245,165,36,0.2);
  letter-spacing: 0.06em;
}

#act-exile .clock-label {
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245,165,36,0.7);
}

#act-exile .stl-line {
  margin-top: 2.2rem;
  font-size: 1.05rem;
  color: var(--muted);
  opacity: 0;
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
}

#act-exile .stl-line.is-in {
  animation: lineIn 0.9s var(--ease-out) forwards;
}

.hallway {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.75) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.75) 100%),
    linear-gradient(180deg, #12101a 0%, #1a1624 40%, #0d0b12 100%);
  z-index: 0;
}

.hallway::before,
.hallway::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  background: repeating-linear-gradient(
    180deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 48px
  );
  opacity: 0.5;
}

.hallway::before { left: 0; }
.hallway::after { right: 0; }

.locker-glow {
  position: absolute;
  left: 50%;
  top: 18%;
  width: 120%;
  height: 40%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(245,165,36,0.1), transparent 65%);
  animation: pulseGlow 3.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ── ACT 2: Reflect ────────────────────────────────────── */
#act-reflect { background: #0f0d18; }

/* Same guard as The Reach: a tall step (small phone, large type) must stay
   scrollable so its Continue button is always reachable. Auto margins center
   short steps; `justify-content: center` would clip the overflow instead. */
#act-reflect .reflect-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1.1rem;
  max-width: 28rem;
  width: 100%;
  margin: 0 auto;
  padding-top: 0.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#act-reflect .reflect-inner > .eyebrow { margin-top: auto; }
#act-reflect .reflect-inner > .step.is-on { margin-bottom: auto; }

#act-reflect h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6.5vw, 2.15rem);
  line-height: 1.1;
}

.step { display: none; flex-direction: column; gap: 1rem; animation: stepIn 0.55s var(--ease-out); }
.step.is-on { display: flex; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.emotion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.name-row { display: flex; gap: 0.65rem; align-items: center; }
.name-row .field { flex: 1; min-height: 52px; }

.char-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255,248,239,0.4);
  text-align: right;
}

.reflect-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.reflect-actions .btn-primary { flex: 1; }

.soft-note {
  font-size: 0.78rem;
  color: rgba(255,248,239,0.4);
  line-height: 1.4;
}

/* ── In-the-moment care beat ─────────────────────────────── */
.care-root { display: flex; width: 100%; }

.care-card {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  padding: 1.7rem 1.35rem 1.5rem;
  border-radius: 24px;
  border: 1px solid rgba(139, 92, 246, 0.32);
  background:
    radial-gradient(130% 85% at 50% 0%, rgba(139, 92, 246, 0.2), transparent 70%),
    linear-gradient(165deg, rgba(26, 24, 36, 0.92), rgba(12, 11, 16, 0.94));
  box-shadow: 0 24px 60px rgba(139, 92, 246, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: careIn 0.6s var(--ease-out);
}

.care-card.is-safety {
  border-color: rgba(251, 113, 133, 0.42);
  background:
    radial-gradient(130% 85% at 50% 0%, rgba(251, 113, 133, 0.22), transparent 72%),
    linear-gradient(165deg, rgba(32, 20, 26, 0.94), rgba(14, 11, 14, 0.95));
  box-shadow: 0 24px 70px rgba(251, 113, 133, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Threats toward others — red, firmer than the rose care tone. */
.care-card.is-harm {
  border-color: rgba(239, 68, 68, 0.48);
  background:
    radial-gradient(130% 85% at 50% 0%, rgba(239, 68, 68, 0.24), transparent 72%),
    linear-gradient(165deg, rgba(36, 16, 16, 0.94), rgba(16, 10, 10, 0.95));
  box-shadow: 0 24px 70px rgba(239, 68, 68, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.care-card.is-harm .care-glyph {
  color: #ef4444;
  background: radial-gradient(circle at 50% 45%, rgba(239, 68, 68, 0.32), rgba(239, 68, 68, 0.05) 70%);
}
.care-card.is-harm .care-eyebrow { color: #f87171; }
.care-card.is-harm .care-message::after { color: #ef4444; }
.care-card.is-harm .care-assure {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.28);
}

@keyframes careIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.care-glyph {
  position: relative;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--violet);
  background: radial-gradient(circle at 50% 45%, rgba(139, 92, 246, 0.3), rgba(139, 92, 246, 0.05) 70%);
}
.care-glyph svg { width: 30px; height: 30px; }
.care-glyph::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0.3;
  animation: careHalo 2.4s ease-in-out infinite;
}
.care-card.is-safety .care-glyph {
  color: var(--rose);
  background: radial-gradient(circle at 50% 45%, rgba(251, 113, 133, 0.32), rgba(251, 113, 133, 0.05) 70%);
}

@keyframes careHalo {
  0%, 100% { transform: scale(1); opacity: 0.28; }
  50% { transform: scale(1.16); opacity: 0.06; }
}

.care-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
}
.care-card.is-safety .care-eyebrow { color: var(--rose); }

.care-message {
  font-family: var(--font-display);
  font-size: 1.22rem;
  line-height: 1.42;
  color: var(--cream);
  min-height: 2.6em;
  max-width: 30ch;
}
.care-message::after {
  content: "▍";
  margin-left: 1px;
  color: var(--violet);
  animation: careCaret 0.9s step-end infinite;
}
.care-card.is-safety .care-message::after { color: var(--rose); }
.care-message.is-done::after { content: ""; }

@keyframes careCaret { 50% { opacity: 0; } }

.care-assure {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--cream);
  max-width: 32ch;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.24);
}

.care-card .btn-primary { width: 100%; margin-top: 0.35rem; }

.care-card.is-thinking {
  gap: 1.1rem;
  padding-top: 2.3rem;
  padding-bottom: 2.3rem;
}
.care-orb { display: flex; gap: 0.55rem; }
.care-orb span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--violet);
  animation: careOrb 1.2s ease-in-out infinite;
}
.care-orb span:nth-child(2) { animation-delay: 0.15s; background: var(--sky); }
.care-orb span:nth-child(3) { animation-delay: 0.3s; background: var(--rose); }
.care-status { font-size: 0.9rem; color: var(--muted); }

@keyframes careOrb {
  0%, 100% { opacity: 0.3; transform: scale(0.8) translateY(0); }
  50% { opacity: 1; transform: scale(1) translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  .care-card, .care-glyph::before, .care-orb span { animation: none !important; }
  .care-message::after { content: "" !important; }
}

/* ── ACT 3: Flip ───────────────────────────────────────── */
#act-flip { background: #140e0c; }

.flip-scene {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  perspective: 1400px;
  min-height: 0;
}

.flip-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.15s var(--ease-out);
  min-height: min(62vh, 520px);
}

.flip-card.is-flipped { transform: rotateY(180deg); }

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 24px;
  padding: 1.35rem 1.25rem;
  overflow: auto;
  border: 1px solid var(--line);
}

.flip-front {
  background: linear-gradient(160deg, rgba(139,92,246,0.22), rgba(14,165,233,0.14), rgba(0,0,0,0.35));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
  box-shadow: 0 0 60px rgba(139,92,246,0.15);
}

.flip-back {
  background: linear-gradient(165deg, rgba(255,248,239,0.99), rgba(255,241,230,0.97));
  color: #1c1917;
  transform: rotateY(180deg);
  box-shadow: 0 25px 80px rgba(249,115,22,0.25);
}

.flip-front h2,
.waiting-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  line-height: 1.1;
}

.pulse-dots span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sky);
  margin-right: 5px;
  animation: dotPulse 1.2s ease-in-out infinite;
}

.pulse-dots span:nth-child(2) { animation-delay: 0.15s; background: var(--violet); }
.pulse-dots span:nth-child(3) { animation-delay: 0.3s; background: var(--orange); }

@keyframes dotPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

.brief-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(28,25,23,0.1);
}

.brief-head .tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 650;
}

.brief-head h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.1;
  margin-top: 0.25rem;
}

.ai-pill {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(249,115,22,0.12);
  color: #c2410c;
  white-space: nowrap;
}
.ai-pill.is-urgent {
  background: #b91c1c;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(185,28,28,0.18);
  animation: urgentPulse 1.8s ease-in-out infinite;
}
@keyframes urgentPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(185,28,28,0.18); }
  50% { box-shadow: 0 0 0 6px rgba(185,28,28,0.08); }
}
.brief-card.is-urgent .tag { color: #b91c1c; }
.safety-strip {
  display: flex; align-items: flex-start; gap: 0.65rem;
  margin: -0.15rem -0.15rem 0.9rem; padding: 0.7rem 0.85rem;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(135deg, #7f1d1d, #b91c1c);
  color: #fef2f2;
}
.safety-strip strong {
  display: block; font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.15rem;
}
.safety-strip span { display: block; font-size: 0.88rem; line-height: 1.3; font-weight: 600; }
.safety-pulse {
  width: 10px; height: 10px; margin-top: 0.3rem; border-radius: 50%;
  background: #fecaca; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(254,202,202,0.7);
  animation: safetyDot 1.4s ease-out infinite;
}
@keyframes safetyDot {
  0% { box-shadow: 0 0 0 0 rgba(254,202,202,0.7); }
  70% { box-shadow: 0 0 0 10px rgba(254,202,202,0); }
  100% { box-shadow: 0 0 0 0 rgba(254,202,202,0); }
}
.safety-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: -0.25rem 0 0.85rem; }
.safety-chip {
  font-family: var(--font-mono); font-size: 0.58rem; font-weight: 650;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.28rem 0.5rem; border-radius: 999px;
  background: #fee2e2; color: #991b1b; border: 1px solid #fecaca;
}
.quote-block.is-urgent {
  border-left-color: #b91c1c;
  background: rgba(185,28,28,0.06);
}
.watch-box.is-urgent {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #7f1d1d;
  border-left: 3px solid #b91c1c;
}
.stay-banner.is-urgent {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  color: #fef2f2;
  box-shadow: 0 10px 28px rgba(127,29,29,0.28);
}

.brief-section { margin-bottom: 1rem; }

.brief-section h4 {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a8a29e;
  margin-bottom: 0.4rem;
}

.quote-block {
  border-left: 3px solid var(--orange);
  padding: 0.65rem 0.85rem;
  background: rgba(249,115,22,0.06);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  line-height: 1.45;
}

.quote-block .phase {
  display: block;
  margin-top: 0.35rem;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: #a8a29e;
}

.watch-box {
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #9a3412;
}

.stay-banner {
  margin-top: 0.5rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #065f46;
  font-weight: 650;
  text-align: center;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 24px rgba(16,185,129,0.15);
}

.flip-cta {
  position: relative;
  z-index: 3;
  margin-top: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.flip-cta.is-on {
  opacity: 1;
  pointer-events: auto;
}

.flip-cta .btn-primary { width: 100%; }

/* ── ACT 4: Admin ──────────────────────────────────────── */
#act-admin {
  background: #0b1210;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding-bottom: 0.5rem;
}

.admin-top { margin-bottom: 0.9rem; }

.admin-title {
  font-size: clamp(1.55rem, 6.2vw, 2.05rem);
  margin-top: 0.35rem;
}

.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(16,185,129,0.15);
  color: #6ee7b7;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.alert-chip.alive::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 12px #34d399;
  animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.admin-case {
  padding: 1rem 1.05rem;
  margin-bottom: 0.85rem;
}

.admin-case .case-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.admin-case .case-head h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.15;
}

.admin-case .badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  background: rgba(16,185,129,0.2);
  color: #6ee7b7;
  white-space: nowrap;
}
.admin-case .badge.is-urgent {
  background: #b91c1c;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(185,28,28,0.25);
}
.admin-case .case-head.is-urgent h3 { color: #fecaca; }
.tl-dot.is-urgent {
  background: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.35);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, rgba(16,185,129,0.6), rgba(14,165,233,0.2));
}

.tl-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 0.65rem;
  padding: 0.45rem 0;
  opacity: 0;
  transform: translateX(-8px);
}

.tl-item.is-in {
  animation: tlIn 0.55s var(--ease-out) forwards;
}

@keyframes tlIn {
  to { opacity: 1; transform: translateX(0); }
}

.tl-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0b1210;
  border: 2px solid #34d399;
  box-shadow: 0 0 10px rgba(52,211,153,0.45);
  margin-top: 2px;
  z-index: 1;
}

.tl-item .tl-body strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 650;
  margin-bottom: 0.1rem;
}

.tl-item .tl-body span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.admin-action {
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease-spring);
}

.admin-action .aa-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,248,239,0.4);
  margin-bottom: 0.2rem;
}

.admin-action strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 0.15rem;
}

.admin-action span:last-child {
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-action.is-on {
  border-color: rgba(52,211,153,0.55);
  background: linear-gradient(135deg, rgba(16,185,129,0.18), rgba(14,165,233,0.08));
  box-shadow: 0 0 28px rgba(16,185,129,0.15);
  transform: scale(1.01);
}

.admin-action.is-on .aa-kicker { color: #6ee7b7; }

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.kpi {
  padding: 0.9rem 0.85rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.kpi .num {
  font-family: var(--font-display);
  font-size: 1.85rem;
  line-height: 1;
  color: var(--emerald);
  text-shadow: 0 0 24px rgba(16,185,129,0.3);
}

.kpi .lbl {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.admin-thesis {
  font-size: 0.88rem;
  color: rgba(255,248,239,0.55);
  line-height: 1.45;
  margin-bottom: 1rem;
  text-align: center;
}

/* ── ACT 5: Parent ─────────────────────────────────────── */
#act-parent {
  background: linear-gradient(180deg, #1c1410 0%, #2a1f16 40%, #1a120e 100%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.parent-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
}

.parent-eyebrow { color: #fbbf24; }

.parent-title {
  font-size: clamp(1.55rem, 6vw, 2rem);
  margin: 0.35rem 0 1rem;
  color: #fff8ef;
}

.phone-frame {
  position: relative;
  background: linear-gradient(160deg, #292524, #1c1917);
  border-radius: 32px;
  padding: 12px 10px 16px;
  box-shadow:
    0 40px 80px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,255,255,0.08),
    inset 0 1px 0 rgba(255,255,255,0.1);
  margin-bottom: 1rem;
}

.phone-notch {
  width: 38%;
  height: 18px;
  background: #0c0b10;
  border-radius: 0 0 14px 14px;
  margin: 0 auto 10px;
}

.phone-screen {
  background: var(--parent-cream);
  color: #1c1917;
  border-radius: 22px;
  padding: 1rem 0.95rem 1.1rem;
  min-height: 280px;
  box-shadow: inset 0 0 0 1px rgba(180,83,9,0.08);
}

.parent-feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.parent-feed-head .app-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.parent-feed-head .streak {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #fef3c7;
  color: #92400e;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
}

.parent-card {
  background: #fff;
  border-radius: 16px;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.65rem;
  border: 1px solid #f3e8d8;
  box-shadow: 0 4px 16px rgba(120,53,15,0.06);
  opacity: 0;
  transform: translateY(10px);
}

.parent-card.is-in {
  animation: stepIn 0.55s var(--ease-out) forwards;
}

.parent-card .pc-kicker {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b45309;
  margin-bottom: 0.3rem;
}

.parent-card h4 {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.3rem;
}

.parent-card p {
  font-size: 0.82rem;
  color: #78716c;
  line-height: 1.4;
}

.parent-card.trust {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: #a7f3d0;
}

.parent-card.trust h4 { color: #065f46; }
.parent-card.trust p { color: #047857; }

.parent-card.prompt {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #fde68a;
}

.connection-bar {
  margin-top: 0.55rem;
  height: 6px;
  border-radius: 99px;
  background: #f5f5f4;
  overflow: hidden;
}

.connection-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #f59e0b, #ea580c);
  transition: width 1.2s var(--ease-out);
}

.privacy-seal {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(255,248,239,0.08);
  border: 1px solid rgba(251,191,36,0.25);
  margin-bottom: 1rem;
}

.privacy-seal .lock { font-size: 1.1rem; line-height: 1.2; }

.privacy-seal p {
  font-size: 0.82rem;
  color: rgba(255,248,239,0.7);
  line-height: 1.4;
}

.privacy-seal strong { color: #fde68a; }
.privacy-seal em { color: #fbbf24; font-style: normal; font-weight: 600; }

/* ── ACT 6: Lead magnet close ──────────────────────────── */
#act-close {
  background: var(--ink);
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.close-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 28rem;
  margin: auto 0 0;
  padding-bottom: 0.25rem;
}

.logo-mark {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 8px 24px rgba(249,115,22,0.35));
}

#act-close h2 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 7vw, 2.45rem);
  line-height: 1.02;
  margin-bottom: 0.55rem;
}

.close-lead {
  color: rgba(255,248,239,0.7);
  max-width: 34ch;
  margin-bottom: 1.1rem;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

/* The card-leave panel. "Back this mission" above it is the loud one, so this
   read as fine print at the bottom of a long close and got scrolled past.
   Its own lit panel with a slow breathing glow pulls the eye back down
   without shouting over the primary CTA. */
.lead-capture {
  position: relative;
  margin-top: 1.35rem;
  padding: 0.35rem 1.05rem 1rem;
  border-radius: 18px;
  border: 1.5px solid rgba(249,115,22,0.4);
  background: linear-gradient(160deg, rgba(249,115,22,0.1), rgba(251,113,133,0.05) 62%, transparent);
  animation: leadGlow 3.6s ease-in-out infinite;
}
@keyframes leadGlow {
  0%, 100% {
    border-color: rgba(249,115,22,0.38);
    box-shadow: 0 0 0 0 rgba(249,115,22,0), 0 10px 30px rgba(249,115,22,0.1);
  }
  50% {
    border-color: rgba(251,146,60,0.78);
    box-shadow: 0 0 0 5px rgba(249,115,22,0.06), 0 14px 38px rgba(249,115,22,0.22);
  }
}
.lead-capture .lead-divide { margin-top: 0.55rem; }
.lead-capture .close-lead {
  color: rgba(255,248,239,0.94);
  font-weight: 600;
  max-width: none;
}
@media (prefers-reduced-motion: reduce) {
  .lead-capture {
    animation: none;
    border-color: rgba(251,146,60,0.7);
    box-shadow: 0 12px 34px rgba(249,115,22,0.18);
  }
}

.lead-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lead-field > span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,248,239,0.5);
}

.lead-field > span em {
  font-style: normal;
  opacity: 0.65;
  letter-spacing: 0.08em;
  text-transform: none;
}

.lead-field input,
.lead-field textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  color: var(--cream);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  backdrop-filter: blur(12px);
}

.lead-field textarea { resize: none; line-height: 1.4; }

.lead-field input:focus,
.lead-field textarea:focus {
  border-color: rgba(249,115,22,0.75);
  box-shadow: 0 0 0 4px rgba(249,115,22,0.15);
  background: rgba(255,255,255,0.09);
}

.lead-field input::placeholder,
.lead-field textarea::placeholder { color: rgba(255,248,239,0.32); }

.lead-field.is-invalid input,
.lead-field.is-invalid textarea {
  border-color: rgba(251,113,133,0.8);
  box-shadow: 0 0 0 4px rgba(251,113,133,0.12);
}

.lead-error {
  font-size: 0.85rem;
  color: #fda4af;
  line-height: 1.35;
}

#btn-lead-submit {
  width: 100%;
  margin-top: 0.25rem;
  min-height: 56px;
  font-size: 1.05rem;
}

#btn-lead-submit.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.close-secondary {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.close-secondary .btn-ghost,
.close-secondary .btn-primary { width: 100%; }

.role-recap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.2rem 0 1.1rem;
}

.role-recap span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(249,115,22,0.35);
  color: rgba(255,248,239,0.65);
  background: rgba(249,115,22,0.08);
}

.lead-success {
  text-align: left;
  animation: riseIn 0.7s var(--ease-out);
}

.success-burst {
  font-size: 2rem;
  color: var(--amber);
  text-shadow: 0 0 30px rgba(245,165,36,0.55);
  margin-bottom: 0.5rem;
  animation: burstSpin 1.2s var(--ease-spring);
}

@keyframes burstSpin {
  from { transform: scale(0.4) rotate(-30deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
}

.confetti.is-on { opacity: 1; }

.stl-badge {
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,248,239,0.45);
  text-align: center;
}

.price-whisper {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,248,239,0.5);
  line-height: 1.4;
}

/* External CTA to the live platform — a distinct card, not another ghost link */
.platform-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(249,115,22,0.28);
  background: linear-gradient(135deg, rgba(249,115,22,0.1), rgba(251,113,133,0.06));
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s var(--ease-spring), box-shadow 0.2s;
}

.platform-card:hover,
.platform-card:focus-visible {
  border-color: rgba(249,115,22,0.55);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(249,115,22,0.16);
}

.platform-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--orange), var(--rose));
  color: #fff;
}

.platform-card-icon svg { width: 20px; height: 20px; }

.platform-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.platform-card-text strong {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--cream);
  line-height: 1.25;
}

.platform-card-text span {
  font-size: 0.76rem;
  color: rgba(255,248,239,0.55);
  line-height: 1.3;
}

.platform-card-arrow {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--orange);
}

/* Interactive parent CTA */
.parent-card .try-btn {
  margin-top: 0.65rem;
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  font-weight: 650;
  font-size: 0.88rem;
  box-shadow: 0 6px 18px rgba(217,119,6,0.25);
}

.parent-card .try-btn.is-done {
  background: #065f46;
  box-shadow: none;
}

/* Ripple on chips */
.btn-chip { position: relative; overflow: hidden; }
.btn-chip .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: ripple 0.55s ease-out;
  pointer-events: none;
}
@keyframes ripple {
  to { transform: scale(3); opacity: 0; }
}

/* ── Tier upgrades ─────────────────────────────────────── */
/* #4 — the student's typed words sweep-highlight as the brief flips in */
.quote-typed { position: relative; overflow: hidden; }
.quote-typed::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 18%, rgba(251,113,133,0.42), transparent 82%);
  transform: translateX(-120%);
}
.flip-card.is-flipped .quote-typed::after { animation: quoteSweep 1.15s cubic-bezier(0.22,1,0.36,1) 0.5s 1; }
@keyframes quoteSweep { to { transform: translateX(120%); } }

/* #2 — KPI sparklines draw in, making the cockpit read as live */
.kpi .spark { display: block; margin-top: 0.45rem; width: 100%; height: 22px; overflow: visible; }
.kpi .spark-line { stroke-dasharray: 150; stroke-dashoffset: 150; animation: sparkDraw 1.2s ease 0.35s forwards; }
.kpi .spark-dot { opacity: 0; animation: sparkDot 0.01s linear 1.35s forwards; }
@keyframes sparkDraw { to { stroke-dashoffset: 0; } }
@keyframes sparkDot { to { opacity: 1; } }
.admin-action.is-on { animation: recPulse 2.6s ease-in-out infinite; }
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 28px rgba(16,185,129,0.15); }
  50% { box-shadow: 0 0 38px rgba(16,185,129,0.3); }
}

/* #8 — emotion chips get a per-feeling color dot + tinted selection */
.btn-chip[data-emotion] { padding-left: 2.15rem; }
.btn-chip[data-emotion]::before {
  content: ""; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--chip, #a78bfa); box-shadow: 0 0 10px var(--chip, #a78bfa);
  transition: transform 0.2s var(--ease-spring);
}
.btn-chip[data-emotion].is-selected {
  border-color: var(--chip, #a78bfa) !important;
  box-shadow: 0 0 24px -2px var(--chip, #a78bfa) !important;
}
.btn-chip[data-emotion].is-selected::before { transform: translateY(-50%) scale(1.45); }

/* #9 — hero line words rise in, staggered */
.rw-word { display: inline-block; opacity: 0; transform: translateY(0.55em); animation: rwUp 0.6s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes rwUp { to { opacity: 1; transform: translateY(0); } }

/* ── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .aurora { animation: none; }
  .flip-card { transition: none; }
  .flip-card.is-flipped { transform: none; }
  .flip-back { position: relative; transform: none; }
  .flip-front { display: none; }
}

@media (max-height: 700px) {
  .act { padding-top: calc(44px + var(--safe-top)); }
  .phone-screen { min-height: 240px; }
  .flip-card { min-height: min(55vh, 420px); }
}

/* ── National close: founder note, primary CTA, role chips ── */

/* Exile zoom-out: the personal clock becomes the country's number */
#act-exile .stl-line { max-width: 30ch; }

.natl-kicker {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.natl-line {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.55;
}

.natl-line b {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 0.02em;
  display: inline-block;
  min-width: 10ch; /* number counts up in place without reflow */
  text-align: center;
}

.natl-source {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,248,239,0.35);
}

.founder-note {
  margin: 0.95rem 0 0.2rem;
  padding: 0.95rem 1.1rem;
  border-left: 2px solid var(--orange);
  border-radius: 0 14px 14px 0;
  background: rgba(255,255,255,0.045);
  text-align: left;
}

.founder-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--cream-dim);
}

.founder-sign {
  margin-top: 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cream);
}

.founder-sign span {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,248,239,0.4);
}

.platform-card.is-primary {
  margin-top: 1.05rem;
  padding: 1.05rem 1.1rem;
  border-width: 1.5px;
  border-color: rgba(249,115,22,0.6);
  background: linear-gradient(135deg, rgba(249,115,22,0.2), rgba(251,113,133,0.12));
  box-shadow: 0 12px 34px rgba(249,115,22,0.16);
}

.platform-card.is-primary .platform-card-icon { width: 46px; height: 46px; }
.platform-card.is-primary .platform-card-text strong { font-size: 1.02rem; }
.platform-card.is-primary .platform-card-text span { font-size: 0.8rem; }

.lead-divide {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1.35rem 0 0.5rem;
}

.lead-divide::before,
.lead-divide::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.lead-divide span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,248,239,0.4);
  white-space: nowrap;
}

.role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.role-chip {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s var(--ease-spring);
}

.role-chip:active { transform: scale(0.96); }

.role-chip.is-on {
  border-color: rgba(249,115,22,0.65);
  background: rgba(249,115,22,0.16);
  color: var(--cream);
}

/* Safety-path recommended card: urgent rose ring, not the routine green */
.admin-action.is-on.is-safety-rec {
  border-color: rgba(251,113,133,0.6);
  background: linear-gradient(135deg, rgba(251,113,133,0.16), rgba(196,30,58,0.08));
  box-shadow: 0 0 28px rgba(251,113,133,0.16);
}

.admin-action.is-on.is-safety-rec .aa-kicker { color: #fda4af; }

/* Safety-recommended cards pulse rose, not the routine green */
.admin-action.is-on.is-safety-rec { animation: recPulseSafety 2.6s ease-in-out infinite; }

@keyframes recPulseSafety {
  0%, 100% { box-shadow: 0 0 28px rgba(251,113,133,0.16); }
  50% { box-shadow: 0 0 38px rgba(251,113,133,0.32); }
}

/* One honest whisper at the close: the walk is the trailer, not the product */
.taste-line {
  margin: 0.4rem 0 0.15rem;
  font-size: 0.82rem;
  color: rgba(255,248,239,0.55);
  line-height: 1.5;
}
