/* =========================================================================
   FLIGHT MODE
   Deliberately avoids backdrop-filter: a live WebGL canvas sits behind every
   panel, and blurring it per-element costs more than it is worth. Translucent
   gradients over the moving sky read as glass on their own.
   ========================================================================= */

@font-face {
  font-family: 'Archivo';
  src: url('../assets/fonts/archivo-100_900.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'DM Mono';
  src: url('../assets/fonts/dmmono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'DM Mono';
  src: url('../assets/fonts/dmmono-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  --ink:        #05070f;
  --ink-2:      #0a1020;
  --cream:      #f4efe6;
  --cream-dim:  #c3bfb6;
  --muted:      #8d93a6;
  --amber:      #ffc46b;
  --amber-deep: #f0a53c;
  --coral:      #ff6b45;
  --aqua:       #8fd9e8;

  --hair:       rgba(255, 255, 255, 0.13);
  --hair-soft:  rgba(255, 255, 255, 0.07);
  --glass:      linear-gradient(165deg, rgba(20, 29, 54, 0.72), rgba(7, 11, 24, 0.82));
  --glass-lift: linear-gradient(165deg, rgba(32, 44, 76, 0.82), rgba(11, 17, 33, 0.88));

  --sans: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-lg: 22px;
  --r-md: 15px;
  --r-sm: 9px;

  --ease: cubic-bezier(0.22, 0.85, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --pad: clamp(1.1rem, 4vw, 2.6rem);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

body {
  min-height: 100svh;
  /* Prevent the iOS double-tap zoom stealing taps on the answer cards. */
  touch-action: manipulation;
}

img { max-width: 100%; display: block; }

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

::selection { background: var(--amber); color: var(--ink); }

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

/* ---------------------------------------------------------------- backdrop */

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  /* Canvas renders at ~half resolution; a whisper of blur turns that from
     "low res" into "shallow depth of field". */
  filter: blur(0.4px) saturate(1.06);
  transform: scale(1.02);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* The cloud deck is deliberately bright; this keeps a readable pocket in the
     middle of the frame without flattening the sky at the edges. */
  background:
    radial-gradient(68% 52% at 50% 52%, rgba(4, 6, 14, 0.62) 0%, rgba(4, 6, 14, 0.24) 55%, transparent 78%),
    radial-gradient(120% 80% at 50% 0%, transparent 26%, rgba(3, 5, 12, 0.55) 100%),
    linear-gradient(180deg, rgba(4, 6, 14, 0.68) 0%, rgba(4, 6, 14, 0.2) 30%, rgba(4, 6, 14, 0.4) 62%, rgba(4, 6, 14, 0.82) 100%);
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  animation: grain 900ms steps(4) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-3%, 2%); }
  50%  { transform: translate(2%, -3%); }
  75%  { transform: translate(-2%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ------------------------------------------------------------------ chrome */

.chrome {
  position: fixed;
  z-index: 40;
  top: 0; left: 0; right: 0;
  padding: calc(var(--safe-t) + 0.85rem) var(--pad) 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: none;
}
.chrome > * { pointer-events: auto; }

/* The header floats over a scrolling page; without this, result copy passes
   directly under the wordmark and both become unreadable. */
.chrome::before {
  content: '';
  position: absolute;
  inset: 0 0 -22px 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 7, 15, 0.94) 0%, rgba(5, 7, 15, 0.66) 48%, transparent 100%);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-dim);
  transition: color 0.3s var(--ease);
}
.mark:hover { color: var(--cream); }
.mark svg { width: 17px; height: 17px; fill: var(--amber); }

.sound {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--hair);
  border-radius: 100px;
  background: rgba(8, 12, 24, 0.5);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cream-dim);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.sound:hover { border-color: rgba(255, 196, 107, 0.5); color: var(--cream); }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i {
  width: 2px;
  background: var(--amber);
  border-radius: 1px;
  height: 30%;
  animation: eq 900ms ease-in-out infinite alternate;
}
.bars i:nth-child(2) { animation-delay: 130ms; }
.bars i:nth-child(3) { animation-delay: 260ms; }
.bars i:nth-child(4) { animation-delay: 390ms; }
@keyframes eq { from { height: 22%; } to { height: 100%; } }

.sound[aria-pressed='false'] .bars i {
  animation: none;
  height: 22%;
  background: var(--muted);
}
.sound[aria-pressed='false'] { color: var(--muted); }

/* ------------------------------------------------------------------- stage */

.stage {
  position: relative;
  z-index: 10;
  min-height: 100svh;
}

.screen {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: calc(var(--safe-t) + 4.5rem) var(--pad) calc(var(--safe-b) + 2rem);
}

/* ------------------------------------------------------------------- intro */

.intro-inner {
  width: min(100%, 62rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.9rem, 2.4vw, 1.5rem);
}

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(0.6rem, 1.6vw, 0.72rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amber);
  opacity: 0.85;
}

.intro-h1 {
  margin: 0;
  font-size: clamp(2rem, 6.4vw, 4.4rem);
  font-weight: 500;
  font-stretch: 88%;
  line-height: 0.98;
  letter-spacing: -0.028em;
  max-width: 15ch;
}
.intro-h1 span { display: inline-block; }
.intro-h1 span:nth-child(2) {
  font-style: italic;
  font-weight: 600;
  background: linear-gradient(96deg, var(--amber) 10%, var(--coral) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Italic terminals overhang the inline box; background-clip would shear
     the last glyph without this. */
  padding-inline: 0.09em;
  margin-inline: -0.09em;
}

.lede {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(0.95rem, 2.1vw, 1.12rem);
  line-height: 1.62;
  color: var(--cream-dim);
  text-wrap: pretty;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.fineprint {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.scroll-hint {
  position: absolute;
  bottom: calc(var(--safe-b) + 1.2rem);
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 46px;
  overflow: hidden;
  background: var(--hair-soft);
}
.scroll-hint span {
  display: block;
  width: 100%;
  height: 40%;
  background: linear-gradient(180deg, transparent, var(--amber));
  animation: drip 2.4s var(--ease) infinite;
}
@keyframes drip {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(250%); }
}

/* ------------------------------------------------------------------ button */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  border-radius: 100px;
  border: 1px solid var(--hair);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  overflow: hidden;
  isolation: isolate;
  min-height: 48px;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), color 0.35s var(--ease);
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--glass);
  transition: opacity 0.35s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.985); }

.btn-primary {
  color: #1a1206;
  border-color: transparent;
  padding-inline: 1.9rem;
}
.btn-primary::before {
  background: linear-gradient(96deg, var(--amber) 0%, var(--amber-deep) 55%, var(--coral) 130%);
  opacity: 1;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
  transform: translateX(-130%);
  transition: transform 0.85s var(--ease);
}
.btn-primary:hover::after { transform: translateX(130%); }
.btn-arrow { transition: transform 0.4s var(--ease); }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

.btn-ghost { color: var(--cream-dim); }
.btn-ghost:hover { color: var(--cream); border-color: rgba(255, 196, 107, 0.45); }

.btn-back {
  align-self: flex-start;
  margin-top: 0.4rem;
  padding: 0.6rem 1.05rem;
  min-height: 42px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border-color: transparent;
}
.btn-back::before { opacity: 0; }
.btn-back:hover { color: var(--cream); }
.btn-back[hidden] { display: none; }

/* -------------------------------------------------------------- split-flap */

.board { display: flex; flex-direction: column; align-items: center; gap: 0.34em; }
.board-row { display: flex; flex-direction: column; align-items: center; gap: 0.3em; }

.sf {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 0.085em;
  perspective: 800px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(1.65rem, 7.4vw, 3.6rem);
  line-height: 1;
}
.board-lg .sf { font-size: clamp(1.5rem, 7vw, 3rem); }

.sf-cell {
  position: relative;
  width: 0.84em;
  height: 1.2em;
  border-radius: 5px;
  transform-style: preserve-3d;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.sf-half, .sf-leaf {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  background: linear-gradient(180deg, #1d2740, #101728);
  backface-visibility: hidden;
}
.sf-top, .sf-leaf-a {
  top: 0;
  border-radius: 5px 5px 0 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.55);
  background: linear-gradient(180deg, #222e4c 0%, #172038 100%);
}
.sf-bot, .sf-leaf-b {
  bottom: 0;
  border-radius: 0 0 5px 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  background: linear-gradient(180deg, #131b2e 0%, #0c1222 100%);
}
.sf-leaf-a { transform-origin: bottom center; z-index: 3; display: none; }
.sf-leaf-b { transform-origin: top center; z-index: 3; display: none; }

.sf-half i, .sf-leaf i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2em;              /* = cell height, so halves crop one glyph */
  line-height: 1.2em;
  text-align: center;
  font-style: normal;
  color: var(--cream);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.sf-top i, .sf-leaf-a i { top: 0; }
.sf-bot i, .sf-leaf-b i { top: -0.6em; }

/* ---------------------------------------------------------------- question */

.q-inner {
  width: min(100%, 60rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 2.2vw, 1.35rem);
}

.q-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.q-kicker { color: var(--amber); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8); }
.q-count { color: var(--cream-dim); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8); }

/* Copy sits directly on the sky, so it carries its own shadow. */
.q-prompt, .intro-h1, .lede, .pass-name { text-shadow: 0 2px 26px rgba(2, 4, 10, 0.55); }

.q-body {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 3vw, 1.8rem);
}

.q-art {
  flex: 0 0 auto;
  width: clamp(72px, 15vw, 132px);
  aspect-ratio: 1;
  margin: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--hair);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}
.q-art img { width: 100%; height: 100%; object-fit: cover; }

.q-prompt {
  margin: 0;
  font-size: clamp(1.32rem, 4.2vw, 2.35rem);
  font-weight: 500;
  font-stretch: 92%;
  line-height: 1.1;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.q-prompt .w { display: inline-block; }

.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  min-height: 74px;
  text-align: left;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  background: var(--glass);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.4s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.opt::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60% 120% at var(--mx, 50%) var(--my, 50%), rgba(255, 196, 107, 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
@media (hover: hover) {
  .opt:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 196, 107, 0.42);
    background: var(--glass-lift);
  }
  .opt:hover::after { opacity: 1; }
}
.opt:active { transform: translateY(-1px) scale(0.99); }

.opt-key {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--amber);
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.opt:hover .opt-key { background: rgba(255, 196, 107, 0.14); border-color: rgba(255, 196, 107, 0.4); }

.opt-text { display: flex; flex-direction: column; gap: 0.22rem; }
.opt-label { font-size: 0.98rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.008em; }
.opt-detail { font-size: 0.8rem; line-height: 1.42; color: var(--muted); text-wrap: pretty; }

.opt.is-chosen {
  border-color: var(--amber);
  background: linear-gradient(150deg, rgba(255, 196, 107, 0.22), rgba(255, 107, 69, 0.1));
}
.opt.is-chosen .opt-key { background: var(--amber); color: #17110a; border-color: transparent; }

/* The stamp that thuds down on the chosen card. */
.opt .stamp {
  position: absolute;
  top: 50%;
  right: 1rem;
  translate: 0 -50%;
  width: 46px;
  height: 46px;
  border: 2px solid var(--amber);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.05em;
  color: var(--amber);
  opacity: 0;
  rotate: -18deg;
  scale: 2.4;
  pointer-events: none;
}
.opt.is-chosen .stamp { animation: stamp 0.5s var(--ease-out) forwards; }
@keyframes stamp {
  0%   { opacity: 0; scale: 2.4; rotate: -34deg; }
  55%  { opacity: 0.95; scale: 0.94; rotate: -14deg; }
  100% { opacity: 0.8; scale: 1; rotate: -16deg; }
}

/* -------------------------------------------------------------- route line */

.route {
  position: fixed;
  z-index: 30;
  left: 0; right: 0;
  bottom: calc(var(--safe-b) + 0.7rem);
  height: 54px;
  pointer-events: none;
  padding-inline: var(--pad);
}
.route svg { width: 100%; height: 100%; overflow: visible; }
.route .line { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 1.4; stroke-dasharray: 3 7; }
.route .done { fill: none; stroke: var(--amber); stroke-width: 1.8; stroke-linecap: round; filter: drop-shadow(0 0 7px rgba(255, 196, 107, 0.6)); }
.route .node { fill: rgba(255, 255, 255, 0.35); }
.route .node.end { fill: rgba(255, 255, 255, 0.22); }
.route .plane { fill: var(--amber); filter: drop-shadow(0 0 8px rgba(255, 196, 107, 0.7)); }
.route .cap {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  fill: var(--muted);
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ reveal */

.reveal { gap: 1.6rem; text-align: center; }
.reveal-status {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  min-height: 1.2em;
}
.reveal-code {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.5em;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
.reveal-code.on { opacity: 1; }

/* ------------------------------------------------------------------ result */

.result {
  justify-content: flex-start;
  padding-top: calc(var(--safe-t) + 5.5rem);
  gap: clamp(2.4rem, 7vw, 4.5rem);
}
.result > * { width: min(100%, 62rem); }

.pass {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  border-radius: var(--r-lg);
  border: 1px solid var(--hair);
  background: var(--glass-lift);
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  transform-style: preserve-3d;
  will-change: transform;
}

.pass-main { padding: clamp(1.4rem, 4vw, 2.4rem); display: flex; flex-direction: column; gap: 1rem; }

.pass-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.pass-meta b { color: var(--amber); font-weight: 500; }

.pass-name {
  margin: 0;
  font-size: clamp(1.9rem, 6.6vw, 3.5rem);
  font-weight: 600;
  font-stretch: 84%;
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.pass-tag {
  margin: 0;
  font-size: clamp(0.98rem, 2.4vw, 1.2rem);
  line-height: 1.45;
  color: var(--amber);
  font-style: italic;
  text-wrap: pretty;
}

.pass-code {
  display: flex;
  gap: 0.4rem;
  margin-top: auto;   /* sits on the baseline of the stub, like a real pass */
  padding-top: 0.6rem;
}
.pass-code span {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.6rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--hair);
  background: rgba(0, 0, 0, 0.32);
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--amber);
}

.pass-art {
  position: relative;
  /* Lets the artwork set a sane card height instead of the 3:4 source
     stretching the whole pass to 600px+. */
  aspect-ratio: 5 / 4;
  min-height: 260px;
  border-left: 1px dashed rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.pass-art img {
  width: 100%; height: 100%;
  object-fit: cover;
  clip-path: inset(0 0 100% 0);
}
.pass-art img.on {
  animation: aperture 1.15s var(--ease-out) forwards;
}
@keyframes aperture {
  from { clip-path: inset(0 0 100% 0); transform: scale(1.14); }
  to   { clip-path: inset(0 0 0 0);    transform: scale(1); }
}
.pass-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, transparent 40%, rgba(5, 7, 15, 0.6) 100%);
  pointer-events: none;
}

/* Perforation between stub and body. */
.pass::before, .pass::after {
  content: '';
  position: absolute;
  left: calc(55.5% - 9px);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink);
  z-index: 3;
}
.pass::before { top: -9px; }
.pass::after { bottom: -9px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}
.section-head h3 {
  margin: 0;
  font-size: 0.72rem;
  font-family: var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 400;
}
.section-head hr {
  flex: 1;
  border: 0;
  border-top: 1px solid var(--hair-soft);
  margin: 0;
}

.prose p {
  margin: 0 0 1rem;
  font-size: clamp(1rem, 2.2vw, 1.14rem);
  line-height: 1.72;
  color: var(--cream-dim);
  text-wrap: pretty;
  max-width: 62ch;
}
.prose p:last-child { margin-bottom: 0; }

.facets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.7rem; }
.facet {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  background: var(--glass);
}
.facet h4 {
  margin: 0 0 0.45rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.facet p { margin: 0; font-size: 0.94rem; line-height: 1.5; }
.facet.good h4 { color: var(--aqua); }
.facet.shadow h4 { color: var(--coral); }

/* Axis readout */
.axes { display: flex; flex-direction: column; gap: 1.15rem; }
.axis-row { display: grid; grid-template-columns: 1fr; gap: 0.4rem; }
.axis-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}
.axis-labels .on { color: var(--cream); }
.axis-track {
  position: relative;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.09);
}
.axis-track i {
  position: absolute;
  top: 50%;
  width: 14px; height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 196, 107, 0.16), 0 0 14px rgba(255, 196, 107, 0.7);
  left: 50%;
  transition: left 1.1s var(--ease-out);
}
.axis-track b {
  position: absolute;
  top: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 196, 107, 0.5));
  border-radius: 3px;
  transition: all 1.1s var(--ease-out);
}
.axis-note { font-size: 0.85rem; line-height: 1.55; color: var(--muted); margin: 0.15rem 0 0; max-width: 68ch; }

/* Meters */
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.4rem; }
.meter-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 0.63rem; letter-spacing: 0.15em; text-transform: uppercase;
}
.meter-head span:first-child { color: var(--cream); }
.meter-head span:last-child { color: var(--amber); }
.meter-track {
  margin-top: 0.55rem;
  height: 46px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.meter-track i {
  flex: 1;
  border-radius: 2px 2px 1px 1px;
  background: rgba(255, 255, 255, 0.1);
  height: 16%;
  transition: height 0.8s var(--ease-out), background 0.8s var(--ease-out);
}
.meter-track i.lit {
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  box-shadow: 0 0 10px rgba(255, 196, 107, 0.35);
}
/* The bar just past the reading marks the level, like a needle. */
.meter-track i.edge { background: var(--coral); box-shadow: 0 0 14px rgba(255, 107, 69, 0.6); }
.meter-ends {
  display: flex; justify-content: space-between;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: var(--muted);
}

/* Compatibility */
.mates { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.7rem; }
.mate {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  background: var(--glass);
  text-align: left;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}
.mate:hover { transform: translateY(-3px); border-color: rgba(255, 196, 107, 0.4); }
.mate img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.mate div { min-width: 0; }
.mate strong { display: block; font-size: 0.88rem; font-weight: 600; line-height: 1.2; }
.mate small { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.16em; color: var(--muted); }
.mate.friction:hover { border-color: rgba(255, 107, 69, 0.5); }
.mate.friction small { color: var(--coral); }

/* Science */
.science details {
  border-top: 1px solid var(--hair-soft);
  padding: 1rem 0;
}
.science details:last-of-type { border-bottom: 1px solid var(--hair-soft); }
.science summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1rem;
  font-weight: 500;
}
.science summary::-webkit-details-marker { display: none; }
.science summary::after {
  content: '+';
  font-family: var(--mono);
  color: var(--amber);
  transition: transform 0.35s var(--ease);
}
.science details[open] summary::after { transform: rotate(45deg); }
.science details p {
  margin: 0.8rem 0 0;
  font-size: 0.94rem;
  line-height: 1.68;
  color: var(--muted);
  max-width: 68ch;
}

.sources { list-style: none; margin: 1.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.sources li { font-size: 0.82rem; line-height: 1.5; color: var(--muted); }
.sources a { color: var(--aqua); text-decoration: none; border-bottom: 1px solid rgba(143, 217, 232, 0.3); }
.sources a:hover { border-bottom-color: var(--aqua); }

.disclaimer {
  margin-top: 1.6rem;
  padding: 1rem 1.2rem;
  border-left: 2px solid var(--coral);
  font-size: 0.86rem;
  line-height: 1.62;
  color: var(--muted);
  background: rgba(255, 107, 69, 0.05);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.result-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  padding-bottom: 2rem;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.7rem;
}
.gcard {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--hair);
  aspect-ratio: 3 / 4;
  text-align: left;
  transition: transform 0.45s var(--ease), border-color 0.35s var(--ease);
}
.gcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.gcard::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(4, 6, 14, 0.92) 100%);
}
.gcard span {
  position: absolute;
  z-index: 2;
  left: 0.75rem; right: 0.75rem; bottom: 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.15;
}
.gcard small {
  position: absolute;
  z-index: 2;
  left: 0.75rem; top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--amber);
}
.gcard:hover { transform: translateY(-5px); border-color: rgba(255, 196, 107, 0.5); }
.gcard:hover img { transform: scale(1.07); }
.gcard.is-you { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 20px 40px rgba(0, 0, 0, 0.5); }

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--safe-b) + 5.5rem);
  translate: -50% 0;
  padding: 0.7rem 1.2rem;
  border-radius: 100px;
  border: 1px solid var(--hair);
  background: rgba(10, 15, 30, 0.94);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), translate 0.35s var(--ease);
}
.toast.on { opacity: 1; translate: -50% -8px; }

.noscript {
  position: relative;
  z-index: 50;
  margin: 30vh auto;
  max-width: 30rem;
  text-align: center;
  padding: 2rem;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .options { grid-template-columns: 1fr; gap: 0.5rem; }
  .opt { min-height: 64px; padding: 0.85rem 0.95rem; }
  .opt-label { font-size: 0.94rem; }
  .opt-detail { font-size: 0.78rem; }
  .q-body { align-items: center; }
  .pass { grid-template-columns: 1fr; }
  .pass-art { aspect-ratio: 4 / 3; min-height: 0; order: -1; border-left: 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.18); }
  .pass::before, .pass::after { display: none; }
  .sound-label { display: none; }
  .sound { padding: 0.5rem 0.7rem; }
  .route { height: 46px; }
}

/* Short viewports: the vignette is the first thing to go. */
@media (max-height: 680px) and (max-width: 760px) {
  .q-art { display: none; }
  .screen { padding-top: calc(var(--safe-t) + 3.6rem); }
}

/* Only the genuinely tiny screens lose the answer detail — 375px phones are
   still common and the detail is where most of the personality lives. */
@media (max-width: 340px) {
  .opt-detail { display: none; }
  .opt { min-height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .grain { animation: none; }
  .pass-art img { clip-path: none; }
}
