/* ==========================================================================
   Golbarg & Mahdi — A Journey of Love
   ========================================================================== */
/* Palette — Soft Pink #F1B8C8 · Ivory #FAF8F2 · Sage #A0B58A · Burgundy #711F3D
   Pink + ivory dominate, sage is the natural accent, burgundy is used sparingly for contrast.
   Text tokens are tuned for WCAG AA on ivory (ink 14:1, ink-2 8:1, muted 5.4:1). */
:root {
  --bg: #FAF8F2;            /* ivory */
  --bg-2: #F5EAEA;
  --ink: #3A1C28;           /* burgundy-black */
  --ink-2: #64414E;
  --muted: #7F5D69;
  --line: rgba(113, 31, 61, .16);
  --card: rgba(255, 252, 249, .88);
  --shade: rgba(250, 248, 242, .84);
  --accent: #711F3D;        /* burgundy */
  --on-accent: #FAF8F2;
  --pink: #F1B8C8;
  --blush: #FBE9EE;         /* soft pink wash for surfaces */
  --sage: #A0B58A;
  --sage-deep: #6F8A5A;     /* sage for thin strokes on light paper */
  --frame-a: rgba(160, 181, 138, .8);
  --frame-b: rgba(241, 184, 200, .95);
  --sh: 113, 31, 61;        /* tinted shadows */
  --paper: radial-gradient(130% 100% at 50% 42%, var(--bg) 52%, var(--blush) 100%);
  --serif: 'Gilda Display', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* Spacing around the double border. Every edge element (logo, header links, menu button, gallery close, the
     bottom timeline and icons, the globe's city labels) sits exactly one --gutter inside the inner line, i.e. at --edge. */
  --frame: clamp(12px, 2.2vmin, 22px);            /* outer line inset; the inner line sits 6px further in (frame+6 .. frame+7) */
  --gutter: clamp(14px, 2.6vmin, 24px);           /* clear space between the inner line and any content */
  --edge: calc(var(--frame) + 7px + var(--gutter));
  color-scheme: light;
}
html.dark {
  --bg: #1A1014;            /* deep plum */
  --bg-2: #22161B;
  --ink: #FAF8F2;
  --ink-2: #E6D6DB;
  --muted: #B79BA6;
  --line: rgba(241, 184, 200, .18);
  --card: rgba(38, 24, 30, .9);
  --shade: rgba(26, 16, 20, .84);
  --accent: #F1B8C8;        /* pink carries the accent on dark */
  --on-accent: #3A1C28;
  --blush: #2A1820;
  --sage-deep: #A0B58A;
  --frame-a: rgba(160, 181, 138, .42);
  --frame-b: rgba(241, 184, 200, .28);
  --sh: 0, 0, 0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-weight: 400; letter-spacing: .01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: background-color .6s var(--ease), color .6s var(--ease);
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--pink); color: #3A1C28; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; }

.ms {
  font-family: 'Material Symbols Outlined'; font-weight: 300; font-style: normal; font-size: 1.25rem; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr;
  font-feature-settings: 'liga'; -webkit-font-feature-settings: 'liga'; font-variation-settings: 'FILL' 0, 'wght' 300, 'opsz' 24;
  user-select: none;
}
.ms.fill { font-variation-settings: 'FILL' 1, 'wght' 300, 'opsz' 24; }

/* ---------- Monogram ---------- */
.monogram { position: relative; width: 170px; height: 170px; color: var(--ink); }
.monogram.small { width: 120px; height: 120px; }
.mono-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mono-arc-text { font-family: var(--sans); font-size: 8.4px; letter-spacing: .32em; fill: currentColor; opacity: .7; }
.mono-ring .mono-arc-text, .mono-ring textPath { animation: none; }
#gate .mono-ring { animation: spin 60s linear infinite; }
.mono-letters { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 52px; line-height: 1; }
.monogram.small .mono-letters { font-size: 36px; }
.mono-letters span:first-child { transform: translate(6px, -8px); }
.mono-letters span:last-child { transform: translate(-6px, 10px); font-style: italic; }
.mono-letters .amp { font-size: .5em; transform: translateY(2px); opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Gate: a full-screen sealed envelope; the password goes on the wax seal ---------- */
:root { --env-paper: #F3C5D0; --env-flap: #F1B8C8; --env-line: rgba(113, 31, 61, .14); --env-liner: #A0B58A; --env-liner-line: rgba(250, 248, 242, .26); --env-ink: #711F3D; --env-muted: #7A3550; --env-error: #9A1E3E; --wax-hi: #9A3D60; --wax-lo: #4A1428; --wax-ink: #FAF8F2; --wax-shadow: rgba(74, 20, 40, .38); }
html.dark { --env-paper: #2E1C24; --env-flap: #3A2230; --env-line: rgba(241, 184, 200, .13); --env-liner: #2F3A28; --env-liner-line: rgba(160, 181, 138, .22); --env-ink: #F1B8C8; --env-muted: #D7B6C1; --env-error: #FFC2D1; --wax-hi: #F6CAD6; --wax-lo: #D48FA5; --wax-ink: #4E1229; --wax-shadow: rgba(0, 0, 0, .45); }
#gate { --seal: clamp(190px, min(34vmin, 44vh), 260px); position: fixed; inset: 0; z-index: 60; overflow: hidden; background: var(--bg); transition: opacity .7s var(--ease), visibility .7s; }
body:not(.state-gate) #gate { opacity: 0; visibility: hidden; pointer-events: none; }
html body.gate-hold #gate { opacity: 1; visibility: visible; pointer-events: none; }   /* envelope stays up while the site loads underneath */
.envelope { position: absolute; inset: 0; perspective: 2400px; transform-origin: 50% 50%; transition: transform 1.05s var(--ease-io) .3s, box-shadow 1.05s var(--ease-io) .3s; }
.env-back { position: absolute; inset: 0; background: repeating-linear-gradient(45deg, var(--env-liner-line) 0 1px, transparent 1px 12px), var(--env-liner); }   /* sage liner */
.env-pocket, .env-flap { position: absolute; left: 0; top: 0; width: 100%; overflow: visible; }
.env-pocket { height: 100%; z-index: 3; }
.env-pocket .paper { fill: var(--env-paper); }
.env-pocket .fold { fill: none; stroke: var(--env-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.env-flap { height: 56%; z-index: 4; transform-origin: 50% 0; filter: drop-shadow(0 6px 14px rgba(var(--sh), .14)); transition: transform 1s var(--ease-io) .75s, z-index 0s 1.25s; }
.env-flap .paper { fill: var(--env-flap); stroke: var(--env-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.env-flap-text { position: absolute; z-index: 5; left: 0; right: 0; top: 15%; text-align: center; pointer-events: none; animation: rise 1.1s var(--ease) both; transition: opacity .45s var(--ease); }
.env-flap-text { color: var(--env-ink); }
.env-flap-text .eyebrow { font-size: .6rem; letter-spacing: .44em; text-transform: uppercase; color: var(--env-ink); padding-left: .44em; }
.gate-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.1rem, 5.4vw, 3.4rem); margin: 12px 0 6px; letter-spacing: .01em; }
.env-seal { position: absolute; left: 50%; top: 56%; z-index: 5; width: var(--seal); aspect-ratio: 1; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--wax-ink); transition: transform .35s var(--ease); }
.seal-wax { position: absolute; inset: -5%; width: 110%; height: 110%; filter: drop-shadow(0 6px 12px var(--wax-shadow)); }
.seal-wax .wax-hi { stop-color: var(--wax-hi); } .seal-wax .wax-lo { stop-color: var(--wax-lo); }
.seal-wax .wax-ring { stroke: var(--wax-ink); stroke-width: 1; opacity: .32; }
.seal-mono { position: relative; font-family: var(--serif); font-size: calc(var(--seal) * .085); letter-spacing: .14em; opacity: .85; margin-bottom: 4px; }
.seal-mono span { font-size: .7em; opacity: .7; }
#gate-input { position: relative; width: 62%; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--wax-ink) 45%, transparent); background: transparent; outline: none; padding: 9px 2px 8px; font-size: 1.15rem; letter-spacing: .12em; text-align: center; color: var(--wax-ink); border-radius: 0; caret-color: var(--wax-ink); }
#gate-input::placeholder { color: var(--wax-ink); opacity: .72; letter-spacing: .32em; text-transform: uppercase; font-size: .72rem; }
#gate-input:focus { border-bottom-color: var(--wax-ink); }
#gate-input::selection { background: color-mix(in srgb, var(--wax-ink) 28%, transparent); color: var(--wax-ink); }
.seal-actions { position: relative; display: flex; gap: 10px; margin-top: 8px; }
.seal-actions button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--wax-ink); opacity: .8; transition: opacity .25s, transform .25s var(--ease), background .25s; }
.seal-actions button:hover { opacity: 1; background: color-mix(in srgb, var(--wax-ink) 12%, transparent); }
.seal-actions .ms { font-size: 1.25rem; }
#gate-submit:hover { transform: translateX(2px); }
#gate-submit[disabled] { opacity: .35; pointer-events: none; }
.env-seal :focus-visible { outline: 1.5px solid var(--wax-ink); outline-offset: 2px; }
.env-seal:hover { transform: translate(-50%, -50%) scale(1.02); }
.env-seal::before { content: ''; position: absolute; inset: -3%; border-radius: 50%; border: 1px solid var(--wax-lo); opacity: 0; pointer-events: none; animation: sealCall 3.4s ease-out 1.4s infinite; }
html.dark .env-seal::before { border-color: var(--wax-hi); }
.env-seal:has(#gate-input:not(:placeholder-shown))::before, #gate.opening .env-seal::before { animation: none; }
@keyframes sealCall { 0% { transform: scale(.98); opacity: .4; } 100% { transform: scale(1.32); opacity: 0; } }
.env-below { position: absolute; z-index: 5; left: 0; right: 0; top: calc(56% + var(--seal) / 2 + 22px); display: flex; flex-direction: column; align-items: center; padding: 0 20px; text-align: center; transition: opacity .45s var(--ease); }
.gate-hint { color: var(--env-muted); font-size: .8rem; line-height: 1.7; margin: 0; letter-spacing: .03em; }
.gate-remember { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: .72rem; color: var(--env-muted); letter-spacing: .06em; cursor: pointer; }
.gate-remember input { accent-color: var(--env-ink); width: 14px; height: 14px; }
.gate-error { min-height: 1.4em; margin: 12px 0 0; font-size: .76rem; color: var(--env-error); letter-spacing: .02em; font-weight: 500; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#gate.checking .seal-wax { animation: sealPulse 1s ease-in-out infinite; }
@keyframes sealPulse { 50% { transform: scale(.97); } }
#gate.shake .env-seal { animation: sealShake .45s var(--ease); }
@keyframes sealShake { 20%, 60% { transform: translate(calc(-50% - 8px), -50%); } 40%, 80% { transform: translate(calc(-50% + 8px), -50%); } }
/* the letter tucked inside is a copy of the homepage card */
.env-letter { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: var(--paper); background-color: var(--bg); color: var(--ink); transform: translateY(6%) scale(.9); transform-origin: 50% 50%; box-shadow: 0 2px 6px rgba(var(--sh), .08), 0 30px 60px rgba(var(--sh), .12); transition: transform 1.15s var(--ease-io) 1.5s; }
.env-letter-page { position: absolute; inset: 0; display: grid; place-items: center; }   /* the homepage copy on the card */
.env-letter :is(.title-part, .intro-eyebrow, .intro-rule, .intro-date) { opacity: 1; transform: none; }
.env-letter .action-btn { opacity: 1; transform: translate(-50%, 0); }
/* the right password: seal lifts away, the envelope steps back, the flap opens, the card slides out ... */
#gate.opening .env-seal { animation: sealOff .6s var(--ease-io) forwards; pointer-events: none; }
@keyframes sealOff { 30% { transform: translate(-50%, -50%) scale(1.07); opacity: 1; } 100% { transform: translate(-50%, -30%) scale(.86) rotate(-12deg); opacity: 0; } }
#gate.opening :is(.env-flap-text, .env-below) { opacity: 0; animation: none; }
#gate.opening .envelope { transform: translateY(17%) scale(.58); box-shadow: 0 40px 90px rgba(var(--sh), .2); }
#gate.opening .env-flap { transform: rotateX(180deg); z-index: 1; }
#gate.opening .env-letter { transform: translateY(-56%) scale(.9); }
/* ... and grows to fill the screen while the envelope falls away */
#gate.expanding .envelope { transform: none; box-shadow: none; transition: transform 1.1s var(--ease-io), box-shadow .5s; }
#gate.expanding .env-letter { transform: none; box-shadow: none; transition: transform 1.1s var(--ease-io), box-shadow .8s; }
#gate.expanding :is(.env-pocket, .env-flap, .env-back) { opacity: 0; transition: opacity .55s var(--ease); }

/* ---------- Preloader ---------- */
#preloader { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: var(--bg); opacity: 0; visibility: hidden; transition: opacity .8s var(--ease), visibility .8s; }
body.state-loading #preloader { opacity: 1; visibility: visible; transition-delay: .5s; }
.pl-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
#pl-arc { stroke: var(--accent); transition: stroke-dashoffset .35s var(--ease); }
#pl-pct { font-family: var(--serif); font-size: 1.15rem; min-width: 4ch; text-align: center; font-variant-numeric: tabular-nums; }
#pl-skip { font-size: .62rem; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 9px 16px; opacity: 0; transition: opacity .6s, color .3s, border-color .3s; }
#pl-skip.show { opacity: 1; }
#pl-skip:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- App shell & screens ---------- */
#app { position: fixed; inset: 0; }
#app::before { /* soft studio backdrop behind the globe */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 48%, rgba(241,184,200,.34) 0%, rgba(251,233,238,.22) 42%, rgba(241,184,200,0) 72%);
  opacity: .9; transition: opacity .6s;
}
html.dark #app::before { background: radial-gradient(60% 55% at 50% 48%, rgba(241,184,200,.08) 0%, rgba(241,184,200,0) 70%); }
.screen { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .9s var(--ease), visibility .9s; }

#globe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; opacity: 0; transition: opacity 1s var(--ease); }
body.state-journey #globe, body.state-transition #globe { opacity: 1; }
body.state-story #globe { opacity: .25; }
#label-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .8s; overflow: visible; }
#label-lines line { stroke: var(--ink); stroke-width: .7; }
#label-lines line.next { stroke-dasharray: 3 3; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -12; } }
#label-layer { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .8s; }
body.state-journey #label-lines, body.state-journey #label-layer { opacity: 1; }
body.state-journey #label-layer { pointer-events: none; }
body.state-journey .city-label { pointer-events: auto; }
#label-layer.compact, #label-lines.compact { display: none; }
.city-label {
  position: absolute; left: 0; top: 0; will-change: transform; white-space: nowrap;
  font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 500; color: var(--ink-2);
  background: var(--card); border: 1px solid var(--line); padding: 7px 13px;
  transition: color .3s, background-color .3s, border-color .3s, box-shadow .3s;
}
.city-label.left { border-right: 3px solid var(--pink); }
.city-label.right { border-left: 3px solid var(--pink); }
.city-label.hover, .city-label:hover, .city-label:focus-visible { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.city-label.visited .cl-name::after { content: ' ·'; opacity: .5; }
.city-label.next { box-shadow: 0 0 0 4px rgba(241,184,200,.55); animation: blink 1.4s var(--ease-io) infinite; }
@keyframes blink { 50% { box-shadow: 0 0 0 8px rgba(241,184,200,0); } }

/* Header (journey & wedding): logo on the left, links on the right */
#persistent-header {
  --hdr-h: 84px;
  position: absolute; top: 0; left: 0; right: 0; z-index: 12; min-height: var(--hdr-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: max(var(--edge), env(safe-area-inset-top)) var(--edge) 14px;
  background: linear-gradient(var(--bg) 58%, color-mix(in srgb, var(--bg) 0%, transparent));
  transform: translateY(-10px); opacity: 0; visibility: hidden; transition: opacity .8s var(--ease), transform .8s var(--ease), visibility .8s;
}
body.state-journey #persistent-header, body.state-wedding #persistent-header, body.state-transition #persistent-header { opacity: 1; visibility: visible; transform: none; }
.hdr-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2.3vw, 34px); }
.site-link { position: relative; padding: 8px 0; font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); white-space: nowrap; transition: color .3s; }
.site-link::after { content: ''; position: absolute; left: 0; right: .24em; bottom: 0; height: 1px; background: var(--accent); transform: scaleX(0); transition: transform .45s var(--ease); }
.site-link:hover, .site-link.active { color: var(--ink); }
.site-link.active::after { transform: scaleX(1); }
@media (min-width: 821px) { .site-link:last-child { margin-right: -.24em; } }   /* trailing letter-spacing: the last letter lands on --edge */
.menu-btn { display: none; width: 44px; height: 44px; margin-block: -6px; margin-inline-end: -11px;   /* the lines' edge lands on --edge */
  place-items: center; color: var(--ink); border-radius: 50%; transition: background .3s; }
@media (hover: hover) { .menu-btn:hover { background: color-mix(in srgb, var(--pink) 30%, transparent); } }
.mb-lines { position: relative; width: 22px; height: 9px; }   /* two hairlines that cross into an × */
.mb-lines i { position: absolute; right: 0; top: 0; width: 100%; height: 1.3px; background: currentColor; transition: transform .4s var(--ease), top .4s var(--ease), width .4s var(--ease); }
.mb-lines i + i { top: 8px; width: 64%; }
.menu-open .mb-lines i { top: 4px; width: 100%; transform: rotate(45deg); }
.menu-open .mb-lines i + i { transform: rotate(-45deg); }
.header-logo { display: grid; grid-template-columns: auto auto; font-family: var(--serif); font-size: 1.45rem; line-height: .85; text-align: left; color: var(--accent); }
.header-logo .hl-a { grid-column: 1; }
.header-logo { grid-template-columns: max-content 1fr; }
.header-logo .hl-and { grid-column: 2; justify-self: start; font-size: .6em; align-self: end; margin-left: .18em; color: var(--sage-deep); }
.header-logo .hl-b { grid-column: 1 / span 2; padding-left: 1.1em; font-style: italic; }
.header-sub { font-size: .8rem; color: var(--ink-2); padding-left: 14px; border-left: 1px solid var(--line); letter-spacing: .06em; white-space: nowrap; }

/* ---------- Intro: the invitation card that came out of the envelope ---------- */
#intro { z-index: 5; display: grid; place-items: center; background: var(--paper); background-color: var(--bg); color: var(--ink); }
body.state-intro #intro { opacity: 1; visibility: visible; }
#site-frame { z-index: 25; }   /* above the pages, header and bottom bar; below the story, gallery and photo viewer */
.card-frame { position: absolute; inset: var(--frame); border: 1px solid var(--frame-a); pointer-events: none; }
.card-frame::after { content: ''; position: absolute; inset: 5px; border: 1px solid var(--frame-b); }
.intro-card { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: -8vh; }
.intro-eyebrow { font-size: .62rem; letter-spacing: .44em; text-transform: uppercase; color: var(--muted); padding-left: .44em; margin-bottom: clamp(18px, 3.4vh, 30px); }
.intro-rule { display: flex; align-items: center; gap: 14px; color: var(--accent); margin: clamp(22px, 4vh, 34px) 0 clamp(12px, 2.2vh, 18px); }
.intro-rule i { width: clamp(40px, 8vw, 72px); height: 1px; background: var(--sage); }
.intro-rule svg { width: 13px; height: 12px; display: block; }
.intro-rule svg path, .event-heart svg path { fill: var(--pink); }
.intro-date { font-size: .66rem; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-2); padding-left: .32em; }
.intro-eyebrow, .intro-rule, .intro-date { opacity: 0; transform: translateY(10px); }
#intro.titles :is(.intro-eyebrow, .intro-rule, .intro-date) { opacity: 1; transform: none; transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
#intro.titles .intro-rule { transition-delay: .6s; } #intro.titles .intro-date { transition-delay: .75s; }
#intro.instant, #intro.instant * { transition: none !important; }
.intro-subtitle { position: absolute; left: 0; right: 0; top: 58%; transform: translateY(-50%); text-align: center; z-index: 2; pointer-events: none; }
.sub-line { font-size: clamp(1rem, 2.6vw, 1.25rem); letter-spacing: .3em; text-transform: uppercase; text-align: center; padding: 0 24px 0 calc(24px + .3em); opacity: 0; position: absolute; left: 0; right: 0; color: var(--ink-2); }
.title-layout {
  position: relative; z-index: 2; display: grid; grid-template-columns: max-content 1fr; align-items: end;
  font-family: var(--serif); line-height: .82; user-select: none;
}
.title-part {
  font-size: clamp(4.2rem, 11vw, 7.2rem); opacity: 0; transform: translateY(24px);
  color: var(--accent);
}
.t-a { grid-column: 1; }
.t-and { color: var(--sage-deep); grid-column: 2; justify-self: start; font-size: clamp(2.6rem, 6vw, 4rem); padding-left: .12em; align-self: end; transform-origin: left; }
.t-b { grid-column: 1 / span 2; padding-left: 1.5em; font-style: italic; }
#intro.titles .title-part { opacity: 1; transform: none; transition: opacity 1.4s var(--ease), transform 1.4s var(--ease); }
#intro.titles .t-and { transition-delay: .25s; }
#intro.titles .t-b { transition-delay: .45s; }
.action-btn {
  position: absolute; z-index: 3; left: 50%; bottom: calc(var(--edge) + 146px + var(--safe-b)); transform: translate(-50%, 10px);
  padding: 13px 26px; border: 1px solid var(--accent); color: var(--accent); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
  opacity: 0; pointer-events: none; transition: opacity .9s var(--ease), transform .9s var(--ease), background .35s, color .35s;
}
#intro.titles .action-btn { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; transition-delay: .9s, .9s, 0s, 0s; }
.action-btn:hover { background: var(--accent); color: var(--on-accent); }

/* ---------- Transition lines ("And now…") ---------- */
.trans-line { font-family: var(--serif); font-size: clamp(1.4rem, 3.4vw, 2rem); color: var(--ink-2); opacity: 0; transform: translateY(10px); transition: opacity 1s var(--ease), transform 1s var(--ease); position: absolute; left: 0; right: 0; }
.trans-line.on { opacity: 1; transform: none; }
#journey-instruction {
  position: absolute; left: 0; right: 0; bottom: calc(var(--edge) + 104px + var(--safe-b)); text-align: center; z-index: 8;
  font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-2);
  opacity: 0; transition: opacity .8s; pointer-events: none;
}
body.state-journey #journey-instruction { opacity: 1; }

/* ---------- Story modal ---------- */
#story { position: fixed; inset: 0; z-index: 30; background: #1A0E13; color: #FAF8F2; overflow: hidden; opacity: 0; transition: opacity .7s var(--ease); }
#story.open { opacity: 1; }
.story-stage { position: absolute; inset: 0; }
.story-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s var(--ease); overflow: hidden; }
.story-slide.on { opacity: 1; }
.story-slide .bg { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(28px) brightness(.55) saturate(1.1); }
.story-slide .fg { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; will-change: transform; }
.story-slide.on .fg { animation: kenburns var(--dur, 4.6s) linear both; }
.story-slide:nth-child(2n).on .fg { animation-name: kenburns2; }
@keyframes kenburns { from { transform: scale(1.0) translate3d(0, 0, 0); } to { transform: scale(1.07) translate3d(-1%, -1%, 0); } }
@keyframes kenburns2 { from { transform: scale(1.07) translate3d(1%, 0, 0); } to { transform: scale(1.0) translate3d(0, 0, 0); } }
@media (min-aspect-ratio: 1/1) { .story-slide .fg { padding: 9vh 0 13vh; } }
#story-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; opacity: 0; transition: opacity .8s; }
#story.video #story-video { opacity: 1; }
.story-progress { position: absolute; z-index: 3; top: max(16px, env(safe-area-inset-top)); left: 0; right: 0; margin: 0 auto; width: min(560px, calc(100% - 40px)); display: flex; gap: 5px; }
.story-progress i { flex: 1; height: 2px; background: rgba(250,248,242,.28); border-radius: 2px; overflow: hidden; position: relative; }
.story-progress i b { position: absolute; inset: 0; background: #F1B8C8; transform: scaleX(0); transform-origin: left; }
.story-tap { position: absolute; top: 15%; bottom: 20%; width: 35%; z-index: 2; cursor: pointer; }
.story-tap.prev { left: 0; cursor: w-resize; }
.story-tap.next { right: 0; cursor: e-resize; }
.story-actions { position: absolute; z-index: 4; top: max(34px, calc(env(safe-area-inset-top) + 22px)); right: 22px; display: flex; gap: 10px; align-items: center; }
.story-btn { height: 40px; min-width: 40px; display: grid; place-items: center; border: 1px solid rgba(250,248,242,.55); color: #FAF8F2; background: rgba(26,14,19,.22); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .3s, color .3s; }
.story-btn.circle { border-radius: 50%; }
.story-btn:hover { background: #FAF8F2; color: #711F3D; }
/* The ✕ in the city stories, the globe slideshow and the photo viewer: just the icon, no circle around it */
:is(#story #story-close, #ambient #ambient-close, #lightbox #lb-close) { border: 0; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; color: #FAF8F2; }
:is(#story #story-close, #ambient #ambient-close, #lightbox #lb-close) .ms { font-size: 1.6rem; text-shadow: 0 1px 10px rgba(26,14,19,.6); }
:is(#story #story-close, #ambient #ambient-close, #lightbox #lb-close):hover { background: transparent; color: #F1B8C8; border: 0; }
/* the viewer focuses the ✕ when it opens: show focus by colour, not the round focus ring */
:is(#story #story-close, #ambient #ambient-close, #lightbox #lb-close):focus-visible { outline: none; color: #F1B8C8; }
.story-header { position: absolute; z-index: 3; left: 0; right: 0; bottom: calc(46px + var(--safe-b)); display: flex; align-items: center; justify-content: center; gap: 16px; text-shadow: 0 1px 16px rgba(26,14,19,.55); }
/* Photo subtitle, the same in every view (photo viewer, city stories, globe slideshow), filled by
   setPhotoSubtitle() in app.js: the place ("Los Angeles, CA") in normal case, and under it the month + year
   in spaced-out grey small caps. */
.photo-subtitle { display: flex; flex-direction: column; align-items: center; gap: 11px; text-align: center; color: #FAF8F2; }
.ps-place { font-size: 1.3rem; line-height: 1.25; letter-spacing: .02em; text-wrap: balance; }
.ps-date { font-size: .62rem; line-height: 1.4; letter-spacing: .38em; padding-left: .38em; text-transform: uppercase; color: #BDB3B7; }
#story .story-header, #story .story-actions, #story .story-progress { opacity: 0; transform: translateY(8px); transition: opacity .8s var(--ease) .35s, transform .8s var(--ease) .35s; }
#story.open .story-header, #story.open .story-actions, #story.open .story-progress { opacity: 1; transform: none; }

/* ---------- Ambient slideshow (idle on the globe) ---------- */
#ambient { position: fixed; inset: 0; z-index: 30; background: #1A0E13; color: #FAF8F2; overflow: hidden; opacity: 0; transition: opacity 1.2s var(--ease); cursor: pointer; }
#ambient.open { opacity: 1; }
.ambient-stage { position: absolute; inset: 0; }
.ambient-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s cubic-bezier(.45, 0, .2, 1); overflow: hidden; }
.ambient-slide.on { opacity: 1; }
.ambient-slide .bg { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(28px) brightness(.5) saturate(1.1); }
.ambient-slide .fg { position: absolute; inset: 0; margin: auto; width: 100%; height: 100%; object-fit: contain; will-change: transform; }
@media (min-aspect-ratio: 1/1) { .ambient-slide .fg { padding: 6vh 0 19vh; } }
#ambient::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; pointer-events: none; background: linear-gradient(to top, rgba(26,14,19,.62), rgba(26,14,19,0)); }
.ambient-actions { opacity: 0; transform: translateY(8px); transition: opacity .8s var(--ease) .4s, transform .8s var(--ease) .4s; }
#ambient.open .ambient-actions { opacity: 1; transform: none; }
.ambient-caption { position: absolute; z-index: 3; left: 16px; right: 16px; bottom: calc(40px + var(--safe-b, 0px)); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; text-shadow: 0 1px 16px rgba(26,14,19,.55); opacity: 0; transform: translateY(6px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.ambient-caption.on { opacity: 1; transform: none; }

/* ---------- Final transition ---------- */
#final-transition { z-index: 7; display: grid; place-items: center; background: var(--bg); }
#final-transition .transition-text { position: static; }
#final-transition .trans-line { position: static; display: block; }
#final-transition .emphasis { font-size: clamp(1.9rem, 5vw, 3rem); color: var(--ink); margin-top: 8px; }
body.state-final #final-transition { opacity: 1; visibility: visible; }

/* ---------- Wedding (sections are opened from the header links) ---------- */
#wedding { z-index: 4; background: var(--bg); }
body.state-wedding #wedding { opacity: 1; visibility: visible; }
.wedding-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior: contain; scroll-behavior: smooth; }
.wedding-scroll::-webkit-scrollbar { display: none; }
.wedding-content { max-width: 620px; margin: 0 auto; padding: calc(max(var(--edge), env(safe-area-inset-top)) + 86px) var(--edge) calc(var(--edge) + 160px + var(--safe-b)); text-align: center; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeUp .7s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.wedding-day { font-size: .7rem; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); margin-top: 18px; }
#wedding-date { font-family: var(--serif); font-size: clamp(1.7rem, 4.8vw, 2.4rem); color: var(--accent); margin: 6px 0 26px; text-transform: uppercase; letter-spacing: .02em; }
#countdown { display: flex; justify-content: center; align-items: flex-start; gap: clamp(6px, 2vw, 14px); direction: ltr; }
.cd { display: flex; flex-direction: column; align-items: center; min-width: 3.1em; }
.cd .num { font-family: var(--serif); font-size: clamp(1.5rem, 5vw, 2rem); font-variant-numeric: tabular-nums; line-height: 1.1; }
.cd .lbl { font-size: .56rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.cd-sep { font-family: var(--serif); font-size: clamp(1.15rem, 3.4vw, 1.5rem); color: var(--sage-deep); line-height: 1.25; }
.ceremony-text { font-family: var(--serif); font-size: clamp(1.6rem, 4.5vw, 2.2rem); margin-top: 52px; }
.at-text { font-size: .62rem; letter-spacing: .4em; color: var(--muted); margin: 14px 0; text-transform: uppercase; }
.venue-country { font-family: var(--serif); font-size: clamp(1.5rem, 4.4vw, 2rem); letter-spacing: .14em; text-transform: uppercase; margin-top: 52px; }
.venue-note { --note-w: min(760px, 100vw - 2 * var(--edge)); width: var(--note-w); margin: 26px calc((100% - var(--note-w)) / 2) 0; font-size: .82rem; line-height: 1.8; color: var(--ink-2); text-wrap: balance; }   /* as wide as the two cards above it: two lines on desktop and tablet */
.sub-title { font-family: var(--serif); font-size: clamp(1.4rem, 3.6vw, 1.75rem); letter-spacing: .04em; margin: 64px 0 26px; }
.sub-title::before { content: ''; display: block; width: 44px; height: 1px; margin: 0 auto 26px; background: var(--sage); }
.btn-row { margin-top: 36px; }
.outline-btn { padding: 14px 34px; border: 1px solid var(--accent); color: var(--accent); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; transition: background .3s, color .3s; }
.outline-btn:hover { background: var(--accent); color: var(--on-accent); }
.section-title { font-family: var(--serif); font-size: clamp(1.9rem, 5vw, 2.5rem); margin: 18px 0 30px; text-transform: uppercase; letter-spacing: .06em; }
.small-note { font-size: .74rem; color: var(--muted); line-height: 1.7; margin-top: 30px; letter-spacing: .02em; }

.timeline { display: inline-flex; flex-direction: column; text-align: left; }
.tl-item { display: grid; grid-template-columns: 34px 22px 1fr; align-items: start; gap: 8px; min-height: 64px; }
.tl-icon { color: var(--sage-deep); padding-top: 1px; text-align: center; }
.tl-node { position: relative; display: flex; justify-content: center; height: 100%; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--blush); margin-top: 6px; position: relative; z-index: 1; }
.tl-line { position: absolute; top: 14px; bottom: -6px; width: 1px; background: var(--sage); }
.tl-item:last-child .tl-line { display: none; }
.tl-time { font-size: .7rem; letter-spacing: .18em; color: var(--muted); }
.tl-desc { font-family: var(--serif); font-size: 1.3rem; margin-top: 2px; }

.menu-section { margin-bottom: 30px; }
.menu-section .t { font-family: var(--serif); font-size: 1.4rem; }
.menu-section .d { font-size: .8rem; color: var(--ink-2); margin-top: 6px; line-height: 1.7; letter-spacing: .04em; font-style: italic; }
.menu-section + .menu-section::before { content: '·'; display: block; color: var(--muted); margin: -16px 0 14px; }

.seat-search { width: 100%; max-width: 360px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 4px; text-align: center; outline: none; font-size: .9rem; margin-bottom: 26px; }
.seat-search:focus { border-color: var(--accent); }
.seat-row { display: flex; justify-content: space-between; padding: 11px 4px; border-bottom: 1px solid var(--line); font-size: .9rem; text-align: left; }
.seat-row .tbl { color: var(--muted); font-size: .8rem; letter-spacing: .1em; }
.seat-empty { color: var(--ink-2); font-size: .85rem; line-height: 1.8; }

.ev-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 26px 0 0; }
.ev-quick-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px 11px 15px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: .62rem; letter-spacing: .24em; text-transform: uppercase; transition: background .3s, color .3s; }
.ev-quick-btn .ms { font-size: 1.05rem; }
.ev-quick-btn:hover { background: var(--accent); color: var(--bg); }
.ev-todo .sub-title { margin-top: 64px; }

/* Travel notes */
.tv-sec { margin-top: 18px; }
.tv-icon { margin: 56px auto -44px; color: var(--sage-deep); }
.tv-icon .ms { font-size: 1.6rem; }
.tv-sec .tv-title { margin-top: 56px; }
.tv-sec .tv-title::before { display: none; }
.tv-body { font-size: .86rem; line-height: 1.8; color: var(--ink-2); max-width: 31em; margin: 0 auto; }
.tv-body b { color: var(--ink); font-weight: 500; }
.tv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 26px 0 0; }
.tv-stat { border: 1px solid var(--line); border-radius: 14px; padding: 16px 8px 14px; background: var(--blush); }
.tv-stat .ms { color: var(--accent); font-size: 1.2rem; }
.tv-stat-v { font-family: var(--serif); font-size: 1.25rem; margin-top: 6px; color: var(--ink); }
.tv-stat-l { font-size: .56rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.tv-list { list-style: none; padding: 0; margin: 4px auto 0; max-width: 30em; text-align: start; }
.tv-list li { position: relative; padding: 12px 0 12px 26px; border-bottom: 1px solid var(--line); font-size: .84rem; line-height: 1.65; color: var(--ink-2); }
.tv-list li::before { content: ''; position: absolute; left: 4px; top: 20px; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--accent); }
.tv-list li b { color: var(--ink); font-weight: 500; }

/* The map */
.tv-map { margin: 26px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; position: relative; }
.tv-map::before { content: ''; position: absolute; inset: 5px; border: 1px solid var(--frame-a); border-radius: 12px; pointer-events: none; }
.tv-map svg { display: block; width: 100%; height: auto; overflow: hidden; border-radius: 8px; direction: ltr; }
.mp-land { fill: var(--blush); }
.mp-coast { fill: none; stroke: var(--ink); stroke-width: .9; stroke-linejoin: round; }
.mp-doodle path { fill: none; stroke: var(--sage-deep); stroke-width: .9; stroke-linecap: round; stroke-linejoin: round; opacity: .6; }
.mp-waves path { fill: none; stroke: var(--sage-deep); stroke-width: .8; stroke-linecap: round; opacity: .55; }
.mp-road { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; opacity: .7; }
.mp-sea { font-family: var(--serif); font-style: italic; font-size: 13px; fill: var(--sage-deep); letter-spacing: .06em; }
.mp-town { font-size: 8.5px; letter-spacing: .26em; text-transform: uppercase; fill: var(--muted); }
.mp-hwy { font-size: 7.5px; letter-spacing: .2em; text-transform: uppercase; fill: var(--muted); opacity: .8; }
.mp-pin { cursor: pointer; outline: none; }
.mp-hit { fill: transparent; }
.mp-dot { stroke: var(--bg); stroke-width: 1.4; transition: r .3s var(--ease); }
.mp-venue .mp-dot { fill: var(--accent); }
.mp-halo { fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: var(--accent); stroke-width: 1.3; opacity: 0; transform-box: fill-box; transform-origin: center; animation: mpPulse 3s ease-out infinite; }
.mp-halo.h1 { animation-delay: 1s; } .mp-halo.h2 { animation-delay: 2s; }
@keyframes mpPulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mp-halo { animation: none; opacity: .4; transform: scale(1.8); } .mp-halo.h1, .mp-halo.h2 { display: none; } }
.mp-venue .mp-label { font-size: 15px; fill: var(--accent); }
.mp-venue .mp-tag { fill: var(--accent); font-size: 7.5px; }
.mp-block .mp-dot { fill: var(--sage-deep); }
.mp-hotel .mp-dot { fill: color-mix(in srgb, var(--sage-deep) 45%, var(--bg)); stroke: var(--sage-deep); stroke-width: 1.3; }
.mp-food .mp-dot { fill: var(--bg); stroke: var(--accent); stroke-width: 1.3; }
.mp-airport .mp-dot, .mp-place .mp-dot { fill: var(--ink); }
.mp-pin.on circle.mp-dot, .mp-pin:hover circle.mp-dot, .mp-pin:focus-visible circle.mp-dot { r: 8; }
.mp-pin.on rect.mp-dot, .mp-pin:hover rect.mp-dot { stroke-width: 2.2; }
.mp-label { font-family: var(--serif); font-size: 12.5px; fill: var(--ink); paint-order: stroke; stroke: var(--blush); stroke-width: 3px; stroke-linejoin: round; }
.mp-tag { font-family: var(--sans, inherit); font-size: 7px; letter-spacing: .22em; text-transform: uppercase; fill: var(--muted); }
.mp-compass path { fill: var(--ink); } .mp-compass text { font-size: 8px; fill: var(--ink); letter-spacing: .1em; }
.mp-caption { min-height: 46px; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 12px; padding: 12px 6px 4px; border-top: 1px solid var(--line); margin-top: 8px; }
.mp-hint { font-size: .74rem; color: var(--muted); font-style: italic; }
.mp-name { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); }
.mp-sub { font-size: .74rem; color: var(--ink-2); }
.mp-go { display: inline-flex; align-items: center; gap: 4px; font-size: .6rem; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.mp-go .ms { font-size: .9rem; }
.mp-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; padding: 10px 4px 4px; }
.mp-key { display: inline-flex; align-items: center; gap: 7px; font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.mp-key i { width: 9px; height: 9px; border-radius: 50%; }
.mp-key.mp-venue i { background: var(--accent); } .mp-key.mp-block i { background: var(--sage-deep); }
.mp-key.mp-hotel i { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); border: 1.3px solid var(--sage-deep); background: color-mix(in srgb, var(--sage-deep) 45%, var(--bg)); } .mp-key.mp-food i { border: 1.3px solid var(--accent); }

/* Where to stay / where to eat */
.places-intro { font-family: var(--serif); font-style: italic; font-size: 1.15rem; line-height: 1.6; color: var(--ink-2); max-width: 30em; margin: -8px auto 0; }
.places .sub-title { margin-top: 56px; }
.places-group-note { font-size: .74rem; color: var(--muted); letter-spacing: .02em; margin: -12px 0 22px; line-height: 1.7; }
.place-list { display: grid; gap: 14px; }
.place { padding: 26px 22px 24px; border: 1px solid var(--line); border-radius: 14px; }
.place-block { border-color: var(--frame-a); background: var(--blush); }
.place-badge { display: inline-block; font-size: .56rem; letter-spacing: .28em; text-transform: uppercase; color: var(--accent); border: 1px solid currentColor; border-radius: 99px; padding: 5px 10px 5px 12px; margin-bottom: 14px; }
.place-name { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; line-height: 1.25; }
.place-area { font-size: .6rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.place-note { font-size: .82rem; line-height: 1.7; color: var(--ink-2); margin: 12px auto 0; max-width: 28em; }
.place-links { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; font-size: .62rem; letter-spacing: .24em; text-transform: uppercase; }
.place-links a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.place-links i { font-style: normal; color: var(--muted); }

.faq-item { border-bottom: 1px solid var(--line); text-align: left; }
.faq-q { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 2px; font-size: .92rem; text-align: inherit; line-height: 1.5; }
.faq-q .ms { transition: transform .4s var(--ease); color: var(--muted); flex-shrink: 0; }
.faq-item.open .faq-q .ms { transform: rotate(180deg); color: var(--accent); }
.faq-q { transition: color .3s; } .faq-item.open .faq-q, .faq-q:hover { color: var(--accent); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.faq-a > div { overflow: hidden; font-size: .85rem; line-height: 1.85; color: var(--ink-2); }
.faq-a > div > p { margin: 0 2px 20px; }
.faq-item.open .faq-a { grid-template-rows: 1fr; }

.scroll-indicator { position: fixed; right: var(--edge); bottom: calc(var(--edge) + 30px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: .56rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); pointer-events: none; transition: opacity .5s; }
.scroll-indicator.hide { opacity: 0; }
.mouse { width: 18px; height: 28px; border: 1px solid var(--muted); border-radius: 10px; position: relative; }
.wheel { position: absolute; left: 50%; top: 6px; width: 2px; height: 5px; margin-left: -1px; border-radius: 2px; background: var(--muted); animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(8px); } }
#wedding::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--edge) + 176px + var(--safe-b)); pointer-events: none; background: linear-gradient(to bottom, transparent, var(--bg) 40%); }
/* scroll progress runs between the two border lines */
#wedding-scrollbar { position: absolute; right: calc(var(--frame) + 2px); top: calc(var(--frame) + 7px); bottom: calc(var(--frame) + 7px); width: 3px; overflow: hidden; transition: opacity .4s; }
#wedding-scrollbar-fill { width: 100%; height: 100%; background: var(--accent); transform-origin: top; transform: scaleY(0); }

/* ---------- Bottom nav & controls ---------- */
#bottom-nav, #controls { position: fixed; left: 50%; z-index: 20; transform: translateX(-50%); opacity: 0; visibility: hidden; transition: opacity .8s var(--ease), visibility .8s, color .6s; }
body:is(.state-intro, .state-journey, .state-transition, .state-wedding, .state-final) :is(#bottom-nav, #controls) { opacity: 1; visibility: visible; }
/* the bar and its icons sit clear of the homepage border: icons ~20px above the inner line, labels 6px above the icons */
#bottom-nav { bottom: calc(var(--edge) + 30px + var(--safe-b)); width: min(400px, calc(100% - 2 * var(--edge))); }
.nav-labels { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; margin-bottom: 12px; }
.nav-item { font-size: .64rem; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); transition: color .4s; padding: 6px 0; white-space: nowrap; }
.nav-item:nth-child(2) { text-align: center; }
.nav-item:nth-child(2) { padding-left: .26em; }   /* optical centring with the trailing letter-spacing */
.nav-item:last-child { margin-right: -.26em; }
@media (max-width: 380px) { .nav-item { letter-spacing: .14em; } }
.nav-item:first-child { text-align: left; } .nav-item:last-child { text-align: right; }
.nav-item.active { color: var(--ink); }
#journey-count { margin-inline-start: .4em; letter-spacing: .1em; unicode-bidi: isolate; direction: ltr; display: inline-block; }
.nav-progress { position: relative; height: 5px; margin: 0; direction: ltr; }   /* the line spans the labels: first dot under Intro's first letter, last under Wedding's last */
.nav-line { position: absolute; left: 0; right: 0; top: 2px; height: 1px; background: var(--line); }
.nav-fill { position: absolute; left: 0; top: 2px; height: 1px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease-io); }
.dot { position: absolute; top: 0; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--muted); transition: background .4s, transform .4s; }
.dot.active { background: var(--accent); transform: scale(1.25); box-shadow: 0 0 0 3px rgba(241,184,200,.45); }
.d1 { left: 2.5px; } .d2 { left: 50%; } .d3 { left: calc(100% - 2.5px); }
/* Wedding-only passcode: the journey (globe, slideshows, gallery) doesn't exist for this guest. */
body.no-journey #nav-journey, body.no-journey .dot.d2, body.no-journey .site-link[data-go="journey"],
body.no-journey #gallery-btn, body.no-journey .ctl-sep { display: none; }
body.no-journey .nav-labels { grid-template-columns: 1fr 1fr; }
#controls { bottom: calc(var(--edge) - 8px + var(--safe-b));   /* the icons' ink (18px glyphs in a 32px row) ends on --edge */
  display: flex; align-items: center; gap: 2px; }
.ctl { width: 40px; height: 32px; display: grid; place-items: center; color: var(--ink-2); transition: color .3s; }
.ctl:hover { color: var(--ink); }
.ctl .ms { font-size: 1.15rem; }
.ctl-sep { width: 1px; height: 12px; background: var(--line); }

/* ---------- Overlays: gallery, lightbox, RSVP ---------- */
#gallery, #lightbox, #rsvp { position: fixed; inset: 0; z-index: 40; opacity: 0; transition: opacity .5s var(--ease); }
#gallery.open, #lightbox.open, #rsvp.open { opacity: 1; }
#gallery { background: var(--bg); }
#gallery::before, #gallery::after { content: ''; position: absolute; z-index: 4; inset: var(--frame); border: 1px solid var(--frame-a); pointer-events: none; }
#gallery::after { inset: calc(var(--frame) + 5px); border-color: var(--frame-b); }
#gallery .icon-btn.close { top: max(var(--edge), env(safe-area-inset-top)); right: var(--edge); z-index: 5; }
.gallery-scroll { position: absolute; inset: calc(var(--frame) + 7px); overflow-y: auto; padding: calc(var(--gutter) + 56px) var(--gutter) calc(var(--gutter) + 40px); overscroll-behavior: contain; scrollbar-width: none; }   /* photos stay inside the border */
.gallery-scroll::-webkit-scrollbar { display: none; }
.gallery-title { font-family: var(--serif); font-size: clamp(2rem, 6vw, 3rem); text-align: center; text-transform: uppercase; letter-spacing: .08em; }
.gallery-title.small { font-size: clamp(1.6rem, 4.5vw, 2.2rem); margin-top: 60px; }
.gallery-subtitle { text-align: center; color: var(--muted); font-size: .78rem; letter-spacing: .14em; margin: 8px 0 34px; }
.gallery-grid { columns: 4 220px; column-gap: 12px; max-width: 1280px; margin: 0 auto; }
.g-item { break-inside: avoid; margin: 0 0 12px; display: block; width: 100%; position: relative; background: var(--blush); overflow: hidden; cursor: zoom-in; }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .6s var(--ease), transform .8s var(--ease); }
.g-item img.loaded { opacity: 1; }
.g-item:hover img { transform: scale(1.03); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .3s, color .3s; }
.icon-btn:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.icon-btn.close { position: absolute; top: max(20px, env(safe-area-inset-top)); right: 20px; z-index: 3; }
.gallery-upload { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin-bottom: 26px; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border: 1px solid var(--ink); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; transition: background .3s, color .3s; }
.pill-btn:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pill-btn.ghost { border-color: rgba(250,248,242,.6); color: #FAF8F2; }
.pill-btn.ghost:hover { background: #FAF8F2; color: #711F3D; border-color: #FAF8F2; }
.upload-status { font-size: .75rem; color: var(--muted); width: 100%; text-align: center; min-height: 1em; }
#lightbox { background: rgba(26, 14, 19, .96); color: #FAF8F2; z-index: 45; }
#lightbox .icon-btn { background: rgba(250,248,242,.08); color: #FAF8F2; border-color: rgba(250,248,242,.22); }
#lightbox .icon-btn:hover { background: #FAF8F2; color: #711F3D; border-color: #FAF8F2; }
/* The photo stops above its subtitle with the same gap as from the date down to the "12 / 125" counter
   (--lb-cap = the subtitle's height: place line + gap + date line). The photo sits on the bottom of its
   area, so a wide photo on a phone keeps that gap too. */
#lightbox { --lb-cap-bottom: 66px; --lb-gap: 35px; --lb-cap: 51px; }
.lb-stage { position: absolute; inset: 70px 70px calc(var(--lb-cap-bottom) + var(--lb-cap) + var(--lb-gap) + var(--safe-b)); display: grid; grid-template: 100% / 100%; place-items: end center; touch-action: pan-y; }
#lb-img { max-width: 100%; max-height: 100%; object-fit: contain; opacity: 0; transition: opacity .35s var(--ease); user-select: none; -webkit-user-drag: none; }
#lb-img.loaded { opacity: 1; }
/* Place ("City, State" in the USA, "City, Country" elsewhere) and date of the open photo */
.lb-caption { position: absolute; left: 0; right: 0; bottom: calc(var(--lb-cap-bottom) + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 20px; text-align: center; pointer-events: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lb-nav.prev { left: 16px; } .lb-nav.next { right: 16px; }
.lb-bottom { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); display: flex; justify-content: center; align-items: center; gap: 18px; font-size: .75rem; letter-spacing: .14em; color: rgba(250,248,242,.75); }
@media (max-width: 640px) { #lightbox { --lb-cap: 46px; } .lb-stage { left: 0; right: 0; } .lb-nav { top: auto; bottom: calc(14px + var(--safe-b)); transform: none; } }

#rsvp { background: var(--shade); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.rsvp-card { position: relative; width: min(460px, 100%); background: var(--bg); border: 1px solid var(--line); padding: 44px clamp(22px, 5vw, 40px) 30px; box-shadow: 0 30px 80px rgba(var(--sh),.14); transform: translateY(14px); transition: transform .6s var(--ease); max-height: calc(100dvh - 32px); overflow-y: auto; }
#rsvp.open .rsvp-card { transform: none; }
.rsvp-card .icon-btn.close { top: 12px; right: 12px; background: transparent; border: 0; }
.rsvp-title { font-family: var(--serif); font-size: 2.1rem; text-align: center; letter-spacing: .06em; }
.rsvp-subtitle { text-align: center; color: var(--muted); font-size: .8rem; margin: 4px 0 26px; letter-spacing: .06em; }
.field { margin-bottom: 18px; text-align: left; }
.field label, .field-label { display: block; font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 8px 2px; outline: none; border-radius: 0; font-size: .95rem; transition: border-color .3s; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field select { appearance: none; -webkit-appearance: none; background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 8px center / 5px 5px no-repeat, linear-gradient(-45deg, transparent 50%, var(--muted) 50%) right 3px center / 5px 5px no-repeat; }
.radio-group { display: flex; gap: 10px; margin-bottom: 20px; }
.radio { flex: 1; position: relative; }
.radio input { position: absolute; opacity: 0; inset: 0; }
.radio span { display: block; text-align: center; padding: 11px; border: 1px solid var(--line); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; cursor: pointer; transition: all .3s; }
.radio input:checked + span { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.radio input:focus-visible + span { outline: 1.5px solid var(--ink); outline-offset: 2px; }
.solid-btn { width: 100%; padding: 15px; background: var(--accent); color: var(--on-accent); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; margin-top: 8px; transition: opacity .3s; }
.solid-btn[disabled] { opacity: .5; pointer-events: none; }
.rsvp-note { font-size: .72rem; color: var(--muted); line-height: 1.7; text-align: center; margin: 16px 0 0; }
.rsvp-note.warn { color: var(--ink-2); }
#rsvp-success { text-align: center; padding: 20px 0 6px; }
.rsvp-heart { font-size: 2rem; margin-bottom: 8px; color: var(--accent); }
.rsvp-heart .ms { font-size: 2.6rem; animation: beat 1.4s var(--ease) infinite; }
@keyframes beat { 15% { transform: scale(1.15); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } 60% { transform: scale(1); } }
.rsvp-msg { color: var(--ink-2); font-size: .88rem; line-height: 1.8; margin: 10px 0 26px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--edge) + 112px + var(--safe-b)); transform: translate(-50%, 10px); z-index: 70; background: var(--accent); color: var(--on-accent); font-size: .78rem; padding: 10px 18px; opacity: 0; pointer-events: none; transition: opacity .4s, transform .4s var(--ease); letter-spacing: .04em; max-width: calc(100% - 40px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- The two days: arch-topped invitation cards (We Do / We Party Again) ---------- */
.venue-sub { font-size: .64rem; letter-spacing: .5em; text-transform: uppercase; color: var(--muted); margin-top: 8px; padding-left: .5em; }
.events { --events-w: min(1000px, 100vw - 2 * var(--edge)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; width: var(--events-w); margin: 38px calc((100% - var(--events-w)) / 2) 0; text-align: center; }
.event { position: relative; display: flex; flex-direction: column; align-items: center; padding: 34px 20px 30px; border: 1px solid var(--line); border-radius: 190px 190px 14px 14px; background: var(--blush); animation: fadeUp .9s var(--ease) both; animation-delay: calc(.15s + var(--i) * .14s); }
.event::before { content: ''; position: absolute; inset: 6px; border: 1px solid var(--frame-a); border-radius: 184px 184px 9px 9px; pointer-events: none; }
.event-art { width: 74px; height: 54px; color: var(--accent); margin: 6px 0 14px; }
.event-art svg { width: 100%; height: 100%; overflow: visible; }
/* The line drawings (coupes / sun / rings) on the day cards and at the top of each day's page draw themselves,
   hold, fade and draw again from the start, on a loop. Same timing on both, so they read as one motif.
   --i staggers the three cards (set inline); a day's page sets --i: 0 on its header. */
.event-art .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawLoop 6s var(--ease) infinite; animation-delay: calc(.45s + var(--i) * .2s); }
.event-art .draw.d2 { animation-delay: calc(.75s + var(--i) * .2s); }
.event-art .draw.d3 { animation-delay: calc(1.05s + var(--i) * .2s); }
@keyframes drawLoop {
  0% { stroke-dashoffset: 1; opacity: 1; }
  25% { stroke-dashoffset: 0; opacity: 1; }
  78% { stroke-dashoffset: 0; opacity: 1; }
  92% { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 1; opacity: 0; }
}
.event-art .spark { stroke: var(--sage-deep); opacity: 0; transform-box: fill-box; transform-origin: center; animation: twinkle 3s ease-in-out infinite; animation-delay: calc(1.6s + var(--i) * .2s); }
.event-art .spark.s2 { animation-delay: calc(2.3s + var(--i) * .2s); }
.event-art .spark.s3 { animation-delay: calc(2.9s + var(--i) * .2s); }
@media (prefers-reduced-motion: reduce) { .event-art .draw { animation: none; stroke-dashoffset: 0; } .event-art .spark { animation: none; } }
.event .clink { transform-box: view-box; }
.event .clink.l { transform-origin: 22px 48px; } .event .clink.r { transform-origin: 58px 48px; }
.event-coupes:hover .clink.l { animation: clinkL .9s var(--ease); } .event-coupes:hover .clink.r { animation: clinkR .9s var(--ease); }
@keyframes clinkL { 40% { transform: rotate(-8deg); } 75% { transform: rotate(1.5deg); } }
@keyframes clinkR { 40% { transform: rotate(8deg); } 75% { transform: rotate(-1.5deg); } }
.event-rings .event-art svg { transition: transform .6s var(--ease); }
.event-rings:hover .event-art svg { transform: rotate(-6deg) scale(1.04); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 45%, 60% { opacity: 1; transform: scale(1); } }
.event-day { font-size: .58rem; letter-spacing: .34em; text-transform: uppercase; color: var(--muted); padding-left: .34em; }
.event-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.75rem, 3.8vw, 2.15rem); line-height: 1.05; letter-spacing: .01em; margin: 12px 0 10px; white-space: nowrap; }
.event-date { font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; color: var(--ink); padding-left: .26em; }
.event-what { font-size: .8rem; color: var(--ink-2); margin-top: 6px; letter-spacing: .02em; }
.event-heart { width: 15px; height: 14px; color: var(--accent); margin: 18px 0 14px; }
.event-heart svg { width: 100%; height: 100%; display: block; }
.event-venue { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); text-decoration: none; padding-left: .2em; }
a.event-venue { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; padding-bottom: 3px; transition: background-size .4s var(--ease); }
a.event-venue:hover { background-size: 0 1px; background-position: 100% 100%; }
.event-tbd { display: inline-block; font-size: .58rem; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-2); border: 1px dashed var(--sage-deep); border-radius: 999px; padding: 7px 14px 7px calc(14px + .28em); }
.event-place { font-size: .72rem; color: var(--muted); margin-top: 8px; letter-spacing: .03em; }
/* "Details" link at the foot of each card */
.event-more { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding: 22px 0 0; color: var(--accent); font-size: .64rem; letter-spacing: .28em; text-transform: uppercase; }
.event-more::before { content: ''; position: absolute; inset: 0; border-radius: 190px 190px 14px 14px; }   /* the whole card opens the day's page */
.event-more .ms { font-size: .95rem; }
.event-place { margin-bottom: 0; }
.event-place:empty { display: none; }
.event { cursor: pointer; transition: translate .45s var(--ease), box-shadow .45s var(--ease), border-color .45s; }
.event:hover { translate: 0 -3px; box-shadow: 0 18px 40px rgba(var(--sh), .1); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.event a.event-venue { position: relative; z-index: 1; }   /* the venue link still opens the venue's site */
.event-more { position: static; }

/* A day's own page */
#tab-event { max-width: 680px; margin: 0 auto; }
.ev-back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .64rem; letter-spacing: .28em; text-transform: uppercase; padding: 6px 0; transition: color .3s; }
.ev-back .ms { font-size: .95rem; transform: scaleX(-1); transition: transform .35s var(--ease); }
.ev-back:hover { color: var(--accent); }
.ev-back:hover .ms { transform: scaleX(-1) translateX(4px); }
.ev-hero { display: flex; flex-direction: column; align-items: center; margin-top: 26px; }
.ev-art { width: 96px; height: 70px; margin: 0 0 16px; }
.ev-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 8vw, 3.8rem); line-height: 1; letter-spacing: .01em; color: var(--accent); margin: 14px 0 12px; }
.ev-what { font-size: .86rem; color: var(--ink-2); letter-spacing: .03em; }
.ev-rule { margin: 26px 0 0; }
.ev-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 34px 0 0; border: 1px solid var(--line); border-radius: 14px; background: var(--blush); position: relative; }
.ev-facts::before { content: ''; position: absolute; inset: 5px; border: 1px solid var(--frame-a); border-radius: 10px; pointer-events: none; }
.ev-fact { padding: 26px 16px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ev-fact + .ev-fact { border-inline-start: 1px solid var(--line); }
.ev-facts.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ev-facts.n4 .ev-fact:nth-child(3) { border-inline-start: 0; }
.ev-facts.n4 .ev-fact:nth-child(n+3) { border-top: 1px solid var(--line); }
.ev-dress-more { font-size: .8rem; line-height: 1.75; color: var(--ink-2); max-width: 30em; margin: 20px auto 0; }
.ev-label { font-size: .58rem; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); padding-left: .32em; }
.ev-main { font-family: var(--serif); font-size: 1.3rem; line-height: 1.2; color: var(--ink); }
.ev-sub { font-size: .76rem; color: var(--ink-2); line-height: 1.5; }
.ev-link { color: var(--accent); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; padding-bottom: 2px; transition: background-size .4s var(--ease); }
.ev-link:hover { background-size: 0 1px; background-position: 100% 100%; }
#tab-event .timeline { margin-top: 2px; }
.ev-soon { font-family: var(--serif); font-size: 1.15rem; font-style: italic; color: var(--ink-2); margin-top: 0; }
.ev-next { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 56px auto 0; padding: 26px 34px 0; border-top: 1px solid var(--frame-a); }
.ev-next-day { font-size: .58rem; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); padding-left: .32em; }
.ev-next-title { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.6rem; color: var(--ink); transition: color .3s; }
.ev-next-title .ms { font-size: 1.1rem; color: var(--accent); transition: transform .35s var(--ease); }
.ev-next:hover .ev-next-title { color: var(--accent); }
.ev-next:hover .ev-next-title .ms { transform: translateX(4px); }

@media (max-width: 560px) {
  .tv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ev-facts.n4 { grid-template-columns: 1fr; }
  .ev-facts.n4 .ev-fact:nth-child(2) { border-top: 1px solid var(--line); }
  /* phones: the three days sit in one row you swipe through, with the next card peeking in */
  .events { --events-w: 100vw; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 76%; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 8px 12% 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .events::-webkit-scrollbar { display: none; }
  .event { scroll-snap-align: center; }
  .event:hover { translate: none; }
  .ev-facts { grid-template-columns: 1fr; }
  .ev-fact { padding: 20px 16px; }
  .ev-fact + .ev-fact { border-inline-start: 0; border-top: 1px solid var(--line); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) { .header-sub { display: none; } }
@media (max-width: 820px) {
  /* phones & small tablets: the links fold into a drop-down menu */
  #persistent-header { --hdr-h: 72px; }
  .menu-btn { display: grid; }
  .site-nav {
    position: absolute; top: calc(100% - 6px); left: var(--edge); right: var(--edge); flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 0; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 24px 50px rgba(var(--sh), .14);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s;
  }
  #persistent-header.menu-open .site-nav { opacity: 1; visibility: visible; transform: none; }
  .site-link { padding: 15px 20px; text-align: center; font-size: .7rem; }
  .site-link + .site-link { border-top: 1px solid var(--line); }
  .wedding-content { padding-top: calc(max(var(--edge), env(safe-area-inset-top)) + 76px); }
}
@media (max-width: 640px) {
  .header-logo { font-size: 1.2rem; }
  .header-sub { font-size: .7rem; }
  .action-btn { bottom: calc(var(--edge) + 138px + var(--safe-b)); }
  .story-actions { right: 14px; top: max(30px, calc(env(safe-area-inset-top) + 20px)); }
  .story-header { flex-direction: column; gap: 6px; bottom: calc(60px + var(--safe-b)); }
  .gallery-grid { columns: 2 140px; column-gap: 8px; }
  .g-item { margin-bottom: 8px; }
  /* phones: the hint sits above the globe instead of at the bottom. On a portrait phone the globe is ~74vw
     across and centred, and its photo cards reach out to ~54vw from the centre, so the line goes just above
     them, but never under the header. */
  #journey-instruction { bottom: auto; top: max(calc(max(var(--edge), env(safe-area-inset-top)) + 76px), calc(50% - 54vw - 2.4em)); }
  .scroll-indicator { display: none; }
  #persistent-header { gap: 10px; }
  .t-b { padding-left: .9em; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .env-flap-text { top: 5%; }
  .gate-title { font-size: 1.8rem; margin: 4px 0 2px; }
  .gate-remember { margin-top: 6px; }
  .nav-labels { margin-bottom: 6px; }
  .nav-item { padding: 4px 0; }
  .action-btn { padding: 10px 24px; }
  .action-btn { bottom: calc(var(--edge) + 76px); }
  .title-part { font-size: clamp(2.2rem, 7vh + 2vw, 4rem); }
  .intro-card { margin-top: -18vh; }
  .intro-eyebrow { margin-bottom: 8px; }
  .intro-rule { margin: 10px 0 6px; }
  #journey-instruction { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; scroll-behavior: auto !important; }
}

/* ---------- Phones & tablets held upright ----------
   The envelope keeps the proportions it has on a computer screen (3:2) instead of stretching to a tall
   phone: it sits on the paper like a real envelope, the greeting above it and the hint below. When the
   right password goes in, the card slides out and the envelope grows into the homepage. */
@media (orientation: portrait) and (max-width: 900px) {
  #gate { --env-w: min(100vw - 36px, 560px); --env-h: calc(var(--env-w) / 1.5); --seal: min(calc(var(--env-h) * .72), 210px); background: var(--paper); background-color: var(--bg); }
  .envelope { inset: auto; left: calc(50% - var(--env-w) / 2); top: calc(50% - var(--env-h) / 2 + 3vh); width: var(--env-w); height: var(--env-h); border-radius: 4px; box-shadow: 0 2px 5px rgba(var(--sh), .08), 0 26px 50px rgba(var(--sh), .16);
    transition: transform 1.05s var(--ease-io) .3s, box-shadow 1.05s var(--ease-io) .3s, left 1.1s var(--ease-io), top 1.1s var(--ease-io), width 1.1s var(--ease-io), height 1.1s var(--ease-io), border-radius 1.1s var(--ease-io); }
  .env-back, .env-pocket { border-radius: 4px; }
  .env-flap-text { top: auto; bottom: calc(100% + clamp(26px, 6vh, 56px)); }
  .gate-title { font-size: clamp(2.3rem, 10.5vw, 3.2rem); }
  .env-seal { top: 56%; }
  .seal-mono { font-size: calc(var(--seal) * .095); }
  #gate-input { width: 74%; font-size: 1rem; letter-spacing: .05em; padding: 7px 2px 6px; }
  #gate-input::placeholder { letter-spacing: .24em; font-size: .64rem; }
  .seal-actions { margin-top: 4px; gap: 14px; }
  .seal-actions button { width: 40px; height: 40px; }   /* comfortable thumb targets */
  .env-below { top: calc(100% + clamp(22px, 4.5vh, 40px)); padding: 0 4px; }
  .gate-remember { padding: 6px 4px; }
  /* opening: the envelope dips a little, the card rises out of it, then everything grows to fill the screen */
  .env-letter { transform: translateY(0) scale(.9); }
  /* The card carries a copy of the homepage laid out at the phone's own size and shrunk to fit the card
     (1 / --cover-s). As the card zooms to cover the screen the copy grows to exactly 1:1, landing on the real
     homepage underneath, so the hand-off is invisible: one continuous zoom, no blank frame, no swap. */
  .env-letter-page { inset: auto; left: 50%; top: 50%; width: var(--page-w, 100vw); height: var(--page-h, 100vh); transform: translate(-50%, -50%) scale(calc(1 / var(--cover-s, 3.6))); opacity: 0; transition: opacity .5s var(--ease); }
  /* the copy carries the homepage's own paper, so when the envelope layer fades the two are identical */
  #gate.expanding .env-letter { background: var(--bg); }
  #gate.expanding .env-letter-page { background: var(--paper); background-color: var(--bg); }
  #gate.expanding .env-letter-page { opacity: 1; transition: opacity .45s var(--ease) .1s; }
  #gate.opening .envelope { transform: translateY(16%) scale(.9); }
  #gate.opening .env-letter { transform: translateY(-62%) scale(.94); }
  /* ...then, instead of stretching the landscape envelope into a tall screen (which made it jump), the blank
     card zooms evenly until it covers the screen while the envelope fades away behind it; the homepage's words
     then rise in on the same paper. app.js measures the zoom (--cover-x / --cover-y / --cover-s). */
  #gate.expanding .envelope { transform: none; box-shadow: none; }
  #gate.expanding .env-letter { z-index: 6; transform: translate(var(--cover-x, 0px), var(--cover-y, 0px)) scale(var(--cover-s, 3.6)); box-shadow: 0 0 0 rgba(var(--sh), 0); transition: transform 1.25s var(--ease-io), box-shadow 1.25s ease-in; }   /* the card keeps its shadow while it grows, so the zoom reads on ivory paper */
  #gate.expanding :is(.env-pocket, .env-flap, .env-back) { opacity: 0; transition: opacity .8s var(--ease) .1s; }
}
@media (orientation: portrait) and (max-width: 900px) and (max-height: 620px) {
}

/* ---------- Phones: the rest of the site ---------- */
@media (max-width: 560px) {
  /* the day cards swipe inside the frame, with dots to show where you are */
  .events { --events-w: calc(100vw - 2 * var(--frame) - 14px); padding-left: 11%; padding-right: 11%; grid-auto-columns: 78%; }
  .events-dots { display: flex; justify-content: center; gap: 8px; margin: 2px 0 0; }
  .events-dots button { width: 7px; height: 7px; padding: 0; border-radius: 50%; background: var(--line); transition: background .3s, width .3s var(--ease); }
  .events-dots button.on { width: 20px; border-radius: 99px; background: var(--accent); }
  /* a day's page gets to the facts sooner */
  .ev-hero { margin-top: 14px; }
  .ev-art { width: 76px; height: 56px; margin-bottom: 10px; }
  .ev-title { margin: 10px 0 8px; }
  .ev-rule { margin-top: 18px; }
  .ev-facts { margin-top: 24px; }
  .ev-quick { flex-wrap: nowrap; gap: 8px; }
  .ev-quick-btn { flex: 1 1 0; justify-content: center; padding: 12px 8px; letter-spacing: .14em; font-size: .58rem; }
  /* the Intro/Wedding timeline is only useful on the intro and the journey; on the wedding pages the header
     menu does that job, so phones get the room back for content */
  body.state-wedding #bottom-nav { opacity: 0; visibility: hidden; }
  body.state-wedding #wedding::after { height: calc(var(--edge) + 64px + var(--safe-b)); background: linear-gradient(to bottom, transparent, var(--bg) 55%); }
  /* a soft band under the header so scrolled text never runs into the logo */
  #wedding::before { content: ''; position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: calc(var(--edge) + 62px); pointer-events: none; background: linear-gradient(to top, transparent, var(--bg) 62%); }
  body.state-wedding .wedding-content { padding-bottom: calc(var(--edge) + 80px + var(--safe-b)); }
  .place { padding: 22px 16px 20px; }
  .tv-map { padding: 8px; }
}
@media (min-width: 561px) { .events-dots { display: none; } }

/* Icon links (website · Instagram · map) used everywhere instead of text labels */
.icon-links { display: flex; justify-content: center; gap: 10px; margin-top: 14px; position: relative; z-index: 1; }
.icon-link { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--accent); text-decoration: none; transition: opacity .3s, transform .3s var(--ease); }
.icon-link .ms { font-size: 1.15rem; }
@media (hover: hover) { .icon-link:hover { opacity: .7; transform: translateY(-1px); } }
.icon-links { gap: 4px; }
.icon-links.sm { gap: 2px; }
.icon-link .ms { font-size: 1.3rem; }
.icon-links.sm { gap: 8px; margin-top: 10px; }
.icon-links.sm .icon-link { width: 34px; height: 34px; }
.icon-links.sm .icon-link .ms { font-size: 1.2rem; }
.event .icon-links { margin-top: 12px; }
.event-venue-name { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); padding-left: .2em; }
.mp-caption .icon-links { margin-top: 0; }
.tl-sub { font-size: .74rem; color: var(--muted); margin-top: 2px; letter-spacing: .02em; }

/* A day's page: When + Where up top, then Dress code and Shuttles as their own titled sections */
.ev-facts.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ev-sec { margin-top: 8px; }
.ev-sec .sub-title { margin-top: 56px; }
.ev-sec-main { font-family: var(--serif); font-size: 1.6rem; color: var(--ink); line-height: 1.2; }
.ev-sec-icon { color: var(--sage-deep); margin-top: -8px; }
.ev-sec-icon .ms { font-size: 1.7rem; }
.ev-sec-note { font-size: .86rem; line-height: 1.75; color: var(--ink-2); max-width: 30em; margin: 10px auto 0; }
.ev-sec .ev-dress-more { margin-top: 14px; }
@media (max-width: 560px) {
  .ev-facts.n2 { grid-template-columns: 1fr; }
  .ev-facts.n2 .ev-fact:nth-child(2) { border-top: 1px solid var(--line); }
  .ev-sec .sub-title { margin-top: 44px; }
}

/* Dress code / Getting there: small uppercase eyebrows over the serif line, like the When / Where labels */
.ev-sec { margin-top: 52px; }
.ev-sec .ev-sec-icon { margin: 0 0 8px; color: var(--sage-deep); }
.ev-sec .ev-sec-icon .ms { font-size: 1.6rem; }
.ev-eyebrow { font-size: .6rem; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); padding-left: .32em; margin-bottom: 10px; }
@media (max-width: 560px) { .ev-sec { margin-top: 42px; } }

/* More breathing room between the program's moments */
.tl-item { min-height: 0; padding-bottom: 26px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-sub { margin-top: 4px; }
.event-tbd { white-space: nowrap; }
@media (max-width: 560px) { .event-tbd { letter-spacing: .2em; padding-left: calc(14px + .2em); } }

/* Day pages: every section opens the same way (icon · eyebrow · serif line), no divider lines, even spacing */
#tab-event .ev-sec { margin-top: 64px; }
#tab-event .ev-sec .ev-sec-icon { margin: 0 0 10px; height: 28px; display: grid; place-items: center; }
#tab-event .ev-sec-main { margin-bottom: 4px; }
#tab-event .ev-sec .timeline { margin-top: 26px; }
#tab-event .ev-prog-note { margin-top: 26px; font-size: .8rem; color: var(--muted); }
#tab-event .ev-quick { margin-top: 30px; }
#tab-event .ev-todo .places-intro { display: none; }
#tab-event .ev-todo .places { margin-top: 18px; }
#tab-event .ev-todo .places .sub-title::before { display: none; }
#tab-event .ev-todo .places .sub-title { margin: 34px 0 16px; font-size: 1.25rem; }
#tab-event .ev-next { margin-top: 64px; }
/* dress code: who wears what, one clear row each */
.ev-dress { max-width: 26em; margin: 20px auto 0; border-top: 1px solid var(--line); }
.ev-dress-row { display: grid; grid-template-columns: 7.5em 1fr; gap: 14px; align-items: baseline; text-align: start; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.ev-dress-row .ev-label { padding: 0; }
.ev-dress-what { font-size: .88rem; line-height: 1.55; color: var(--ink); }
/* the program: icon, dot and first line sit on one axis; consistent gaps */
.tl-item { grid-template-columns: 30px 22px 1fr; gap: 10px; }
.tl-icon { padding-top: 0; line-height: 18px; height: 18px; font-size: 1.15rem; }
.tl-dot { margin-top: 5px; }
.tl-line { top: 18px; }
.tl-time { line-height: 18px; }
@media (max-width: 560px) {
  #tab-event .ev-sec { margin-top: 52px; }
  #tab-event .ev-next { margin-top: 52px; }
  .ev-dress-row { grid-template-columns: 6.5em 1fr; gap: 10px; }
}

/* Dress code: the "please avoid" rule stands apart so nobody misses it */
.ev-avoid { display: flex; align-items: center; gap: 14px; max-width: 26em; margin: 22px auto 0; padding: 16px 20px; text-align: start; border: 1px solid var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.ev-avoid > .ms { color: var(--accent); font-size: 1.5rem; flex-shrink: 0; }
.ev-avoid-label { font-size: .6rem; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.ev-avoid-what { font-size: .9rem; line-height: 1.5; color: var(--ink); margin-top: 4px; }
/* Timeline: one continuous line from dot to dot, with more room between the moments */
.tl-item { --tl-gap: 77px; padding-bottom: var(--tl-gap); }
.tl-node { align-self: stretch; height: auto; }
.tl-line { top: 9px; bottom: calc(-9px - var(--tl-gap)); }   /* centre of this dot → centre of the next one (gap + 5px margin + 4px half-dot), so it never pokes out past the first or last dot */
.tl-item:last-child .tl-line { display: none; }

/* "Please avoid": quieter — its own short note under the table, no box */
.ev-avoid { display: block; max-width: 26em; margin: 18px auto 0; padding: 0; border: 0; background: none; text-align: center; }
.ev-avoid-label { font-weight: 500; font-size: .58rem; color: var(--accent); }
.ev-avoid-what { font-size: .84rem; color: var(--ink-2); margin-top: 4px; }
/* Dress code rows centered: label on top, line underneath (matches "Please avoid") */
.ev-dress-row { display: block; text-align: center; padding: 14px 4px; }
.ev-dress-row .ev-label { margin-bottom: 5px; padding-left: .32em; }
@media (max-width: 560px) { .ev-dress-row { display: block; } }
/* When / Where: the same three rows in both boxes (label · title · detail), evenly spaced, so the time
   under the date lines up with the icons under the venue */
.ev-facts .ev-fact { display: grid; grid-template-rows: auto auto 38px; row-gap: 12px; align-content: center; justify-items: center; padding: 28px 16px; }
.ev-facts .ev-label { margin: 0; }
.ev-facts .ev-main { margin: 0; display: flex; flex-direction: column; align-items: center; }
.ev-facts .ev-main .icon-links { display: none; }
.ev-facts .ev-sub, .ev-facts .ev-fact > .icon-links { margin: 0; height: 38px; display: flex; align-items: center; justify-content: center; }
.ev-facts .ev-fact { grid-template-rows: auto auto 34px; row-gap: 10px; padding: 26px 16px 20px; }
.ev-facts .ev-sub, .ev-facts .ev-fact > .icon-links { height: 34px; }
/* "Please avoid": its own soft card — set apart from the table, but quiet */
.ev-avoid { display: block; max-width: 24em; margin: 22px auto 0; padding: 14px 20px 15px; text-align: center; background: var(--blush); border: 1px dashed color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 12px; }
.ev-avoid-label { font-size: .58rem; letter-spacing: .3em; font-weight: 500; color: var(--accent); padding-left: .3em; }
.ev-avoid-what { font-size: .84rem; color: var(--ink-2); margin-top: 5px; line-height: 1.55; }
/* Listing cards: the name sits close to the top border, with even spacing inside */
.place { padding: 20px 18px 16px; }
.place-name { margin: 0; }
.place-area { margin-top: 6px; }
.place-note { margin-top: 10px; }
.place .icon-links { margin-top: 10px; }

/* When / Where: label-to-title gap matches the title-to-detail gap */
.ev-facts .ev-label { margin-bottom: 8px; }
.ev-avoid-what { text-transform: uppercase; letter-spacing: .22em; font-size: .95rem; font-weight: 600; color: var(--accent); padding-left: .22em; }
.ev-avoid-note { font-size: .8rem; line-height: 1.6; color: var(--ink-2); margin: 8px auto 0; max-width: 22em; font-style: italic; }
.ev-avoid-note { font-style: normal; font-size: .74rem; }
/* "One rule" card: wider, slimmer side padding, the funny line kept to two lines */
.ev-avoid { max-width: 30em; padding: 14px 14px 15px; }
.ev-avoid-note { max-width: none; margin-top: 6px; }

.mp-scale path { fill: none; stroke: var(--ink); stroke-width: 1; }
.mp-scale text { font-size: 8px; letter-spacing: .14em; fill: var(--ink); }
/* phones: the map is drawn at ~60% size, so its words get bigger to stay readable */
@media (max-width: 560px) {
  .mp-label { font-size: 17px; stroke-width: 4px; }
  .mp-tag { font-size: 9.5px; }
  .mp-town { font-size: 11px; }
  .mp-sea { font-size: 16px; }
  .mp-hwy, .mp-scale text, .mp-compass text { font-size: 10px; }
}

/* Transition lines ("And now…") keep inside the frame on phones */
.trans-line { padding: 0 calc(var(--edge) + 6px); box-sizing: border-box; }
@media (max-width: 560px) { .trans-line { font-size: 1.3rem; line-height: 1.35; } #final-transition .emphasis { font-size: 1.75rem; } }
/* The globe never draws past the frame's inner line */
#globe { clip-path: inset(calc(var(--frame) + 7px)); }
/* Very narrow phones (≤360px): the countdown tightens so "Months" and "Secs" stay inside the frame */
@media (max-width: 360px) {
  #countdown { gap: 3px; }
  .cd { min-width: 2.6em; }
  .cd .lbl { letter-spacing: .12em; font-size: .5rem; }
  .cd .num { font-size: 1.35rem; }
  .cd-sep { font-size: 1rem; }
}

/* ---------- Phones: no border ----------
   On phones (and phones held sideways) the double border is dropped on every page, the envelope's card, the
   intro and the gallery, so content gets the whole screen. --frame goes to 0 and --edge becomes a plain
   screen margin, so everything that is spaced from the border (header, labels, timeline, cards) moves out with it. */
@media (max-width: 640px), (max-height: 560px) and (orientation: landscape) {
  :root { --frame: 0px; --edge: 20px; }
  #site-frame, .card-frame, #gallery::before, #gallery::after { display: none; }
  #globe { clip-path: none; }
  .gallery-scroll { inset: 0; padding: calc(max(var(--edge), env(safe-area-inset-top)) + 52px) 10px calc(var(--edge) + 24px + var(--safe-b)); }
  #wedding-scrollbar { right: 2px; top: 0; bottom: 0; }
  .events { --events-w: 100vw; }
  .trans-line { padding: 0 var(--edge); }
}

/* ---------- Phones: tighter type and spacing ----------
   Everything set in rem comes down ~12% (16px → 14px root), and the big vertical gaps are cut so more of
   each page fits on one screen. Text inputs stay at 16px so iOS doesn't zoom in when they're tapped. */
@media (max-width: 640px) {
  html { font-size: 14px; }
  #gate-input, .seat-search, .field input, .field select, .field textarea { font-size: 16px; }

  /* Details: Saturday + date + countdown start right under the header */
  .wedding-content { padding-top: calc(max(var(--edge), env(safe-area-inset-top)) + 54px); }
  #countdown { gap: clamp(4px, 2vw, 10px); }
  .cd { min-width: 2.7em; }
  .cd .num { font-size: 1.2rem; }
  .cd .lbl { margin-top: 2px; font-size: .5rem; letter-spacing: .16em; }
  .cd-sep { font-size: .95rem; line-height: 1.3; }
  /* the gaps between blocks grow a little on taller phones, so short and tall screens both look evenly spaced */
  .venue-country { margin-top: clamp(22px, 3.6vh, 36px); letter-spacing: .1em; }
  .events { margin-top: clamp(18px, 3vh, 30px); }
  .event { padding: 22px 14px 18px; }
  .events-dots { margin-top: 4px; }
  /* the Easter note runs as one paragraph across the full width (the desktop line break is dropped) */
  .venue-note { width: auto; margin: clamp(16px, 2.6vh, 26px) 0 0; padding: 0 2px; font-size: .9rem; line-height: 1.65; text-wrap: pretty; }
  .venue-note br { display: none; }

  /* titles and sections on every page */
  .section-title { margin: 0 0 16px; }
  .sub-title { margin: 36px 0 16px; }
  .sub-title::before { margin-bottom: 16px; }
  .small-note { margin-top: 18px; line-height: 1.6; }
  .btn-row { margin-top: 22px; }
  .outline-btn { padding: 12px 24px; }
  .ev-sec, #tab-event .ev-sec { margin-top: 32px; }
  .ev-sec .sub-title, .ev-todo .sub-title, .places .sub-title, .tv-sec .tv-title { margin-top: 32px; }
  .tv-icon { margin: 32px auto -28px; }
  #tab-event .ev-quick { margin-top: 18px; }
  #tab-event .ev-next, .ev-next { margin-top: 36px; padding-top: 18px; }
  .ev-facts { margin-top: 18px; }
  .ev-fact { padding: 14px 12px; }
  .tl-item { min-height: 48px; --tl-gap: 45px; padding-bottom: var(--tl-gap); }
  .menu-section { margin-bottom: 20px; }
  .place { padding: 16px 12px 14px; }
  .gallery-title.small { margin-top: 36px; }
  .gallery-subtitle { margin-bottom: 20px; }
}

/* ---------- Sideways scrollers: soft edges ----------
   The standard for any row that scrolls sideways (today: the three day cards on phones). Add edgeFade(el) in
   app.js; it puts .fade-x on the row and toggles .more-l / .more-r when there is more to see on that side.
   The row's edge then fades into the page, a hint to swipe, and the fade goes away once you reach that end. */
@property --fade-l { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --fade-r { syntax: '<length>'; inherits: false; initial-value: 0px; }
.fade-x {
  --fade: clamp(28px, 11vw, 56px);
  transition: --fade-l .35s var(--ease), --fade-r .35s var(--ease);
}
/* The mask is only on while the row actually scrolls: a mask clips everything to the row's box, so on desktop
   (three cards, nothing to scroll) it would cut off the top of a card lifted on hover, and its shadow. */
.fade-x:is(.more-l, .more-r) {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
}
.fade-x.more-l { --fade-l: var(--fade); }
.fade-x.more-r { --fade-r: var(--fade); }

/* ---------- Phones: the Details page fills the screen ----------
   The page is four blocks: countdown · Los Cabos · the day cards · the Easter note. The free height is shared
   evenly above, between and below them (space-evenly), so on any phone the page reads as one full screen instead of a column with a gap at the end.
   Shorter phones (≤ 740px tall) also tighten the cards so everything still fits without scrolling; if a screen
   is too small even then, the page simply scrolls. */
@media (max-width: 640px) {
  .wedding-content:has(> #tab-detail.active) { display: flex; flex-direction: column; min-height: 100%;
    padding-top: calc(max(var(--edge), env(safe-area-inset-top)) + 54px);
    padding-bottom: calc(var(--edge) + 44px + var(--safe-b)); }
  #tab-detail.active { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: space-evenly; gap: 12px; }   /* equal space above the countdown, between the blocks and under the note */
  #tab-detail .venue { display: contents; }
  #tab-detail .venue-country { margin-top: 0; }
  #tab-detail .events { margin-top: 0; padding-top: 4px; padding-bottom: 12px; }
  #tab-detail .venue-note { margin-top: 0; }
  /* the cards breathe with the screen height, so tall phones get taller cards rather than bigger gaps */
  #tab-detail .event { padding: clamp(14px, 3.6vh, 40px) 14px clamp(12px, 2.6vh, 28px); }
  #tab-detail .event-art { margin: 2px 0 clamp(8px, 1.8vh, 18px); }
  #tab-detail .event-heart { margin: clamp(10px, 2.2vh, 24px) 0 clamp(8px, 1.8vh, 18px); }
  #tab-detail .event-more { padding-top: clamp(12px, 3vh, 30px); }
  /* the fade at the bottom stays below the note */
  body.state-wedding #wedding::after { height: calc(var(--edge) + 40px + var(--safe-b)); }
}
@media (max-width: 640px) and (max-height: 740px) {
  #tab-detail .event { padding: 14px 12px 12px; }
  #tab-detail .event-art { height: clamp(34px, 6vh, 48px); margin: 2px 0 8px; }
  #tab-detail .event-title { margin: 6px 0 6px; font-size: 1.6rem; }
  #tab-detail .event-heart { margin: 10px 0 8px; }
  #tab-detail .event-more { padding-top: 12px; }
  #tab-detail .venue-country { font-size: 1.4rem; }
  #tab-detail .venue-note { font-size: .84rem; line-height: 1.55; }
}
@media (max-width: 640px) and (max-height: 620px) {
  .wedding-content:has(> #tab-detail.active) { padding-top: calc(max(var(--edge), env(safe-area-inset-top)) + 48px); padding-bottom: calc(var(--edge) + 36px + var(--safe-b)); }
  #tab-detail.active { gap: 8px; }
  #tab-detail .cd .num { font-size: 1.1rem; }
  #tab-detail .venue-country { font-size: 1.25rem; }
  #tab-detail .venue-sub { margin-top: 4px; }
  #tab-detail .event-title { font-size: 1.45rem; }
  #tab-detail .event-what { margin-top: 3px; }
  #tab-detail .events-dots { margin-top: 0; }
  #tab-detail .venue-note { font-size: .78rem; line-height: 1.5; }
}

/* ---------- Phones: a day's When / Where box ----------
   Tighter, so more of the day's page shows on the first screen, with the label, the big line and the small line
   still evenly spaced inside each half. */
@media (max-width: 640px) {
  #tab-event .ev-rule { margin-top: 10px; }
  #tab-event .ev-facts { margin-top: 16px; }
  .ev-facts .ev-fact { row-gap: 6px; padding: 16px 14px 12px; grid-template-rows: auto auto 30px; }
  .ev-facts .ev-label { margin-bottom: 2px; }
  .ev-facts .ev-sub, .ev-facts .ev-fact > .icon-links { height: 30px; }
  .ev-facts .icon-links { margin-top: 0; }
}

/* ---------- Day pages: quieter, chic info boxes ----------
   The day's subtitle ("The welcome party", "Your day off"…) and the matching line on the Details cards are set in
   small spaced capitals. When / Where and the dress code (Ladies / Gentlemen) share one look: a hairline box with
   a faint inner line, no colour fill, a small spaced label and a modest serif line, so they read as elegant
   notes rather than heavy panels. */
.ev-what, .event-what { font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; padding-left: .26em; color: var(--ink-2); }
.ev-what { margin-top: 2px; }

.ev-facts, .ev-dress { background: transparent; border: 1px solid var(--line); border-radius: 14px; position: relative; }
.ev-facts::before, .ev-dress::before { content: ''; position: absolute; inset: 5px; border: 1px solid var(--frame-a); border-radius: 10px; opacity: .55; pointer-events: none; }
.ev-facts .ev-main { font-size: 1.15rem; }

.ev-dress { max-width: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; margin: 20px 0 0; border-top: 1px solid var(--line); }
.ev-dress-row { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px 16px; border-bottom: 0; text-align: center; }
.ev-dress-row + .ev-dress-row { border-inline-start: 1px solid var(--line); }
.ev-dress-row .ev-label { margin: 0; }
.ev-dress-what { font-family: var(--serif); font-size: 1.05rem; line-height: 1.35; color: var(--ink); }
@media (max-width: 560px) {
  .ev-dress { grid-auto-flow: row; grid-template-columns: 1fr; }
  .ev-dress-row { display: flex; padding: 14px 14px 13px; gap: 4px; }
  .ev-dress-row + .ev-dress-row { border-inline-start: 0; border-top: 1px solid var(--line); }
  .ev-sec .ev-dress { margin-top: 16px; }
}

/* "One rule" (e.g. NO BLACK) is the last row of the dress-code box: full width under Ladies / Gentlemen, its
   label in the burgundy accent so the rule still stands out, quietly. */
.ev-dress { grid-auto-flow: row; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
.ev-dress-row.ev-dress-rule { grid-column: 1 / -1; border-inline-start: 0; border-top: 1px solid var(--line); }
.ev-dress-rule .ev-label { color: var(--accent); font-weight: 500; }
.ev-dress-rule .ev-dress-what { letter-spacing: .14em; text-transform: uppercase; padding-left: .14em; }
.ev-dress-rule .ev-avoid-note { font-size: .74rem; line-height: 1.55; color: var(--ink-2); margin: 2px auto 0; max-width: 26em; font-style: normal; }
@media (max-width: 560px) { .ev-dress { grid-template-columns: 1fr; } }

/* Phones too: When | Where and Ladies | Gentlemen sit side by side in one row (the one rule stays full width
   underneath), with slightly smaller type so each half fits its column. */
@media (max-width: 560px) {
  .ev-facts.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ev-facts.n2 .ev-fact + .ev-fact, .ev-facts.n2 .ev-fact:nth-child(2) { border-top: 0; border-inline-start: 1px solid var(--line); }
  .ev-facts .ev-fact { padding: 16px 8px 12px; align-content: start; }
  .ev-facts .ev-main { font-size: 1.02rem; }
  .ev-facts .ev-sub { font-size: .7rem; line-height: 1.4; }
  .ev-dress { grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
  .ev-dress-row { padding: 14px 10px 13px; justify-content: flex-start; }
  .ev-dress-row + .ev-dress-row { border-top: 0; border-inline-start: 1px solid var(--line); }
  .ev-dress-row.ev-dress-rule { border-top: 1px solid var(--line); border-inline-start: 0; }
  .ev-dress-what { font-size: .95rem; }
}

/* A touch more air under the small labels (WHEN / WHERE, LADIES / GENTLEMEN, ONE RULE), the same in every box */
.ev-facts .ev-label { margin-bottom: 6px; }
.ev-dress-row .ev-label { margin-bottom: 4px; }
@media (max-width: 640px) {
  .ev-facts .ev-label { margin-bottom: 6px; }
  .ev-facts .ev-fact { padding: 18px 8px 14px; }
  .ev-dress-row { padding: 16px 10px 15px; }
  .ev-dress-row .ev-label { margin-bottom: 4px; }
}

/* Dress code box: the one rule first, then Ladies and Gentlemen each on their own row (every screen size). */
.ev-dress, .ev-dress[style] { grid-template-columns: 1fr; }
.ev-dress-row.ev-dress-row { border-inline-start: 0; border-top: 0; }
.ev-dress-row + .ev-dress-row { border-top: 1px solid var(--line); }
.ev-dress-row.ev-dress-rule { border-top: 0; }

/* Line breaks written into content as \n (e.g. the one-rule note) break the line on phones only */
@media (min-width: 561px) { br.m-br { display: none; } }
@media (min-width: 561px) { .ev-dress-rule .ev-avoid-note { max-width: none; } }   /* one line on computers */
/* More room at the top and bottom of the dress-code box: above ONE RULE and under the Gentlemen line */
.ev-dress > .ev-dress-row:first-child { padding-top: 24px; }
.ev-dress > .ev-dress-row:last-child { padding-bottom: 22px; }
@media (max-width: 640px) {
  .ev-dress > .ev-dress-row:first-child { padding-top: 22px; }
  .ev-dress > .ev-dress-row:last-child { padding-bottom: 20px; }
}

/* ---------- Phones & small tablets: full-screen menu ----------
   A quiet full-screen sheet in the page colour. The logo and the menu button (now an ×) stay where they are;
   the pages are a single centred column of serif words, the current one in ink with a short hairline under it,
   the rest muted. Links fade up one after another; the page behind is covered, the bottom icons hide, and
   reduced-motion turns the movement off. Touch targets are full-width rows at least 48px tall. */
@media (max-width: 820px) {
  #persistent-header.menu-open { z-index: 35; }
  .hdr-brand, .menu-btn { position: relative; z-index: 2; }
  .site-nav {
    position: fixed; inset: 0; z-index: 1; top: 0; left: 0; right: 0;
    display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: clamp(2px, 1.2vh, 10px);
    padding: calc(max(var(--edge), env(safe-area-inset-top)) + 64px) var(--edge) calc(var(--edge) + 48px + var(--safe-b));
    background: var(--bg); border: 0; box-shadow: none;
    opacity: 0; visibility: hidden; transform: none;
    transition: opacity .4s var(--ease), visibility .4s;
    overscroll-behavior: contain; overflow-y: auto;
  }
  #persistent-header.menu-open .site-nav { opacity: 1; visibility: visible; transform: none; }
  .site-link {
    padding: clamp(8px, 1.6vh, 14px) 0; min-height: 48px; text-align: center; border: 0 !important;
    font-family: var(--serif); font-size: clamp(1.7rem, 7.4vw, 2.3rem); line-height: 1.1; letter-spacing: .02em; text-transform: none; color: var(--muted);
    opacity: 0; transform: translateY(10px);
    transition: opacity .5s var(--ease), transform .5s var(--ease), color .3s;
  }
  #persistent-header.menu-open .site-link { opacity: 1; transform: none; transition-delay: calc(.08s + var(--i, 0) * .045s), calc(.08s + var(--i, 0) * .045s), 0s; }
  .site-link.active, .site-link:active { color: var(--ink); }
  .site-link + .site-link { border-top: 0; }
  body.menu-open :is(#controls, #bottom-nav, #wedding-scrollbar, #journey-instruction) { opacity: 0 !important; visibility: hidden !important; transition: opacity .3s, visibility .3s; }
  #persistent-header.menu-open { background: transparent; }
}
@media (max-width: 820px) and (prefers-reduced-motion: reduce) {
  .site-link { transform: none; transition: opacity .2s; }
}
/* Phone menu links in spaced capitals (a touch smaller so the capitals stay light) */
@media (max-width: 820px) {
  .site-link { text-transform: uppercase; letter-spacing: .14em; padding-left: .14em; font-size: clamp(1.35rem, 5.8vw, 1.8rem); }
}
/* Phone menu colours: the current page in full white (full ink on light paper), the others a soft grey */
@media (max-width: 820px) {
  .site-link { color: color-mix(in srgb, var(--ink) 42%, var(--bg)); }
  html.dark .site-link.active { color: #fff; }
  html.dark .site-link.active::after { background: #fff; }
}
/* the current page one step heavier: the serif has a single weight, so a hairline stroke thickens it gently */
@media (max-width: 820px) {
  .site-link.active { -webkit-text-stroke: .45px currentColor; }
}

/* Long, scrolling pages (Travel, Stay, Dine, Do, FAQ, Menu, Seat) start with a little more air under the
   header on phones, the same on every page. (Details fills the screen on its own; a day's page opens with its
   back link.) */
@media (max-width: 640px) {
  .tab-content:not(#tab-detail):not(#tab-event) > .section-title:first-child { margin-top: clamp(18px, 3.4vh, 32px); }
}

/* ---------- Phones: the illustrated map ----------
   Edge to edge with no box: the map runs the full screen width and melts into the page at the left and right
   (and very softly at the top and bottom), so it reads as part of the page rather than a framed picture.
   The caption and the legend keep the page margins, with even room above and below them. */
@media (max-width: 640px) {
  .tv-map { margin: 22px calc(-1 * var(--edge)) 34px; padding: 0; border: 0; border-radius: 0; }
  .tv-map::before { display: none; }
  .tv-map svg { border-radius: 0;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
    mask-composite: intersect; }
  .tv-map .mp-caption { padding: 14px var(--edge) 0; border-top: 0; min-height: 0; }
  .tv-map .mp-legend { padding: 14px var(--edge) 0; gap: 10px 18px; }
}

/* ---------- Places (room blocks, hotels, restaurants, things to do) ----------
   The same quiet box as When / Where and the dress code: a hairline outline with a faint inner line and no
   colour fill. The "Room block" tag becomes a small spaced label in the burgundy accent (like ONE RULE)
   instead of a pill. */
.place, .place-block { position: relative; background: transparent; border: 1px solid var(--line); border-radius: 14px; }
.place::before { content: ''; position: absolute; inset: 5px; border: 1px solid var(--frame-a); border-radius: 10px; opacity: .55; pointer-events: none; }
.place > * { position: relative; }
.place-badge { border: 0; border-radius: 0; padding: 0 0 0 .32em; margin-bottom: 10px; font-size: .58rem; letter-spacing: .32em; font-weight: 500; color: var(--accent); }

/* ==========================================================================
   TYPE & SPACING SYSTEM (audit, applies everywhere and wins over the older rules above)
   One scale for every page. Each text role uses one size, one weight and one letter-spacing:
     h1      page titles (TRAVEL NOTES, WHERE TO STAY…)              serif, caps
     h2      section titles (Flight, Our room blocks, Formal Florals…) serif
     h3      card titles (place names, program items)                 serif
     h4      values inside boxes (April 1st 2027, Dunara, Ladies…)    serif
     lead    page intros                                               serif italic
     body    paragraphs and lists                                      sans 400, bold = 600
     small   notes, hints, sub-lines                                   sans 400
     caps    small spaced capitals that read as subtitles (THE WELCOME PARTY, APRIL 1ST 2027)
     eyebrow the smallest spaced capitals: labels and kickers (WHEN, DRESS CODE, ROOM BLOCK)
   Weights: the serif has one weight (400). Sans is 400; labels that carry the accent (ONE RULE, ROOM BLOCK)
   are 500; bold inside text is 600. Nothing is lighter than 10px.
   Spacing uses one 4px-based scale: 4 · 8 · 12 · 16 · 24 · 32 · 48 · 64.
   ========================================================================== */
:root {
  --fs-eyebrow: .66rem; --fs-caps: .72rem; --fs-small: .76rem; --fs-body: .875rem; --fs-lead: 1.15rem;
  --fs-h4: 1.12rem; --fs-h3: 1.4rem; --fs-h2: 1.75rem;
  --ls-eyebrow: .3em; --ls-caps: .24em;
  --sp-section: 64px;  /* between sections of a page */
  --sp-head: 16px;     /* section title -> its content */
  --sp-list: 16px;     /* between boxes in a list */
  --box-py: 24px; --box-px: 20px;
}
@media (max-width: 640px) {
  :root { --fs-eyebrow: .72rem; --fs-caps: .8rem; --fs-small: .84rem; --fs-body: .95rem; --fs-lead: 1.14rem;
    --fs-h4: 1.08rem; --fs-h3: 1.43rem; --fs-h2: 1.6rem;
    --sp-section: 48px; --sp-head: 16px; --sp-list: 12px; --box-py: 20px; --box-px: 16px; }
}

/* --- type roles --- */
.sub-title, .tv-sec .tv-title, .ev-sec-main, .ev-next-title, .places .sub-title { font-size: var(--fs-h2); line-height: 1.2; letter-spacing: .01em; }
.venue-country { font-size: var(--fs-h2); }
.place-name, .tl-desc { font-size: var(--fs-h3); line-height: 1.25; }
.ev-facts .ev-main, .ev-dress-what, .tv-stat-v { font-size: var(--fs-h4); line-height: 1.3; }
.places-intro { font-size: var(--fs-lead); line-height: 1.55; }
.tv-body, .ev-sec-note, .venue-note, .place-note, .tv-list li, .small-note:not(.places-group-note) { font-size: var(--fs-body); line-height: 1.7; }
.tv-body b, .tv-list li b, .ev-sec-note b, .place-note b, .faq-a b { font-weight: 600; color: var(--ink); }
.tl-sub, .places-group-note, .ev-avoid-note, .ev-dress-rule .ev-avoid-note, .mp-hint, .ev-facts .ev-sub, .seat-empty { font-size: var(--fs-small); line-height: 1.55; letter-spacing: .01em; }
.tl-time { font-size: var(--fs-small); letter-spacing: .12em; }
.ev-what, .event-what, .event-date, .event-venue, .venue-sub, .ev-back, .event-more, .ev-quick-btn {
  font-size: var(--fs-caps); letter-spacing: var(--ls-caps); text-transform: uppercase; }
.venue-sub { padding-left: var(--ls-caps); }
.ev-label, .ev-eyebrow, .event-day, .place-area, .mp-key, .tv-stat-l, .ev-next-day, .event-tbd, .place-badge, .ev-avoid-label {
  font-size: var(--fs-eyebrow); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; font-weight: 400; }
.ev-dress-rule .ev-label, .place-badge, .ev-avoid-label { font-weight: 500; color: var(--accent); }
.cd .lbl { font-size: var(--fs-eyebrow); letter-spacing: .14em; }
@media (max-width: 380px) { .cd .lbl { font-size: .62rem; letter-spacing: .1em; } }

/* --- section rhythm: icon -> eyebrow -> title -> content, the same on every page --- */
.ev-sec, #tab-event .ev-sec, .tv-sec { margin-top: var(--sp-section); }
.tv-sec:first-of-type { margin-top: calc(var(--sp-section) * .75); }
.tv-icon, .tv-icon:first-child { margin: 0 auto 10px; }
.ev-sec-icon { margin: 0 auto 8px; }
.tv-sec .tv-title { margin: 0 0 var(--sp-head); }
.ev-eyebrow { margin-bottom: 6px; }
.ev-sec-main { margin-bottom: 0; }
.ev-sec .ev-dress, .ev-sec .ev-sec-note, .ev-sec .timeline, .ev-sec .places, .tv-sec .tv-map, .tv-sec .tv-stats, .tv-sec .tv-list { margin-top: var(--sp-head); }
.tv-sec .tv-body + .tv-body { margin-top: 12px; }
.section-title { margin-bottom: 12px; }
.places-intro { margin: 0 auto; }
.places .sub-title { margin: var(--sp-section) 0 6px; }
.places .sub-title::before { margin-bottom: var(--sp-head); }
.places-group-note { margin: 0 0 var(--sp-head); }
.places .sub-title + .place-list { margin-top: var(--sp-head); }
.place-list { gap: var(--sp-list); }
#tab-event .ev-facts { margin-top: 24px; }

/* --- boxes: one padding and one inner rhythm --- */
.place { padding: var(--box-py) var(--box-px); }
.place-badge { margin-bottom: 8px; }
.place-name { margin: 0; }
.place-area { margin-top: 6px; }
.place-note { margin: 10px auto 0; }
.place .icon-links { margin-top: 10px; }
.ev-facts .ev-fact { padding: var(--box-py) var(--box-px) calc(var(--box-py) - 6px); row-gap: 8px; }
.ev-facts .ev-label { margin-bottom: 0; }
.ev-dress-row { padding: calc(var(--box-py) - 4px) var(--box-px); gap: 6px; }
.ev-dress > .ev-dress-row:first-child { padding-top: var(--box-py); }
.ev-dress > .ev-dress-row:last-child { padding-bottom: var(--box-py); }
.ev-dress-row .ev-label { margin-bottom: 0; }
.tv-stat { background: transparent; position: relative; padding: 16px 8px 14px; }
.tv-stat::before { content: ''; position: absolute; inset: 4px; border: 1px solid var(--frame-a); border-radius: 10px; opacity: .55; pointer-events: none; }
@media (max-width: 640px) {
  .ev-facts .ev-fact { padding: var(--box-py) 8px calc(var(--box-py) - 6px); }
  .ev-dress-row { padding-left: 12px; padding-right: 12px; }
}

/* --- room blocks: the one box that steps forward, quietly ---
   A soft blush wash, a pink inner line and a burgundy-tinted outline set them apart from the other places;
   the "Room block" label sits between two short hairlines. */
.place.place-block { background: color-mix(in srgb, var(--pink) 12%, var(--bg)); border-color: color-mix(in srgb, var(--accent) 24%, transparent); }
.place.place-block::before { border-color: var(--frame-b); opacity: 1; }
html.dark .place.place-block { background: color-mix(in srgb, var(--pink) 7%, var(--bg)); }
.place-block .place-badge { display: inline-flex; align-items: center; gap: 10px; }
.place-block .place-badge::before, .place-block .place-badge::after { content: ''; width: 16px; height: 1px; background: currentColor; opacity: .45; }
.faq-q, .faq-a > div { font-size: var(--fs-body); }
.faq-q { padding: 16px 2px; }
.event-venue, .event-venue-name { letter-spacing: var(--ls-caps); }
.place { padding-bottom: calc(var(--box-py) - 8px); }   /* the icon row carries its own 38px tap height */

/* ---------- Phones: day cards on Details ----------
   The arches size to their content with even, modest gaps (drawing → day → title → what → heart → venue →
   Details), so the words read as one group instead of being spread across a tall card. */
@media (max-width: 640px) {
  #tab-detail .events { grid-auto-columns: 82%; padding-left: 9%; padding-right: 9%; gap: 12px; }
  #tab-detail .event { min-height: 0; justify-content: flex-start;
    padding: clamp(40px, 6vh, 52px) 18px clamp(20px, 3vh, 26px); }
  #tab-detail .event-art { margin: 0 0 clamp(12px, 1.8vh, 16px); }
  #tab-detail .event-title { margin: 10px 0 8px; }
  #tab-detail .event-what { margin-top: 4px; }
  #tab-detail .event-heart { margin: clamp(16px, 2.4vh, 22px) 0 clamp(12px, 1.8vh, 16px); padding-top: 0; }
  #tab-detail .event-place { margin-top: 6px; }
  #tab-detail .event-more { margin-top: auto; padding-top: clamp(20px, 3vh, 26px); }
}
@media (max-width: 640px) and (max-height: 620px) {
  #tab-detail .event { min-height: 0; padding: 16px 12px 12px; }
  #tab-detail .event-heart { padding-top: 0; margin-top: 10px; }
  #tab-detail .event-more { padding-top: 12px; }
}

/* Day cards: what it is ("The welcome party") and where ("Dunara" / "Anywhere, anytime") in bold white */
.event :is(.event-what, .event-venue, .event-venue-name, .event-tbd) { color: #fff; font-weight: 600; }

/* "Details →": the arrow drifts gently back and forth, all the time, so guests notice the card opens. A slow,
   even ease in and out (no pauses, no jolts). Hovering the card doesn't change it: same drift, same place.
   It stays still for anyone who prefers reduced motion. */
@keyframes nudgeX { from { transform: translateX(0); } to { transform: translateX(5px); } }
.event-more .ms { animation: nudgeX 1.1s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
@media (prefers-reduced-motion: reduce) { .event-more .ms { animation: none !important; } }

/* Returning guests (passcode remembered on this device) go straight to the site: the envelope is never shown.
   If the saved key no longer works, app.js removes .returning and the envelope appears as usual. */
html.returning #gate { display: none; }

/* Day cards: the "Day 1 · Thursday · April 1" line a step smaller than other eyebrows, so it sits quietly above the title */
.event .event-day { font-size: calc(var(--fs-eyebrow) * .88); letter-spacing: .26em; padding-left: .26em; }

/* Day cards: the venue ("Dunara", "Solaz") wears the same dashed pill as "Anywhere, anytime", so the three
   cards end alike. The venue link still opens the venue; the pill's border warms to pink on hover. */
.event :is(.event-venue, .event-venue-name) {
  display: inline-block; font-size: var(--fs-eyebrow); letter-spacing: var(--ls-eyebrow); white-space: nowrap;
  border: 1px dashed var(--sage-deep); border-radius: 999px; padding: 7px 14px 7px calc(14px + var(--ls-eyebrow));
  background: none; transition: border-color .35s var(--ease); }
.event a.event-venue:hover { background: none; border-color: var(--accent); }
@media (max-width: 560px) { .event :is(.event-venue, .event-venue-name) { letter-spacing: .2em; padding-left: calc(14px + .2em); } }

/* Day cards: "Details →" a step smaller, so it reads as a quiet link under the venue */
.event .event-more { font-size: calc(var(--fs-caps) * .76); gap: 6px; }
.event .event-more .ms { font-size: .78rem; }
/* The arrow's ink sits a hair (~0.4px) above the caps' centre at the phone type size; this sub-pixel nudge
   centres it exactly. `translate` (not `transform`) so it stacks with the drift animation. */
@media (max-width: 640px) { .event .event-more .ms { translate: 0 .03em; } }

/* Day page facts (When / Where): three rows that line up exactly across the two boxes (label · value ·
   detail line or the venue's icon buttons), with the same gap between every row. The detail row is one text
   line tall in both boxes; the round icon buttons keep their full tap area but overhang it, so the icons sit
   on the same line as the time next to them. */
.ev-facts .ev-fact { grid-template-rows: auto auto var(--fact-row3, 22px); row-gap: 10px; align-content: center; }
.ev-facts .ev-label, .ev-facts .ev-main { line-height: 1.25; }
.ev-facts .ev-sub, .ev-facts .ev-fact > .icon-links { height: var(--fact-row3, 22px); margin: 0; display: flex; align-items: center; justify-content: center; line-height: 1.3; }
.ev-facts .ev-fact > .icon-links .icon-link { margin: -6px 0; }
@media (max-width: 640px) { .ev-facts .ev-fact { row-gap: 8px; } }

/* Day page: the Dress code section follows the When / Where box more closely than a full section gap */
#tab-event .ev-facts + .ev-sec { margin-top: calc(var(--sp-section) * .6); }

/* Day page: When / Where sit in the same framed box as the Dress code (outer line + soft inner frame), with a
   divider between them: a vertical line, on phones too (When and Where stay side by side, like the box below).
   The venue's "Get directions" is a small dark-filled pill button (no border) that fills pink on hover; when it's there the
   third row is the button's height, so the time in When stays centred on the same line as the button. */
#tab-event .ev-facts { background: transparent; border: 1px solid var(--line); border-radius: 14px; }
#tab-event .ev-facts .ev-fact { border: 0; padding: var(--box-py) var(--box-px); }
#tab-event .ev-facts .ev-fact + .ev-fact { border-inline-start: 1px solid var(--line); }
#tab-event .ev-facts .ev-fact + .ev-fact { border-top: 0; }
#tab-event .ev-facts.has-dir { --fact-row3: 26px; }
.ev-dir-btn { display: inline-flex; align-items: center; justify-content: center; height: 26px; padding: 0 12px 0 calc(12px + .2em);
  border: 0; border-radius: 999px; background: var(--on-accent); color: var(--accent); text-decoration: none;
  font-size: .5rem; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; transition: background .3s, color .3s;
  /* centre the capitals themselves, not the font's line box: trim the text to cap height → baseline, then the
     flex centring puts the letters dead centre. Measured Nov 2 at 8px (.5rem) on 2x/3x/4x screens: equal space above
     and below the capitals, with or without text-box support, and equal space left and right (the extra .2em of
     left padding balances the letter-spacing after the last letter). Re-measure if the size changes: below 8px the
     text sits about 1px high. */
  line-height: 1; text-box: trim-both cap alphabetic; }
@media (hover: hover) { .ev-dir-btn:hover { background: var(--accent); color: var(--bg); } }
.ev-dir-btn:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

/* Dress code: the line under "No black" in the same colour as the program's sub-lines ("Shuttles roll in, …") */
.ev-avoid-note, .ev-dress-rule .ev-avoid-note { color: var(--muted); }

/* Program timeline (every day): a little more room between the dot line and the time / title / sub-line */
.tl-item > div:last-child { padding-inline-start: 6px; }

/* Dress code: "Ladies" and "Gentlemen" labels match "One rule" (pink, medium weight) */
.ev-dress-row .ev-label { color: var(--accent); font-weight: 500; }


/* ---------- Every screen: the Details page balances itself ----------
   Tablets, laptops and big monitors get the same rule phones already have: the page is four blocks (countdown ·
   Los Cabos · the day cards · the Easter note) and the free height between the header and the bottom bar is
   shared evenly above, between and below them, so a tall screen never leaves everything stuck at the top with
   an empty half underneath. If the screen is too short for that, the page simply scrolls. */
@media (min-width: 641px) {
  .wedding-content:has(> #tab-detail.active) { display: flex; flex-direction: column; min-height: 100%;
    padding-bottom: calc(var(--edge) + 128px + var(--safe-b)); }
  #tab-detail.active { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: space-evenly; gap: clamp(18px, 3.2vh, 44px); }
  #tab-detail .venue { display: contents; }
  #tab-detail .venue-country { margin-top: 0; }
  #tab-detail .events { margin-top: 0; }
  #tab-detail .venue-note { margin-top: 0; }
}

/* ---------- Big screens: everything grows a little with the screen ----------
   On large monitors the type (and everything sized in rem) steps up smoothly from 16px to 19px, and the day
   cards get wider, keeping their arch: the top corners stay a half circle of the card's own width. */
@media (min-width: 1280px) and (min-height: 820px) {
  html { font-size: clamp(16px, calc(.5vw + .5vh + 3px), 19px); }
  .events { --events-w: min(100vw - 2 * var(--edge), clamp(1000px, 60vw, 1240px), 104vh); gap: clamp(18px, 1.4vw, 26px); }
  .event { --arch: calc((var(--events-w) - 2 * clamp(18px, 1.4vw, 26px)) / 3 * .59);
    border-radius: var(--arch) var(--arch) 14px 14px; }
  .event::before { border-radius: calc(var(--arch) - 6px) calc(var(--arch) - 6px) 9px 9px; }
  .wedding-content { max-width: 680px; }
}

/* Quick-link pills on a day's page ("Where to eat", "Things to do"): even room on both sides. The icon side
   is 2px tighter because the glyph carries its own side bearing, and the text side gives back the trailing
   letter-spacing, so the ink sits centred in the pill. */
html[lang] .ev-quick-btn { min-height: 40px; padding-block: 0; padding-inline: 14px calc(16px - .24em); gap: 8px; line-height: 1.2; }
html[lang] .ev-quick-btn .ms { margin-block: -2px; }
@media (max-width: 560px) {
  html[lang] .ev-quick-btn { padding-inline: 10px calc(12px - .14em); }
}

/* ---------- Short laptop screens: the Details cards tighten with the height ----------
   Between ~700 and ~880px tall the cards' inner spacing and drawing scale with the screen height, so the
   countdown, Los Cabos, all three cards and the note fit between the header and the bottom bar. */
@media (min-width: 641px) and (max-height: 880px) {
  #tab-detail.active { gap: clamp(12px, 2.4vh, 28px); }
  #tab-detail .event { padding: clamp(16px, 3.4vh, 34px) 20px clamp(14px, 2.6vh, 30px); }
  #tab-detail .event-art { height: clamp(36px, 6vh, 54px); margin: 2px 0 clamp(8px, 1.4vh, 14px); }
  #tab-detail .event-title { margin: clamp(6px, 1.2vh, 12px) 0 clamp(6px, 1vh, 10px); }
  #tab-detail .event-heart { margin: clamp(8px, 1.8vh, 18px) 0 clamp(6px, 1.4vh, 14px); }
  #tab-detail .event-more { padding-top: clamp(10px, 2.2vh, 22px); }
  #tab-detail .venue-sub { margin-top: 4px; }
  .wedding-content:has(> #tab-detail.active) { padding-top: calc(max(var(--edge), env(safe-area-inset-top)) + clamp(60px, 9vh, 86px)); }
}

/* ---------- Place cards (Stay, Dine, Things to Do, and the lists on a day's page) ----------
   More room inside each card and between cards, with an even inner rhythm: name → area → note → icons. */
.place { padding: calc(var(--box-py) + 8px) calc(var(--box-px) + 12px) calc(var(--box-py) + 4px); }
.place-list { gap: calc(var(--sp-list) + 8px); }
.place-area { margin-top: 8px; }
.place-note { margin-top: 14px; }
.place .icon-links { margin-top: 14px; }
@media (max-width: 640px) {
  .place { padding: calc(var(--box-py) + 4px) calc(var(--box-px) + 6px) var(--box-py); }
  .place-list { gap: calc(var(--sp-list) + 6px); }
  .place-note { margin-top: 12px; }
  .place .icon-links { margin-top: 12px; }
}

/* Short laptop screens (≤ 760px tall): a slightly smaller countdown and title, and more room above the bottom
   bar, so the Easter note never sits under the bottom fade. */
@media (min-width: 641px) and (max-height: 760px) {
  .wedding-content:has(> #tab-detail.active) { padding-bottom: calc(var(--edge) + 150px + var(--safe-b)); }
  #tab-detail .cd .num { font-size: 1.6rem; }
  #tab-detail .venue-country { font-size: 1.6rem; }
}

/* "Explore" (homepage): the trailing letter-spacing of the last capital is given back on the left, so the
   word sits centred in its frame. */
.action-btn { padding: 13px 26px 13px calc(26px + .3em); }
@media (max-width: 640px) {
  .action-btn { padding: 11px 24px 11px calc(24px + .3em); }
}

/* ---------- Wedding-only passcode: no Intro → Wedding timeline ----------
   Without the journey the bottom bar would only link Intro and Wedding, which the header logo and the
   Explore button already do, so it's hidden on every screen. Only the sound icon stays at the
   bottom, so the bottom fade and the room kept for the bar shrink to match. */
body.no-journey #bottom-nav { display: none; }
@media (min-width: 641px) {
  body.no-journey.state-wedding #wedding::after { height: calc(var(--edge) + 72px + var(--safe-b)); background: linear-gradient(to bottom, transparent, var(--bg) 55%); }
  body.no-journey .wedding-content { padding-bottom: calc(var(--edge) + 96px + var(--safe-b)); }
  body.no-journey .wedding-content:has(> #tab-detail.active) { padding-bottom: calc(var(--edge) + 64px + var(--safe-b)); }
}
