:root {
  --gold: #c9a227;
  --gold-light: #e3c876;
  --gold-dark: #a9821c;
  --offwhite: #faf6ec;
  --ivory: #fffdf8;
  --cream: #f3e8d0;
  --ink: #3a2f22;
  --ink-soft: #7a6a51;

  --font-script: 'Great Vibes', cursive;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Cormorant Garamond', serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
}

html.no-scroll,
html.no-scroll body {
  overflow: hidden;
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--offwhite);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

p {
  font-size: 1.08rem;
}

.section-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.6rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  color: var(--ink);
  text-align: center;
  margin-bottom: 1.2rem;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  margin: 0.8rem auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ============ COVER / ENVELOPE ============ */
.cover {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 30%, var(--ivory), var(--cream) 78%);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.cover.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.envelope {
  position: relative;
  width: 78vw;
  max-width: 280px;
  aspect-ratio: 4 / 3;
  perspective: 1000px;
}

.envelope__body {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--ivory), #efe2c1);
  border: 1px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 20px 45px rgba(58, 47, 34, 0.18);
}

.envelope__body::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(45deg, transparent 49%, rgba(201, 162, 39, 0.25) 50%, transparent 51%),
    linear-gradient(-45deg, transparent 49%, rgba(201, 162, 39, 0.25) 50%, transparent 51%);
  border-radius: 8px;
}

.envelope__flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 62%;
  background: linear-gradient(160deg, #f8f0da, #e9dcbd);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 1.1s cubic-bezier(0.7, 0, 0.3, 1);
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
}

.envelope.is-open .envelope__flap {
  transform: rotateX(-170deg);
}

.seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--gold-dark);
  background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  color: var(--ivory);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(120, 90, 20, 0.4);
  transition: transform 0.6s ease, opacity 0.6s ease;
  z-index: 2;
}

.seal:active {
  transform: translate(-50%, -50%) scale(0.92);
}

.envelope.is-open .seal {
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

.cover__hint {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dark);
  animation: pulseHint 2.2s ease-in-out infinite;
}

.cover.is-hidden .cover__hint {
  display: none;
}

/* sparkle burst particles, spawned by envelope.js */
.spark {
  position: fixed;
  top: 0;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-light), var(--gold));
  pointer-events: none;
  z-index: 25;
  animation: sparkFly 0.9s ease-out forwards;
}

/* ============ BACKGROUND: CONFETTI SHOWER ============ */
.bg-particles {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.bg-confetti {
  position: absolute;
  top: -6%;
  opacity: 0;
  animation: confettiFall linear infinite;
}

.bg-confetti--diamond {
  width: 7px;
  height: 7px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: rotate(45deg);
}

.bg-confetti--dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.bg-confetti--dash {
  width: 12px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 25%, var(--ivory), var(--offwhite) 75%);
  overflow: hidden;
  padding: 2.5rem 1.25rem 5rem;
}

.hero__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero__frame-rect {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-dasharray: 1960;
  stroke-dashoffset: 1960;
  animation: borderDraw 2.6s ease-out 0.3s forwards;
  opacity: 0.6;
}

.hero__bokeh {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bokeh {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.3), rgba(201, 162, 39, 0));
  animation: bokehDrift 9s ease-in-out infinite;
}

.bokeh:nth-child(1) { width: 55px; height: 55px; top: 10%; left: 8%; animation-duration: 10s; }
.bokeh:nth-child(2) { width: 28px; height: 28px; top: 22%; left: 80%; animation-duration: 8s; animation-delay: 1s; }
.bokeh:nth-child(3) { width: 40px; height: 40px; top: 68%; left: 12%; animation-duration: 11s; animation-delay: 2s; }
.bokeh:nth-child(4) { width: 22px; height: 22px; top: 80%; left: 72%; animation-duration: 9s; animation-delay: 0.5s; }
.bokeh:nth-child(5) { width: 60px; height: 60px; top: 6%; left: 55%; animation-duration: 12s; animation-delay: 1.5s; }
.bokeh:nth-child(6) { width: 32px; height: 32px; top: 46%; left: 88%; animation-duration: 10s; animation-delay: 2.5s; }

.hero__content {
  position: relative;
  text-align: center;
  color: var(--ink);
  max-width: 400px;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s ease, transform 1s ease;
}

.hero__content.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero__photo {
  width: 150px;
  height: 190px;
  object-fit: cover;
  border-radius: 16px;
  border: 3px solid var(--gold);
  box-shadow: 0 12px 28px rgba(120, 90, 20, 0.25);
  margin-bottom: 1.1rem;
}

.eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.4rem;
}

.hero__names {
  font-family: var(--font-script);
  font-size: 2.7rem;
  color: var(--ink);
  margin: 0.3rem 0;
}

.amp {
  color: var(--gold);
}

.hero__tagline {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 0.7rem;
}

.hero__invite {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 32ch;
  margin: 0 auto 0.9rem;
}

.hero__ceremony {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: var(--gold-dark);
  margin: 0.4rem 0 0.2rem;
}

.hero__date {
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.hero__scroll-cue {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 2px solid var(--gold);
  border-radius: 14px;
  opacity: 0.8;
}

.hero__scroll-cue span {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--gold);
  animation: scrollCueDrop 1.6s ease-in-out infinite;
}

/* ============ COUNTDOWN ============ */
.countdown {
  padding: 3rem 1.25rem 3.5rem;
  background: var(--offwhite);
  text-align: center;
}

.flip-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.flip-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.flip-card {
  width: 58px;
  height: 76px;
  perspective: 600px;
}

.flip-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.flip-card__inner.is-flipped {
  transform: rotateX(180deg);
}

.flip-card__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--ink);
  background: linear-gradient(160deg, var(--ivory), var(--cream));
  border: 1.5px solid var(--gold);
  box-shadow: 0 6px 14px rgba(58, 47, 34, 0.12);
}

.flip-card__face--back {
  transform: rotateX(180deg);
}

.flip-unit__label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.flip-colon {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--gold);
  padding-bottom: 1.4rem;
}

.countdown__msg {
  margin-top: 1.4rem;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* ============ DETAILS ============ */
.details {
  padding: 3.5rem 1.25rem;
  background: linear-gradient(180deg, var(--offwhite), var(--ivory));
  text-align: center;
}

.details__intro {
  max-width: 36ch;
  margin: 0 auto 2rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.details__card {
  max-width: 520px;
  margin: 0 auto;
  background: var(--ivory);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 14px;
  padding: 1.6rem;
  box-shadow: 0 10px 30px rgba(58, 47, 34, 0.08);
  text-align: left;
}

.details__row {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.8rem 0;
  border-bottom: 1px dashed rgba(201, 162, 39, 0.35);
}

.details__row:last-of-type {
  border-bottom: none;
}

.details__icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--gold-light), var(--gold));
}

.details__icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--ivory);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.details__label {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

.details__value {
  font-size: 1.1rem;
  color: var(--ink);
  margin-top: 0.15rem;
}

.details__map {
  margin-top: 1.4rem;
  border-radius: 10px;
  overflow: hidden;
  height: 220px;
  border: 1px solid rgba(201, 162, 39, 0.4);
}

.details__map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============ FOOTER ============ */
.footer {
  padding: 3.5rem 1.25rem 2.75rem;
  background: var(--ivory);
  color: var(--ink);
  text-align: center;
  border-top: 1px solid rgba(201, 162, 39, 0.3);
}

.footer__divider svg {
  width: 180px;
  height: 20px;
  margin: 0 auto 1.5rem;
  display: block;
}

.footer__divider line {
  stroke: var(--gold);
  stroke-width: 1;
}

.footer__divider circle {
  fill: var(--gold);
}

.footer__lead {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 0.8rem;
}

.footer__note {
  max-width: 38ch;
  margin: 0 auto 1.3rem;
  font-size: 1.08rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.footer__together {
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.9rem;
}

.footer__signature {
  font-family: var(--font-script);
  font-size: 1.9rem;
  color: var(--gold-dark);
}

/* ============ RESPONSIVE (mobile-first: base styles above target small screens) ============ */
@media (min-width: 480px) {
  .flip-card { width: 66px; height: 84px; }
  .flip-card__face { font-size: 2rem; }
  .flip-colon { font-size: 1.8rem; padding-bottom: 1.6rem; }
}

@media (min-width: 640px) {
  .envelope { max-width: 320px; }
  .section-title { font-size: 2.1rem; }
  .hero__content { max-width: 460px; }
  .hero__photo { width: 190px; height: 240px; }
  .hero__names { font-size: 3.5rem; }
  .hero__ceremony { font-size: 1.55rem; }
  .details__map { height: 260px; }
  .footer__note { max-width: 46ch; }
}

@media (min-width: 1024px) {
  .hero__photo { width: 220px; height: 280px; }
  .details__card { padding: 2.2rem; }
}
