/* ─────────────────────────────────────────────────────────────────────────────
   Wedding invitation styles. Every colour and font comes from CSS custom
   properties generated from invite.config.js → theme (see src/js/lib/theme.js).
   Mobile first: designed for 360–430px, then widened for tablets and desktop.
   ───────────────────────────────────────────────────────────────────────────── */

/* Fallback tokens. :where() gives them zero specificity, so the theme block the
   build generates from invite.config.js always wins. */
:where(:root) {
  --c-bg: #0F1A2B; --c-surface: #16243A; --c-surface-2: #1A2940; --c-text: #F3EBDD; --c-muted: #B9B2A6;
  --c-primary: #D8B26E; --c-on-primary: #0F1A2B; --c-accent: #8FA9C9; --c-line: #3A4352; --c-line-soft: #2F3846;
  --c-glow: rgba(216, 178, 110, .4); --c-glow-0: rgba(216, 178, 110, 0); --c-shade-1: rgba(15, 26, 43, .25); --c-shade-2: rgba(15, 26, 43, .72); --c-shade-3: rgba(15, 26, 43, .94);
  --font-display: cursive; --font-heading: Georgia, serif; --font-body: Georgia, serif;
  --names-scale: 1; --display-style: normal; --display-weight: 400;
  --h-size: 1.1rem; --h-track: .1em; --body-size: 1.1rem;
  --radius: 14px; --card-radius: 22px; --map-filter: none;
  --opening-ink-before: #0F1A2B; --opening-ink-after: #D8B26E; --opening-ink-top-after: #FFFFFF;

  --gutter: max(1.25rem, env(safe-area-inset-left, 0px));
  --measure: 34rem;
  --section-pad: clamp(3.25rem, 9vw, 5.5rem);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --reveal-shift: 14px;
  --reveal-time: .7s;
}
.anim-rich { --reveal-shift: 30px; --reveal-time: 1s; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; background: var(--c-bg); }
body {
  margin: 0; min-height: 100vh; background: var(--c-bg); color: var(--c-text);
  font-family: var(--font-body); font-size: var(--body-size); line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
html.is-locked, html.is-locked body { overflow: hidden; }
img, video, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--c-primary); text-underline-offset: .2em; }
p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; border-radius: 4px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ── Layout primitives ─────────────────────────────────────────────────────── */
.section { position: relative; padding: var(--section-pad) var(--gutter); text-align: center; }
.section--tight { padding-block: clamp(2.5rem, 8vw, 3.75rem); }
.wrap { max-width: var(--measure); margin-inline: auto; display: grid; gap: 1.25rem; }
.section-title {
  margin: 0; font-family: var(--font-heading); font-weight: 400; font-size: var(--h-size);
  letter-spacing: var(--h-track); line-height: 1.3; color: var(--c-primary); text-wrap: balance;
}
.section-head { display: grid; gap: .55rem; justify-items: center; margin-bottom: .5rem; }
.orn { display: inline-flex; color: var(--c-accent); line-height: 0; }
.orn--divider svg { width: 168px; height: 22px; }
.orn--big svg { width: 210px; height: 28px; }
.wrap > .orn { justify-self: center; }
.lead { font-size: 1.06em; text-wrap: pretty; }
.muted { color: var(--c-muted); }
.sep { display: flex; justify-content: center; padding-block: .25rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.5rem; border-radius: 999px; border: 1px solid var(--c-primary);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.2; letter-spacing: .02em;
  text-decoration: none; cursor: pointer; transition: transform .2s var(--ease-out), background-color .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--c-primary); color: var(--c-on-primary); }
.btn--ghost { background: transparent; color: var(--c-primary); }
.btn--small { min-height: 40px; padding: .45rem 1rem; font-size: .92rem; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link-btn {
  background: none; border: 0; padding: .35rem 0; min-height: 40px; cursor: pointer; color: var(--c-primary);
  text-decoration: underline; text-underline-offset: .22em; font-size: .95rem; display: inline-flex; align-items: center; gap: .35rem;
}
.link-btn svg { width: 1em; height: 1em; }

/* ── Reveal on scroll ──────────────────────────────────────────────────────── */
.reveal-ready .reveal { transition: opacity var(--reveal-time) var(--ease-out), transform var(--reveal-time) var(--ease-out); }
.reveal-ready .reveal:not(.is-in) { opacity: 0; transform: translateY(var(--reveal-shift)); }

/* ── Opening screen ────────────────────────────────────────────────────────── */
.opening {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh; display: grid; place-items: center;
  padding: max(4.5rem, env(safe-area-inset-top, 0px)) var(--gutter) max(5.5rem, calc(env(safe-area-inset-bottom, 0px) + 4rem));
  text-align: center; background: radial-gradient(120% 80% at 50% 30%, var(--c-surface) 0%, var(--c-bg) 70%);
}
.opening__media, .opening__media img, .opening__media video, .opening__shade, .opening__motif, .opening__ambient {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.opening__media { z-index: -4; }
/* Photos and video fill the screen, cropped around the centre (object-fit: cover). */
.opening__media img, .opening__media video { object-fit: cover; object-position: center; }
.opening__media video { opacity: 0; transition: opacity .8s ease; background: transparent; }
.opening.video-first .opening__media video,
.opening[data-state="playing"] .opening__media video, .opening[data-state="done"].has-played .opening__media video { opacity: 1; }
.opening__shade { z-index: -3; background: linear-gradient(180deg, var(--c-shade-2) 0%, var(--c-shade-1) 38%, var(--c-shade-1) 55%, var(--c-shade-3) 100%); }
.opening.has-media .opening__shade { background: linear-gradient(180deg, var(--c-shade-2) 0%, var(--c-shade-1) 30%, var(--c-shade-2) 70%, var(--c-shade-3) 100%); }

/* Video as the opening background (no poster.jpg): before the tap the video is shown
   bright with dark text; once the text fades back in over the playing video it turns
   gold over a darker shade. Colours: theme.openingText in invite.config.js. */
.opening.video-first .opening__shade { transition: opacity .9s ease; }
.opening.video-first[data-state="gate"] .opening__shade { opacity: 0; }
.opening.video-first .opening__content { --ink: var(--opening-ink-before); --ink-top: var(--opening-ink-before); --ink-orn: var(--opening-ink-before); }
.opening.video-first.show-text .opening__content,
.opening.video-first[data-state="done"] .opening__content { --ink: var(--opening-ink-after); --ink-top: var(--opening-ink-top-after); --ink-orn: var(--c-primary); }
.opening.video-first .opening__content :is(.names, .names__joiner) { color: var(--ink); }
.opening.video-first .opening__content .orn { color: var(--ink-orn); }
.opening.video-first .opening__content :is(.greeting, .kicker) { color: var(--ink-top); }
/* No text before play: only the video shows, and tapping anywhere starts it. */
.opening.text-after-play[data-state="gate"] .opening__content { opacity: 0; visibility: hidden; }
.opening__tap { position: absolute; inset: 0; z-index: 1; display: none; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.opening.text-after-play[data-state="gate"] .opening__tap { display: block; }
.opening__tap:focus-visible { outline: 3px solid var(--c-primary); outline-offset: -6px; border-radius: 0; }
.opening.video-first[data-state="gate"] .names { text-shadow: 0 1px 14px rgba(255, 255, 255, .35); }
.opening__motif { z-index: -2; color: var(--c-accent); opacity: .55; pointer-events: none; max-width: 40rem; left: 50%; transform: translateX(-50%); }
.opening__motif svg { width: 100%; height: 100%; }
.opening.has-media .opening__motif { opacity: .35; }
.opening__ambient { z-index: -1; pointer-events: none; overflow: hidden; }

.opening__content { display: grid; gap: .9rem; justify-items: center; max-width: 30rem; transition: opacity .9s ease, transform .9s var(--ease-out); }
.opening[data-state="playing"]:not(.show-text) .opening__content { opacity: 0; transform: translateY(12px); }
.greeting { font-style: italic; font-size: 1.15em; color: var(--c-text); }
.kicker { font-family: var(--font-heading); font-size: calc(var(--h-size) * .78); letter-spacing: calc(var(--h-track) + .02em); color: var(--c-muted); text-wrap: balance; }
.names {
  margin: 0; display: grid; justify-items: center; gap: .1em;
  font-family: var(--font-display); font-style: var(--display-style); font-weight: var(--display-weight);
  font-size: calc(clamp(3.2rem, 16vw, 5.6rem) * var(--names-scale)); line-height: 1.05; color: var(--c-primary);
  text-shadow: 0 2px 18px var(--c-shade-2);
}
/* Script fonts often have an unreadable ampersand, so the joiner uses the body italic. */
.joiner { font-family: var(--font-body); font-style: italic; font-weight: 400; color: var(--c-accent); }
.names__joiner { font-size: .42em; line-height: 1.3; }
.opening__actions { display: grid; gap: .75rem; justify-items: center; min-height: 3.25rem; margin-top: .5rem; }
.opening[data-state="playing"] .opening__actions, .opening[data-state="done"] .open-btn { display: none; }
.open-btn { box-shadow: 0 0 0 0 var(--c-glow); }
.anim-rich .opening[data-state="gate"] .open-btn { animation: pulse 2.8s ease-in-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--c-glow); } 70%, 100% { box-shadow: 0 0 0 16px var(--c-glow-0); } }

.scroll-hint {
  position: absolute; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: none; flex-direction: column; align-items: center; gap: .3rem; background: none; border: 0; cursor: pointer;
  color: var(--c-muted); font-family: var(--font-heading); font-size: .78rem; letter-spacing: .14em; padding: .5rem 1rem; min-height: 48px;
}
.opening[data-state="done"] .scroll-hint { display: inline-flex; }
.scroll-hint svg { width: 18px; height: 18px; }
.anim-rich .scroll-hint svg, .anim-subtle .scroll-hint svg { animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

.skip-btn {
  position: absolute; z-index: 2; top: max(1rem, env(safe-area-inset-top, 0px)); right: var(--gutter);
  display: none; background: var(--c-shade-2); color: var(--c-text); border: 1px solid var(--c-line);
  border-radius: 999px; padding: .5rem 1.1rem; min-height: 44px; cursor: pointer; font-size: .9rem; letter-spacing: .04em;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.opening[data-state="playing"] .skip-btn { display: inline-flex; align-items: center; }

/* Entrance of the opening text */
.anim-rich .opening__content > *, .anim-subtle .opening__content > * { animation: rise var(--reveal-time) var(--ease-out) both; }
.opening__content > :nth-child(2) { animation-delay: .12s; }
.opening__content > :nth-child(3) { animation-delay: .24s; }
.opening__content > :nth-child(4) { animation-delay: .36s; }
.opening__content > :nth-child(5) { animation-delay: .48s; }
@keyframes rise { from { opacity: 0; transform: translateY(var(--reveal-shift)); } to { opacity: 1; transform: none; } }

/* Drifting motifs (rich animation) */
.drift span { position: absolute; bottom: -20px; color: var(--c-accent); opacity: 0; animation: drift var(--d) linear var(--delay) infinite; }
.drift span svg { width: 100%; height: 100%; }
@keyframes drift {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  15% { opacity: .55; }
  85% { opacity: .35; }
  100% { transform: translate(var(--dx), -105vh) rotate(var(--r)); opacity: 0; }
}

/* ── Sound button & toast ──────────────────────────────────────────────────── */
.sound-btn {
  position: fixed; z-index: 40; right: max(1rem, env(safe-area-inset-right, 0px)); bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--c-surface); color: var(--c-primary); border: 1px solid var(--c-line);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .45);
}
.sound-btn svg { width: 22px; height: 22px; }
.sound-btn.is-playing svg .wave { animation: wave 1.6s ease-in-out infinite; transform-origin: 13px 12px; }
@keyframes wave { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: max(5rem, calc(env(safe-area-inset-bottom, 0px) + 4.5rem));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100% - 2.5rem); padding: .75rem 1.1rem; border-radius: var(--radius);
  background: var(--c-primary); color: var(--c-on-primary); font-size: .95rem; line-height: 1.4; text-align: center;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .55); transition: opacity .3s, transform .3s var(--ease-out);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ── Welcome ───────────────────────────────────────────────────────────────── */
.couple-block { display: grid; gap: .35rem; justify-items: center; margin-top: .75rem; }
.couple-block__name { font-family: var(--font-heading); font-size: calc(var(--h-size) * 1.02); letter-spacing: calc(var(--h-track) * .6); color: var(--c-primary); line-height: 1.35; text-wrap: balance; }
.couple-block__family { font-style: italic; color: var(--c-muted); font-size: .98em; text-wrap: balance; }
.welcome__actions { display: flex; justify-content: center; margin-top: .75rem; }
.couple-block__joiner { font-size: 1.9rem; line-height: 1.1; margin-block: .25rem; }

/* ── Scratch card ──────────────────────────────────────────────────────────── */
.scratch { position: relative; }
.scratch__card {
  position: relative; width: min(100%, 22rem); height: 11.5rem; margin-inline: auto; overflow: hidden;
  display: grid; place-items: center; padding: 1.25rem; border-radius: var(--card-radius);
  background: radial-gradient(circle at 50% 40%, var(--c-surface-2), var(--c-surface));
  border: 1px solid var(--c-line); box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .6);
}
.scratch__message {
  font-family: var(--font-display); font-style: var(--display-style); font-weight: var(--display-weight);
  font-size: calc(clamp(2.2rem, 10vw, 3rem) * var(--names-scale)); line-height: 1.1; color: var(--c-primary); text-wrap: balance;
}
.scratch__canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity .7s ease, transform .7s var(--ease-out); }
.scratch__canvas:active { cursor: grabbing; }
.scratch.is-revealed .scratch__canvas { opacity: 0; transform: scale(1.05); pointer-events: none; }
.anim-minimal .scratch__canvas { transition: opacity .25s linear; }
.anim-minimal .scratch.is-revealed .scratch__canvas { transform: none; }
.scratch__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.scratch.is-revealed .scratch__tap { display: none; }
.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: visible; }
.fx-layer .confetti, .fx-layer .sparkle { position: absolute; display: block; }
.fx-layer .sparkle svg { width: 100%; height: 100%; }

/* ── Gallery ───────────────────────────────────────────────────────────────── */
.gallery { position: relative; }
.gallery__track {
  display: flex; margin: 0; padding: 0; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  border-radius: var(--card-radius); border: 1px solid var(--c-line); background: var(--c-surface);
  -webkit-overflow-scrolling: touch;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; margin: 0; }
.gallery__open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gallery__open picture { display: block; }
.gallery__open img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--c-surface-2); }
.gallery__dots { display: flex; justify-content: center; flex-wrap: wrap; gap: .1rem; margin-top: .25rem; }
.gallery__dot { width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; padding: 0; }
.gallery__dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-line); transition: background-color .3s, transform .3s; }
.gallery__dot[aria-current="true"]::before { background: var(--c-primary); transform: scale(1.3); }

.lightbox { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, .94); color: #fff; }
.lightbox::backdrop { background: rgba(0, 0, 0, .94); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lightbox__bar { display: flex; justify-content: space-between; align-items: center; padding: max(.75rem, env(safe-area-inset-top, 0px)) 1rem .75rem; font-size: .9rem; }
.lightbox__stage { position: relative; min-height: 0; display: grid; place-items: center; touch-action: pan-y; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lightbox__controls { display: flex; justify-content: center; gap: 1.5rem; padding: .75rem 1rem max(1rem, env(safe-area-inset-bottom, 0px)); }
.lightbox button { min-width: 48px; min-height: 48px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; display: inline-grid; place-items: center; padding: 0 1rem; }
.lightbox button svg { width: 20px; height: 20px; }

/* ── Countdown ─────────────────────────────────────────────────────────────── */
.countdown__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.countdown__unit { display: grid; gap: .1rem; padding: .85rem .25rem .75rem; border-radius: var(--radius); background: var(--c-surface); border: 1px solid var(--c-line); }
.countdown__num { font-family: var(--font-heading); font-size: clamp(1.7rem, 8vw, 2.4rem); line-height: 1.1; color: var(--c-primary); font-variant-numeric: tabular-nums; }
.countdown__label { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); }
.countdown__state { font-family: var(--font-display); font-style: var(--display-style); font-size: calc(2.6rem * var(--names-scale)); color: var(--c-primary); line-height: 1.2; }
.countdown__map { justify-self: center; }

/* ── Events ────────────────────────────────────────────────────────────────── */
.days { display: grid; gap: 2rem; text-align: left; }
.day { display: grid; gap: .85rem; }
.day__title {
  margin: 0; display: flex; align-items: center; gap: .85rem; font-family: var(--font-heading); font-weight: 400;
  font-size: .85rem; letter-spacing: .14em; color: var(--c-muted); text-align: center;
}
.day__title::before, .day__title::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }
.event {
  position: relative; display: grid; gap: .2rem; padding: 1.15rem 1.25rem 1rem; border-radius: var(--radius);
  background: var(--c-surface); border: 1px solid var(--c-line-soft);
}
.event.is-main { border-color: var(--c-primary); background: linear-gradient(160deg, var(--c-surface-2), var(--c-surface)); }
.event__title { margin: 0; font-family: var(--font-heading); font-weight: 400; font-size: calc(var(--h-size) * 1.02); letter-spacing: calc(var(--h-track) * .7); color: var(--c-primary); line-height: 1.3; display: flex; align-items: center; gap: .5rem; }
.event__title .orn svg { width: 14px; height: 14px; }
.event__time { font-weight: 500; color: var(--c-text); }
.event__local, .event__venue, .event__notes { color: var(--c-muted); font-size: .95em; }
.event__actions { display: flex; flex-wrap: wrap; gap: .1rem 1.25rem; margin-top: .3rem; }
.events__all { display: grid; gap: .5rem; justify-items: center; margin-top: 1rem; text-align: center; }
.events__all p { font-size: .88rem; color: var(--c-muted); max-width: 26rem; }

/* ── Calendar dialog ───────────────────────────────────────────────────────── */
.dialog {
  width: min(calc(100% - 2rem), 24rem); padding: 1.5rem 1.25rem 1.25rem; border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-text); text-align: center;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
}
.dialog::backdrop { background: rgba(5, 10, 18, .65); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog[open] { display: grid; gap: .9rem; }
.dialog__title { margin: 0; font-family: var(--font-heading); font-weight: 400; font-size: var(--h-size); letter-spacing: var(--h-track); color: var(--c-primary); }
.dialog__sub { color: var(--c-muted); font-size: .95rem; }
.dialog__notice { padding: .65rem .9rem; border-radius: var(--radius); background: var(--c-primary); color: var(--c-on-primary); font-size: .95rem; line-height: 1.4; }
.dialog__options { display: grid; gap: .55rem; }
.dialog__options .btn { width: 100%; }
.dialog__hint { font-size: .82rem; color: var(--c-muted); }
.dialog__close { position: absolute; top: .5rem; right: .5rem; width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; color: var(--c-muted); cursor: pointer; display: grid; place-items: center; }
.dialog__close svg { width: 18px; height: 18px; }
.dialog-fallback { position: fixed; inset: 0; margin: auto; height: max-content; z-index: 70; }

/* ── Venues map ────────────────────────────────────────────────────────────── */
.map {
  position: relative; overflow: hidden; aspect-ratio: 4 / 5; max-height: 70vh; width: 100%;
  border-radius: var(--card-radius); border: 1px solid var(--c-line); background: var(--c-surface);
}
.map__tiles { position: absolute; inset: 0; transform-origin: 0 0; filter: var(--map-filter); }
.map__tiles img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; -webkit-user-drag: none; }
.map__pins { position: absolute; inset: 0; }
.map__pin {
  position: absolute; width: 32px; height: 32px; margin: -32px 0 0 -16px; display: grid; place-items: center;
  color: var(--c-on-primary); font-family: var(--font-heading); font-size: .85rem; font-weight: 600; text-decoration: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .45));
}
.map__pin svg { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--c-primary); }
.map__pin span { position: relative; margin-top: -5px; }
.map__credit {
  position: absolute; right: 0; bottom: 0; padding: .15rem .45rem; font-size: .68rem; line-height: 1.4;
  background: var(--c-shade-2); color: var(--c-text); border-top-left-radius: 6px;
}
.map__credit a { color: inherit; }
.venue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; text-align: left; }
.venue {
  display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; align-items: start;
  padding: 1rem 1.15rem; border-radius: var(--radius); background: var(--c-surface); border: 1px solid var(--c-line-soft);
}
.venue__num {
  grid-row: span 3; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--c-primary); color: var(--c-on-primary); font-family: var(--font-heading); font-size: .9rem; margin-top: .1rem;
}
.venue__name { margin: 0; font-family: var(--font-heading); font-weight: 400; font-size: calc(var(--h-size) * .95); letter-spacing: calc(var(--h-track) * .6); color: var(--c-primary); line-height: 1.3; }
.venue__events { color: var(--c-muted); font-size: .95em; }

/* ── Info sections (dress code, gifts, transportation) ─────────────────────── */
.info { display: grid; gap: .9rem; justify-items: center; }
.info__icon { color: var(--c-accent); }
.info__icon svg { width: 30px; height: 30px; }
.info__text { max-width: 26rem; text-wrap: pretty; }

/* ── RSVP ──────────────────────────────────────────────────────────────────── */
.rsvp-form { display: grid; gap: 1.35rem; text-align: left; }
.field { display: grid; gap: .45rem; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { padding: 0; font-family: var(--font-heading); font-size: .82rem; letter-spacing: .1em; color: var(--c-primary); }
.field .optional { font-family: var(--font-body); letter-spacing: 0; color: var(--c-muted); font-size: .95em; text-transform: none; }
.input {
  width: 100%; min-height: 50px; padding: .75rem 1rem; border-radius: var(--radius); border: 1px solid var(--c-line);
  background: var(--c-surface); color: var(--c-text); font-size: 1rem; line-height: 1.4; transition: border-color .2s;
}
.input::placeholder { color: var(--c-muted); opacity: .8; }
.input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-glow); }
textarea.input { min-height: 6.5rem; resize: vertical; }
.input[aria-invalid="true"] { border-color: #E7816B; }
.choices { display: grid; gap: .55rem; }
.choices--row { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choice__box {
  display: flex; align-items: center; gap: .75rem; min-height: 50px; padding: .7rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--c-line); background: var(--c-surface); transition: border-color .2s, background-color .2s;
}
.choice__mark { flex: none; width: 20px; height: 20px; border: 1.5px solid var(--c-muted); display: grid; place-items: center; transition: background-color .2s, border-color .2s; }
.choice input[type="radio"] + .choice__box .choice__mark { border-radius: 50%; }
.choice input[type="checkbox"] + .choice__box .choice__mark { border-radius: 5px; }
.choice__mark svg { width: 12px; height: 12px; color: var(--c-on-primary); opacity: 0; }
.choice input:checked + .choice__box { border-color: var(--c-primary); background: var(--c-surface-2); }
.choice input:checked + .choice__box .choice__mark { background: var(--c-primary); border-color: var(--c-primary); }
.choice input:checked + .choice__box .choice__mark svg { opacity: 1; }
.choice input:focus-visible + .choice__box { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.choice__label { display: grid; line-height: 1.3; }
.choice__meta { font-size: .85em; color: var(--c-muted); }
.choices--row .choice__box { justify-content: center; }
.choices--row .choice__mark { display: none; }
.field-error { color: #F09A86; font-size: .9rem; }
.rsvp-honey { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.rsvp-submit { width: 100%; }
.rsvp-status { text-align: center; min-height: 1.5em; }
.rsvp-status.is-error { color: #F09A86; }
.rsvp-note { font-size: .92rem; color: var(--c-muted); text-align: center; padding: .75rem 1rem; border: 1px dashed var(--c-line); border-radius: var(--radius); }
.rsvp-done { display: grid; gap: 1rem; justify-items: center; padding: 1.75rem 1.25rem; border-radius: var(--card-radius); background: var(--c-surface); border: 1px solid var(--c-line); }
.rsvp-done p { font-size: 1.1em; text-wrap: balance; }
.rsvp-contact__phone { font-family: var(--font-heading); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.rsvp-contact__phone a { color: var(--c-text); text-decoration: none; }

/* ── Footer ────────────────────────────────────────────────────────────────── */
.footer { position: relative; overflow: hidden; isolation: isolate; background: var(--c-surface); padding-bottom: calc(var(--section-pad) + env(safe-area-inset-bottom, 0px)); }
.footer__ambient { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .45; }
.footer__kicker { font-family: var(--font-heading); font-size: .8rem; letter-spacing: .16em; color: var(--c-muted); }
.footer__names { margin: 0; font-family: var(--font-display); font-style: var(--display-style); font-weight: var(--display-weight); font-size: calc(clamp(2.3rem, 10vw, 3.4rem) * var(--names-scale)); line-height: 1.15; color: var(--c-primary); text-wrap: balance; }
.footer__names .joiner { font-size: .55em; padding-inline: .15em; }
.footer__credit { font-size: .75rem; color: var(--c-muted); }

noscript p { padding: 3rem 1.5rem; text-align: center; }

/* ── Wider screens ─────────────────────────────────────────────────────────── */
@media (min-width: 48rem) {
  :root { --measure: 36rem; }
  .gallery__open picture { display: block; }
.gallery__open img { aspect-ratio: 4 / 5; max-height: 78vh; }
  .map { aspect-ratio: 1 / 1; }
}

/* ── Reduced motion ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .drift { display: none; }
}
