:root {
  --bg: #f3f8f1;
  --bg-alt: #e4efe1;
  --ink: #25372a;
  --muted: #647667;
  --gold: #6e9a73;
  --gold-dark: #4d7753;
  --cta: #8c68b8;
  --cta-dark: #6d4d96;
  --line: #cadbc8;
  --white: #ffffff;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
  --maxw: 1080px;
  --shadow: 0 18px 50px rgba(37, 55, 42, 0.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

body.subpage {
  background: linear-gradient(180deg, #e9f1e5 0%, var(--bg) 220px);
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow { max-width: 720px; }
.section-story .container.narrow { max-width: 980px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 34px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--cta);
  color: #fff;
}
.btn-primary:hover { background: var(--cta-dark); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  color: var(--cta-dark);
  border-color: var(--cta);
}
.btn-outline:hover { background: var(--cta); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #d8e7d5;
  overflow: hidden;
  isolation: isolate;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(243, 248, 241, 0.82) 0%, rgba(243, 248, 241, 0.4) 34%, rgba(228, 239, 225, 0.58) 100%),
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.18) 28%, rgba(255, 255, 255, 0) 58%);
  z-index: 1;
  pointer-events: none;
}
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
  filter: brightness(0.84) saturate(0.94) contrast(1.02);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid var(--line);
  pointer-events: none;
  z-index: 4;
}

.nav {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 40px;
}
.nav-monogram {
  font-family: var(--serif);
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: #213026;
  text-shadow: 0 2px 16px rgba(243, 248, 241, 0.9);
}
.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #47604c;
  text-shadow: 0 2px 14px rgba(243, 248, 241, 0.86);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold-dark); }
.nav-cta {
  color: var(--cta-dark) !important;
  border-bottom: 1px solid var(--cta);
  padding-bottom: 2px;
}

.subpage-header {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0) 44%),
    linear-gradient(180deg, #dcead9 0%, #eff6ec 100%);
  border-bottom: 1px solid var(--line);
}
.nav-subpage {
  max-width: var(--maxw);
  margin: 0 auto;
}
.subpage-header .nav-monogram,
.subpage-header .nav-links a {
  text-shadow: none;
}
.subpage-intro {
  text-align: center;
  padding: 56px 24px 86px;
}
.subpage-title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  font-weight: 500;
  line-height: 0.95;
  margin: 0 0 18px;
}
.subpage-copy {
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.05rem;
  color: #506551;
}

.hero-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  isolation: isolate;
}
.hero-inner::before {
  content: "";
  position: absolute;
  inset: 4% -2% 8%;
  border-radius: 40px;
  z-index: -1;
  pointer-events: none;
}
.hero-eyebrow {
  font-size: 1.4rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #4b7352;
  margin: 0 0 18px;
  text-shadow: 0 2px 20px rgba(243, 248, 241, 0.96);
}
.hero-names {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.2rem, 11vw, 7rem);
  line-height: 1;
  margin: 0;
  letter-spacing: 0.01em;
  color: #213126;
  text-shadow: 0 8px 32px rgba(243, 248, 241, 0.88), 0 1px 0 rgba(255, 255, 255, 0.45);
}
.hero-names span {
  display: block;
  font-size: 0.42em;
  font-style: italic;
  color: #628967;
  margin: 8px 0;
}
.hero-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  color: #435845;
  margin: 22px 0 6px;
  text-shadow: 0 2px 18px rgba(243, 248, 241, 0.96);
}
.hero-meta {
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #263529;
  margin: 0 0 36px;
  text-shadow: 0 2px 16px rgba(243, 248, 241, 0.96);
}

/* ---------- Countdown ---------- */
.countdown {
  display: flex;
  gap: clamp(16px, 4vw, 44px);
  margin-bottom: 40px;
}
.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
}
.countdown-unit span {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 500;
  color: #4b7250;
  line-height: 1;
  text-shadow: 0 2px 18px rgba(243, 248, 241, 0.96);
}
.countdown-unit label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #213026;
  margin-top: 8px;
  text-shadow: 0 2px 16px rgba(243, 248, 241, 0.96);
}

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section-details { background: var(--bg-alt); }
.section-rsvp { background: var(--bg-alt); }
.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3rem);
  text-align: center;
  margin: 0 0 10px;
}
.ornament {
  text-align: center;
  color: var(--gold);
  font-size: 1.4rem;
  margin-bottom: 44px;
}

/* Story */
.story-paragraph {
  font-family: var(--serif);
  font-size: 1.3rem;
  text-align: center;
  color: var(--ink);
  max-width: 720px;
  margin: 0 auto 24px;
}
.story-polaroids {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  /* gap: 12px; */
  margin-top: 56px;
}
.story-polaroid {
  width: calc((100% - 40px) / 3);
  max-width: 280px;
  margin: 0;
  padding: 16px 16px 34px;
  background: var(--white);
  border: 1px solid rgba(37, 55, 42, 0.08);
  box-shadow: 0 20px 40px rgba(37, 55, 42, 0.14);
}
.story-polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.story-polaroid:first-child { transform: rotate(-8deg) translateY(10px); }
.story-polaroid:nth-child(2) { transform: rotate(3deg); }
.story-polaroid:last-child { transform: rotate(14deg) translateY(20px); }

/* Details cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 40px 34px;
  text-align: center;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 500;
  margin: 0 0 6px;
}
.card-time {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin: 0 0 18px;
}
.card-venue { font-weight: 500; margin: 0 0 2px; }
.card-address { color: var(--muted); font-size: 0.92rem; margin: 0 0 16px; }
.card-desc { color: var(--ink); margin: 0 0 20px; }
.card-map {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cta-dark);
  text-decoration: none;
  border-bottom: 1px solid var(--cta);
  padding-bottom: 2px;
}

/* Timeline */
.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 480px; }
.timeline-item {
  display: grid;
  grid-template-columns: 110px 24px 1fr;
  align-items: center;
  padding: 14px 0;
}
.timeline-time {
  text-align: right;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  padding-right: 16px;
}
.timeline-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  justify-self: center;
  position: relative;
}
.timeline-item:not(:last-child) .timeline-dot::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 44px;
  background: var(--line);
}
.timeline-label {
  font-family: var(--serif);
  font-size: 1.3rem;
  padding-left: 16px;
}

/* RSVP form */
.rsvp-deadline {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--muted);
  margin: -20px 0 36px;
}
.rsvp-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 40px;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 22px; }
.field label, .field-label {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="file"],
.field input[type="number"],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color 0.2s;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.field input[type="file"] {
  padding: 14px;
  line-height: 1.5;
}
.field-help {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.radio-row { display: flex; flex-wrap: wrap; gap: 20px; }
.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
}
.radio input { accent-color: var(--gold); }
.rsvp-form .btn { width: 100%; border: none; margin-top: 6px; }
.form-status {
  text-align: center;
  margin: 18px 0 0;
  font-size: 0.95rem;
  min-height: 1.2em;
}
.form-status.success { color: #4f7a4a; }
.form-status.error { color: #b4554a; }
[data-show-if-attending].hidden { display: none; }

.photo-upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 32px;
  align-items: start;
}
.photo-upload-form {
  min-width: 0;
}
.photo-side-note {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 34px 28px;
  box-shadow: var(--shadow);
}
.photo-side-note h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
}
.photo-side-note p {
  margin: 0 0 16px;
  color: var(--muted);
}

/* FAQ */
.faq-list { margin-bottom: 60px; }
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.faq-item summary {
  font-family: var(--serif);
  font-size: 1.3rem;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 30px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 1.4rem;
}
.faq-item[open] summary::after { content: "\2013"; }
.faq-item p { margin: 12px 0 0; color: var(--muted); }

.registry {
  text-align: center;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 44px 30px;
}
.registry h3 {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 500;
  margin: 0 0 12px;
}
.registry p { color: var(--muted); margin: 0 auto 24px; max-width: 460px; }

/* Footer */
.footer {
  text-align: center;
  padding: 70px 24px;
  background: var(--ink);
  color: #efe9df;
}
.footer-names {
  font-family: var(--serif);
  font-size: 2.4rem;
  margin: 0 0 10px;
}
.footer-message { font-family: var(--serif); font-style: italic; font-size: 1.2rem; margin: 0 0 18px; opacity: 0.85; }
.footer-hashtag {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 10px;
}
.footer-meta { font-size: 0.78rem; letter-spacing: 0.1em; opacity: 0.6; margin: 0; }
.footer-credit {
  margin: 16px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  opacity: 0.62;
}
.footer-credit a {
  color: inherit;
  text-underline-offset: 2px;
}

/* Reveal on scroll */
.section { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s ease; }
.section.in-view { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav { padding: 20px; flex-direction: column; gap: 14px; }
  .nav-links { gap: 18px; flex-wrap: wrap; justify-content: center; }
  .section { padding: 70px 0; }
  .hero::after { inset: 12px; }
  .hero-video { object-position: 62% center; }
  .hero-inner::before { inset: 8% -6% 10%; }
  .subpage-intro { padding: 42px 24px 60px; }
  .subpage-copy { font-size: 1rem; }
  .story-polaroids { flex-wrap: wrap; gap: 18px; margin-top: 40px; }
  .story-polaroid {
    width: min(100%, 260px);
    max-width: none;
    padding: 14px 14px 28px;
  }
  .photo-upload-layout { grid-template-columns: 1fr; }
  .photo-side-note { padding: 28px 24px; }
  .timeline-item { grid-template-columns: 92px 20px 1fr; }
  .rsvp-form { padding: 28px 20px; }

  .story-polaroid:last-child { transform: rotate(-3deg) translateY(0px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .section { opacity: 1; transform: none; transition: none; }
}
