/* ==========================================================================
   THE THRESHOLD — fable redesign
   "An illuminated night-manuscript."
   One scene held for the whole journey: a dark study, one source of light.
   Type carries the ceremony (Fraunces), the sans carries the interface
   (Albert Sans). One accent: ember. One motif: light through a door ajar.
   Mobile is the canonical view. Everything is sanity-checked at 390–430px.
   ========================================================================== */

:root {
  /* ink — warm-black paper, never pure black */
  --ink-0: #070504;
  --ink-1: #0F0B08;
  --ink-2: #1A130D;
  --ink-3: #261B12;
  /* bone — warm ivory, never pure white */
  --bone: #EFE5D3;
  --bone-soft: #D9CDB8;
  --muted: #A6927B;
  --muted-2: #C2B098;
  /* ember — the single accent */
  --ember: #D89E58;
  --ember-hot: #F4CA8B;
  --ember-deep: #8F6630;
  --ember-dim: rgba(216, 158, 88, 0.55);
  /* oxblood — second neutral, used only as a tint inside surfaces */
  --oxblood: #4A1F1A;
  /* hairlines */
  --line: rgba(216, 158, 88, 0.14);
  --line-2: rgba(216, 158, 88, 0.26);
  /* type */
  --serif: "Fraunces", "Georgia", serif;
  --sans: "Albert Sans", system-ui, -apple-system, sans-serif;
  /* rhythm */
  --pad: 22px;
  --radius: 16px;
  --radius-sm: 12px;
  /* motion */
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
  --t-fast: 180ms;
  --t-med: 320ms;
  --t-slow: 560ms;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--ink-1);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ambient scene — held for the entire journey */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(120% 90% at 50% -10%, #2A1C10 0%, #140E09 45%, #080604 100%);
  animation: ambientBreathe 26s var(--ease) infinite alternate;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(90% 60% at 50% 108%, rgba(216, 158, 88, 0.10) 0%, rgba(216, 158, 88, 0) 60%),
    radial-gradient(140% 110% at 50% 50%, rgba(0, 0, 0, 0) 52%, rgba(5, 3, 2, 0.6) 100%);
}
@keyframes ambientBreathe {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-2.5%) scale(1.04); }
}

/* film grain */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

::selection { background: rgba(216, 158, 88, 0.3); }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 4px; }

/* ==========================================================================
   STAGE + SCREENS
   ========================================================================== */

.stage { position: relative; width: 100%; min-height: 100dvh; }

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  /* clip inactive screens — their (tall) content must not add scroll height */
  visibility: hidden;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    calc(74px + env(safe-area-inset-top))
    calc(var(--pad) + env(safe-area-inset-right))
    calc(40px + env(safe-area-inset-bottom))
    calc(var(--pad) + env(safe-area-inset-left));
}
.screen.is-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  overflow: visible;
  min-height: 100dvh;
}

/* long pages scroll the document naturally */
.screen.scrollable { justify-content: flex-start; }
.screen.scrollable.is-active { min-height: 100dvh; height: auto; }

.frame { width: 100%; max-width: 560px; }
.frame.wide { max-width: 680px; }

/* entrance choreography — children of the active frame rise in sequence */
.is-active .frame > * {
  animation: rise var(--t-slow) var(--ease) both;
}
.is-active .frame > *:nth-child(1) { animation-delay: 60ms; }
.is-active .frame > *:nth-child(2) { animation-delay: 140ms; }
.is-active .frame > *:nth-child(3) { animation-delay: 220ms; }
.is-active .frame > *:nth-child(4) { animation-delay: 300ms; }
.is-active .frame > *:nth-child(5) { animation-delay: 380ms; }
.is-active .frame > *:nth-child(6) { animation-delay: 450ms; }
.is-active.no-anim .frame > * { animation: none; }

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

/* ==========================================================================
   TYPE
   ========================================================================== */

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 14px;
}

.question {
  font-family: var(--serif);
  font-size: clamp(27px, 7.2vw, 38px);
  font-weight: 480;
  font-variation-settings: "opsz" 40;
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--bone);
  margin-bottom: 10px;
  text-wrap: balance;
}

.display {
  font-family: var(--serif);
  font-size: clamp(34px, 9vw, 52px);
  font-weight: 430;
  font-variation-settings: "opsz" 60;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.display em, .question em {
  font-style: italic;
  font-weight: 420;
  color: var(--ember-hot);
}

.helper {
  font-size: 14.5px;
  color: var(--muted);
  margin-bottom: 26px;
}
.helper.italic { font-family: var(--serif); font-style: italic; font-size: 16px; }

.lede {
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--bone-soft);
}

/* ==========================================================================
   FIXED UI — progress hairline, back, audio
   ========================================================================== */

.progress-rail {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 50;
  background: rgba(216, 158, 88, 0.10);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}
.progress-rail.is-shown { opacity: 1; }
.progress-rail i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ember-deep), var(--ember) 70%, var(--ember-hot));
  box-shadow: 0 0 12px rgba(244, 202, 139, 0.55);
  transition: width 700ms var(--ease);
}

.progress-step {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--muted);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
  pointer-events: none;
}
.progress-step.is-shown { opacity: 1; }

.ui-orb {
  position: fixed;
  z-index: 50;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(15, 11, 8, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--bone-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease), transform var(--t-fast) var(--ease), border-color var(--t-fast);
}
.ui-orb.is-shown { opacity: 1; pointer-events: auto; }
.ui-orb:active { transform: scale(0.94); }
.ui-orb svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.back-btn { top: calc(10px + env(safe-area-inset-top)); left: calc(14px + env(safe-area-inset-left)); }
.audio-toggle { top: calc(10px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right)); }

/* dev skip — invisible corner tap target */
.dev-skip {
  position: fixed; bottom: 0; right: 0; width: 44px; height: 44px;
  z-index: 70; opacity: 0.02; color: var(--muted); font-size: 18px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 16px 32px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--ember-hot) 0%, var(--ember) 55%, #C88E48 100%);
  color: #1C1209;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.03em;
  box-shadow:
    0 1px 0 rgba(255, 235, 200, 0.5) inset,
    0 10px 30px -10px rgba(216, 158, 88, 0.45);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), filter var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.975); filter: brightness(0.96); }
.btn.is-disabled, .btn[disabled] {
  background: var(--ink-3);
  color: var(--muted);
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}
.btn.ghost {
  background: transparent;
  color: var(--bone-soft);
  border: 1px solid var(--line-2);
  box-shadow: none;
  font-weight: 550;
}

.actions { margin-top: 28px; }
.actions + .actions { margin-top: 12px; }

.text-link {
  display: inline-block;
  margin-top: 22px;
  min-height: 44px;
  padding: 10px 6px;
  font-size: 14.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(166, 146, 123, 0.5);
  transition: color var(--t-fast);
}
.text-link:active { color: var(--bone-soft); }

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

.options { display: flex; flex-direction: column; gap: 12px; }

.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 17px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(38, 27, 18, 0.6), rgba(22, 16, 11, 0.75));
  color: var(--bone);
  font-size: 16.5px;
  font-weight: 520;
  text-align: left;
  line-height: 1.4;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.opt:active { transform: scale(0.985); }

/* selection — ember ring, soft inner light, ✓ seal */
.opt::after {
  content: "✓";
  margin-left: auto;
  width: 22px; height: 22px;
  flex: 0 0 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: #1C1209;
  background: var(--ember);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-med) var(--ease);
}
.opt.is-selected {
  border-color: transparent;
  box-shadow: 0 0 0 1.5px var(--ember), inset 0 0 30px rgba(216, 158, 88, 0.10);
  background: linear-gradient(180deg, rgba(48, 33, 20, 0.85), rgba(28, 19, 12, 0.9));
}
.opt.is-selected::after { opacity: 1; transform: scale(1); }

/* centered two-choice (perception answers) */
.options.two-up .opt { justify-content: center; text-align: center; font-weight: 560; }
.options.two-up .opt::after { position: absolute; right: 16px; margin: 0; }

/* icon grid (q6 time-of-day, q7 word weight) */
.options.icon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.options.icon-grid .opt {
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: 116px;
  padding: 20px 12px 18px;
  text-align: center;
  font-weight: 560;
  font-size: 15.5px;
}
.options.icon-grid .opt::after { position: absolute; top: 10px; right: 10px; margin: 0; }
.options.icon-grid .opt.span-2 { grid-column: 1 / -1; min-height: 92px; flex-direction: row; gap: 14px; }
.opt-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ember);
}
.opt-icon svg { width: 34px; height: 34px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.opt.is-selected .opt-icon { color: var(--ember-hot); }

/* multi-select check square */
.opt.multi::before {
  content: "";
  width: 20px; height: 20px;
  flex: 0 0 20px;
  border-radius: 6px;
  border: 1.5px solid var(--line-2);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.opt.multi.is-selected::before {
  background: var(--ember);
  border-color: var(--ember);
}
.opt.multi::after { display: none; }
.opt.multi.is-selected {
  box-shadow: 0 0 0 1px var(--ember-dim), inset 0 0 24px rgba(216, 158, 88, 0.07);
}

/* ==========================================================================
   PLATES — the framed perception images (q1–q5)
   "specimen plates in a manuscript" — double hairline, numeral caption
   ========================================================================== */

.plate {
  position: relative;
  margin: 0 auto 22px;
  max-width: min(76vw, 340px);
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(34, 24, 15, 0.5), rgba(18, 13, 9, 0.6));
}
.plate::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  pointer-events: none;
}
.plate img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 3px;
  filter: sepia(0.08) saturate(1.02);
}
.plate-caption {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 9px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

@media (max-height: 740px) {
  .plate { max-width: min(62vw, 270px); }
  .helper { margin-bottom: 18px; }
}

/* ==========================================================================
   INTRO
   ========================================================================== */

.screen[data-screen="intro"] { justify-content: flex-end; padding-bottom: calc(56px + env(safe-area-inset-bottom)); }

.intro-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.intro-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  filter: brightness(1.18) contrast(0.96) sepia(0.12) saturate(1.05);
  animation: introDrift 22s var(--ease) infinite alternate;
}
@keyframes introDrift {
  from { transform: scale(1.02); }
  to   { transform: scale(1.1) translateY(-1.5%); }
}
.intro-bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 7, 5, 0.55) 0%, rgba(10, 7, 5, 0.12) 34%, rgba(10, 7, 5, 0.55) 62%, rgba(8, 6, 4, 0.94) 88%),
    radial-gradient(80% 50% at 50% 100%, rgba(216, 158, 88, 0.16), rgba(216, 158, 88, 0) 60%);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.brand-sigil { color: var(--ember); font-size: 15px; text-shadow: 0 0 14px rgba(244, 202, 139, 0.6); }
.brand-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--bone-soft);
}

.intro-tagline {
  font-family: var(--serif);
  font-size: clamp(30px, 8vw, 44px);
  font-weight: 440;
  font-variation-settings: "opsz" 50;
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  text-wrap: balance;
}
.intro-tagline em { font-style: italic; color: var(--ember-hot); }

.intro-meta {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15.5px;
  color: var(--muted-2);
  margin-bottom: 26px;
}

/* ==========================================================================
   AUDIO PERCEPTION (qaudio)
   ========================================================================== */

.audio-note {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(40, 28, 17, 0.6), rgba(22, 16, 11, 0.7));
  margin-bottom: 26px;
  text-align: left;
}
.audio-note-icon { flex: 0 0 30px; color: var(--ember); }
.audio-note-icon svg { width: 30px; height: 30px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.audio-note-text { font-size: 14.5px; line-height: 1.5; color: var(--bone-soft); }

.audio-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-bottom: 28px; }

.play-btn {
  position: relative;
  width: 92px; height: 92px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ember-hot);
  background: radial-gradient(circle at 50% 38%, rgba(216, 158, 88, 0.16), rgba(216, 158, 88, 0.05) 70%);
  border: 1px solid var(--line-2);
  transition: transform var(--t-fast) var(--ease);
}
.play-btn:active { transform: scale(0.95); }
.play-btn::before {
  content: "";
  position: absolute; inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(216, 158, 88, 0.25);
  animation: playHalo 2s var(--ease) infinite;
}
@keyframes playHalo {
  0%   { transform: scale(0.96); opacity: 0.9; }
  70%  { transform: scale(1.1); opacity: 0; }
  100% { transform: scale(1.1); opacity: 0; }
}
.play-btn.is-playing::before { animation: none; opacity: 0.35; }
.play-btn .pause-bars { display: none; }
.play-btn.is-playing .play-tri { display: none; }
.play-btn.is-playing .pause-bars { display: block; }
.play-btn svg { fill: currentColor; }

.waveform { display: flex; align-items: center; gap: 4px; height: 44px; }
.waveform span {
  width: 3px; height: 10px;
  border-radius: 2px;
  background: var(--ember-deep);
  transition: background var(--t-med);
}
.waveform.is-active span { background: var(--ember); animation: wave 760ms var(--ease) infinite alternate; }
.waveform span:nth-child(2n) { animation-duration: 920ms; }
.waveform span:nth-child(3n) { animation-duration: 640ms; }
.waveform span:nth-child(5n) { animation-duration: 1080ms; }
@keyframes wave {
  from { height: 8px; }
  to   { height: 38px; }
}

/* ==========================================================================
   STATEMENTS — ceremonial pauses, the "door ajar" motif
   ========================================================================== */

.screen.statement { text-align: center; }

.stmt-bg {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
}
.stmt-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.5;
  filter: brightness(1.1) sepia(0.15);
}
.stmt-bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 7, 5, 0.82) 0%, rgba(10, 7, 5, 0.45) 45%, rgba(8, 6, 4, 0.9) 100%);
}

/* the light through the door ajar */
.door-light {
  position: relative;
  width: 1.5px;
  height: 64px;
  margin: 0 auto 26px;
  background: linear-gradient(180deg, rgba(244, 202, 139, 0) 0%, var(--ember-hot) 40%, var(--ember) 70%, rgba(216, 158, 88, 0) 100%);
  box-shadow: 0 0 18px 2px rgba(244, 202, 139, 0.4);
  animation: doorGlow 3.4s var(--ease) infinite alternate;
}
@keyframes doorGlow {
  from { opacity: 0.75; }
  to   { opacity: 1; }
}

.stmt-title { margin-bottom: 14px; }
.stmt-descriptor {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 4.6vw, 21px);
  color: var(--muted-2);
  line-height: 1.5;
  max-width: 40ch;
  margin: 0 auto;
}
.statement .actions { margin-top: 38px; }
.statement .btn { max-width: 330px; }

/* ==========================================================================
   SCENES (q8)
   ========================================================================== */

.scene-stack { display: flex; flex-direction: column; gap: 12px; }
.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 8.4;
  max-height: 21dvh;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: box-shadow var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.scene:active { transform: scale(0.985); }
.scene img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.scene::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8, 6, 4, 0.66) 0%, rgba(8, 6, 4, 0.12) 55%, rgba(8, 6, 4, 0) 100%);
  transition: background var(--t-fast);
}
.scene-label {
  position: absolute;
  left: 16px; bottom: 12px;
  z-index: 2;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--bone);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}
.scene-check {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 2;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ember);
  color: #1C1209;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity var(--t-fast), transform var(--t-med) var(--ease);
}
.scene.is-selected { border-color: transparent; box-shadow: 0 0 0 1.5px var(--ember); }
.scene.is-selected .scene-check { opacity: 1; transform: scale(1); }

/* ==========================================================================
   FIELDS
   ========================================================================== */

.field { margin-bottom: 18px; text-align: left; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  min-height: 58px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(22, 16, 11, 0.8);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16.5px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input::placeholder { color: rgba(166, 146, 123, 0.55); }
.field input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 1.5px var(--ember);
}
.field input.is-error { border-color: transparent; box-shadow: 0 0 0 1.5px #C96F50; }
.field-error { margin-top: 8px; font-size: 13.5px; color: #D98E72; }

.privacy { margin-top: 10px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

.trust-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(26, 19, 13, 0.5);
}
.trust-note svg { flex: 0 0 18px; width: 18px; height: 18px; stroke: var(--ember); stroke-width: 1.7; fill: none; stroke-linecap: round; }
.trust-note p { font-size: 13.5px; color: var(--bone-soft); }

/* ==========================================================================
   LOADING — the weighing
   ========================================================================== */

.screen[data-screen="loading"] { text-align: center; }

.weigh-stage { width: 100%; max-width: 420px; }

.weigh-ring {
  position: relative;
  width: 168px; height: 168px;
  margin: 0 auto 34px;
}
.weigh-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.weigh-ring .ring-track { fill: none; stroke: rgba(216, 158, 88, 0.12); stroke-width: 2; }
.weigh-ring .ring-fill {
  fill: none;
  stroke: var(--ember);
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(244, 202, 139, 0.5));
}
.weigh-sigil {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  color: var(--ember-hot);
  text-shadow: 0 0 24px rgba(244, 202, 139, 0.7);
  animation: sigilPulse 2.4s var(--ease) infinite alternate;
}
@keyframes sigilPulse {
  from { opacity: 0.7; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1.03); }
}

.weigh-headline {
  font-family: var(--serif);
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 460;
  margin-bottom: 26px;
  min-height: 1.3em;
  transition: opacity var(--t-med);
}

.weigh-steps {
  display: flex;
  flex-direction: column;
  gap: 13px;
  max-width: 320px;
  margin: 0 auto;
  text-align: left;
}
.weigh-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  color: var(--muted);
  opacity: 0.35;
  transition: opacity var(--t-med), color var(--t-med);
}
.weigh-step.is-active { opacity: 1; color: var(--bone-soft); }
.weigh-step.is-done { opacity: 0.8; color: var(--muted-2); }
.weigh-dot {
  flex: 0 0 18px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  color: #1C1209;
  transition: background var(--t-med), border-color var(--t-med);
}
.weigh-step.is-active .weigh-dot { border-color: var(--ember); box-shadow: 0 0 10px rgba(216, 158, 88, 0.4); }
.weigh-step.is-done .weigh-dot { background: var(--ember); border-color: var(--ember); }
.weigh-step.is-done .weigh-dot::after { content: "✓"; }

/* ==========================================================================
   RESULT — the reading, set like a book page
   ========================================================================== */

.screen[data-screen="result"] {
  padding-top: calc(84px + env(safe-area-inset-top));
}

.result-header { text-align: center; margin-bottom: 44px; }
.confirm-greeting {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--muted-2);
  margin-bottom: 18px;
}
.confirm-headline { margin-bottom: 12px; }
.confirm-subline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ember);
}

.phase-block { text-align: center; margin-bottom: 30px; }
.phase-name {
  font-family: var(--serif);
  font-size: clamp(38px, 10.5vw, 56px);
  font-weight: 430;
  font-variation-settings: "opsz" 70;
  font-style: italic;
  line-height: 1.05;
  color: var(--ember-hot);
  /* revealed by JS with a mask wipe */
  clip-path: inset(0 0 100% 0);
}
.phase-name.is-revealed {
  clip-path: inset(0 0 -10% 0);
  transition: clip-path 1100ms var(--ease) 250ms;
}
.phase-rule {
  width: 72px; height: 1px;
  margin: 22px auto 0;
  background: linear-gradient(90deg, rgba(216, 158, 88, 0), var(--ember), rgba(216, 158, 88, 0));
}

.reading-banner {
  width: min(100%, 420px);
  margin: 0 auto 28px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  padding: 9px;
  background: linear-gradient(180deg, rgba(34, 24, 15, 0.5), rgba(18, 13, 9, 0.6));
}
/* cropped to a wide plate so the reading starts above the fold —
   the art is centered, so a 16:10 center crop keeps the figure */
.reading-banner img { width: 100%; height: auto; border-radius: 4px; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 52%; }

/* the reading itself — a typeset page */
.reading-page {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 38px 26px 34px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(33, 23, 15, 0.55), rgba(19, 14, 10, 0.7));
}
.reading-page::before {
  content: "";
  position: absolute; inset: 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  pointer-events: none;
}
.reading-pullquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(21px, 5.8vw, 25px);
  font-weight: 440;
  line-height: 1.4;
  color: var(--ember-hot);
  margin-bottom: 22px;
}
.reading-line {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  font-variation-settings: "opsz" 14;
  line-height: 1.7;
  color: var(--bone);
  margin-bottom: 16px;
  /* scroll-revealed: design enforces "read this slowly" */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.reading-line.is-read { opacity: 1; transform: translateY(0); }
.reading-line:last-child { margin-bottom: 0; }

.result-continue { max-width: 560px; margin: 36px auto 24px; }

/* ==========================================================================
   BRIDGE
   ========================================================================== */

.bridge-commit {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ember);
  margin-top: 18px;
}

/* ==========================================================================
   OFFER
   ========================================================================== */

.screen[data-screen="offer"] {
  padding-left: 0; padding-right: 0;
  padding-top: calc(64px + env(safe-area-inset-top));
}
.offer-inner {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 calc(var(--pad) + env(safe-area-inset-right)) 0 calc(var(--pad) + env(safe-area-inset-left));
}

.offer-section { margin-bottom: 72px; }

.section-head { text-align: center; margin-bottom: 28px; }
.section-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--muted-2);
  margin-top: 4px;
}

/* phase cards — stacked, the user's phase is marked */
.phase-cards { display: flex; flex-direction: column; gap: 18px; }
.phase-card {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(30, 21, 14, 0.7), rgba(17, 12, 9, 0.85));
}
.phase-card.is-yours {
  border-color: transparent;
  box-shadow: 0 0 0 1.5px var(--ember), 0 18px 50px -20px rgba(216, 158, 88, 0.35);
}
.you-are-here {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 3;
  padding: 7px 13px;
  border-radius: 100px;
  background: var(--ember);
  color: #1C1209;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 6px 18px -4px rgba(216, 158, 88, 0.6);
}
.phase-card-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.phase-card-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; filter: sepia(0.12) saturate(1.04); }
.phase-card-img::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 7, 5, 0) 40%, rgba(13, 9, 6, 0.92) 100%);
}
.phase-card-body { padding: 20px 22px 24px; margin-top: -34px; position: relative; z-index: 2; }
.phase-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  color: var(--ember);
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}
.phase-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 480;
  margin-bottom: 10px;
}
.phase-desc { font-size: 15.5px; line-height: 1.62; color: var(--bone-soft); margin-bottom: 14px; }
.phase-recognition {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted-2);
  padding-left: 14px;
  border-left: 2px solid var(--ember-deep);
}
.phase-recognition em { font-family: var(--serif); font-style: italic; }
.phase-recognition .label { color: var(--ember); font-weight: 600; font-style: normal; }

/* product hero */
.product-hero {
  position: relative;
  text-align: center;
  padding: 56px 0 40px;
  overflow: hidden;
}
.product-hero-bg {
  position: absolute; inset: 0; z-index: -1;
}
.product-hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.35;
  filter: sepia(0.2) brightness(1.06);
}
.product-hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--ink-1) 0%, rgba(15, 11, 8, 0.55) 30%, rgba(15, 11, 8, 0.6) 70%, var(--ink-1) 100%);
}
.product-title { margin-bottom: 8px; }
.product-byline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--ember-hot);
  margin-bottom: 30px;
}

.product-portrait {
  width: min(72vw, 300px);
  margin: 0 auto 26px;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(34, 24, 15, 0.6), rgba(18, 13, 9, 0.7));
}
.product-portrait img { width: 100%; border-radius: 4px; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 15%; }

.product-phase-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ember-hot);
  max-width: 34ch;
  margin: 0 auto 14px;
}
.product-desc {
  font-size: 16px;
  line-height: 1.65;
  color: var(--bone-soft);
  max-width: 42ch;
  margin: 0 auto 28px;
}

.product-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
  max-width: 420px;
  margin: 0 auto 32px;
  text-align: left;
}
.product-bullets li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--bone);
}
.bullet-icon { flex: 0 0 26px; color: var(--ember); }
.bullet-icon svg { width: 26px; height: 26px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.product-cta-wrap { max-width: 420px; margin: 0 auto; }

.price-block { margin-top: 26px; }
.price-now {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 480;
  color: var(--bone);
}
.price-fine { margin-top: 8px; font-size: 13.5px; color: var(--muted-2); }
.price-compare {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
}
.price-compare span {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  color: var(--muted);
}

/* codex */
.codex { text-align: center; }
.codex-cover {
  width: min(64vw, 270px);
  margin: 0 auto 28px;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(34, 24, 15, 0.6), rgba(18, 13, 9, 0.7));
}
.codex-cover img { width: 100%; border-radius: 4px; aspect-ratio: 1 / 1; object-fit: cover; }
.codex-headline { margin-bottom: 16px; }
.codex-provenance {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 4.8vw, 20px);
  color: var(--ember-hot);
  margin-bottom: 20px;
}
.codex-body p { font-size: 16px; line-height: 1.65; color: var(--bone-soft); margin-bottom: 12px; }
.codex-body .note { font-size: 14.5px; color: var(--muted-2); }

/* honest note — letterpress block */
.honest-note {
  max-width: 480px;
  margin: 0 auto;
  padding: 30px 26px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(33, 23, 15, 0.55), rgba(19, 14, 10, 0.7));
  text-align: center;
}
.honest-note-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 18px;
}
.honest-note p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--bone);
  margin-bottom: 12px;
}
.honest-note p:last-child { margin-bottom: 0; }

/* meet quasim */
.meet { text-align: center; }
.meet-portrait {
  width: min(78vw, 340px);
  margin: 0 auto 26px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-2);
}
.meet-portrait img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; object-position: 50% 20%; }
.meet-body { max-width: 46ch; margin: 0 auto; text-align: left; }
.meet-body p { font-size: 16px; line-height: 1.7; color: var(--bone-soft); margin-bottom: 14px; }
.meet-body p:first-child {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18.5px;
  color: var(--bone);
}

/* FAQ */
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 60px;
  padding: 19px 2px;
  font-family: var(--serif);
  font-size: 18.5px;
  font-weight: 460;
  text-align: left;
  color: var(--bone);
  transition: color var(--t-fast);
}
.faq-item.is-open .faq-q { color: var(--ember-hot); }
.faq-chevron { flex: 0 0 20px; transition: transform var(--t-med) var(--ease); color: var(--ember); }
.faq-chevron svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.faq-item.is-open .faq-chevron { transform: rotate(180deg); }
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--t-med) var(--ease);
}
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; }
.faq-a p { padding: 0 2px 22px; font-size: 15.5px; line-height: 1.65; color: var(--bone-soft); }

/* closer */
.closer { text-align: center; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.closer-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 5.6vw, 24px);
  color: var(--ember-hot);
  margin-bottom: 12px;
}
.closer-attr { font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); margin-bottom: 30px; }
.closer .btn { max-width: 420px; }
.closer-reassure { margin-top: 14px; font-size: 13px; color: var(--muted-2); }

/* divider sigil between offer sections */
.divider {
  text-align: center;
  color: var(--ember);
  font-size: 15px;
  margin: 0 0 72px;
  opacity: 0.7;
}

/* scroll-reveal for offer sections */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 750ms var(--ease), transform 750ms var(--ease);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  body::before, .intro-bg img, .door-light, .weigh-sigil, .play-btn::before,
  .waveform.is-active span { animation: none !important; }
  .is-active .frame > * { animation: none !important; }
  .reading-line, .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .phase-name { clip-path: none !important; }
  * { transition-duration: 1ms !important; }
}

/* ==========================================================================
   LARGER VIEWPORTS — derived view, gently widened
   ========================================================================== */

@media (min-width: 700px) {
  .options.icon-grid { grid-template-columns: 1fr 1fr 1fr; }
  .options.icon-grid .opt.span-2 { grid-column: auto; flex-direction: column; }
  .scene-stack { flex-direction: row; }
  .scene { aspect-ratio: 3 / 4; max-height: none; flex: 1; }
  .scene::after { background: linear-gradient(180deg, rgba(8,6,4,0) 40%, rgba(8,6,4,0.72) 100%); }
}
