:root {
  color-scheme: dark;
  --ink: #fff8f2;
  --muted: #cdbdc5;
  --rose: #ff8fa8;
  --coral: #ff6f61;
  --gold: #ffd28a;
  --violet: #bfa6ff;
  --night: #09070d;
  --deep: #130d18;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 143, 168, 0.16), transparent 28rem),
    radial-gradient(circle at 84% 72%, rgba(255, 210, 138, 0.12), transparent 24rem),
    linear-gradient(145deg, var(--night), var(--deep) 62%, #050407);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
}

button {
  font: inherit;
}

.experience,
.intro,
.memory-stage,
.qualities,
.finale {
  min-height: 100svh;
  width: 100%;
}

.intro,
.memory-stage,
.qualities,
.finale {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s ease, filter 1.4s ease;
}

.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.is-fading {
  filter: blur(8px);
}

.intro {
  padding: 2rem;
  text-align: center;
  background: rgba(4, 3, 8, 0.56);
}

.soft-glow {
  position: absolute;
  width: min(28rem, 72vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 143, 168, 0.22), transparent 67%);
  filter: blur(10px);
  animation: breathe 6s ease-in-out infinite;
}

.section-kicker {
  margin: 0 0 0.5rem;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.intro h1 {
  position: relative;
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3.45rem, 13vw, 9rem);
  font-weight: 500;
  line-height: 0.9;
  text-shadow: 0 0 34px rgba(255, 143, 168, 0.24);
}

.intro-note {
  position: relative;
  max-width: 28rem;
  margin: 1.5rem auto 2rem;
  color: var(--muted);
  font-size: clamp(0.94rem, 2vw, 1.08rem);
  line-height: 1.7;
}

.enter-button {
  position: relative;
  min-width: 9rem;
  min-height: 3.1rem;
  border: 1px solid rgba(255, 248, 242, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.enter-button:hover,
.enter-button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 143, 168, 0.75);
  background: rgba(255, 143, 168, 0.13);
  outline: none;
}

.memory-stage {
  overflow: hidden;
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(255, 210, 138, 0.8) 0 1px, transparent 1.4px);
  background-position: 0 0, 42px 64px;
  background-size: 138px 138px, 190px 190px;
  opacity: 0.16;
  animation: drift 24s linear infinite;
}

.floating-hearts span {
  position: absolute;
  bottom: -4rem;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  transform: rotate(45deg);
  background: rgba(255, 143, 168, 0.28);
  animation: floatUp var(--d) ease-in infinite;
  animation-delay: var(--delay);
}

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

.floating-hearts span::before {
  left: -50%;
}

.floating-hearts span::after {
  top: -50%;
}

.floating-hearts span:nth-child(1) { --x: 10%; --s: 1rem; --d: 11s; --delay: 0s; }
.floating-hearts span:nth-child(2) { --x: 28%; --s: 0.7rem; --d: 15s; --delay: 3s; }
.floating-hearts span:nth-child(3) { --x: 55%; --s: 1.25rem; --d: 13s; --delay: 1s; }
.floating-hearts span:nth-child(4) { --x: 78%; --s: 0.85rem; --d: 16s; --delay: 5s; }
.floating-hearts span:nth-child(5) { --x: 91%; --s: 1rem; --d: 12s; --delay: 2s; }

.memory-layer {
  position: absolute;
  inset: 0;
}

.memory {
  position: absolute;
  left: var(--left);
  top: var(--top);
  max-width: min(32rem, 78vw);
  padding: 0.35rem 0;
  color: rgba(255, 248, 242, 0.94);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.35rem, 3.2vw, 2.55rem);
  font-weight: 500;
  line-height: 1.12;
  text-wrap: balance;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  text-shadow: 0 0 28px rgba(255, 143, 168, 0.2);
  animation: memoryAppear 6.8s ease forwards;
}

.memory.small {
  max-width: min(20rem, 70vw);
  color: rgba(255, 223, 229, 0.78);
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(0.82rem, 1.9vw, 1.05rem);
  line-height: 1.5;
}

.memory::after {
  content: "";
  display: block;
  width: 4rem;
  height: 1px;
  margin-top: 0.95rem;
  background: linear-gradient(90deg, transparent, rgba(255, 143, 168, 0.8), transparent);
}

.qualities {
  align-content: center;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: rgba(5, 4, 8, 0.83);
}

.qualities h2 {
  margin: 0 0 2rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.5rem, 9vw, 5.8rem);
  font-weight: 500;
  text-align: center;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(68rem, 100%);
  gap: 0.85rem;
}

.quality-card {
  min-height: 11rem;
  border: 1px solid rgba(255, 248, 242, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.02);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  padding: 1.2rem;
  text-align: left;
  opacity: 0;
  transform: translateY(1.6rem);
  transition: transform 0.38s ease, border-color 0.38s ease, background 0.38s ease;
}

.qualities.is-visible .quality-card {
  animation: riseIn 0.9s ease forwards;
  animation-delay: var(--quality-delay);
}

.quality-card:nth-child(1) { --quality-delay: 0.15s; }
.quality-card:nth-child(2) { --quality-delay: 0.45s; }
.quality-card:nth-child(3) { --quality-delay: 0.75s; }
.quality-card:nth-child(4) { --quality-delay: 1.05s; }

.quality-card span {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1;
}

.quality-card small {
  display: block;
  max-height: 0;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  opacity: 0;
  transition: max-height 0.45s ease, margin-top 0.45s ease, opacity 0.45s ease;
}

.quality-card:hover,
.quality-card:focus-visible,
.quality-card.is-open {
  transform: translateY(-0.35rem);
  border-color: rgba(255, 143, 168, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 143, 168, 0.13), rgba(255, 210, 138, 0.05)),
    rgba(255, 255, 255, 0.04);
  outline: none;
}

.quality-card:hover small,
.quality-card:focus-visible small,
.quality-card.is-open small {
  max-height: 9rem;
  margin-top: 1.1rem;
  opacity: 1;
}

.finale {
  padding: 2rem;
  background: #000;
  text-align: center;
}

.final-line,
.postscript {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(38rem, calc(100vw - 2rem));
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.2rem, 8vw, 5.4rem);
  line-height: 1.05;
  opacity: 0;
  transform: translate(-50%, -44%);
}

.finale.is-visible .final-line {
  animation: finalPulse 3.8s ease forwards;
}

.finale.is-visible .final-line:nth-child(1) { animation-delay: 0.2s; }
.finale.is-visible .final-line:nth-child(2) { animation-delay: 3.2s; }
.finale.is-visible .final-line:nth-child(3) { animation-delay: 6.3s; }
.finale.is-visible .final-line:nth-child(4) { animation-delay: 9.4s; }
.finale.is-visible .final-line:nth-child(5) {
  animation: finalStay 6s ease forwards;
  animation-delay: 12.8s;
}

.final-celebration span {
  color: var(--rose);
  font-size: 0.46em;
}

.postscript {
  top: auto;
  bottom: 8vh;
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  transform: translateX(-50%);
}

.finale.is-visible .postscript {
  animation: psIn 2.5s ease forwards;
  animation-delay: 17s;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.94); opacity: 0.58; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes drift {
  to { background-position: 138px 138px, 232px 254px; }
}

@keyframes floatUp {
  0% { transform: translateY(0) rotate(45deg); opacity: 0; }
  12% { opacity: 0.65; }
  100% { transform: translateY(-118vh) rotate(45deg); opacity: 0; }
}

@keyframes memoryAppear {
  0% { opacity: 0; transform: translate(-50%, -38%) scale(0.96); filter: blur(7px); }
  18%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(1.02); filter: blur(6px); }
}

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

@keyframes finalPulse {
  0% { opacity: 0; transform: translate(-50%, -42%); filter: blur(6px); }
  28%, 70% { opacity: 1; transform: translate(-50%, -50%); filter: blur(0); }
  100% { opacity: 0; transform: translate(-50%, -58%); filter: blur(6px); }
}

@keyframes finalStay {
  0% { opacity: 0; transform: translate(-50%, -42%); filter: blur(6px); }
  28%, 100% { opacity: 1; transform: translate(-50%, -50%); filter: blur(0); }
}

@keyframes psIn {
  to { opacity: 1; }
}

@media (max-width: 760px) {
  .quality-grid {
    grid-template-columns: 1fr;
    max-width: 27rem;
  }

  .quality-card {
    min-height: 6.8rem;
  }

  .memory {
    max-width: 82vw;
  }
}

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

  body {
    overflow: auto;
  }

  .intro,
  .memory-stage,
  .qualities,
  .finale {
    position: relative;
    opacity: 1;
    pointer-events: auto;
  }
}
