/* ---------- fonts (self-hosted) ---------- */
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/bodoni-moda/bodoni-moda-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/bodoni-moda/bodoni-moda-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Bodoni Moda"; font-style: italic; font-weight: 500; font-display: swap; src: url(/fonts/bodoni-moda/bodoni-moda-latin-500-italic.woff2) format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300; font-display: swap; src: url(/fonts/jost/jost-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/jost/jost-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/jost/jost-latin-500-normal.woff2) format("woff2"); }

/* ---------- tokens ---------- */
:root {
  --bg: #0e0a0d;
  --bg-2: #160f15;
  --surface: #1d141c;
  --ink: #f4ede4;
  --ink-soft: #d8ccc4;
  --muted: #a99a99;
  --gold: #d4b27c;
  --gold-deep: #b8925a;
  --plum: #6e2f63;
  --plum-glow: #9b4a8a;
  --wine: #4a0f1f;
  --line: rgba(244, 237, 228, 0.14);
  --line-strong: rgba(244, 237, 228, 0.28);
  --danger: #f0a3a3;

  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --radius: 2px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 17px/1.65 var(--sans);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--plum); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- type ---------- */
.eyebrow {
  margin: 0 0 14px;
  font: 500 12px/1.2 var(--sans);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
.display {
  margin: 0 0 24px;
  font: italic 400 clamp(34px, 5vw, 58px)/1.08 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.display em { font-style: normal; color: var(--gold); }
.display-xl { font-size: clamp(42px, 7vw, 88px); }
.prose p { margin: 0 0 1em; color: var(--ink-soft); max-width: 52ch; }
.prose-lead { font-size: 19px; color: var(--ink-soft); max-width: 46ch; margin: 0 0 32px; }
.text-link {
  display: inline-block; background: none; border: 0; padding: 0; cursor: pointer;
  font: 500 12px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  color: var(--gold); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 4px;
  transition: color .2s;
}
.text-link:hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 30px;
  border: 1px solid var(--gold); border-radius: var(--radius);
  background: var(--gold); color: #1a1014;
  font: 500 13px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s, transform .25s var(--ease);
}
.btn:hover { background: var(--ink); border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-small { min-height: 40px; padding: 0 20px; font-size: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--gutter);
  padding-top: max(18px, env(safe-area-inset-top));
  transition: background .35s var(--ease), padding .35s var(--ease), border-color .35s;
  border-bottom: 1px solid transparent;
}
.nav.is-solid { background: rgba(14, 10, 13, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--line); padding-block: 12px; }
.nav-mark { font: italic 400 26px/1 var(--serif); text-decoration: none; letter-spacing: .02em; }
.nav-links { display: flex; gap: clamp(18px, 2.6vw, 36px); list-style: none; margin: 0; padding: 0; }
.nav-links a { font: 400 12px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; text-decoration: none; color: var(--ink-soft); transition: color .2s; }
.nav-links a:hover { color: var(--gold); }
@media (max-width: 820px) { .nav-links { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; place-items: end center; overflow: hidden; isolation: isolate; }
.hero-media, .hero-media picture, .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-img { object-fit: cover; object-position: 50% 40%; animation: heroIn 2.4s var(--ease) both; }
@keyframes heroIn { from { transform: scale(1.08); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.hero-shade {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(14,10,13,.55) 0%, rgba(14,10,13,0) 28%),
    linear-gradient(0deg, rgba(14,10,13,.96) 4%, rgba(14,10,13,.55) 38%, rgba(14,10,13,0) 70%);
}
.hero-content { position: relative; z-index: 2; text-align: center; padding: 0 var(--gutter) clamp(64px, 9vh, 110px); max-width: 1100px; }
.hero-names {
  margin: 0 0 18px;
  font: italic 400 clamp(52px, 8vw, 112px)/.95 var(--serif);
  letter-spacing: -0.02em;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: .22em;
  text-shadow: 0 2px 40px rgba(0,0,0,.35);
}
.amp { color: var(--gold); font-style: italic; font-family: var(--serif); }
.hero-names .amp { font-size: .62em; }
@media (min-width: 700px) { .hero-names { flex-wrap: nowrap; white-space: nowrap; } }
.hero-date { margin: 0 0 22px; font: 400 14px/1.4 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--ink-soft); }
.hero-date .dot { margin: 0 .8em; color: var(--gold); }
@media (max-width: 520px) { .hero-date { letter-spacing: .18em; font-size: 12px; } }
.countdown { display: flex; justify-content: center; gap: clamp(22px, 4vw, 40px); margin: 0 0 30px; }
.countdown div { display: grid; justify-items: center; gap: 4px; }
.countdown span { font: italic 400 clamp(26px, 3vw, 32px)/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.countdown .cd-seats { position: relative; padding-left: clamp(22px, 4vw, 40px); }
.countdown .cd-seats::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px; background: var(--line-strong); }
.countdown .cd-seats span { color: var(--gold); }
.form-note { margin: 10px 0 0; font-size: 14px; color: var(--gold); }
.countdown small { font: 400 10px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.scroll-cue { position: absolute; z-index: 2; bottom: 22px; left: 50%; width: 1px; height: 44px; overflow: hidden; translate: -50% 0; }
.scroll-cue span { position: absolute; inset: 0; background: linear-gradient(var(--gold), transparent); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

/* ---------- sections ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(80px, 12vw, 150px) var(--gutter); }
.section-head { text-align: center; margin-bottom: clamp(40px, 6vw, 72px); }

/* story */
.story { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(36px, 7vw, 110px); align-items: center; }
.story-photo { position: relative; }
.story-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; }
.story-photo::after { content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 1px solid var(--gold); opacity: .45; z-index: -1; }
.signature { margin: 28px 0 0; font: italic 400 24px/1 var(--serif); color: var(--gold); }
@media (max-width: 860px) {
  .story { grid-template-columns: 1fr; }
  .story-photo { max-width: 460px; margin-right: 18px; }
}

/* bands with background photos */
.details, .rsvp-band { position: relative; isolation: isolate; overflow: hidden; }
.band-media, .band-media .band-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.band-media { z-index: -2; }
.band-img { object-fit: cover; }
.band-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--bg) 0%, rgba(14,10,13,.7) 24%, rgba(14,10,13,.7) 76%, var(--bg) 100%); }
.band-shade-strong { background: radial-gradient(ellipse at center, rgba(40,14,34,.72) 0%, rgba(14,10,13,.92) 70%), linear-gradient(180deg, var(--bg), transparent 20%, transparent 80%, var(--bg)); }

/* details */
.details .band-img { object-position: 50% 70%; filter: saturate(.85); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.detail-card { background: rgba(22, 15, 21, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: clamp(28px, 4vw, 48px); text-align: center; display: flex; flex-direction: column; align-items: center; }
.detail-time { margin: 0 0 6px; font: italic 400 38px/1.1 var(--serif); }
.detail-venue { margin: 0 0 8px; font: 400 15px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.detail-address { margin: 0 0 22px; color: var(--muted); max-width: 30ch; flex: 1; }
.detail-note { margin: -10px 0 22px; color: var(--gold); font-size: 15px; max-width: 30ch; }

/* gallery */
.g-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; gap: 14px; }
.g-item { margin: 0; overflow: hidden; aspect-ratio: 4 / 5; }
.g-item.is-wide { grid-column: span 2; aspect-ratio: 8 / 5; }
.g-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; position: relative; }
.g-open img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: transform .9s var(--ease), filter .5s; filter: brightness(.92); }
.g-open:hover img { transform: scale(1.035); filter: brightness(1.02); }
.g-item.is-extra { display: none; }
.g-grid.show-all .g-item.is-extra { display: block; }
.g-more { text-align: center; margin-top: 40px; }
@media (min-width: 641px) { .g-item.fill-last { grid-column: span 2; aspect-ratio: 8 / 5; } .g-item.fill-last img { object-position: 50% 45%; } }
@media (max-width: 640px) { .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* rsvp band */
.rsvp-band { min-height: 80vh; display: grid; place-items: center; text-align: center; padding: clamp(100px, 14vw, 180px) var(--gutter); }
.rsvp-band .band-img { filter: grayscale(1) contrast(1.1); object-position: 50% 35%; }
.rsvp-inner { max-width: 720px; }
.rsvp-intro { color: var(--ink-soft); max-width: 50ch; margin: 0 auto 10px; }
.rsvp-deadline { font: 500 12px/1.4 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin: 0 0 36px; }
.rsvp-closed { color: var(--ink-soft); font-style: italic; }

/* registry */
.registry { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(36px, 7vw, 110px); align-items: center; }
.registry-photo img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
@media (max-width: 860px) { .registry { grid-template-columns: 1fr; } .registry-photo { order: -1; } }

/* faq */
.faq { padding-top: 0; }
.faq-list { max-width: 760px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 24px 40px 24px 0; position: relative;
  font: italic 400 22px/1.3 var(--serif);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 4px; top: 50%; translate: 0 -50%; font: 300 26px/1 var(--sans); color: var(--gold); transition: rotate .3s var(--ease); }
.faq-item[open] summary::after { rotate: 45deg; }
.faq-item p { margin: 0 0 24px; color: var(--ink-soft); max-width: 62ch; }

/* footer */
.footer { text-align: center; padding: 90px var(--gutter) max(60px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg-2); }
.footer-names { margin: 0 0 8px; font: italic 400 clamp(36px, 6vw, 56px)/1 var(--serif); }
.footer-date { margin: 0 0 8px; letter-spacing: .4em; color: var(--muted); font-size: 13px; }
.hashtag { margin: 0 0 8px; color: var(--gold); letter-spacing: .1em; }
.footer .btn { margin-top: 26px; }

/* ---------- reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
/* Hero animates with pure CSS so it never waits on JavaScript. */
.hero .reveal, .js .hero .reveal { opacity: 1; transform: none; transition: none; animation: fadeUp 1.2s var(--ease) both; }
.hero .reveal:nth-child(1) { animation-delay: .5s; }
.hero .reveal:nth-child(2) { animation-delay: .65s; }
.hero .reveal:nth-child(3) { animation-delay: .85s; }
.hero .reveal:nth-child(4) { animation-delay: 1s; }
.hero .reveal:nth-child(5) { animation-delay: 1.15s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- RSVP modal ---------- */
.modal {
  width: min(620px, 100vw - 24px); max-height: calc(100dvh - 24px);
  padding: 0; border: 1px solid var(--line-strong); border-radius: 4px;
  background: var(--bg-2); color: var(--ink);
  box-shadow: 0 40px 120px rgba(0,0,0,.6);
  overscroll-behavior: contain;
}
.modal::backdrop { background: rgba(8, 4, 8, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal[open] { animation: modalIn .45s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.rsvp-form { position: relative; padding: clamp(28px, 5vw, 48px); }
.rsvp-form .display { font-size: clamp(30px, 5vw, 42px); margin-bottom: 4px; }
.form-sub { color: var(--muted); margin: 0 0 28px; }
.modal-close { position: absolute; top: 10px; right: 12px; width: 44px; height: 44px; border: 0; background: none; font-size: 30px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-close:hover { color: var(--ink); }

.field { margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.field label, .field legend, .field .label {
  display: block; margin: 0 0 8px; padding: 0;
  font: 500 11px/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft);
}
.opt { color: var(--muted); letter-spacing: .1em; text-transform: none; font-weight: 300; font-size: 12px; margin-left: 4px; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: rgba(244, 237, 228, .04); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font: 400 16px/1.4 var(--sans);
  transition: border-color .2s, background .2s;
}
textarea { resize: vertical; min-height: 90px; }
input::placeholder { color: rgba(244,237,228,.35); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); background: rgba(244, 237, 228, .07); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
select option { background: var(--bg-2); }
.field.has-error input, .field.has-error select, .field.has-error .choice-pill span { border-color: var(--danger); }
.field-msg { margin: 6px 0 0; font-size: 14px; color: var(--danger); }

.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .choice-row { grid-template-columns: 1fr; } }
.choice-pill { position: relative; cursor: pointer; margin: 0 !important; }
.choice-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.choice-pill span {
  display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font: italic 400 19px/1.2 var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink);
  transition: all .2s var(--ease); text-align: center;
}
.choice-pill:hover span { border-color: var(--gold); }
.choice-pill input:checked + span { background: var(--gold); border-color: var(--gold); color: #1a1014; }
.choice-pill input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }

.guests-head { display: flex; justify-content: space-between; align-items: baseline; }
.guests-count { font-size: 13px; color: var(--muted); }
.guest-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; counter-reset: g; }
.guest-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; counter-increment: g; }
.guest-row.with-meal { grid-template-columns: 26px 1fr 1fr auto; }
@media (max-width: 520px) { .guest-row.with-meal { grid-template-columns: 26px 1fr auto; } .guest-row.with-meal select { grid-column: 2 / 3; } }
.guest-row::before { content: counter(g); font: italic 400 20px/1 var(--serif); color: var(--gold); text-align: center; }
.guest-remove { width: 40px; height: 40px; border: 1px solid var(--line); background: none; border-radius: 50%; cursor: pointer; color: var(--muted); font-size: 18px; }
.guest-remove:hover { color: var(--ink); border-color: var(--line-strong); }
.guest-remove[disabled] { visibility: hidden; }
.add-guest { margin-left: 36px; }

.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-error { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--danger); color: var(--danger); font-size: 15px; border-radius: var(--radius); }

.done-view { text-align: center; padding: 20px 0 6px; }
.done-view .display { font-size: clamp(30px, 5vw, 40px); margin-bottom: 12px; }
.done-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }

/* ---------- lightbox ---------- */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(8, 5, 8, .97); color: var(--ink); }
.lightbox::backdrop { background: rgba(8, 5, 8, .97); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 100px); width: auto; height: auto; object-fit: contain; user-select: none; }
.lb-btn { position: absolute; width: 56px; height: 56px; border: 0; background: rgba(14,10,13,.4); border-radius: 50%; color: var(--ink); font-size: 34px; line-height: 1; cursor: pointer; transition: background .2s; }
.lb-btn:hover { background: rgba(244,237,228,.12); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; translate: 0 -50%; }
.lb-next { right: 14px; top: 50%; translate: 0 -50%; }
.lb-count { position: absolute; bottom: 14px; left: 0; right: 0; margin: 0; text-align: center; font-size: 12px; letter-spacing: .3em; color: var(--muted); }
@media (max-width: 640px) { .lb-prev, .lb-next { top: auto; bottom: 8px; translate: none; } .lightbox img { max-height: calc(100dvh - 150px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
