:root {
  --bg: #080711;
  --bg-soft: #141020;
  --gold: #f8d98b;
  --pink: #ffc7dc;
  --white: #fff8ee;
  --muted: #d9c9d3;
  --glass: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at top, #241737 0%, var(--bg) 45%, #030207 100%);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

#stars {
  position: fixed;
  inset: 0;
  z-index: -2;
}

.nav {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(8, 7, 17, .65);
  backdrop-filter: blur(14px);
}
.nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 999px;
}
.nav a:hover { background: var(--glass); }

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  padding: 110px 20px 60px;
}
.moon {
  position: absolute;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 5%, #f8e8b6 30%, #c99c47 100%);
  box-shadow: 0 0 80px rgba(248, 217, 139, .45);
  top: 17%;
  right: 12%;
  opacity: .75;
}
.hero-content { max-width: 860px; position: relative; z-index: 2; }
.eyebrow {
  color: var(--gold);
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
}
h1, h2, .big-quote {
  font-family: 'Cormorant Garamond', serif;
}
h1 {
  font-size: clamp(64px, 12vw, 140px);
  line-height: .86;
  margin: 20px 0;
}
h1 span {
  color: var(--pink);
  text-shadow: 0 0 30px rgba(255,199,220,.35);
}
h2 {
  font-size: clamp(42px, 7vw, 80px);
  margin: 10px 0 18px;
}
.subtitle, .section-text, .story-card p, .letter-box p, .finale p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}
.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 12px;
  max-width: 560px;
  margin: 34px auto;
}
.countdown div, .gift-card, .story-card, .letter-box {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  backdrop-filter: blur(16px);
}
.countdown div { border-radius: 22px; padding: 18px 10px; }
.countdown strong { display: block; font-size: 30px; color: var(--gold); }
.countdown span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.button {
  border: 0;
  display: inline-block;
  padding: 15px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #ffd1e1);
  color: #20101a;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(248,217,139,.25);
}

.section { padding: 90px 20px; max-width: 1120px; margin: 0 auto; text-align: center; }
.big-quote { font-size: clamp(36px, 6vw, 76px); line-height: 1.05; color: var(--gold); }
.gift-grid {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  position: relative;
}
.gift-grid::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -18px;
  bottom: -18px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(248,217,139,.45), transparent);
  opacity: .45;
}
.gift-card {
  min-height: 170px;
  border-radius: 28px;
  padding: 22px;
  text-align: left;
  cursor: pointer;
  transition: transform .25s ease, border-color .25s ease;
  position: relative;
  overflow: hidden;
}
.gift-card:hover { transform: translateY(-6px); border-color: rgba(248,217,139,.6); }
.gift-card.open {
  border-color: rgba(248,217,139,.72);
  background: linear-gradient(145deg, rgba(248,217,139,.14), rgba(255,199,220,.08));
}
.gift-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 2;
}
.gift-card .number { color: var(--gold); font-weight: 900; letter-spacing: .08em; }
.gift-card .time {
  color: #20101a;
  background: linear-gradient(135deg, var(--gold), #ffd1e1);
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 8px 22px rgba(248,217,139,.18);
}
.gift-card h3 { margin: 28px 0 8px; font-family: 'Cormorant Garamond', serif; font-size: 30px; }
.gift-card p { color: var(--muted); margin: 0; line-height: 1.5; }
.gift-card::after {
  content: '🎁';
  position: absolute;
  right: 18px;
  top: 14px;
  opacity: .28;
  font-size: 38px;
}
.story-card, .letter-box { border-radius: 34px; padding: clamp(28px, 6vw, 70px); }
.symbols { display: flex; justify-content: center; gap: 18px; font-size: 34px; margin-top: 28px; flex-wrap: wrap; }
.letter-box { text-align: left; max-width: 840px; margin: 0 auto; }
.signature { color: var(--gold) !important; font-family: 'Cormorant Garamond', serif; font-size: 30px !important; }
.finale { min-height: 420px; }
#fireworks { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: boom 900ms ease-out forwards;
}
@keyframes boom {
  to { transform: translate(var(--x), var(--y)) scale(0); opacity: 0; }
}
footer { text-align: center; color: var(--muted); padding: 40px 20px 70px; }

@media (max-width: 640px) {
  .nav { width: calc(100% - 24px); overflow-x: auto; justify-content: flex-start; }
  .moon { width: 130px; height: 130px; top: 13%; right: -25px; }
  .countdown { grid-template-columns: repeat(2, 1fr); }
  .gift-grid::before { left: 14px; }
}



.gift-card.locked {
  opacity: .58;
  cursor: not-allowed;
}

.gift-card.locked:hover {
  transform: none;
  border-color: rgba(255,255,255,.13);
}

.gift-card.locked::after {
  content: '🔒';
}


.media-button {
  margin-top: 18px;
  border: 1px solid rgba(248,217,139,.48);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(248,217,139,.12);
  color: var(--gold);
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.media-button:hover {
  background: rgba(248,217,139,.2);
}

.media-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 22px;
}

.media-modal.show {
  display: grid;
}

.media-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 2, 7, .78);
  backdrop-filter: blur(10px);
}

.media-box {
  position: relative;
  z-index: 2;
  width: min(92vw, 760px);
  max-height: 86vh;
  padding: 18px;
  border-radius: 28px;
  background: rgba(20, 16, 32, .92);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 22px 80px rgba(0,0,0,.42);
}

.media-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #ffd1e1);
  color: #20101a;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  font-weight: 900;
}

.modal-media {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 20px;
}


.countdown-wrap {
  position: relative;
  max-width: 620px;
  margin: 34px auto;
  padding: 10px;
}

.countdown-wrap .countdown {
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.countdown-effects {
  position: absolute;
  inset: -34px -18px;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.float-magic {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 26px;
  filter: drop-shadow(0 0 12px rgba(248,217,139,.35));
  animation: floatMagic 2.8s ease-out forwards;
  opacity: 0;
}

@keyframes floatMagic {
  0% {
    transform: translate(-50%, -50%) scale(.3) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.25) rotate(var(--r));
    opacity: 0;
  }
}

.confetti-piece {
  position: absolute;
  left: 50%;
  top: 35%;
  width: 8px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  animation: confettiFall 2.5s ease-out forwards;
  opacity: 0;
}

@keyframes confettiFall {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r));
    opacity: 0;
  }
}

.countdown-wrap.magic-pulse .countdown div {
  animation: countdownGlow 1.8s ease-in-out;
}

@keyframes countdownGlow {
  0%, 100% {
    box-shadow: 0 18px 60px rgba(0,0,0,.25);
    border-color: rgba(255,255,255,.13);
  }
  50% {
    box-shadow: 0 18px 70px rgba(248,217,139,.35), 0 0 34px rgba(255,199,220,.22);
    border-color: rgba(248,217,139,.62);
  }
}

@media (max-width: 640px) {
  .countdown-effects {
    inset: -26px -8px;
  }
  .float-magic {
    font-size: 22px;
  }
}
