/* ==========================================================================
   Midnight Glow — New Year's Eve invitation design (ported from landing/new-year)
   Mobile-first column; ≥1024px switches to the full-width desktop layout.
   ========================================================================== */

/* Local fonts (SIL Open Font License, fonts/OFL.txt): Cormorant Garamond, Jost, Herr Von Muellerhoff. */
@font-face { font-display: swap; font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300 700; src: url("fonts/cormorant-garamond-cyrillic-wght-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-display: swap; font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300 700; src: url("fonts/cormorant-garamond-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-display: swap; font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300 700; src: url("fonts/cormorant-garamond-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-display: swap; font-family: "Cormorant Garamond"; font-style: italic; font-weight: 300 700; src: url("fonts/cormorant-garamond-cyrillic-wght-italic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-display: swap; font-family: "Cormorant Garamond"; font-style: italic; font-weight: 300 700; src: url("fonts/cormorant-garamond-latin-ext-wght-italic.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-display: swap; font-family: "Cormorant Garamond"; font-style: italic; font-weight: 300 700; src: url("fonts/cormorant-garamond-latin-wght-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-display: swap; font-family: "Jost"; font-style: normal; font-weight: 100 900; src: url("fonts/jost-cyrillic-wght-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-display: swap; font-family: "Jost"; font-style: normal; font-weight: 100 900; src: url("fonts/jost-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-display: swap; font-family: "Jost"; font-style: normal; font-weight: 100 900; src: url("fonts/jost-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-display: swap; font-family: "Herr Von Muellerhoff"; font-style: normal; font-weight: 400; src: url("fonts/herr-von-muellerhoff-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-display: swap; font-family: "Herr Von Muellerhoff"; font-style: normal; font-weight: 400; src: url("fonts/herr-von-muellerhoff-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* palette */
  --navy-950: #070d1c;
  --navy-900: #0b1428;
  --navy-800: #101b34;
  --navy-700: #182543;
  --navy-600: #25345a;
  --ivory:    #f8f4ec;
  --cream:    #eee8e3;
  --cream-2:  #f4f0ec;
  --ink:      #18213a;
  --ink-2:    #444b63;
  --ink-3:    #7b8095;
  --line:     #d9d2cc;
  --gold:     #c6a066;
  --gold-l:   #e9d3a3;
  --gold-d:   #98743f;
  --ice:      #b8cbe0;
  --err:      #a2483c;
  --gold-grad: linear-gradient(135deg, #f1dcab 0%, #d3ad6f 42%, #b48a4f 70%, #e0c48d 100%);

  /* type */
  --f-display: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --f-ui:      "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --f-script:  "Herr Von Muellerhoff", "Pinyon Script", "Snell Roundhand", cursive;   /* signature-style hand, as in the mockup */

  /* layout */
  --gutter: 26px;
  --col: 480px;
  --colw: min(100vw, var(--col));     /* width of the page column */
  --ease-out: cubic-bezier(.22, .8, .24, 1);

  --noise: 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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .55 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
html.is-locked, html.is-locked body, html.menu-open, html.menu-open body { overflow: hidden; }
body {
  margin: 0;
  background: var(--navy-950);
  color: var(--ink);
  font: 300 1rem/1.55 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
picture { display: contents; }   /* the <picture> around a background must not become a grid cell */
picture > source { display: none; }   /* …and with display: contents its <source>s would turn into grid cells themselves */
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
p, h1, h2, h3, figure, ol, ul, dl, dd, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 3px; }

/* lining figures everywhere (every `font:` shorthand resets the variant) */
*, *::before, *::after { font-variant-numeric: lining-nums !important; }
.clock b { font-variant-numeric: lining-nums tabular-nums !important; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico--arrow { width: 1.3em; }
.ico-fill { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* ---------- page column ---------- */
.page {
  position: relative;
  max-width: var(--col);
  margin: 0 auto;
  background: var(--navy-900);
  overflow: clip;
}
@media (min-width: 560px) {
  body {
    background:
      radial-gradient(ellipse at 50% 0%, rgba(80,110,170,.25), transparent 60%),
      var(--navy-950) var(--noise);
    background-attachment: fixed;
  }
  .page { box-shadow: 0 0 0 1px rgba(233,211,163,.12), 0 30px 90px -20px rgba(0,0,0,.7); }
}

/* ---------- shared bits ---------- */
.eyebrow {
  font: 400 .8rem/1.6 var(--f-ui);
  letter-spacing: .3em;
  text-transform: uppercase;
  padding-left: .3em;
}
.flourish { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gold); }
.flourish i { display: block; width: 58px; height: 1px; background: linear-gradient(90deg, transparent, currentColor); }
.flourish i:last-child { transform: scaleX(-1); }
.flourish svg { width: 15px; height: 15px; filter: drop-shadow(0 0 4px rgba(233,211,163,.7)); }

.title {
  font: 400 clamp(2.45rem, 11.2vw, 3.1rem)/1.02 var(--f-display);
  text-transform: uppercase;
  letter-spacing: .05em;
  text-align: center;
  text-wrap: balance;
}
.title > span { display: block; }
.title > span:first-child { font-size: .6em; letter-spacing: .2em; padding-left: .2em; margin-bottom: .1em; }
.title--italic { font-style: italic; }
.title--italic > span:first-child { font-style: normal; }
.title--xl { font: italic 400 clamp(4.2rem, 21vw, 5.2rem)/1 var(--f-display); text-transform: none; letter-spacing: 0; }
.title--sm { font-size: 2.2rem; line-height: 1.05; }
.lead { font: italic 400 1.25rem/1.45 var(--f-display); text-wrap: pretty; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .9em;
  min-height: 54px; padding: 0 30px;
  font: 400 .84rem/1 var(--f-ui);
  letter-spacing: .24em; text-transform: uppercase;
  text-decoration: none;
  border-radius: 8px;
  transition: background-color .3s, color .3s, border-color .3s, transform .2s, box-shadow .3s, filter .3s;
}
.btn .ico { font-size: 1.05rem; }
.btn:active { transform: scale(.98); }
.btn--gold {
  background: var(--gold-grad);
  color: #1d2236;
  font-weight: 500;
  box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 -1px 0 rgba(120,85,40,.25) inset, 0 14px 28px -14px rgba(150,110,50,.8);
}
.btn--gold:hover { filter: brightness(1.05) saturate(1.05); }
.btn--glass {
  color: var(--ivory);
  border: 1px solid rgba(233,211,163,.75);
  border-radius: 999px;
  background: rgba(11,20,40,.42);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 0 22px -6px rgba(233,211,163,.45);
}
.btn--glass:hover { background: rgba(11,20,40,.6); border-color: var(--gold-l); }
.btn--line { border: 1px solid var(--ink-2); color: var(--ink); background: rgba(255,255,255,.3); }
.btn--line:hover { background: rgba(255,255,255,.7); }
.btn--block { width: 100%; }

/* glass plaque for text over photos */
.glass {
  color: var(--ivory);
  background: rgba(11,20,40,.42);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(233,211,163,.55);
  border-radius: 999px;
}

/* reveal on scroll (only when JS is on) */
.js [data-reveal] {
  opacity: 0;
  translate: 0 18px;
  transition: opacity 1s var(--ease-out), translate 1s var(--ease-out);
  transition-delay: calc(var(--rd, 0) * 110ms);
}
.js [data-reveal].is-in { opacity: 1; translate: none; }

/* animated alpha clips (webm) with a static poster underneath */
.anim { position: absolute; display: block; pointer-events: none; }
.anim > img, .anim > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.anim > video { opacity: 0; transition: opacity .6s; background: transparent; }
.anim > video[hidden] { display: none; }
.anim.is-playing > video { opacity: 1; }
.anim video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }   /* iOS: no play glyph */
.anim video::-webkit-media-controls { display: none !important; }
.anim.is-playing > img { opacity: 0; transition: opacity .6s .2s; }

/* ---------- background music toggle: four little bars that dance while it plays ---------- */
.sound-btn {
  position: fixed; z-index: 60;
  top: calc(14px + env(safe-area-inset-top));
  left: max(14px, calc(50vw - var(--col) / 2 + 14px));
  display: grid; place-items: center;
  width: 46px; height: 46px; padding: 0; border-radius: 50%;
  color: var(--gold-l);
  background: rgba(11,20,40,.5);
  border: 1px solid rgba(233,211,163,.4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; cursor: pointer;
  transition: opacity .5s var(--ease-out), background-color .3s, border-color .3s;
  -webkit-tap-highlight-color: transparent;
}
.is-opened .sound-btn { opacity: 1; pointer-events: auto; }
.sound-btn:hover { background: rgba(11,20,40,.72); border-color: rgba(233,211,163,.7); }
.sound-btn .eq { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.sound-btn .eq i {
  width: 2.5px; height: 16px; border-radius: 2px; background: currentColor;
  transform-origin: 50% 100%; scale: 1 .22; transition: scale .5s var(--ease-out), opacity .4s;
  opacity: .6;
}
.sound-btn.is-on .eq i { opacity: 1; animation: eq 1.1s ease-in-out infinite alternate; }
.sound-btn.is-on .eq i:nth-child(2) { animation-duration: .8s; animation-delay: -.3s; }
.sound-btn.is-on .eq i:nth-child(3) { animation-duration: 1.3s; animation-delay: -.7s; }
.sound-btn.is-on .eq i:nth-child(4) { animation-duration: .95s; animation-delay: -.2s; }
@keyframes eq { 0% { scale: 1 .25; } 50% { scale: 1 .9; } 100% { scale: 1 .45; } }
@media (prefers-reduced-motion: reduce) { .sound-btn.is-on .eq i { animation: none; scale: 1 .7; } }

/* ---------- menu ---------- */
.menu-btn {
  position: fixed; z-index: 60;
  top: calc(14px + env(safe-area-inset-top));
  right: max(14px, calc(50vw - var(--col) / 2 + 14px));
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  font-size: 24px; color: var(--ivory);
  background: rgba(11,20,40,.5);
  border: 1px solid rgba(233,211,163,.4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity .5s var(--ease-out), background-color .3s;
}
.menu-btn .ico { stroke-width: 1.3; }
.is-opened .menu-btn { opacity: 1; pointer-events: auto; }
.menu {
  position: fixed; z-index: 70;
  top: 0; bottom: 0; left: 50%; translate: -50% 0;
  width: 100%; max-width: var(--col);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px var(--gutter);
  color: var(--ivory);
  background: radial-gradient(ellipse at 50% 0%, rgba(233,211,163,.14), transparent 60%), var(--navy-900) var(--noise);
  text-align: center;
  opacity: 0;
  transition: opacity .45s var(--ease-out);
}
.menu.is-shown { opacity: 1; }
.menu[hidden] { display: none; }
.menu-close {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px;
  width: 46px; height: 46px; display: grid; place-items: center; font-size: 22px;
}
.menu-brand { font: 400 .9rem/1 var(--f-ui); letter-spacing: .42em; text-transform: uppercase; padding-left: .42em; margin-bottom: 14px; }
.menu ul { margin: 30px 0 34px; display: grid; gap: 4px; }
.menu ul a {
  display: block; padding: 8px 20px;
  font: italic 400 2rem/1.15 var(--f-display);
  text-decoration: none;
  transition: color .25s;
}
.menu ul a:hover { color: var(--gold-l); }
.menu-meta { font: 400 .72rem/1.4 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--gold-l); }

/* ==========================================================================
   1. COVER — envelope film (recipe: landing/конверты/ИНСТРУКЦИЯ_конверт_из_видео.md)
   The film and its stills share one 864×608 frame (--bw × --bh); every place on the envelope
   is a fraction of that frame. The envelope body is only 44 % of the frame width (the ribbon
   ends take the rest), so on phones the frame is wider than the screen and the ribbon simply
   runs off its edges.
   States on .cover: is-ready (envelope shown, waiting loop) → is-open (tapped) → is-playing
   (the film's first frame is on screen) → is-unsealed (the open still replaces the film's
   last frame) → is-revealed (the card slides out).
   ========================================================================== */
.cover {
  --bw: min(136vw, 980px, calc((100vh - 330px) * 1.42));
  --bh: calc(var(--bw) * .7037);          /* 608 / 864 */
  --sx: .492; --sy: .638;                 /* wax-seal centre on the closed envelope */
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--navy-800);
}
@supports (height: 1svh) {
  .cover { --bw: min(136vw, 980px, calc((100svh - 330px) * 1.42)); min-height: 100svh; }
}
.cover::after {   /* before the tap the scene is dimmed: only the envelope and its captions are bright */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 65% 45% at 50% 52%, rgba(5,10,24,.28), rgba(5,10,24,.66) 75%);
  transition: opacity 1.6s var(--ease-out);
}
.cover.is-open::after { opacity: 0; }
/* the same scene with an empty starry sky: the fireworks (still + loop underneath) are a surprise of the tap */
.cover-still {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: 50% 30%;
  opacity: 0; scale: 1.06;
  transition: opacity 1.6s var(--ease-out), scale 2.4s var(--ease-out);
  pointer-events: none;
}
.cover.is-intro .cover-still, .cover.is-ready .cover-still { opacity: 1; scale: 1; }
.cover.is-open .cover-still { opacity: 0; transition: opacity 1.6s var(--ease-out) .15s; }
html:not(.js) .cover-still { display: none; }
.cover-bg {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: 50% 30%;
  opacity: 0; scale: 1.06;
  transition: opacity 1.6s var(--ease-out), scale 2.4s var(--ease-out);
  pointer-events: none;
}
.cover.is-intro .cover-bg, .cover.is-ready .cover-bg { opacity: 1; scale: 1; }
.cover::before {   /* soft vignette so the envelope reads over the scene */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 50% 46%, rgba(7,13,28,.35), transparent 70%),
    linear-gradient(rgba(7,13,28,.25), transparent 25%, transparent 70%, rgba(7,13,28,.5));
}

.stage {
  position: relative; z-index: 2;
  width: var(--bw); height: var(--bh);
  justify-self: start; align-self: start;
  margin: clamp(104px, 15vh, 140px) 0 110px calc(50% - var(--bw) / 2);   /* high on the screen; centred even when wider than it */
}

.cover-eyebrow {
  position: absolute; left: 50%; top: calc(var(--bh) * .26 - 66px);   /* above the ribbon loop of the closed envelope */
  width: max-content;
  translate: -50% 8px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
  color: var(--ivory);
  opacity: 0;
  transition: opacity 1.2s var(--ease-out) .15s, translate 1.2s var(--ease-out) .15s;
}
.cover-eyebrow p {
  font: 400 .92rem/1 var(--f-ui);
  letter-spacing: .46em; text-transform: uppercase;
  padding-left: .46em;
  text-shadow: 0 1px 12px rgba(7,13,28,.8);
}
.cover.is-intro .cover-eyebrow, .cover.is-ready .cover-eyebrow { opacity: 1; translate: -50% 0; }
.cover.is-open .cover-eyebrow { opacity: 0; translate: -50% -10px; transition-delay: 0s; transition-duration: .5s; }

/* fireworks that bloom behind the card once it opens */
.anim--burst { width: 26%; aspect-ratio: 462 / 384; z-index: 0; opacity: 0; scale: .6; mix-blend-mode: screen;
  transition: opacity 1.2s var(--ease-out) 1.6s, scale 1.6s var(--ease-out) 1.6s; }
.anim--l { left: 13%; top: -6%; }
.anim--r { right: 13%; top: 6%; width: 22%; }
.cover.is-revealed .anim--burst { opacity: .95; scale: 1; }

/* the whole frame is the button; nothing is clickable before the envelope is shown */
.envelope {
  position: absolute; inset: 0; z-index: 1;
  display: block; padding: 0; background: none; border: 0;
  -webkit-tap-highlight-color: transparent;
}
.cover:not(.is-ready) .envelope { pointer-events: none; }
.cover.is-open .envelope { cursor: default; }
.envelope:focus-visible { outline-offset: -20%; }

.env {
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0; scale: .94;
  transition: opacity 1s var(--ease-out), scale 1.1s var(--ease-out);
}
.cover.is-ready .env { opacity: 1; scale: 1; animation: float 5.2s ease-in-out 1.2s infinite; }
/* teaser while it waits: the closed envelope turns a few degrees in perspective (a flat card, so a 3D turn
   of the picture is exact); on the tap it settles back flat (main.js hands the current pose to a transition) */
.cover.is-ready:not(.is-open) .env { animation: float 5.2s ease-in-out 1.2s infinite, tilt 7s ease-in-out 1.4s infinite; }
.cover.is-open .env { transition: opacity 1s var(--ease-out), scale 1.1s var(--ease-out), transform .55s var(--ease-out), filter .55s ease; }
.env > *, .env-open > * { position: absolute; }
.env-closed, .env-idle, .env-film, .env-back, .env-front { inset: 0; width: 100%; height: 100%; max-width: none; }
/* the ribbon ends reach the frame edges: fade them out instead of a hard cut */
.env-closed, .env-idle, .env-film, .env-back, .env-front {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 11%, #000 89%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 11%, #000 89%, transparent 100%);
}
.env-closed, .env-idle, .env-film, .env-back { filter: drop-shadow(0 22px 26px rgba(0,0,0,.42)) drop-shadow(0 4px 6px rgba(0,0,0,.25)); }

.env-closed { z-index: 2; transition: opacity .6s ease; }
.cover.is-unsealed .env-closed { opacity: 0; }
.cover.is-playing .env-closed { opacity: 0; transition: none; }
/* waiting loop: starts and ends on the closed still, so it replaces it without a fade;
   on the tap it dissolves under the opening film */
.env-idle { z-index: 2; object-fit: fill; opacity: 0; }
.cover.is-idling .env-idle { opacity: 1; }
.cover.is-idling .env-closed { opacity: 0; transition: none; }
.cover.is-idling.is-playing .env-idle, .cover.is-idling.is-unsealed .env-idle { opacity: 0; transition: opacity .3s ease; }

/* waiting: the sharp closed still (= the film's first frame) with a slow light sweep across the paper,
   ribbon and wax, clipped to the envelope's own silhouette by using the same picture as a mask */
.env-glint { inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; mix-blend-mode: soft-light; opacity: 0; }
.cover.is-ready:not(.is-open) .env-glint { opacity: 1; }
.cover.is-ready:not(.is-open) .glint-band { animation: glint 5.8s ease-in-out 1.6s infinite; }
.cover.is-open .env-glint { opacity: 0; transition: opacity .2s ease; }

.env-film { z-index: 4; object-fit: fill; opacity: 0; }
.cover.is-playing .env-film { opacity: 1; }
.cover.is-unsealed .env-film { visibility: hidden; }

.env-open { inset: 0; z-index: 1; opacity: 0; transition: opacity .65s ease .1s; }
.cover.is-unsealed .env-open { opacity: 1; }
.cover.is-playing .env-open { transition: none; }   /* the still is the film's last frame: swap without a fade */
.env-back { z-index: 1; }
.env-front { z-index: 3; }
.card-clip { inset: 0; z-index: 2; clip-path: inset(-40% -20% 14.6% -20%); }   /* never below the body (y 519 / 608) */

/* the card: within the body (x 256–606 of 864); it starts fully behind the pocket and rises */
.card {
  --cw: calc(var(--bw) * .405);
  position: absolute;   /* inside .card-clip, which `.env-open > *` does not reach */
  left: 29.6%; top: 1.6%; width: 40.5%; height: 82%;
  display: flex; flex-direction: column; align-items: center;
  padding-top: calc(var(--cw) * .1);
  text-align: center;
  color: var(--ink);
  background: #fbf8f2 url("img/paper-tex.jpg") center / 256px 256px;
  border-radius: 2px;
  box-shadow: 0 -1px 0 rgba(255,255,255,.8) inset, 0 8px 22px -10px rgba(30,25,40,.45);
  translate: 0 calc(var(--bh) * .59);
  visibility: hidden;
  transition: translate 1.6s cubic-bezier(.2,.75,.25,1);
}
.cover.is-unsealed .card { visibility: visible; }
.cover.is-revealed .card { translate: 0 0; }
.card-frame { position: absolute; inset: calc(var(--cw) * .034); pointer-events: none; }
.card-frame svg { width: 100%; height: 100%; }
.card-frame rect { fill: none; stroke: var(--gold); vector-effect: non-scaling-stroke; }
.card-frame .f1 { stroke-width: 1.2; }
.card-frame .f2 { stroke-width: .6; opacity: .7; }
.card-eyebrow {
  font: 400 max(7px, calc(var(--cw) * .031))/1.4 var(--f-ui);
  letter-spacing: .28em; text-transform: uppercase;
  padding-left: .28em;
  color: var(--ink-2);
}
.card-title {
  margin-top: calc(var(--cw) * .04);
  font: 400 calc(var(--cw) * .112)/.98 var(--f-display);
  text-transform: uppercase;
  letter-spacing: .08em; padding-left: .08em;
}
.card-script {
  margin-top: calc(var(--cw) * -.005);
  font: 400 calc(var(--cw) * .17)/1.15 var(--f-script);
  background: linear-gradient(100deg, #a77d43, #d8b678 45%, #a77d43 80%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding: 0 .15em;
}
.card-rule { display: flex; align-items: center; gap: 6px; color: var(--gold); margin: calc(var(--cw) * .007) 0 calc(var(--cw) * .031); }
.card-rule i { width: calc(var(--cw) * .11); height: 1px; background: linear-gradient(90deg, transparent, currentColor); }
.card-rule i:last-child { transform: scaleX(-1); }
.card-rule svg { width: calc(var(--cw) * .036); height: calc(var(--cw) * .036); }
.card-sub { font: italic 400 calc(var(--cw) * .063)/1.2 var(--f-display); color: var(--ink-2); }
.card-date {
  margin-top: calc(var(--cw) * .034);
  font: 500 calc(var(--cw) * .04)/1 var(--f-ui);
  letter-spacing: .3em; padding-left: .3em;
  color: var(--gold-d);
}

/* a calm warm halo that "breathes" round the wax seal while the envelope waits */
.seal-ring {
  z-index: 5;
  left: calc(var(--bw) * var(--sx)); top: calc(var(--bh) * var(--sy));
  width: calc(var(--bw) * .14); height: calc(var(--bw) * .14);
  margin: calc(var(--bw) * -.07) 0 0 calc(var(--bw) * -.07);
  border-radius: 50%;
  background: radial-gradient(closest-side, transparent 50%, rgba(255,214,140,.5) 68%, rgba(255,214,140,0) 100%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}
.cover.is-ready:not(.is-open) .seal-ring { animation: halo 4.4s ease-in-out 1.4s infinite; }
.cover.is-open .seal-ring { opacity: 0; transition: opacity .3s ease; }

/* hint + after-open block */
.cover-hint {
  position: absolute; left: 50%; top: calc(var(--bh) * .95 + 4px);   /* below the ribbon tail */
  translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: max-content;
  text-align: center;
  opacity: 0;
  transition: opacity .9s var(--ease-out) .4s;
  pointer-events: none;
  z-index: 3;
}
.cover-hint p { padding: 11px 22px 12px; font: 400 .74rem/1.3 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; }
.cover-hint p span { padding-left: .26em; }
.cover-hint p em { font: italic 400 1.15rem/1 var(--f-display); letter-spacing: .04em; text-transform: none; color: var(--gold-l); }
.tap-ring {
  display: grid; place-items: center;
  width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid rgba(233,211,163,.55);
  background: rgba(11,20,40,.38);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.tap-icon { width: 28px; height: 28px; fill: none; stroke: var(--ivory); stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.cover.is-ready .cover-hint { opacity: 1; }
.cover.is-ready .tap-icon { animation: tap 2.2s ease-in-out 1.4s infinite; }
.cover.is-open .cover-hint { opacity: 0; transition-delay: 0s; transition-duration: .3s; }

.cover-after {
  position: absolute; left: 50%; top: calc(var(--bh) * .855 + 10px);
  translate: -50% 10px;
  width: max-content;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  opacity: 0; visibility: hidden;
  transition: opacity .9s var(--ease-out) 1.1s, translate .9s var(--ease-out) 1.1s, visibility 0s 1.1s;
  z-index: 3;
}
.cover-date {
  position: absolute; left: 50%; top: calc(var(--bh) * .016 - 46px);   /* just above the risen card */
  translate: -50% 8px; width: max-content; z-index: 3;
  opacity: 0; visibility: hidden;
  transition: opacity .9s var(--ease-out) 1.1s, translate .9s var(--ease-out) 1.1s, visibility 0s 1.1s;
  padding: 9px 18px 10px;
  font: 400 .7rem/1 var(--f-ui);
  letter-spacing: .26em; text-transform: uppercase;
}
.cover-date { padding-left: calc(18px + .26em); }
.cover-chev { display: none; }   /* it would sit on the snow globe; the button already leads on */
.cover.is-revealed .cover-after, .cover.is-revealed .cover-date { opacity: 1; visibility: visible; translate: -50% 0; }

/* instant open (deep link) */
.cover.no-anim *, .cover.no-anim *::before, .cover.no-anim *::after { transition: none !important; animation-duration: .001s !important; animation-delay: 0s !important; }
.cover.no-anim .env { animation: none !important; }

/* golden sparks from the seal on opening */
.spark {
  position: absolute; z-index: 8;
  left: calc(var(--bw) * var(--sx)); top: calc(var(--bh) * var(--sy));
  width: var(--s); height: var(--s);
  background: var(--c, #f1dcab);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 3px rgba(255,220,150,.9));
  pointer-events: none;
  animation: spark var(--d) cubic-bezier(.2,.7,.3,1) forwards;
}
.spark.is-dot { clip-path: none; border-radius: 50%; }

/* without JS: the open envelope with the card, straight away */
html:not(.js) .env, html:not(.js) .cover-bg { opacity: 1; scale: 1; }
html:not(.js) .env-closed, html:not(.js) .env-idle, html:not(.js) .env-glint, html:not(.js) .env-film, html:not(.js) .seal-ring, html:not(.js) .cover-hint { display: none; }
html:not(.js) .env-open { opacity: 1; }
html:not(.js) .card { visibility: visible; translate: none; }
html:not(.js) .cover-after, html:not(.js) .cover-date { opacity: 1; visibility: visible; translate: -50% 0; }

@keyframes halo { 0%, 100% { opacity: .25; scale: .92; } 50% { opacity: .9; scale: 1.08; } }
@keyframes glint { 0% { transform: translateX(0); } 55%, 100% { transform: translateX(2500px); } }   /* SVG user units */
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes tilt {
  0%, 100% { transform: perspective(1100px) rotateX(0deg) rotateY(0deg) rotateZ(0deg); filter: brightness(1); }
  24%      { transform: perspective(1100px) rotateX(7deg) rotateY(-15deg) rotateZ(-2deg); filter: brightness(1.09); }
  50%      { transform: perspective(1100px) rotateX(-1.5deg) rotateY(2deg) rotateZ(.4deg); filter: brightness(1); }
  76%      { transform: perspective(1100px) rotateX(-6deg) rotateY(14deg) rotateZ(1.8deg); filter: brightness(.94); }
}
@keyframes tap { 0%, 60%, 100% { transform: translateY(0) scale(1); } 70% { transform: translateY(3px) scale(.94); } 80% { transform: translateY(0) scale(1); } }
@keyframes nudge { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(4px); } }
@keyframes spark {
  0%   { transform: translate(-50%, -50%) rotate(0) scale(.3); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(1); opacity: 0; }
}

/* ==========================================================================
   Content sections — shared shell
   ========================================================================== */
.sec {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 0 var(--gutter);
  text-align: center;
}
.sec--dark  { --base: var(--navy-800); background: var(--base); color: var(--ivory); }
.sec--light { --base: var(--cream);    background: var(--base); color: var(--ink); }
.sec-bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: 50% 50%;
  pointer-events: none;
}
/* living background loop (desktop only, created by JS on top of the still) */
.bg-loop {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; max-width: none;
  object-fit: cover;
  opacity: 0; transition: opacity 1.2s var(--ease-out);
  pointer-events: none;
}
.cover .bg-loop { z-index: -1; }
.bg-loop.is-on { opacity: 1; }
@media (max-width: 1023px) { .bg-loop--d { display: none; } }
@media (min-width: 1024px) { .bg-loop--m { display: none; } }

/* phones: animated top / bottom tiles placed over the vertical still (geometry set by JS) */
.m-stage { position: absolute; z-index: -2; pointer-events: none; }
.cover .m-stage { z-index: -1; }
.m-stage video {
  position: absolute; left: 0; width: 100%; max-width: none;
  object-fit: fill;
  opacity: 0; transition: opacity 1.2s var(--ease-out);
}
.m-stage video.is-on { opacity: 1; }
/* how much of each tile shows: per section, so the video covers only the decor and the calm,
   sparkly middle always stays the sharp still (--mt-*: top tile fade, --mb-*: bottom tile fade, % of tile height) */
.m-stage video[data-edge="top"] {
  -webkit-mask-image: linear-gradient(#000 0, #000 var(--mt-a, 76%), transparent var(--mt-b, 100%));
          mask-image: linear-gradient(#000 0, #000 var(--mt-a, 76%), transparent var(--mt-b, 100%));
}
.m-stage video[data-edge="bot"] {
  -webkit-mask-image: linear-gradient(transparent 0, transparent var(--mb-a, 0%), #000 var(--mb-b, 24%), #000 100%);
          mask-image: linear-gradient(transparent 0, transparent var(--mb-a, 0%), #000 var(--mb-b, 24%), #000 100%);
}
.invite { --mt-a: 48%; --mt-b: 60%; --mb-a: 36%; --mb-b: 48%; }   /* ribbon + berries on top, the coupe still life below */
.countdown { --mt-a: 40%; --mt-b: 54%; }                            /* only the bursts move; the sky under the title stays still */
.program { --mb-a: 30%; --mb-b: 40%; }                              /* the disco ball + candles; the ivory wall above stays still */
@media (min-width: 1024px) { .m-stage { display: none; } }

/* soft hand-over from the section above (navy ↔ cream) */
.sec::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 70px; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--from, transparent), transparent);
}
.invite    { --from: #0e1b2e; }
.countdown { --from: #d9d7dc; }
.program   { --from: #0f1828; }
.details   { --from: #c9cbd8; }
.rsvp      { --from: #12192c; }

/* ==========================================================================
   Seams between screens on phones: no line at all. Each screen slides --dz up over the one above
   and dissolves into it (mask on the whole section), and a few faint gold sparks twinkle in that
   overlap. Desktop keeps its own layout. The first joint (cover -> invitation) only overlaps once
   the envelope is open, so nothing creeps into the dimmed first screen.
   ========================================================================== */
.seam { position: relative; height: 0; z-index: 6; pointer-events: none; }
@media (min-width: 1024px) { .seam { display: none; } }
@media (max-width: 1023px) {
  .sec::before { display: none; }                         /* the dissolve replaces the old colour fades */
  .seam, .seam + .sec { --dz: 110px; }
  html:not(.is-opened) .seam--first, html:not(.is-opened) .seam--first + .sec { --dz: 0px; }
  .seam + .sec {
    margin-top: calc(-1 * var(--dz));
    -webkit-mask-image: linear-gradient(transparent 0, rgba(0,0,0,.1) calc(var(--dz) * .25), rgba(0,0,0,.45) calc(var(--dz) * .5),
                                        rgba(0,0,0,.85) calc(var(--dz) * .78), #000 var(--dz));
            mask-image: linear-gradient(transparent 0, rgba(0,0,0,.1) calc(var(--dz) * .25), rgba(0,0,0,.45) calc(var(--dz) * .5),
                                        rgba(0,0,0,.85) calc(var(--dz) * .78), #000 var(--dz));
  }
}
/* sparks: tiny warm points + two small four-point glints, all very soft */
.seam-glints, .seam-spark { position: absolute; }
.seam-glints {
  left: 0; right: 0; top: calc(-1 * var(--dz, 110px) - 10px); height: calc(var(--dz, 110px) + 20px);
  background:
    radial-gradient(circle at 9% 62%,  rgba(255,244,214,.9) 0 1px, rgba(226,184,110,.28) 2px, transparent 6px),
    radial-gradient(circle at 23% 30%, rgba(255,244,214,.8) 0 .8px, rgba(226,184,110,.22) 1.6px, transparent 5px),
    radial-gradient(circle at 41% 74%, rgba(255,244,214,.85) 0 1px, rgba(226,184,110,.25) 2px, transparent 6px),
    radial-gradient(circle at 57% 38%, rgba(255,244,214,.75) 0 .8px, rgba(226,184,110,.2) 1.6px, transparent 5px),
    radial-gradient(circle at 72% 58%, rgba(255,244,214,.9) 0 1.1px, rgba(226,184,110,.28) 2.2px, transparent 7px),
    radial-gradient(circle at 88% 26%, rgba(255,244,214,.8) 0 .9px, rgba(226,184,110,.22) 1.8px, transparent 5px),
    radial-gradient(circle at 95% 70%, rgba(255,244,214,.7) 0 .8px, rgba(226,184,110,.2) 1.6px, transparent 5px);
  animation: glints 5.5s ease-in-out infinite;
}
.seam-spark {
  width: 34px; top: calc(var(--dz, 110px) * -.62); left: var(--a); translate: -50% -50%;
  opacity: .0; filter: drop-shadow(0 0 5px rgba(255,214,150,.7));
  animation: seam-spark 6s ease-in-out infinite;
}
.seam-spark--b { width: 22px; left: var(--b); top: calc(var(--dz, 110px) * -.3); animation-delay: -3s; }
.seam--first { opacity: 0; transition: opacity 1.2s var(--ease-out) 1.2s; }
.is-opened .seam--first { opacity: 1; }
@keyframes glints { 0%, 100% { opacity: .35; } 50% { opacity: .8; } }
@keyframes seam-spark { 0%, 100% { opacity: 0; scale: .6; rotate: 0deg; } 45% { opacity: .75; scale: 1; rotate: 20deg; } 70% { opacity: 0; scale: .7; } }
@media (prefers-reduced-motion: reduce) { .seam-glints, .seam-spark { animation: none; } .seam-spark { opacity: .5; } }


/* ==========================================================================
   2. INVITATION
   ========================================================================== */
.invite {
  min-height: calc(var(--colw) * 3.3 + var(--dz, 0px));
  padding-top: calc(var(--colw) * .52 + var(--dz, 0px));
  padding-bottom: calc(var(--colw) * .78);
}
.invite .sec-bg { object-position: 50% 40%; }

.inv-card {
  position: relative;
  width: min(80%, 320px);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10% 10% 16%;
  filter: drop-shadow(0 22px 26px rgba(60,48,40,.24)) drop-shadow(0 2px 3px rgba(60,48,40,.12));
}
.inv-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(160deg, rgba(255,255,255,.65), rgba(255,255,255,0) 60%), #fbf8f2 url("img/paper-tex.jpg") center / 256px 256px;
  --n: 16px;
  -webkit-mask:
    radial-gradient(circle at 0 0, transparent var(--n), #000 calc(var(--n) + .5px)) top left / 51% 51% no-repeat,
    radial-gradient(circle at 100% 0, transparent var(--n), #000 calc(var(--n) + .5px)) top right / 51% 51% no-repeat,
    radial-gradient(circle at 0 100%, transparent var(--n), #000 calc(var(--n) + .5px)) bottom left / 51% 51% no-repeat,
    radial-gradient(circle at 100% 100%, transparent var(--n), #000 calc(var(--n) + .5px)) bottom right / 51% 51% no-repeat;
          mask:
    radial-gradient(circle at 0 0, transparent var(--n), #000 calc(var(--n) + .5px)) top left / 51% 51% no-repeat,
    radial-gradient(circle at 100% 0, transparent var(--n), #000 calc(var(--n) + .5px)) top right / 51% 51% no-repeat,
    radial-gradient(circle at 0 100%, transparent var(--n), #000 calc(var(--n) + .5px)) bottom left / 51% 51% no-repeat,
    radial-gradient(circle at 100% 100%, transparent var(--n), #000 calc(var(--n) + .5px)) bottom right / 51% 51% no-repeat;
}
.inv-frame { position: absolute; inset: 22px; border: 1px solid rgba(198,160,102,.75); pointer-events: none; }
.inv-frame::before, .inv-frame::after {   /* small diamonds at the top and bottom of the frame */
  content: ""; position: absolute; left: 50%; width: 7px; height: 7px; margin-left: -3.5px;
  background: var(--gold); rotate: 45deg;
}
.inv-frame::before { top: -4px; }
.inv-frame::after  { bottom: -4px; }
.inv-title { display: flex; flex-direction: column; align-items: center; font-weight: 400; }
.inv-1 {
  font: 400 clamp(1.9rem, 8.6vw, 2.35rem)/1.04 var(--f-display);
  text-transform: uppercase; letter-spacing: .1em; padding-left: .1em;
}
.inv-2 { margin: 8px 0 6px; font: italic 400 1.2rem/1 var(--f-display); color: var(--ink-2); }
.inv-3 { font: italic 400 clamp(1.45rem, 6.4vw, 1.7rem)/1.18 var(--f-display); }
.inv-seal { position: absolute; width: 66px; left: 50%; bottom: -26px; margin-left: -33px; filter: drop-shadow(0 6px 6px rgba(80,55,25,.35)); }
.inv-fir { position: absolute; width: 46%; right: -18%; top: -9%; rotate: 8deg; filter: drop-shadow(0 8px 8px rgba(40,40,40,.2)); }

.facts { margin: 64px auto 0; max-width: 330px; text-align: left; }
.facts li {
  display: grid; grid-template-columns: 34px 1fr; gap: 20px; align-items: center;
  padding: 15px 4px;
  font: 500 .86rem/1.3 var(--f-ui); letter-spacing: .16em; text-transform: uppercase;
}
.facts li + li { border-top: 1px solid rgba(198,160,102,.45); }
.facts .ico { width: 32px; height: 32px; color: var(--gold-d); stroke-width: 1.3; }

/* ==========================================================================
   3. COUNTDOWN
   ========================================================================== */
.countdown {
  min-height: calc(var(--colw) * 3.42 + var(--dz, 0px));
  display: flex; flex-direction: column; justify-content: space-between;
  padding-top: calc(var(--colw) * .8 + var(--dz, 0px));
  padding-bottom: calc(var(--colw) * .26);
}
.countdown .sec-bg { object-position: 50% 0%; }
.count-head { position: relative; }
.countdown .title { text-shadow: 0 2px 18px rgba(7,13,28,.6); }
.countdown .title > span:first-child { font-size: 1em; letter-spacing: .05em; padding-left: 0; margin: 0; }
.clock {
  display: flex; justify-content: center; align-items: flex-start; gap: 4px;
  margin-top: 30px;
}
.clock > div { display: flex; flex-direction: column; align-items: center; min-width: 58px; }
.clock b { font: 300 clamp(2.6rem, 12vw, 3.2rem)/1 var(--f-display); letter-spacing: .02em; }
.clock i { font: 300 clamp(2.2rem, 10vw, 2.7rem)/1 var(--f-display); font-style: normal; opacity: .75; }
.clock small { margin-top: 8px; font: 400 .58rem/1 var(--f-ui); letter-spacing: .22em; text-transform: uppercase; padding-left: .22em; opacity: .85; }
.clock-done { margin-top: 26px; font: 400 3.6rem/1.1 var(--f-script); color: var(--gold-l); }
.count-head .flourish { margin-top: 30px; }
.anim--spark { width: 96px; aspect-ratio: 298 / 334; mix-blend-mode: screen; }
.anim--s1 { right: -4px; top: -64px; }
.quote { color: var(--ink); }
.quote p { font: italic 400 clamp(1.45rem, 6.6vw, 1.7rem)/1.4 var(--f-display); }
.quote .flourish { margin-top: 18px; }

/* ==========================================================================
   4. NIGHT PROGRAM
   ========================================================================== */
.program {
  padding-top: calc(var(--colw) * .4 + var(--dz, 0px));
  padding-bottom: calc(var(--colw) * 1.02);
}
.program .sec-bg { object-position: 50% 100%; }
.timeline {
  position: relative;
  margin: 46px auto 0;
  max-width: 340px;
  display: grid; gap: 28px;
  text-align: left;
}
.timeline::before {   /* vertical hairline with dots */
  content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 1px;
  background: linear-gradient(transparent, var(--gold) 6%, var(--gold) 94%, transparent);
}
.timeline li { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 16px; align-items: start; padding-left: 26px; }
.timeline li::before {
  content: ""; position: absolute; left: 1px; top: 15px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--cream-2); border: 1.5px solid var(--gold);
}
.timeline .ico { width: 38px; height: 38px; color: var(--gold-d); stroke-width: 1.2; margin-top: 2px; }
.timeline time { display: block; font: 400 1.6rem/1 var(--f-display); letter-spacing: .02em; }
.timeline b { display: block; margin-top: 6px; font: 500 .82rem/1.3 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; }
.timeline span { display: block; margin-top: 2px; font: 300 .95rem/1.35 var(--f-ui); color: var(--ink-2); }

/* ==========================================================================
   5. CELEBRATION DETAILS
   ========================================================================== */
.details {
  padding-top: calc(var(--colw) * .62 + var(--dz, 0px));
  padding-bottom: calc(var(--colw) * .78);
}
.details .sec-bg { object-position: 50% 50%; }
.details .title { text-shadow: 0 2px 18px rgba(7,13,28,.7); }
.glass-card {
  margin: 34px auto 0; max-width: 380px;
  padding: 8px 24px;
  text-align: left;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(60,72,104,.5), rgba(14,22,42,.55));
  border: 1px solid rgba(233,211,163,.35);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.12) inset;
}
.dt { display: grid; grid-template-columns: 38px 1fr; gap: 18px; padding: 24px 0; }
.dt + .dt { border-top: 1px solid rgba(233,211,163,.22); }
.dt > .ico { width: 36px; height: 36px; color: var(--gold-l); stroke-width: 1.2; }
.dt h3 { font: 400 .92rem/1.3 var(--f-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-l); }
.dt p { margin-top: 6px; font: 300 .98rem/1.5 var(--f-ui); color: rgba(248,244,236,.9); }
.text-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  font: 400 .72rem/1 var(--f-ui); letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-l); text-decoration: none; border-bottom: 1px solid rgba(233,211,163,.4); padding-bottom: 5px;
}
.swatches { display: flex; gap: 12px; margin-top: 14px; }
.swatches li {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c);
  border: 1px solid rgba(233,211,163,.6);
  box-shadow: 0 4px 10px -3px rgba(0,0,0,.6), inset 0 1px 1px rgba(255,255,255,.35);
}

/* ==========================================================================
   6. RSVP
   ========================================================================== */
.rsvp {
  padding-top: calc(var(--colw) * .3 + var(--dz, 0px));
  padding-bottom: calc(var(--colw) * .42);
}
.rsvp .sec-bg { object-position: 50% 0%; }
.rsvp-bow, .rsvp-fir { display: none; }
.rsvp-head .flourish { margin: 6px 0 14px; }
.rsvp .eyebrow { font: 400 1.05rem/1.35 var(--f-display); letter-spacing: .2em; padding-left: .2em; }
.rsvp .eyebrow span { font-size: .82em; }
.rsvp-by { margin-top: 10px; font: italic 400 1.05rem/1.3 var(--f-display); color: var(--ink-2); }

.form { margin-top: 30px; text-align: left; }
.field { margin-bottom: 20px; border: 0; padding: 0; min-width: 0; }
.field > label:not(.choice-card), .field > .label {
  display: block; padding: 0;
  font: 500 .72rem/1.4 var(--f-ui);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}
.field label i, .field .label i { font-style: normal; color: var(--gold-d); }
.field label em { font-style: normal; color: var(--ink-3); letter-spacing: .1em; }
.field input[type=text], .field input[type=email], .field textarea, .select select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
  padding: 13px 16px;
  font: 400 1rem/1.35 var(--f-ui);
  color: var(--ink);
  transition: border-color .25s, background-color .25s, box-shadow .25s;
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 92px; }
.field input::placeholder, .field textarea::placeholder { color: #9b9eac; font-weight: 300; }
.field input:focus, .field textarea:focus, .select select:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(198,160,102,.2);
}
.select { position: relative; display: block; }
.select::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); rotate: 45deg; pointer-events: none;
}
.select select { padding-right: 44px; cursor: pointer; }
.select select:invalid { color: #9b9eac; }

.err { display: none; margin-top: 6px; font: 400 .88rem/1.3 var(--f-ui); color: var(--err); }
.field.has-error .err { display: block; }
.field.has-error input, .field.has-error .choice-card, .field.has-error select { border-color: var(--err); }
.hint { margin-top: 6px; font: 300 .86rem/1.2 var(--f-ui); color: var(--ink-3); }

.choice { display: grid; gap: 10px; margin-bottom: 22px; }
.choice-card {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  min-height: 52px;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.7);
  font: 500 .8rem/1.3 var(--f-ui);
  letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer;
  transition: background-color .35s var(--ease-out), border-color .35s, box-shadow .35s, color .35s;
  -webkit-tap-highlight-color: transparent;
}
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-mark {
  position: relative;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--ink-2);
  flex: none;
  transition: border-color .35s;
}
.choice-mark::after {
  content: ""; position: absolute; inset: 3.5px; border-radius: 50%;
  background: var(--gold-l);
  transform: scale(0); transition: transform .35s var(--ease-out);
}
.choice-card:has(input:checked) {
  background: var(--navy-800); color: var(--ivory);
  border-color: var(--navy-800);
  box-shadow: 0 14px 26px -16px rgba(16,27,52,.9);
}
.choice-card:has(input:checked) .choice-mark { border-color: var(--gold-l); }
.choice-card:has(input:checked) .choice-mark::after { transform: scale(1); }
.choice-card:has(input:focus-visible) { outline: 1.5px solid var(--gold); outline-offset: 3px; }
.choice-card.is-checked { background: var(--navy-800); color: var(--ivory); border-color: var(--navy-800); }
.choice-card.is-checked .choice-mark { border-color: var(--gold-l); }
.choice-card.is-checked .choice-mark::after { transform: scale(1); }

.if-attending {
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows .55s var(--ease-out), opacity .45s;
}
.if-attending > .if-inner { overflow: hidden; min-height: 0; }
.if-attending.is-collapsed { grid-template-rows: 0fr; opacity: 0; }
.field.is-hidden { display: none; }

#rsvpSubmit { margin-top: 8px; min-height: 58px; font-size: .92rem; }
#rsvpSubmit.is-loading { pointer-events: none; opacity: .8; }
#rsvpSubmit.is-loading span::after { content: "…"; }
.form-status { margin-top: 12px; min-height: 1.3em; text-align: center; font: 400 .9rem/1.3 var(--f-ui); color: var(--err); }

.thanks {
  margin-top: 30px;
  padding: 30px 24px 32px;
  border: 1px solid rgba(198,160,102,.5);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 24px 40px -30px rgba(40,40,60,.5);
  animation: rise .8s var(--ease-out) both;
}
.thanks:focus { outline: none; }
.thanks-star { width: 84px; margin: 0 auto 8px; }
.thanks .title { text-transform: none; font-style: italic; letter-spacing: 0; }
.thanks .lead { margin: 12px auto 22px; max-width: 18em; color: var(--ink-2); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  position: relative;
  padding: 120px var(--gutter) 70px;
  text-align: center;
  color: var(--ivory);
  background: radial-gradient(ellipse at 50% 0%, rgba(233,211,163,.12), transparent 60%), var(--navy-900);
  overflow: hidden;
}
.footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 60px; background: linear-gradient(#b3b4c2, transparent); opacity: .25; }
.anim--lights { left: 50%; top: 0; width: min(110%, 520px); margin-left: calc(min(110%, 520px) / -2); aspect-ratio: 546 / 150; }
.anim--coupes { position: relative; display: block; width: 150px; aspect-ratio: 508 / 532; margin: 0 auto 6px; }
.footer-script { font: 400 3.3rem/1.1 var(--f-script); color: var(--gold-l); }
.footer-brand { margin-top: 10px; font: 400 .9rem/1 var(--f-ui); letter-spacing: .42em; text-transform: uppercase; padding-left: .42em; }
.footer-meta { margin-top: 12px; font: 300 .76rem/1.5 var(--f-ui); letter-spacing: .24em; text-transform: uppercase; color: rgba(248,244,236,.7); }
.footer-note { margin-top: 20px; font: italic 400 1.1rem/1.4 var(--f-display); color: rgba(248,244,236,.8); }
.footer-note a { color: var(--gold-l); }
.footer-bg { display: none; }

/* phones: the last screen is the light still life from the reference (bottom of the invitation scene) */
@media (max-width: 1023px) {
  .footer {
    --mb-a: 36%; --mb-b: 48%;                         /* only the coupe + votives move (the invite tile) */
    isolation: isolate;
    min-height: calc(var(--colw) * 3400 / 1536);      /* the picture at its own proportions */
    padding: calc(var(--colw) * .2) var(--gutter) 0;
    color: var(--ink);
    background: #efe7e3;
  }
  .footer::before { display: none; }
  .footer-bg {
    display: block;
    position: absolute; inset: 0; z-index: -2;
    width: 100%; height: 100%; max-width: none;
    object-fit: cover; object-position: 50% 100%;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(transparent 0, #000 12%);  /* rises out of the same cream the RSVP ends in */
            mask-image: linear-gradient(transparent 0, #000 12%);
  }
  .footer { background: #e9ddd9; }
  .rsvp { --base: #e9ddd9; }
  .rsvp .sec-bg {
    /* starts below the dissolve from Details, so the ribbon never lies over the candles; its top edge
       emerges softly from the cream, and the snow + fir at the bottom melt into the footer's cream */
    top: var(--dz, 0px); height: calc(100% - var(--dz, 0px));
    -webkit-mask-image: linear-gradient(transparent 0, #000 70px, #000 calc(100% - 110px), transparent 100%);
            mask-image: linear-gradient(transparent 0, #000 70px, #000 calc(100% - 110px), transparent 100%);
  }
  .footer .anim--lights, .footer .anim--coupes { display: none; }
  .footer-script { color: var(--gold-d); font-size: 3.5rem; text-shadow: 0 1px 14px rgba(255,255,255,.7); }
  .footer-brand { color: var(--ink); }
  .footer-meta { color: var(--ink-2); }
  .footer-note { color: var(--ink-2); }
  .footer-note a { color: var(--gold-d); }
}

/* ---------- floating RSVP ---------- */
.fab {
  position: fixed; z-index: 50;
  right: max(16px, calc(50vw - var(--col) / 2 + 16px));
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: grid; place-items: center;
  width: 64px; height: 64px; border-radius: 50%;
  color: #1d2236; isolation: isolate;
  font: 500 .74rem/1 var(--f-ui); letter-spacing: .16em; padding-left: .16em; text-decoration: none;
  opacity: 0; scale: .8; pointer-events: none;
  transition: opacity .4s var(--ease-out), scale .4s var(--ease-out);
}
.fab.is-shown { opacity: 1; scale: 1; pointer-events: auto; }
/* a drop of molten gold, like wax in a lava lamp: the button never moves, only its outline slowly
   flows and light / dark blobs rise and sink inside it. Every 8 s it teases: a springy squash and a
   thin gold ring that ripples out. */
.fab::before, .fab::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fab::before {
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(255,249,228,.9), rgba(255,249,228,0)) 20% 110% / 62% 62% no-repeat,
    radial-gradient(closest-side, rgba(140,96,40,.5), rgba(140,96,40,0)) 80% -10% / 72% 72% no-repeat,
    var(--gold-grad);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.6), inset 0 -3px 8px rgba(120,80,30,.35);
  filter: drop-shadow(0 12px 12px rgba(0,0,0,.4));
  animation: lava 9s ease-in-out infinite, molten 11s ease-in-out infinite, fab-tease 8s ease-in-out 2s infinite;
}
.fab::after {
  border-radius: 50%; border: 1.5px solid rgba(232,199,130,.9);
  opacity: 0; animation: fab-ring 8s ease-out 2s infinite;
}
.fab:hover::before, .fab:focus-visible::before { animation-duration: 3.5s, 4s, 8s; }
@keyframes lava {
  0%, 100% { border-radius: 58% 42% 47% 53% / 50% 58% 42% 50%; }
  25%      { border-radius: 42% 58% 62% 38% / 56% 44% 56% 44%; }
  50%      { border-radius: 52% 48% 38% 62% / 41% 55% 45% 59%; }
  75%      { border-radius: 63% 37% 53% 47% / 58% 46% 54% 42%; }
}
@keyframes molten {
  0%, 100% { background-position: 20% 115%, 80% -15%, 0 0; }
  50%      { background-position: 72% -12%, 22% 110%, 0 0; }
}
@keyframes fab-tease {
  0%, 16%, 100% { scale: 1 1; }
  3%  { scale: 1.12 .9; }
  6%  { scale: .93 1.09; }
  9%  { scale: 1.05 .96; }
  12% { scale: .99 1.02; }
}
@keyframes fab-ring {
  0%, 9%  { opacity: 0; scale: 1.08; }     /* after the squash has settled, never on the drop's edge */
  11%     { opacity: .8; scale: 1.14; }
  30%     { opacity: 0; scale: 1.8; }
  100%    { opacity: 0; scale: 1.8; }
}
@media (prefers-reduced-motion: reduce) { .fab::before, .fab::after { animation: none; } }

/* ==========================================================================
   Pointer wording: "Tap" on touch, "Click" with a mouse
   ========================================================================== */
.cover-hint .t-mouse { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cover-hint .t-touch { display: none; }
  .cover-hint .t-mouse { display: inline; }
}

/* desktop-only chrome is hidden on phones/tablets */
.topbar, .rail { display: none; }

/* very low phones */
@media (max-height: 700px) and (max-width: 559px) {
}

/* ==========================================================================
   DESKTOP ≥ 1024px — full-width layout, top bar, dot rail, split sections
   ========================================================================== */
@media (min-width: 1024px) {
  :root { --gutter: 48px; --side: max(56px, 7vw); }

  body { background: var(--navy-900); }
  .page { max-width: none; box-shadow: none; }

  .menu-btn, .menu, .fab { display: none !important; }

  /* ---- top bar ---- */
  .topbar {
    position: fixed; z-index: 60; inset: 0 0 auto;
    display: flex; align-items: center; gap: 40px;
    height: 78px; padding: 0 var(--side);
    color: var(--ivory);
    opacity: 0; translate: 0 -12px; pointer-events: none;
    background: linear-gradient(rgba(7,13,28,.75), rgba(7,13,28,0));
    transition: opacity .6s var(--ease-out), translate .6s var(--ease-out), background-color .4s, box-shadow .4s;
  }
  .is-opened .topbar { opacity: 1; translate: none; pointer-events: auto; }
  .topbar.is-solid {
    background: rgba(11,20,40,.82);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(233,211,163,.18);
  }
  .topbar-brand {
    display: inline-flex; align-items: center; gap: 12px;
    font: 400 .86rem/1 var(--f-ui); letter-spacing: .4em; text-transform: uppercase; text-decoration: none;
  }
  .topbar-brand svg { width: 16px; height: 16px; color: var(--gold-l); }
  .topbar-nav { display: flex; gap: 4px; margin-left: auto; }
  .topbar-nav a {
    position: relative; padding: 10px 14px;
    font: 400 .76rem/1 var(--f-ui); letter-spacing: .22em; text-transform: uppercase;
    text-decoration: none; color: rgba(248,244,236,.72);
    transition: color .25s;
  }
  .topbar-nav a::after {
    content: ""; position: absolute; left: 14px; right: calc(14px + .22em); bottom: 2px; height: 1px;
    background: var(--gold-l); transform: scaleX(0); transform-origin: left;
    transition: transform .4s var(--ease-out);
  }
  .topbar-nav a:hover, .topbar-nav a[aria-current="true"] { color: var(--ivory); }
  .topbar-nav a:hover::after, .topbar-nav a[aria-current="true"]::after { transform: none; }
  .btn--sm { min-height: 42px; padding: 0 26px; font-size: .74rem; }
  .topbar .btn.is-active { box-shadow: 0 0 0 1px var(--gold-l), 0 0 22px -4px rgba(233,211,163,.8); }

  /* ---- dot rail ---- */
  .rail {
    position: fixed; z-index: 55; right: 26px; top: 50%; translate: 0 -50%;
    display: flex; flex-direction: column; gap: 4px;
    opacity: 0; pointer-events: none; transition: opacity .6s var(--ease-out);
  }
  .is-opened .rail { opacity: 1; pointer-events: auto; }
  /* music toggle: bottom-left, mirroring the dot rail on the right */
  .sound-btn { top: auto; left: 26px; bottom: 26px; width: 44px; height: 44px; }
  .rail a { position: relative; width: 26px; height: 26px; display: grid; place-items: center; }
  .rail a::after {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    border: 1px solid var(--gold); background: rgba(11,20,40,.35);
    transition: background-color .3s, transform .3s;
  }
  .rail a:hover::after { transform: scale(1.3); }
  .rail a[aria-current="true"]::after { background: var(--gold); }
  .rail a::before {
    content: attr(aria-label); position: absolute; right: 32px; top: 50%; translate: 6px -50%;
    white-space: nowrap; padding: 6px 12px; border-radius: 999px;
    font: italic 400 1.05rem/1 var(--f-display); color: var(--ivory); background: rgba(11,20,40,.7);
    opacity: 0; pointer-events: none; transition: opacity .3s, translate .3s var(--ease-out);
  }
  .rail a:hover::before { opacity: 1; translate: 0 -50%; }

  /* ---- shared type ---- */
  .title { font-size: clamp(3.6rem, 4.6vw, 4.8rem); }
  .title--xl { font-size: clamp(6rem, 8.5vw, 8.4rem); }
  .btn { min-height: 58px; }
  .btn--gold:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 20px 34px -14px rgba(150,110,50,.9); }

  /* every content section fills the screen */
  .sec { min-height: 100vh; padding: 120px var(--side) 100px; }

  /* ---- cover ---- */
  .cover { --bw: min(880px, calc((100vh - 240px) * 1.42)); }   /* the risen card keeps clear of the top bar */
  @supports (height: 1svh) { .cover { --bw: min(880px, calc((100svh - 240px) * 1.42)); } }
  .stage { margin-top: clamp(132px, 17vh, 160px); }
  .cover-bg, .cover-still { object-position: 50% 60%; }
  .cover-eyebrow p { font-size: 1.05rem; }
  .cover.is-ready:not(.is-open) .envelope:hover .seal-ring { animation-duration: 2.2s; }

  /* landscape scenes (bg-*-d.webp) are composed for this layout: full-bleed, centred */
  .sec-bg { object-position: 50% 50%; }
  .sec::before { display: none; }

  /* ---- invitation: ribbon panel left, card over its edge, facts right ---- */
  .invite {
    display: grid; grid-template-columns: minmax(0, .75fr) auto minmax(0, 1fr);
    align-items: center; column-gap: clamp(40px, 5vw, 96px);
    background: linear-gradient(90deg, var(--cream) 0, var(--cream-2) 100%);
  }
  .invite .sec-bg { object-position: 50% 50%; }
  .inv-card { grid-column: 2; width: min(380px, calc((100vh - 260px) * .8)); margin: 0; }
  .inv-1 { font-size: 2.8rem; }
  .inv-3 { font-size: 2rem; }
  .inv-seal { width: 84px; margin-left: -42px; bottom: -34px; }
  .facts {
    grid-column: 3; justify-self: start; margin: 0; width: 100%; max-width: 440px;
    padding: 8px 30px;
    background: rgba(250,247,242,.72);
    border: 1px solid rgba(198,160,102,.35);
    border-radius: 18px;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    box-shadow: 0 30px 60px -40px rgba(60,48,40,.45);
  }
  .facts li { font-size: .95rem; padding: 22px 4px; gap: 24px; grid-template-columns: 40px 1fr; }
  .facts .ico { width: 38px; height: 38px; }

  /* ---- countdown: copy left, champagne panel right ---- */
  .countdown {
    min-height: 100vh;
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-content: center; row-gap: 56px;
    background: radial-gradient(ellipse at 20% 30%, #1d2a4b, var(--navy-900) 70%);
  }
  .countdown .sec-bg { object-position: 70% 60%; }
  .count-head, .quote { grid-column: 1; }
  .clock { gap: 10px; margin-top: 42px; }
  .clock > div { min-width: 96px; }
  .clock b { font-size: 5rem; }
  .clock i { font-size: 4rem; }
  .clock small { font-size: .68rem; margin-top: 12px; }
  .quote { color: var(--ivory); }
  .quote p { font-size: 1.85rem; }
  .anim--s1 { right: 4%; top: -70px; width: 120px; }

  /* ---- program: disco panel left, timeline right ---- */
  .program {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-content: center; justify-items: center;
    background: linear-gradient(90deg, var(--cream) 0, var(--cream-2) 100%);
  }
  .program .sec-bg { object-position: 30% 70%; }
  .program .title, .timeline { grid-column: 2; }
  .timeline { margin-top: 48px; max-width: 420px; gap: 30px; }
  .timeline time { font-size: 1.9rem; }
  .timeline b { font-size: .9rem; }

  /* ---- details: title + card left, candles panel right ---- */
  .details {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-content: center; justify-items: center;
    background: radial-gradient(ellipse at 25% 50%, #222f52, var(--navy-900) 75%);
  }
  .details .sec-bg { object-position: 70% 50%; }
  .details .title, .glass-card { grid-column: 1; }
  .glass-card { max-width: 480px; margin-top: 44px; padding: 10px 34px; }

  /* ---- rsvp: heading left, form right ---- */
  .rsvp {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(560px, 640px);
    column-gap: clamp(48px, 6vw, 110px); align-items: center;
    padding-top: 108px; padding-bottom: 64px;
  }
  .rsvp .sec-bg { object-position: 50% 50%; }
  .rsvp-head { grid-column: 1; grid-row: 1; }
  .rsvp-bow, .rsvp-fir { display: none; }
  .rsvp .eyebrow { font-size: 1.35rem; }
  .rsvp .form, .rsvp .thanks { grid-column: 2; grid-row: 1; margin-top: 0; }
  /* compact two-column form so the section fits one screen and the background keeps its bow */
  .rsvp .form {
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px;
    padding: 32px 36px 20px;
    background: rgba(255,255,255,.55);
    border: 1px solid rgba(217,210,204,.8);
    border-radius: 20px;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    box-shadow: 0 40px 70px -50px rgba(30,35,60,.55);
  }
  .rsvp .form > * { grid-column: 1 / -1; }
  .rsvp .form > [data-field="name"]  { grid-column: 1; }
  .rsvp .form > [data-field="email"] { grid-column: 2; }
  .rsvp .field { margin-bottom: 16px; }
  .rsvp .choice { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
  .rsvp .choice .err { grid-column: 1 / -1; }
  .rsvp .if-inner { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .rsvp .if-inner > * { grid-column: 1 / -1; }
  .rsvp .if-inner > [data-field="guests"] { grid-column: 1; order: 1; }
  .rsvp .if-inner > [data-field="food"]   { grid-column: 2; order: 2; }
  .rsvp .if-inner > [data-field="companions"] { order: 3; }
  .rsvp .if-inner > [data-field="diet"]   { order: 4; }
  .rsvp .field textarea { min-height: 72px; }
  .rsvp .form-status { margin-top: 6px; }
  .choice-card:hover { border-color: var(--ink-3); }

  /* ---- footer ---- */
  .footer { padding: 140px var(--side) 80px; }
  .anim--coupes { width: 180px; }
  .footer-script { font-size: 4.1rem; }
}

/* very wide screens: keep the halves from drifting apart */
@media (min-width: 1680px) {
  .invite, .rsvp { padding-left: calc((100vw - 1560px) / 2); padding-right: calc((100vw - 1560px) / 2); }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal] { opacity: 1; translate: none; }
}

/* ==========================================================================
   Invitation design additions (join.holiday)
   What the landing did not have: event data of any length, the server-side RSVP with the shared
   macros, photos, the wishlist, the confirmation page, the WebGL alpha clips and the page without JS.
   ========================================================================== */
img { height: auto; }
.skip-link { position: fixed; z-index: 90; left: 1rem; top: 1rem; padding: .8rem 1rem; background: var(--navy-900); color: var(--ivory); border: 1px solid var(--gold); border-radius: 8px; transform: translateY(-300%); }
.skip-link:focus { transform: none; }
.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; }
main:focus { outline: none; }
.sound-btn[hidden], .menu-btn[hidden] { display: none !important; }
.btn--sm { min-height: 42px; padding: 0 22px; font-size: .74rem; letter-spacing: .2em; }

/* the envelope is a link to the invitation (it works without JS) */
.envelope { color: inherit; text-decoration: none; }

/* alpha clips: H.264 with the opacity stacked under the colour, drawn into a canvas (invitation.js) */
.anim > canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s; }
.anim.is-playing > canvas { opacity: 1; }
.env-idle, .env-film { display: block; }

/* titles are the organizer's own text: any length, never wider than the screen */
.cover-eyebrow { top: auto; bottom: calc(var(--bh) * .74 + 25px); width: max-content; max-width: min(88vw, 640px); }
.cover-eyebrow p { white-space: normal; text-wrap: balance; overflow-wrap: anywhere; line-height: 1.35; }
.cover-eyebrow p.is-md { font-size: .8rem; letter-spacing: .3em; padding-left: .3em; }
.cover-eyebrow p.is-sm { font-size: .72rem; letter-spacing: .2em; padding-left: .2em; }
.card-title { max-width: 84%; text-wrap: balance; overflow-wrap: anywhere; }
.card-title.is-md { font-size: calc(var(--cw) * .082); line-height: 1.05; }
.card-title.is-sm { font-size: calc(var(--cw) * .058); line-height: 1.12; letter-spacing: .05em; }
.inv-3 { max-width: 100%; text-wrap: balance; overflow-wrap: anywhere; }
.inv-3.is-md { font-size: clamp(1.25rem, 5.4vw, 1.5rem); }
.inv-3.is-sm { font-size: clamp(1.05rem, 4.6vw, 1.25rem); }
.inv-note { max-width: 330px; margin: 30px auto 0; white-space: pre-line; overflow-wrap: anywhere; font: italic 400 1.2rem/1.5 var(--f-display); color: var(--ink-2); }
.facts li span { overflow-wrap: anywhere; }
.footer-brand, .menu-brand, .saved-event { overflow-wrap: anywhere; text-wrap: balance; line-height: 1.4; }
.footer-brand.is-md, .menu-brand.is-md { letter-spacing: .28em; padding-left: .28em; }
.footer-brand.is-sm, .menu-brand.is-sm { font-size: .78rem; letter-spacing: .16em; padding-left: .16em; }
.footer-meta { overflow-wrap: anywhere; }
.topbar-brand { min-width: 0; max-width: 34vw; }
.topbar-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* countdown: without JS the date stands in for the clock */
.clock-date { margin-top: 26px; font: 400 1.5rem/1.3 var(--f-display); letter-spacing: .04em; }
.js .clock-date { display: none; }
html:not(.js) .clock { display: none; }

/* program: the start first, then the organizer's items; untimed items keep their place */
.timeline-zone { margin-top: 30px; font: 400 .7rem/1.4 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }
.timeline b, .timeline span { overflow-wrap: anywhere; }

/* details rows */
.dt-place { overflow-wrap: anywhere; }
.dt .dt-zone { margin-top: 8px; font: 400 .66rem/1.4 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: rgba(233,211,163,.75); }
.dt-program { margin-top: 12px; display: grid; gap: 8px; }
.dt-program > div { display: grid; grid-template-columns: 74px 1fr; gap: 10px; font: 300 .95rem/1.4 var(--f-ui); color: rgba(248,244,236,.9); }
.dt-program dt { font: 400 1.1rem/1.25 var(--f-display); color: var(--gold-l); }
.dt-program dd { margin: 0; overflow-wrap: anywhere; }
.dt-program dd span { display: block; font-size: .85rem; color: rgba(248,244,236,.7); }
.text-link .ico--arrow { width: 1.4em; height: 1em; }

/* ---------- RSVP: the server form ---------- */
.rsvp-by { margin-top: 10px; font: italic 400 1.05rem/1.3 var(--f-display); color: var(--ink-2); }
.form-error { margin-bottom: 18px; padding: 12px 16px; border-radius: 10px; background: #f6e2de; border: 1px solid rgba(162,72,60,.35); color: var(--err); font: 400 .95rem/1.4 var(--f-ui); }
.form-current { margin-bottom: 18px; font: italic 400 1.15rem/1.4 var(--f-display); color: var(--ink-2); }
.form-current strong { font-style: normal; font-weight: 600; color: var(--ink); }
.form-hint { margin-top: 14px; text-align: center; font: italic 400 1.02rem/1.4 var(--f-display); color: var(--ink-2); }
.form-link { display: block; margin-top: 8px; padding: 6px 0; text-align: center; font: italic 400 1.1rem/1.3 var(--f-display); color: var(--gold-d); text-underline-offset: 4px; }
.choice { border: 0; padding: 0; min-width: 0; }
.choice > legend { padding: 0; margin-bottom: 10px; }
.choice-card input { inset: 0; width: 100%; height: 100%; margin: 0; }
.rsvp-extra { display: grid; gap: 18px; margin-bottom: 22px; }
.rsvp-extra__field { display: grid; gap: 7px; min-width: 0; }
.rsvp-extra__label { display: block; font: 500 .72rem/1.4 var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.rsvp-extra__optional { font-weight: 400; letter-spacing: .1em; color: var(--ink-3); }
.rsvp-extra__help { font: 300 .9rem/1.35 var(--f-ui); color: var(--ink-3); }
.rsvp-extra__input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.78);
  padding: 13px 16px; font: 400 1rem/1.35 var(--f-ui); color: var(--ink);
  transition: border-color .25s, background-color .25s, box-shadow .25s;
}
.rsvp-extra__input:focus { outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px rgba(198,160,102,.2); }
.rsvp-extra__textarea { resize: vertical; min-height: 92px; line-height: 1.45; }
.rsvp-extra__number { max-width: 140px; }
.rsvp-guests-block { display: grid; gap: 12px; min-width: 0; }
.rsvp-guests { display: grid; gap: 14px; }
.rsvp-guest { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.5); }
.rsvp-guest__legend { padding: 0 6px; font: italic 400 1.15rem/1 var(--f-display); color: var(--gold-d); }
.rsvp-guest__names { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rsvp-guest__field { display: grid; gap: 6px; min-width: 0; }
.rsvp-guest__select { -webkit-appearance: auto; appearance: auto; }
.rsvp-guest__toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rsvp-guest__option {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.7);
  font: 500 .72rem/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  transition: background-color .3s, color .3s, border-color .3s;
}
.rsvp-guest__option[aria-pressed="true"] { background: var(--navy-800); border-color: var(--navy-800); color: var(--ivory); }
.rsvp-guest__icon { flex: none; width: 14px; height: auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rsvp-guests__add { justify-self: center; }
.rsvp-guests__count { text-align: center; font: italic 400 1rem/1.3 var(--f-display); color: var(--ink-2); }
.rsvp-guest__remove { justify-self: end; min-height: 40px; padding: 0 4px; font: italic 400 1.05rem/1 var(--f-display); color: var(--gold-d); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 380px) { .rsvp-guest__names { grid-template-columns: 1fr; } }
#rsvpSubmit .ico--arrow { width: 1.3em; height: 1em; }
@media (min-width: 1024px) {
  .rsvp .form .rsvp-extra { margin-bottom: 18px; }
  .rsvp .form .form-hint, .rsvp .form .form-link { margin-top: 10px; }
}

/* ---------- photos and wishlist: two extra night-blue screens ---------- */
.extra {
  padding-top: calc(70px + var(--dz, 0px)); padding-bottom: 80px;
  background: radial-gradient(ellipse at 50% 0%, rgba(233,211,163,.12), transparent 60%), var(--navy-800) var(--noise);
}
.extra .title { text-shadow: 0 2px 18px rgba(7,13,28,.6); }
.extra > .flourish, .wish-in > .flourish { margin: 18px 0 26px; }
.photo-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 640px; margin: 0 auto; }
.photo-gallery__item { aspect-ratio: 4 / 5; }
.photo-gallery__item:first-child, .photo-gallery__item:last-child:nth-child(even) { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.photo-gallery__link { display: block; height: 100%; overflow: hidden; border-radius: 14px; border: 1px solid rgba(233,211,163,.35); box-shadow: 0 20px 40px -24px rgba(0,0,0,.8); }
.photo-gallery__link img { width: 100%; height: 100%; max-width: none; object-fit: cover; transition: scale .6s var(--ease-out); }
.photo-gallery__link:hover img { scale: 1.03; }
.wish-in { max-width: 520px; margin: 0 auto; }
.ico--gift { width: 44px; height: 44px; margin: 0 auto 14px; color: var(--gold-l); stroke-width: 1.2; }
.wish-lead { font: italic 400 1.35rem/1.4 var(--f-display); }
.wish-text { margin-top: 10px; font: 300 1rem/1.5 var(--f-ui); color: rgba(248,244,236,.82); }
.wish-list { margin-top: 26px; text-align: left; }
.wishlist { width: 100%; }
.wishlist-items { display: grid; gap: 14px; }
.wishlist-item {
  display: grid; gap: 14px; padding: 20px 22px;
  border-radius: 16px; border: 1px solid rgba(233,211,163,.3);
  background: linear-gradient(160deg, rgba(60,72,104,.45), rgba(14,22,42,.5));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.wishlist-item--mine { border-color: rgba(233,211,163,.75); box-shadow: 0 0 0 1px rgba(233,211,163,.25) inset; }
.wishlist-item--taken { opacity: .7; }
.wishlist-item__title { font: 400 1.45rem/1.2 var(--f-display); color: var(--ivory); overflow-wrap: anywhere; }
.wishlist-item__description { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; font: 300 .95rem/1.5 var(--f-ui); color: rgba(248,244,236,.85); }
.wishlist-item__link { margin-top: 6px; }
.wishlist-item__link a { color: var(--gold-l); text-underline-offset: 4px; font: 400 .9rem/1.4 var(--f-ui); }
.wishlist-item__status { margin-top: 8px; font: italic 400 1.05rem/1.4 var(--f-display); color: rgba(248,244,236,.75); }
.wishlist-item__status strong { font-style: normal; font-weight: 600; color: var(--gold-l); }
.wishlist-item__actions { display: grid; gap: 10px; }
.wishlist-item__form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.wishlist-item__quantity { display: grid; gap: 4px; font: 500 .68rem/1.3 var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-l); }
.wishlist-item__quantity input {
  width: 96px; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(233,211,163,.45);
  background: rgba(7,13,28,.5); color: var(--ivory); font: 400 1rem/1.2 var(--f-ui);
}
.wishlist-item__quantity input:focus { outline: none; border-color: var(--gold-l); box-shadow: 0 0 0 3px rgba(233,211,163,.2); }
.wishlist-item__form .btn, .wishlist-item__cancel .btn { flex: 1 1 100%; width: 100%; }
.wishlist-notice, .wishlist-error { margin-bottom: 14px; padding: 12px 16px; border-radius: 12px; font: 400 .95rem/1.4 var(--f-ui); text-align: left; }
.wishlist-notice { background: rgba(233,211,163,.14); border: 1px solid rgba(233,211,163,.4); color: var(--ivory); }
.wishlist-error { background: #f6e2de; color: var(--err); }
.wishlist-help { margin-top: 16px; text-align: center; font: italic 400 1rem/1.4 var(--f-display); color: rgba(248,244,236,.7); }
@media (max-width: 1023px) {
  .seam--plain + .extra { --dz: 110px; }
}
@media (min-width: 1024px) {
  .extra { padding: 110px var(--side) 110px; }
  .wish-in { max-width: 640px; }
  .photo-gallery { max-width: 980px; grid-template-columns: repeat(3, 1fr); }
  .photo-gallery__item:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
  .photo-gallery__item:last-child:nth-child(even) { grid-column: auto; aspect-ratio: 4 / 5; }
}

/* ---------- confirmation page ---------- */
.saved {
  min-height: 100vh; padding-top: 70px; padding-bottom: 60px;
  background: radial-gradient(ellipse at 50% 0%, rgba(233,211,163,.14), transparent 60%), var(--navy-800) var(--noise);
}
.saved .thanks { margin: 0 auto; max-width: 440px; text-align: center; color: var(--ink); animation: none; background: var(--ivory) url("img/paper-tex.jpg") center / 256px 256px; border-color: rgba(198,160,102,.7); }
.saved .thanks .lead { overflow-wrap: anywhere; }
.saved-event { margin: -6px 0 18px; font: 400 .8rem/1.4 var(--f-ui); letter-spacing: .3em; padding-left: .3em; text-transform: uppercase; color: var(--gold-d); }
.saved-party { margin: -8px 0 18px; font: italic 400 1.1rem/1.3 var(--f-display); color: var(--ink-2); }
.saved .glass-card { margin-top: 34px; }
.saved-wishlist { max-width: 480px; margin: 44px auto 0; }
.saved-wishlist .flourish { margin: 14px 0 18px; }
.saved > .form-link { margin-top: 26px; color: var(--gold-l); }
.footer--saved .footer-bg { display: none; }
@media (max-width: 1023px) {
  .footer--saved { min-height: 0; padding: 70px var(--gutter) 60px; color: var(--ivory); background: var(--navy-900); }
  .footer--saved .footer-script { color: var(--gold-l); text-shadow: none; }
  .footer--saved .footer-brand { color: var(--ivory); }
  .footer--saved .footer-meta { color: rgba(248,244,236,.7); }
}
@media (min-width: 1024px) {
  .saved { padding: 110px var(--side) 90px; }
  .saved .glass-card { max-width: 520px; }
}

/* ---------- without JavaScript: the open envelope, the whole page, no locked scroll ---------- */
html:not(.js) .cover::after { opacity: 0; }
@media (min-width: 1024px) {
  html:not(.js) .topbar, html:not(.js) .rail { opacity: 1; translate: none; pointer-events: auto; }
}

/* desktop: the note sits under the facts card; longer titles stay large enough on the card */
@media (min-width: 1024px) {
  .invite:has(.inv-note) .inv-card { grid-row: 1 / span 2; }
  .invite:has(.inv-note) .facts { grid-row: 1; align-self: end; }
  .inv-note { grid-column: 3; grid-row: 2; align-self: start; justify-self: start; max-width: 440px; margin: 22px 0 0; padding: 0 30px; text-align: left; font-size: 1.35rem; }
  .inv-3.is-md { font-size: 1.6rem; }
  .inv-3.is-sm { font-size: 1.3rem; }
}

/* the guest on a personal invitation: "Dear Ms Anna Smith," at the top of the card */
.inv-dear { position: relative; max-width: 100%; margin-bottom: 16px; text-align: center; text-wrap: balance; overflow-wrap: anywhere; font: italic 400 clamp(1.15rem, 5vw, 1.35rem)/1.25 var(--f-display); color: var(--ink-2); }
.inv-dear span { font-weight: 500; color: var(--gold-d); }
.inv-dear.is-md { font-size: clamp(1.02rem, 4.4vw, 1.18rem); }
.inv-dear.is-sm { font-size: clamp(.92rem, 3.9vw, 1.04rem); }
@media (min-width: 1024px) { .inv-dear { font-size: 1.5rem; margin-bottom: 20px; } .inv-dear.is-md { font-size: 1.3rem; } .inv-dear.is-sm { font-size: 1.12rem; } }
