/* ==========================================================================
   Tokens (source: docs/design-brief.md). Every colour, font, spacing,
   radius and duration lives here. Component rules below use only these.
   ========================================================================== */
:root {
  --page: #EDE5D8;
  --paper: #FCFAF6;
  --shade: #F2EBDF;
  --burgundy: #6B1D2A;
  --gold: #B39869;
  --ink: #2F2522;
  --ink-soft: #66574F;
  --shadow: rgba(47, 37, 34, .12);
  --logo-src: none; /* set per element by main.js and album.js, the monogram image */

  /* Reference palette (quanbui210 template, repo colours) used by the sections */
  --ivory: #FAF7F2;
  --burgundy-deep: #531521;
  --gold-text: #86693C;
  --gold-line: rgba(179, 152, 105, .55);
  --veil: rgba(250, 247, 242, .72); /* soft backing behind the viewer arrows */
  --gold-faint: rgba(179, 152, 105, .28);
  --gold-dark: #8E6F3E;
  --gold-mid: #C9AD78;
  --gold-light: #D9C28F;
  --gold-soft: #E3CFA4;
  --gold-pale: #F1E2BE;
  --rose-deep: #9B1C2E;
  --sketch-ink: #4A3128;
  --taupe: #A99A8F;
  --line: #D8CCB8;
  --mist: #E4DACA;
  --cream: #EFE8DC;
  --paper-warm: #FFFDF8;

  --font-script: 'Great Vibes', cursive;
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'Be Vietnam Pro', system-ui, sans-serif;
  --font-mark: 'Noto Serif TC', serif;

  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ease-door: cubic-bezier(.7, 0, .25, 1);
  --dur-fast: 200ms;
  --dur-base: 500ms;
  --dur-slow: 900ms;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --radius-card: 6px;
  --radius-pill: 999px;
  --touch: 48px;
  --card: 560px;
  --pad: 28px;
  --cols: 3;
  --gap: 10px;
  --ratio: 3 / 4;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}


body {
  margin: 0;
  background: var(--ivory) var(--grain);
  color: var(--ink);
  font: 400 16px/1.75 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "lnum" 1; /* lining numerals; survives the font shorthand */
}
body.is-locked { overflow: hidden; height: 100%; }
html { scrollbar-gutter: stable; } /* keeps the scrollbar space when the lightbox locks the page, so nothing jumps */

img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }


.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px;
}

:focus-visible { outline: 1px solid var(--burgundy); outline-offset: 3px; }

/* ---------- Type ---------- */
.kicker {
  margin: 0 0 18px;
  font: 400 13px/1.6 var(--font-body);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold-text);
}
.title {
  margin: 0 0 28px;
  font: 400 34px/1.15 var(--font-display);
  color: var(--burgundy);
  letter-spacing: .01em;
}
.script {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--burgundy);
  line-height: 1.15;
}
.muted { color: var(--ink-soft); margin: 0 auto 24px; max-width: 34em; }
.hy { font-family: var(--font-mark); font-weight: 300; line-height: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 28px;
  border: 1px solid var(--burgundy); border-radius: 0;
  font: 400 13px/1 var(--font-body); letter-spacing: .24em; text-transform: uppercase;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out);
}
.btn--solid { background: var(--burgundy); color: var(--ivory); }
.btn--solid:hover { background: var(--burgundy-deep); }
.btn--ghost { background: transparent; color: var(--burgundy); border-color: var(--gold-line); }
.btn--ghost:hover { border-color: var(--burgundy); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; }

/* ---------- Ornaments ---------- */
.divider {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 0 auto 28px; color: var(--gold);
}
.divider::before, .divider::after {
  content: ''; width: 64px; height: 1px; background: var(--gold-line);
}
.divider .hy { font-size: 20px; }

.seal {
  display: grid; place-items: center;
  width: 92px; height: 92px; border-radius: 50%;
  background: var(--burgundy);
  color: var(--gold-soft);
  box-shadow: 0 0 0 1px var(--burgundy), inset 0 0 0 5px var(--burgundy), inset 0 0 0 6px rgba(227, 207, 164, .7), 0 10px 28px rgba(83, 21, 33, .22);
}
.seal .hy { font-size: 40px; transform: translateY(1px); }
.seal--small { width: 64px; height: 64px; margin: 0 auto 20px; }
.seal--small .hy { font-size: 28px; }
.seal__mark { display: block; width: 50px; margin: 0 auto; }
/* Monogram logo: a background image; the PNG is set per element by main.js and album.js */
.logo {
  display: block; width: 100%; aspect-ratio: 640 / 479; margin: 0 auto;
  background: var(--logo-src) center / contain no-repeat;
}


/* ==========================================================================
   Cover: envelope (screen 1)
   Hidden states only apply when JS runs, so the page still shows without JS.
   ========================================================================== */
.cover {
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: center;
  overflow: hidden;
}
.cover.is-done { display: none; }

.cover__watermark {
  position: absolute; left: 50%; top: 50%;
  width: min(88dvh, 90vw); height: auto;
  transform: translate(-50%, -50%);
  fill: var(--burgundy); stroke: none;
  opacity: .06; pointer-events: none;
}
.cover__watermark .hy-bar,
.cover__watermark .hy-frame { fill: none; stroke: var(--burgundy); stroke-width: 55; stroke-linecap: round; stroke-linejoin: round; }
.cover__watermark .hy-frame { stroke-linejoin: round; }

.js .cover { opacity: 0; transition: opacity 400ms var(--ease-out); }
.js.is-ready .cover { opacity: 1; }

.cover__head {
  display: grid;
  gap: 4px;
  justify-items: center;
}
.js .cover__head { opacity: 0; transform: translateY(12px); }
.js.is-ready .cover__head {
  opacity: 1;
  transform: none;
  transition: opacity 500ms var(--ease-out) 300ms, transform 500ms var(--ease-out) 300ms;
}
.cover__mark {
  margin: 0;
  font-family: var(--font-mark);
  font-size: 28px;
  line-height: 1;
  color: var(--burgundy);
}
.cover__kicker {
  margin: 0;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .32em;
}
.cover__names {
  margin: 0;
  font-family: var(--font-script);
  font-size: 52px;
  line-height: 1.15;
  color: var(--ink);
}

/* Line-art florals: each one grows out of its root. Stems draw first (DOM order),
   then leaves, then the petals fill in. `--i` is set per stroke by main.js. */
.flora {
  position: absolute;
  width: 140px;
  height: 140px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-linecap: round;
  pointer-events: none;
}
.flora--bl { left: -60px; bottom: -58px; width: 230px; height: 230px; }
.flora--br { right: -60px; bottom: -46px; width: 190px; height: 190px; }
@media (min-width: 768px) {
  .flora--bl { bottom: 0; width: 450px; height: 450px; }
  .flora--br { bottom: -8px; width: 375px; height: 375px; }
}
.flora--tl { left: -48px; top: -36px; }
/* Blossom branches pinned to the top corners of the screen while scrolling */
.flora--fixed { position: fixed; z-index: 5; }
.flora--tr { right: -48px; top: -36px; }
.flora--flip { transform: scaleX(-1); }
/* Top corners: the template branch hangs down from the top edge instead of rising from the bottom */
.flora--vflip { transform: scaleY(-1); }
.flora--rot { transform: rotate(180deg); }
.flora--sm { width: 110px; height: 110px; }
@media (min-width: 768px) {
  .flora--sm { width: 200px; height: 200px; }
}
/* Extra florals in the top corners of the cover, shown on wider screens only */
.flora--wide { display: none; }
@media (min-width: 768px) {
  .flora--wide { display: block; width: 240px; height: 240px; }
}
.petal { fill: var(--paper); fill-opacity: 1; }
.flora .petal { fill: var(--burgundy); }
.js .petal { fill-opacity: 0; }
.js .flora .ln { stroke-dasharray: 1 2; stroke-dashoffset: 1; }
.js.is-ready .flora--load .ln {
  animation: draw var(--dur-slow) var(--ease-in-out) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 200ms);
}
.js.is-ready .flora--load .petal {
  animation: petal-in var(--dur-base) var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 120ms + 1100ms);
}
.invite {
  position: relative;
  isolation: isolate;
  overflow-x: clip; /* corner florals bleed past the edge; never scroll the page sideways */
}
.invite.is-in .flora--enter .ln {
  animation: draw var(--dur-slow) var(--ease-in-out) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 300ms);
}
.invite.is-in .flora--enter .petal {
  animation: petal-in var(--dur-base) var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 120ms + 1200ms);
}
@keyframes petal-in { to { fill-opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ==========================================================================
   Envelope
   ========================================================================== */
.envelope {
  position: relative;
  width: min(64vw, 240px);
  aspect-ratio: 3 / 2;
  max-width: 100%;
  perspective: 900px;
}
.envelope__back,
.envelope__front,
.envelope__flap {
  position: absolute;
  left: 0;
  right: 0;
}
.envelope__back {
  top: 0;
  bottom: 0;
  background: var(--burgundy);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 18px var(--shadow);
}
.envelope__card {
  position: absolute;
  z-index: 1;
  left: 8%;
  right: 8%;
  top: 10%;
  bottom: 10%;
  background: var(--ivory); /* same colour as the invitation the letter opens into */
  border-radius: 4px;
  box-shadow: 0 2px 10px var(--shadow);
  transform: scale(.86);
}
.envelope__front {
  z-index: 3;
  top: 0;
  bottom: 0;
  background: var(--paper);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  clip-path: polygon(0 35%, 50% 55%, 100% 35%, 100% 100%, 0 100%);
}
.envelope__flap {
  z-index: 4;
  top: -1px;
  height: 55%;
  background: var(--shade);
  clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%);
  transform-origin: top;
  transform: rotateX(0deg);
  backface-visibility: hidden;
}

/* Template credit: a small plum-blossom icon linked to the template repo; the name is read from aria-label */
.credit {
  display: flex; align-items: center; justify-content: center;
  width: var(--touch); height: var(--touch);
  margin: var(--space-2) auto 0;
  border-radius: 50%;
  color: var(--gold);
}
.credit:focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: 2px;
}
.credit__icon {
  width: 30px; height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}

/* Faint 囍 watermark behind the cover, so the page is not one flat colour */

/* Falling petals: one pass over the cover, then they fade out (finite, transform and opacity only) */
.fall {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.fall__petal {
  position: absolute;
  top: 0;
  left: var(--x);
  opacity: 0;
  filter: blur(.5px); /* softens the petals a little */
  animation: petal-fall var(--t) linear var(--d) infinite both;
}
.fall__leaf {
  display: block;
  width: var(--s);
  height: var(--s);
  border-radius: 50% 0 50% 0;
  background: var(--gold);
  animation: petal-sway var(--p) ease-in-out infinite;
}
.fall__bloom {
  width: calc(var(--s) * 1.6);
  height: calc(var(--s) * 1.6);
  background: none;
  border-radius: 0;
}
.fall__bloom { fill: none; stroke-width: 1; stroke-linecap: round; }
.fall__bloom path { stroke: var(--burgundy); }
.fall__bloom circle { stroke: var(--gold); fill: none; }
/* Petals in the invitation: fixed to the screen, so they keep falling while the guest scrolls */
.fall--invite { position: fixed; z-index: 5; }
@keyframes petal-fall {
  0% { opacity: 0; transform: translate3d(0, -8dvh, 0); }
  8% { opacity: .35; }
  92% { opacity: .35; }
  100% { opacity: 0; transform: translate3d(var(--dx), 108dvh, 0); }
}
@keyframes petal-sway {
  0% { transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg); }
  50% { transform: translate3d(var(--amp), 0, 0) rotateX(calc(var(--turn) * .5)) rotateY(50deg); }
  100% { transform: translate3d(0, 0, 0) rotateX(var(--turn)) rotateY(0deg); }
}

/* Dashed stitch line around the front pocket (own drawing, token colour only) */
.envelope__stitch {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

/* Seal sits on the flap seam; D&T monogram on rose-deep, double ring */
.cover .seal {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 55%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--burgundy);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--burgundy), 0 2px 8px var(--shadow);
}
.cover .seal:focus-visible,
.open-btn:focus-visible,
.music:focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: 3px;
}


/* ==========================================================================
   Guest line and open button (screen 1)
   ========================================================================== */
.cover__to {
  margin: 0;
  font-size: 17px;
  color: var(--ink-soft);
}
.cover__note {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + var(--space-3));
  transform: translateX(-50%);
  z-index: 1; /* above the florals, which paint after it in the DOM */
  width: max-content;
  max-width: calc(100% - 96px);
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--paper-warm);
  text-shadow: .5px 0 var(--burgundy), -.5px 0 var(--burgundy), 0 .5px var(--burgundy), 0 -.5px var(--burgundy), .5px .5px var(--burgundy), -.5px -.5px var(--burgundy), .5px -.5px var(--burgundy), -.5px .5px var(--burgundy); /* white text with a thin burgundy outline */
  text-wrap: balance;
}
.cover__note-icon { font-size: 16px; line-height: 1; vertical-align: -2px; }
.cover__guest {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
  overflow-wrap: anywhere;
  font-weight: 500;
}
.open-btn {
  min-height: var(--touch);
  min-width: 44px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--burgundy);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--shadow);
}
.js.is-ready .open-btn {
  animation: breathe 2400ms var(--ease-in-out) 1500ms infinite;
}
.open-btn:active { transform: scale(.97); transition: transform 100ms var(--ease-out); }
/* Wedding ticket: one event card with the time, place and two buttons */
.ticket {
  display: grid;
  gap: var(--space-1);
  justify-items: center;
  text-align: center;
}
.ticket__kicker {
  margin: 0;
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.ticket__time {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--burgundy);
}
.ticket__venue,
.ticket__address {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}
.ticket__address { color: var(--ink-soft); }
.ticket__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1);
  width: 100%;
  margin-top: var(--space-1);
}
.ticket__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  font-size: 15px;
}
.btn--line {
  color: var(--burgundy);
  background: transparent;
  border: 1px solid var(--burgundy);
  box-shadow: none;
}

/* Wider screens: the cover scales up so the envelope and its text do not look small */
@media (min-width: 768px) {
  .envelope { width: 440px; }
  .cover .seal { width: 92px; height: 92px; }
  .seal__mark { width: 64px; }
  .cover__note { color: var(--ink-soft); text-shadow: none; }
  .cover__to { font-size: 20px; }
  .open-btn { font-size: 18px; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* ==========================================================================
   Opening sequence, timings from design-brief.md section B.
   main.js adds cover classes at 0, 1250 and 1900 ms, then unlocks at 2400 ms.
   ========================================================================== */
.cover.is-opening .seal {
  transform: translate(-50%, -50%) scale(.6);
  opacity: 0;
  transition: transform 250ms var(--ease-out), opacity 250ms var(--ease-out);
}
.cover.is-opening .cover__head,
.cover.is-opening .cover__to,
.cover.is-opening .cover__note {
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
}
.cover.is-opening .open-btn {
  opacity: 0;
  animation: none;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.cover.is-opening .envelope__flap {
  transform: rotateX(180deg);
  transition: transform 600ms var(--ease-in-out) 150ms;
}
.cover.is-opening .envelope__card {
  transform: translateY(-95%) scale(.86);
  transition: transform 700ms var(--ease-out) 650ms;
}
/* The letter zooms above the petals and florals, so they never draw over it */
.cover.is-leaving .envelope { z-index: 2; }
.cover.is-leaving .envelope__back,
.cover.is-leaving .envelope__front,
.cover.is-leaving .envelope__stitch {
  transform: translateY(48px);
  opacity: 0;
  transition: transform 650ms var(--ease-out), opacity 650ms var(--ease-out);
}
.cover.is-leaving .cover__head,
.cover.is-leaving .cover__to,
.cover.is-leaving .cover__note {
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
}

/* ---------- Page and sections ---------- */
.card {
  position: relative;
  max-width: var(--card);
  margin: 0 auto;
  overflow: hidden;
  text-align: center;
}

.section { position: relative; padding: 80px var(--pad); }
.section + .section::before { /* hairline between sections */
  content: ''; position: absolute; top: 0; left: 50%; width: 1px; height: 44px;
  background: var(--gold-line);
}

/* ---------- Hero ---------- */
.hero { padding-top: 96px; }
.hero__sprig {
  position: absolute; top: 34px; left: -12px; width: 150px; height: 50px;
  color: var(--gold); opacity: .8; transform: scaleX(-1);
}
.hero__photo {
  position: relative;
  width: 74%; max-width: 340px; aspect-ratio: 3 / 4;
  margin: 8px auto 40px;
}
.hero__photo::before { /* outer hairline arch */
  content: ''; position: absolute; inset: -9px;
  border: 1px solid var(--gold-line);
  border-radius: 999px 999px 0 0;
}
.hero__photo > * { border-radius: 999px 999px 0 0; overflow: hidden; width: 100%; height: 100%; }
.hero__photo img { object-fit: cover; }
.hero__photo .ph::after { border-radius: 999px 999px 0 0; }

[data-names] .amp, .hero__names .amp {
  display: block; margin: 2px 0;
  font: italic 300 .5em/1 var(--font-display); color: var(--gold);
}
.hero__names { margin: 0; font-size: clamp(46px, 13vw, 62px); }
.hero__lead { max-width: 20em; margin: 14px auto 34px; font: italic 400 19px/1.5 var(--font-display); color: var(--ink-soft); text-wrap: balance; }

.date {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  max-width: 330px; margin: 0 auto 18px;
}
.date > span { white-space: nowrap; padding: 6px 0; font: 400 13px/1.4 var(--font-body); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-soft); }
.date > span:first-child { border-right: 1px solid var(--gold-line); padding-right: 14px; }
.date > span:last-child { border-left: 1px solid var(--gold-line); padding-left: 14px; }
.date .date__big { padding: 0 18px; font: 300 44px/1 var(--font-display); letter-spacing: .02em; color: var(--burgundy); }
.hero__lunar { margin: 0; font: italic 400 16px/1.5 var(--font-display); color: var(--ink-soft); white-space: pre-line; }
.hero__quote {
  max-width: 24em; margin: 36px auto 0; padding: 22px 0 0;
  border-top: 1px solid var(--gold-faint);
  font: italic 400 18px/1.6 var(--font-display); color: var(--ink); text-wrap: balance;
  white-space: pre-line; /* honours the \n in heroQuote */
}

/* ---------- Family ----------
   Two houses side by side, a red thread (tơ hồng) down from each,
   tied in a heart between the couple's names. */
.family__intro { max-width: 22em; margin: -14px auto 34px; font: italic 400 18px/1.5 var(--font-display); color: var(--ink-soft); }
.family__tree { max-width: 820px; margin: 0 auto; }
.family__grid, .family__couple { display: grid; grid-template-columns: 1fr 1fr; }
.family__col { padding: 0 6px; }
.family__art { max-width: 150px; margin: 0 auto 12px; }
.family__col .kicker { margin-bottom: 8px; }
.family__couple { margin-top: 26px; }
.family__couple .kicker { margin-bottom: 6px; }
.family__name { margin: 0; font: 400 28px/1.25 var(--font-display); color: var(--burgundy); }
.family__parent { margin: 0; font: 400 16.5px/1.55 var(--font-display); }
.family__col p.addr { margin-top: 8px; font: 300 13px/1.6 var(--font-body); color: var(--ink-soft); }
.family__thread { margin: 10px 0 6px; }
.family__thread .sketch { color: var(--burgundy); }
.sketch--thread g { stroke-width: 1.5; }
}

/* ---------- Events ---------- */
.events__list { display: grid; gap: 28px; }
.event {
  position: relative;
  padding: 34px 22px 32px;
  background: var(--paper);
  border: 1px solid var(--gold-line);
}
.event::before { content: ''; position: absolute; inset: 5px; border: 1px solid var(--gold-faint); pointer-events: none; }
/* Gold corner brackets, like a printed card */
.event__corner { position: absolute; width: 24px; height: 24px; border: 0 solid var(--gold); pointer-events: none; }
.event__corner:nth-of-type(1) { top: 12px; left: 12px; border-top-width: 1px; border-left-width: 1px; }
.event__corner:nth-of-type(2) { top: 12px; right: 12px; border-top-width: 1px; border-right-width: 1px; }
.event__corner:nth-of-type(3) { bottom: 12px; left: 12px; border-bottom-width: 1px; border-left-width: 1px; }
.event__corner:nth-of-type(4) { bottom: 12px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; }
.event__art { margin: 0 -4px 18px; }
.event__name { margin: 0 0 10px; }
.event__venue { margin: 0 0 6px; font: 400 30px/1.2 var(--font-display); color: var(--burgundy); }
.event__host { margin: 0 0 26px; font: italic 400 17px/1.4 var(--font-display); color: var(--ink-soft); }
.event__facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  border-top: 1px solid var(--gold-faint); border-bottom: 1px solid var(--gold-faint);
  padding: 20px 0;
}
.event__fact { padding: 0 6px; }
.event__fact + .event__fact { border-left: 1px solid var(--gold-faint); }
.event__label { display: block; font: 400 12px/1.6 var(--font-body); letter-spacing: .26em; text-transform: uppercase; color: var(--gold-text); }
.event__big { display: block; margin: 6px 0 4px; font: 300 32px/1.05 var(--font-display); color: var(--ink); }
.event__sub { display: block; margin-top: 6px; font: italic 400 14px/1.35 var(--font-display); color: var(--ink-soft); white-space: pre-line; /* honours the \n in date.lunar */ }
.event__lunar { margin: 14px 0 0; font: italic 400 15px/1.5 var(--font-display); color: var(--ink-soft); }
.event__where { margin: 24px auto 0; }
.event__addr {
  display: inline-flex; align-items: flex-start; gap: 8px; max-width: 24em; margin: 8px 0 0;
  font: 500 19px/1.4 var(--font-display); color: var(--ink); text-decoration: none;
}
a.event__addr span { text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: 5px; text-decoration-thickness: 1px; }
a.event__addr:hover span { text-decoration-color: var(--burgundy); }
.event__pin { flex: none; width: 18px; height: 18px; margin-top: 3px; fill: none; stroke: var(--burgundy); stroke-width: 1.4; }
.event__dress { margin: 12px 0 0; font: italic 400 15px/1.5 var(--font-display); color: var(--gold-text); }
.sketch--venue .ln { animation-delay: calc(var(--i, 0) * 22ms + .2s); } /* many strokes: draw faster */
.sketch--venue g { stroke-width: 1.1; }
.event__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.event__actions .btn { padding: 0 18px; flex: 1 1 140px; }
.event__cal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 14px; }
.event__cal a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 13px; color: var(--burgundy);
  text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: 5px;
}

/* ---------- Sketches (assets/js/sketches.js) ---------- */
.sketch { display: block; width: 100%; height: auto; overflow: visible; color: var(--sketch-ink); }
.sketch__ink { fill: var(--burgundy); stroke: none; font-family: var(--font-mark); }
/* Each stroke has pathLength=1 and class .ln: dash "1 2" with offset 1 hides it, offset 0 shows it whole. */
.js .sketch .ln { stroke-dasharray: 1 2; stroke-dashoffset: 1; }
.js .sketch__ink { opacity: 0; transition: opacity 1.2s var(--ease-out) 1.6s; }
.is-visible .sketch .ln { animation: draw 1.5s cubic-bezier(.45, .05, .3, 1) calc(var(--i, 0) * 45ms + .25s) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.is-visible .sketch__ink { opacity: .9; }

/* ---------- Program ---------- */
.program__date { margin: -14px 0 40px; font: 400 12px/1.6 var(--font-body); letter-spacing: .3em; color: var(--gold-text); }
.program__list { list-style: none; margin: 0 auto; padding: 0; max-width: 460px; }
.program__item {
  display: grid; grid-template-columns: 46% 1fr; align-items: center; gap: 18px;
  padding: 22px 0; text-align: left;
}
.program__item + .program__item { border-top: 1px solid var(--gold-faint); }
.program__item:nth-child(even) { grid-template-columns: 1fr 46%; text-align: right; }
.program__item:nth-child(even) .program__art { order: 2; }
.program__time { margin: 0; font: 300 34px/1 var(--font-display); color: var(--burgundy); }
.program__title { margin: 8px 0 2px; font: 500 21px/1.3 var(--font-display); }
.program__note { margin: 0; font: italic 400 15px/1.45 var(--font-display); color: var(--ink-soft); }

.gift__art { width: 150px; margin: -10px auto 10px; }

/* ---------- Date: tear-off calendar (.bloc) and month page (.mcal) ---------- */
.when { position: relative; z-index: 2; margin: 6px auto 0; }
.when--bloc { margin-top: 120px; } /* room for the nail and string, clear of the kicker above */
.when__left { margin: 30px 0 0; font: italic 400 19px/1.4 var(--font-display); color: var(--ink-soft); }
.when__left b { margin: 0 .12em; font: 400 32px/1 var(--font-display); color: var(--burgundy); font-variant-numeric: lining-nums; }

/* Tear-off wall calendar (lịch bloc): burgundy backing board, binding strip, a stack of pages */
.bloc {
  width: 252px; margin-inline: auto; padding: 0 16px 18px;
  background: var(--burgundy) var(--grain); border-radius: 4px;
  box-shadow: 0 18px 34px -18px rgba(83, 21, 33, .55), inset 0 0 0 1px rgba(255, 255, 255, .06);
  position: relative;
}
.bloc::before { /* gold hairline frame */
  content: ''; position: absolute; inset: 7px; border: 1px solid rgba(214, 190, 140, .45); border-radius: 2px; pointer-events: none;
}
.bloc::after { /* hanging string from the nail down to the board */
  content: ''; position: absolute; left: 50%; top: -34px; width: 1px; height: 34px; background: var(--gold);
}
.bloc__head { height: 50px; display: grid; place-items: center; color: var(--gold-light); font-size: 22px; }
.bloc__head::before { /* the nail */
  content: ''; position: absolute; left: 50%; top: -34px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold-pale), var(--gold-dark));
}
.bloc__stack {
  position: relative; display: grid;
  box-shadow: 0 2px 0 var(--cream), 0 4px 0 var(--mist), 0 6px 0 var(--line); /* page thickness under the top sheet */
}
.bloc__stack::before { /* binding strip: pages tear away from under it */
  content: ''; position: absolute; z-index: 20; left: -3px; right: -3px; top: -5px; height: 14px; border-radius: 2px;
  background: linear-gradient(var(--gold-dark), var(--gold-mid) 45%, var(--gold-dark));
  box-shadow: 0 2px 3px rgba(0, 0, 0, .25);
}
.bloc__page {
  grid-area: 1 / 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 26px 14px 18px;
  background: var(--paper-warm); color: var(--ink);
  transform-origin: 8% 0;
}
.bloc__page::before { /* perforation just under the binding */
  content: ''; position: absolute; left: 6px; right: 6px; top: 14px; border-top: 1.5px dotted rgba(102, 87, 79, .3);
}
.bloc__month { margin: 0; font: 500 10.5px/1.6 var(--font-body); letter-spacing: .26em; text-transform: uppercase; color: var(--gold-text); }
.bloc__day { margin: 2px 0 0; font: 500 116px/.95 var(--font-display); letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.bloc__wd { margin: 6px 0 0; font: 500 12px/1.4 var(--font-body); letter-spacing: .32em; text-transform: uppercase; color: var(--ink-soft); }
.bloc__page.is-sun .bloc__day, .bloc__page--final .bloc__day { color: var(--burgundy); }
.bloc__page--final .bloc__wd { color: var(--burgundy); }
.bloc__names { margin: 12px 0 0; font-size: 25px; white-space: nowrap; line-height: 1.2; color: var(--burgundy); }
.bloc__names .amp { margin: 0 .2em; }
.bloc__lunar {
  margin: 14px 0 0; padding-top: 10px; width: 100%; border-top: 1px solid var(--gold-faint);
  font: italic 400 15px/1.4 var(--font-display); color: var(--ink-soft);
}
.bloc__lunar span { display: block; font: 500 12px/1.6 var(--font-body); font-style: normal; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-text); }
.bloc__stamp {
  position: absolute; right: 14px; top: 26px; width: 40px; height: 40px; display: grid; place-items: center;
  border: 1.5px solid var(--burgundy); border-radius: 50%; color: var(--burgundy);
  transform: rotate(-10deg); opacity: .8;
}
.bloc__stamp .logo { width: 26px; }
.bloc__page.is-torn { animation: tear .95s cubic-bezier(.55, 0, .8, .35) forwards; pointer-events: none; }
@keyframes tear {
  0% { transform: none; }
  16% { transform: translateY(8px) rotate(2deg); } /* the free corner swings down, never up over the binding */
  100% { transform: translate(-26%, 150%) rotate(-32deg); opacity: 0; }
}

/* Month page with the day circled by a hand-drawn heart */
.mcal {
  width: 300px; margin: 0 auto; padding: 26px 22px 22px; position: relative;
  background: var(--paper-warm); border: 1px solid var(--gold-line);
  box-shadow: 0 16px 30px -20px rgba(47, 37, 34, .35);
}
.mcal::before { content: ''; position: absolute; inset: 5px; border: 1px solid var(--gold-faint); pointer-events: none; }
.mcal__month { margin: 0 0 16px; font: 400 26px/1.2 var(--font-display); color: var(--ink); }
.mcal__grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 6px; font: 400 17px/34px var(--font-display); color: var(--ink-soft); font-variant-numeric: lining-nums tabular-nums; }
.mcal__grid .is-sun { color: var(--burgundy); opacity: .75; }
.mcal__wd { font: 500 12px/22px var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); border-bottom: 1px solid var(--gold-faint); margin-bottom: 4px; }
.mcal__day { position: relative; }
.mcal__day b { position: relative; z-index: 1; font-weight: 600; color: var(--burgundy); }
.mcal__heart { position: absolute; left: 50%; top: 50%; width: 52px; transform: translate(-50%, -48%); color: var(--burgundy); }
.is-visible .mcal__heart .ln { animation-duration: 1.4s; animation-delay: .8s; }
.mcal__lunar { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--gold-faint); font: italic 400 15px/1.4 var(--font-display); color: var(--ink-soft); }

@media (min-width: 960px) {
  .bloc { width: 290px; }
  .bloc__day { font-size: 136px; }
  .mcal { width: 360px; padding: 32px 28px 26px; }
  .mcal__grid { font-size: 19px; line-height: 40px; }
  .mcal__heart { width: 60px; }
}

/* ---------- Placeholder (hero, album, QR) ---------- */
.ph {
  position: relative;
  display: grid; place-items: center; align-content: center; gap: 10px;
  width: 100%; height: 100%;
  background: var(--shade) var(--grain);
  color: var(--gold);
}
.ph::after { content: ''; position: absolute; inset: 10px; border: 1px solid var(--gold-line); pointer-events: none; }
.ph .hy { font-size: 30px; opacity: .85; }
.ph__logo { width: 120px; }
.album__item .ph__logo { width: 56%; }
.ph__label { font: 400 12px/1 var(--font-body); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-text); opacity: .8; }

/* ---------- Album (self-contained) ---------- */
/* Flex rows: portrait = 1 column, landscape = 2 columns; a short last row centres itself. */
.album { --cols: 2; --gap: 10px; display: flex; flex-wrap: wrap; justify-content: center; column-gap: var(--gap); row-gap: 10px; }
.album__item {
  position: relative; display: block; padding: 0;
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  border: 0; background: none; overflow: hidden;
  aspect-ratio: 3 / 4;
}
.album__item--landscape { flex-basis: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols) * 2 + var(--gap)); aspect-ratio: 3 / 2; }
.album__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease-out), opacity .8s var(--ease-out); }
.album__item img.is-loading { opacity: 0; }
.album__item:hover img { transform: scale(1.025); }
.album__item .ph .hy { font-size: 22px; }

.lightbox {
  position: fixed; inset: 0; z-index: 60;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--ivory) var(--grain);
  opacity: 0; transition: opacity .45s var(--ease-out);
}
.lightbox.is-open { opacity: 1; }
.lightbox__bar { display: flex; justify-content: space-between; align-items: center; padding: max(8px, env(safe-area-inset-top)) 8px 0 20px; }
.lightbox__count { font: 400 12px/1 var(--font-body); letter-spacing: .26em; color: var(--ink-soft); }
.lightbox__btn {
  display: grid; place-items: center; width: 48px; height: 48px;
  background: none; border: 0; color: var(--burgundy);
}
.lightbox__btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.1; }
.lightbox__stage { position: relative; min-height: 0; touch-action: pan-y; }
.lightbox__figure { position: absolute; inset: 4px 8px; margin: 0; min-width: 0; display: flex; align-items: center; justify-content: center; transition: opacity .35s var(--ease-out), transform .35s var(--ease-out); }
.lightbox__figure img { width: 100%; height: 100%; object-fit: contain; }
.hero__open { display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: none; cursor: zoom-in; }
.hero__open img { width: 100%; height: 100%; object-fit: cover; }
.hero__open:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 3px; }
.lightbox__figure .ph { width: min(78vw, 420px); height: auto; aspect-ratio: var(--ratio, 3 / 4); max-height: 100%; }
.lightbox__figure .ph .hy { font-size: 46px; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); border-radius: 50%; background: var(--veil); box-shadow: 0 0 0 1px var(--gold-line); }
.lightbox__nav--prev { left: 2px; }
.lightbox__nav--next { right: 2px; }
.lightbox__caption { min-height: 0; padding: 4px 24px max(10px, env(safe-area-inset-bottom)); text-align: center; font: italic 400 17px/1.4 var(--font-display); color: var(--ink-soft); }

@media (min-width: 720px) {
  .lightbox__nav--prev { left: 24px; }
  .lightbox__nav--next { right: 24px; }
}

/* ---------- Story ---------- */
.story__list { list-style: none; margin: 0 auto; padding: 0; max-width: 400px; text-align: left; position: relative; }
.story__list::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--gold-line); }
.story__item { position: relative; padding: 0 0 34px 38px; }
.story__item:last-child { padding-bottom: 0; }
.story__item::before {
  content: ''; position: absolute; left: 2px; top: 9px; width: 9px; height: 9px;
  background: var(--ivory); border: 1px solid var(--gold); transform: rotate(45deg);
}
.story__year { display: block; font: italic 400 16px/1.4 var(--font-display); color: var(--gold-text); }
.story__title { margin: 0 0 4px; font: 500 21px/1.3 var(--font-display); color: var(--burgundy); }
.story__text { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* ---------- Gift ---------- */
.gift__panel { display: grid; gap: 20px; margin-top: 32px; }
.gift__panel.is-in { animation: rise .7s var(--ease-out) both; }
.gift__card { padding: 28px 22px 22px; border: 1px solid var(--gold-line); background: var(--paper); }
.gift__qr { width: 168px; height: 168px; margin: 14px auto 20px; }
.gift__qr img { width: 100%; height: 100%; object-fit: contain; }
.gift__qr .ph .hy { font-size: 24px; }
.gift__rows { margin: 0 0 18px; display: grid; gap: 8px; }
.gift__rows div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px solid var(--gold-faint); padding-bottom: 8px; }
.gift__rows dt { color: var(--ink-soft); }
.gift__rows dd { margin: 0; text-align: right; font-weight: 400; }
.gift__num { font: 400 15px/1.3 var(--font-body); letter-spacing: .08em; }
.gift__card .btn { width: 100%; }

/* ---------- RSVP form ---------- */
.form { max-width: 420px; margin: 8px auto 0; text-align: left; }
.field { margin: 0 0 26px; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend {
  display: block; margin-bottom: 4px; padding: 0;
  font: 400 13px/1.6 var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft);
}
.req { color: var(--burgundy); }
.field input[type="text"], .field input[type="tel"], .field input[type="number"], .field textarea {
  display: block; width: 100%; min-height: 48px; padding: 10px 2px;
  background: transparent; border: 0; border-bottom: 1px solid var(--gold-line); border-radius: 0;
  font: 400 18px/1.4 var(--font-display); color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--burgundy); }
.field input::placeholder, .field textarea::placeholder { color: var(--taupe); font-style: italic; }
.hint { display: block; margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.err { display: block; font-size: 13px; color: var(--rose-deep); }
.err:empty { display: none; }
.err:not(:empty) { margin-top: 6px; }
.is-invalid { border-bottom-color: var(--rose-deep); }

.choices { display: grid; gap: 4px; margin-top: 6px; }
.choices--row { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.choice { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font: 400 18px/1.35 var(--font-display); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice > span::before {
  content: ''; display: inline-block; flex: none;
  width: 16px; height: 16px; margin-right: 12px; vertical-align: -2px;
  border: 1px solid var(--gold); border-radius: 50%;
}
.choice input[type="checkbox"] + span::before { border-radius: 0; }
.choice input:checked + span::before { background: var(--burgundy); box-shadow: inset 0 0 0 3px var(--ivory); border-color: var(--burgundy); }
.choice input:focus-visible + span { outline: 1px solid var(--burgundy); outline-offset: 4px; }

.choice--pill { justify-content: center; border: 1px solid var(--gold-line); font: 400 15px/1.2 var(--font-body); padding: 0 8px; text-align: center; }
.choice--pill > span::before { display: none; }
.choice--pill:has(input:checked) { background: var(--burgundy); border-color: var(--burgundy); color: var(--ivory); }
.choice--pill.is-checked { background: var(--burgundy); border-color: var(--burgundy); color: var(--ivory); }
.field--inline { margin: 14px 0 0; }

.hp { display: none; }
.form__error { margin: 0 0 14px; text-align: center; font-size: 14px; color: var(--rose-deep); }
.form__error:empty { display: none; }
.form__demo { margin: 14px 0 0; text-align: center; font-size: 12px; color: var(--ink-soft); }

.thanks { max-width: 420px; margin: 0 auto; padding: 36px 24px; border: 1px solid var(--gold-line); animation: rise .9s var(--ease-out) both; }
.thanks:focus { outline: none; }
.thanks__text { margin: 0 0 24px; font: italic 400 21px/1.5 var(--font-display); color: var(--ink); white-space: pre-line; /* honours the \n in thanksTitle */ }

/* ---------- Closing ---------- */
.closing { padding-bottom: 120px; }
.monogram {
  position: relative;
  display: grid; place-items: center;
  width: 104px; height: 104px; margin: 0 auto 32px;
  border: 1px solid var(--gold-line); border-radius: 50%;
}
.monogram::after { content: ''; position: absolute; inset: 5px; border: 1px solid var(--gold-faint); border-radius: 50%; }
.monogram .logo { width: 96px; }
.closing__names { margin: 26px 0 8px; font-size: 40px; }
.closing__tag { margin: 0 0 30px; font: 400 13px/1.6 var(--font-body); letter-spacing: .28em; color: var(--gold-text); }
.closing__hy { display: block; font-size: 26px; color: var(--gold); }

.noscript { padding: 24px; text-align: center; }


/* =====================================================================
   MOTION
   ===================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out); }
.js .reveal--left:not(.is-visible) { transform: translateX(-28px); }
.js .reveal--right:not(.is-visible) { transform: translateX(28px); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .sketch .ln { stroke-dashoffset: 0; animation: none; }
  .sketch .petal { fill-opacity: .9; }
  .js .sketch__ink { opacity: .9; }
  *, *::before, *::after { animation-duration: .01ms; transition-duration: .01ms; transition-delay: 0s; }
  .js .reveal { opacity: 1; transform: none; }
}

/* =====================================================================
   TABLET: same single column, a little more air
   ===================================================================== */
@media (min-width: 600px) {
  .card { max-width: 600px; }
  .section { padding-left: 48px; padding-right: 48px; }
  .controls { top: 20px; right: 24px; }
  .music { right: 24px; bottom: 24px; }
}

/* =====================================================================
   DESKTOP (≥ 960px): full-width page, each section laid out for the screen
   ===================================================================== */
@media (min-width: 960px) {
  :root { --pad: 64px; }
  .card { max-width: none; }
  .section { padding: 132px var(--pad); }
  .section + .section::before { height: 64px; }
  .title { font-size: 46px; margin-bottom: 44px; }
  .kicker { font-size: 12px; }
  .muted { font-size: 16px; }

  /* Hero: arch portrait left, names and date right, one full screen */
  .hero {
    display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    grid-template-areas: "photo kicker" "photo names" "photo lead" "photo date" "photo lunar" "photo quote";
    align-content: center; column-gap: 7vw;
    max-width: 1280px; min-height: 100dvh; margin: 0 auto;
    padding-top: 88px; padding-bottom: 88px;
  }
  .hero > .kicker { grid-area: kicker; align-self: end; margin-bottom: 8px; }
  .hero__photo { grid-area: photo; width: 100%; max-width: 580px; margin: 0 auto; align-self: center; }
  .hero__lead { grid-area: lead; font-size: 23px; margin: 22px auto 40px; }
  .hero__names { grid-area: names; font-size: clamp(72px, 7vw, 104px); }
  .hero .date { grid-area: date; max-width: 400px; }
  .hero .date .date__big { font-size: 56px; }
  .hero__lunar { grid-area: lunar; font-size: 18px; }
  .hero__quote { grid-area: quote; align-self: start; max-width: 22em; margin-inline: auto; font-size: 20px; }
  .hero__sprig { left: auto; right: 3vw; top: 24px; width: 220px; height: 74px; transform: none; }

  /* Family */
  .family__intro { font-size: 21px; margin-bottom: 48px; }
  .family__col { padding: 0 32px; }
  .family__art { max-width: 230px; margin-bottom: 18px; }
  .family__parent { font-size: 22px; }
  .family__thread { margin: 14px 0 10px; }
  .sketch--thread g { stroke-width: .8; }
  .family__person .person { font-size: 38px; }

  /* Events: three cards side by side */
  .events__list { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; max-width: 1180px; margin: 0 auto; }
  .event { display: flex; flex-direction: column; padding: 48px 64px 44px; }
  .event__art { margin: -6px 0 22px; }
  .sketch--venue g { stroke-width: .75; } /* the drawing is scaled up 2x here */
  .event__venue { font-size: 38px; }
  .event__big { font-size: 46px; }
  .event__sub { font-size: 15.5px; }
  .event__addr { font-size: 22px; }
  .event__label { font-size: 13px; }
  .event__actions { margin-top: auto; padding-top: 30px; }

  .events__list:not(:has(> :nth-child(2))) { max-width: 780px; } /* a single event stays card-width */
  .js .reveal--left:not(.is-visible) { transform: translateX(-56px); }
  .js .reveal--right:not(.is-visible) { transform: translateX(56px); }

  /* Program: sketches in a row */
  .program__list { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 28px; max-width: 1180px; }
  .program__item, .program__item:nth-child(even) { display: block; padding: 0; text-align: center; }
  .program__item + .program__item { border-top: 0; }
  .program__art { max-width: 190px; margin: 0 auto 22px; }
  .program__time { font-size: 44px; }
  .program__title { font-size: 23px; }
  .program__note { font-size: 16px; }
  .gift__art { width: 190px; }

  /* Countdown */

  /* Album: four columns */
  .album { --cols: 4; --gap: 1%; max-width: 1120px; margin: 0 auto; row-gap: 14px; }
  .album__item--landscape { aspect-ratio: 1.531; } /* same row height as a portrait at this gap */

  /* Story: horizontal timeline */
  .story__list { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 32px; max-width: 1080px; text-align: center; }
  .story__list::before { left: 0; right: 0; top: 6px; bottom: auto; width: auto; height: 1px; }
  .story__item { padding: 40px 0 0; }
  .story__item::before { left: calc(50% - 5px); top: 2px; }
  .story__title { font-size: 24px; }

  /* Gift */
  .gift__panel { grid-template-columns: 1fr 1fr; gap: 28px; max-width: 820px; margin-left: auto; margin-right: auto; }

  /* RSVP: .field--half puts two short fields on one row */
  .form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 36px; max-width: 680px; }
  .form > * { grid-column: 1 / -1; }
  .form > .field--half { grid-column: auto; }
  .thanks { max-width: 560px; }

  .closing__names { font-size: 56px; }
}


/* ==========================================================================
   Music toggle: 48px circle, bottom right, fades in after the opening.
   While playing, a soft ring pulses (brief section D). Paused: icon at 60%.
   ========================================================================== */
.music {
  position: fixed;
  right: var(--space-2);
  bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: grid;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  padding: 0;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--burgundy);
  box-shadow: 0 2px 10px var(--shadow);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
.music.is-in { opacity: 1; }
.music svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.music[aria-pressed="false"] svg { opacity: .6; }
.music::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--burgundy);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.music[aria-pressed="true"]::after { animation: pulse 2s var(--ease-out) infinite; }
@keyframes pulse {
  from { transform: scale(1); opacity: .5; }
  to { transform: scale(1.25); opacity: 0; }
}

/* Last on purpose: the hidden attribute wins over display rules of the same specificity */
[hidden] { display: none; }
