:root {
  --bg: #110711;
  --bg-2: #1d0d18;
  --rose: #ff6f9e;
  --rose-soft: #ffc3d7;
  --gold: #f7d68a;
  --mint: #a7f3d0;
  --sky: #9ddcff;
  --ink: #fff8fb;
  --muted: rgba(255, 248, 251, 0.72);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.24);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 111, 158, 0.16), transparent 32rem),
    linear-gradient(135deg, var(--bg), #170b21 44%, #061316 100%);
  font-family: "Poppins", system-ui, sans-serif;
  overflow-x: hidden;
  cursor: none;
}

button,
a {
  font: inherit;
}

button {
  cursor: none;
}

::selection {
  color: #220516;
  background: var(--rose-soft);
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #0b050b;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--rose), var(--gold));
  border: 3px solid #0b050b;
  border-radius: 999px;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  background: radial-gradient(circle, #321023 0%, #110711 62%);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader__heart {
  font-size: clamp(3rem, 10vw, 7rem);
  animation: heartbeat 1.2s ease-in-out infinite;
  filter: drop-shadow(0 0 28px rgba(255, 111, 158, 0.8));
}

.loader p {
  margin: 0;
  color: var(--rose-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 35;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--mint));
  box-shadow: 0 0 18px rgba(255, 111, 158, 0.85);
}

.cursor-glow {
  position: fixed;
  z-index: 60;
  width: 34px;
  height: 34px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 195, 215, 0.38), transparent 68%);
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
  mix-blend-mode: screen;
}

.sky-layer,
.effect-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sky-layer {
  z-index: -4;
}

.effect-layer {
  z-index: 45;
}

.aurora {
  position: fixed;
  inset: -20%;
  z-index: -3;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 18%, rgba(167, 243, 208, 0.16), transparent 38%),
    linear-gradient(65deg, transparent 30%, rgba(157, 220, 255, 0.14), transparent 54%),
    linear-gradient(155deg, transparent 42%, rgba(255, 111, 158, 0.14), transparent 70%);
  filter: blur(28px);
  animation: auroraFlow 18s ease-in-out infinite alternate;
}

.petal-field,
.heart-field,
.firefly-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.section {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(5rem, 12vw, 9rem) 1.2rem;
}

.hero {
  overflow: hidden;
}

.hero__content,
.proposal__inner {
  width: min(950px, 100%);
  text-align: center;
  will-change: transform;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.script-title {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-size: clamp(5rem, 17vw, 12rem);
  font-weight: 400;
  line-height: 0.88;
  text-shadow: 0 0 48px rgba(255, 111, 158, 0.7);
}

.hero__line {
  min-height: 2.1rem;
  margin: 1.6rem auto 2.2rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.typewriter::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 0.2rem;
  background: var(--rose-soft);
  vertical-align: -0.15em;
  animation: blink 0.8s steps(1) infinite;
}

.primary-button,
.proposal-button {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(255, 111, 158, 0.75), rgba(247, 214, 138, 0.38));
  box-shadow: 0 24px 70px rgba(255, 111, 158, 0.32);
  backdrop-filter: blur(18px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.primary-button {
  min-width: min(92vw, 310px);
  padding: 1.05rem 1.5rem;
  font-weight: 700;
}

.primary-button:hover,
.proposal-button:hover,
.primary-button:focus-visible,
.proposal-button:focus-visible {
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 30px 95px rgba(255, 111, 158, 0.46);
  outline: none;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  width: 30px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  transform: translateX(-50%);
}

.scroll-cue span {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 5px;
  height: 10px;
  border-radius: 999px;
  background: var(--rose-soft);
  transform: translateX(-50%);
  animation: scrollCue 1.6s infinite;
}

.section__inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.section__inner--narrow {
  width: min(820px, 100%);
}

.section-title,
.proposal-title {
  margin: 0 0 2rem;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 1;
}

.section-title {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
}

.glass-panel,
.memory-card {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.06));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.story-panel,
.letter-card {
  padding: clamp(1.4rem, 4vw, 3rem);
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.9;
}

.highlight {
  color: var(--rose-soft);
  font-weight: 700;
  text-shadow: 0 0 18px rgba(255, 111, 158, 0.58);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  padding: 0;
  margin: 3rem 0 0;
  list-style: none;
}

.timeline__item {
  position: relative;
  min-height: 145px;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
}

.timeline__item::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--rose-soft);
  box-shadow: 0 0 28px var(--rose);
  transform: translateX(-50%);
}

.timeline__item::after {
  content: "";
  position: absolute;
  top: 26px;
  left: 50%;
  width: calc(100% + 1rem);
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 195, 215, 0.5), rgba(247, 214, 138, 0.5));
  z-index: -1;
}

.timeline__item:last-child::after {
  display: none;
}

.timeline__item span {
  display: block;
  margin-top: 2.8rem;
  color: var(--ink);
  font-weight: 600;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

.memory-card {
  min-height: 250px;
  padding: 1.4rem;
  transform-style: preserve-3d;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.memory-card:hover {
  border-color: rgba(255, 195, 215, 0.7);
  transform: translateY(-10px) rotateX(4deg) rotateY(-4deg);
}

.memory-card__icon {
  display: inline-grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 1.2rem;
  border-radius: 50%;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.12);
}

.memory-card h3 {
  margin: 0 0 0.7rem;
}

.memory-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.letter-card {
  font-size: clamp(1.08rem, 2.2vw, 1.45rem);
}

.exact-letter {
  min-height: 7rem;
  margin: 0;
  color: var(--ink);
  font: inherit;
  line-height: 1.9;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.typewriter-block::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 0.16rem;
  background: var(--rose-soft);
  vertical-align: -0.12em;
  animation: blink 0.8s steps(1) infinite;
}

.proposal-title {
  font-weight: 800;
  text-shadow: 0 0 42px rgba(255, 111, 158, 0.72);
  animation: softGlow 2.8s ease-in-out infinite alternate;
}

.heart-3d {
  width: clamp(120px, 24vw, 210px);
  height: clamp(120px, 24vw, 210px);
  margin: 0 auto 1.5rem;
  perspective: 900px;
}

.heart-3d__shape {
  position: relative;
  width: 58%;
  height: 58%;
  margin: 21% auto;
  background: linear-gradient(135deg, #ff4b86, #ffd1df);
  transform: rotate(-45deg);
  animation: heartFloat 3.4s ease-in-out infinite;
  box-shadow: 0 0 38px rgba(255, 75, 134, 0.8), 0 0 90px rgba(255, 75, 134, 0.36);
}

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

.heart-3d__shape::before {
  top: -50%;
  left: 0;
}

.heart-3d__shape::after {
  top: 0;
  left: 50%;
}

.proposal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.proposal-button {
  min-width: min(86vw, 230px);
  padding: 1rem 1.4rem;
  font-weight: 800;
}

.proposal-button--hug {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, rgba(157, 220, 255, 0.56), rgba(167, 243, 208, 0.32));
}

.answer-message {
  min-height: 4rem;
  margin: 2rem auto 0;
  color: var(--rose-soft);
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 800;
  text-shadow: 0 0 28px rgba(255, 111, 158, 0.7);
}

.hug-scene {
  display: none;
  place-items: center;
  gap: 0.8rem;
  min-height: 120px;
  margin-top: 1rem;
}

.hug-scene.is-visible {
  display: grid;
}

.hug-person {
  display: inline-block;
  font-size: 3rem;
  animation: hugMove 1.1s ease-in-out infinite alternate;
}

.hug-person--right {
  animation-direction: alternate-reverse;
}

.secret-page {
  position: fixed;
  inset: 0;
  z-index: 48;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(9, 3, 10, 0.78);
  backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.secret-page.is-open {
  opacity: 1;
  visibility: visible;
}

.secret-page__content {
  width: min(740px, 100%);
  padding: clamp(1.4rem, 5vw, 3rem);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  box-shadow: var(--shadow);
}

.secret-page__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}

.reason-list {
  display: grid;
  gap: 0.8rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.reason-list li {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  animation: riseIn 0.6s ease both;
}

.reason-list li:nth-child(2) { animation-delay: 0.08s; }
.reason-list li:nth-child(3) { animation-delay: 0.16s; }
.reason-list li:nth-child(4) { animation-delay: 0.24s; }
.reason-list li:nth-child(5) { animation-delay: 0.32s; }
.reason-list span { color: var(--rose-soft); font-weight: 800; }

.petal,
.floating-heart,
.firefly {
  position: absolute;
  will-change: transform, opacity;
}

.petal {
  top: -8vh;
  color: rgba(255, 195, 215, 0.86);
  animation: fall linear infinite;
}

.floating-heart {
  bottom: -10vh;
  color: rgba(255, 111, 158, 0.7);
  animation: floatHeart linear infinite;
}

.firefly {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 16px var(--gold);
  animation: fireflyDrift ease-in-out infinite alternate;
}

.reveal {
  opacity: 0;
  transform: translateY(34px) scale(0.98);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.noscript {
  position: fixed;
  inset: auto 1rem 1rem;
  z-index: 70;
  padding: 1rem;
  border-radius: 12px;
  background: #fff;
  color: #140817;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.12); }
  30% { transform: scale(1); }
  45% { transform: scale(1.08); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes auroraFlow {
  to { transform: translate3d(6%, -4%, 0) rotate(4deg) scale(1.08); }
}

@keyframes scrollCue {
  to { opacity: 0; transform: translate(-50%, 22px); }
}

@keyframes softGlow {
  to { text-shadow: 0 0 72px rgba(255, 195, 215, 0.95); }
}

@keyframes heartFloat {
  0%, 100% { transform: rotate(-45deg) rotateX(0deg) rotateY(0deg) translateY(0); }
  50% { transform: rotate(-45deg) rotateX(18deg) rotateY(-18deg) translateY(-16px); }
}

@keyframes hugMove {
  to { transform: translateX(22px) scale(1.12); }
}

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

@keyframes fall {
  to { transform: translate3d(var(--drift), 112vh, 0) rotate(560deg); }
}

@keyframes floatHeart {
  to { opacity: 0; transform: translate3d(var(--drift), -112vh, 0) scale(1.8); }
}

@keyframes fireflyDrift {
  to { transform: translate3d(var(--x), var(--y), 0); opacity: 0.25; }
}

@media (max-width: 900px) {
  .timeline,
  .memory-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline__item::after {
    display: none;
  }
}

@media (max-width: 620px) {
  body {
    cursor: auto;
  }

  button {
    cursor: pointer;
  }

  .cursor-glow {
    display: none;
  }

  .section {
    min-height: auto;
    padding: 6rem 1rem;
  }

  .hero,
  .proposal {
    min-height: 100vh;
  }

  .timeline,
  .memory-grid {
    grid-template-columns: 1fr;
  }

  .timeline__item {
    min-height: 100px;
  }

  .proposal-actions {
    display: grid;
  }
}

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