:root {
  color-scheme: dark;
  --bg: #04131d;
  --panel: rgba(255, 255, 255, 0.09);
  --text: #f2fcff;
  --muted: #cfeff9;
  --accent: #2ec7c9;
  --accent-2: #4f8cff;
  --accent-3: #7fe7ff;
  --accent-soft: #ff8fa8;
  --shadow: 0 24px 80px rgba(2, 20, 31, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #032137 0%, #0a4763 35%, #01131c 100%);
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(46, 199, 201, 0.22), transparent 22%), radial-gradient(circle at 80% 0%, rgba(79, 140, 255, 0.18), transparent 26%), radial-gradient(circle at 50% 100%, rgba(127, 231, 255, 0.2), transparent 24%);
  pointer-events: none;
  animation: drift 14s ease-in-out infinite alternate;
  z-index: 0;
}

#hearts-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.bg-aurora {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: floatAurora 12s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

.aurora-1 {
  width: 320px;
  height: 320px;
  background: var(--accent);
  top: -80px;
  left: -70px;
}

.aurora-2 {
  width: 260px;
  height: 260px;
  background: var(--accent-3);
  right: -40px;
  top: 130px;
  animation-duration: 16s;
}

.aurora-3 {
  width: 240px;
  height: 240px;
  background: var(--accent-soft);
  bottom: 40px;
  left: 30%;
  animation-duration: 9s;
}

.cursor-glow {
  position: fixed;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  z-index: 4;
  transition: transform 0.15s ease, opacity 0.15s ease;
  opacity: 0.8;
}

.cursor-glow::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(255, 95, 139, 0.4);
  border-radius: 50%;
  animation: pulseRing 1.2s ease-out infinite;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, rgba(46, 199, 201, 0.28), rgba(3, 16, 24, 0.96));
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

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

.loader-heart {
  font-size: 3rem;
  text-align: center;
  animation: bounce 0.8s infinite;
}

.loader p {
  margin-top: 12px;
  color: #ffeaf4;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.page {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.section {
  padding: 36px 0;
}

.hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 30px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 16px;
}

h1,
h2,
h3 {
  font-family: "Dancing Script", cursive;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 1.1;
  margin-bottom: 16px;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--muted);
  max-width: 620px;
}

.actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn {
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  border-radius: 50%;
  transition: transform 0.45s ease;
}

.btn:active::after {
  transform: scale(2.2);
}

.btn:hover {
  transform: translateY(-3px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 10px 30px rgba(46, 199, 201, 0.28);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-badges span {
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #ffdbe8;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-card {
  position: relative;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: floatCard 4.2s ease-in-out infinite;
}

.card-glow {
  position: absolute;
  inset: -20% 35% auto auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(46, 199, 201, 0.35), transparent 70%);
  filter: blur(10px);
}

.sparkle {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.card-label {
  color: var(--accent-3);
  margin-bottom: 10px;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-card h2 {
  font-size: 1.7rem;
  margin-bottom: 12px;
}

.hero-card p {
  color: var(--muted);
  line-height: 1.75;
}

.heart-icon {
  font-size: 2.6rem;
  margin-top: 18px;
  animation: pulse 1.8s ease-in-out infinite;
}

.section-heading {
  text-align: center;
  margin-bottom: 24px;
}

.section-heading h3 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.envelope-wrap {
  display: grid;
  place-items: center;
  gap: 24px;
}

.envelope {
  position: relative;
  width: min(320px, 83vw);
  height: 220px;
  border: none;
  background: transparent;
  cursor: pointer;
  perspective: 1000px;
}

.envelope-front,
.envelope-back {
  position: absolute;
  inset: 0;
  border-radius: 18px 18px 24px 24px;
  background: linear-gradient(135deg, #ff749f, #ff4f7e);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
  transition: transform 0.8s ease, box-shadow 0.3s ease;
  transform-origin: top center;
}

.envelope-front {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 50%);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: white;
}

.envelope-front span {
  margin-top: 70px;
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.envelope-back {
  transform: rotateX(180deg);
  background: linear-gradient(135deg, #ff9bba, #ff6a90);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.envelope.open .envelope-front {
  transform: rotateX(-180deg);
}

.envelope.open .envelope-back {
  transform: rotateX(0deg);
}

.letter {
  max-width: 720px;
  width: 100%;
  border-radius: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.8s ease;
}

.letter.open {
  opacity: 1;
  transform: translateY(0);
}

.letter-inner p {
  margin-bottom: 10px;
  line-height: 1.8;
  color: #ffeaf4;
}

.quote-card {
  padding: 30px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
}

.quote-label {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.typing-text {
  font-size: clamp(1.15rem, 2.3vw, 1.5rem);
  line-height: 1.9;
  color: #fff4fb;
}

.typing-cursor {
  display: inline-block;
  width: 9px;
  height: 1.2em;
  background: #ffdbe8;
  margin-left: 4px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.polaroid {
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.polaroid:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.03);
}

.polaroid .photo {
  height: 180px;
  border-radius: 16px;
  margin-bottom: 10px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background-size: cover;
  background-position: center;
  color: white;
  text-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.photo-1 {
  background: linear-gradient(135deg, #ff7ca2, #ffcded);
}

.photo-2 {
  background: linear-gradient(135deg, #72d9ff, #7456ff);
}

.photo-3 {
  background: linear-gradient(135deg, #ffbf6b, #ff5f8b);
}

.polaroid h4 {
  font-family: "Dancing Script", cursive;
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.polaroid p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.timeline {
  position: relative;
  display: grid;
  gap: 16px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(255, 95, 139, 0.4), rgba(141, 228, 255, 0.4));
}

.timeline-item {
  position: relative;
  padding: 16px 16px 16px 44px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 24px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff5f8b, #ff95c2);
  box-shadow: 0 0 0 4px rgba(255, 95, 139, 0.2);
}

.timeline-item strong {
  display: block;
  margin-bottom: 6px;
  color: #ffdce9;
}

.countdown {
  text-align: center;
  padding: 30px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 14px;
  max-width: 700px;
  margin: 20px auto 0;
}

.time-box {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 16px 10px;
}

.time-box span {
  display: block;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 6px;
}

.time-box small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}

.countdown-foot {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.surprise-card {
  text-align: center;
  padding: 30px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
}

.surprise-btn {
  margin-top: 16px;
  border: none;
  border-radius: 999px;
  padding: 16px 22px;
  font-size: 1.2rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 16px 34px rgba(46, 199, 201, 0.28);
  transition: transform 0.2s ease;
}

.surprise-btn:hover {
  transform: scale(1.05);
}

.final {
  text-align: center;
  padding: 40px 20px 20px;
}

.final h3 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.final p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 18px;
}

.music-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  border: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.music-toggle.playing {
  background: linear-gradient(135deg, #ff5f8b, #ff95c2);
  transform: scale(1.05);
}

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

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

.heart-pop {
  position: fixed;
  font-size: 1.25rem;
  animation: driftHeart 2.6s linear forwards;
  pointer-events: none;
  z-index: 1;
}

.confetti-piece {
  position: fixed;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 6;
  animation: fallConfetti 0.9s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(20px, 30px, 0) scale(1.05);
  }
}

@keyframes floatAurora {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(40px, 35px, 0) scale(1.08);
  }
}

@keyframes floatCard {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

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

@keyframes driftHeart {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.8);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-140px) translateX(16px) scale(1.2);
  }
}

@keyframes fallConfetti {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--x), 120vh, 0) rotate(720deg);
  }
}

@keyframes pulseRing {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .countdown-grid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }

  .section {
    padding: 24px 0;
  }

  .page {
    padding-top: 16px;
  }
}
