/*
 * Template 03: Fine Line (version 1.0.0)
 * Minimalist. Paper white and black ink, hairlines everywhere: ruled sections with a sticky index
 * column, a ruled hero, photo corner marks, contact-sheet gallery, table-style party, schedule and
 * gift rows, a line-drawn map and a ruled countdown. Photos are black and white until hovered.
 * Instrument Serif for large type, Inter for everything else. Fixed layout. Fonts and images are
 * local files, so this works offline.
 * Motion: lines that draw themselves, a masked name reveal, photo wipes, parallax, a vertical
 * progress rule, rows that underline on hover, a drawing map and a ticking countdown.
 * Everything stops for reduced motion.
 */

@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/instrument-serif-normal-400.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url('../assets/fonts/instrument-serif-italic-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('../assets/fonts/inter-normal-400-600.woff2') format('woff2'); }

:root {
  --paper: #F7F6F2;
  --white: #FFFFFF;
  --ink: #111111;
  --muted: #625F5A;
  --rule: #CFCBC3;
  --faint: #E6E3DC;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-draw: cubic-bezier(0.65, 0, 0.35, 1);
  --wrap: 1240px;
  --label: 190px;
  --bar: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 8px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.container { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }

/* Photos are black and white until hovered. */
.hero-frame img, .story-frame img, .gallery-item img, .person img, .band-media img { filter: grayscale(1) contrast(1.04); transition: filter 700ms ease; }

/* ---------- Scroll progress: a vertical rule down the left edge ---------- */
.progress { position: fixed; top: 0; bottom: 0; left: 0; width: 3px; z-index: 60; pointer-events: none; }
.progress span { display: block; width: 100%; height: 100%; background: var(--ink); transform-origin: 50% 0; transform: scaleY(var(--progress, 0)); }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(247, 246, 242, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--ink); }
.topbar-inner { width: min(var(--wrap), 100% - 48px); margin-inline: auto; height: var(--bar); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-family: var(--serif); font-size: 1.9rem; line-height: 1; text-decoration: none; letter-spacing: .01em; }
.nav { display: flex; align-items: center; gap: 30px; font-size: .7rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; }
.nav a { position: relative; text-decoration: none; padding: 6px 0; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform 400ms var(--ease-out); }

/* ---------- Buttons: ink fills, paper sweeps up on hover ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--ink); background-color: var(--ink); background-image: linear-gradient(var(--paper), var(--paper)); background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 0; color: var(--paper); font: 500 .72rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; text-decoration: none; padding: 20px 34px; border-radius: 0; cursor: pointer; transition: background-size 450ms var(--ease-out), color 300ms ease, transform 160ms var(--ease-out); }
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 12px 22px; font-size: .68rem; }
.btn-outline { background-color: transparent; background-image: linear-gradient(var(--ink), var(--ink)); color: var(--ink); }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: .7rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; padding-bottom: 4px; border-bottom: 1px solid var(--ink); }
.link-arrow::after { content: '\2192'; font-size: 1rem; letter-spacing: 0; transition: transform 300ms var(--ease-out); }

/* ---------- Ruled sections ---------- */
.section { position: relative; padding-block: clamp(4rem, 8vw, 7rem); }
.section::before, .footer::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--ink); transform-origin: 0 50%; }
.sec-grid { display: grid; grid-template-columns: var(--label) 1fr; align-items: start; }
.sec-label { position: sticky; top: calc(var(--bar) + 28px); display: grid; gap: 6px; padding-right: 16px; }
.idx::before { content: counter(sec, decimal-leading-zero); font-family: var(--serif); font-style: italic; font-size: 2.8rem; line-height: 1; }
.sec-name { font-size: .68rem; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.sec-body { border-left: 1px solid var(--rule); padding-left: clamp(24px, 5vw, 72px); min-width: 0; }
main { counter-reset: sec; }
.section { counter-increment: sec; }
.section h2, .hero h1 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.section h2 { font-size: clamp(2.5rem, 5.4vw, 4.4rem); line-height: 1.04; margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.lead { max-width: 560px; color: var(--muted); margin: -1rem 0 2.25rem; }

/* Corner marks around photos (crop marks) */
.marks { position: relative; }
.marks::before { content: ''; position: absolute; inset: -12px; z-index: 2; pointer-events: none; background:
  linear-gradient(var(--ink), var(--ink)) 0 0 / 22px 1px, linear-gradient(var(--ink), var(--ink)) 0 0 / 1px 22px,
  linear-gradient(var(--ink), var(--ink)) 100% 0 / 22px 1px, linear-gradient(var(--ink), var(--ink)) 100% 0 / 1px 22px,
  linear-gradient(var(--ink), var(--ink)) 0 100% / 22px 1px, linear-gradient(var(--ink), var(--ink)) 0 100% / 1px 22px,
  linear-gradient(var(--ink), var(--ink)) 100% 100% / 22px 1px, linear-gradient(var(--ink), var(--ink)) 100% 100% / 1px 22px;
  background-repeat: no-repeat; }

/* ---------- Hero ---------- */
.hero { padding: 28px 0 72px; }
.hero-meta { position: relative; display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; font-size: .7rem; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; }
.hero-meta::after, .hero-cells::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform-origin: 0 50%; }
.hero h1 { font-size: clamp(3.6rem, 12.6vw, 11.5rem); line-height: .96; letter-spacing: -.025em; margin: clamp(1.5rem, 4vw, 3rem) 0 clamp(1.5rem, 3vw, 2.5rem); overflow-wrap: anywhere; }
.hero-cells { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.hero-cells::before { bottom: 0; }
.cell { display: grid; gap: 4px; align-content: start; padding: 16px 22px 18px; border-left: 1px solid var(--rule); }
.cell:first-child { border-left: 0; padding-left: 0; }
.cell-label { font-size: .64rem; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.cell-value { font-size: 1.05rem; line-height: 1.4; }
.cell-value b { font-family: var(--serif); font-weight: 400; font-size: 1.8rem; line-height: 1; }
.cell-arrow { display: inline-block; height: 40px; text-decoration: none; }
.down { display: block; position: relative; width: 1px; height: 36px; background: var(--ink); }
.down::after { content: ''; position: absolute; left: -4px; bottom: 0; width: 8px; height: 8px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); transform: rotate(45deg); }
.hero-photo { margin: clamp(2.25rem, 5vw, 4rem) 12px 0; }
.hero-frame { position: relative; aspect-ratio: 21 / 9; overflow: hidden; background: var(--faint); }
.hero-frame img { position: absolute; left: 0; top: -9%; width: 100%; height: 118%; object-fit: cover; will-change: transform; }

/* ---------- Our story ---------- */
.story-body { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.story-photo { margin: 12px; }
.story-frame { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--faint); }
.story-frame img { position: absolute; left: 0; top: -6%; width: 100%; height: 112%; object-fit: cover; will-change: transform; }
.prose { display: grid; gap: 1.2em; color: var(--muted); }
.prose p { max-width: 56ch; }
.story-text h2 { margin-bottom: 1.5rem; }

/* ---------- Band: ruled frame and countdown over a photo ---------- */
.band { position: relative; isolation: isolate; overflow: hidden; color: #fff; padding-block: clamp(4.5rem, 10vw, 8rem); }
.band-media { position: absolute; inset: -18% 0; z-index: -2; will-change: transform; }
.band-media img { width: 100%; height: 100%; object-fit: cover; }
.band::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(17, 17, 17, .58); }
.band-inner { position: relative; border: 1px solid rgba(255, 255, 255, .75); padding: clamp(28px, 5vw, 52px) 0 0; display: grid; justify-items: center; gap: 18px; }
.band-label { font-size: .7rem; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; }
.countdown { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255, 255, 255, .75); }
.countdown li { display: grid; justify-items: center; padding: clamp(18px, 3vw, 32px) 8px; border-left: 1px solid rgba(255, 255, 255, .45); overflow: hidden; }
.countdown li:first-child { border-left: 0; }
.countdown b { font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 9vw, 7rem); line-height: 1; font-variant-numeric: tabular-nums; }
.countdown span { font-size: .66rem; font-weight: 500; letter-spacing: .28em; text-transform: uppercase; opacity: .85; }

/* ---------- Wedding party: a ruled table ---------- */
.party-list { border-top: 1px solid var(--ink); counter-reset: p; }
.person { position: relative; counter-increment: p; display: grid; grid-template-columns: 40px 64px 1fr auto; align-items: center; gap: 22px; padding: 14px 0; background-image: linear-gradient(var(--ink), var(--ink)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0 1px; transition: background-size 600ms var(--ease-out), padding 500ms var(--ease-out); }
.person::before { content: counter(p, decimal-leading-zero); font-size: .7rem; font-weight: 500; letter-spacing: .16em; color: var(--muted); }
.person::after, .event::after, .gift-item::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--rule); transform-origin: 0 50%; }
.person img { width: 64px; height: 64px; object-fit: cover; }
.person h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.1; }
.person-role { font-size: .68rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); text-align: right; }

/* ---------- Gallery: contact sheet ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-left: 1px solid var(--rule); counter-reset: g; }
.gallery-item { position: relative; counter-increment: g; padding: 16px 16px 44px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); cursor: zoom-in; transition: background-color 400ms ease; }
.gallery-item::after { content: counter(g, decimal-leading-zero); position: absolute; left: 16px; bottom: 14px; font-size: .68rem; font-weight: 500; letter-spacing: .2em; color: var(--muted); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.gallery-item:focus-visible { outline-offset: -3px; }
.lb { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(247, 246, 242, .97); opacity: 0; visibility: hidden; transition: opacity 300ms ease, visibility 0s linear 300ms; }
.lb.open { opacity: 1; visibility: visible; transition: opacity 300ms ease; }
.lb img { max-width: min(90vw, 1100px); max-height: 82vh; width: auto; height: auto; border: 1px solid var(--ink); padding: 12px; background: #fff; transform: translateY(14px); transition: transform 500ms var(--ease-out); }
.lb.open img { transform: none; }
.lb button { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: 300 1.6rem/1 var(--sans); cursor: pointer; transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out); }
.lb button:active { transform: scale(0.94); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; margin-top: -26px; }
.lb-next { right: 18px; top: 50%; margin-top: -26px; }
.lb-count { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; font-size: .7rem; font-weight: 500; letter-spacing: .28em; }

/* ---------- Schedule ---------- */
.timeline { border-top: 1px solid var(--ink); }
.event { position: relative; display: grid; grid-template-columns: 150px 1fr 1.5fr; align-items: baseline; gap: 12px 24px; padding: 22px 0; background-image: linear-gradient(var(--ink), var(--ink)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0 1px; transition: background-size 600ms var(--ease-out), padding 500ms var(--ease-out); }
.event-time { font-family: var(--serif); font-style: italic; font-size: 2.1rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.event h3 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1.15; }
.event p { color: var(--muted); }

/* ---------- Venue and map ---------- */
.venue-grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.venue-card { position: relative; display: grid; justify-items: start; gap: 4px; padding: 24px 0 30px 56px; border-top: 1px solid var(--ink); }
.venue-mark { position: absolute; left: 0; top: 24px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--ink); font-size: .8rem; font-weight: 600; letter-spacing: .06em; }
.venue-label { font-size: .66rem; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.venue-card h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.1; }
.venue-time { font-family: var(--serif); font-style: italic; font-size: 1.4rem; line-height: 1.3; }
.venue-address { white-space: pre-line; color: var(--muted); margin-bottom: 12px; }
.venue-map { position: relative; border: 1px solid var(--ink); background: var(--white); aspect-ratio: 6 / 5; overflow: hidden; }
.venue-map svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-grid { fill: none; stroke: var(--faint); stroke-width: 1; }
.map-blocks { fill: none; stroke: #8E8A82; stroke-width: 1; }
.map-water { fill: none; stroke: #8E8A82; stroke-width: 1.2; }
.map-road { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.map-route { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.pin circle { fill: var(--ink); }
.pin text { fill: #fff; font: 600 13px var(--sans); }
.map-north path, .map-scale path { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.map-north text, .map-scale text { fill: var(--ink); font: 600 11px var(--sans); letter-spacing: .1em; }
.venue-note { white-space: pre-line; margin-top: 2.5rem; padding: 22px 28px; border: 1px solid var(--ink); color: var(--muted); }
.venue-note::before { content: 'Dress code and notes'; display: block; margin-bottom: 6px; font-size: .66rem; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--ink); }

/* ---------- Gifts ---------- */
.gift-list { border-top: 1px solid var(--ink); }
.gift-item { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; background-image: linear-gradient(var(--ink), var(--ink)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0 1px; transition: background-size 600ms var(--ease-out), padding 500ms var(--ease-out); }
.gift-name { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.15; }
.gift-external { margin-top: 2.5rem; }

/* ---------- RSVP ---------- */
.rsvp-body { display: grid; grid-template-columns: 4fr 6fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.rsvp-intro .lead { margin: 0; }
.rsvp-form { display: grid; gap: 26px; }
.field { display: grid; gap: 4px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-size: .66rem; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); padding: 0; }
.field input[type="text"], .field input[type="email"], .field input[type="number"], .field textarea { width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 10px 0; transition: box-shadow 200ms ease; }
.field input:focus, .field textarea:focus { outline: none; box-shadow: 0 1px 0 0 var(--ink); }
.field textarea { resize: vertical; }
.choice { grid-auto-flow: column; justify-content: start; align-items: center; gap: 12px; }
.choice legend { grid-column: 1 / -1; margin-bottom: 8px; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-block; border: 1px solid var(--ink); padding: 13px 22px; font-size: .74rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); cursor: pointer; background: transparent; transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out); }
.pill span:active { transform: scale(0.98); }
.pill input:checked + span { background: var(--ink); color: var(--paper); }
.pill input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rsvp-form .btn { justify-self: start; }
.form-status { min-height: 1.4em; color: var(--muted); }
.form-status.ok { color: #2F6B3F; }
.form-status.err { color: #A33A3A; }

/* ---------- Footer ---------- */
.footer { position: relative; padding: 44px 0 56px; }
.footer-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 20px; }
.footer-names { font-family: var(--serif); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; }
.footer-date { font-family: var(--serif); font-style: italic; font-size: 1.4rem; text-align: center; }
.footer-top { justify-self: end; }

/* ---------- Motion ---------- */
/* Scroll reveals. Content is visible by default; the .js class is added in <head>. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 900ms ease, transform 900ms var(--ease-out); transition-delay: var(--delay, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .person:nth-child(3n+2), .js .gallery-item:nth-child(3n+2) { --delay: 100ms; }
.js .person:nth-child(3n+3), .js .gallery-item:nth-child(3n+3) { --delay: 200ms; }

/* Lines draw themselves: section rules and the rules under table rows */
.js .ruled::before { transform: scaleX(0); transition: transform 1400ms var(--ease-draw); }
.js .ruled.in::before { transform: none; }
.js .reveal.person::after, .js .reveal.event::after, .js .reveal.gift-item::after { transform: scaleX(0); transition: transform 1200ms var(--ease-draw) 250ms; }
.js .reveal.in.person::after, .js .reveal.in.event::after, .js .reveal.in.gift-item::after { transform: none; }

/* Photos wipe in */
.js .story-frame { clip-path: inset(0 0 100% 0); }
.js .story-photo.in .story-frame { clip-path: inset(0 0 0 0); transition: clip-path 1400ms var(--ease-draw) 150ms; }
.js .marks::before { inset: 0; opacity: 0; }
.js .marks.in::before { inset: -12px; opacity: 1; transition: inset 900ms var(--ease-out) 900ms, opacity 500ms ease 900ms; }

/* Hero entrance */
@keyframes mask-up { from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(40px); } to { opacity: 1; clip-path: inset(-12% -4% -12% -4%); transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes marks-in { from { inset: 0; opacity: 0; } to { inset: -12px; opacity: 1; } }
.js .hero-meta > * { opacity: 0; animation: rise 800ms var(--ease-out) 300ms forwards; }
.js .hero-meta::after, .js .hero-cells::before { animation: draw-x 1500ms var(--ease-draw) 100ms backwards; }
.js .hero h1 { animation: mask-up 1300ms var(--ease-out) 350ms backwards; }
.js .cell { animation: rise 900ms var(--ease-out) backwards; }
.js .cell:nth-child(1) { animation-delay: 900ms; }
.js .cell:nth-child(2) { animation-delay: 1000ms; }
.js .cell:nth-child(3) { animation-delay: 1100ms; }
.js .cell:nth-child(4) { animation-delay: 1200ms; }
.js .hero-frame { animation: wipe 1700ms var(--ease-draw) 700ms backwards; }
.js .hero-photo.marks::before { inset: -12px; opacity: 1; animation: marks-in 900ms var(--ease-out) 2.1s backwards; }

/* Ambient */
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes tick-in { from { opacity: 0; transform: translateY(40%); } to { opacity: 1; transform: none; } }
.down { animation: nudge 2s ease-in-out infinite; }
.countdown b.tick { animation: tick-in 420ms var(--ease-out); }

/* The map draws itself, then the pins drop */
.js .venue-map .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .venue-map.in .draw { stroke-dashoffset: 0; transition: stroke-dashoffset 2200ms var(--ease-draw); }
.js .venue-map.in .map-blocks .draw { transition-duration: 2600ms; }
.js .venue-map.in .map-route { transition-delay: 1400ms; transition-duration: 1600ms; }
.js .venue-map .pin, .js .venue-map .map-north, .js .venue-map .map-scale { opacity: 0; }
.js .venue-map .pin circle { transform-box: fill-box; transform-origin: center; transform: scale(0); }
.js .venue-map.in .pin, .js .venue-map.in .map-north, .js .venue-map.in .map-scale { opacity: 1; transition: opacity 600ms ease 2.2s; }
.js .venue-map.in .pin circle { transform: none; transition: transform 700ms var(--ease-out) 2.2s; }
.js .venue-map.in .pin-b circle { transition-delay: 2.5s; }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background-size: 100% 100%; color: var(--ink); }
  .btn-outline:hover { color: var(--paper); }
  .link-arrow:hover::after { transform: translateX(5px); }
  .nav a:hover::after { transform: scaleX(1); }
  .person:hover, .event:hover, .gift-item:hover { background-size: 100% 1px; padding-left: 14px; }
  .person:hover img, .gallery-item:hover img { filter: grayscale(0) contrast(1); }
  .gallery-item:hover { background-color: var(--white); }
  .hero-photo:hover img, .story-photo:hover img { filter: grayscale(0) contrast(1); }
  .lb button:hover { background: var(--ink); color: var(--paper); }
}
.gallery-item:focus-visible img { filter: grayscale(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; transition: opacity 200ms ease; }
  .js .ruled::before, .js .reveal.person::after, .js .reveal.event::after, .js .reveal.gift-item::after { transform: none; transition: none; }
  .js .story-frame { clip-path: none; }
  .js .marks::before { inset: -12px; opacity: 1; transition: none; }
  .js .hero-meta > *, .js .hero h1, .js .cell, .js .hero-frame, .js .hero-meta::after, .js .hero-cells::before, .js .hero-photo.marks::before { opacity: 1; animation: none; clip-path: none; }
  .js .venue-map .draw { stroke-dashoffset: 0; transition: none; }
  .js .venue-map .pin, .js .venue-map .map-north, .js .venue-map .map-scale { opacity: 1; }
  .js .venue-map .pin circle { transform: none; transition: none; }
  .down, .countdown b.tick { animation: none; }
  .progress { display: none; }
  .hero-frame img, .story-frame img, .band-media { transform: none !important; }
  .person, .event, .gift-item, .gallery-item, .lb img { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .nav a { display: none; }
  .sec-grid { grid-template-columns: 1fr; }
  .sec-label { position: static; display: flex; align-items: baseline; gap: 14px; padding: 0 0 22px; }
  .idx::before { font-size: 2.2rem; }
  .sec-body { border-left: 0; padding-left: 0; }
  .hero-cells { grid-template-columns: repeat(2, 1fr); }
  .cell:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); }
  .cell:nth-child(4) { border-top: 1px solid var(--rule); }
  .story-body, .venue-grid, .rsvp-body { grid-template-columns: 1fr; }
  .story-photo { width: min(100%, 420px); }
}
@media (max-width: 700px) {
  .container, .topbar-inner { width: calc(100% - 36px); }
  .hero-meta { flex-direction: column; gap: 2px; }
  .hero-frame { aspect-ratio: 4 / 3; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-item { padding: 10px 10px 36px; }
  .gallery-item::after { left: 10px; }
  .person { grid-template-columns: 28px 52px 1fr; gap: 14px; }
  .person img { width: 52px; height: 52px; }
  .person-role { grid-column: 3; text-align: left; margin-top: -10px; }
  .event { grid-template-columns: 84px 1fr; gap: 4px 16px; }
  .event p { grid-column: 2; }
  .event-time { font-size: 1.6rem; }
  .countdown li { padding-inline: 2px; }
  .choice { grid-auto-flow: row; justify-items: start; }
  .footer-grid { grid-template-columns: 1fr; justify-items: start; }
  .footer-date { text-align: left; }
  .footer-top { justify-self: start; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
