:root {
  color-scheme: dark;
  --midnight: #050614;
  --deep: #0c1028;
  --rose: #ff5f93;
  --blush: #ffc4d6;
  --gold: #f8c56d;
  --cream: #fff7e9;
  --cyan: #92e8ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--midnight);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.experience {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 62%, rgba(255, 95, 147, 0.13), transparent 34%),
    radial-gradient(circle at 52% 20%, rgba(146, 232, 255, 0.09), transparent 24%),
    linear-gradient(150deg, #02030c 0%, var(--deep) 46%, #18091b 100%);
  color: var(--cream);
}

.start-screen,
.stage {
  position: absolute;
  inset: 0;
}

.start-screen {
  z-index: 20;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(248, 197, 109, 0.2), transparent 28%),
    radial-gradient(circle at 28% 66%, rgba(255, 95, 147, 0.18), transparent 24%),
    linear-gradient(150deg, #03040d, #111530 56%, #210d23);
  transition: opacity 900ms ease, transform 900ms ease, visibility 900ms ease;
}

.start-screen.is-hidden {
  opacity: 0;
  transform: scale(1.04);
  visibility: hidden;
  pointer-events: none;
}

.start-glow {
  position: absolute;
  width: min(62vmin, 520px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 214, 0.26), transparent 62%);
  filter: blur(14px);
  animation: breathe 5s ease-in-out infinite;
}

.start-kicker,
.final-kicker {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.84rem, 2vw, 1rem);
  font-style: italic;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.start-screen h1 {
  z-index: 1;
  max-width: 720px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 500;
  line-height: 0.9;
  text-shadow: 0 0 46px rgba(255, 196, 214, 0.3);
}

.play-button {
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 132px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid rgba(255, 247, 233, 0.42);
  border-radius: 999px;
  background: rgba(255, 247, 233, 0.12);
  color: var(--cream);
  cursor: pointer;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.26), inset 0 0 28px rgba(255, 255, 255, 0.05);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.play-button:hover,
.play-button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(248, 197, 109, 0.86);
  background: rgba(248, 197, 109, 0.18);
  outline: none;
}

.play-icon {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid currentColor;
}

.stage {
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 900ms ease, transform 900ms ease;
}

.stage.is-running {
  opacity: 1;
  transform: scale(1);
}

.stage.is-running .moon-haze {
  animation: moonRise 235s cubic-bezier(0.2, 0.8, 0.18, 1) forwards;
}

.stage.is-running .light-one {
  animation: driftOne 72s ease-in-out infinite alternate;
}

.stage.is-running .light-two {
  animation: driftTwo 88s ease-in-out infinite alternate;
}

.stage.is-running .light-three {
  animation: driftThree 80s ease-in-out infinite alternate;
}

.sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.vignette {
  position: absolute;
  inset: -1px;
  z-index: 8;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, transparent 28%, rgba(0, 0, 0, 0.18) 58%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 24%, rgba(0, 0, 0, 0.42));
}

.moon-haze {
  position: absolute;
  left: 50%;
  top: 55%;
  width: min(86vmin, 740px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 247, 233, 0.32) 0%, rgba(248, 197, 109, 0.18) 24%, rgba(255, 95, 147, 0.11) 45%, transparent 70%);
  filter: blur(22px);
  opacity: 0.25;
  transform: translate(-50%, -50%) scale(0.62);
}

.aurora {
  position: absolute;
  z-index: 2;
  width: 86vw;
  height: 24vh;
  border-radius: 50%;
  opacity: 0.28;
  filter: blur(28px);
  mix-blend-mode: screen;
  pointer-events: none;
}

.aurora-one {
  left: -10vw;
  top: 15vh;
  background: linear-gradient(90deg, transparent, rgba(255, 95, 147, 0.48), rgba(248, 197, 109, 0.24), transparent);
  transform: rotate(-12deg);
  animation: auroraDrift 46s ease-in-out infinite alternate;
}

.aurora-two {
  right: -14vw;
  bottom: 18vh;
  background: linear-gradient(90deg, transparent, rgba(146, 232, 255, 0.2), rgba(255, 196, 214, 0.42), transparent);
  transform: rotate(14deg);
  animation: auroraDriftTwo 58s ease-in-out infinite alternate;
}

.light {
  position: absolute;
  border-radius: 999px;
  filter: blur(20px);
  mix-blend-mode: screen;
}

.light-one {
  left: 8%;
  top: 68%;
  width: 42vw;
  max-width: 560px;
  height: 7vw;
  max-height: 90px;
  background: rgba(255, 95, 147, 0.34);
  transform: rotate(-12deg);
}

.light-two {
  right: 5%;
  top: 18%;
  width: 34vw;
  max-width: 460px;
  height: 8vw;
  max-height: 96px;
  background: rgba(248, 197, 109, 0.3);
  transform: rotate(18deg);
}

.light-three {
  left: 28%;
  bottom: 6%;
  width: 48vw;
  max-width: 650px;
  height: 8vw;
  max-height: 98px;
  background: rgba(146, 232, 255, 0.16);
  transform: rotate(4deg);
}

.scene-copy,
.finale {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 92px);
  text-align: center;
  pointer-events: none;
}

.scene-copy {
  z-index: 12;
  transition: opacity 700ms ease, visibility 700ms ease;
}

.scene-copy.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.line {
  width: min(82vw, 980px);
  min-height: 1.8em;
  margin: 0;
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  color: rgba(255, 247, 233, 0.96);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.05rem, 6.5vw, 6.3rem);
  font-weight: 500;
  line-height: 1.04;
  text-wrap: balance;
  text-shadow: 0 0 34px rgba(255, 196, 214, 0.3), 0 0 70px rgba(248, 197, 109, 0.18);
  transition: opacity 1.15s ease, transform 1.15s ease, filter 1.15s ease;
}

.line.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.line.is-fading {
  opacity: 0;
  transform: translateY(-18px) scale(1.02);
  filter: blur(8px);
}

.finale {
  z-index: 13;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 2.4s ease, transform 2.4s ease, filter 2.4s ease;
}

.finale.is-visible {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.finale h2 {
  max-width: min(92vw, 1040px);
  margin: 8px 0 0;
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.7rem, 12vw, 10.6rem);
  font-weight: 500;
  line-height: 0.9;
  text-wrap: balance;
  text-shadow:
    0 0 16px rgba(255, 255, 255, 0.42),
    0 0 42px rgba(255, 95, 147, 0.48),
    0 0 88px rgba(248, 197, 109, 0.3);
}

.orbit {
  position: absolute;
  width: min(86vmin, 670px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 196, 214, 0.2);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 2s ease, transform 2s ease;
}

.finale.is-visible .orbit {
  opacity: 1;
  transform: scale(1);
}

.orbit::before,
.orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 0 20px rgba(255, 247, 233, 0.8), 0 0 46px rgba(255, 95, 147, 0.45);
}

.orbit::before {
  width: 10px;
  height: 10px;
  left: 50%;
  top: -5px;
}

.orbit::after {
  width: 7px;
  height: 7px;
  right: 9%;
  bottom: 13%;
}

.orbit-one {
  animation: orbit 12s linear infinite;
}

.orbit-two {
  width: min(74vmin, 580px);
  border-color: rgba(248, 197, 109, 0.2);
  animation: orbitReverse 16s linear infinite;
}

.heart-field,
.trail-field,
.memory-field,
.spark-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.heart-field,
.trail-field,
.spark-field {
  z-index: 4;
}

.memory-field {
  z-index: 5;
}

.heart {
  position: absolute;
  width: var(--size);
  height: var(--size);
  opacity: 0;
  transform: rotate(45deg) scale(0.2);
  background: linear-gradient(135deg, rgba(255, 196, 214, 0.95), rgba(255, 95, 147, 0.7));
  filter: drop-shadow(0 0 14px rgba(255, 95, 147, 0.34));
  animation: floatHeart var(--duration) ease-in forwards;
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
}

.heart::before {
  left: -50%;
}

.heart::after {
  top: -50%;
}

.trail {
  position: absolute;
  width: var(--length);
  height: 2px;
  border-radius: 999px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 247, 233, 0.9), rgba(248, 197, 109, 0.2), transparent);
  box-shadow: 0 0 22px rgba(248, 197, 109, 0.52);
  transform: translate3d(var(--start-x), var(--start-y), 0) rotate(var(--angle));
  animation: lightTrail var(--duration) ease-out forwards;
}

.spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  opacity: 0;
  background: rgba(255, 247, 233, 0.96);
  box-shadow:
    0 0 14px rgba(255, 247, 233, 0.85),
    0 0 34px rgba(248, 197, 109, 0.48),
    0 0 58px rgba(255, 95, 147, 0.3);
  animation: sparklePop var(--duration) ease-out forwards;
}

.meteor,
.meteor-haze {
  position: absolute;
  left: var(--x);
  top: var(--y);
  opacity: 0;
  transform: rotate(var(--angle));
  pointer-events: none;
}

.meteor {
  width: var(--length);
  height: 18px;
  border-radius: 999px;
  animation: meteorTravel var(--duration) cubic-bezier(0.12, 0.78, 0.18, 1) var(--delay) forwards;
}

.meteor-tail {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 100%;
  height: var(--thickness);
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(146, 232, 255, 0.18) 22%, rgba(255, 196, 214, 0.46) 58%, rgba(248, 197, 109, 0.72) 78%, rgba(255, 247, 233, 0.98) 96%);
  box-shadow:
    0 0 14px rgba(255, 247, 233, 0.58),
    0 0 34px rgba(146, 232, 255, 0.26),
    0 0 62px rgba(255, 95, 147, 0.22);
  transform: translateY(-50%);
}

.meteor-tail::before {
  content: "";
  position: absolute;
  inset: -6px 14px -6px 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 95, 147, 0.16), rgba(248, 197, 109, 0.22), transparent);
  filter: blur(7px);
}

.meteor-head {
  position: absolute;
  right: 0;
  top: 50%;
  width: calc(var(--thickness) * 4.2);
  height: calc(var(--thickness) * 4.2);
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffffff 0 28%, #fff7e9 36%, rgba(248, 197, 109, 0.92) 52%, rgba(255, 95, 147, 0.32) 72%, transparent 76%);
  box-shadow:
    0 0 16px rgba(255, 255, 255, 0.95),
    0 0 34px rgba(248, 197, 109, 0.68),
    0 0 68px rgba(255, 95, 147, 0.44),
    0 0 100px rgba(146, 232, 255, 0.24);
  transform: translate(38%, -50%);
}

.meteor-medium .meteor-tail,
.meteor-finale .meteor-tail {
  height: calc(var(--thickness) * 1.18);
  box-shadow:
    0 0 18px rgba(255, 247, 233, 0.72),
    0 0 42px rgba(146, 232, 255, 0.34),
    0 0 82px rgba(255, 95, 147, 0.28);
}

.meteor-finale .meteor-head {
  width: calc(var(--thickness) * 5.2);
  height: calc(var(--thickness) * 5.2);
}

.meteor-haze {
  width: calc(var(--length, 360px) * 0.72);
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 247, 233, 0.06), rgba(146, 232, 255, 0.08), transparent);
  filter: blur(12px);
  animation: meteorHaze var(--duration) ease-out var(--delay) forwards;
}

.meteor-fragment {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  opacity: 0;
  background: rgba(255, 247, 233, 0.95);
  box-shadow:
    0 0 12px rgba(255, 247, 233, 0.86),
    0 0 26px rgba(248, 197, 109, 0.52),
    0 0 44px rgba(255, 95, 147, 0.24);
  animation: meteorFragment var(--duration) ease-out var(--delay) forwards;
}

.memory-card {
  position: absolute;
  width: min(24vw, 230px);
  min-width: 126px;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 247, 233, 0.68);
  border-radius: 50%;
  opacity: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 247, 233, 0.34), transparent 26%),
    radial-gradient(circle at 40% 30%, rgba(255, 196, 214, 0.45), transparent 34%),
    radial-gradient(circle at 70% 70%, rgba(248, 197, 109, 0.28), transparent 36%),
    linear-gradient(145deg, rgba(255, 247, 233, 0.16), rgba(255, 255, 255, 0.04));
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.42),
    0 0 0 10px rgba(255, 247, 233, 0.055),
    0 0 34px rgba(255, 95, 147, 0.26),
    0 0 78px rgba(248, 197, 109, 0.16),
    inset 0 0 36px rgba(255, 255, 255, 0.1);
  transform: translate3d(var(--x), var(--y), 0) rotate(var(--rotate)) scale(0.82);
  animation: memoryFloat var(--duration) cubic-bezier(0.16, 0.86, 0.22, 1) forwards;
}

.memory-card::before {
  content: "";
  position: absolute;
  inset: -15px;
  z-index: -1;
  border: 1px solid rgba(255, 247, 233, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(248, 197, 109, 0.18);
  animation: photoHalo 7s ease-in-out infinite;
}

.memory-card.has-photo {
  background-image: var(--photo);
  background-position: center;
  background-size: cover;
}

.memory-card.has-photo .unused {
  display: none;
}

.memory-card.has-photo::before {
  content: "";
  position: absolute;
  inset: -15px;
  z-index: -1;
  border: 1px solid rgba(255, 247, 233, 0.18);
  border-radius: 50%;
  background: none;
  box-shadow: 0 0 34px rgba(248, 197, 109, 0.18);
  animation: photoHalo 7s ease-in-out infinite;
}

.memory-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.2) 42%, transparent 62%);
  transform: translateX(-130%);
  animation: shimmer 4s ease-in-out infinite;
}

.memory-card .photo-vignette {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 34%, transparent 34%, rgba(0, 0, 0, 0.1) 72%, rgba(0, 0, 0, 0.34) 100%),
    linear-gradient(145deg, rgba(255, 247, 233, 0.14), transparent 32%, rgba(255, 95, 147, 0.08));
}

@keyframes breathe {
  50% {
    transform: scale(1.1);
    opacity: 0.72;
  }
}

@keyframes auroraDrift {
  100% {
    transform: translate(20vw, 8vh) rotate(-4deg) scale(1.14);
    opacity: 0.44;
  }
}

@keyframes auroraDriftTwo {
  100% {
    transform: translate(-18vw, -10vh) rotate(6deg) scale(1.2);
    opacity: 0.38;
  }
}

@keyframes moonRise {
  0% {
    opacity: 0.18;
    transform: translate(-50%, -42%) scale(0.54);
  }
  50% {
    opacity: 0.58;
  }
  100% {
    opacity: 0.82;
    transform: translate(-50%, -50%) scale(1.18);
  }
}

@keyframes driftOne {
  100% {
    transform: translate(20vw, -24vh) rotate(-4deg) scale(1.3);
  }
}

@keyframes driftTwo {
  100% {
    transform: translate(-18vw, 26vh) rotate(10deg) scale(1.22);
  }
}

@keyframes driftThree {
  100% {
    transform: translate(10vw, -16vh) rotate(-8deg) scale(1.28);
  }
}

@keyframes orbit {
  100% {
    rotate: 360deg;
  }
}

@keyframes orbitReverse {
  100% {
    rotate: -360deg;
  }
}

@keyframes floatHeart {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(45deg) scale(0.2);
  }
  12% {
    opacity: 0.86;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), -104vh, 0) rotate(45deg) scale(1);
  }
}

@keyframes lightTrail {
  0% {
    opacity: 0;
    transform: translate3d(var(--start-x), var(--start-y), 0) rotate(var(--angle)) scaleX(0.18);
  }
  18% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--end-x), var(--end-y), 0) rotate(var(--angle)) scaleX(1);
  }
}

@keyframes sparklePop {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.2);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) scale(1.6);
  }
}

@keyframes meteorTravel {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(var(--angle)) scaleX(0.2);
  }
  12% {
    opacity: 1;
    transform: translate3d(calc(var(--dx) * 0.08), calc(var(--dy) * 0.08), 0) rotate(var(--angle)) scaleX(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--angle)) scaleX(1);
  }
}

@keyframes meteorHaze {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(var(--angle)) scaleX(0.4);
  }
  20% {
    opacity: 0.62;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--angle)) scaleX(1.2);
  }
}

@keyframes meteorFragment {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.35);
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) scale(0.08);
  }
}

@keyframes photoHalo {
  50% {
    transform: scale(1.07);
    opacity: 0.58;
  }
}

@keyframes memoryFloat {
  0% {
    opacity: 0;
    transform: translate3d(var(--x), calc(var(--y) + 28px), 0) rotate(var(--rotate)) scale(0.74);
    filter: blur(10px) saturate(0.88);
  }
  18% {
    opacity: 0.92;
    transform: translate3d(var(--x), var(--y), 0) rotate(var(--rotate)) scale(1);
    filter: blur(0) saturate(1.06);
  }
  74% {
    opacity: 0.92;
    transform: translate3d(calc(var(--x) + var(--drift) * 0.35), calc(var(--y) - 16px), 0) rotate(calc(var(--rotate) * 0.35)) scale(1.02);
    filter: blur(0) saturate(1.08);
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(var(--x) + var(--drift)), calc(var(--y) - 42px), 0) rotate(calc(var(--rotate) * -0.45)) scale(0.86);
    filter: blur(10px) saturate(0.9);
  }
}

@keyframes shimmer {
  55%,
  100% {
    transform: translateX(130%);
  }
}

@media (max-width: 680px) {
  .experience {
    min-height: 100vh;
  }

  .start-screen h1 {
    font-size: clamp(3rem, 18vw, 5.8rem);
  }

  .line {
    width: min(88vw, 620px);
    font-size: clamp(2.25rem, 11vw, 5.2rem);
    line-height: 1.08;
  }

  .finale h2 {
    font-size: clamp(3.8rem, 17vw, 6.8rem);
    line-height: 0.95;
  }

  .orbit {
    width: 92vmin;
  }

  .memory-card {
    width: min(36vw, 168px);
    min-width: 118px;
  }

  .meteor {
    height: 14px;
  }

  .meteor-head {
    width: calc(var(--thickness) * 3.7);
    height: calc(var(--thickness) * 3.7);
  }
}

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