/* ==========================================================
   Sarah & James — Wedding Invitation
   Pure CSS, no external requests. Font: Cormorant Garamond (OFL), self-hosted.
   ========================================================== */
@font-face {
  font-family: "Cormorant";
  src: url("../fonts/cormorant-garamond-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("../fonts/cormorant-garamond-italic-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --ivory: #faf7f2;
  --paper: #f3ece2;
  --blush: #f1e2dc;
  --ink: #2b2622;
  --ink-soft: #5e554d;
  --gold: #b8955e;
  --gold-deep: #85663a;
  --gold-light: #d9bf8f;
  --rose: #b97b76;
  --sage: #8c9a84;
  --night: #1d1916;
  --line: rgba(133, 102, 58, .28);
  --serif: "Cormorant", "Cormorant Garamond", Garamond, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
  --shadow: 0 18px 50px -24px rgba(43, 38, 34, .35);
  --max: 1180px;
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--ivory);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; }
p { margin: 0 0 1em; }
.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; }

:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; border-radius: 2px; }
.on-dark :focus-visible, .hero :focus-visible, .lightbox :focus-visible { outline-color: var(--gold-light); }

.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 200;
  background: var(--ink); color: var(--ivory); padding: 10px 16px; border-radius: var(--radius);
  text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; }

.container { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.section { padding: clamp(72px, 10vw, 140px) 0; position: relative; }

/* ---------- Typographic helpers ---------- */
.eyebrow {
  font-family: var(--sans); font-size: .74rem; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold-deep); font-weight: 600; margin: 0 0 18px;
}
.section-head { text-align: center; max-width: 640px; margin: 0 auto clamp(40px, 6vw, 72px); }
.section-head h2 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 400; }
.section-head h2 em { font-style: italic; color: var(--gold-deep); }
.section-head p.lead { font-family: var(--serif); font-size: clamp(1.15rem, 2vw, 1.35rem); color: var(--ink-soft); margin-top: 18px; }
.flourish { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 22px auto 0; color: var(--gold); }
.flourish::before, .flourish::after { content: ""; height: 1px; width: 64px; background: linear-gradient(90deg, transparent, currentColor); }
.flourish::after { transform: scaleX(-1); }
.flourish svg { width: 18px; height: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 28px; border-radius: 999px;
  font-family: var(--sans); font-size: .8rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; border: 1px solid transparent; transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-gold { background: var(--gold); color: #1d1916; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-light); border-color: var(--gold-light); }
.btn-ghost-light { color: #fff; border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.04); }
.btn-ghost-light:hover { background: rgba(255,255,255,.14); border-color: #fff; }
.btn-ink { background: var(--ink); color: var(--ivory); }
.btn-ink:hover { background: #000; }
.btn-outline { border-color: var(--gold-deep); color: var(--gold-deep); background: transparent; }
.btn-outline:hover { background: var(--gold-deep); color: #fff; }
.btn:active { transform: translateY(1px); }

/* ---------- Back to projects ---------- */
.back-link {
  position: fixed; left: 14px; bottom: 14px; z-index: 90;
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
  padding: 6px 14px; border-radius: 999px; font-size: .78rem; font-weight: 600; letter-spacing: .04em;
  background: rgba(29, 25, 22, .82); color: #f6efe4; text-decoration: none;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px -8px rgba(0,0,0,.4); opacity: .85; transition: opacity .2s, transform .2s;
}
.back-link:hover, .back-link:focus-visible { opacity: 1; transform: translateY(-2px); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center; color: #fff;
  transition: background .35s, color .35s, box-shadow .35s;
}
.nav.scrolled { background: rgba(250, 247, 242, .94); color: var(--ink); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: min(100% - 32px, 1320px); margin-inline: auto; }
.monogram { font-family: var(--serif); font-size: 1.7rem; font-style: italic; text-decoration: none; letter-spacing: .02em; display: inline-flex; align-items: center; min-height: 44px; }
.monogram span { color: var(--gold-light); margin: 0 .15em; }
.nav.scrolled .monogram span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 34px); list-style: none; margin: 0; padding: 0; }
.nav-links a:not(.btn) {
  text-decoration: none; font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 500;
  padding: 10px 0; position: relative; display: inline-block;
}
.nav-links a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: currentColor; transform: scaleX(0); transition: transform .3s; }
.nav-links a:not(.btn):hover::after, .nav-links a[aria-current="true"]::after { transform: scaleX(1); }
.nav-links .btn { min-height: 40px; padding: 8px 22px; }
.nav:not(.scrolled) .nav-links .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.nav:not(.scrolled) .nav-links .btn:hover { background: #fff; color: var(--ink); }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
    background: none; border: 0; color: inherit; margin-right: -8px; position: relative; z-index: 2;
  }
  .menu-toggle .bars, .menu-toggle .bars::before, .menu-toggle .bars::after {
    display: block; width: 24px; height: 1.5px; background: currentColor; position: relative; transition: transform .3s, background .3s;
  }
  .menu-toggle .bars::before, .menu-toggle .bars::after { content: ""; position: absolute; left: 0; }
  .menu-toggle .bars::before { top: -7px; }
  .menu-toggle .bars::after { top: 7px; }
  .menu-toggle[aria-expanded="true"] .bars { background: transparent; }
  .menu-toggle[aria-expanded="true"] .bars::before { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .bars::after { transform: translateY(-7px) rotate(-45deg); }
  .nav-links {
    position: fixed; inset: 0; z-index: 1; flex-direction: column; justify-content: center; gap: 6px;
    background: var(--ivory); color: var(--ink);
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  }
  .nav-links.open { opacity: 1; visibility: visible; }
  .nav-links a:not(.btn) { font-family: var(--serif); font-size: 2rem; letter-spacing: .02em; text-transform: none; font-style: italic; padding: 8px 16px; }
  .nav-links a:not(.btn)::after { display: none; }
  .nav-links li:last-child { margin-top: 20px; }
  .nav-links .btn, .nav:not(.scrolled) .nav-links .btn { min-height: 50px; padding: 12px 34px; background: var(--ink); color: var(--ivory); border-color: var(--ink); }
  body.menu-open .nav { color: var(--ink); }
  body.menu-open { overflow: hidden; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center;
  color: #fff; text-align: center; overflow: hidden; isolation: isolate; background: var(--night);
  padding: calc(var(--nav-h) + 24px) 20px 110px;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; animation: heroZoom 18s ease-out both; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at center, rgba(20,16,13,.35) 0%, rgba(20,16,13,.7) 70%),
    linear-gradient(180deg, rgba(20,16,13,.55) 0%, rgba(20,16,13,.15) 40%, rgba(20,16,13,.75) 100%);
}
.hero-frame { position: absolute; inset: calc(var(--nav-h) + 4px) clamp(14px, 3vw, 34px) clamp(14px, 3vw, 34px); border: 1px solid rgba(217,191,143,.45); pointer-events: none; z-index: -1; }
.hero-frame::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(217,191,143,.2); }
.hero-content { max-width: 880px; }
.hero-prelude { font-size: .76rem; letter-spacing: .38em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 26px; }
.hero h1 { font-size: clamp(3.6rem, 13vw, 9.5rem); font-weight: 300; font-style: italic; line-height: .92; letter-spacing: -.01em; }
.hero h1 .amp { display: block; font-size: .45em; color: var(--gold-light); margin: .12em 0 .08em; font-weight: 400; }
.hero-invite { font-family: var(--serif); font-size: clamp(1.2rem, 2.6vw, 1.6rem); font-style: italic; margin: 28px auto 8px; color: rgba(255,255,255,.9); max-width: 32ch; }
.hero-date {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px;
  font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; margin: 18px 0 38px;
}
.hero-date .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold-light); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.scroll-cue {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: .66rem; letter-spacing: .3em; text-transform: uppercase; text-decoration: none; color: rgba(255,255,255,.75);
  padding: 8px;
}
.scroll-cue i { width: 1px; height: 42px; background: linear-gradient(var(--gold-light), transparent); animation: cue 2.4s ease-in-out infinite; transform-origin: top; }
@media (max-height: 940px) { .scroll-cue { display: none; } }
@keyframes cue { 0%,100% { transform: scaleY(.3); opacity: .4; } 50% { transform: scaleY(1); opacity: 1; } }
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1); } }

.hero-reveal > * { opacity: 0; transform: translateY(18px); animation: rise 1s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-reveal > *:nth-child(1) { animation-delay: .2s; }
.hero-reveal > *:nth-child(2) { animation-delay: .45s; }
.hero-reveal > *:nth-child(3) { animation-delay: .75s; }
.hero-reveal > *:nth-child(4) { animation-delay: .95s; }
.hero-reveal > *:nth-child(5) { animation-delay: 1.15s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Countdown ---------- */
.countdown { background: var(--paper); padding: clamp(56px, 8vw, 96px) 0; text-align: center; position: relative; }
.countdown::before, .countdown::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); width: min(90%, 900px); height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.countdown::before { top: 18px; } .countdown::after { bottom: 18px; }
.countdown h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-style: italic; font-weight: 400; margin-bottom: 34px; }
.cd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 150px)); justify-content: center; gap: clamp(8px, 3vw, 40px); list-style: none; margin: 0 auto; padding: 0; }
.cd-grid li { position: relative; }
.cd-grid li + li::before { content: ""; position: absolute; left: calc(clamp(8px, 3vw, 40px) / -2); top: 18%; bottom: 30%; width: 1px; background: var(--line); }
.cd-num { display: block; font-family: var(--serif); font-size: clamp(2.6rem, 9vw, 5.2rem); font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums lining-nums; color: var(--ink); }
.cd-label { display: block; margin-top: 10px; font-size: .68rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; }
.cd-note { margin: 30px auto 0; font-family: var(--serif); font-size: 1.2rem; font-style: italic; color: var(--ink-soft); }
.cd-done { font-family: var(--serif); font-size: clamp(1.6rem, 4vw, 2.4rem); font-style: italic; }

/* ---------- Story ---------- */
.story-intro { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(36px, 7vw, 110px); align-items: center; margin-bottom: clamp(80px, 11vw, 150px); }
.story-photo { position: relative; }
.story-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 240px 240px var(--radius) var(--radius); box-shadow: var(--shadow); }
.story-photo::before { content: ""; position: absolute; inset: -16px 16px 16px -16px; border: 1px solid var(--gold); border-radius: 250px 250px var(--radius) var(--radius); z-index: -1; }
.story-photo figcaption { position: absolute; right: -14px; bottom: 34px; background: var(--ivory); padding: 14px 20px; font-family: var(--serif); font-style: italic; font-size: 1.1rem; box-shadow: var(--shadow); }
.story-copy h2 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 400; margin-bottom: 26px; }
.story-copy h2 em { color: var(--gold-deep); }
.story-copy .dropcap::first-letter { font-family: var(--serif); float: left; font-size: 4.2em; line-height: .8; padding: 6px 12px 0 0; color: var(--gold-deep); }
.story-copy p { color: var(--ink-soft); font-size: 1.04rem; }
.story-sign { font-family: var(--serif); font-style: italic; font-size: 1.6rem; color: var(--ink) !important; margin-top: 26px; }

.timeline { position: relative; list-style: none; margin: 0 auto; padding: 0; max-width: 1000px; }
.timeline::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: linear-gradient(transparent, var(--gold) 6%, var(--gold) 94%, transparent); }
.tl-item { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; margin-bottom: clamp(40px, 6vw, 72px); }
.tl-item:last-child { margin-bottom: 0; }
.tl-marker { grid-column: 2; justify-self: center; width: 46px; height: 46px; border-radius: 50%; background: var(--ivory); border: 1px solid var(--gold); display: grid; place-items: center; color: var(--gold-deep); position: relative; z-index: 1; }
.tl-marker svg { width: 20px; height: 20px; }
.tl-card { grid-row: 1; padding: 6px 0; }
.tl-item:nth-child(odd) .tl-card { grid-column: 1; text-align: right; padding-right: 26px; }
.tl-item:nth-child(even) .tl-card { grid-column: 3; padding-left: 26px; }
.tl-media { grid-row: 1; }
.tl-item:nth-child(odd) .tl-media { grid-column: 3; padding-left: 26px; }
.tl-item:nth-child(even) .tl-media { grid-column: 1; padding-right: 26px; }
.tl-media img { width: 100%; max-width: 360px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.tl-item:nth-child(even) .tl-media img { margin-left: auto; }
.tl-year { font-size: .72rem; letter-spacing: .3em; font-weight: 600; color: var(--gold-deep); text-transform: uppercase; }
.tl-card h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 500; margin: 8px 0 10px; }
.tl-card p { color: var(--ink-soft); margin: 0; }
.tl-quote { font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2.4vw, 1.7rem); color: var(--ink-soft); line-height: 1.35; }
.tl-item:nth-child(odd) .tl-quote { padding-left: 26px; grid-column: 3; }
.tl-item:nth-child(even) .tl-quote { padding-right: 26px; grid-column: 1; text-align: right; }

/* ---------- Schedule ---------- */
.schedule { background: var(--night); color: #efe7db; overflow: hidden; }
.schedule .eyebrow { color: var(--gold-light); }
.schedule .section-head h2 em { color: var(--gold-light); }
.schedule .section-head p.lead { color: rgba(239,231,219,.75); }
.schedule-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 90px); align-items: start; }
.agenda { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(217,191,143,.22); }
.agenda li { display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 22px 0; border-bottom: 1px solid rgba(217,191,143,.22); }
.agenda time { font-family: var(--serif); font-size: 1.5rem; color: var(--gold-light); line-height: 1.2; font-variant-numeric: lining-nums; }
.agenda h3 { font-size: 1.45rem; font-weight: 500; margin-bottom: 4px; color: #fff; }
.agenda p { margin: 0; color: rgba(239,231,219,.72); font-size: .95rem; }
.agenda .tag { display: inline-block; margin-top: 8px; font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-light); border: 1px solid rgba(217,191,143,.4); border-radius: 999px; padding: 3px 10px; }
.venues { display: grid; gap: 22px; }
.venue {
  background: rgba(255,255,255,.035); border: 1px solid rgba(217,191,143,.25); border-radius: var(--radius);
  overflow: hidden;
}
.venue img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.venue-body { padding: 26px clamp(20px, 3vw, 32px) 28px; }
.venue .kicker { font-size: .68rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold-light); font-weight: 600; }
.venue h3 { font-size: 1.9rem; margin: 8px 0 6px; color: #fff; font-weight: 500; }
.venue address { font-style: normal; color: rgba(239,231,219,.78); margin-bottom: 18px; }
.venue-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .88rem; color: rgba(239,231,219,.78); margin-bottom: 20px; }
.venue-meta span { display: inline-flex; align-items: center; gap: 8px; }
.venue-meta svg { width: 16px; height: 16px; color: var(--gold-light); }
.venue .btn { min-height: 44px; padding: 10px 22px; font-size: .72rem; }
.venue .btn-ghost-light { border-color: rgba(217,191,143,.55); }
.cal-cta { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 22px 26px; border: 1px dashed rgba(217,191,143,.4); border-radius: var(--radius); }
.cal-cta p { margin: 0; flex: 1 1 220px; color: rgba(239,231,219,.8); font-family: var(--serif); font-size: 1.2rem; font-style: italic; }

/* ---------- Details / FAQ ---------- */
.details { background: var(--paper); }
.details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: clamp(48px, 7vw, 80px); }
.detail-card { background: var(--ivory); padding: 34px 28px; border-radius: var(--radius); text-align: center; border: 1px solid var(--line); }
.detail-card svg { width: 34px; height: 34px; color: var(--gold); margin: 0 auto 16px; display: block; }
.detail-card h3 { font-size: 1.6rem; margin-bottom: 8px; }
.detail-card p { color: var(--ink-soft); margin: 0; font-size: .96rem; }
.faq { max-width: 820px; margin: 0 auto; }
.faq h3 { text-align: center; font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-style: italic; font-weight: 400; margin-bottom: 20px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 20px 4px; font-family: var(--serif); font-size: 1.3rem; font-weight: 500; min-height: 56px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); font-weight: 300; font-size: 1.6rem; color: var(--gold-deep); transition: transform .3s; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 4px 20px; margin: 0; color: var(--ink-soft); }

/* ---------- Gallery ---------- */
.gallery-grid { columns: 3 280px; column-gap: 16px; }
.g-item {
  display: block; width: 100%; margin: 0 0 16px; padding: 0; border: 0; background: var(--paper);
  break-inside: avoid; position: relative; overflow: hidden; border-radius: var(--radius); cursor: zoom-in;
}
.g-item img { width: 100%; height: auto; transition: transform .7s cubic-bezier(.2,.7,.2,1), filter .5s; }
.g-item::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(29,25,22,.55));
  opacity: 0; transition: opacity .4s;
}
.g-item:hover img, .g-item:focus-visible img { transform: scale(1.04); }
.g-item:hover::after, .g-item:focus-visible::after { opacity: 1; }
.g-item span { position: absolute; left: 18px; bottom: 14px; z-index: 1; color: #fff; font-family: var(--serif); font-style: italic; font-size: 1.2rem; opacity: 0; transform: translateY(8px); transition: .4s; }
.g-item:hover span, .g-item:focus-visible span { opacity: 1; transform: none; }

.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(17, 14, 12, .95);
  display: grid; grid-template-rows: auto 1fr auto; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  touch-action: pan-y;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: rgba(255,255,255,.8); font-size: .8rem; letter-spacing: .2em; }
.lb-stage { display: grid; place-items: center; min-height: 0; padding: 0 clamp(8px, 7vw, 100px); position: relative; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100svh - 150px); width: auto; height: auto; object-fit: contain; border-radius: 2px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lb-caption { text-align: center; color: #efe7db; font-family: var(--serif); font-style: italic; font-size: 1.2rem; padding: 14px 16px 24px; margin: 0; }
.lb-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.3); color: #fff;
  display: grid; place-items: center; transition: background .2s;
}
.lb-btn:hover { background: rgba(255,255,255,.15); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: clamp(8px, 2vw, 30px); } .lb-next { right: clamp(8px, 2vw, 30px); }

/* ---------- RSVP ---------- */
.rsvp { background:
  radial-gradient(circle at 10% 0%, rgba(185,123,118,.12), transparent 40%),
  radial-gradient(circle at 100% 100%, rgba(184,149,94,.15), transparent 45%), var(--ivory); }
.rsvp-card {
  max-width: 780px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(28px, 6vw, 64px); box-shadow: var(--shadow); position: relative;
}
.rsvp-card::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(184,149,94,.18); pointer-events: none; border-radius: 2px; }
.rsvp-deadline { text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--ink-soft); margin: -8px 0 32px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 24px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, fieldset legend, .field-label { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; color: var(--ink); }
.field .opt { font-weight: 400; letter-spacing: .05em; text-transform: none; color: var(--ink-soft); }
.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid #d8cdbd; border-radius: var(--radius); background: var(--ivory);
  font-size: 1rem; transition: border-color .2s, box-shadow .2s; appearance: none; -webkit-appearance: none;
}
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--gold-deep) 50%), linear-gradient(135deg, var(--gold-deep) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: none; border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(184,149,94,.22); }
.input[aria-invalid="true"] { border-color: #b3423a; }
.error { font-size: .84rem; color: #a2332c; min-height: 0; margin: 0; }
.error:empty { display: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset legend { margin-bottom: 10px; padding: 0; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px;
  min-height: 72px; padding: 12px; border: 1px solid #d8cdbd; border-radius: var(--radius); background: var(--ivory);
  font-family: var(--serif); font-size: 1.25rem; transition: border-color .2s, background .2s, color .2s;
}
.choice label small { font-family: var(--sans); font-size: .74rem; color: var(--ink-soft); }
.choice input:checked + label { border-color: var(--gold-deep); background: #fbf4e8; box-shadow: inset 0 0 0 1px var(--gold-deep); }
.choice input:focus-visible + label { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.choice-row[aria-invalid="true"] label { border-color: #b3423a; }
.stepper { display: inline-flex; align-items: center; border: 1px solid #d8cdbd; border-radius: 999px; background: var(--ivory); width: max-content; }
.stepper button { width: 48px; height: 48px; border: 0; background: none; font-size: 1.4rem; color: var(--gold-deep); border-radius: 50%; }
.stepper button:disabled { opacity: .3; cursor: not-allowed; }
.stepper output { min-width: 40px; text-align: center; font-family: var(--serif); font-size: 1.5rem; }
.guests-list { display: grid; gap: 14px; }
.guest-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; padding: 16px; border-radius: var(--radius); background: #fcf9f4; border: 1px solid #efe6d8; }
.guest-row .guest-title { grid-column: 1 / -1; font-family: var(--serif); font-size: 1.15rem; font-style: italic; color: var(--gold-deep); }
.attending-only[hidden] { display: none; }
.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.form-actions p { margin: 0; font-size: .86rem; color: var(--ink-soft); }
.form-status { grid-column: 1 / -1; margin: 0; padding: 12px 16px; border-radius: var(--radius); background: #fbeae8; color: #8f2a24; font-size: .92rem; }
.form-status:empty { display: none; }

.rsvp-done { text-align: center; }
.rsvp-done[hidden] { display: none; }
.rsvp-done .seal { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--rose); color: #fff; font-family: var(--serif); font-style: italic; font-size: 1.6rem; box-shadow: 0 10px 30px -10px rgba(185,123,118,.8); }
.rsvp-done h3 { font-size: clamp(2rem, 5vw, 2.8rem); font-style: italic; font-weight: 400; margin-bottom: 10px; }
.rsvp-done > p { color: var(--ink-soft); max-width: 46ch; margin-inline: auto; }
.summary { text-align: left; margin: 28px auto; max-width: 520px; border-top: 1px solid var(--line); }
.summary div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.summary dt { color: var(--ink-soft); }
.summary dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- Closing & footer ---------- */
.closing { position: relative; color: #fff; text-align: center; overflow: hidden; isolation: isolate; padding: clamp(110px, 16vw, 200px) 0; }
.closing img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.closing::before { content: ""; position: absolute; inset: 0; background: rgba(24, 20, 17, .6); z-index: -1; }
.closing blockquote { margin: 0 auto; max-width: 780px; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(1.7rem, 4.2vw, 3rem); line-height: 1.25; }
.closing cite { display: block; margin-top: 22px; font-style: normal; font-family: var(--sans); font-size: .74rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-light); }
.footer { background: var(--night); color: rgba(239,231,219,.7); text-align: center; padding: 64px 0 90px; font-size: .88rem; }
.footer .monogram { color: #fff; font-size: 2.4rem; justify-content: center; }
.footer .hashtag { color: var(--gold-light); letter-spacing: .2em; font-size: .78rem; text-transform: uppercase; margin: 8px 0 24px; }
.footer p { margin: 0 0 6px; }
.footer a { color: var(--gold-light); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .details-grid { grid-template-columns: 1fr 1fr; }
  .details-grid .detail-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .schedule-wrap { grid-template-columns: 1fr; }
  .venues { grid-template-columns: 1fr 1fr; }
  .story-intro { grid-template-columns: 1fr; }
  .story-photo { max-width: 440px; margin: 0 auto; width: calc(100% - 20px); }
}
@media (max-width: 720px) {
  :root { --nav-h: 60px; }
  .venues { grid-template-columns: 1fr; }
  .timeline::before { left: 22px; }
  .tl-item { grid-template-columns: 46px 1fr; column-gap: 18px; row-gap: 14px; align-items: start; }
  .tl-marker { grid-column: 1 !important; grid-row: 1 / span 2; }
  .tl-item .tl-card, .tl-item:nth-child(odd) .tl-card, .tl-item:nth-child(even) .tl-card { grid-column: 2; grid-row: 1; text-align: left; padding: 6px 0 0; }
  .tl-item .tl-media, .tl-item .tl-quote { grid-column: 2 !important; grid-row: 2; padding: 0 !important; text-align: left !important; }
  .tl-media img { max-width: 100%; margin: 0 !important; }
  .details-grid { grid-template-columns: 1fr; }
  .details-grid .detail-card:last-child { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .guest-row { grid-template-columns: 1fr; }
  .agenda li { grid-template-columns: 78px 1fr; gap: 14px; }
  .agenda time { font-size: 1.25rem; }
  .story-photo figcaption { right: -6px; }
  .gallery-grid { columns: 2 140px; column-gap: 10px; }
  .g-item { margin-bottom: 10px; }
  .cd-label { letter-spacing: .14em; font-size: .62rem; }
  .form-actions .btn { width: 100%; }
  .lb-prev, .lb-next { top: auto; bottom: -64px; transform: none; }
  .lb-stage { margin-bottom: 64px; }
  .lb-prev { left: calc(50% - 60px); } .lb-next { right: calc(50% - 60px); }
}
@media (max-width: 520px) {
  .hero-date { flex-direction: column; gap: 6px; }
  .hero-date .dot { display: none; }
}
@media (max-width: 400px) {
  .hero-actions .btn { width: 100%; }
  .choice-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
  .reveal, .hero-reveal > * { opacity: 1 !important; transform: none !important; }
}

@media print {
  .nav, .back-link, .scroll-cue, .lightbox, .hero-actions { display: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* small fixes */
.monogram { position: relative; z-index: 2; }
.rsvp-done:focus { outline: none; }
.tl-quote { grid-row: 1; margin: 0; }
@media (min-width: 901px) { .agenda { position: sticky; top: calc(var(--nav-h) + 30px); } }

/* "All projects" link: on phones it moves into the page footer (see app.js) so it never covers content;
   without JS it falls back to a small round button */
@media (max-width: 640px) {
  .back-link { width: 40px; height: 40px; min-height: 0; padding: 0 !important; display: inline-grid; place-items: center; overflow: hidden; font-size: 0 !important; letter-spacing: 0; }
  .back-link::before { content: "\2190"; font-size: 1.1rem; line-height: 1; }
}
.back-foot { display: flex; justify-content: center; width: 100%; flex-basis: 100%; grid-column: 1 / -1; padding: 16px 16px 24px; }
.back-link.in-footer { position: static; inset: auto; width: auto; height: auto; min-height: 42px; padding: 0 18px !important; display: inline-flex; align-items: center; font-size: .82rem !important; letter-spacing: .02em; opacity: 1; transform: none; box-shadow: none; }
.back-link.in-footer::before { content: none; }
