:root {
  --pink: #ffd7ec;
  --rose: #ff8fc5;
  --lavender: #d9ccff;
  --blue: #cfeeff;
  --white: #fffaff;
  --ink: #2f2540;
  --muted: #756985;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.72);
  --shadow: 0 22px 70px rgba(172, 101, 160, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Poppins", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 215, 236, 0.95), transparent 30rem),
    radial-gradient(circle at 88% 10%, rgba(207, 238, 255, 0.92), transparent 34rem),
    linear-gradient(135deg, #fff7fb 0%, #f8f1ff 48%, #eef9ff 100%);
  overflow-x: hidden;
}

body.dark {
  --white: #171224;
  --ink: #fff7ff;
  --muted: #d9cfe4;
  --glass: rgba(35, 27, 52, 0.66);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  background:
    radial-gradient(circle at 14% 16%, rgba(132, 83, 139, 0.5), transparent 30rem),
    radial-gradient(circle at 86% 12%, rgba(68, 130, 170, 0.36), transparent 34rem),
    linear-gradient(135deg, #171224 0%, #221a34 52%, #102638 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

#particleCanvas,
#fireworksCanvas {
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

#fireworksCanvas {
  position: absolute;
}

.cursor-glow {
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 143, 197, 0.24), transparent 66%);
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.25s ease;
  z-index: 1;
}

.scroll-progress {
  background: linear-gradient(90deg, var(--rose), #a88cff, #76d7ff);
  height: 4px;
  left: 0;
  position: fixed;
  top: 0;
  transform-origin: left;
  transform: scaleX(0);
  width: 100%;
  z-index: 30;
}

.loader {
  align-items: center;
  background: linear-gradient(135deg, #fff7fb, #f4eeff, #effaff);
  display: grid;
  inset: 0;
  justify-items: center;
  position: fixed;
  transition: opacity 0.55s ease, visibility 0.55s ease;
  z-index: 100;
}

.loader.hide {
  opacity: 0;
  visibility: hidden;
}

.loader-card {
  animation: floaty 2.4s ease-in-out infinite;
  border-radius: 26px;
  padding: 2rem;
  text-align: center;
}

.loader-heart {
  color: var(--rose);
  display: block;
  font-size: 3rem;
  margin-bottom: 0.6rem;
}

.glass,
.loader-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.site-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  left: 50%;
  max-width: 1120px;
  padding: 0.85rem 1rem;
  position: fixed;
  top: 1rem;
  transform: translateX(-50%);
  width: min(calc(100% - 2rem), 1120px);
  z-index: 25;
}

.site-header::before {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  content: "";
  inset: 0;
  position: absolute;
  z-index: -1;
  backdrop-filter: blur(20px);
}

.brand,
.script-title {
  font-family: "Dancing Script", cursive;
  font-weight: 700;
}

.brand {
  color: var(--rose);
  font-size: clamp(1.45rem, 3vw, 2rem);
  white-space: nowrap;
}

.nav-links {
  align-items: center;
  display: flex;
  gap: clamp(0.55rem, 2vw, 1.35rem);
  font-size: 0.9rem;
}

.nav-links a {
  border-radius: 999px;
  padding: 0.45rem 0.65rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(255, 143, 197, 0.16);
}

.icon-button,
.music-toggle,
.back-to-top,
.lightbox-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  cursor: pointer;
  display: inline-grid;
  height: 2.75rem;
  justify-items: center;
  width: 2.75rem;
}

.section {
  margin: 0 auto;
  max-width: 1120px;
  padding: 6rem 1rem;
  position: relative;
  z-index: 2;
}

.hero {
  align-items: center;
  display: grid;
  gap: 3rem;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 31rem);
  min-height: 100vh;
  padding-top: 8rem;
}

.hero-copy {
  border-radius: 28px;
  padding: clamp(1.3rem, 5vw, 3rem);
}

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

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.script-title {
  font-size: clamp(3.2rem, 9vw, 6.8rem);
  line-height: 0.92;
  margin: 0;
}

.typing {
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  line-height: 1.8;
  min-height: 5.4rem;
}

.typing::after {
  animation: blink 0.9s steps(2, start) infinite;
  content: "|";
  margin-left: 0.2rem;
}

.hero-actions,
.reasons-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.primary-button,
.ghost-button {
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  min-height: 3rem;
  padding: 0.78rem 1.2rem;
}

.primary-button {
  background: linear-gradient(135deg, #ff8fc5, #a98dff);
  border: 0;
  color: white;
  box-shadow: 0 14px 34px rgba(255, 143, 197, 0.28);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid var(--glass-border);
}

.hero-photo-wrap {
  position: relative;
}

.hero-photo-button {
  aspect-ratio: 0.78;
  background: transparent;
  border: 0;
  border-radius: 34px;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  position: relative;
  transform: rotate(2deg);
  width: 100%;
}

.hero-photo-button::after {
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: inherit;
  content: "";
  inset: 0.7rem;
  position: absolute;
}

.hero-photo-button img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.photo-orbit {
  animation: floaty 4s ease-in-out infinite;
  border-radius: 999px;
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.7rem 1rem;
  position: absolute;
  text-transform: uppercase;
}

.orbit-one {
  background: #ff8fc5;
  right: -1rem;
  top: 12%;
}

.orbit-two {
  animation-delay: 1s;
  background: #8dcfff;
  bottom: 10%;
  left: -1rem;
}

.stats-band {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
  margin: -3rem auto 0;
  max-width: 900px;
  padding: 0 1rem;
  position: relative;
  z-index: 3;
}

.stat {
  border-radius: 22px;
  padding: 1.4rem;
  text-align: center;
}

.stat span {
  color: var(--rose);
  display: block;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
}

.stat p {
  margin: 0.2rem 0 0;
}

.section-heading {
  margin: 0 auto 2.2rem;
  max-width: 680px;
  text-align: center;
}

.section-heading h2,
.compliment-panel h2,
.final-content h2 {
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1;
  margin: 0;
}

.masonry-gallery {
  columns: 3 15rem;
  column-gap: 1rem;
}

.gallery-item {
  background: transparent;
  border: 0;
  border-radius: 22px;
  cursor: zoom-in;
  display: inline-block;
  margin: 0 0 1rem;
  overflow: hidden;
  padding: 0;
  position: relative;
  width: 100%;
}

.gallery-item img {
  transition: transform 0.45s ease, filter 0.45s ease;
  width: 100%;
}

.gallery-item span {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.58));
  bottom: 0;
  color: white;
  font-weight: 700;
  left: 0;
  padding: 3rem 1rem 1rem;
  position: absolute;
  text-align: left;
  width: 100%;
}

.gallery-item:hover img {
  filter: saturate(1.12);
  transform: scale(1.06);
}

.letter-stage {
  align-items: center;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(16rem, 24rem) 1fr;
}

.envelope {
  aspect-ratio: 1.42;
  background: linear-gradient(145deg, #ffd7ec, #d9ccff);
  border: 0;
  border-radius: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.envelope::before,
.envelope::after {
  border-bottom: 8rem solid rgba(255, 255, 255, 0.42);
  border-left: 12rem solid transparent;
  border-right: 12rem solid transparent;
  bottom: 0;
  content: "";
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}

.flap {
  border-left: 12rem solid transparent;
  border-right: 12rem solid transparent;
  border-top: 8rem solid rgba(255, 143, 197, 0.6);
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  transform-origin: top;
  transition: transform 0.65s ease;
  z-index: 2;
}

.envelope.open .flap {
  transform: translateX(-50%) rotateX(160deg);
}

.seal {
  color: white;
  font-size: 2.2rem;
  left: 50%;
  position: absolute;
  top: 48%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.envelope-label {
  bottom: 1.1rem;
  font-family: "Dancing Script", cursive;
  font-size: 1.65rem;
  left: 0;
  position: absolute;
  text-align: center;
  width: 100%;
  z-index: 3;
}

.letter-paper {
  border-radius: 24px;
  min-height: 20rem;
  padding: clamp(1.3rem, 4vw, 2.3rem);
}

.letter-paper h3 {
  font-family: "Dancing Script", cursive;
  font-size: 2.5rem;
  margin: 0 0 0.8rem;
}

.letter-paper p {
  color: var(--muted);
  font-family: "Dancing Script", cursive;
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  line-height: 1.35;
  margin: 0;
  white-space: pre-line;
}

.reasons-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.reason-card {
  border-radius: 18px;
  min-height: 9rem;
  padding: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.reason-card strong {
  color: var(--rose);
  display: block;
  margin-bottom: 0.45rem;
}

.reason-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.reason-card.active {
  box-shadow: 0 18px 42px rgba(255, 143, 197, 0.34);
  transform: translateY(-6px) scale(1.02);
}

.timeline {
  margin: 0 auto;
  max-width: 860px;
  position: relative;
}

.timeline::before {
  background: linear-gradient(var(--rose), #8dcfff);
  border-radius: 999px;
  content: "";
  height: 100%;
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 4px;
}

.timeline-item {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 3rem;
  position: relative;
}

.timeline-item:nth-child(even) .timeline-card {
  grid-column: 2;
}

.timeline-card {
  border-radius: 24px;
  overflow: hidden;
}

.timeline-card img {
  aspect-ratio: 1.2;
  object-fit: cover;
  width: 100%;
}

.timeline-card div {
  padding: 1.2rem;
}

.timeline-card time {
  color: var(--rose);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.timeline-card h3 {
  margin: 0.35rem 0;
}

.timeline-card p {
  color: var(--muted);
  margin: 0;
}

.compliment-panel,
.final-content {
  border-radius: 30px;
  margin: auto;
  max-width: 760px;
  padding: clamp(1.4rem, 5vw, 3rem);
  text-align: center;
}

.compliment-output {
  color: var(--muted);
  font-size: 1.25rem;
  margin: 1.4rem auto 0;
  max-width: 46rem;
}

.meme-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
}

.meme-card {
  border-radius: 22px;
  padding: 1.4rem;
}

.meme-card span {
  color: var(--rose);
  font-weight: 800;
}

.meme-card p {
  margin-bottom: 0;
}

.final-surprise {
  align-items: center;
  display: grid;
  min-height: 78vh;
  overflow: hidden;
}

.final-content p:last-of-type {
  color: var(--muted);
  font-size: 1.35rem;
}

.site-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 auto;
  max-width: 1120px;
  padding: 2rem 1rem 7rem;
  position: relative;
  z-index: 2;
}

.site-footer-row {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  width: 100%;
}

.site-footer .credit {
  color: var(--text-muted, #9a93a8);
  font-size: 0.8rem;
  text-align: center;
  width: 100%;
}

.music-player {
  align-items: center;
  border-radius: 999px;
  bottom: 1rem;
  display: flex;
  gap: 0.8rem;
  left: 1rem;
  max-width: min(23rem, calc(100% - 6rem));
  padding: 0.65rem 1rem 0.65rem 0.65rem;
  position: fixed;
  z-index: 20;
}

.music-player p,
.music-player strong {
  display: block;
  margin: 0;
}

.music-player p {
  color: var(--muted);
  font-size: 0.78rem;
}

.back-to-top {
  bottom: 1rem;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 1rem;
  transform: translateY(0.75rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 20;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lightbox {
  background: rgba(20, 14, 30, 0.72);
  border: 0;
  height: 100%;
  max-height: none;
  max-width: none;
  padding: 1.2rem;
  width: 100%;
}

.lightbox::backdrop {
  background: rgba(18, 12, 24, 0.72);
  backdrop-filter: blur(10px);
}

.lightbox img {
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  max-height: 82vh;
  object-fit: contain;
  width: 100%;
}

.lightbox p {
  color: white;
  font-weight: 700;
  text-align: center;
}

.lightbox-close {
  color: white;
  position: fixed;
  right: 1rem;
  top: 1rem;
}

.secret-toast {
  background: linear-gradient(135deg, #ff8fc5, #a98dff);
  border-radius: 999px;
  bottom: 5.2rem;
  color: white;
  font-weight: 700;
  left: 50%;
  opacity: 0;
  padding: 0.85rem 1.1rem;
  pointer-events: none;
  position: fixed;
  text-align: center;
  transform: translate(-50%, 1rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
  width: min(92%, 34rem);
  z-index: 40;
}

.secret-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.floating-heart,
.confetti-piece {
  pointer-events: none;
  position: fixed;
  z-index: 50;
}

.floating-heart {
  animation: rise 3.4s ease-out forwards;
  color: var(--rose);
  font-size: 1.4rem;
}

.confetti-piece {
  animation: confetti 2.8s ease-out forwards;
  border-radius: 4px;
  height: 0.7rem;
  width: 0.42rem;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

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

@keyframes floaty {
  50% {
    transform: translateY(-10px);
  }
}

@keyframes rise {
  to {
    opacity: 0;
    transform: translateY(-260px) scale(1.8) rotate(22deg);
  }
}

@keyframes confetti {
  to {
    opacity: 0;
    transform: translate3d(var(--x), 100vh, 0) rotate(620deg);
  }
}

@media (max-width: 820px) {
  .site-header {
    border-radius: 26px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .site-header::before {
    border-radius: 26px;
  }

  .nav-links {
    order: 3;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    width: 100%;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 10rem;
  }

  .hero-photo-wrap {
    margin: auto;
    max-width: 27rem;
    width: 100%;
  }

  .stats-band,
  .letter-stage,
  .meme-grid {
    grid-template-columns: 1fr;
  }

  .timeline::before {
    left: 1rem;
  }

  .timeline-item,
  .timeline-item:nth-child(even) .timeline-card {
    display: block;
    grid-column: auto;
    margin-left: 2rem;
  }
}

@media (max-width: 560px) {
  .section {
    padding: 4.5rem 0.85rem;
  }

  .hero {
    min-height: auto;
  }

  .script-title {
    font-size: 3.25rem;
  }

  .stats-band {
    margin-top: 0;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .music-player {
    max-width: calc(100% - 5rem);
  }
}

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