:root {
  --ink: #f7fbfa;
  --ink-soft: #d9e7e9;
  --sky: #dcebf2;
  --cream: #f7f1e5;
  --white: #fffdf8;
  --gold: #d8bd79;
  --gold-soft: rgba(196, 169, 107, 0.2);
  --text: rgba(247, 251, 250, 0.92);
  --muted: rgba(247, 251, 250, 0.72);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: #6f96a2;
  overflow: hidden;
}

body {
  height: 100%;
  margin: 0;
  color: var(--text);
  font-family: "Noto Serif JP", serif;
  font-weight: 300;
  letter-spacing: 0;
  background: #6f96a2;
  overflow: hidden;
}

button {
  font: inherit;
}

.app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

.app::before,
.app::after {
  content: "";
  position: absolute;
  inset: -10%;
  z-index: -2;
  pointer-events: none;
}

.app::before {
  background:
    radial-gradient(ellipse at 18% 68%, rgba(255, 255, 255, 0.66), transparent 15rem),
    radial-gradient(ellipse at 84% 64%, rgba(229, 240, 240, 0.46), transparent 16rem),
    radial-gradient(ellipse at 50% 42%, rgba(16, 78, 96, 0.5), transparent 20rem),
    radial-gradient(ellipse at 52% 78%, rgba(255, 255, 255, 0.34), transparent 22rem);
  opacity: 0;
  filter: blur(1.55rem);
  transition: opacity 720ms ease;
}

.app::after {
  background:
    radial-gradient(ellipse at 28% 8%, rgba(240, 248, 248, 0.48), transparent 14rem),
    radial-gradient(ellipse at 70% 8%, rgba(222, 235, 237, 0.42), transparent 18rem),
    radial-gradient(ellipse at 42% 56%, rgba(4, 39, 55, 0.5), transparent 16rem),
    linear-gradient(180deg, rgba(235, 247, 247, 0.34) 0%, transparent 32%, rgba(238, 243, 242, 0.2) 100%);
  opacity: 0;
  filter: blur(1.55rem);
  transition: opacity 720ms ease;
}

.app.is-opening::before,
.app.is-opening::after,
.app.is-opened::before,
.app.is-opened::after {
  opacity: 1;
}

.screen {
  position: absolute;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1.75rem;
  padding: 2.6rem 1.2rem 4.4rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.75rem);
  transition: opacity 680ms ease, transform 680ms ease;
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.landing-screen {
  background:
    radial-gradient(ellipse at 50% 44%, rgba(235, 255, 245, 0.42), transparent 17rem),
    linear-gradient(180deg, rgba(5, 39, 31, 0.34), rgba(5, 34, 28, 0.24)),
    url("assets/forest-entrance.png");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

.landing-screen::before,
.landing-screen::after {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: -1;
  pointer-events: none;
}

.landing-screen::before {
  background:
    radial-gradient(ellipse at 50% 42%, rgba(238, 255, 246, 0.44), transparent 14rem),
    radial-gradient(ellipse at 50% 86%, rgba(235, 248, 243, 0.38), transparent 19rem),
    linear-gradient(90deg, rgba(3, 31, 24, 0.3), transparent 24%, transparent 76%, rgba(2, 29, 24, 0.34));
  filter: blur(1.8rem);
  opacity: 0.6;
  transform: scale(1.02) translateY(0.4rem);
  transition: opacity 1000ms ease, transform 1650ms ease, filter 1650ms ease;
}

.landing-screen::after {
  background:
    radial-gradient(ellipse at 50% 42%, rgba(3, 27, 22, 0.16), transparent 15rem),
    linear-gradient(180deg, rgba(4, 29, 25, 0.36), rgba(2, 24, 20, 0.08) 32%, rgba(4, 29, 25, 0.32));
  filter: blur(0);
  opacity: 0.82;
  transition: opacity 1000ms ease, transform 1650ms ease;
}

.landing-screen.is-transitioning::before {
  opacity: 1;
  filter: blur(4.2rem);
  transform: scale(1.36) translateY(-2.6rem);
}

.landing-screen.is-transitioning::after {
  opacity: 0.18;
  transform: scale(1.18) translateY(-2rem);
}

.ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  opacity: 0.54;
  transition: opacity 620ms ease;
}

.landing-screen.is-transitioning .ambient {
  opacity: 1;
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  inset: -20%;
  opacity: 0.9;
  background:
    radial-gradient(ellipse at 18% 20%, rgba(233, 247, 232, 0.28), transparent 10rem),
    radial-gradient(ellipse at 82% 24%, rgba(230, 248, 235, 0.24), transparent 11rem),
    radial-gradient(ellipse at 18% 78%, rgba(232, 247, 235, 0.24), transparent 12rem),
    radial-gradient(ellipse at 82% 78%, rgba(230, 247, 236, 0.22), transparent 12rem),
    radial-gradient(ellipse at 50% 46%, rgba(248, 255, 249, 0.54), transparent 18rem);
  filter: blur(1.25rem);
  animation: breatheLight 5.4s ease-in-out infinite alternate;
}

.ambient::after {
  opacity: 0.7;
  animation-delay: -1.6s;
  transform: scale(1.18);
}

.ambient::before {
  background:
    linear-gradient(180deg, rgba(240, 252, 244, 0.26), transparent 34%),
    radial-gradient(ellipse at 50% 44%, rgba(250, 255, 251, 0.66), transparent 18rem),
    radial-gradient(ellipse at 18% 46%, rgba(8, 72, 44, 0.28), transparent 13rem),
    radial-gradient(ellipse at 82% 46%, rgba(7, 67, 42, 0.26), transparent 13rem),
    radial-gradient(ellipse at 50% 86%, rgba(255, 255, 255, 0.3), transparent 22rem);
}

.mist {
  position: absolute;
  width: 22rem;
  height: 11rem;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(244, 255, 250, 0.68), rgba(174, 220, 205, 0.22) 56%, transparent 72%);
  filter: blur(1.8rem);
  animation: drift 11s ease-in-out infinite alternate;
}

.mist-a {
  top: 18%;
  left: -4rem;
  transform: rotate(-28deg);
}

.mist-b {
  right: -4rem;
  bottom: 20%;
  transform: rotate(22deg);
  animation-delay: -3.2s;
}

.light-pulse {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 1), rgba(239, 253, 245, 0.88) 14rem, transparent 25rem),
    radial-gradient(ellipse at 50% 18%, rgba(199, 239, 225, 0.36), transparent 27rem),
    radial-gradient(ellipse at 52% 45%, rgba(247, 235, 205, 0.24), transparent 30rem);
  opacity: 0;
}

.landing-screen.is-transitioning .light-pulse {
  animation: whiteRise 1.78s ease forwards;
}

.landing-copy,
.prologue-copy,
.reality-copy,
.source-copy,
.final-gate-copy,
.chapter-copy,
.question-card,
.completion-copy,
.result-copy {
  width: min(100%, 34rem);
}

.landing-copy {
  display: grid;
  gap: 1.05rem;
  text-align: center;
  text-shadow: 0 0 1.6rem rgba(2, 30, 24, 0.42), 0 1px 0 rgba(2, 30, 24, 0.12);
}

.signature {
  justify-self: center;
  margin: 0;
  border: 1px solid rgba(196, 169, 107, 0.74);
  border-radius: 0.18rem;
  padding: 0.42rem 0.9rem 0.46rem;
  color: rgba(255, 248, 229, 0.94);
  font-size: 0.88rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  background:
    linear-gradient(180deg, rgba(196, 169, 107, 0.32), rgba(111, 83, 32, 0.16)),
    rgba(9, 46, 37, 0.24);
  box-shadow: 0 0 1.4rem rgba(196, 169, 107, 0.18), inset 0 0 0 1px rgba(255, 252, 240, 0.12);
  text-shadow: 0 1px 0 rgba(38, 28, 12, 0.24);
}

.label {
  margin: 0;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 0 rgba(13, 36, 32, 0.55), 0 0 0.75rem rgba(255, 248, 221, 0.2);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--ink);
  font-size: clamp(1.9rem, 8.6vw, 2.65rem);
  font-weight: 200;
  line-height: 1.24;
  letter-spacing: 0.045em;
  white-space: nowrap;
}

h2 {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 300;
  line-height: 1.55;
}

.lead {
  color: rgba(247, 251, 250, 0.78);
  font-size: 0.9rem;
  line-height: 2;
}

.primary-button {
  min-width: 10.5rem;
  min-height: 3.1rem;
  border: 1px solid rgba(196, 169, 107, 0.7);
  border-radius: 999px;
  color: rgba(34, 62, 55, 0.94);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 2.2rem rgba(255, 255, 255, 0.32), 0 0 2.5rem rgba(196, 169, 107, 0.12);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.landing-screen .primary-button {
  min-width: 12.2rem;
  min-height: 3.55rem;
  font-size: 1.04rem;
}

.primary-button:hover {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.86);
  transform: translateY(-1px);
}

.prologue-screen {
  align-content: start;
  overflow-y: auto;
  padding-top: max(2.75rem, env(safe-area-inset-top));
  padding-bottom: 5.2rem;
  background:
    radial-gradient(ellipse at 50% 12%, rgba(255, 255, 255, 0.72), transparent 18rem),
    radial-gradient(ellipse at 18% 76%, rgba(222, 235, 240, 0.62), transparent 18rem),
    radial-gradient(ellipse at 78% 70%, rgba(197, 217, 226, 0.42), transparent 20rem),
    linear-gradient(180deg, #dce9ee 0%, #edf4f6 48%, #d2e1e8 100%);
}

.prologue-screen::before,
.reality-screen::before,
.source-screen::before,
.final-gate-screen::before,
.chapter-screen::before,
.question-screen::before,
.completion-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(235, 246, 246, 0.28), transparent 34%),
    radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, 0.32), transparent 22rem),
    radial-gradient(ellipse at 48% 52%, rgba(4, 43, 60, 0.16), transparent 18rem),
    radial-gradient(ellipse at 58% 74%, rgba(255, 255, 255, 0.28), transparent 22rem),
    radial-gradient(ellipse at 50% 31%, rgba(196, 169, 107, 0.06), transparent 17rem);
}

.prologue-screen::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 34%),
    radial-gradient(ellipse at 50% 26%, rgba(255, 255, 255, 0.5), transparent 22rem),
    radial-gradient(ellipse at 48% 58%, rgba(151, 177, 196, 0.16), transparent 19rem);
}

.reality-screen {
  align-content: center;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255, 255, 255, 0.95), transparent 17rem),
    radial-gradient(ellipse at 18% 84%, rgba(213, 236, 246, 0.42), transparent 18rem),
    radial-gradient(ellipse at 84% 24%, rgba(247, 235, 205, 0.34), transparent 17rem),
    linear-gradient(180deg, #ffffff 0%, #f4fbfd 46%, #dff1f7 100%);
}

.reality-screen::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 36%),
    radial-gradient(ellipse at 50% 48%, rgba(186, 219, 235, 0.18), transparent 20rem);
}

.reality-copy {
  display: grid;
  gap: 1.05rem;
}

.reality-copy p {
  color: rgba(47, 61, 80, 0.78);
  font-size: 0.97rem;
  line-height: 2.04;
  opacity: 0;
  transform: translateY(0.5rem);
}

.reality-copy p.is-visible {
  animation: lineReveal 600ms ease forwards;
}

.reality-button {
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
  color: rgba(47, 61, 80, 0.9);
  background: rgba(255, 255, 255, 0.78);
}

.reality-button.is-visible {
  animation: lineReveal 500ms ease forwards;
  pointer-events: auto;
}

.question-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.92) 28%, transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.95));
  opacity: 0;
  pointer-events: none;
}

.app.is-returning .question-screen::after {
  animation: returnWhite 1.35s ease forwards;
}

.app.is-diving .question-screen::after {
  background:
    radial-gradient(ellipse at 50% 82%, rgba(187, 226, 230, 0.28), transparent 16rem),
    radial-gradient(ellipse at 50% 16%, rgba(255, 255, 255, 0.2), transparent 18rem),
    linear-gradient(180deg, rgba(18, 55, 72, 0.1), rgba(8, 24, 42, 0.92) 74%, rgba(9, 31, 49, 0.98));
  animation: diveDark 1.45s ease forwards;
}

.app.is-final-darkening .question-screen::after {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 171, 197, 0.22), transparent 18rem),
    radial-gradient(ellipse at 50% 100%, rgba(190, 218, 198, 0.12), transparent 15rem),
    linear-gradient(180deg, rgba(28, 61, 87, 0.72), rgba(9, 23, 45, 0.96) 78%, rgba(6, 14, 31, 1));
  animation: finalDark 1.45s ease forwards;
}

.app.is-reality .chapter-screen,
.app.is-reality .question-screen,
.app.is-reality .completion-screen {
  background:
    radial-gradient(ellipse at 50% 8%, rgba(255, 255, 255, 0.86), transparent 18rem),
    radial-gradient(ellipse at 18% 80%, rgba(190, 226, 241, 0.34), transparent 18rem),
    linear-gradient(180deg, #ffffff 0%, #eff9fc 46%, #d8eef6 100%);
}

.app.is-reality .chapter-screen::before,
.app.is-reality .question-screen::before,
.app.is-reality .completion-screen::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), transparent 38%),
    radial-gradient(ellipse at 50% 48%, rgba(127, 187, 211, 0.16), transparent 18rem);
}

.app.is-reality h2,
.app.is-reality .question-body,
.app.is-reality .completion-copy p:last-child {
  color: rgba(47, 61, 80, 0.82);
}

.app.is-reality .choice-button {
  border-color: rgba(86, 120, 137, 0.24);
  color: rgba(47, 61, 80, 0.86);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.42));
}

.app.is-reality .choice-button:hover,
.app.is-reality .choice-button:focus-visible,
.app.is-reality .choice-button.is-selected {
  background: rgba(255, 255, 255, 0.88);
}

.app.is-reality .label,
.app.is-reality .question-count {
  color: #9f7d38;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 0.6rem rgba(255, 255, 255, 0.45);
}

.source-screen {
  align-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(180, 229, 222, 0.26), transparent 18rem),
    radial-gradient(ellipse at 50% 12%, rgba(255, 255, 255, 0.2), transparent 19rem),
    linear-gradient(180deg, #193e59 0%, #102b46 45%, #081a2f 100%);
}

.source-screen::before {
  background:
    radial-gradient(ellipse at 50% 88%, rgba(195, 232, 220, 0.18), transparent 15rem),
    radial-gradient(ellipse at 50% 22%, rgba(190, 221, 231, 0.13), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%);
  animation: waterDrift 8s ease-in-out infinite alternate;
}

.source-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent, rgba(163, 213, 220, 0.055), transparent),
    radial-gradient(ellipse at 50% 72%, rgba(88, 165, 169, 0.1), transparent 18rem);
  filter: blur(0.8rem);
  opacity: 0.9;
  animation: waterSway 7s ease-in-out infinite alternate;
}

.source-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1.1rem;
  text-shadow: 0 1px 0 rgba(4, 15, 28, 0.28), 0 0 1.2rem rgba(184, 226, 231, 0.16);
}

.source-copy p {
  color: rgba(248, 252, 250, 0.86);
  font-size: 0.97rem;
  line-height: 2.08;
  opacity: 0;
  transform: translateY(0.5rem);
}

.source-copy p.is-visible {
  animation: lineReveal 620ms ease forwards;
}

.source-button {
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
  color: rgba(17, 43, 61, 0.94);
  background: rgba(255, 255, 255, 0.78);
}

.source-button.is-visible {
  animation: lineReveal 520ms ease forwards;
  pointer-events: auto;
}

.bubble-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.bubble {
  position: absolute;
  bottom: -4rem;
  display: block;
  width: var(--size);
  height: var(--size);
  border: 1px solid rgba(219, 248, 248, 0.36);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.46), transparent 24%),
    radial-gradient(circle at 62% 68%, rgba(143, 218, 221, 0.16), transparent 55%);
  box-shadow: inset 0 0 0.7rem rgba(220, 255, 255, 0.13), 0 0 1rem rgba(144, 215, 221, 0.08);
  opacity: 0;
  animation: bubbleRise var(--duration) ease-in infinite;
  animation-delay: var(--delay);
}

.b1 { --size: 0.42rem; --duration: 8s; --delay: 0.1s; left: 9%; }
.b2 { --size: 0.68rem; --duration: 10s; --delay: 1.4s; left: 17%; }
.b3 { --size: 0.34rem; --duration: 9s; --delay: 2.2s; left: 27%; }
.b4 { --size: 0.9rem; --duration: 12s; --delay: 0.7s; left: 36%; }
.b5 { --size: 0.48rem; --duration: 9.5s; --delay: 3s; left: 46%; }
.b6 { --size: 0.74rem; --duration: 11s; --delay: 1.9s; left: 55%; }
.b7 { --size: 0.38rem; --duration: 8.6s; --delay: 3.6s; left: 63%; }
.b8 { --size: 1.05rem; --duration: 13s; --delay: 0.4s; left: 72%; }
.b9 { --size: 0.5rem; --duration: 9.8s; --delay: 2.7s; left: 81%; }
.b10 { --size: 0.32rem; --duration: 8.8s; --delay: 4.1s; left: 88%; }
.b11 { --size: 0.62rem; --duration: 11.5s; --delay: 5s; left: 31%; }
.b12 { --size: 0.42rem; --duration: 10.4s; --delay: 4.6s; left: 68%; }

.app.is-source .chapter-screen,
.app.is-source .question-screen,
.app.is-source .completion-screen {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(146, 210, 198, 0.18), transparent 18rem),
    radial-gradient(ellipse at 50% 14%, rgba(255, 255, 255, 0.12), transparent 17rem),
    linear-gradient(180deg, #173c58 0%, #0f2b47 50%, #081b31 100%);
}

.app.is-source .chapter-screen::before,
.app.is-source .question-screen::before,
.app.is-source .completion-screen::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%),
    radial-gradient(ellipse at 50% 80%, rgba(154, 219, 207, 0.12), transparent 17rem);
}

.app.is-source h2,
.app.is-source .question-body,
.app.is-source .completion-copy p:last-child {
  color: rgba(248, 252, 250, 0.84);
}

.app.is-source .choice-button {
  border-color: rgba(224, 249, 248, 0.2);
  color: rgba(248, 252, 250, 0.86);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045));
}

.app.is-source .choice-button:hover,
.app.is-source .choice-button:focus-visible,
.app.is-source .choice-button.is-selected {
  background: rgba(255, 255, 255, 0.15);
}

.app.is-source .label,
.app.is-source .question-count {
  color: #d8bd79;
  text-shadow: 0 1px 0 rgba(4, 16, 30, 0.62), 0 0 0.75rem rgba(222, 244, 235, 0.14);
}

.final-gate-screen {
  align-content: center;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(133, 184, 210, 0.28), transparent 18rem),
    radial-gradient(ellipse at 50% 100%, rgba(184, 213, 196, 0.12), transparent 16rem),
    linear-gradient(180deg, #254d70 0%, #132d51 48%, #071329 100%);
}

.final-gate-screen::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%),
    radial-gradient(ellipse at 50% 16%, rgba(170, 211, 226, 0.12), transparent 17rem);
}

.final-gate-copy {
  display: grid;
  gap: 1.05rem;
  text-shadow: 0 1px 0 rgba(3, 10, 24, 0.34), 0 0 1.1rem rgba(151, 199, 218, 0.14);
}

.final-gate-copy p {
  color: rgba(248, 252, 250, 0.86);
  font-size: 0.97rem;
  line-height: 2.06;
  opacity: 0;
  transform: translateY(0.5rem);
}

.final-gate-copy p.is-visible {
  animation: lineReveal 620ms ease forwards;
}

.final-gate-button {
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
  color: rgba(17, 43, 61, 0.94);
  background: rgba(255, 255, 255, 0.78);
}

.final-gate-button.is-visible {
  animation: lineReveal 520ms ease forwards;
  pointer-events: auto;
}

.app.is-final-whiteout .final-gate-screen::after {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: 5;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(255, 255, 255, 0.98) 0%, rgba(253, 255, 239, 0.94) 18%, rgba(222, 255, 188, 0.48) 43%, rgba(223, 244, 255, 0.18) 62%, transparent 74%),
    radial-gradient(ellipse at 50% 104%, rgba(207, 247, 182, 0.44), transparent 42%),
    linear-gradient(180deg, rgba(238, 251, 255, 0.08), rgba(255, 255, 255, 0.86) 58%, rgba(233, 255, 218, 0.24));
  opacity: 0;
  pointer-events: none;
  transform: scale(0.84);
  animation: finalWhiteout 1.58s cubic-bezier(0.18, 0.8, 0.18, 1) forwards;
}

.app.is-final .question-screen,
.app.is-final .completion-screen {
  background:
    radial-gradient(ellipse at 50% 42%, rgba(223, 255, 185, 0.3), transparent 18rem),
    radial-gradient(ellipse at 50% 78%, rgba(202, 245, 178, 0.2), transparent 19rem),
    linear-gradient(180deg, rgba(128, 185, 95, 0.22), rgba(20, 76, 50, 0.2)),
    url("assets/forest-entrance.png");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: local;
}

.app.is-result .completion-screen {
  background:
    radial-gradient(ellipse at 50% 24%, rgba(232, 255, 205, 0.34), transparent 17rem),
    radial-gradient(ellipse at 50% 78%, rgba(210, 245, 180, 0.18), transparent 20rem),
    linear-gradient(180deg, rgba(100, 156, 72, 0.28), rgba(20, 76, 50, 0.24)),
    url("assets/forest-entrance.png");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: local;
}

.app.is-final .question-screen::before,
.app.is-final .completion-screen::before,
.app.is-result .completion-screen::before {
  display: none;
}

.app.is-final h2,
.app.is-final .question-body,
.app.is-final .completion-copy p:last-child,
.app.is-result .result-copy {
  color: rgba(248, 252, 250, 0.86);
  text-shadow: 0 1px 0 rgba(2, 20, 16, 0.34), 0 0 1rem rgba(2, 20, 16, 0.14);
}

.app.is-final .choice-button {
  border-color: rgba(247, 251, 250, 0.26);
  color: rgba(248, 252, 250, 0.88);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.095));
  font-size: 0.96rem;
  line-height: 1.78;
  white-space: pre-line;
}

.choice-title {
  display: block;
  margin-bottom: 0.55rem;
  color: rgba(255, 253, 244, 0.96);
  font-size: 1.16em;
  line-height: 1.55;
}

.choice-text {
  display: block;
}

.app.is-final .choice-button:hover,
.app.is-final .choice-button:focus-visible,
.app.is-final .choice-button.is-selected {
  background: rgba(255, 255, 255, 0.25);
}

.whiteout {
  position: absolute;
  inset: 0;
  background: var(--white);
  opacity: 0;
  pointer-events: none;
}

.prologue-screen.is-active .whiteout {
  animation: whiteoutFade 1.2s ease forwards;
}

.prologue-copy {
  display: grid;
  gap: 1.15rem;
  padding-top: 0;
  padding-bottom: 0.4rem;
}

.prologue-copy p {
  color: rgba(47, 61, 80, 0.78);
  font-size: 0.98rem;
  line-height: 2.12;
  opacity: 0;
  transform: translateY(0.55rem);
}

.prologue-copy p.is-visible {
  animation: lineReveal 640ms ease forwards;
}

.prologue-button {
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
  color: rgba(47, 61, 80, 0.86);
  background: rgba(255, 255, 255, 0.3);
}

.prologue-button.is-visible {
  animation: lineReveal 520ms ease forwards;
  pointer-events: auto;
}

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

.chapter-copy {
  display: grid;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(0.8rem);
}

.chapter-screen.is-active .chapter-copy {
  animation: chapterReveal 1.3s ease forwards;
}

.chapter-copy p:last-child,
.completion-copy p:last-child {
  color: var(--muted);
  line-height: 2;
}

.question-screen {
  align-content: start;
  padding-top: max(3.3rem, env(safe-area-inset-top));
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.question-card {
  display: grid;
  gap: 1.25rem;
  padding-bottom: 0.25rem;
}

.question-count {
  color: var(--gold);
  font-size: 0.78rem;
  text-shadow: 0 1px 0 rgba(13, 36, 32, 0.55), 0 0 0.75rem rgba(255, 248, 221, 0.2);
}

.question-body {
  display: grid;
  gap: 0.9rem;
  color: rgba(247, 251, 250, 0.76);
  font-size: 0.97rem;
  line-height: 2.05;
}

.choices {
  display: grid;
  gap: 0.85rem;
  padding-top: 0.6rem;
}

.choice-button {
  width: 100%;
  border: 1px solid rgba(247, 251, 250, 0.22);
  border-radius: 0;
  padding: 1rem 1rem;
  color: rgba(247, 251, 250, 0.86);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055));
  box-shadow: inset 0 0 0 1px rgba(196, 169, 107, 0.04);
  text-align: left;
  line-height: 1.85;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, color 180ms ease;
}

.choice-button:hover,
.choice-button:focus-visible {
  border-color: rgba(196, 169, 107, 0.66);
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.choice-button.is-selected {
  border-color: var(--gold);
  color: var(--ink);
  background: rgba(196, 169, 107, 0.2);
  transform: translateY(-1px);
}

.question-card.is-entering {
  animation: questionEnter 520ms ease both;
}

.question-card.is-leaving {
  animation: questionLeave 380ms ease both;
}

.completion-screen {
  align-content: start;
  overflow-y: auto;
  text-align: left;
}

.completion-copy {
  display: grid;
  gap: 0.8rem;
}

.result-copy {
  display: grid;
  gap: 1.25rem;
  padding: 0.25rem 0 1.2rem;
  color: rgba(248, 252, 250, 0.88);
  text-shadow: 0 1px 0 rgba(2, 20, 16, 0.34), 0 0 1rem rgba(2, 20, 16, 0.16);
}

.result-copy p {
  line-height: 2.05;
}

.result-epilogue,
.result-depth {
  display: grid;
  gap: 0.9rem;
}

.result-mode {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.18rem;
  margin: 0.2rem 0 0.15rem;
  border: 1px solid rgba(255, 253, 244, 0.38);
  border-radius: 1.45rem;
  padding: 1.05rem 1rem 1.1rem;
  color: rgba(255, 253, 244, 0.98);
  font-weight: 300;
  line-height: 1.45;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 55%, rgba(255, 255, 240, 0.22), transparent 11rem),
    radial-gradient(ellipse at 50% 65%, rgba(216, 189, 121, 0.15), transparent 8rem),
    rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 0 0 1px rgba(216, 189, 121, 0.1),
    inset 0 0 2.6rem rgba(255, 255, 255, 0.08),
    0 0 2.2rem rgba(255, 255, 255, 0.1);
}

.result-mode::before,
.result-mode::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  height: 1px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 253, 244, 0.22), rgba(216, 189, 121, 0.68), rgba(255, 253, 244, 0.22), transparent);
  opacity: 0.9;
}

.result-mode::before {
  top: 0.62rem;
}

.result-mode::after {
  bottom: 0.62rem;
}

.result-mode-kicker,
.result-mode-tail {
  color: rgba(255, 253, 244, 0.9);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.result-mode-type {
  color: rgba(255, 253, 244, 1);
  font-size: clamp(3.6rem, 18vw, 5.7rem);
  font-weight: 400;
  line-height: 1.05;
  text-shadow:
    0 0 0.55rem rgba(255, 253, 224, 0.5),
    0 0 1.8rem rgba(216, 189, 121, 0.28),
    0 1px 0 rgba(16, 50, 36, 0.32);
}

.result-description {
  color: rgba(248, 252, 250, 0.84);
}

.result-bridge {
  color: rgba(255, 253, 244, 0.96);
  font-size: 1.05rem;
  font-weight: 400;
}

.result-depth span {
  display: inline-block;
  color: rgba(255, 253, 244, 1);
  font-size: 1.12em;
  font-weight: 400;
}

.result-button {
  justify-self: center;
  margin-top: 0.35rem;
  min-width: min(100%, 15.8rem);
  min-height: 3.35rem;
}

.progress-wrap {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  height: 4px;
  background: rgba(130, 142, 154, 0.16);
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(196, 169, 107, 0.62), var(--gold));
  box-shadow: 0 0 1.2rem rgba(196, 169, 107, 0.42);
  transition: width 520ms ease;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(4rem, -2rem, 0) scale(1.13);
  }
}

@keyframes breatheLight {
  from {
    transform: scale(0.98);
    opacity: 0.36;
  }
  to {
    transform: scale(1.08);
    opacity: 0.72;
  }
}

@keyframes whiteRise {
  0% {
    opacity: 0;
    transform: scale(0.62);
  }
  42% {
    opacity: 0.42;
    transform: scale(1.08);
  }
  76% {
    opacity: 1;
    transform: scale(1.76);
  }
  100% {
    opacity: 0;
    transform: scale(2.45);
  }
}

@keyframes whiteoutFade {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes returnWhite {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  55% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes diveDark {
  0% {
    opacity: 0;
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0.92;
  }
}

@keyframes finalDark {
  0% {
    opacity: 0;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0.96;
  }
}

@keyframes finalWhiteout {
  0% {
    opacity: 0;
    filter: blur(0);
    transform: scale(0.84);
  }
  36% {
    opacity: 0.72;
    filter: blur(0.08rem);
    transform: scale(1.02);
  }
  64% {
    opacity: 1;
    filter: blur(0.24rem);
    transform: scale(1.16);
  }
  100% {
    opacity: 0;
    filter: blur(0.72rem);
    transform: scale(1.36);
  }
}

@keyframes bubbleRise {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.86);
  }
  18% {
    opacity: 0.48;
  }
  84% {
    opacity: 0.34;
  }
  100% {
    opacity: 0;
    transform: translate3d(1.4rem, -112vh, 0) scale(1.08);
  }
}

@keyframes waterDrift {
  from {
    transform: translate3d(-0.6rem, 0, 0) scale(1);
  }
  to {
    transform: translate3d(0.6rem, -0.5rem, 0) scale(1.03);
  }
}

@keyframes waterSway {
  from {
    transform: translate3d(-1rem, 0, 0);
    opacity: 0.72;
  }
  to {
    transform: translate3d(1rem, -0.4rem, 0);
    opacity: 0.94;
  }
}

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

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

@keyframes questionEnter {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes questionLeave {
  to {
    opacity: 0;
    transform: translateY(-0.45rem);
  }
}

@media (min-width: 720px) {
  .screen {
    gap: 2rem;
    padding-inline: 2rem;
  }

  h1 {
    font-size: clamp(2.7rem, 7vw, 4.45rem);
    letter-spacing: 0.08em;
  }

  .lead {
    font-size: 0.94rem;
    line-height: 2.15;
  }

  .question-screen {
    align-content: center;
    padding-top: 3rem;
  }

  .question-card,
  .prologue-copy {
    width: min(100%, 38rem);
  }

  .choice-button {
    padding: 1.08rem 1.2rem;
  }
}

@media (max-width: 719px) {
  .app::before {
    background:
      radial-gradient(ellipse at 18% 68%, rgba(255, 255, 255, 0.38), transparent 15rem),
      radial-gradient(ellipse at 84% 64%, rgba(229, 240, 240, 0.28), transparent 16rem),
      radial-gradient(ellipse at 50% 42%, rgba(16, 78, 96, 0.5), transparent 20rem),
      radial-gradient(ellipse at 52% 78%, rgba(255, 255, 255, 0.2), transparent 22rem);
    filter: blur(1.15rem);
  }

  .app::after {
    background:
      radial-gradient(ellipse at 28% 8%, rgba(240, 248, 248, 0.3), transparent 14rem),
      radial-gradient(ellipse at 70% 8%, rgba(222, 235, 237, 0.26), transparent 18rem),
      radial-gradient(ellipse at 42% 56%, rgba(4, 39, 55, 0.5), transparent 16rem),
      linear-gradient(180deg, rgba(235, 247, 247, 0.22) 0%, transparent 32%, rgba(238, 243, 242, 0.12) 100%);
    filter: blur(1.15rem);
  }

  .landing-screen {
    gap: 1.55rem;
  }

  .landing-screen {
    background:
      url("assets/cover-mobile.svg");
    background-color: #285b52;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: local;
  }

  .app:has(.landing-screen.is-active)::before,
  .app:has(.landing-screen.is-active)::after,
  .landing-screen::before,
  .landing-screen::after,
  .landing-screen.is-transitioning::before,
  .landing-screen.is-transitioning::after {
    background: none;
    opacity: 0;
    filter: none;
  }

  .landing-screen .ambient,
  .landing-screen.is-transitioning .ambient {
    opacity: 0;
  }

  .chapter-screen::before {
    background:
      linear-gradient(180deg, rgba(235, 246, 246, 0.18), transparent 34%),
      radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, 0.18), transparent 22rem),
      radial-gradient(ellipse at 48% 52%, rgba(4, 43, 60, 0.16), transparent 18rem),
      radial-gradient(ellipse at 58% 74%, rgba(255, 255, 255, 0.16), transparent 22rem),
      radial-gradient(ellipse at 50% 31%, rgba(196, 169, 107, 0.06), transparent 17rem);
  }

  .signature {
    font-size: 0.82rem;
    padding-inline: 0.72rem;
  }

  .landing-screen .primary-button {
    min-width: 12.4rem;
    min-height: 3.55rem;
    font-size: 1rem;
  }

  .prologue-screen {
    align-content: start;
    padding-top: 2.4rem;
  }

  .prologue-copy {
    gap: 1rem;
  }

  .prologue-copy p {
    font-size: 0.94rem;
    line-height: 1.96;
  }

  .reality-screen {
    align-content: start;
    padding-top: 3rem;
  }

  .reality-copy {
    gap: 0.95rem;
  }

  .reality-copy p {
    font-size: 0.94rem;
    line-height: 1.96;
  }

  .source-screen {
    align-content: start;
    padding-top: 3.2rem;
  }

  .source-copy {
    gap: 0.95rem;
  }

  .source-copy p {
    font-size: 0.94rem;
    line-height: 1.98;
  }

  .bubble {
    opacity: 0;
  }

  .final-gate-screen {
    align-content: start;
    padding-top: 3.2rem;
  }

  .final-gate-copy {
    gap: 0.95rem;
  }

  .final-gate-copy p {
    font-size: 0.94rem;
    line-height: 1.98;
  }

  .app.is-final .question-screen,
  .app.is-final .completion-screen,
  .app.is-result .completion-screen {
    background:
      radial-gradient(ellipse at 50% 38%, rgba(223, 255, 185, 0.14), transparent 10rem),
      linear-gradient(180deg, rgba(87, 139, 68, 0.32), rgba(17, 70, 48, 0.34)),
      url("assets/forest-entrance.png");
    background-color: #5f8f69;
    background-position: 37% 42%;
    background-size: auto 92%;
    background-repeat: no-repeat;
  }

  .app.is-final .choice-button {
    font-size: 0.9rem;
    line-height: 1.7;
    padding: 0.9rem 0.9rem;
  }

  .choice-title {
    margin-bottom: 0.42rem;
    font-size: 1.12em;
  }

  .completion-screen {
    padding-top: max(2.4rem, env(safe-area-inset-top));
  }

  .result-copy {
    gap: 1.05rem;
    font-size: 0.92rem;
  }

  .result-copy p {
    line-height: 1.92;
  }

  .result-mode {
    padding: 0.9rem 0.85rem;
    font-size: 0.98rem;
  }

  .result-button {
    width: min(100%, 17rem);
    min-height: 3.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
