:root {
  --bg-1: #fff1ea;
  --bg-2: #ffd9cf;
  --bg-3: #ffc9c9;
  --rose-gold: #c98a7d;
  --rose-gold-dark: #a9695d;
  --gold: #c9a15a;
  --gold-light: #e8c98a;
  --blue-pastel: #a9d3e0;
  --yellow-pastel: #f5dd9a;
  --pearl: #fbf1e6;
  --ink: #4a3428;
  --ink-soft: #6d5445;
  --card-bg: #fffaf6;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  overflow-x: hidden;
  position: relative;
}

.script-title {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
  margin: 0 0 18px;
  line-height: 1.15;
}

h1.script-title { font-size: clamp(2rem, 8vw, 3.2rem); }
h2.script-title.small { font-size: clamp(1.6rem, 6vw, 2.4rem); text-align: center; }

/* ---------- Confetti ---------- */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.confetti-layer::before,
.confetti-layer::after {
  content: "";
  position: absolute;
  inset: -10% 0 0 0;
  height: 130%;
  background-image:
    radial-gradient(3px 3px at 10% 8%, var(--gold) 50%, transparent 51%),
    radial-gradient(2.5px 2.5px at 25% 22%, var(--rose-gold) 50%, transparent 51%),
    radial-gradient(3px 3px at 40% 5%, var(--blue-pastel) 50%, transparent 51%),
    radial-gradient(2px 2px at 55% 18%, var(--gold-light) 50%, transparent 51%),
    radial-gradient(3px 3px at 70% 10%, var(--rose-gold) 50%, transparent 51%),
    radial-gradient(2.5px 2.5px at 85% 24%, var(--gold) 50%, transparent 51%),
    radial-gradient(2px 2px at 95% 6%, var(--yellow-pastel) 50%, transparent 51%),
    radial-gradient(3px 3px at 15% 45%, var(--gold-light) 50%, transparent 51%),
    radial-gradient(2px 2px at 60% 55%, var(--rose-gold) 50%, transparent 51%),
    radial-gradient(2.5px 2.5px at 80% 60%, var(--blue-pastel) 50%, transparent 51%);
  animation: confetti-fall 14s linear infinite;
  opacity: 0.55;
}
.confetti-layer::after {
  background-position: 50px 200px;
  animation-duration: 19s;
  animation-delay: -6s;
  opacity: 0.35;
}

@keyframes confetti-fall {
  from { transform: translateY(-10%); }
  to   { transform: translateY(20%); }
}

main { position: relative; z-index: 2; }

/* ---------- Lights ---------- */
.lights {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 70px;
  overflow: hidden;
  z-index: 3;
}
.lights-wire { width: 100%; height: 100%; }
.bulb {
  position: absolute;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6d9, var(--gold) 70%);
  box-shadow: 0 0 8px 3px rgba(201,161,90,0.65);
  animation: twinkle 2.4s ease-in-out infinite;
}
.bulb.b1 { left: 4%;  top: 22px; animation-delay: 0s; }
.bulb.b2 { left: 18%; top: 46px; animation-delay: 0.3s; }
.bulb.b3 { left: 34%; top: 18px; animation-delay: 0.9s; }
.bulb.b4 { left: 50%; top: 40px; animation-delay: 0.5s; }
.bulb.b5 { left: 66%; top: 16px; animation-delay: 1.1s; }
.bulb.b6 { left: 82%; top: 38px; animation-delay: 0.2s; }
.bulb.b7 { left: 95%; top: 20px; animation-delay: 0.7s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.55; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* ---------- Balloons ---------- */
.balloons {
  position: absolute;
  top: 0;
  width: 160px;
  height: 260px;
  z-index: 2;
  pointer-events: none;
}
.balloons-left { left: -30px; }
.balloons-right { right: -30px; }
.balloons.small-cluster { height: 160px; width: 110px; }

.balloon {
  position: absolute;
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  animation: float 5s ease-in-out infinite;
}
.balloon::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid inherit;
}
.balloon.rose {
  width: 64px; height: 78px; top: 10px; left: 10px;
  background: radial-gradient(circle at 32% 28%, #f3c8bf, var(--rose-gold) 65%, var(--rose-gold-dark));
  animation-delay: 0s;
}
.balloon.blue {
  width: 50px; height: 62px; top: 70px; left: 55px;
  background: radial-gradient(circle at 32% 28%, #e3f4f9, var(--blue-pastel) 65%, #7fb8c9);
  animation-delay: 0.6s;
}
.balloon.yellow {
  width: 44px; height: 54px; top: 130px; left: 5px;
  background: radial-gradient(circle at 32% 28%, #fdf3d0, var(--yellow-pastel) 65%, #dcb95f);
  animation-delay: 1.1s;
}
.balloon.pearl {
  width: 36px; height: 44px; top: 30px; left: 90px;
  background: radial-gradient(circle at 32% 28%, #ffffff, var(--pearl) 65%, #e3d3bf);
  animation-delay: 1.6s;
}
.balloons-right .balloon.rose { left: auto; right: 10px; }
.balloons-right .balloon.blue { left: auto; right: 55px; }
.balloons-right .balloon.yellow { left: auto; right: 5px; }
.balloons-right .balloon.pearl { left: auto; right: 90px; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 90px 22px 60px;
  text-align: center;
}

.hero-content {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  position: relative;
  z-index: 4;
}

.eyebrow {
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 6px;
}
.eyebrow span {
  font-family: 'Dancing Script', cursive;
  font-size: 1.4rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--rose-gold-dark);
  margin-left: 4px;
}

.dedication p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 0 0 18px;
  font-weight: 300;
}

.love-line {
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 500;
  margin: -6px 0 28px;
}

.signature {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 22px;
}
.signature-label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.signature-names {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--rose-gold-dark);
}

.thanks {
  font-family: 'Dancing Script', cursive;
  font-size: 1.8rem;
  color: var(--gold);
  margin: 0;
}

.scroll-cue {
  margin-top: 46px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--rose-gold-dark);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  animation: bob 2.2s ease-in-out infinite;
  z-index: 4;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ---------- Video Section ---------- */
.video-section {
  position: relative;
  padding: 40px 20px 90px;
  text-align: center;
}

.video-intro {
  width: 100%;
  max-width: 480px;
  color: var(--ink-soft);
  font-weight: 300;
  margin: 0 auto 30px;
  font-size: 1rem;
}

/* ---------- Player ---------- */
.player {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  position: relative;
  z-index: 4;
}

.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #1c1614;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 40px -14px rgba(90, 50, 30, 0.45), 0 0 0 6px var(--card-bg), 0 0 0 7px rgba(201,161,90,0.35);
}

.video-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #1c1614;
}

.big-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 74px; height: 74px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, var(--gold-light), var(--rose-gold));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -6px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
}
.big-play svg { margin-left: 3px; }
.big-play:hover { transform: translate(-50%, -50%) scale(1.06); }
.big-play .pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(201,161,90,0.55);
  animation: pulse-ring 2.2s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}
.big-play.hidden { display: none; }

.loading-spinner {
  position: absolute;
  top: 50%; left: 50%;
  width: 40px; height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: var(--gold-light);
  animation: spin 0.8s linear infinite;
  display: none;
}
.loading-spinner.active { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Controls ---------- */
.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(255, 250, 246, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  box-shadow: 0 6px 20px -8px rgba(90,50,30,0.25);
  border: 1px solid rgba(201,161,90,0.25);
}

.ctrl-btn {
  border: none;
  background: transparent;
  color: var(--rose-gold-dark);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.ctrl-btn:hover {
  background: rgba(201,161,90,0.15);
  color: var(--gold);
}
.play-pause {
  background: linear-gradient(145deg, var(--gold-light), var(--rose-gold));
  color: #fff;
}
.play-pause:hover { color: #fff; opacity: 0.9; background: linear-gradient(145deg, var(--gold-light), var(--rose-gold)); }

.time {
  font-size: 0.72rem;
  color: var(--ink-soft);
  min-width: 34px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.time.duration { text-align: right; }

.progress-wrap {
  position: relative;
  flex: 1;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.progress-wrap::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  border-radius: 4px;
  background: rgba(169, 105, 93, 0.2);
}
.progress-buffer, .progress-fill {
  position: absolute;
  left: 0;
  height: 4px;
  border-radius: 4px;
}
.progress-buffer { background: rgba(201,161,90,0.28); width: 0%; }
.progress-fill { background: linear-gradient(90deg, var(--rose-gold), var(--gold)); width: 0%; }
.progress-thumb {
  position: absolute;
  left: 0%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gold);
  transform: translateX(-50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.volume-wrap {
  display: flex;
  align-items: center;
  position: relative;
}
.volume-slider-wrap {
  width: 0;
  overflow: hidden;
  transition: width 0.2s ease;
}
.volume-wrap:hover .volume-slider-wrap,
.volume-wrap:focus-within .volume-slider-wrap {
  width: 60px;
}
.volume-slider {
  position: relative;
  width: 52px;
  height: 14px;
  margin-left: 4px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.volume-slider::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  border-radius: 4px;
  background: rgba(169, 105, 93, 0.2);
}
.volume-fill {
  position: absolute;
  left: 0;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--rose-gold), var(--gold));
  width: 100%;
}
.volume-thumb {
  position: absolute;
  left: 100%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gold);
  transform: translateX(-50%);
}

.footer-note {
  margin-top: 40px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .balloons { width: 110px; height: 190px; }
  .balloon.rose { width: 46px; height: 56px; }
  .balloon.blue { width: 38px; height: 46px; }
  .balloon.yellow { width: 32px; height: 40px; }
  .balloon.pearl { width: 26px; height: 32px; }
  .hero { padding-top: 76px; }
}

@media (min-width: 700px) {
  .balloons { width: 220px; height: 320px; }
  .balloon.rose { width: 82px; height: 100px; }
  .balloon.blue { width: 64px; height: 78px; }
  .balloon.yellow { width: 54px; height: 66px; }
  .balloon.pearl { width: 44px; height: 54px; }
}
