/* =========================================================================
   HM Digital Wedding Invitation
   Palette sampled from the supplied logo artwork (logo.ai).
   ========================================================================= */

:root {
  --brown: #432815;          /* crest / envelope brown (sampled) */
  --brown-deep: #2e1b0e;
  --brown-soft: #5a3a22;
  --gold: #e5b973;           /* crest gold (sampled) */
  --gold-light: #f1d39c;
  --gold-ink: #8a6223;       /* gold for small text on ivory (AA contrast) */
  --ivory: #f8f5e9;
  --ivory-deep: #efe8d2;
  --ink: #4a3326;            /* body text on ivory */
  --ink-soft: #6e5544;

  --font-km-display: "Moul", "Khmer OS Muol Light", serif;
  --font-km: "Battambang", "Khmer OS Battambang", "Noto Sans Khmer", sans-serif;
  --font-en-caps: "Cinzel", "Trajan Pro", Georgia, serif;
  --font-en: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  --ease: cubic-bezier(.6, .05, .25, 1);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --pattern: url("assets/pattern-kbach.png");
  --pattern-size: 180px 179px;
  --pattern-vector: url("assets/pattern-kbach.svg"); /* one repeat of the printed kbach pattern (500 × 497 px source) */

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%; scroll-behavior: smooth;
  /* No sideways panning on iOS: clip anything wider than the screen at the root */
  overflow-x: hidden; overflow-x: clip;
  /* No rubber-band / pull-to-refresh, so the page never reveals a plain background */
  overscroll-behavior: none;
  background-color: #24150a;
}
html.is-locked, html.is-locked body { overflow: hidden; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-km), var(--font-en);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overscroll-behavior: none;
  font-variant-numeric: lining-nums;
}

img { max-width: 100%; height: auto; display: block; }
p { margin: 0; }

.km { font-family: var(--font-km); }
.km-display { font-family: var(--font-km-display); font-weight: 400; line-height: 1.9; }
.km-strong { font-family: var(--font-km); font-weight: 700; }
.latin { font-family: var(--font-km); font-weight: 700; }
.en, .body-en { font-family: var(--font-en); }
.en-caps { font-family: var(--font-en-caps); letter-spacing: .06em; text-transform: uppercase; font-size: .82rem; color: var(--gold-ink); line-height: 1.6; }
.amp { font-family: var(--font-en); font-style: italic; color: var(--gold-ink); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--brown); color: var(--ivory); padding: 8px 14px; border-radius: 4px;
}
.skip-link:focus { top: 16px; }

:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; }
.section--brown :focus-visible, .opening :focus-visible { outline-color: var(--gold); }

/* =========================================================================
   LANGUAGE — html[data-lang] shows one language at a time
   ========================================================================= */
html[data-lang="km"] body [lang="en"],
html[data-lang="en"] body [lang="km"] { display: none !important; }
html[data-lang="en"] .cover__title--en { font: 600 clamp(1.15rem, 6vw, 1.6rem)/1.3 var(--font-en-caps); letter-spacing: .08em; text-transform: uppercase; }
.cover__names.cover__names--km { font-family: var(--font-km); letter-spacing: 0; text-transform: none; font-size: clamp(.85rem, 3.8vw, 1.05rem); }
.plaque__km--en { font: italic 500 .95rem var(--font-en); color: var(--gold-ink); }
.hero__title-en { display: block; font: 600 clamp(1.35rem, 6.5vw, 2rem)/1.3 var(--font-en-caps); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); }
.hero__invite--en { font: italic 500 1.1rem var(--font-en); color: var(--ink-soft); }
html[data-lang="en"] .hero__names-en { margin-top: 12px; font-family: 'Great Vibes', var(--font-en); text-transform: none; letter-spacing: 0; font-size: clamp(1.6rem, 6.6vw, 2.4rem); color: var(--gold-ink); line-height: 1.25; }
html[data-lang="en"] .hero__venue { font-family: var(--font-en); font-size: 1.05rem; }
html[data-lang="en"] .couple__join .amp { font-size: 2rem; }
.map-sketch .co-en { transform: translateY(-6px); }
.map-sketch .co.km { transform: translateY(5px); }

/* Language switch — on the cover (top right) and in the dock */
.lang-switch {
  position: absolute; z-index: 5; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right));
  display: flex; padding: 3px; border-radius: 999px; background: rgba(30, 17, 8, .55);
  border: 1px solid rgba(229, 185, 115, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .4s ease;
}
.lang-switch button {
  min-width: 44px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--gold-light); font: 700 .85rem var(--font-km), var(--font-en); letter-spacing: .04em;
  transition: background-color .25s ease, color .25s ease;
}
html[data-lang="km"] .lang-switch [data-set-lang="km"], html[data-lang="en"] .lang-switch [data-set-lang="en"] { background: var(--gold); color: var(--brown-deep); }
.opening:not([data-state="closed"]) .lang-switch { opacity: 0; pointer-events: none; }
.dock__lang {
  min-width: 46px; height: 34px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(229, 185, 115, .6); background: rgba(229, 185, 115, .12); color: var(--gold-light);
  font: 700 .85rem var(--font-km), var(--font-en); letter-spacing: .04em;
}
.dock__lang:hover { background: rgba(229, 185, 115, .25); }
body { transition: opacity .18s ease; }
html.lang-swap body { opacity: 0; }

/* =========================================================================
   OPENING — full-screen gatefold:
   closed → opening (doors swing toward the guest) → glowing (crest draws in gold)
   → blooming (flash of light into the page) → done
   ========================================================================= */

.opening, .ambient, .cover__dust { display: none; }

.js .opening {
  --seal-w: min(44vw, 210px, 27svh);
  --seal-h: calc(var(--seal-w) * .9625);
  --seal-y: 33%;
  --frame-inset: max(8px, env(safe-area-inset-top));
  --door-ease: cubic-bezier(.6, .02, .25, 1);
  position: fixed; inset: 0; z-index: 50; display: block;
  background: var(--brown-deep); overflow: hidden;
  transition: opacity .7s ease, visibility 0s linear .7s;
}
.js .opening[data-state="done"] { opacity: 0; visibility: hidden; pointer-events: none; }
.opening.no-anim, .opening.no-anim * { transition: none !important; }

/* ---- Layer 2: framed brown panel ---- */
.inner {
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 50% at 50% 45%, rgba(229, 185, 115, .14), transparent 70%),
    radial-gradient(120% 90% at 50% 50%, transparent 40%, rgba(0, 0, 0, .5) 100%),
    var(--pattern) 0 0 / var(--pattern-size),
    var(--brown);
}
.inner__beam {
  position: absolute; left: 50%; top: -5%; bottom: -5%; width: 3px; transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, #fff6dc 25%, #fff 50%, #fff6dc 75%, transparent);
  box-shadow: 0 0 24px 8px rgba(255, 214, 140, .55), 0 0 80px 30px rgba(229, 185, 115, .35);
  opacity: 0; transition: opacity .4s ease, width 1.4s var(--door-ease);
}
.inner__halo {
  position: absolute; left: 50%; top: 47%; width: 120vmax; height: 120vmax;
  transform: translate(-50%, -50%) scale(.6);
  background: radial-gradient(closest-side, rgba(255, 226, 170, .45), rgba(229, 185, 115, .15) 35%, transparent 70%);
  opacity: 0; transition: opacity 1.2s ease, transform 2.4s var(--ease-out);
}
.inner__sparkles { position: absolute; inset: 0; width: 100%; height: 100%; }
.inner__bloom {
  position: absolute; left: 50%; top: 47%; width: 40vmax; height: 40vmax; margin: -20vmax 0 0 -20vmax; border-radius: 50%;
  background: radial-gradient(closest-side, #fffdf6 0%, var(--ivory) 62%, rgba(248, 245, 233, 0) 100%);
  transform: scale(0); transition: transform 1.3s cubic-bezier(.55, 0, .3, 1);
}
/* Panel frame: same place and look as the fixed page frame, so the hand-off is seamless */
.inner__frame {
  position: absolute; pointer-events: none;
  top: var(--frame-inset); bottom: max(8px, env(safe-area-inset-bottom));
  left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));
  border: 1.5px solid var(--gold);
  clip-path: inset(50% -30px 50% -30px);
  transition: clip-path 1.3s var(--ease);
}
.inner__frame::before { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(229, 185, 115, .7); }
.inner__corner {
  position: absolute; width: 46px; height: 46px; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transition: opacity .6s ease .9s;
}
.inner__corner path:first-child { fill: var(--gold); }
.inner__corner--tl { top: -4px; left: -4px; }
.inner__corner--tr { top: -4px; right: -4px; transform: scaleX(-1); }
.inner__corner--bl { bottom: -4px; left: -4px; transform: scaleY(-1); }
.inner__corner--br { bottom: -4px; right: -4px; transform: scale(-1, -1); }
@media (min-width: 900px) { .inner__frame { top: 14px; bottom: 14px; left: 14px; right: 14px; } .inner__corner { width: 60px; height: 60px; } }

/* Crest: JS places it over the hero crest, then offsets it to the centre (FLIP). It draws itself in. */
.inner__crest {
  position: absolute; left: 0; top: 0; width: 200px; height: 200px; transform-origin: 50% 50%;
  transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(var(--s, 1));
  opacity: 0; filter: drop-shadow(0 0 12px rgba(255, 214, 140, .55));
  transition: opacity .4s ease, transform 1.3s var(--ease), filter 1.2s ease;
}
.inner__crest img {
  width: 100%; height: 100%;
  -webkit-mask: linear-gradient(180deg, #000 0 40%, transparent 56% 100%) 0 100% / 100% 250% no-repeat;
          mask: linear-gradient(180deg, #000 0 40%, transparent 56% 100%) 0 100% / 100% 250% no-repeat;
  transition: -webkit-mask-position 2s cubic-bezier(.45, .05, .4, 1) .25s, mask-position 2s cubic-bezier(.45, .05, .4, 1) .25s;
}
.inner__pen { /* the glowing "pen" line that leads the drawing */
  position: absolute; left: 6%; right: 6%; top: 0; height: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, transparent, #fff6dc, transparent);
  box-shadow: 0 0 12px 4px rgba(255, 214, 140, .7);
}
.inner__shine {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 250, 230, .95) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%; background-position: 140% 0;
  -webkit-mask: url("assets/crest-gold.webp") center / contain no-repeat;
          mask: url("assets/crest-gold.webp") center / contain no-repeat;
}
.inner__jewel { position: absolute; left: 50%; top: 86%; width: 18%; aspect-ratio: 1; margin-left: -9%; transform: scale(0) rotate(-90deg); opacity: 0; }
.inner__jewel svg { width: 100%; height: 100%; fill: #fff7e0; filter: drop-shadow(0 0 6px rgba(255, 230, 170, .95)); }

/* ---- Layer 1: doors ---- */
.gates {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit;
  cursor: pointer; perspective: 1400px; perspective-origin: 50% 45%; -webkit-tap-highlight-color: transparent;
}
.gates:focus-visible { outline: none; }
.gates:focus-visible .cover__btn { outline: 2px solid var(--gold); outline-offset: 4px; }
.gate {
  position: absolute; top: 0; bottom: 0; width: 50.2%;
  transform-style: preserve-3d; will-change: transform;
  transition: transform 1.6s var(--door-ease), opacity .6s ease;
}
.gate--left { left: 0; transform-origin: 0 50%; z-index: 2; }
.gate--right { right: 0; transform-origin: 100% 50%; z-index: 1; }
.gate__face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.gate__front {
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(0, 0, 0, .18)), var(--pattern) 0 0 / var(--pattern-size), var(--brown);
}
.gate--left .gate__front { box-shadow: inset -14px 0 22px -12px rgba(0, 0, 0, .6), 8px 0 16px -6px rgba(0, 0, 0, .45); }
.gate--right .gate__front { box-shadow: inset 14px 0 22px -12px rgba(0, 0, 0, .6); }
.gate__back { transform: rotateY(180deg); background: linear-gradient(90deg, #2a180c, #4a2d18); }
.gate__lining { position: absolute; inset: 16px 14px; border: 1px solid rgba(229, 185, 115, .5); border-radius: 2px; }
.gate__frame {
  position: absolute; top: max(18px, 3svh); bottom: max(18px, 3svh); border: 1.5px solid var(--gold);
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
}
.gate--left .gate__frame { left: max(16px, 4vw); right: 10px; }
.gate--right .gate__frame { right: max(16px, 4vw); left: 10px; }
.gate__frame::before {
  content: ""; position: absolute; inset: 5px; border: 1px solid var(--gold);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
}
.gate__shade { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 1.6s var(--door-ease); }
.gate--left .gate__shade { background: linear-gradient(90deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .55)); }
.gate--right .gate__shade { background: linear-gradient(-90deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .55)); }

/* Seal rides on the left door's edge, overlapping the seam */
.seal {
  position: absolute; left: calc(100% - var(--seal-w) / 2); top: calc(var(--seal-y) - var(--seal-h) / 2);
  width: var(--seal-w); height: var(--seal-h);
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .45));
  transition: transform .5s cubic-bezier(.3, 1.4, .5, 1), filter .5s ease;
}
.seal img { width: 100%; height: 100%; }
.seal__glint {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 244, 210, .6) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%; background-position: 140% 0;
  -webkit-mask: url("assets/hm-seal.webp") center / contain no-repeat; mask: url("assets/hm-seal.webp") center / contain no-repeat;
  animation: glint 4.2s ease-in-out 1s infinite;
}
@keyframes glint { 0%, 50% { background-position: 140% 0; } 80%, 100% { background-position: -40% 0; } }

/* Cover text, plaque, button, hand, stars */
.cover { position: absolute; inset: 0; pointer-events: none; color: var(--gold); z-index: 3; transition: opacity .45s ease; }
.cover__top {
  position: absolute; left: 0; right: 0; top: max(7svh, 52px);
  display: flex; flex-direction: column; align-items: center; gap: 0; text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}
.cover__title { font-size: clamp(.95rem, 5vw, 1.4rem); line-height: 1.9; }
.cover__names { font-family: var(--font-en-caps); letter-spacing: .14em; font-size: clamp(.7rem, 3.2vw, .92rem); text-transform: uppercase; color: var(--gold-light); }
.cover__names i { font-family: var(--font-en); text-transform: none; font-size: 1.2em; }

.plaque {
  position: absolute; left: 50%; top: calc(var(--seal-y) + var(--seal-h) / 2 + clamp(26px, 6svh, 60px));
  transform: translateX(-50%); width: min(84vw, 380px);
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 22px 14px;
  background: linear-gradient(180deg, #fbf6e6, #f1e6c9); color: var(--brown);
  border: 1.5px solid var(--gold); border-radius: 6px;
  box-shadow: 0 0 0 4px rgba(46, 27, 14, .35), 0 0 0 5px rgba(229, 185, 115, .7), 0 14px 26px rgba(0, 0, 0, .35);
}
.plaque::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(185, 138, 67, .55); border-radius: 3px; pointer-events: none; }
.plaque__km { font-size: .8rem; color: var(--gold-ink); }
.plaque__name { font: 700 clamp(1.05rem, 5vw, 1.3rem)/1.5 var(--font-km), var(--font-en); text-align: center; }

.cover__cta { position: absolute; left: 50%; bottom: max(15svh, 92px); transform: translateX(-50%); }
.cover__btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  min-height: 46px; padding: 8px 26px; border: 1.5px solid var(--gold); border-radius: 999px;
  background: linear-gradient(180deg, #fbf3dc, #ecdcb4); color: var(--brown);
  font: 600 1.02rem var(--font-en); letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 0 0 3px rgba(46, 27, 14, .4), 0 10px 20px rgba(0, 0, 0, .35);
}
.cover__btn .km { font-weight: 700; font-size: .9rem; text-transform: none; letter-spacing: 0; }
.cover__btn::after { content: ""; position: absolute; inset: -1.5px; border-radius: inherit; border: 1.5px solid var(--gold); animation: ripple 2.4s ease-out infinite; }
@keyframes ripple { 0% { transform: scale(1); opacity: .8; } 70%, 100% { transform: scale(1.18, 1.6); opacity: 0; } }
.cover__hand {
  position: absolute; right: -6px; top: 22px; width: 40px; height: 46px;
  fill: #f6d7a6; stroke: #8a6223; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); transform-origin: 40% 10%;
  animation: tap 1.6s ease-in-out .8s infinite;
}
@keyframes tap { 0%, 100% { transform: translate(0, 0) rotate(-12deg); } 40% { transform: translate(-6px, -8px) rotate(-12deg) scale(.94); } 55% { transform: translate(-6px, -8px) rotate(-12deg) scale(.86); } }
.cover__date { position: absolute; left: 0; right: 0; bottom: max(8svh, 48px); text-align: center; font-family: var(--font-en); letter-spacing: .3em; font-size: .9rem; color: var(--gold); }

.twinkle { position: absolute; width: calc(18px * var(--s, 1)); height: calc(18px * var(--s, 1)); margin: -9px; animation: twinkle 3.2s ease-in-out var(--d, 0s) infinite; opacity: 0; }
.twinkle svg { width: 100%; height: 100%; fill: #fff4d6; filter: drop-shadow(0 0 4px rgba(255, 226, 170, .9)); }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.2) rotate(0deg); } 45% { opacity: 1; transform: scale(1) rotate(45deg); } 70% { opacity: 0; transform: scale(.3) rotate(90deg); } }

.cover__dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .6s ease; }
.js .cover__dust { display: block; }

.opening__skip {
  position: absolute; z-index: 4;
  right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(46, 27, 14, .4); border: 1px solid rgba(229, 185, 115, .4); border-radius: 999px;
  padding: 8px 16px; min-height: 40px; font: 500 .95rem var(--font-en); color: var(--gold-light);
  cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .4s ease;
}

/* ---- Beat 1: opening — plaque fades, seal lifts, doors swing toward the guest (right, then left) ---- */
.opening:not([data-state="closed"]) .cover, .opening:not([data-state="closed"]) .cover__dust { opacity: 0; }
.opening:not([data-state="closed"]) .seal__glint, .opening:not([data-state="closed"]) .cover__btn::after,
.opening:not([data-state="closed"]) .cover__hand, .opening:not([data-state="closed"]) .twinkle { animation: none; }
.opening:not([data-state="closed"]):not([data-state="done"]) .opening__skip { opacity: 1; pointer-events: auto; }
.opening:not([data-state="closed"]) .gates { cursor: default; }
.opening:not([data-state="closed"]) .seal { transform: translateZ(30px) scale(1.06); filter: drop-shadow(0 22px 22px rgba(0, 0, 0, .5)); }
.opening[data-state="opening"] .inner__beam { opacity: .75; width: 10vw; filter: blur(6px); transition: opacity .3s ease .2s, width 1.6s var(--door-ease) .3s; }

.opening:not([data-state="closed"]) .gate--right { transform: rotateY(118deg); transition-delay: .3s; }
.opening:not([data-state="closed"]) .gate--left { transform: rotateY(-118deg); transition: transform 1.75s var(--door-ease) .55s, opacity .6s ease; }
.opening:not([data-state="closed"]) .gate__shade { opacity: 1; }

/* ---- Beat 2: glowing — frame draws, crest draws itself in gold, shine, jewel ---- */
.opening[data-state="glowing"] .gate, .opening[data-state="blooming"] .gate, .opening[data-state="done"] .gate { opacity: 0; }
.opening[data-state="glowing"] .inner__beam { opacity: 0; width: 80vw; transition: opacity .8s ease, width 1s ease; }
.opening[data-state="glowing"] .inner__frame, .opening[data-state="blooming"] .inner__frame, .opening[data-state="done"] .inner__frame { clip-path: inset(-30px); }
.opening[data-state="glowing"] .inner__corner, .opening[data-state="blooming"] .inner__corner, .opening[data-state="done"] .inner__corner { opacity: 1; }
.opening[data-state="glowing"] .inner__halo { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.opening[data-state="glowing"] .inner__crest, .opening[data-state="blooming"] .inner__crest, .opening[data-state="done"] .inner__crest { opacity: 1; }
.opening[data-state="glowing"] .inner__crest img, .opening[data-state="blooming"] .inner__crest img, .opening[data-state="done"] .inner__crest img {
  -webkit-mask-position: 0 0; mask-position: 0 0;
}
.opening[data-state="glowing"] .inner__pen { animation: pen 2s cubic-bezier(.45, .05, .4, 1) .25s 1 both; }
@keyframes pen { 0% { top: 0; opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.opening[data-state="glowing"] .inner__shine { animation: shine 1.4s ease-in-out 2.1s 1 both; }
@keyframes shine { from { background-position: 140% 0; } to { background-position: -40% 0; } }
.opening[data-state="glowing"] .inner__jewel { animation: jewel 1.2s cubic-bezier(.3, 1.6, .5, 1) 2.2s 1 both; }
@keyframes jewel { 0% { opacity: 0; transform: scale(0) rotate(-90deg); } 60% { opacity: 1; transform: scale(1.25) rotate(20deg); } 100% { opacity: 0; transform: scale(.4) rotate(90deg); } }
.opening[data-state="glowing"] .inner__crest { filter: drop-shadow(0 0 20px rgba(255, 214, 140, .75)); }

/* ---- Beat 3: blooming — flash of light; crest lands on the page crest ---- */
.opening[data-state="blooming"] .inner__bloom, .opening[data-state="done"] .inner__bloom { transform: scale(6); }
.opening[data-state="blooming"] .inner__halo { opacity: 0; }
.opening[data-state="blooming"] .inner__crest, .opening[data-state="done"] .inner__crest {
  transform: none; filter: drop-shadow(0 0 0 rgba(255, 214, 140, 0));
  transition: transform 1.3s var(--ease), filter 1.3s ease;
}

/* Short screens (phones held sideways): compact cover */
@media (max-height: 520px) {
  .js .opening { --seal-w: 24svh; --seal-y: 40%; }
  .cover__top { top: 30px; }
  .cover__title { font-size: 1rem; line-height: 1.7; }
  .cover__names { font-size: .7rem; }
  .plaque { top: auto; bottom: 74px; padding: 6px 16px; width: min(60vw, 340px); }
  .plaque__km { display: none; }
  .cover__cta { bottom: 22px; }
  .cover__date { display: none; }
}

/* Reduced motion: no 3D, no particles — a calm cross-fade */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .seal__glint, .cover__btn::after, .cover__hand, .twinkle, .inner__shine, .inner__pen, .inner__jewel { animation: none !important; }
  .js .opening { transition: opacity .4s ease, visibility 0s linear .4s; }
  .cover__dust, .ambient { display: none !important; }
}

/* ---- Gold frame fixed around the screen while the page scrolls ---- */
.page-frame {
  position: fixed; z-index: 41; pointer-events: none;
  top: max(8px, env(safe-area-inset-top)); bottom: max(8px, env(safe-area-inset-bottom));
  left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));
  border: 1.5px solid var(--gold);
  transition: clip-path 1.4s var(--ease) .1s;
  clip-path: inset(-30px);
}
.page-frame::before { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(229, 185, 115, .7); }
.page-frame.no-anim, .page-frame.no-anim .page-frame__corner { transition: none !important; }
.page-frame__corner {
  position: absolute; width: 46px; height: 46px;
  fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: opacity .7s ease 1.2s, transform .8s var(--ease-out) 1.2s;
}
.page-frame__corner path:first-child { fill: var(--gold); }
.page-frame__corner--tl { top: -4px; left: -4px; }
.page-frame__corner--tr { top: -4px; right: -4px; transform: scaleX(-1); }
.page-frame__corner--bl { bottom: -4px; left: -4px; transform: scaleY(-1); }
.page-frame__corner--br { bottom: -4px; right: -4px; transform: scale(-1, -1); }
.js.is-pre-reveal .page-frame { clip-path: inset(50% -30px 50% -30px); }
.js.is-pre-reveal .page-frame__corner { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .page-frame, .page-frame__corner { transition: none !important; }
  .js.is-pre-reveal .page-frame { clip-path: inset(-30px); }
}
@media (min-width: 900px) { :root { --pattern-size: 250px 249px; } .page-frame { top: 14px; bottom: 14px; left: 14px; right: 14px; } .page-frame__corner { width: 60px; height: 60px; } }

/* ---- Ambient gold dust over the page + music toggle ---- */
.js .ambient {
  display: block; position: fixed; inset: 0; z-index: 40;
  width: 100%; height: 100%; pointer-events: none;
}
/* ---- Bottom dock: menu + sound ---- */
.dock {
  position: fixed; z-index: 45; left: 50%; transform: translateX(-50%);
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  width: min(calc(100% - 44px), 420px); height: 52px; padding: 0 6px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 999px; border: 1px solid rgba(229, 185, 115, .55);
  background: rgba(46, 27, 14, .78); -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, .55);
  transition: transform .6s var(--ease-out), opacity .5s ease;
}
.js.is-pre-reveal .dock { transform: translate(-50%, 160%); opacity: 0; }
.dock__btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: var(--gold-light);
  display: grid; place-items: center; cursor: pointer; transition: background-color .2s ease;
}
.dock__btn:hover { background: rgba(229, 185, 115, .15); }
.dock__btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dock__btn .spk { fill: currentColor; stroke: none; }
.dock__mark { font: 600 .82rem var(--font-en-caps); letter-spacing: .14em; color: var(--gold); }
.dock__mark i { font-family: var(--font-en); font-size: 1.1em; }
.music-btn[hidden] { display: grid; visibility: hidden; }
.music-btn .mute { display: none; }
.music-btn[aria-pressed="false"] .wave { display: none; }
.music-btn[aria-pressed="false"] .mute { display: inline; }
.music-btn[aria-pressed="true"] .w1 { animation: wave 1.4s ease-in-out infinite; }
.music-btn[aria-pressed="true"] .w2 { animation: wave 1.4s ease-in-out .2s infinite; }
@keyframes wave { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(30, 17, 8, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadein .3s ease; }
.sheet__panel {
  position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(calc(100% - 28px), 440px); padding: 18px 18px 14px; border-radius: 24px;
  background: linear-gradient(180deg, #fffdf6, #f5ecd6); border: 1px solid rgba(229, 185, 115, .7);
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, .5); animation: sheetup .4s var(--ease-out);
}
@keyframes sheetup { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@keyframes fadein { from { opacity: 0; } }
.sheet__title { text-align: center; font: 600 .82rem var(--font-en-caps); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); }
.sheet__title .km-display { display: block; font-size: 1.15rem; color: var(--gold-ink); letter-spacing: 0; text-transform: none; }
.sheet__list { list-style: none; margin: 10px 0 6px; padding: 0; }
.sheet__list a {
  display: flex; align-items: baseline; gap: 10px; padding: 12px 10px; border-radius: 12px;
  text-decoration: none; color: var(--brown); font: 600 1.08rem var(--font-en);
  border-bottom: 1px dashed rgba(138, 98, 35, .25);
}
.sheet__list li:last-child a { border-bottom: 0; }
.sheet__list a:hover, .sheet__list a:focus-visible { background: rgba(229, 185, 115, .18); }
.sheet__list .km { min-width: 7.5em; font-weight: 700; font-size: .92rem; color: var(--ink); }
.sheet__close { display: block; width: 100%; margin-top: 6px; min-height: 44px; border: 0; border-radius: 12px; background: var(--brown); color: var(--gold-light); font: 600 1rem var(--font-en), var(--font-km); cursor: pointer; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================================
   MAIN INVITATION
   ========================================================================= */

main { display: block; outline: none; }

/* Ivory sections are see-through: the fixed .bg-art layer (vector kbach + moving gold light) shows behind them */
.section--ivory {
  background: radial-gradient(90% 60% at 50% 30%, rgba(252, 250, 242, .5), rgba(252, 250, 242, 0) 75%);
}

/* ---- Background art (fixed behind the page): the kbach drawn as thin outlines, tone-on-tone,
   with soft patches of gold light drifting along the outlines, plus twinkling stars (ambient canvas) ---- */
.bg-art { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; --line: url("assets/pattern-kbach-line.svg"); --line-size: 330px 328px; }
.bg-art__base, .bg-art__glow {
  position: absolute; inset: 0;
  -webkit-mask: var(--line) 50% 0 / var(--line-size) repeat;
          mask: var(--line) 50% 0 / var(--line-size) repeat;
}
.bg-art__base { background: rgba(229, 185, 115, .06); }
.glow { position: absolute; border-radius: 50%; opacity: 0; will-change: opacity, transform; animation: 56s cubic-bezier(.45, 0, .55, 1) infinite; }
/* soft, slow "breathing" pools of light; they overlap gently so the change is never abrupt */
.glow--top    { left: -10%; top: -18%; width: 120%; height: 46%; background: radial-gradient(closest-side, rgba(255, 232, 180, .7), rgba(229, 185, 115, .3) 50%, transparent 100%); animation-name: gTop; }
.glow--bottom { left: -10%; bottom: -18%; width: 120%; height: 46%; background: radial-gradient(closest-side, rgba(255, 232, 180, .7), rgba(229, 185, 115, .3) 50%, transparent 100%); animation-name: gBottom; }
.glow--ring   { left: 50%; top: 50%; width: 120vmin; height: 120vmin; margin: -60vmin 0 0 -60vmin;
  background: radial-gradient(closest-side, transparent 45%, rgba(255, 232, 180, .55) 66%, rgba(229, 185, 115, .2) 80%, transparent 95%); animation-name: gRing; }
.glow--left   { left: -30%; top: 15%; width: 70%; height: 70%; background: radial-gradient(closest-side, rgba(255, 232, 180, .6), transparent); animation-name: gLeft; }
.glow--right  { right: -30%; top: 15%; width: 70%; height: 70%; background: radial-gradient(closest-side, rgba(255, 232, 180, .6), transparent); animation-name: gRight; }
@keyframes gTop    { 0%, 100% { opacity: .05; transform: translateX(-6%); } 20% { opacity: .45; } 40% { opacity: .05; transform: translateX(6%); } }
@keyframes gBottom { 0%, 30%, 100% { opacity: .05; transform: translateX(6%); } 50% { opacity: .45; } 70% { opacity: .05; transform: translateX(-6%); } }
@keyframes gRing   { 0%, 45%, 100% { opacity: 0; transform: scale(.92); } 65% { opacity: .35; } 85% { opacity: 0; transform: scale(1.05); } }
@keyframes gLeft   { 0%, 100% { opacity: .25; transform: translateY(6%); } 15% { opacity: .05; } 75% { opacity: .05; transform: translateY(-6%); } 90% { opacity: .3; } }
@keyframes gRight  { 0%, 55%, 100% { opacity: 0; transform: translateY(-6%); } 78% { opacity: .35; transform: translateY(4%); } 95% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .glow { animation: none !important; } .glow--top, .glow--bottom { opacity: .2; } }

/* ---- Dark theme: the page sits on the dark background like the reference; one switch (body.theme-dark) ---- */
.theme-dark { background: transparent; }
.theme-dark .bg-art { background: radial-gradient(120% 80% at 50% 40%, #3a2213, #24150a 70%, #1c1008); }
.theme-dark main {
  --ink: #efe3c8; --ink-soft: #cdb894; --gold-ink: #e5b973; --brown: #f1d39c; --brown-soft: #e2c48e;
  color: var(--ink);
}
.theme-dark .section--ivory { background: transparent; }
.theme-dark .section--brown, .theme-dark .band { background: transparent; }
.theme-dark .section--brown::before, .theme-dark .band::before { display: none; }
.theme-dark .bigdate__num { background: linear-gradient(180deg, #fff1c9, #e5b973 55%, #b98a43); -webkit-background-clip: text; background-clip: text; }
.theme-dark .guest-plate { background: rgba(229, 185, 115, .12); }
.theme-dark .timeline__item::before { background: #2e1b0e; }
.theme-dark .timeline__item.is-lit::before { background: var(--gold); }
.theme-dark .timeline__item--main { background: rgba(229, 185, 115, .08); }
.theme-dark .closing { color: var(--gold); }
/* light cards keep their original ink */
.theme-dark .rsvp-card, .theme-dark .venue__map {
  --ink: #4a3326; --ink-soft: #6e5544; --gold-ink: #8a6223; --brown: #432815; --brown-soft: #5a3a22; color: var(--ink);
}
.theme-dark .rsvp-intro, .theme-dark .rsvp-intro .km { color: var(--ink-soft); }
.theme-dark .rsvp-intro .km { color: var(--ink); }

/* Brown surfaces: the same gold light shimmering through the kbach motifs */
.section--brown, .band { position: relative; }
.section--brown, .band, .gate__front, .inner { isolation: isolate; }
.section--brown::before, .band::before, .gate__front::before, .inner::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 0%, rgba(241, 211, 156, .0) 30%, rgba(255, 236, 190, .55) 45%, rgba(229, 185, 115, .35) 52%, transparent 68%) no-repeat;
  background-size: 300% 100%;
  -webkit-mask: var(--pattern-vector) 0 0 / var(--pattern-size) repeat;
          mask: var(--pattern-vector) 0 0 / var(--pattern-size) repeat;
  opacity: .35;
  animation: goldSweep 14s cubic-bezier(.45, 0, .55, 1) infinite;
}
.gate--right .gate__front::before { animation-delay: -1.2s; }
@keyframes goldSweep { 0% { background-position: 120% 0; } 60%, 100% { background-position: -20% 0; } }

@media (prefers-reduced-motion: reduce) {
  .section--brown::before, .band::before, .gate__front::before, .inner::before { animation: none !important; }
}
.section--brown {
  background-color: var(--brown);
  background-image: var(--pattern);
  background-size: var(--pattern-size);
  color: var(--ivory);
}

.section { padding: 56px 16px; }

.frame {
  position: relative;
  max-width: 680px; margin: 0 auto;
  padding: 40px clamp(10px, 4vw, 40px) 8px;
  text-align: center;
}
.frame::before { /* ornament heading each section */
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(70%, 280px); height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 280 14'%3E%3Cg fill='none' stroke='%23e5b973' stroke-width='1.2'%3E%3Cpath d='M0 7 H112 M168 7 H280'/%3E%3Cpath d='M140 1 L146 7 L140 13 L134 7 Z' fill='%23e5b973'/%3E%3Cpath d='M112 7 C120 1 128 1 132 7 C128 13 120 13 112 7 Z M168 7 C160 1 152 1 148 7 C152 13 160 13 168 7 Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

/* Hero */
.hero {
  min-height: 100svh;
  display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px 16px;
}
.frame--hero::before { display: none; }
.frame--hero {
  width: 100%;
  min-height: calc(100svh - 32px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding-top: 32px; padding-bottom: 64px;
}
.hero__crest { width: min(50vw, 250px, 26svh); margin-bottom: 2px; }
.hero__title { margin: 0; font-size: clamp(1.25rem, 6vw, 1.9rem); color: var(--gold-ink); font-weight: 400; }
.hero__invite { color: var(--ink-soft); font-size: .95rem; }

.guest-plate {
  margin: 10px auto 6px;
  width: min(100%, 420px);
  padding: 8px 28px;
  border: 1.5px solid var(--gold);
  outline: 1px solid var(--gold); outline-offset: 3px;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
  background: rgba(229, 185, 115, .12);
}
.guest-plate__name { font-family: var(--font-km), var(--font-en); font-weight: 700; font-size: 1.15rem; color: var(--brown); }

.hero__names { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 12px; font-size: clamp(1.3rem, 6vw, 1.8rem); color: var(--brown); line-height: 1.7; }
.hero__names-en { font-family: var(--font-en-caps); font-size: clamp(.85rem, 3.6vw, 1.1rem); letter-spacing: .1em; color: var(--brown-soft); text-transform: uppercase; }
.bigdate {
  margin-top: 10px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0 14px;
  width: min(100%, 380px);
}
.bigdate__side { display: flex; flex-direction: column; line-height: 1.35; padding: 8px 0; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
.bigdate__side .km { font-size: .85rem; color: var(--ink); }
.bigdate__side .en { font-family: var(--font-en-caps); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink); }
.bigdate__num {
  font-family: var(--font-en); font-weight: 600; line-height: .9;
  font-size: clamp(4.2rem, 21vw, 6.5rem); color: var(--gold-ink);
  background: linear-gradient(180deg, #b98a43, #8a6223 60%, #6e4c1a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__time { margin-top: 6px; font-family: var(--font-en); font-size: 1.1rem; color: var(--gold-ink); letter-spacing: .04em; }
.hero__time .km { font-size: .9rem; color: var(--ink); }
.hero__date-en { font-family: var(--font-en); font-size: 1.1rem; color: var(--gold-ink); letter-spacing: .05em; }
.hero__venue { margin-top: 4px; font-size: .9rem; color: var(--ink-soft); max-width: 34em; }

.scroll-cue {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 44px; min-height: 44px; padding: 4px 8px;
  text-decoration: none; color: var(--gold-ink);
}
.scroll-cue__text { font-family: var(--font-en); font-size: .9rem; letter-spacing: .06em; white-space: nowrap; }
.scroll-cue__text .km { font-size: .78rem; letter-spacing: 0; }
.scroll-cue__arrow {
  width: 11px; height: 11px; border-right: 1.5px solid var(--gold-ink); border-bottom: 1.5px solid var(--gold-ink);
  transform: rotate(45deg); animation: cue 2s ease-in-out infinite;
}
@keyframes cue { 0%, 100% { transform: translateY(-4px) rotate(45deg); opacity: .5; } 50% { transform: translateY(3px) rotate(45deg); opacity: 1; } }

/* Hero entrance after the opening: gold lines draw open, then content rises.
   The crest stays put — the opening crest lands exactly on top of it. */
.hero__lines {
  position: absolute; inset: -1.5px; pointer-events: none;
  border: 1.5px solid var(--gold);
  outline: 1px solid var(--gold); outline-offset: -8px;
  clip-path: inset(-2px -2px -2px -2px);
  transition: clip-path 1.4s var(--ease) .1s;
}
.js .frame--hero { border-color: transparent; outline-color: transparent; }
.js .frame--hero::before, .js .frame--hero::after { transition: opacity .6s ease 1.1s, transform .6s var(--ease-out) 1.1s; }
.js.is-pre-reveal .hero__lines { clip-path: inset(50% -2px 50% -2px); }
.js.is-pre-reveal .frame--hero::before, .js.is-pre-reveal .frame--hero::after { opacity: 0; transform: rotate(45deg) scale(.3); }

.js .hero .frame--hero > :not(.hero__lines):not(.hero__crest) { transition: opacity .9s ease, transform 1s var(--ease-out); }
.js.is-pre-reveal .hero .frame--hero > :not(.hero__lines):not(.hero__crest) { opacity: 0; transform: translateY(18px); }
.js .hero .frame--hero > :nth-child(3) { transition-delay: .35s; }
.js .hero .frame--hero > :nth-child(4) { transition-delay: .5s; }
.js .hero .frame--hero > :nth-child(5) { transition-delay: .62s; }
.js .hero .frame--hero > :nth-child(6) { transition-delay: .74s; }
.js .hero .frame--hero > :nth-child(7) { transition-delay: .86s; }
.js .hero .frame--hero > :nth-child(n+8) { transition-delay: 1s; }

/* Invitation wording */
.parents { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0 clamp(8px, 3vw, 18px); align-items: start; margin-bottom: 24px; }
.parents::before { /* thin gold divider between the two families */
  content: ""; grid-column: 2; grid-row: 1; width: 1px; height: 100%; min-height: 48px;
  background: linear-gradient(180deg, transparent, var(--gold), transparent); opacity: .7;
}
.parents__side:first-child { grid-column: 1; grid-row: 1; }
.parents__side:last-child { grid-column: 3; grid-row: 1; }
.parents__side p { white-space: nowrap; }
.parents .km-strong { color: var(--brown); font-size: clamp(.86rem, 4vw, 1.02rem); line-height: 1.75; }
.parents .en-caps { font-size: clamp(.64rem, 3vw, .82rem); letter-spacing: .04em; line-height: 1.75; }
.parents__side .en-caps:first-of-type { margin-top: 6px; }

.section__kicker { color: var(--gold-ink); font-size: 1.1rem; margin-bottom: 6px; }
.body-km { font-size: .98rem; line-height: 2; color: var(--ink); }
.body-en { font-size: 1.12rem; line-height: 1.6; color: var(--ink); }

.couple { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 26px 0; }
.couple__role { color: var(--gold-ink); font-size: .85rem; }
.couple__name { font-size: clamp(1.1rem, 5.2vw, 1.5rem); color: var(--brown); line-height: 1.9; }
.couple__role-en { font-family: var(--font-en-caps); font-size: .7rem; letter-spacing: .14em; color: var(--gold-ink); margin-top: 6px; }
.couple__name-en { font-family: 'Great Vibes', var(--font-en); font-size: clamp(1.7rem, 7.5vw, 2.1rem); color: var(--gold-ink); line-height: 1.2; }
.couple__join { display: flex; flex-direction: column; align-items: center; color: var(--gold-ink); font-size: .85rem; line-height: 1.4; }
.couple__join .amp { font-size: 1.6rem; }
.couple__crest { width: 58px; height: auto; filter: drop-shadow(0 2px 4px rgba(138, 98, 35, .25)); }

.couple-en { margin: 14px 0; font-family: 'Great Vibes', var(--font-en); font-size: clamp(1.8rem, 8vw, 2.4rem); color: var(--gold-ink); line-height: 1.25; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 10px; }

.divider {
  height: 1px; margin: 30px auto; width: 70%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  position: relative;
}
.divider::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  background: var(--gold); transform: translate(-50%, -50%) rotate(45deg);
}

/* Band */
.band {
  padding: 36px 16px; text-align: center;
  background-color: var(--brown); background-image: var(--pattern); background-size: var(--pattern-size);
  color: var(--gold);
}
.band__label { font-family: var(--font-en-caps); letter-spacing: .25em; font-size: .85rem; text-transform: uppercase; }
.band__date { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 6px 0; }
.band__num { font-family: var(--font-en); font-weight: 600; font-size: clamp(4rem, 20vw, 6rem); line-height: .95; color: var(--gold); }
.band__side { font-family: var(--font-en-caps); letter-spacing: .2em; font-size: .95rem; text-transform: uppercase; color: var(--gold-light);
  padding: 6px 0; border-top: 1px solid rgba(229, 185, 115, .6); border-bottom: 1px solid rgba(229, 185, 115, .6); min-width: 64px; }
.countdown { display: flex; justify-content: center; gap: clamp(8px, 3vw, 14px); margin-top: 14px; }
.countdown__box {
  min-width: 62px; padding: 8px 6px 6px; border: 1px solid rgba(229, 185, 115, .55); border-radius: 8px;
  background: rgba(46, 27, 14, .35); display: flex; flex-direction: column; align-items: center; overflow: hidden;
}
.countdown__num { font-family: var(--font-en); font-weight: 600; font-size: 1.7rem; line-height: 1.1; color: var(--gold); font-variant-numeric: lining-nums tabular-nums; }
.countdown__num.flip { animation: flip .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes flip { from { transform: translateY(-60%); opacity: 0; } to { transform: none; opacity: 1; } }
.countdown__lbl { font-family: var(--font-en); font-size: .78rem; color: var(--gold-light); letter-spacing: .04em; }
.countdown__lbl .km { font-size: .72rem; }
.band__today { font-family: var(--font-en); font-size: 1.1rem; color: var(--gold-light); margin-top: 10px; }

/* Section titles */
.section__title { margin: 0 0 10px; font-weight: 400; display: flex; flex-direction: column; align-items: center; }
.section__title .km-display { font-size: clamp(1.1rem, 5.2vw, 1.45rem); color: var(--gold-ink); }
.section__title-en { font-family: var(--font-en-caps); font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); line-height: 1.4; }
.section--brown .section__title .km-display { color: var(--gold); }
.section--brown .section__title-en { color: var(--gold-light); }
.section__sub { font-size: .9rem; color: var(--ink-soft); }
.section__sub-en { font-family: var(--font-en); font-size: 1.05rem; color: var(--gold-ink); margin-top: 2px; }

/* Timeline — gold rail that fills on scroll, dots that light up */
.timeline { --progress: 0; position: relative; list-style: none; margin: 28px 0 0; padding: 0 0 0 26px; text-align: left; }
.timeline::before, .timeline::after {
  content: ""; position: absolute; left: 7px; top: 22px; bottom: 30px; width: 2px; border-radius: 2px;
}
.timeline::before { background: rgba(229, 185, 115, .3); }
.timeline::after {
  background: linear-gradient(180deg, var(--gold-light), var(--gold), var(--gold-ink));
  transform-origin: top; transform: scaleY(var(--progress));
  box-shadow: 0 0 8px rgba(229, 185, 115, .6);
}
.timeline__item {
  position: relative;
  display: grid; grid-template-columns: 84px 1fr; gap: 12px;
  padding: 14px 0; border-top: 1px dashed rgba(138, 98, 35, .3);
}
.timeline__item:first-child { border-top: 0; }
.timeline__item::before { /* dot on the rail */
  content: ""; position: absolute; left: -24px; top: 21px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--ivory); border: 2px solid rgba(229, 185, 115, .55);
  transition: background-color .4s ease, border-color .4s ease, box-shadow .4s ease, transform .4s cubic-bezier(.3, 1.8, .5, 1);
}
.timeline__item.is-lit::before {
  background: var(--gold); border-color: var(--gold-ink); transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(229, 185, 115, .25), 0 0 14px rgba(229, 185, 115, .8);
}
.timeline__time { display: flex; flex-direction: column; line-height: 1.4; }
.timeline__time .km { font-family: var(--font-km); font-weight: 700; color: var(--gold-ink); font-size: .95rem; }
.timeline__time .en { font-family: var(--font-en); font-size: .95rem; color: var(--ink-soft); }
.timeline__body .km { font-size: .95rem; line-height: 1.85; color: var(--ink); }
.timeline__body .en { font-size: 1.02rem; line-height: 1.4; color: var(--ink-soft); font-style: italic; }
.timeline__note { margin-top: 6px; }
.timeline__note.km { color: var(--gold-ink); font-weight: 700; font-size: .88rem; }
.timeline__item--main {
  margin-top: 6px; padding: 16px 14px; border: 1px solid var(--gold); border-radius: 4px;
  background: rgba(229, 185, 115, .1); overflow: hidden;
}
.timeline__item--main::before { left: -25px; top: 23px; }
.timeline__item--main::after { /* light sweep once the evening event lights up */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 246, 220, .7) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%; background-position: 150% 0;
}
.timeline__item--main.is-lit::after { animation: sweep 1.6s ease .2s 1 both; }
@keyframes sweep { to { background-position: -50% 0; } }
.timeline__item--main { overflow: visible; }

/* Venue */
.venue__name { font-size: 1rem; color: var(--ivory); line-height: 1.9; }
.venue__name-en { font-family: var(--font-en); font-size: 1.15rem; color: var(--gold-light); line-height: 1.4; }
.venue__hall { margin-top: 6px; font-family: var(--font-en-caps); color: var(--gold); letter-spacing: .1em; }
.venue__sketch { margin: 22px auto 0; max-width: 460px; }
.venue__sketch svg { width: 100%; height: auto; overflow: hidden; }
.venue__sketch .sk { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.venue__sketch .sk-thin { stroke-width: .9; stroke: var(--gold-light); opacity: .85; }
.venue__sketch figcaption { margin-top: 4px; font-family: var(--font-en); font-size: .9rem; color: var(--gold-light); opacity: .7; }
.venue__sketch figcaption .km { font-size: .8rem; }
.js .venue__sketch .sk path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s ease-in-out; transition-delay: calc(var(--i, 0) * 70ms + .3s); }
.js .reveal.is-visible .venue__sketch .sk path { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .js .venue__sketch .sk path { stroke-dasharray: none; transition: none; } }
.venue__map { margin: 24px 0 0; padding: 8px; background: #fbf8ee; border: 1.5px solid var(--gold); border-radius: 18px; }
.venue__map figcaption { margin-top: 6px; font-family: var(--font-en); font-size: .78rem; color: var(--ink-soft); }
.venue__map figcaption .km { font-size: .72rem; }
.map-sketch { display: block; width: 100%; height: auto; overflow: hidden; border-radius: 12px; }
.map-water path { fill: rgba(205, 170, 110, .18); stroke: #c9a46a; stroke-width: .9; }
.map-waves path { fill: url(#waves); stroke: none; }
.map-roads path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.map-roads .r1 { stroke: #8a6223; stroke-width: 3.2; }
.map-roads .r2 { stroke: #b98a43; stroke-width: 2.2; }
.map-roads .r3 { stroke: #d5b07a; stroke-width: 1.1; }
.map-roads .br { stroke: #8a6223; stroke-width: 3.6; }
.map-round { fill: #fbf8ee; stroke: #8a6223; stroke-width: 1.6; }
.map-venue { fill: var(--gold); stroke: var(--brown); stroke-width: 1; }
.map-route { fill: none; stroke: #9b3d1f; stroke-width: 2; stroke-dasharray: .02 .018; stroke-linecap: round; }
.map-traveller { fill: #9b3d1f; stroke: #fff; stroke-width: 1.2; }
.map-from path { fill: #9b3d1f; }
.js .venue__map .map-from { opacity: 0; transition: opacity .6s ease 1.9s; }
.js .venue__map.is-visible .map-from { opacity: 1; }
.map-pin__drop path { fill: var(--brown); stroke: var(--gold); stroke-width: 1.4; }
.map-pin__dot { fill: var(--gold); }
.map-pulse { fill: none; stroke: var(--brown); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.map-callout rect { fill: rgba(67, 40, 21, .92); stroke: var(--gold); stroke-width: 1; }
.map-callout .co { font: 700 9px var(--font-km); fill: var(--gold-light); }
.map-callout .co-en { font: 600 9.5px var(--font-en); fill: var(--gold); letter-spacing: .04em; }
.map-sketch text { pointer-events: none; }
.lbl-water { font: 400 11px var(--font-km); fill: #8a6223; opacity: .85; }
.lbl-water-en { font: italic 500 10px var(--font-en); fill: #8a6223; opacity: .75; }
.lbl { font: 700 8.5px var(--font-km); fill: var(--brown); paint-order: stroke; stroke: #fbf8ee; stroke-width: 3px; }
.lbl-en { font: 600 9px var(--font-en); fill: var(--brown); paint-order: stroke; stroke: #fbf8ee; stroke-width: 3px; }
.lbl-road { font: 700 8px var(--font-en-caps); fill: #8a6223; letter-spacing: .08em; paint-order: stroke; stroke: #fbf8ee; stroke-width: 3px; }
.lbl-road.sm { font-size: 7px; }
.map-compass circle { fill: rgba(251, 248, 238, .9); stroke: var(--gold); stroke-width: 1; }
.map-compass path { fill: var(--brown); }
.map-compass text { font: 700 7px var(--font-en-caps); fill: var(--brown); }

/* Map animation (only when JS runs; static otherwise) */
.js .venue__map .map-water, .js .venue__map .map-waves { transition: opacity 1s ease; }
.js .venue__map .map-roads path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s ease-in-out; }
.js .venue__map .map-roads .r1 { transition-delay: .3s; }
.js .venue__map .map-roads .r2 { transition-delay: .6s; }
.js .venue__map .map-roads .r3 { transition-delay: .9s; }
.js .venue__map .map-route { stroke-dashoffset: 1; transition: stroke-dashoffset 2.6s linear 1.9s, opacity .3s ease 1.9s; opacity: 0; }
.js .venue__map .map-pin { opacity: 0; transition: opacity .3s ease 1.4s; }
.js .venue__map .map-pin__drop { transform: translateY(-40px); }
.js .venue__map .map-callout, .js .venue__map .map-round, .js .venue__map .map-venue, .js .venue__map .map-sketch > g > text { opacity: 0; transition: opacity .6s ease 1.6s; }
.js .venue__map .map-traveller { opacity: 0; }
.js .venue__map:not(.is-visible) .map-water, .js .venue__map:not(.is-visible) .map-waves { opacity: 0; }
.js .venue__map.is-visible .map-roads path { stroke-dashoffset: 0; }
.js .venue__map.is-visible .map-route { stroke-dashoffset: 0; opacity: 1; }
.js .venue__map.is-visible .map-pin { opacity: 1; }
.js .venue__map.is-visible .map-pin__drop { animation: pindrop .7s cubic-bezier(.3, 1.6, .5, 1) 1.4s both; }
.js .venue__map.is-visible .map-pulse { animation: pulse 2.4s ease-out 2.2s infinite; }
.js .venue__map.is-visible .map-pulse.p2 { animation-delay: 3.4s; }
.js .venue__map.is-visible .map-callout, .js .venue__map.is-visible .map-round, .js .venue__map.is-visible .map-venue, .js .venue__map.is-visible .map-sketch text { opacity: 1; }
.js .venue__map.is-moving .map-traveller { opacity: 1; }
@keyframes pindrop { from { transform: translateY(-40px); } to { transform: none; } }
@keyframes pulse { 0% { transform: scale(.4); opacity: .8; } 100% { transform: scale(3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .js .venue__map *, .js .venue__map { transition: none !important; animation: none !important; }
  .js .venue__map .map-roads path, .js .venue__map .map-route { stroke-dashoffset: 0 !important; }
  .js .venue__map .map-route { stroke-dasharray: .02 .018; opacity: 1 !important; }
  .js .venue__map .map-from, .js .venue__map .map-pin, .js .venue__map .map-callout, .js .venue__map .map-round, .js .venue__map .map-venue, .js .venue__map .map-sketch text, .js .venue__map .map-water, .js .venue__map .map-waves { opacity: 1 !important; }
  .js .venue__map .map-pin__drop { transform: none !important; }
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 48px; padding: 10px 26px;
  border-radius: 999px; border: 1.5px solid var(--gold);
  font: 600 1.05rem var(--font-en); text-decoration: none; cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.btn .km { font-size: .9rem; font-weight: 700; }
.btn:active { transform: translateY(1px); }
.btn--gold { background: var(--gold); color: var(--brown-deep); }
.btn--gold:hover { background: var(--gold-light); }
.btn--brown { background: var(--brown); color: var(--gold-light); border-color: var(--brown); width: 100%; }
.btn--brown:hover { background: var(--brown-soft); }
.btn[disabled] { opacity: .6; cursor: progress; }

.link-btn { background: none; border: 0; color: var(--gold-light); font: 500 1rem var(--font-en); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 10px; min-height: 44px; }

/* RSVP — card, choice tiles, floating labels, stepper, chips */
.rsvp-intro { font-family: var(--font-en); font-size: 1.08rem; color: var(--ink-soft); line-height: 1.5; margin-top: 4px; }
.rsvp-intro .km { font-size: .9rem; color: var(--ink); }
.rsvp-deadline[hidden] { display: none; }
.rsvp-deadline { margin-top: 8px; display: inline-block; padding: 4px 14px; border-radius: 999px; background: rgba(229, 185, 115, .2); font-family: var(--font-en); font-weight: 600; color: var(--gold-ink); }
.rsvp-card {
  position: relative; margin: 22px auto 0; max-width: 520px; text-align: left;
  padding: clamp(18px, 5vw, 30px);
  background: linear-gradient(180deg, #fffdf7, #fbf6e8);
  border: 1px solid rgba(229, 185, 115, .55); border-radius: 22px;
  box-shadow: 0 1px 0 #fff inset, 0 18px 40px -18px rgba(67, 40, 21, .35), 0 4px 12px -6px rgba(67, 40, 21, .15);
}
.rsvp { display: grid; gap: 22px; }
.rsvp-block { border: 0; margin: 0; padding: 0; min-width: 0; }
.rsvp-label { display: block; padding: 0; margin: 0 0 10px; font: 600 1.02rem var(--font-en); color: var(--brown); line-height: 1.4; }
.rsvp-label .km { display: block; font: 700 .9rem var(--font-km); color: var(--ink); }
.rsvp-hint { margin-top: 6px; font: italic 500 .98rem var(--font-en); color: var(--ink-soft); text-align: center; }

/* Wizard: steps + progress dots */
.wizard-head { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: -4px; }
.wizard-dots { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; }
.wizard-dots li { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--gold-ink); transition: background-color .3s ease, transform .3s ease, width .3s ease; }
.wizard-dots li.is-on { background: var(--gold); border-color: var(--gold-ink); width: 26px; border-radius: 6px; }
.wizard-dots li.is-done { background: var(--gold-ink); }
.wizard-step { font: 600 .78rem var(--font-en-caps); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.wstep { display: grid; gap: 22px; }
.wstep[hidden] { display: none; }
.wstep.from-right { animation: stepR .45s var(--ease-out); }
.wstep.from-left { animation: stepL .45s var(--ease-out); }
@keyframes stepR { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes stepL { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.wstep__hint { margin-top: -6px; font-style: normal; font-size: .95rem; }
.wstep__hint .km { font-size: .85rem; }
.wstep__nav { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.wbtn {
  min-height: 52px; padding: 0 20px; border-radius: 14px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #e9c584, var(--gold)); color: var(--brown-deep);
  font: 700 1.05rem var(--font-en); box-shadow: 0 8px 18px -10px rgba(138, 98, 35, .8); transition: transform .15s ease;
}
.wbtn .km { font-size: .92rem; }
.wbtn:active { transform: scale(.98); }
.wbtn--ghost { background: transparent; box-shadow: none; border: 1.5px solid rgba(138, 98, 35, .4); color: var(--gold-ink); font-weight: 600; }
.wbtn--back { justify-self: center; min-height: 40px; border: 0; padding: 0 12px; margin-top: -10px; }
.wbtn:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; }

/* Choice tiles */
.choice-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-tile {
  position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 16px 10px 14px; border-radius: 16px; background: #fff;
  border: 1.5px solid rgba(138, 98, 35, .25);
  transition: border-color .25s ease, background-color .25s ease, transform .2s ease, box-shadow .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.choice-tile:hover { border-color: rgba(138, 98, 35, .5); }
.choice-tile:active { transform: scale(.98); }
.choice-tile input { position: absolute; opacity: 0; pointer-events: none; }
.choice-tile__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(229, 185, 115, .18); transition: background-color .25s ease, transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.choice-tile__icon svg { width: 26px; height: 26px; fill: none; stroke: var(--gold-ink); stroke-width: 1.8; stroke-linejoin: round; }
.choice-tile__title { margin-top: 8px; font-weight: 700; font-size: .98rem; color: var(--brown); line-height: 1.5; }
.choice-tile__sub { font: 600 .98rem var(--font-en); color: var(--ink-soft); line-height: 1.3; }
.choice-tile__check {
  position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--brown); display: grid; place-items: center; transform: scale(0); transition: transform .35s cubic-bezier(.3, 1.8, .5, 1);
}
.choice-tile__check svg { width: 14px; height: 14px; fill: none; stroke: var(--gold-light); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.choice-tile:has(input:checked) { border-color: var(--gold-ink); background: linear-gradient(180deg, #fff9ea, #f7ecd2); box-shadow: 0 8px 18px -10px rgba(138, 98, 35, .6); }
.choice-tile:has(input:checked) .choice-tile__icon { background: var(--gold); transform: scale(1.08); }
.choice-tile:has(input:checked) .choice-tile__icon svg { stroke: var(--brown); }
.choice-tile:has(input:checked) .choice-tile__check { transform: scale(1); }
.choice-tile:has(input:focus-visible) { outline: 2px solid var(--gold-ink); outline-offset: 3px; }

/* Floating-label fields */
.float { position: relative; }
.float input, .float textarea {
  width: 100%; display: block;
  padding: 24px 16px 10px; font: 16px/1.5 var(--font-km), var(--font-en); color: var(--ink);
  background: #fff; border: 1.5px solid rgba(138, 98, 35, .28); border-radius: 14px;
  transition: border-color .2s ease, box-shadow .2s ease; -webkit-appearance: none; appearance: none;
}
.float textarea { min-height: 112px; resize: vertical; padding-top: 32px; }
.float label {
  position: absolute; left: 17px; top: 17px; pointer-events: none; transform-origin: 0 0;
  font: 500 1.02rem var(--font-en), var(--font-km); color: var(--ink-soft);
  right: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: transform .2s ease, color .2s ease;
}
.float label .km { font-size: .9rem; }
.float input:focus, .float textarea:focus { outline: none; border-color: var(--gold-ink); box-shadow: 0 0 0 4px rgba(229, 185, 115, .3); }
.float input:focus + label, .float input:not(:placeholder-shown) + label,
.float textarea:focus + label, .float textarea:not(:placeholder-shown) + label { transform: translateY(-11px) scale(.78); color: var(--gold-ink); }
.float [aria-invalid="true"] { border-color: #b4532a; box-shadow: 0 0 0 4px rgba(180, 83, 42, .12); }
.opt { font-weight: 500; color: var(--ink-soft); opacity: .8; }

.field__error { display: flex; align-items: center; gap: 6px; margin-top: 8px; font: 600 .95rem var(--font-en), var(--font-km); color: #a1441f; line-height: 1.5; }
.field__error::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: #a1441f; color: #fff; font: 700 .75rem/18px var(--font-en); text-align: center; }
.field__error:empty { display: none; }

/* Expanding details for "yes" (grid 0fr → 1fr) */
.rsvp-more-unused { display: grid; grid-template-rows: 0fr; opacity: 0; margin-top: -22px; transition: grid-template-rows .45s var(--ease-out), opacity .35s ease, margin-top .45s var(--ease-out); }
.rsvp-more.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: 0; }
.rsvp-more__inner { overflow: hidden; display: grid; gap: 22px; min-height: 0; }

/* Stepper */
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; }
.stepper__btn {
  width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--gold); background: #fff; color: var(--brown);
  font: 500 1.7rem/1 var(--font-en); cursor: pointer; display: grid; place-items: center;
  transition: background-color .2s ease, transform .15s ease, opacity .2s ease; -webkit-tap-highlight-color: transparent;
}
.stepper__btn:hover:not(:disabled) { background: rgba(229, 185, 115, .2); }
.stepper__btn:active:not(:disabled) { transform: scale(.92); }
.stepper__btn:disabled { opacity: .35; cursor: not-allowed; }
.stepper__value { min-width: 2ch; text-align: center; font: 600 2.4rem/1 var(--font-en); color: var(--gold-ink); font-variant-numeric: lining-nums tabular-nums; }
.stepper__value.bump { animation: bump .3s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { from { transform: scale(1.3); } to { transform: none; } }

/* Chips */
.chips { display: grid; gap: 10px; }
.chip { position: relative; cursor: pointer; display: block; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px 12px 46px; min-height: 52px; border-radius: 14px; background: #fff;
  border: 1.5px solid rgba(138, 98, 35, .25); font: 500 1rem var(--font-en); color: var(--ink-soft); line-height: 1.35;
  transition: border-color .2s ease, background-color .2s ease;
}
.chip span b { font-weight: 700; font-size: .92rem; color: var(--brown); }
.chip span::before { /* checkbox */
  content: ""; position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 6px;
  border: 1.5px solid rgba(138, 98, 35, .5); background: #fff; transition: background-color .2s ease, border-color .2s ease;
}
.chip span::after {
  content: ""; position: absolute; left: 21px; top: 50%; width: 6px; height: 11px; margin-top: -7px;
  border: solid var(--gold-light); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .25s cubic-bezier(.3, 1.8, .5, 1);
}
.chip input:checked + span { border-color: var(--gold-ink); background: #fff9ea; }
.chip input:checked + span::before { background: var(--brown); border-color: var(--brown); }
.chip input:checked + span::after { transform: rotate(45deg) scale(1); }
.chip input:focus-visible + span { outline: 2px solid var(--gold-ink); outline-offset: 2px; }

/* Wishes */
.wishes { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 10px; }
.wish-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wish {
  padding: 6px 12px; min-height: 34px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(138, 98, 35, .3); background: rgba(229, 185, 115, .12);
  font: 500 .92rem var(--font-en), var(--font-km); color: var(--brown); transition: background-color .2s ease, transform .15s ease;
}
.wish:hover { background: rgba(229, 185, 115, .28); }
.wish:active { transform: scale(.96); }
.rsvp-count { flex: none; font: 500 .85rem var(--font-en); color: var(--ink-soft); padding-top: 8px; font-variant-numeric: lining-nums tabular-nums; }
.rsvp-count.is-near { color: #a1441f; }

/* Submit */
.rsvp-submit {
  position: relative; width: 100%; min-height: 56px; border: 0; border-radius: 16px; cursor: pointer;
  background: linear-gradient(180deg, #5a3a22, var(--brown)); color: var(--gold-light);
  font: 600 1.1rem var(--font-en); letter-spacing: .02em;
  box-shadow: 0 10px 22px -12px rgba(67, 40, 21, .8), inset 0 1px 0 rgba(255, 255, 255, .12);
  overflow: hidden; transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.rsvp-submit .km { font-size: .95rem; font-weight: 700; }
.rsvp-submit::after { /* gentle shine */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 240, 200, .22) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%; background-position: 150% 0; animation: btnshine 4.5s ease-in-out 2s infinite;
}
@keyframes btnshine { 0%, 60% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.rsvp-submit:hover { box-shadow: 0 14px 26px -12px rgba(67, 40, 21, .85), inset 0 1px 0 rgba(255, 255, 255, .12); }
.rsvp-submit:active { transform: translateY(1px) scale(.995); }
.rsvp-submit:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 3px; }
.rsvp-submit__spinner {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 2.5px solid rgba(241, 211, 156, .35); border-top-color: var(--gold-light); opacity: 0;
}
.rsvp-submit.is-loading { cursor: progress; }
.rsvp-submit.is-loading .rsvp-submit__label { opacity: 0; }
.rsvp-submit.is-loading .rsvp-submit__spinner { opacity: 1; animation: spin .8s linear infinite; }

.rsvp-status { font: 500 1rem var(--font-en), var(--font-km); text-align: center; color: var(--ink-soft); line-height: 1.45; margin-top: -8px; }
.rsvp-status:empty { display: none; }
.rsvp-status .km { display: block; font-size: .9rem; }
.rsvp-status.is-error { color: #a1441f; }
.rsvp-status.is-info { padding: 10px 14px; border-radius: 12px; background: rgba(229, 185, 115, .16); color: var(--brown); }
.rsvp-privacy { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: -8px; font: 500 .9rem var(--font-en); color: var(--ink-soft); }
.rsvp-privacy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.rsvp-closed { text-align: center; font: 600 1.1rem var(--font-en); color: var(--brown); }

/* Confirmation */
.rsvp-done { text-align: center; outline: none; animation: donein .5s var(--ease-out); }
@keyframes donein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rsvp-done__tick { width: 72px; height: 72px; margin: 4px auto 6px; display: block; }
.rsvp-done__tick circle { fill: rgba(229, 185, 115, .18); stroke: var(--gold); stroke-width: 2; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .7s ease-out .1s forwards; }
.rsvp-done__tick path { fill: none; stroke: var(--brown); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s ease-out .65s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.rsvp-done__title { font-size: 1.5rem; color: var(--gold-ink); }
.rsvp-done__sub { font: 500 1.1rem var(--font-en); color: var(--ink); line-height: 1.45; }
.rsvp-summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 18px 0 0; padding: 14px 16px; text-align: left; border-radius: 14px; background: rgba(229, 185, 115, .12); border: 1px dashed rgba(138, 98, 35, .35); }
.rsvp-summary dt { font: 600 .82rem var(--font-en-caps); letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); padding-top: 3px; }
.rsvp-summary dd { margin: 0; font: 500 1.02rem var(--font-en), var(--font-km); color: var(--ink); overflow-wrap: anywhere; }
.rsvp-done__actions { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 18px; }
.btn--sm { width: auto; min-height: 46px; padding: 8px 22px; font-size: 1rem; }
.link-btn--dark { color: var(--gold-ink); }

@media (max-width: 360px) { .choice-tiles { grid-template-columns: 1fr; } .wishes { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) {
  .rsvp-more, .choice-tile, .choice-tile__check, .choice-tile__icon, .stepper__value, .rsvp-done, .rsvp-submit::after { transition: none !important; animation: none !important; }
  .rsvp-done__tick circle, .rsvp-done__tick path { animation: none; stroke-dashoffset: 0; }
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Closing */
.closing { padding: 56px 16px max(120px, calc(env(safe-area-inset-bottom) + 100px)); text-align: center; color: var(--gold); }
.closing__seal { width: 140px; margin: 0 auto 16px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .35)); }
.closing__thanks { font-size: 1.5rem; }
.closing__thanks-en { font-family: var(--font-en); font-size: 1.15rem; color: var(--gold-light); }
.closing__date { margin-top: 18px; font-family: var(--font-en-caps); letter-spacing: .2em; font-size: .85rem; text-transform: uppercase; }
.closing__replay { margin-top: 12px; }

/* Scroll reveal (enhancement only) */
.js .reveal .frame { transition: opacity .9s ease, transform .9s var(--ease-out); }
.js .reveal:not(.is-visible) .frame { opacity: 0; transform: translateY(28px) scale(.985); }
/* Per-element reveals ([data-anim]) */
.js [data-anim] { transition: opacity .8s ease, transform .9s var(--ease-out), filter .9s ease; }
.js [data-anim="up"]:not(.is-visible) { opacity: 0; transform: translateY(22px); }
.js [data-anim="left"]:not(.is-visible) { opacity: 0; transform: translateX(-36px); }
.js [data-anim="right"]:not(.is-visible) { opacity: 0; transform: translateX(36px); }
.js [data-anim="pop"] { transition: opacity .5s ease .45s, transform .7s cubic-bezier(.3, 1.8, .5, 1) .45s; }
.js [data-anim="pop"]:not(.is-visible) { opacity: 0; transform: scale(.3) rotate(-20deg); }
.js [data-anim="soft"]:not(.is-visible) { opacity: 0; transform: translateY(18px); filter: blur(6px); }
.js [data-anim="seal"] { transition: opacity 1s ease, transform 1.4s cubic-bezier(.2, 1.2, .3, 1); }
.js [data-anim="seal"]:not(.is-visible) { opacity: 0; transform: rotate(-120deg) scale(.4); }
.js .couple [data-anim="right"] { transition-delay: .15s; }

/* Section ornament draws open, title follows */
.js .reveal .frame::before { transition: transform 1s var(--ease-out) .1s, opacity .6s ease .1s; }
.js .reveal:not(.is-visible) .frame::before { transform: translateX(-50%) scaleX(0); opacity: 0; }

.js .reveal .stagger > * { transition: opacity .7s ease, transform .8s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms + .25s); }
.js .reveal:not(.is-visible) .stagger > * { opacity: 0; transform: translateY(16px); }
@media (prefers-reduced-motion: reduce) {
  .js .reveal .frame, .js .reveal .stagger > *, .js .hero .frame--hero > * { transition: none !important; opacity: 1 !important; transform: none !important; }
  .js.is-pre-reveal .hero__lines { clip-path: none; }
  .js [data-anim] { transition: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
  .js .reveal .frame::before { transition: none !important; transform: translateX(-50%) !important; opacity: 1 !important; }
  .countdown__num.flip, .timeline__item--main.is-lit::after { animation: none !important; }
  .scroll-cue__arrow { animation: none; }
}

@media (max-width: 380px) {
  .couple { grid-template-columns: 1fr; }
  .timeline__item { grid-template-columns: 1fr; gap: 2px; }
  .timeline__time { flex-direction: row; gap: 10px; align-items: baseline; }
}

/* Phones: stack groom / bride so Khmer names never break mid-name */
@media (max-width: 560px) {
  .couple { grid-template-columns: 1fr; gap: 4px; }
  .couple__join { flex-direction: column; gap: 2px; margin: 6px 0; }
  .couple__name { white-space: nowrap; font-size: clamp(1.25rem, 6.4vw, 1.6rem); }
}
.rsvp-done__title.is-en { font-family: var(--font-en-caps); font-weight: 600; letter-spacing: .06em; }

/* English mode: English text becomes the main label where it used to be the subtitle */
html[data-lang="en"] .section__title-en { font: 600 clamp(1.25rem, 5.6vw, 1.6rem)/1.3 var(--font-en-caps); letter-spacing: .1em; color: var(--gold-ink); }
html[data-lang="en"] .choice-tile__sub { margin-top: 8px; font-weight: 700; font-size: 1.1rem; color: var(--brown); }
html[data-lang="en"] .section__sub-en { font-size: 1.12rem; }
html[data-lang="en"] .timeline__body .en { font-style: normal; color: var(--ink); font-size: 1.08rem; }
html[data-lang="en"] .timeline__time .en { color: var(--gold-ink); font-weight: 600; }
html[data-lang="en"] .rsvp-label { font-size: 1.1rem; }
html[data-lang="km"] .wizard-step { font: 700 .82rem var(--font-km); letter-spacing: 0; text-transform: none; }
html[data-lang="km"] .rsvp-hint { font: 500 .9rem var(--font-km); }
html[data-lang="km"] .rsvp-summary dt { font: 700 .82rem var(--font-km); letter-spacing: 0; }
.dock__mark { white-space: nowrap; }
@media (max-width: 360px) { .dock__mark { font-size: .68rem; letter-spacing: .06em; } .dock { padding: 0 4px; } }
