:root {
  --ink: #3b2f22;
  --panel-bg: rgba(253, 248, 238, 0.92);
  --accent: #8a5a3b;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --script: 'Playfair Display', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background: #f2e9d4;
}

/* Nav */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25), transparent);
}

.nav-mark {
  font-family: var(--script);
  font-style: italic;
  font-size: 1.3rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.nav-links a:hover { text-decoration: underline; }

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  text-decoration: none;
}

.skip-link:focus {
  left: 1rem;
  top: 4.5rem;
}

/* Pinned scroll stage: one fixed viewport, seven images crossfade through it */
#story {
  position: relative;
  /* Total scroll track: 5 zones (js/main.js) at ~90vh/unit. */
  height: 450vh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.scroll-marker {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  opacity: 0;
  will-change: opacity, transform;
}

#bg-1 { opacity: 1; }

.content-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
}

.content-layer.is-active { pointer-events: auto; }

.scene-content {
  position: relative;
  max-width: 620px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  text-align: center;
  background: var(--panel-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(138, 90, 59, 0.25);
  border-radius: 10px;
  padding: 2.5rem 2.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.couple-names {
  font-family: var(--script);
  font-style: italic;
  font-size: 2.75rem;
  line-height: 1.2;
  white-space: nowrap;
  color: #000;
  margin: 0.2rem 0;
}

#content-hero .eyebrow { color: #1a1a1a; }

#content-hero .scene-content { max-width: 760px; }

.venue-line, .date-line {
  font-size: 1.15rem;
  margin: 0.3rem 0;
}

h2 {
  font-size: 2rem;
  margin: 0.2rem 0 0.8rem;
}

h3 { font-size: 1.2rem; margin: 1.2rem 0 0.3rem; }

.schedule-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  text-align: left;
  display: inline-block;
}

.schedule-list li { margin: 0.4rem 0; }

.schedule-list .time {
  font-weight: 600;
  color: var(--accent);
  margin-right: 0.6rem;
}

.dress-code { font-style: italic; margin-top: 1rem; }

.map-link, .gallery-cta {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.contact-note { font-size: 0.9rem; opacity: 0.8; margin-top: 1rem; }

/* FAQ */
.faq-item { text-align: left; margin-bottom: 1rem; }
.closing-note { margin-top: 1.5rem; font-style: italic; }

/* RSVP form */
.rsvp-panel { max-width: 480px; }

#rsvp-form { display: flex; flex-direction: column; gap: 1rem; text-align: left; }

#rsvp-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  gap: 0.3rem;
}

#rsvp-form input,
#rsvp-form select,
#rsvp-form textarea {
  font-family: var(--serif);
  font-size: 1rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(138, 90, 59, 0.4);
  border-radius: 6px;
  background: #fffdf9;
}

.attending-fieldset {
  border: 1px solid rgba(138, 90, 59, 0.3);
  border-radius: 6px;
  padding: 0.8rem;
}

.attending-fieldset legend { font-size: 0.9rem; color: var(--accent); }

.radio { flex-direction: row !important; align-items: center; gap: 0.5rem !important; }

#rsvp-form button {
  font-family: var(--serif);
  font-size: 1.05rem;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s;
}

#rsvp-form button:hover { opacity: 0.85; }

#rsvp-status, #lookup-status { font-size: 0.9rem; min-height: 1.2em; }

.welcome-note {
  font-style: italic;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

#invite-lookup-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

#invite-lookup-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  gap: 0.3rem;
}

#invite-lookup-form input {
  font-family: var(--serif);
  font-size: 1rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(138, 90, 59, 0.4);
  border-radius: 6px;
  background: #fffdf9;
}

#invite-lookup-form button {
  font-family: var(--serif);
  font-size: 1.05rem;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

@media (max-width: 600px) {
  .couple-names { font-size: 1.9rem; white-space: normal; }
  .scene-content { padding: 1.8rem 1.5rem; }
  .site-nav {
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.75rem 0.6rem;
  }
  .nav-mark {
    display: block;
    flex: 0 0 auto;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
  }
  .nav-links {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    gap: clamp(0.32rem, 1.8vw, 0.55rem);
    flex-wrap: nowrap;
  }
  .nav-links a {
    font-size: 0.68rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }
}

/* Respect reduced-motion: drop the pinned crossfade entirely and render a
   plain stacked page instead (main.js also skips building the scroll
   timeline in this case, so nothing here fights with JS). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  #story {
    height: auto;
  }

  .stage {
    position: static;
    height: auto;
  }

  .bg-layer {
    position: relative;
    height: 60vh;
    opacity: 1 !important;
    margin-bottom: 0.5rem;
  }

  .content-layer {
    position: relative;
    opacity: 1 !important;
    pointer-events: auto !important;
    padding: 3rem 1.5rem;
  }

  .scene-content {
    max-height: none;
  }

  .scroll-marker {
    position: static;
  }
}
