/* Olivia + Chase — Wedding site styles
   Theme: off-white, sage, pale blue, paper texture, elegant */

@layer reset, variables, layout, nav, sections, components, gate, utilities;

/* Reset */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  img, picture, video, canvas, svg { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; }
  p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
}

/* Variables */
@layer variables {
  :root {
    /* Primary neutrals */
    --color-bg: #faf9f7;
    --color-bg-paper: #f5f4f0;
    --color-text: #2c2a26;
    --color-text-muted: #5c5954;
    /* Sage */
    --color-sage: #9caa8a;
    --color-sage-light: #b8c4a8;
    --color-sage-muted: rgba(156, 170, 138, 0.25);
    /* Pale blue */
    --color-blue: #a8c5d4;
    --color-blue-light: #c5dce6;
    --color-blue-muted: rgba(168, 197, 212, 0.3);
    /* Floral / accent */
    --color-accent: #c4a8b8;
    --color-accent-muted: rgba(196, 168, 184, 0.2);
    /* UI */
    --color-nav-bg: rgba(250, 249, 247, 0.92);
    --color-nav-border: rgba(156, 170, 138, 0.2);
    --color-link: var(--color-sage);
    --color-link-hover: #7a8a6a;
    --color-rsvp-bg: var(--color-sage);
    --color-rsvp-text: #fff;
    /* Spacing & layout */
    --section-padding-block: clamp(3rem, 8vw, 5rem);
    --section-padding-inline: clamp(1.25rem, 5vw, 3rem);
    --content-max: 52rem;
    --site-header-height: 10rem; /* JS overrides this immediately; large default prevents clip before JS fires */
    --nav-height: 3.75rem;
    --header-total: calc(var(--site-header-height) + var(--nav-height));
    --color-venue: #5c6b4d;
    /* Typography */
    --font-display: "Cormorant Garamond", "Georgia", serif;
    --font-body: "Source Serif 4", "Georgia", serif;
    --font-script: "Great Vibes", cursive;
    /* Motion */
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --transition-fast: 0.2s var(--ease-out);
    --transition-medium: 0.35s var(--ease-out);
    --transition-theme: 1.1s ease; /* smooth dark↔light when entering/leaving hero */
    --transition-page-soft: 1.4s cubic-bezier(0.25, 0.1, 0.25, 1); /* smoother for non-hero↔non-hero */
  }

  @media (min-width: 769px) {
    :root {
      --transition-theme: 0.55s ease;
      --transition-page-soft: 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
      /* Scale content width gradually on wider screens so there's less empty margin */
      --content-max: clamp(52rem, 72vw, 82rem);
    }
  }
}

/* Layout */
@layer layout {
  body {
    font-family: var(--font-body);
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    background-image:
      url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E"),
      linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-paper) 100%);
    min-height: 100dvh;
    /* No padding-top: hero is full-viewport; non-hero sections account for it */
  }

  .pages {
    position: relative;
    isolation: isolate;
  }

  /* Section pages: in-flow continuous scroll. JS adds .scroll-visible to fade in. */
  .section--page {
    position: relative;
    opacity: 0;
    transition: opacity 0.7s ease;
  }

  .section--page.scroll-visible {
    opacity: 1;
  }

  /* .active kept as a JS marker but no longer controls visibility */
  .section--page.active {
    z-index: auto;
  }

  /* Hero & RSVP: full-viewport stops in the scroll */
  .section--hero.section--page,
  .section--rsvp.section--page {
    height: 100dvh;
    overflow: hidden;
  }

  .section {
    padding-block: var(--section-padding-block);
    padding-inline: var(--section-padding-inline);
    /* On mobile, add bottom clearance so the FAB never hides content */
    padding-bottom: calc(var(--section-padding-block) + var(--fab-clearance, 0px));
    /*
     * No min-height here: setting min-height:100% inside an overflow:auto
     * container causes the browser to cap the scroll boundary at the
     * container's visible height, clipping any content that extends beyond.
     * Let the section size naturally to its content instead.
     */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
  }

  .section__inner {
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
  }

  .section--hero {
    padding: 0;
    min-height: 0;
  }
}

/* ============================================================
   Site header — default (light / frosted glass)
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  min-height: var(--site-header-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  padding: 0 var(--section-padding-inline) 0.6rem;
  background: var(--color-nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-nav-border);
  transition:
    background var(--transition-theme),
    border-color var(--transition-theme),
    backdrop-filter var(--transition-theme),
    box-shadow var(--transition-theme);
}

.site-header__title {
  font-family: var(--font-script);
  font-size: clamp(3.3rem, 9.75vw, 4.875rem);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: 0.02em;
  line-height: 1;
  transition: color var(--transition-theme), text-shadow var(--transition-theme);
}

.site-header__meta {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.4rem);
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-align: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  transition: color var(--transition-theme), text-shadow var(--transition-theme);
}

/* Below this width, break to three separate lines */
@media (max-width: 660px) {
  .site-header__meta {
    flex-direction: column;
    white-space: normal;
    font-size: clamp(0.95rem, 3.8vw, 1.1rem);
    gap: 0.1rem;
    line-height: 1.5;
  }
  .site-header__dot { display: none; }
}

.site-header__dot {
  margin-inline: 0.5em;
  color: var(--color-sage);
  font-size: 0.65em;
  flex-shrink: 0;
  transition: color var(--transition-theme);
}

/* ============================================================
   Hero mode — transparent overlay on full-screen photo
   ============================================================ */
body.hero-active .site-header {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
  box-shadow: none;
}

body.hero-active .site-header__title {
  color: #f8f2ea;
  text-shadow:
    0 0 40px rgba(255, 245, 225, 0.55),
    0 0 80px rgba(255, 240, 200, 0.25),
    0 2px 12px rgba(0, 0, 0, 0.35);
}

body.hero-active .site-header__meta {
  color: #fff;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.9),
    0 0 18px rgba(255, 248, 230, 0.65),
    0 0 40px rgba(255, 240, 200, 0.3);
}

body.hero-active .site-header__dot {
  color: rgba(248, 242, 234, 0.5);
}

/* Navigation */
@layer nav {
  .nav {
    position: fixed;
    top: var(--site-header-height);
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    /*
     * NO backdrop-filter here — it would trap position:fixed children
     * (toggle FAB + mobile menu list) to this element instead of viewport.
     * Frosting is handled by .nav::before instead.
     */
    background: transparent;
    border-bottom: 1px solid var(--color-nav-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-inline: var(--section-padding-inline);
    letter-spacing: 0.04em;
    transition: border-color var(--transition-theme), box-shadow var(--transition-theme);
  }

  /* Frosted glass lives here — pseudo-element can't trap fixed children */
  .nav::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: background var(--transition-theme), backdrop-filter var(--transition-theme);
    z-index: -1;
  }

  /* Hero mode nav */
  body.hero-active .nav {
    border-bottom-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
  }

  body.hero-active .nav::before {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: clamp(0.6rem, 2.5vw, 1.75rem);
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.6vw, 1.44rem);
  }

  .nav__link {
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 0.4em 0.65em;
    border-radius: 4px;
    letter-spacing: 0.05em;
    transition: color var(--transition-theme), background var(--transition-theme), border-color var(--transition-theme);
  }

  .nav__link:not(.nav__link--rsvp):hover {
    color: var(--color-link-hover);
    background: none;
    text-shadow: 0 0 14px rgba(156, 170, 138, 0.7), 0 0 28px rgba(156, 170, 138, 0.3);
  }

  .nav__link--active {
    color: var(--color-sage);
    font-weight: 600;
  }

  .nav__link--rsvp {
    background: var(--color-rsvp-bg);
    color: var(--color-rsvp-text);
    padding: 0.45em 1.1em;
    border-radius: 999px;
    border: 1px solid transparent;
  }

  .nav__link--rsvp:hover {
    background: var(--color-link-hover);
    color: var(--color-rsvp-text);
  }

  /* Hero mode nav links */
  body.hero-active .nav__link {
    color: rgba(244, 237, 228, 0.78);
  }

  body.hero-active .nav__link:not(.nav__link--rsvp):hover {
    color: #fff;
    background: none;
    text-shadow:
      0 0 16px rgba(255, 248, 225, 0.85),
      0 0 36px rgba(255, 240, 195, 0.4);
  }

  body.hero-active .nav__link--active {
    color: #f4ede4;
  }

  body.hero-active .nav__link--rsvp {
    background: transparent;
    color: #f4ede4;
    border-color: rgba(244, 237, 228, 0.5);
  }

  body.hero-active .nav__link--rsvp:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(244, 237, 228, 0.8);
  }

  /* ── Hamburger toggle: hidden on desktop ─────────────── */
  .nav__toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
  }

  .nav__toggle span {
    display: block;
    width: 1.35rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform var(--transition-medium), opacity var(--transition-fast);
  }

  .nav__toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* ── Mobile: collapse the nav bar; FAB + floating menu take over ── */
  @media (max-width: 768px) {
    :root {
      --nav-height: 0px;
      /* Extra bottom padding so the FAB (≈5rem tall + 1.5rem gap) never obscures the last line */
      --fab-clearance: 8rem;
    }

    .nav {
      height: 0;
      border-bottom: none;
      overflow: visible; /* allow fixed children to escape the zero-height box */
    }

    .nav::before { display: none; }
  }

  /* ── Mobile: FAB at bottom-right ─────────────────────── */
  @media (max-width: 768px) {
    .nav__toggle {
      display: flex;
      position: fixed;
      bottom: 1.5rem;
      right: 1.5rem;
      z-index: 2000;
      width: 3.25rem;
      height: 3.25rem;
      border-radius: 50%;
      /* light mode bubble */
      background: rgba(250, 249, 247, 0.88);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border: 1px solid rgba(156, 170, 138, 0.4);
      box-shadow:
        0 0 0 4px rgba(156, 170, 138, 0.08),
        0 0 18px rgba(156, 170, 138, 0.35),
        0 4px 20px rgba(0, 0, 0, 0.14);
      color: var(--color-text);
      transition:
        background var(--transition-theme),
        border-color var(--transition-theme),
        box-shadow var(--transition-theme),
        color var(--transition-theme),
        transform 0.15s ease;
    }

    .nav__toggle:hover {
      transform: scale(1.06);
    }

    /* Hero mode bubble: warm glowing white */
    body.hero-active .nav__toggle {
      background: rgba(255, 255, 255, 0.18);
      border-color: rgba(255, 255, 255, 0.45);
      box-shadow:
        0 0 0 4px rgba(255, 245, 220, 0.1),
        0 0 20px rgba(255, 245, 220, 0.55),
        0 0 40px rgba(255, 240, 195, 0.25),
        0 4px 20px rgba(0, 0, 0, 0.28);
      color: #fff;
    }

    /* FAB menu: floating card above and to the left of the FAB */
    .nav__list {
      position: fixed;
      bottom: 5.5rem;
      right: 1.5rem;
      left: auto;
      width: auto;
      min-width: 12rem;
      flex-direction: column;
      align-items: stretch;
      padding: 0.5rem;
      gap: 0;
      border-radius: 16px;
      /* light mode */
      background: rgba(250, 249, 247, 0.96);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid rgba(156, 170, 138, 0.25);
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.08);
      /* hidden state */
      transform: translateY(8px) scale(0.96);
      transform-origin: bottom right;
      visibility: hidden;
      opacity: 0;
      transition:
        transform var(--transition-medium),
        opacity var(--transition-medium),
        visibility var(--transition-medium),
        background var(--transition-theme),
        border-color var(--transition-theme),
        box-shadow var(--transition-theme);
    }

    /* Hero mode menu: dark frosted glass */
    body.hero-active .nav__list {
      background: rgba(18, 14, 10, 0.82);
      border-color: rgba(255, 255, 255, 0.12);
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 245, 220, 0.08);
    }

    .nav__list.open {
      transform: translateY(0) scale(1);
      visibility: visible;
      opacity: 1;
    }

    .nav__list li { width: 100%; }

    .nav__link {
      display: block;
      padding: 0.75rem 1.25rem;
      width: 100%;
      text-align: center;
      border-radius: 10px;
    }

    .nav__link--rsvp {
      margin-top: 0.25rem;
      text-align: center;
      background: none;
      border: none;
      padding: 0.75rem 1.25rem;
      color: var(--color-text-muted);
    }

    body.hero-active .nav__link--rsvp {
      background: none;
      border: none;
      color: rgba(244, 237, 228, 0.78);
    }
  }

  @media (min-width: 769px) {
    .nav__list { display: flex !important; }
  }

}

/* Page nav hint — mobile swipe indicator, fades in only at bottom */
.page-nav-hint {
  display: none;
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  font-size: 1.5rem;
  color: var(--color-sage);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, color var(--transition-theme), text-shadow var(--transition-theme);
}

.page-nav-hint.page-nav-hint--visible {
  opacity: 0.7;
}

@media (max-width: 768px) {
  .page-nav-hint {
    display: block;
  }

  .page-nav-hint[hidden] {
    display: none;
  }

  body.hero-active .page-nav-hint {
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  }
}

/* Sections */
@layer sections {
  /* Hero: full-viewport cover image */
  .section--hero {
    position: relative;
  }

  .section--hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      180deg,
      rgba(10, 8, 6, 0.86) 0%,
      rgba(10, 8, 6, 0.62) 18%,
      rgba(10, 8, 6, 0.26) 38%,
      transparent 58%
    );
    pointer-events: none;
    z-index: 2;
  }

  .hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 52%; /* crop line just above heads */
    display: block;
    position: relative;
    z-index: 1;
  }

  .coming-soon {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    color: var(--color-text-muted);
    font-style: italic;
    text-align: center;
  }

  /* Registry: coming soon large and centered (slightly above true center) */
  .section--registry {
    min-height: 100%;
    justify-content: flex-start;
  }

  .section--registry .section__inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding-top: clamp(5rem, 22vh, 9rem);
  }

  .section--registry .coming-soon {
    font-size: clamp(1.5rem, 3.75vw, 2.25rem);
  }

  /* RSVP: full-page background like hero, content overlaid */
  .section--rsvp {
    position: relative; /* explicit — Safari needs this to contain absolute children */
    padding: 0;
  }

  /* Mirror the hero__img pattern: position: relative so the img flows naturally
     and Safari renders it correctly inside a viewport-height container. */
  .rsvp__img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
  }

  /* Dark overlay: intense at top fading clear, plus dark vignette at bottom for text legibility */
  .section--rsvp::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background:
      linear-gradient(
        180deg,
        rgba(10, 8, 6, 0.95) 0%,
        rgba(10, 8, 6, 0.75) 12%,
        rgba(10, 8, 6, 0.3) 26%,
        transparent 36%
      ),
      linear-gradient(
        0deg,
        rgba(10, 8, 6, 0.72) 0%,
        rgba(10, 8, 6, 0.45) 18%,
        transparent 40%
      );
    pointer-events: none;
    z-index: 2;
  }

  /* Content overlays the image absolutely, same as .hero__content */
  .rsvp__content {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: var(--header-total) var(--section-padding-inline) calc(clamp(2rem, 5vh, 3.5rem) + var(--fab-clearance, 0px));
  }

  .section--rsvp .coming-soon {
    font-size: clamp(1.5rem, 3.75vw, 2.25rem);
    color: rgba(248, 242, 234, 0.95);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7), 0 0 24px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.75rem;
  }

  .section--rsvp .countdown {
    color: rgba(248, 242, 234, 0.95);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.3);
    background: rgba(18, 14, 10, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    margin-top: 0;
    width: 100%;
    max-width: 36rem;
  }

  .section--rsvp .countdown__prefix,
  .section--rsvp .countdown__value {
    color: inherit;
  }

  .section__heading {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    color: var(--color-text);
    margin-bottom: 1.25rem;
    text-align: center;
    letter-spacing: 0.06em;
    position: relative;
    padding-bottom: 0.75rem;
  }

  .section__heading::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-sage-muted), transparent);
  }

  /* Lodging: banner and content align with nav/text width */
  .section--lodging {
    padding: 0;
    align-items: center;
  }

  .lodging__banner {
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    flex-shrink: 0;
  }

  .lodging__banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .section--lodging .section__inner {
    padding: clamp(1.25rem, 3vw, 2rem) var(--section-padding-inline);
    padding-bottom: calc(var(--section-padding-block) + var(--fab-clearance, 0px));
  }

  /* Travel: same banner/content alignment as lodging */
  .section--travel {
    padding: 0;
    align-items: center;
  }

  .travel__banner {
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    flex-shrink: 0;
  }

  .travel__banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    display: block;
  }

  .section--travel .section__inner {
    padding: clamp(1.25rem, 3vw, 2rem) var(--section-padding-inline);
    padding-bottom: calc(var(--section-padding-block) + var(--fab-clearance, 0px));
  }

  .lodging__content,
  .travel__content {
    margin-top: 0;
  }

  /* Wide viewports: cap banner height so they don't dominate vertical space */
  @media (min-width: 1024px) {
    .lodging__banner,
    .travel__banner {
      aspect-ratio: unset;
      height: min(42vh, 420px);
    }
  }

  @media (max-width: 768px) {
    .lodging__banner,
    .travel__banner {
      aspect-ratio: 16 / 9.625;
    }

    .travel__banner img {
      object-position: center 50%;
    }

    .rsvp__img {
      object-position: center 40%;
    }
  }

  .lodging__content p + p,
  .travel__content p + p { margin-top: 1rem; }

  .section__content {
    color: var(--color-text-muted);
    line-height: 1.7;
  }

  .section__content p { margin-bottom: 1rem; }

  .section__content p:last-child { margin-bottom: 0; }

  /* Day-level heading generated from # in markdown */
  .section__content-h2 {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3.2vw, 1.65rem);
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.07em;
    text-align: center;
    margin-top: 2.25rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
    position: relative;
  }

  .section__content-h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-sage-light), transparent);
  }

  .section__content-h2:first-child { margin-top: 0; }

  .section__content-h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--color-text);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
  }

  /* Bullet lists from - items in markdown */
  .section__content-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1rem;
  }

  .section__content-list li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.35rem;
    color: var(--color-text-muted);
    line-height: 1.6;
  }

  .section__content-list li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--color-sage);
    font-size: 0.85em;
    top: 0.12em;
  }

  .section__content del {
    color: var(--color-text-muted);
    opacity: 0.55;
  }

  /* Itinerary-specific layout */
  #itinerary.section {
    padding-top: clamp(1.25rem, 3vw, 2rem);
  }

  .itinerary__content {
    max-width: 36rem;
    margin-inline: auto;
  }

  .itinerary__content p {
    text-align: center;
  }

  .section__content-a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .section__content-a:hover { color: var(--color-link-hover); }

  .countdown {
    margin-top: 2rem;
    padding: 1.5rem 1.75rem;
    background: var(--color-sage-muted);
    border-radius: 12px;
    border: 1px solid var(--color-nav-border);
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  .countdown__prefix {
    font-family: var(--font-display);
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
  }

  .countdown__value {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    color: var(--color-sage);
    font-weight: 600;
  }
}

/* Components */
@layer components {
  .placeholder-label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--color-text-muted);
  }
}

/* Gate overlay — password protection */
@layer gate {
  .gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(250, 249, 247, 0.35);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    transition: opacity 0.6s var(--ease-out);
  }

  .gate[hidden] {
    display: none;
  }

  .gate.gate--unlocking {
    opacity: 0;
    pointer-events: none;
  }

  @keyframes gate-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
  }

  .gate__inner--shake {
    animation: gate-shake 0.5s ease-in-out;
  }

  .gate__inner {
    width: 100%;
    max-width: 24rem;
    min-width: 18rem;
    padding: 2.5rem;
    background: rgba(250, 249, 247, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-nav-border);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
  }

  .gate__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .gate__form input {
    font-family: var(--font-body);
    font-size: 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-nav-border);
    border-radius: 10px;
    background: #fff;
    color: var(--color-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .gate__form input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
  }

  .gate__form input:focus {
    outline: none;
    border-color: var(--color-sage);
    box-shadow: 0 0 0 3px rgba(156, 170, 138, 0.2);
  }

  .gate__form button {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    background: var(--color-sage);
    color: var(--color-rsvp-text);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: background 0.2s ease;
  }

  .gate__form button:hover {
    background: var(--color-link-hover);
  }
}

/* Utilities */
@layer utilities {
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* ============================================================
   Desktop continuous-scroll overrides
   Outside all layers so they take precedence.
   ============================================================ */
@media (min-width: 769px) {
  /* scroll-margin-top ensures nav clicks land below the fixed headers
     without adding blank padding that creates a visible gap above content */
  .section--page {
    scroll-margin-top: var(--header-total);
  }

  /* Hide the scroll hint — not relevant with continuous scroll */
  .page-nav-hint {
    display: none !important;
  }
}

/* ============================================================
   Mobile continuous scroll — mobile-specific adjustments
   Outside all layers so it takes precedence over everything.
   ============================================================ */
@media (max-width: 768px) {
  /* Convert sections from position:fixed stacked panels to
     normal document flow so they scroll continuously */
  .section--page {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    overflow: visible !important;
    visibility: visible !important;
    pointer-events: auto !important;
    /* Start invisible; JS adds .scroll-visible to fade in */
    opacity: 0;
    transition: opacity 0.7s ease;
  }

  /* .active is a no-op on mobile — all sections are in flow */
  .section--page.active {
    z-index: auto !important;
    opacity: 0; /* still controlled by scroll-visible */
  }

  /* Scroll-reveal: IntersectionObserver adds this class */
  .section--page.scroll-visible {
    opacity: 1;
  }

  /* Hero and RSVP: full-viewport stops in the scroll.
     We use a JS-controlled --hero-height variable (set by initHeroHeightLock)
     that captures window.innerHeight and only ever grows.  This means:
       • At load (URL bar visible): height = svh → page fits perfectly.
       • After URL bar hides: height locks to lvh → user can scroll to RSVP top.
       • When URL bar reappears: height stays at lvh → max-scroll unchanged,
         no false-bottom.
     The 100svh fallback covers the instant before JS runs. */
  .section--hero.section--page,
  .section--rsvp.section--page {
    height: var(--hero-height, 100svh);
    overflow: hidden !important;
  }

  /* Correct scrollIntoView anchor so nav-tap lands below the header */
  .section--page {
    scroll-margin-top: var(--header-total);
  }

  /* Hide the swipe hint arrow — not needed with continuous scroll */
  .page-nav-hint {
    display: none !important;
  }

  /* Soft crossfade overrides are also no-ops on mobile */
  body.page-transition-soft .section--page {
    transition: opacity 0.7s ease;
  }

  /* Keep the title transition in sync with the rest of the header theme */
  .site-header__title {
    transition:
      color var(--transition-theme),
      text-shadow var(--transition-theme);
  }

  /* Height and opacity are scroll-driven via JS — clip overflow and hint compositor */
  .site-header__meta {
    overflow: hidden;
    will-change: opacity;
  }

  /* In continuous scroll the FAB doesn't trap content at the bottom of a section,
     so remove the 8rem bottom clearance that was needed for fixed-panel layout.
     RSVP keeps its own clearance since it is a true viewport stop. */
  .section--page:not(.section--rsvp) {
    --fab-clearance: 0px;
  }

  /* Registry centering padding is oversized for a scrollable flow */
  .section--registry .section__inner {
    padding-top: clamp(1.25rem, 3vw, 2rem);
  }

  /* Section headings: visible only on mobile where continuous scroll removes
     the nav-tab context that tells the user which section they are in */
  .section__heading {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 7.5vw, 3rem);
    color: var(--color-text);
    margin-bottom: 1.25rem;
    text-align: center;
    letter-spacing: 0.06em;
    position: relative;
    padding-bottom: 0.75rem;
    text-shadow:
      0 0 18px rgba(220, 120, 50, 0.22),
      0 0 32px rgba(90, 150, 70, 0.18),
      0 0 48px rgba(255, 255, 255, 0.14);
  }

  .section__heading::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-sage-muted), transparent);
  }
}
