@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&family=Cormorant+Garamond:wght@500;600;700&display=swap");

:root {
  --bg-0: #05060a;
  --bg-1: #0b1018;
  --bg-2: #17100c;
  --ink-rgb: 246, 241, 232;
  --accent-rgb: 203, 225, 255;
  --ember-rgb: 238, 144, 92;
  --mist-rgb: 118, 134, 164;
  --scene-intensity: 0.2;
  --entry-progress: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-0);
}

body {
  overflow: hidden;
  color: rgb(var(--ink-rgb));
  font-family: "Manrope", "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.experience {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 20% 18%, rgba(var(--accent-rgb), 0.1) 0%, transparent 28%),
    radial-gradient(circle at 78% 76%, rgba(var(--ember-rgb), 0.18) 0%, transparent 32%),
    linear-gradient(145deg, var(--bg-0) 0%, var(--bg-1) 42%, var(--bg-2) 100%);
}

.experience::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: -2;
  background:
    conic-gradient(
      from 180deg at 50% 50%,
      rgba(var(--accent-rgb), 0.02) 0deg,
      rgba(var(--ember-rgb), 0.11) 70deg,
      rgba(var(--accent-rgb), 0.08) 160deg,
      transparent 240deg,
      rgba(var(--accent-rgb), 0.04) 360deg
    );
  filter: blur(calc(84px + var(--scene-intensity) * 72px));
  opacity: 0.85;
  animation: orbital-haze 24s linear infinite;
}

.experience[data-phase="summon"] {
  --accent-rgb: 204, 224, 255;
  --ember-rgb: 220, 132, 88;
}

.experience[data-phase="scrutiny"] {
  --accent-rgb: 220, 235, 255;
  --ember-rgb: 244, 142, 94;
}

.experience[data-phase="verdict"] {
  --accent-rgb: 250, 241, 220;
  --ember-rgb: 255, 132, 78;
}

.experience[data-phase="system"] {
  --accent-rgb: 188, 212, 255;
  --ember-rgb: 255, 123, 84;
}

.experience[data-phase="confession"] {
  --accent-rgb: 225, 231, 255;
  --ember-rgb: 252, 176, 122;
}

.experience[data-phase="ignition"] {
  --accent-rgb: 255, 241, 226;
  --ember-rgb: 255, 118, 60;
}

.experience[data-phase="epilogue"] {
  --accent-rgb: 240, 244, 250;
  --ember-rgb: 228, 156, 116;
}

.experience[data-phase="final"] {
  --accent-rgb: 255, 249, 240;
  --ember-rgb: 255, 100, 48;
}

.backdrop,
.backdrop > div,
.stage,
.history,
.final-reveal,
.final-reveal > div {
  position: absolute;
  inset: 0;
}

.backdrop {
  z-index: -1;
  pointer-events: none;
}

.backdrop__gradient {
  background:
    radial-gradient(circle at 50% 22%, rgba(var(--accent-rgb), calc(0.14 + var(--scene-intensity) * 0.22)) 0%, transparent 33%),
    radial-gradient(circle at 50% 68%, rgba(var(--ember-rgb), calc(0.16 + var(--scene-intensity) * 0.2)) 0%, transparent 30%),
    linear-gradient(180deg, rgba(3, 5, 10, 0.28) 0%, rgba(3, 5, 10, 0.74) 82%, rgba(0, 0, 0, 0.92) 100%);
}

.backdrop__halo {
  inset: 12% 16% 20%;
  margin: auto;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(var(--accent-rgb), 0.26) 0%, rgba(var(--accent-rgb), 0.06) 34%, transparent 62%),
    radial-gradient(circle, rgba(var(--ember-rgb), 0.14) 0%, transparent 48%);
  filter: blur(calc(18px + var(--scene-intensity) * 30px));
  opacity: calc(0.22 + var(--scene-intensity) * 0.3);
  animation: halo-breathe 16s ease-in-out infinite;
}

.backdrop__storm {
  inset: -12%;
  background:
    conic-gradient(
      from 0deg at 50% 50%,
      transparent 0deg,
      rgba(var(--accent-rgb), 0.08) 58deg,
      transparent 146deg,
      rgba(var(--ember-rgb), 0.12) 212deg,
      transparent 360deg
    );
  mix-blend-mode: screen;
  filter: blur(calc(58px + var(--scene-intensity) * 56px));
  opacity: calc(0.24 + var(--scene-intensity) * 0.22);
  animation: orbital-haze 18s linear infinite reverse;
}

.backdrop__grain {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.016) 0,
      rgba(255, 255, 255, 0.016) 1px,
      transparent 1px,
      transparent 4px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.012) 0,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 5px
    );
  mix-blend-mode: soft-light;
  opacity: 0.22;
  animation: grain-drift 1.6s steps(2) infinite;
}

.backdrop__scanline {
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%);
  mix-blend-mode: screen;
  opacity: 0.08;
  animation: scan-sweep 11s linear infinite;
}

.entry {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 48px);
  background: rgba(4, 6, 11, 0.24);
  backdrop-filter: blur(18px);
  transition: opacity 0.9s ease, transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.entry__panel {
  width: min(100%, 760px);
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 32px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(7, 9, 15, 0.62);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.entry__eyebrow,
.entry__hint,
.lyric-frame__subline,
.controls__button {
  text-transform: uppercase;
  letter-spacing: 0.28em;
}

.entry__eyebrow {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  opacity: 0.68;
}

.entry__title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3.2rem, 10vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0.03em;
}

.entry__copy {
  width: min(100%, 30rem);
  margin: 1.15rem auto 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
  color: rgba(246, 241, 232, 0.84);
}

.entry__button,
.controls__button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgb(var(--ink-rgb));
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition:
    transform 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    opacity 220ms ease;
}

.entry__button {
  margin-top: 2rem;
  padding: 1rem 1.7rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.controls__button {
  padding: 0.88rem 1.2rem;
  font-size: 0.7rem;
  opacity: 0;
  pointer-events: none;
}

.entry__button:hover,
.controls__button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.26);
}

.entry__hint {
  margin: 1rem 0 0;
  font-size: 0.66rem;
  opacity: 0.44;
}

.experience.is-started .entry {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.05);
}

.controls {
  position: absolute;
  top: clamp(18px, 3vw, 28px);
  right: clamp(18px, 3vw, 28px);
  z-index: 4;
}

.experience.is-started .controls__button {
  opacity: 0.46;
  pointer-events: auto;
}

.controls__button:disabled {
  cursor: default;
}

.stage {
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 70px);
}

.lyric-frame {
  position: relative;
  z-index: 3;
  width: min(100%, 1120px);
  display: grid;
  place-items: center;
  gap: 1rem;
}

.lyric-frame__current {
  width: 100%;
  min-height: min(42vh, 340px);
  display: grid;
  place-items: center;
}

.lyric-frame__subline {
  display: none;
  margin: 0;
  min-height: 1.4em;
  max-width: min(78vw, 700px);
  font-size: clamp(0.7rem, 1.5vw, 0.95rem);
  text-align: center;
  color: rgba(246, 241, 232, 0.42);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 280ms ease, transform 280ms ease;
}

.lyric-frame__subline[data-align="left"] {
  justify-self: start;
  text-align: left;
}

.lyric-frame__subline[data-align="right"] {
  justify-self: end;
  text-align: right;
}

.lyric-frame__subline.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lyric-line {
  margin: 0;
  max-width: min(90vw, 980px);
  text-wrap: balance;
  line-height: 0.94;
  color: rgba(246, 241, 232, 0.96);
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.4),
    0 12px 42px rgba(0, 0, 0, 0.32);
}

.lyric-line--left {
  justify-self: start;
  text-align: left;
}

.lyric-line--right {
  justify-self: end;
  text-align: right;
}

.lyric-line--center {
  justify-self: center;
  text-align: center;
}

.lyric-line--whisper {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.14em;
}

.lyric-line--drift {
  font-size: clamp(2.2rem, 5vw, 5.4rem);
  font-weight: 700;
}

.lyric-line--fracture {
  font-size: clamp(2.25rem, 5.6vw, 5.8rem);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lyric-line--verdict {
  font-size: clamp(2.8rem, 7vw, 6.9rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lyric-line--confession {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3.1rem, 10vw, 8.2rem);
  font-weight: 600;
  line-height: 0.9;
}

.lyric-line--pulse {
  font-size: clamp(3rem, 8vw, 7.8rem);
  font-weight: 800;
  letter-spacing: 0.05em;
}

.lyric-line--epigraph {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3.4rem, 8vw, 7rem);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.lyric-line--reveal {
  font-size: clamp(5rem, 15vw, 11rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.lyric-word {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translate3d(0, 16px, 0) scale(0.97);
  transition:
    opacity 360ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 360ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity, filter;
}

.lyric-word.is-revealed {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
}

.lyric-word.is-key {
  color: rgb(255, 246, 235);
  text-shadow:
    0 0 24px rgba(var(--ember-rgb), 0.32),
    0 0 86px rgba(var(--accent-rgb), 0.22);
}

.experience[data-phase="ignition"] .lyric-line,
.experience[data-phase="final"] .lyric-line {
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.5),
    0 0 28px rgba(var(--ember-rgb), 0.24),
    0 18px 60px rgba(0, 0, 0, 0.42);
}

.experience.is-final-reveal .lyric-line--reveal {
  filter: brightness(1.06);
}

.history {
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.history__ghost {
  position: absolute;
  margin: 0;
  width: min(34vw, 360px);
  color: rgba(255, 255, 255, 0.17);
  font-size: clamp(1rem, 2.6vw, 2.4rem);
  line-height: 0.96;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  white-space: pre-wrap;
  transform: translate3d(0, 24px, 0) rotate(var(--ghost-rotation, 0deg));
  filter: blur(12px);
}

.history__ghost--confession,
.history__ghost--epilogue {
  font-family: "Cormorant Garamond", Georgia, serif;
  text-transform: none;
}

.history__ghost.is-live {
  animation: ghost-drift 8.2s ease-out forwards;
}

.tension-bar {
  position: absolute;
  left: clamp(18px, 4vw, 34px);
  right: clamp(18px, 4vw, 34px);
  bottom: clamp(18px, 4vw, 32px);
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  z-index: 3;
}

.tension-bar__fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.4) 0%, rgba(var(--ember-rgb), 0.85) 100%);
  box-shadow: 0 0 22px rgba(var(--ember-rgb), 0.4);
}

.final-reveal {
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transition: opacity 180ms ease;
}

.final-reveal.is-visible {
  opacity: 1;
}

.final-reveal__veil {
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 247, 236, 0.16) 0%, transparent 26%),
    linear-gradient(180deg, rgba(4, 5, 8, 0.16) 0%, rgba(4, 5, 8, 0.74) 100%);
  backdrop-filter: blur(10px);
}

.final-reveal__asset {
  position: absolute;
  inset: 8% 0 14%;
  margin: auto;
  width: min(46vw, 380px);
  height: min(78vh, 720px);
  object-fit: contain;
  opacity: 0;
  transform: translateY(24px) scale(0.86);
  filter:
    blur(24px)
    drop-shadow(0 0 32px rgba(var(--accent-rgb), 0.18))
    drop-shadow(0 20px 80px rgba(0, 0, 0, 0.5));
}

.experience.has-final-asset .apparition {
  display: none;
}

.experience.has-final-asset .final-reveal__asset[hidden] {
  display: none;
}

.final-reveal.is-visible .final-reveal__asset {
  animation:
    apparition-rise 980ms cubic-bezier(0.22, 1, 0.36, 1) forwards,
    apparition-breathe 2.1s ease-in-out 980ms infinite;
}

.apparition {
  position: absolute;
  inset: 12% 0 18%;
  margin: auto;
  width: min(38vw, 320px);
  aspect-ratio: 0.78;
  opacity: 0;
  transform: translateY(22px) scale(0.84);
  filter: blur(26px);
}

.final-reveal.is-visible .apparition {
  animation:
    apparition-rise 980ms cubic-bezier(0.22, 1, 0.36, 1) forwards,
    apparition-breathe 2.1s ease-in-out 980ms infinite;
}

.apparition__aura,
.apparition__halo,
.apparition__torso,
.apparition__head,
.apparition__slit,
.apparition__rift {
  position: absolute;
}

.apparition__aura {
  inset: -14%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 248, 238, 0.28) 0%, rgba(var(--accent-rgb), 0.2) 20%, transparent 52%),
    radial-gradient(circle at 50% 74%, rgba(var(--ember-rgb), 0.24) 0%, transparent 48%);
  filter: blur(18px);
}

.apparition__halo {
  inset: 8% 16% 24%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 42px rgba(var(--accent-rgb), 0.14);
}

.apparition__head {
  top: 10%;
  left: 50%;
  width: 36%;
  height: 24%;
  transform: translateX(-50%);
  border-radius: 50% 50% 44% 44%;
  background: radial-gradient(circle at 50% 38%, rgba(255, 252, 246, 0.96) 0%, rgba(214, 228, 244, 0.58) 34%, rgba(110, 126, 150, 0.12) 72%, transparent 100%);
}

.apparition__torso {
  left: 50%;
  bottom: 6%;
  width: 52%;
  height: 62%;
  transform: translateX(-50%);
  border-radius: 46% 46% 34% 34% / 16% 16% 56% 56%;
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.32) 0%, rgba(168, 176, 190, 0.16) 24%, rgba(68, 74, 88, 0.06) 74%, transparent 100%);
  filter: blur(6px);
}

.apparition__slit {
  top: 22%;
  left: 50%;
  width: 18%;
  height: 2.4%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, rgba(var(--ember-rgb), 0.56) 18%, rgba(255, 255, 255, 0.98) 50%, rgba(var(--accent-rgb), 0.5) 82%, transparent 100%);
  box-shadow:
    0 0 24px rgba(255, 246, 234, 0.52),
    0 0 72px rgba(var(--accent-rgb), 0.28);
}

.apparition__rift {
  top: 3%;
  bottom: 3%;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent 0%, rgba(var(--accent-rgb), 0.0) 18%, rgba(255, 255, 255, 0.46) 38%, rgba(var(--ember-rgb), 0) 100%);
  filter: blur(1px);
}

@keyframes orbital-haze {
  from {
    transform: rotate(0deg) scale(1);
  }

  to {
    transform: rotate(360deg) scale(1.08);
  }
}

@keyframes halo-breathe {
  0%,
  100% {
    transform: scale(0.96);
    opacity: calc(0.22 + var(--scene-intensity) * 0.26);
  }

  50% {
    transform: scale(1.07);
    opacity: calc(0.34 + var(--scene-intensity) * 0.28);
  }
}

@keyframes grain-drift {
  0% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(-1.4%, 1%);
  }

  50% {
    transform: translate(1.2%, -1.2%);
  }

  75% {
    transform: translate(-0.8%, 1.4%);
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes scan-sweep {
  from {
    transform: translateY(-16%);
  }

  to {
    transform: translateY(16%);
  }
}

@keyframes word-rise {
  from {
    opacity: 0;
    filter: blur(14px);
    transform: translate3d(0, calc(34px + var(--rise, 0px)), 0) scale(0.97);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes ghost-drift {
  0% {
    opacity: 0;
    filter: blur(14px);
    transform: translate3d(0, 24px, 0) rotate(var(--ghost-rotation, 0deg));
  }

  14% {
    opacity: 0.34;
    filter: blur(0);
  }

  100% {
    opacity: 0;
    filter: blur(18px);
    transform: translate3d(0, -56px, 0) rotate(var(--ghost-rotation, 0deg));
  }
}

@keyframes apparition-rise {
  0% {
    opacity: 0;
    filter: blur(26px);
    transform: translateY(22px) scale(0.84);
  }

  34% {
    opacity: 0.62;
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes apparition-breathe {
  0%,
  100% {
    transform: translateY(0) scale(0.99);
  }

  50% {
    transform: translateY(-3px) scale(1.02);
  }
}

@media (max-width: 820px) {
  .lyric-frame__current {
    min-height: min(38vh, 260px);
  }

  .history__ghost {
    width: min(44vw, 280px);
  }

  .final-reveal__asset {
    width: min(58vw, 300px);
  }

  .apparition {
    width: min(48vw, 240px);
  }
}

@media (max-width: 620px) {
  .controls {
    top: 14px;
    right: 14px;
  }

  .controls__button {
    padding: 0.74rem 0.95rem;
    letter-spacing: 0.2em;
  }

  .lyric-line--reveal {
    letter-spacing: 0.14em;
  }

  .tension-bar {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}