/* ---------------------------------------
   Foundations
--------------------------------------- */
:root {
  --bg: #0f0f10;
  --bg-alt: #141414;
  --ink: #f2ede4;
  --ink-dim: rgba(242, 237, 228, 0.62);
  --ink-faint: rgba(242, 237, 228, 0.38);
  --gold: #cba876;
  --gold-bright: #e8c990;
  --gold-dim: rgba(203, 168, 118, 0.28);
  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-border: rgba(255, 255, 255, 0.09);
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.45);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

::selection {
  background: var(--gold-dim);
  color: var(--gold-bright);
}

/* ---------------------------------------
   Atmosphere: particles, spotlight, grain
--------------------------------------- */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.spotlight {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 50% 8%, rgba(203, 168, 118, 0.16), transparent 60%),
    radial-gradient(ellipse 40% 30% at 82% 70%, rgba(203, 168, 118, 0.08), transparent 65%),
    radial-gradient(ellipse 40% 30% at 12% 85%, rgba(203, 168, 118, 0.06), transparent 65%);
  filter: blur(10px);
}

.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* ---------------------------------------
   Reveal / fade utilities
--------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: heroFade 1.1s var(--ease) forwards;
  animation-delay: calc(var(--delay, 0) * 0.22s + 0.15s);
}
.reveal[data-delay="0"] { --delay: 0; }
.reveal[data-delay="1"] { --delay: 1; }
.reveal[data-delay="2"] { --delay: 2; }
.reveal[data-delay="3"] { --delay: 3; }
.reveal[data-delay="4"] { --delay: 4; }

@keyframes heroFade {
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------
   Glass
--------------------------------------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---------------------------------------
   Hero
--------------------------------------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8vh 6vw;
  position: relative;
}

.hero-inner { max-width: 860px; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.75rem;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 6.5vw, 5rem);
  line-height: 1.08;
  letter-spacing: 0.005em;
  margin: 0 0 1.75rem;
}

.hero-title em {
  font-style: italic;
  color: var(--gold-bright);
}

.hero-date {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  margin: 0 0 0.75rem;
}

.hero-tagline {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-faint);
  margin: 0;
}

.hero-scroll {
  margin-top: 4.5rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.scroll-line {
  width: 1px;
  height: 42px;
  background: linear-gradient(var(--gold), transparent);
  animation: scrollPulse 2.4s ease-in-out infinite;
}

.scroll-word {
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.25; transform: scaleY(0.7); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

/* ---------------------------------------
   Section shared
--------------------------------------- */
section {
  padding: 11vh 6vw;
  position: relative;
}

.section-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  margin: 0 0 0.9rem;
}

.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  text-align: center;
  margin: 0 0 4rem;
  color: var(--ink);
}

/* ---------------------------------------
   Date Details
--------------------------------------- */
.details { max-width: 1080px; margin: 0 auto; }

.details-header .section-title { margin-bottom: 3.5rem; }

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

.detail-card {
  padding: 2.4rem 2rem;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}

.detail-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold-dim);
}

.detail-card--wide {
  grid-column: span 2;
}

.detail-icon {
  width: 42px;
  height: 42px;
  color: var(--gold-bright);
  margin-bottom: 1.4rem;
}
.detail-icon svg { width: 100%; height: 100%; }

.detail-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  margin: 0 0 0.7rem;
  color: var(--ink);
}

.detail-card p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.98rem;
  font-weight: 300;
}

.detail-highlight {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--gold-bright) !important;
}

/* ---------------------------------------
   Countdown
--------------------------------------- */
.countdown { text-align: center; }

.countdown-grid {
  display: flex;
  justify-content: center;
  gap: clamp(0.8rem, 3vw, 2.6rem);
  flex-wrap: wrap;
}

.countdown-unit {
  min-width: 110px;
  padding: 1.8rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  backdrop-filter: blur(16px);
}

.countdown-number {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 500;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  transition: opacity 0.3s ease;
}

.countdown-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------------------------------------
   Choice
--------------------------------------- */
.choice { text-align: center; }

.choice-buttons {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 1rem 2.1rem;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
  color: var(--ink);
  touch-action: manipulation;
}

.btn-icon { width: 18px; height: 18px; display: inline-flex; }
.btn-icon svg { width: 100%; height: 100%; }

.btn-yes {
  background: linear-gradient(135deg, rgba(203, 168, 118, 0.22), rgba(203, 168, 118, 0.06));
}
.btn-yes:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 12px 34px rgba(203, 168, 118, 0.22);
}

.btn-maybe {
  background: var(--glass-bg);
}
.btn-maybe:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.btn-maybe--dodging {
  position: fixed;
  z-index: 60;
  transition: left 0.28s var(--ease), top 0.28s var(--ease), transform 0.28s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

/* ---------------------------------------
   Footer
--------------------------------------- */
.site-footer {
  text-align: center;
  padding: 9vh 6vw calc(12vh + env(safe-area-inset-bottom, 0px));
}

.footer-line {
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}

/* ---------------------------------------
   Modal
--------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vw;
  background: rgba(6, 6, 7, 0.65);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.modal-backdrop.is-open { opacity: 1; }
.modal-backdrop[hidden] { display: none; }

.modal {
  max-width: 460px;
  width: 100%;
  padding: 3rem 2.6rem;
  text-align: center;
  position: relative;
  transform: translateY(18px) scale(0.97);
  transition: transform 0.45s var(--ease);
}
.modal-backdrop.is-open .modal { transform: translateY(0) scale(1); }

.modal h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
  color: var(--gold-bright);
  margin: 0 0 1.2rem;
}

.modal p {
  color: var(--ink-dim);
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

.modal-thanks {
  color: var(--ink-faint);
  font-style: italic;
}

.modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.3rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--ink-dim);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

/* ---------------------------------------
   Confetti canvas
--------------------------------------- */
#confetti {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

/* ---------------------------------------
   Responsive
--------------------------------------- */
@media (max-width: 860px) {
  .details-grid {
    grid-template-columns: 1fr 1fr;
  }
  .detail-card--wide { grid-column: span 2; }
}

@media (max-width: 620px) {
  .details-grid {
    grid-template-columns: 1fr;
  }
  .detail-card--wide { grid-column: span 1; }

  .countdown-grid { gap: 0.7rem; }
  .countdown-unit { min-width: 78px; padding: 1.2rem 0.6rem; }

  .choice-buttons { flex-direction: column; align-items: center; width: 100%; }
  .btn { width: 100%; max-width: 320px; justify-content: center; }
  .btn-maybe--dodging { width: auto; max-width: none; }
}

@media (max-width: 420px) {
  section { padding: 9vh 5.5vw; }
  .hero { padding: 7vh 5.5vw; }
  .modal { padding: 2.4rem 1.6rem; }
  .modal-backdrop { padding: 5vw; }
  .detail-card { padding: 2rem 1.5rem; }
}

@supports (-webkit-touch-callout: none) {
  .hero { min-height: 100vh; min-height: -webkit-fill-available; min-height: 100svh; }
}
