/* ─────────────────────────────────────────────────────────
   one question.
   Drenched emerald-velvet. Cream type. One gold accent.
   ───────────────────────────────────────────────────────── */

:root {
  --ink:        oklch(15.5% 0.028 168);
  --ink-deep:   oklch(10%   0.022 168);
  --velvet:     oklch(23%   0.045 166);
  --cream:      oklch(95%   0.020 88);
  --cream-soft: oklch(86%   0.018 88 / 0.70);
  --cream-mute: oklch(80%   0.016 88 / 0.42);
  --gold:       oklch(81%   0.135 76);
  --gold-deep:  oklch(64%   0.128 62);
  --blush:      oklch(74%   0.155 18);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);      /* ease-out-expo */
  --ease-q: cubic-bezier(0.22, 1, 0.36, 1);   /* ease-out-quint */

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(1.25rem, 5vw, 4rem);
}

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

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--velvet) 0%, transparent 62%),
    radial-gradient(90% 60% at 50% 118%, oklch(20% 0.05 150) 0%, transparent 60%),
    var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Subtle film grain so the drench never reads as flat CSS. */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 60;
  opacity: 0.035;
  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)'/%3E%3C/svg%3E");
}

/* ── ASK ─────────────────────────────────────────────── */

.stage {
  position: relative;
  z-index: 5;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.75rem, 5vh, 3rem);
  padding: clamp(2.5rem, 8vh, 5rem) var(--gutter);
  text-align: center;
  transition: opacity 0.6s var(--ease), transform 0.7s var(--ease), filter 0.6s var(--ease);
}

.stage.dismissed {
  opacity: 0;
  transform: scale(0.965) translateY(-10px);
  filter: blur(8px);
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  font-size: clamp(0.6rem, 1.9vw, 0.7rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--cream-mute);
  animation: rise 1s var(--ease) backwards 0.1s;
}

.question {
  margin: 0;
  max-width: 17ch;
  font-family: var(--display);
  font-variation-settings: "SOFT" 22, "WONK" 1, "opsz" 120;
  font-weight: 400;
  font-size: clamp(2.35rem, 8.6vw, 5.1rem);
  line-height: 0.99;
  letter-spacing: -0.022em;
  text-wrap: balance;
  animation: rise 1.15s var(--ease) backwards 0.2s;
}

.question em {
  font-style: italic;
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 144;
  color: var(--gold);
}

/* ── choices ─────────────────────────────────────────── */

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.75rem, 3vw, 1.25rem);
  width: min(400px, 100%);
  animation: rise 1.2s var(--ease) backwards 0.42s;
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
}

.btn {
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  width: 100%;
  padding: 1.05rem 1rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    transform 0.4s var(--ease),
    background-color 0.35s var(--ease),
    color 0.35s var(--ease),
    box-shadow 0.45s var(--ease),
    opacity 0.4s linear;
}

.btn-yes {
  background: var(--gold);
  color: oklch(19% 0.05 82);
  box-shadow: 0 1px 0 oklch(96% 0.06 92 / 0.5) inset, 0 10px 34px -14px var(--gold-deep);
}
.btn-yes:hover { transform: translateY(-2px); box-shadow: 0 1px 0 oklch(96% 0.06 92 / 0.5) inset, 0 18px 44px -14px var(--gold-deep); }
.btn-yes:active { transform: translateY(0) scale(0.985); }

.btn-yes.solo {
  animation: breathe 2.6s ease-in-out infinite 0.4s;
}

.btn-no {
  background: transparent;
  color: var(--cream-soft);
  border-color: oklch(86% 0.018 88 / 0.24);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.btn-no.loose {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  margin: 0;
  will-change: transform;
  transition: opacity 0.5s linear, border-color 0.4s linear, color 0.4s linear;
}

.btn-no.panicked {
  color: var(--cream-soft);
  border-color: oklch(86% 0.018 88 / 0.34);
  background: oklch(20% 0.035 168 / 0.6);
}

.btn-no.gone { opacity: 0; }

.verdict {
  position: absolute;
  inset: -0.5rem -0.25rem;
  margin: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-style: italic;
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 30;
  font-size: 0.98rem;
  line-height: 1.22;
  color: var(--gold);
  opacity: 0;
  filter: blur(6px);
  transform: scale(0.94);
  transition: opacity 0.7s var(--ease), filter 0.7s var(--ease), transform 0.8s var(--ease);
  pointer-events: none;
}

.verdict.shown { opacity: 1; filter: blur(0); transform: none; }

.hint {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--cream-mute);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.hint.shown { opacity: 1; }

/* ── REVEAL ──────────────────────────────────────────── */

.reveal {
  position: relative;
  z-index: 5;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 3.5vh, 3.5rem);
  padding: clamp(1.5rem, 4vh, 4.5rem) var(--gutter);
  text-align: center;
}

.receipt {
  margin: 0;
  transform: rotate(-1.8deg);
  animation: land 1.1s var(--ease) backwards 0.12s;
}

.receipt img {
  display: block;
  width: min(200px, 52vw);
  height: auto;
  border-radius: 7px;
  border: 1px solid oklch(86% 0.018 88 / 0.16);
  box-shadow:
    0 2px 6px oklch(8% 0.02 168 / 0.5),
    0 26px 70px -22px oklch(6% 0.02 168 / 0.85);
}

/* Width in rem, not ch: this wrapper inherits the mono font, so `ch` would
   size against the wrong typeface entirely. */
.verdict-copy {
  max-width: 19rem;
}

.stamp {
  margin: 0 0 clamp(0.85rem, 2.4vh, 1.35rem);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream-mute);
  animation: rise 0.9s var(--ease) backwards 0.5s;
}

.punchline {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: "SOFT" 24, "WONK" 1, "opsz" 110;
  font-weight: 400;
  font-size: clamp(1.55rem, 6.2vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.punchline .r {
  display: block;
  animation: rise 1s var(--ease) backwards;
  animation-delay: calc(0.62s + var(--i) * 0.13s);
}

.em-dim { color: var(--cream-soft); }
.em-gold { color: var(--gold); font-style: italic; font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 144; }
.smirk { font-family: system-ui, "Apple Color Emoji", sans-serif; font-style: normal; font-size: 0.72em; vertical-align: 0.06em; }

.closer {
  margin: clamp(1.1rem, 3vh, 1.75rem) 0 0;
  font-size: 0.64rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cream-mute);
  animation: rise 1s var(--ease) backwards calc(0.62s + var(--i) * 0.13s);
}

/* Desktop: portrait photo beside the line, not stacked under it. */
@media (min-width: 860px) {
  .reveal {
    flex-direction: row;
    justify-content: center;
    gap: clamp(3rem, 6vw, 6rem);
    text-align: left;
  }
  .receipt img { width: min(320px, 26vw); }
  .verdict-copy { max-width: 27rem; }
  .punchline { font-size: clamp(1.9rem, 2.9vw, 3.2rem); }
}

/* ── confetti ────────────────────────────────────────── */

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

/* ── motion ──────────────────────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); filter: blur(5px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes land {
  from { opacity: 0; transform: rotate(-7deg) scale(0.9) translateY(26px); }
  to   { opacity: 1; transform: rotate(-1.8deg) scale(1) translateY(0); }
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 1px 0 oklch(96% 0.06 92 / 0.5) inset, 0 10px 34px -14px var(--gold-deep); }
  50%      { box-shadow: 0 1px 0 oklch(96% 0.06 92 / 0.5) inset, 0 14px 52px -12px var(--gold); }
}

@media (prefers-reduced-motion: reduce) {
  .eyebrow, .question, .choices, .receipt, .stamp, .punchline .r, .closer {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
  }
  .btn-yes.solo { animation: none; }
  .stage { transition-duration: 0.2s; }
}

/* ── GATE ────────────────────────────────────────────
   The page's entire first paint. Link previews that render the page
   instead of honouring og:image can only capture this. */

.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  gap: clamp(1.5rem, 5vh, 2.5rem);
  align-content: center;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--velvet) 0%, transparent 62%),
    radial-gradient(90% 60% at 50% 118%, oklch(20% 0.05 150) 0%, transparent 60%),
    var(--ink);
  transition: opacity 0.55s var(--ease), filter 0.55s var(--ease);
}

.gate.lifted {
  opacity: 0;
  filter: blur(10px);
  pointer-events: none;
}

.qmark {
  font-family: var(--display);
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 144;
  font-weight: 400;
  font-size: clamp(9rem, 48vw, 19rem);
  line-height: 0.8;
  color: var(--gold);
  animation: pulse 3.4s ease-in-out infinite;
}

.gate-hint {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream-mute);
  opacity: 0;
  animation: fade-in 1.2s var(--ease) 2.6s forwards;
}

@keyframes pulse {
  0%, 100% { opacity: 0.92; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.035); }
}

@keyframes fade-in { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .qmark { animation: none; }
  .gate-hint { animation-delay: 0.6s; }
}
