/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
/* overflow-x belongs on html alone. On body it also forces overflow-y to
   compute as auto, which turns body into a scroll container that can never
   scroll - the trackpad wheel gesture latches onto that dead scroller instead
   of the page. */
html {
  overflow-x: hidden;
}

body {
  font-family: 'Noto Serif Georgian', 'Cormorant Garamond', serif;
  background: #f5f0e6;
  color: #1e2a1a;
}

/* ── Tokens ───────────────────────────────────────── */
:root {
  --cream: #f5f0e6;
  --off-white: #faf8f3;
  --forest: #3a5430;
  --forest-dark: #253820;
  --sage: #5a7a50;
  --sage-light: #a0b894;
  --text: #1e2a1a;
  --text-mid: #4a6040;
  --text-soft: #7a9070;
}

/* ── Nav ──────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  transform: translateY(-100%);
  transition: transform 0.4s ease, background 0.4s ease;
  background: rgba(58, 84, 48, 0.92);
  backdrop-filter: blur(8px);
}
#nav.visible { transform: translateY(0); }
#nav a {
  color: #e8e2d6;
  text-decoration: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 400;
  transition: color 0.2s;
}
#nav a:hover { color: #fff; }

/* ── Scroll reveal ────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════
   1. HERO
══════════════════════════════════════════════════ */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://weddsite.b-cdn.net/showcase/wedding-3/bg-mobile.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(20, 30, 18, 0.38) 0%,
    rgba(20, 30, 18, 0.18) 50%,
    rgba(20, 30, 18, 0.55) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 1rem 1.5rem;
}
.hero-eyebrow {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(240, 235, 225, 0.85);
  margin: 2rem 0;
}
.hero-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  color: #fff;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 4.2rem;
}
.hero-and {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 2rem;
  color: rgba(240, 235, 220, 0.9);
  letter-spacing: 0.04em;
  text-transform: none;
  margin: 0.1em 0;
}
.hero-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(240, 235, 225, 0.82);
  margin-top: 1.4rem;
}
.hero-rule {
  width: 60px;
  height: 1px;
  background: rgba(240, 235, 225, 0.5);
  margin: 1.2rem auto;
}

/* Countdown */
.countdown {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  margin: 1rem 0 1.6rem;
}
.cd-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.5rem;
}
.cd-num {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 2rem;
  color: #fff;
  line-height: 1;
}
.cd-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(240, 235, 225, 0.7);
  margin-top: 0.25rem;
}
.cd-sep {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 1.8rem;
  color: rgba(255,255,255,0.5);
  align-self: flex-start;
  padding-top: 0.1rem;
}

/* CTA */
.hero-cta {
  display: inline-block;
  padding: 0.75rem 2.2rem;
  border: 1px solid rgba(240, 235, 225, 0.7);
  color: #fff;
  text-decoration: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s;
}
.hero-cta:hover {
  background: rgba(255,255,255,0.15);
}

/* Guest personalisation */
.hero-dear { display: none; }
.hero-dear.visible {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.1rem;
  color: rgba(240,235,225,0.9);
  margin-bottom: 0.9rem;
}
.hero-bridge { display: none; }
.hero-bridge.visible {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  color: rgba(240,235,225,0.75);
  margin-top: 0.7rem;
  margin-bottom: 0;
}
.hero-eyebrow.hidden { display: none; }

/* Scroll arrow */
.scroll-arrow {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: bounce 2s infinite;
}
.scroll-arrow span {
  display: block;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(255,255,255,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.7);
  transform: rotate(45deg);
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ══════════════════════════════════════════════════
   2. COUPLE PHOTO SECTION
══════════════════════════════════════════════════ */
#couple-section {
  background: var(--off-white);
  padding: 4rem 1.5rem;
}
.couple-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

/* Double-border photo frame */
.photo-frame-outer {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  max-width: 340px;
}
.photo-border-box {
  position: absolute;
  inset: -12px;
  border: 1px solid var(--sage);
}
.photo-border-inner {
  position: absolute;
  inset: -6px;
  border: 1px solid var(--sage-light);
}
.couple-photo {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(30%);
}

/* Date & Venue text */
.couple-info {
  text-align: center;
}
.couple-date-label {
  font-family: 'Noto Serif Georgian', 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 2.6rem;
  color: var(--forest);
  line-height: 1.1;
}
.couple-at {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-style: normal;
  font-weight: 300;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--text-mid);
  margin: 0.5rem 0 0.3rem;
}
.couple-venue {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  margin-top: 1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}
.couple-rule {
  width: 40px;
  height: 1px;
  background: var(--sage);
  margin: 1.2rem auto;
}
.couple-tagline {
  font-family: 'Noto Serif Georgian', serif;
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text-soft);
  line-height: 1.7;
  max-width: 280px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════
   3. FOREST MESSAGE SECTION
══════════════════════════════════════════════════ */
#forest-section {
  position: relative;
  padding: 5rem 1.5rem;
  overflow: hidden;
}
.forest-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://weddsite.b-cdn.net/showcase/wedding-3/bg-second-mobile.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.forest-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 45, 24, 0.62);
}
.forest-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  color: #f0ebe0;
}
.forest-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 2.4rem;
  color: #fff;
  margin-bottom: 1.4rem;
}
.forest-rule {
  width: 50px;
  height: 1px;
  background: rgba(255,255,255,0.45);
  margin: 0 auto 1.6rem;
}
.forest-text {
  font-family: 'Noto Serif Georgian', serif;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.95;
  color: rgba(240, 235, 222, 0.88);
  margin-bottom: 0.9rem;
}
.forest-sign {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: rgba(240, 235, 222, 0.9);
  margin-top: 1.8rem;
}

/* ══════════════════════════════════════════════════
   4. DETAILS SECTION
══════════════════════════════════════════════════ */
#details {
  background: var(--cream);
  padding: 4.5rem 1.5rem;
}
.section-label {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.6rem;
}
.section-title {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 2.4rem;
  color: var(--text);
  margin-bottom: 2.8rem;
}
.details-grid {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.detail-card {
  background: var(--off-white);
  border: 1px solid rgba(90, 122, 80, 0.2);
  padding: 2rem 1.8rem;
  text-align: center;
}
.detail-card-icon {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  color: var(--sage);
}
.detail-card-type {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.5rem;
}
.detail-card-time {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.detail-card-venue {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--forest);
  margin-bottom: 0.6rem;
}
.detail-card-addr {
  font-family: 'Noto Serif Georgian', serif;
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-soft);
  line-height: 1.6;
}
.details-divider {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--sage), transparent);
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════
   5. RSVP SECTION
══════════════════════════════════════════════════ */
#rsvp {
  background: var(--off-white);
  padding: 4.5rem 1.5rem;
}
.rsvp-inner {
  max-width: 520px;
  margin: 0 auto;
}
.rsvp-form { display: flex; flex-direction: column; gap: 1.4rem; }

.form-field label {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 0.5rem;
}
.form-field input[type="text"],
.form-field input[type="number"] {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(90,122,80,0.35);
  background: transparent;
  padding: 0.55rem 0;
  font-family: 'Noto Serif Georgian', serif;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.form-field input:focus { border-color: var(--sage); }

.radio-group {
  display: flex;
  gap: 1rem;
}
.radio-card {
  flex: 1;
  padding: 0.9rem;
  border: 1px solid rgba(90,122,80,0.35);
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--text-mid);
  user-select: none;
}
.radio-card.selected {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}
.radio-card input { display: none; }

.guest-count-wrap {
  max-width: 8rem;
}

.rsvp-submit {
  width: 100%;
  padding: 1rem;
  background: var(--forest);
  color: #fff;
  border: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.rsvp-submit:hover { background: var(--forest-dark); }

.rsvp-success {
  display: none;
  text-align: center;
  padding: 2rem;
}
.rsvp-success.visible { display: block; }
.rsvp-success-icon {
  font-size: 2rem;
  color: var(--sage);
  margin-bottom: 0.8rem;
}
.rsvp-success-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--forest);
  margin-bottom: 0.5rem;
}
.rsvp-success-text {
  font-family: 'Noto Serif Georgian', serif;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-soft);
}

/* ══════════════════════════════════════════════════
   6. FOOTER
══════════════════════════════════════════════════ */
#footer {
  background: var(--forest-dark);
  padding: 3rem 1.5rem;
  text-align: center;
}
.footer-names {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.8rem;
  color: rgba(240,235,222,0.9);
  margin-bottom: 0.5rem;
}
.footer-rule {
  width: 30px;
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 1.2rem auto;
}
.footer-credit {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(240,235,222,0.3);
}

/* ══════════════════════════════════════════════════
   DESKTOP OVERRIDES (≥ 768px)
══════════════════════════════════════════════════ */
@media (min-width: 768px) {
  /* Hero */
  .hero-bg {
    background-image: url('https://weddsite.b-cdn.net/showcase/wedding-3/bg-desktop.jpg');
    background-position: center 30%;
  }
  .hero-name { font-size: 6.5rem; }
  .hero-and { font-size: 4.5rem; }
  .hero-subtitle { font-size: 0.85rem; }
  .hero-eyebrow { font-size: 0.9rem; }
  .cd-num { font-size: 3.8rem; }
  .cd-label { font-size: 0.9rem; }

  /* Couple section */
  .couple-inner {
    flex-direction: row;
    align-items: center;
    gap: 5rem;
  }
  .photo-frame-outer {
    max-width: 320px;
    flex-shrink: 0;
  }
  .couple-info { text-align: left; }
  .couple-rule { margin: 1.2rem 0; }
  .couple-tagline { margin: 0; }
  .couple-date-label { font-size: 3.2rem; }
  .couple-venue { font-size: 2rem; }

  /* Forest section */
  .forest-bg {
    background-image: url('https://weddsite.b-cdn.net/showcase/wedding-3/bg-second.jpg');
  }
  .forest-title { font-size: 3.2rem; }
  .forest-text { font-size: 0.95rem; }

  /* Details */
  .details-grid {
    flex-direction: row;
    align-items: center;
    gap: 0;
  }
  .detail-card { flex: 1; }
  .details-divider {
    width: 1px;
    height: 100px;
    flex-shrink: 0;
  }

  /* RSVP */
  .rsvp-inner { max-width: 560px; }

  /* Section title sizes */
  .section-title { font-size: 3rem; }
}

@media (min-width: 1100px) {
  .photo-frame-outer { max-width: 380px; }
}


/* ===========================================================================
   Viewport pin + loading screen
   ---------------------------------------------------------------------------
   Shared across every Weddsite template; only the palette below is per design.

   --vh is written by the inline script in <head> and re-measured on width
   changes only, so Instagram's and Messenger's sliding nav bar cannot resize
   the layout. `vh`, `svh`, `lvh` and `dvh` all move with it, which is why the
   pin has to come from JS. The 100vh/100svh floors stay as the no-JS fallback
   and MUST be declared before the .vh-lock rule that overrides them.

   The loader exists so `font-display: block` is safe: the block period is spent
   behind the spinner instead of on an invisible page. It also holds the entry
   animation (via .is-loading) so the intro is not played out behind it.
   =========================================================================== */

:root {
    --vh: 1vh;
}

html {
    overscroll-behavior-y: none;
}

.vh-lock #hero {
    height: calc(var(--vh) * 100);
}

/* Entry animations must not play out behind the spinner - a guest who uncovers a
   finished, static scene has been shown nothing. `is-loading` is set by the
   inline script in <head> before first paint and removed on reveal, so a paused
   animation resumes from frame zero exactly when the guest can first see it.
   The spinner itself is excluded, and with JS off the class never lands. */
.is-loading body *:not(.loader):not(.loader__spinner) {
    animation-play-state: paused !important;
}

.loader {
    position: fixed;
    inset: 0;
    /* Out-ranks every entry overlay (envelopes / curtains / clouds live at 9999+). */
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f0e6;
    opacity: 1;
    transition: opacity 0.55s ease;
}

.loader.is-hidden {
    opacity: 0;
}

.loader.is-gone {
    display: none;
}

.loader__spinner {
    display: block;
    width: 40px;
    height: 40px;
    border: 2px solid #a0b894;
    border-top-color: #3a5430;
    border-radius: 50%;
    animation: loader-spin 0.9s linear infinite;
}

@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}
