/* Invitation template engine · layout and motion primitives.
   Themes override the custom properties below (theme.json palette + fonts) and may add theme.css. */

:root {
  --paper: #fbf3e2;
  --paper-deep: #f1e2c4;
  --ink: #3a1a1f;
  --accent: #6b1d2f;
  --accent-deep: #45101d;
  --gold: #b88a3e;
  --gold-soft: #e2c27f;
  --leaf: #4f6b2f;
  --bloom: #e8902c;
  --font-display: Georgia, serif;
  --font-accent: Georgia, serif;
  --font-body: system-ui, sans-serif;
  --font-numerals: var(--font-display);
  /* Page texture: fine grain, a faint light sheen (shows on dark colours) and soft paper fibres.
     Drawn by the browser, colour-neutral, so it suits a cream page and a maroon page alike.
     A theme can replace it with its own tile (art.texture). */
  --texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .22 0 0 0 0 .16 0 0 0 .17 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='560'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .03' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .18 0 0 0 .13 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --backdrop: var(--paper);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --frame-line: color-mix(in srgb, var(--gold) 55%, transparent);
  /* Gold for small text: darker than --gold so it reaches 4.5:1 on paper. Themes may set goldText. */
  --gold-text: color-mix(in srgb, var(--gold) 72%, black);
  --card: color-mix(in srgb, var(--paper) 62%, white);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.is-closed { overflow: hidden; }
body {
  margin: 0; min-height: 100svh; overflow-x: hidden;
  background: var(--texture), var(--backdrop); color: var(--ink);
  font: 400 17px/1.65 var(--font-body);
}
img { display: block; max-width: 100%; }
/* The invitation fills the screen at every size: phone, tablet and full screen (see "Responsive" at the end).
   Inside it, sizes use cqi units and @container rules, so the editor's preview frames lay out like real screens. */
.invite {
  position: relative; min-height: 100svh;
  container-type: inline-size;
  background:
    var(--texture),
    radial-gradient(ellipse 90% 30% at 50% 0%, color-mix(in srgb, var(--gold-soft) 22%, transparent), transparent 70%),
    var(--paper);
}
h1, h2, h3, p { margin: 0; font-weight: 400; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.boot-message { min-height: 100svh; display: grid; place-content: center; gap: 10px; padding: 24px; text-align: center; font-family: system-ui, sans-serif; color: #4a2b2b; }

/* ---------- Buttons and controls ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 22px; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--paper);
  font: 600 15px/1 var(--font-body); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease), background .25s ease, color .25s ease;
}
.btn:hover { background: var(--accent-deep); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.btn-small { min-height: 38px; padding: 8px 15px; font-size: 13.5px; }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
.btn-open::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 28%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-18deg); animation: inv-glint 4.8s ease-in-out 1.8s 3;
}
.inv-controls { position: fixed; top: 12px; right: max(12px, env(safe-area-inset-right)); z-index: 60; display: flex; gap: 6px; }
.inv-controls button {
  min-width: 42px; height: 40px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--frame-line); color: var(--accent);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font: 600 13px/1 var(--font-body);
}
.inv-controls [aria-pressed="true"] { background: var(--accent); color: var(--paper); border-color: var(--accent); }

/* ---------- Cover (closed invitation) ---------- */
.cover {
  position: fixed; inset: 0; z-index: 50; overflow: hidden;
  container-type: inline-size;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  background: var(--texture), radial-gradient(ellipse 85% 60% at 50% 42%, color-mix(in srgb, var(--paper) 55%, white), var(--paper) 55%, var(--paper-deep));
  transition: opacity .45s ease, transform .45s ease;
}
.cover.is-leaving { opacity: 0; transform: scale(1.015); pointer-events: none; }
.cover-top { position: relative; z-index: 3; width: min(94cqi, 600px); flex: none; }
.cover-top img { width: 100%; max-height: 22svh; object-fit: contain; object-position: 50% 0; transform-origin: 50% 0; }
.cover-center { position: relative; z-index: 4; display: grid; justify-items: center; gap: 9px; padding: 0 22px; margin-block: auto; text-align: center; }
.invocation { font: 400 15px/1.4 var(--font-accent); color: var(--accent); letter-spacing: .03em; }
.kicker { font: 600 11px/1.5 var(--font-body); letter-spacing: .28em; text-transform: uppercase; color: var(--gold-text); }
.cover-names { font: 400 clamp(42px, 11.5cqi, 80px)/1.02 var(--font-display); color: var(--accent); }
.amp { font-family: var(--font-accent); font-style: italic; color: var(--gold); padding: 0 .12em; }
.cover-date { font: 500 14px/1.4 var(--font-body); letter-spacing: .14em; text-transform: uppercase; }
.btn-open { margin-top: 8px; }
.skip { font: 500 13px/1.4 var(--font-body); color: var(--accent); opacity: .8; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); padding-bottom: 1px; }
.skip:hover { opacity: 1; border-color: var(--accent); }
.cover-stage { position: relative; z-index: 2; flex: none; width: min(100cqi, 660px); height: clamp(150px, 30svh, 320px); }
.cover-stage img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; animation: inv-stage 1.1s var(--ease) both; }
.cover-ring { position: absolute; z-index: 1; width: min(72cqi, 480px); aspect-ratio: 1; opacity: .2; pointer-events: none; }
.cover-ring.left { left: max(-36cqi, -240px); top: 14%; }
.cover-ring.right { right: max(-36cqi, -240px); top: 48%; }
.cover-dust { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.cover-dust i { position: absolute; bottom: -8px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; background: var(--gold-soft); opacity: 0; animation: inv-dust var(--dur) linear var(--delay) infinite; }
.enter { animation: inv-enter 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 120ms + 150ms); }

/* ---------- Chapters ---------- */
.ch { position: relative; padding: clamp(44px, 7cqi, 88px) 16px; overflow: hidden; }
/* Seamless flow: chapters sit straight on the page as one continuous scroll, with no box, border or
   outline between them. A theme can still box a chapter on purpose with the "framed" chapter style. */
.frame {
  position: relative; z-index: 1; max-width: 760px; margin: 0 auto; text-align: center;
  padding: clamp(28px, 5cqi, 56px) clamp(8px, 4cqi, 40px);
}
.ch--framed .frame {
  padding: clamp(44px, 7cqi, 76px) clamp(22px, 6cqi, 64px);
  background: var(--card); border: 1px solid var(--frame-line);
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px var(--frame-line);
}
.corner { position: absolute; display: none; width: clamp(38px, 8cqi, 62px); color: var(--gold); pointer-events: none; }
.ch--framed .corner { display: block; } /* corner pieces belong to boxed chapters only */
.corner.tl { top: 8px; left: 8px; }
.corner.tr { top: 8px; right: 8px; scale: -1 1; }
.corner.bl { bottom: 8px; left: 8px; scale: 1 -1; }
.corner.br { bottom: 8px; right: 8px; scale: -1 -1; }
.ch-title { font: 400 clamp(34px, 7cqi, 56px)/1.06 var(--font-display); color: var(--accent); margin-bottom: 14px; }
.ch-kicker { font: 600 12px/1.5 var(--font-body); letter-spacing: .26em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 12px; }
.ch-copy { font: 400 clamp(17px, 2.4cqi, 19px)/1.75 var(--font-accent); max-width: 46ch; margin: 0 auto; }
.flourish { width: 120px; margin: 18px auto; color: var(--gold); }

/* Welcome */
.ch-welcome { padding-top: clamp(56px, 8cqi, 96px); }
.welcome-card {
  /* Padding is a share of the card's own width (percent padding would follow the page width). */
  --card-w: min(100cqi - 32px, 440px);
  position: relative; width: var(--card-w); aspect-ratio: 9 / 16; margin: 0 auto; outline: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: calc(var(--card-w) * .18) calc(var(--card-w) * .14); text-align: center;
  background: var(--welcome-bg, none) center / cover no-repeat, var(--card);
  /* No box: the card's lower edge melts into the page. */
  -webkit-mask-image: linear-gradient(#000 78%, transparent);
  mask-image: linear-gradient(#000 78%, transparent);
}
.welcome-card.no-art { background: none; }
.welcome-card.just-opened { animation: inv-card 1.1s var(--ease) both; }
.welcome-line { font: 400 16px/1.6 var(--font-accent); max-width: 25ch; }
.welcome-names { display: grid; gap: 6px; font: 400 clamp(46px, 12cqi, 70px)/1 var(--font-display); color: var(--accent); }
.welcome-names .amp { font-size: .5em; line-height: .8; }
.wn { display: grid; gap: 4px; }
.wn small { font: 600 11.5px/1.3 var(--font-body); letter-spacing: .24em; text-transform: uppercase; color: var(--gold-text); }
/* The names as a lockup: the design's own ornament beneath them, and a single foil glint that sweeps
   across the names as the card arrives, like light catching gold on a printed card. */
.welcome-ornament { width: min(64%, 260px); margin: -2px auto 2px; }
.welcome-ornament .divider { width: 100%; margin: 0; }
.welcome-ornament .flourish { margin: 0 auto; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .welcome-names b {
    background: linear-gradient(100deg, transparent 42%, color-mix(in srgb, var(--gold-soft) 80%, white) 50%, transparent 58%) 100% 0 / 260% 100% no-repeat, var(--accent);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .welcome-card.is-arriving .welcome-names b, .welcome-card.just-opened .welcome-names b { animation: inv-foil 1.9s ease-in-out 1s both; }
  .welcome-card.is-arriving .wn + .amp + .wn b { animation-delay: 1.25s; }
}
@keyframes inv-foil { from { background-position: 100% 0, 0 0; } to { background-position: 0% 0, 0 0; } }
.welcome-date { font: 600 12px/1.6 var(--font-body); letter-spacing: .22em; text-transform: uppercase; color: var(--gold-text); }
.scroll-cue { display: grid; justify-items: center; gap: 4px; margin-top: 26px; font: 600 11px/1 var(--font-body); letter-spacing: .24em; text-transform: uppercase; color: var(--gold-text); }
.scroll-cue svg { width: 18px; animation: inv-bob 2.2s ease-in-out infinite; }

/* Greeting */
/* The hanging layer drops in front of the frame's top edge; the frame's top padding keeps the title clear of it. */
.ch-greeting { padding-top: clamp(130px, 22cqi, 200px); }
.ch-greeting .frame { padding-top: clamp(96px, 16cqi, 140px); }
.greet-hanging { position: absolute; z-index: 3; top: 0; left: 0; right: 0; margin: 0 auto; width: min(52cqi, 260px); pointer-events: none; }
.greet-hanging img { width: 100%; height: clamp(190px, 34cqi, 300px); object-fit: contain; object-position: 50% 0; transform-origin: 50% 0; }
.greet-scene { position: relative; width: min(100%, 540px); aspect-ratio: 3 / 2; margin: 26px auto 0; }
.greet-backdrop { position: absolute; inset: 0; }
.greet-backdrop img { width: 100%; height: 100%; object-fit: contain; opacity: .9; }
.greet-cutout { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; width: 66%; }
.greet-cutout img { width: 100%; transition: transform .35s var(--ease), filter .35s ease; cursor: pointer; }
.greet-cutout img:is(:hover, :active) { transform: translateY(-12px) scale(1.025); filter: drop-shadow(0 16px 14px rgba(60, 20, 10, .25)); }

/* Families */
.foliage { position: absolute; z-index: 2; bottom: clamp(30px, 6cqi, 70px); width: clamp(56px, 15cqi, 170px); pointer-events: none; }
/* Keep the text column clear of the sprays at every width. */
.ch-families .frame { padding-inline: clamp(58px, 16cqi, 170px); }
.foliage.left { left: 0; }
.foliage.right { right: 0; }
.foliage img { width: 100%; max-height: 560px; object-fit: contain; object-position: 50% 100%; transform-origin: 50% 100%; }
.foliage.right img { scale: -1 1; }
.families { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 24px; }
.family h3 { font: 400 clamp(24px, 3.4cqi, 30px)/1.1 var(--font-display); color: var(--accent); margin-bottom: 8px; }
.family p { font: 400 16px/1.65 var(--font-accent); }

/* Union */
.ch-union { display: grid; place-items: center; min-height: min(92svh, 660px); text-align: center; isolation: isolate; }
.union-rangoli { position: absolute; inset: 0; z-index: -1; margin: auto; width: min(118cqi, 640px); aspect-ratio: 1; opacity: .16; }
.union-copy { position: relative; z-index: 1; max-width: 34rem; padding: 30px 18px; }
.union-copy h2 { text-wrap: balance; }
/* A soft paper halo keeps the title readable over the turning rangoli. */
.union-copy::before { content: ""; position: absolute; inset: -12% -18%; z-index: -1; background: radial-gradient(closest-side, var(--paper) 55%, transparent); }
.union-copy h2 { font: 400 clamp(40px, 9cqi, 72px)/1.02 var(--font-display); color: var(--accent); }
.union-date { margin: 18px 0 12px; font: 600 13px/1.4 var(--font-body); letter-spacing: .24em; text-transform: uppercase; color: var(--gold-text); }
.union-line { font: 400 18px/1.7 var(--font-accent); }

/* Save the date */
.date-stage { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 4px; max-width: 580px; margin: 16px auto 0; }
.date-figure img { height: clamp(140px, 34cqi, 250px); width: auto; max-width: 100%; margin: 0 auto; object-fit: contain; }
.date-frame { position: relative; width: clamp(170px, 44cqi, 250px); aspect-ratio: 4 / 5; }
.date-frame svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.date-frame .finial { fill: var(--gold); opacity: 0; transition: opacity .8s ease 2s; }
.date-frame.is-drawn .finial { opacity: 1; }
.date-frame path { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.4s var(--ease); }
.date-frame path + path { stroke-width: 1; transition-delay: .25s; }
.date-frame.is-drawn path { stroke-dashoffset: 0; }
.date-face { position: absolute; inset: 20% 12% 10%; display: grid; place-content: center; justify-items: center; gap: 2px; text-align: center; }
.d-week { font: 600 11px/1.4 var(--font-body); letter-spacing: .22em; text-transform: uppercase; color: var(--gold-text); }
.d-day { font: 400 clamp(56px, 14cqi, 84px)/1 var(--font-numerals); color: var(--accent); }
.d-month { font: 400 17px/1.3 var(--font-accent); }
.d-time { font: 500 13px/1.4 var(--font-body); margin-top: 4px; }
.foil { position: absolute; left: 9%; top: 17%; width: 82%; height: 76%; border-radius: 140px 140px 12px 12px; touch-action: none; cursor: grab; transition: opacity .6s ease; }
.foil.is-gone { opacity: 0; pointer-events: none; }
.burst { position: absolute; left: 50%; top: 55%; z-index: 5; pointer-events: none; }
.burst i { position: absolute; width: 11px; height: 7px; border-radius: 80% 15% 80% 20%; background: var(--c); animation: inv-burst 1.05s ease-out var(--delay) both; }
.date-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.countdown { display: flex; justify-content: center; gap: clamp(8px, 3cqi, 20px); margin: 24px 0 6px; }
.cd-unit { display: grid; gap: 4px; min-width: 64px; padding: 10px 8px; background: var(--paper); border: 1px solid var(--frame-line); }
.cd-unit b { font: 400 32px/1 var(--font-numerals); color: var(--accent); font-variant-numeric: tabular-nums; }
.cd-unit span { font: 600 10px/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-text); }
.countdown-label { font: 400 15px/1.5 var(--font-accent); }

/* Events */
.ch-events { text-align: center; }
/* Each day is a row of ceremonies (wrapping by three), centred whatever the count. */
.events { --gap: clamp(18px, 3cqi, 32px); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); max-width: 1040px; margin: 30px auto 0; }
.events > .event { flex: 0 1 calc((100% - 2 * var(--gap)) / 3); }
.event {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 16px 16px 24px; background: var(--card);
  border: 1px solid var(--frame-line); border-radius: 999px 999px 16px 16px;
}
.event-art { width: min(100%, 230px); aspect-ratio: 1; }
.event-art img { width: 100%; height: 100%; object-fit: contain; }
.event-art.is-fallback { display: grid; place-items: center; }
.event-art.is-fallback > * { width: 62%; height: auto; }
.ev-date { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.ev-day { font: 400 42px/1 var(--font-numerals); color: var(--accent); }
.ev-month { font: 600 12px/1 var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-text); }
.event h3 { font: 400 clamp(26px, 3cqi, 32px)/1.1 var(--font-display); color: var(--accent); margin: 8px 0 6px; }
.ev-time { font-size: 14.5px; }
.ev-venue { font: 400 15px/1.5 var(--font-accent); opacity: .86; margin-top: 2px; }
.ev-note { font-size: 13.5px; color: var(--leaf); margin-top: 6px; }
/* The guest guide on each card: what happens, and what to wear with colour dots. */
.ev-about { margin-top: 8px; max-width: 28ch; font: italic 400 15px/1.5 var(--font-accent); color: color-mix(in srgb, var(--ink) 82%, transparent); }
.ev-wear { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; margin-top: 8px; font-size: 13.5px; }
.ev-wear-label { font: 600 10.5px/1 var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-text); }
.ev-swatches { display: inline-flex; }
.ev-swatches i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--card); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); }
.ev-swatches i + i { margin-left: -4px; }

/* layout.events "deck": one swipeable row of cards, each tinted with its first dress colour. */
.events.deck {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(78cqi, 320px); gap: 18px; justify-content: start;
  max-width: none; margin: 26px -16px 0; padding: 6px max(16px, calc(50% - 160px)) 22px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.events.deck::-webkit-scrollbar { display: none; }
.events.deck > .event { scroll-snap-align: center; border-color: color-mix(in srgb, var(--tint) 45%, transparent);
  background: linear-gradient(color-mix(in srgb, var(--tint) 26%, var(--card)) 0 34%, var(--card) 34%); }
.events.deck > .event::before { display: none !important; } /* no timeline thread in a swipe row */
.events.deck .event-art { width: min(80%, 200px); }
.deck-dots { justify-content: center; margin-top: 4px; }
@container (min-width: 1024px) {
  .events.deck { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(240px, 300px)); justify-content: center; overflow: visible; margin-inline: auto; padding-inline: 0; }
  .deck-dots { display: none; }
}

/* Days of a multi-day wedding: a quiet heading for each. */
.day + .day { margin-top: clamp(48px, 7cqi, 84px); }
.day-head { display: grid; justify-items: center; gap: 4px; margin: 30px auto 0; }
.day-no { display: flex; align-items: center; gap: 12px; font: 600 12px/1.4 var(--font-body); letter-spacing: .28em; text-transform: uppercase; color: var(--gold-text); }
.day-no::before, .day-no::after { content: ""; width: 44px; height: 1px; background: var(--frame-line); }
.day-date { font: 400 clamp(22px, 3cqi, 30px)/1.2 var(--font-display); color: var(--accent); }
.day .events { margin-top: 22px; }
/* A dotted thread joins the ceremonies of a day: across on wide screens, down on phones. */
.events > .event + .event::before {
  content: ""; position: absolute; top: 46%; right: 100%; width: var(--gap);
  border-top: 2px dotted color-mix(in srgb, var(--gold) 65%, transparent);
}
.events > .event:nth-child(3n + 1)::before { display: none; }
.ev-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: auto; padding-top: 14px; }

/* Venue */
.venue-art { width: min(100%, 460px); margin: 10px auto 12px; }
.venue-name { font: 400 clamp(28px, 4cqi, 36px)/1.1 var(--font-display); color: var(--accent); }
.venue-address { font: 400 17px/1.6 var(--font-accent); margin: 6px auto 4px; max-width: 34ch; }
.venue-date { font: 600 12px/1.6 var(--font-body); letter-spacing: .22em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 18px; }

/* layout.venue "map": a drawn map card with the venue pinned. */
.venue-map { width: min(100%, 440px); margin: 12px auto 14px; border-radius: 16px; box-shadow: 0 0 0 1px var(--frame-line), 0 22px 34px -24px rgba(60, 20, 30, .45); }
.venue-map svg { display: block; width: 100%; height: auto; }
.venue-map .m-land { fill: color-mix(in srgb, var(--paper-deep) 70%, var(--paper)); }
.venue-map .m-water { fill: color-mix(in srgb, #8fb3c2 45%, var(--paper)); }
.venue-map .m-road { fill: none; stroke: var(--card); stroke-width: 11; stroke-linecap: round; }
.venue-map .m-road.thin { stroke-width: 6; }
.venue-map .m-route { fill: none; stroke: var(--accent); stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; }
.venue-map .m-start { fill: var(--card); stroke: var(--accent); stroke-width: 3; }
.venue-map .m-pin path { fill: var(--accent); }
.venue-map .m-pin circle { fill: var(--card); }
.venue-map .m-label rect { fill: var(--card); stroke: var(--frame-line); }
.venue-map .m-label text { font: 600 11px var(--font-body); fill: var(--accent); }
.venue-map .m-compass circle { fill: var(--card); stroke: var(--frame-line); }
.venue-map .m-compass path { fill: var(--gold); }
.venue-map .m-compass text { font: 700 8px var(--font-body); fill: var(--gold-text); }
.venue-travel { font: italic 400 16px/1.5 var(--font-accent); margin: 2px auto 6px; max-width: 34ch; }
@container (min-width: 1024px) { .ch-venue.is-map .frame { display: block; max-width: 760px; text-align: center; } .ch-venue.is-map .frame > * { justify-self: auto; } }

/* RSVP */
.rsvp-form { display: grid; gap: 16px; max-width: 380px; margin: 22px auto 0; text-align: left; }
.rsvp-form label, .rsvp-form legend { display: grid; gap: 6px; font-weight: 600; font-size: 14.5px; }
.rsvp-form input[type="text"], .rsvp-form input[type="number"], .rsvp-form input[type="tel"] { min-height: 46px; padding: 10px 14px; border: 1px solid var(--frame-line); border-radius: 8px; background: var(--paper); font: inherit; color: inherit; }
.rsvp-form fieldset { border: 0; margin: 0; padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--frame-line); border-radius: 999px; font-weight: 500; cursor: pointer; }
.choices input { accent-color: var(--accent); }
.rsvp-form .btn { justify-self: start; }
.practice { font-size: 13px; opacity: .75; }
.choices-col { flex-direction: column; align-items: stretch; }
.choices-col label { border-radius: 10px; }
.choices-col small { opacity: .7; font-size: .85em; margin-left: 4px; }
.rsvp-form .optional { font-weight: 400; opacity: .65; font-size: 13px; }
.rsvp-form [hidden] { display: none; }
.rsvp-trap { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rsvp-form .btn[disabled] { opacity: .6; cursor: progress; }
.rsvp-alt { text-align: center; margin-top: 18px; }
.rsvp-status { min-height: 1.4em; font: 400 15px/1.5 var(--font-accent); color: var(--leaf); }

/* Closing */
.closing-art { width: min(100%, 300px); margin: 0 auto 6px; }
.signature { font: 400 clamp(24px, 3.6cqi, 30px)/1.2 var(--font-display); color: var(--accent); margin-top: 16px; }
.closing-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.share-status { min-height: 1.4em; margin-top: 10px; font-size: 14px; }

/* Ambient petals (after opening) */
.petals { position: fixed; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; }
.petals i { position: absolute; top: -24px; left: var(--x); width: var(--s); height: calc(var(--s) * .62); border-radius: 80% 15% 80% 20%; background: var(--c); opacity: 0; animation: inv-petal var(--dur) linear var(--delay) infinite; }

/* ---------- Antarpat opening ---------- */
.cover-reveal { position: relative; display: grid; justify-items: center; gap: 9px; padding: 14px 26px 18px; }
.cover-actions { display: grid; justify-items: center; gap: 10px; transition: opacity .4s ease; }
/* The cloth keeps the painting's own 3:2 shape, sized to the screen width and height, and is centred
   over the names. The names area is made just tall enough for it, so it never covers the Open button. */
.cover { --cloth-w: min(100cqi - 40px, 560px, 50svh); --veil-h: calc(var(--cloth-w) * 935 / 1400); }
.antarpat { position: absolute; z-index: 5; left: 50%; top: 50%; width: var(--cloth-w); height: var(--veil-h); translate: -50% -50%; pointer-events: none; }
.cover.has-antarpat .cover-reveal { min-height: calc(var(--veil-h) - 20px); align-content: center; }
/* The names must hide fully behind the cloth until it is lowered, so their size follows the cloth on every screen. */
.cover.has-antarpat .cover-names { font-size: calc(var(--cloth-w) * .13); }
.antarpat-cloth { position: absolute; inset: 0; transform-origin: 50% 0; animation: inv-cloth-hold 4.6s ease-in-out infinite; }
.antarpat-cloth img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; filter: drop-shadow(0 18px 18px rgba(60, 15, 20, .35)); } /* never stretched */
.cover.is-revealing .antarpat-cloth { animation: inv-cloth-lower 1.35s cubic-bezier(.55, 0, .7, .4) .1s forwards; }
/* Flower curtain: two halves of one painted panel (2:3 each, so the pair is 4:3), the right one mirrored.
   The strings sway while closed; on opening each half gathers towards its own side, like a parda tied back. */
.cover.has-curtain { --veil-h: calc(var(--cloth-w) * .75); }
.curtain-half { position: absolute; top: 0; bottom: 0; width: 50%; transform-origin: 50% 0; animation: inv-curtain-sway 5.2s ease-in-out infinite; }
.curtain-half.left { left: 0; }
.curtain-half.right { right: 0; animation-delay: -2.6s; }
.curtain-half img { position: relative; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 0; filter: drop-shadow(0 16px 16px rgba(60, 10, 15, .3)); }
/* A sheer backing behind the strings (like a chunni), so the names stay hidden until the curtain parts. */
.curtain-half::before {
  content: ""; position: absolute; inset: 4% 0 9%;
  background: linear-gradient(color-mix(in srgb, var(--paper) 92%, var(--bloom)), color-mix(in srgb, var(--paper) 84%, var(--bloom)));
  box-shadow: inset 0 0 28px color-mix(in srgb, var(--bloom) 22%, transparent);
}
.curtain-half.right img { scale: -1 1; }
/* Folded cloth (art.fold), like a phulkari folded shut over the names: two halves of one painted panel
   (2:3 each, so 4:3 together), hinged on their outer edges. While closed they lift and settle a little;
   on opening each half swings outward towards the guest, showing the cloth's underside as it turns. */
.cover.has-fold { --veil-h: calc(var(--cloth-w) * .75); }
.antarpat.is-fold { perspective: 1300px; }
.fold-half { position: absolute; top: 0; bottom: 0; width: 50%; transform-style: preserve-3d; animation: inv-fold-breathe 6s ease-in-out infinite; }
.fold-half.left { left: 0; transform-origin: 0 50%; }
.fold-half.right { right: 0; transform-origin: 100% 50%; --lift: 2deg; animation-delay: -3s; }
.fold-face, .fold-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
/* The base cloth behind the painted panel (above its tassels), so the names never show through while it loads. */
.fold-face { background: linear-gradient(var(--accent-deep), var(--accent-deep)) 50% 0 / 100% 90% no-repeat; }
.fold-face img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 0; filter: drop-shadow(0 16px 16px rgba(60, 10, 30, .3)); }
.fold-half.right .fold-face img { scale: -1 1; }
/* The crease where the halves meet: a soft shadow on each inner edge. */
.fold-face::after { content: ""; position: absolute; top: 0; bottom: 6%; width: 14px; pointer-events: none; }
.fold-half.left .fold-face::after { right: 0; background: linear-gradient(to left, rgba(40, 0, 20, .32), transparent); }
.fold-half.right .fold-face::after { left: 0; background: linear-gradient(to right, rgba(40, 0, 20, .32), transparent); }
/* The underside: the plain base cloth with the faint ghost of the stitches. */
.fold-back {
  transform: rotateY(180deg); border-radius: 2px;
  background:
    repeating-linear-gradient(45deg, color-mix(in srgb, var(--gold) 22%, transparent) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, color-mix(in srgb, var(--gold) 16%, transparent) 0 2px, transparent 2px 9px),
    linear-gradient(color-mix(in srgb, var(--accent-deep) 92%, var(--accent)), var(--accent-deep));
}
.cover.is-revealing .fold-half.left { animation: inv-fold-left 1.5s cubic-bezier(.5, 0, .2, 1) .1s forwards; }
.cover.is-revealing .fold-half.right { animation: inv-fold-right 1.5s cubic-bezier(.5, 0, .2, 1) .1s forwards; }
/* ---------- The envelope (engine: envelopeCover; styles in envelopes/library.json) ----------
   One envelope per community category, each with its own shape, border, lining, paper and extra. Portrait screens get a tall envelope that fills the
   phone (room is kept for the language buttons above and the hint below); landscape screens get a wide one as
   large as the screen allows. Layers inside .env: back 1, open flap 1, card 3, pocket 4, closed flap 5,
   seal 6; the card comes up to 7 once it is out.
   Opening, in four beats: the seal is pressed and lifts away; the envelope steps back while the flap turns over
   towards the guest, showing its lining; the card is drawn up out of the pocket; then the envelope falls away and
   the card comes forward to fill the screen. */
.cover.has-envelope {
  --env-w: min(100cqi - 32px, (100svh - 150px) * .625, 560px);
  --env-h: calc(var(--env-w) * 1.6);
  justify-content: center; padding: 58px 0 10px;
}
.cover.has-envelope .cover-center.env-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-block: auto; padding: 0; }
.cover.has-envelope .cover-center::before { content: none; }
.env {
  --e-paper: var(--env-color, color-mix(in srgb, var(--paper) 72%, white));
  --e-foil: var(--env-foil, var(--gold));
  --e-ink: var(--env-ink, var(--gold-text));
  --e-lining: var(--env-lining, var(--accent));
  --e-accent: var(--e-foil); --e-accent2: var(--e-foil);
  /* Each orientation's measurements come from the engine (style attribute); CSS picks the one that fits. */
  --flap: var(--flap-tall); --seal-y: var(--seal-y-tall); --crest-y: var(--crest-y-tall); --crest-w: var(--crest-w-tall);
  --pocket: var(--pocket-tall); --flap-shape: var(--flap-shape-tall); --inside-shape: var(--inside-shape-tall);
  position: relative; flex: none; width: var(--env-w); height: var(--env-h);
  animation: inv-env-in 1.1s var(--ease) .1s both;
}
.env > * { position: absolute; }
.env-defs .f1 { stop-color: var(--e-foil); }
.env-defs .f2 { stop-color: color-mix(in srgb, var(--e-foil) 40%, white); }
.only-wide { display: none; }
/* Paper: a plain box in the envelope's colour and texture, cut to shape by a mask the engine draws. */
.env-shape {
  position: absolute; inset: 0;
  background: var(--env-weave, linear-gradient(transparent, transparent)), var(--env-tex, var(--texture)), var(--e-paper);
  -webkit-mask: var(--m) 0 0 / 100% 100% no-repeat; mask: var(--m) 0 0 / 100% 100% no-repeat;
}
/* Papers. Silk has a sheen and a fine weave; kattam adds Kanjivaram checks; bandhani is dotted; khaddar and
   handloom are woven cotton; sandstone is mottled; kraft has fibres. */
.env[data-paper="silk"] { --env-weave: linear-gradient(112deg, transparent 18%, rgba(255, 255, 255, .16) 36%, transparent 52%, rgba(255, 255, 255, .08) 70%, transparent 86%), repeating-linear-gradient(0deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 3px); }
.env[data-paper="kattam"] {
  --check: calc(var(--env-w) * .11);
  --env-weave: linear-gradient(112deg, transparent 18%, rgba(255, 255, 255, .14) 36%, transparent 52%),
    repeating-linear-gradient(90deg, transparent 0 calc(var(--check) - 7px), color-mix(in srgb, var(--e-accent) 55%, transparent) calc(var(--check) - 7px) calc(var(--check) - 2px), transparent calc(var(--check) - 2px) var(--check)),
    repeating-linear-gradient(0deg, transparent 0 calc(var(--check) - 7px), color-mix(in srgb, var(--e-accent) 45%, transparent) calc(var(--check) - 7px) calc(var(--check) - 2px), transparent calc(var(--check) - 2px) var(--check));
}
.env[data-paper="bandhani"] { --env-weave: radial-gradient(circle, rgba(255, 236, 200, .9) 0 1.2px, transparent 1.7px) 0 0 / 11px 11px, radial-gradient(circle, rgba(255, 236, 200, .7) 0 1px, transparent 1.5px) 5.5px 5.5px / 11px 11px; }
.env[data-paper="khaddar"] { --env-weave: repeating-linear-gradient(0deg, rgba(0, 0, 0, .08) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 3px); }
.env[data-paper="handloom"] { --env-weave: repeating-linear-gradient(0deg, rgba(120, 90, 40, .07) 0 1px, transparent 1px 2.5px), repeating-linear-gradient(90deg, rgba(120, 90, 40, .06) 0 1px, transparent 1px 3px); }
.env[data-paper="sandstone"] { --env-weave: radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .22), transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(120, 40, 30, .14), transparent 55%); }
.env[data-paper="kraft"] { --env-weave: repeating-linear-gradient(7deg, rgba(90, 60, 30, .07) 0 1px, transparent 1px 5px), repeating-linear-gradient(-11deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 7px); }
/* Two families: the right half of the paper and lining in the second colour. */
.env[data-split] .env-shape::before, .env[data-split] .env-back::before { content: ""; position: absolute; inset: 0 0 0 50%; background: var(--texture), var(--e-paper2); }
.env[data-split] .env-back::before, .env[data-split] .env-inside .env-shape::before { background: var(--e-lining2); }
/* The inside of the envelope: its lining, in shadow at the top. */
.env-back {
  inset: 0; z-index: 1; border-radius: 3px;
  background: linear-gradient(rgba(35, 12, 12, .42), transparent 26%), var(--e-lining);
  box-shadow: 0 34px 44px -26px rgba(45, 22, 18, .5), 0 3px 8px rgba(45, 22, 18, .14);
}
.env-back::after, .env-inside .env-shape::after {
  content: ""; position: absolute; inset: 0; background: var(--e-lining-ink, var(--e-foil)); opacity: .5;
  -webkit-mask: var(--lining-pattern); mask: var(--lining-pattern);
}
.env-pocket { inset: 0; z-index: 4; pointer-events: none; }
.env-pocket .env-shape { --m: var(--pocket); }
.env-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.env-lines .edge { fill: none; stroke: url(#env-foil) var(--e-foil); stroke-width: 3.4; stroke-linejoin: round; stroke-linecap: round; }
.env-lines .dots { fill: none; stroke: var(--e-foil); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 0 9; opacity: .75; }
/* Borders, one per craft (engine: ENV_BORDERS). */
.env-lines .band { fill: none; stroke: var(--e-accent); stroke-linejoin: round; }
.env-lines .foil-line { fill: none; stroke: url(#env-foil) var(--e-foil); stroke-linejoin: round; }
.env-lines .foil-fill { fill: url(#env-foil) var(--e-foil); }
.env-lines .tri-a { fill: var(--e-accent); }
.env-lines .tri-b { fill: var(--e-foil); }
.env-lines .tri-c { fill: var(--e-accent2); }
.env-lines .stitch { fill: none; stroke: var(--e-foil); stroke-width: 2; stroke-dasharray: 6 4; }
.env-lines .mirror { fill: url(#env-mirror) #dfe3e6; stroke: var(--e-foil); stroke-width: 2.4; }
.env-lines .ring { fill: none; stroke: var(--e-accent2); stroke-width: 1.8; stroke-dasharray: 2 2.4; }
.env-lines .fleck { fill: var(--e-accent2); }
.env-lines .leaf { fill: var(--e-accent); }
.env-lines .vein { fill: none; stroke: color-mix(in srgb, var(--e-accent) 50%, white); stroke-width: 1; }
.env-lines .bud { fill: var(--e-accent2); }
.env-lines .chalk { fill: var(--e-accent2); }
.env-lines .pearl { fill: url(#env-pearl) #f4efe6; }
.env-lines .thread { fill: none; stroke: #efe7d8; stroke-width: 1; }
.env-lines .floret { fill: var(--e-accent); }
.env-lines .lattice { fill: none; stroke: var(--e-foil); stroke-width: 1.4; }
.env-lines .eyelet { fill: color-mix(in srgb, var(--e-lining) 75%, var(--e-paper)); }
.env-lines .hair { fill: none; stroke: var(--e-ink); stroke-width: 1.2; }
.env-lines .studs { fill: none; stroke: url(#env-foil) var(--e-foil); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 0 16; }
/* The flap: an ogee with a gilded edge and a row of foil dots, hinged at the top. */
/* The wrapper takes the layer swap and the fall at the end; the flap inside only turns, so nothing flattens its 3D. */
.env-flap-wrap { left: 0; top: 0; width: 100%; height: calc(var(--flap) * 100%); z-index: 5; }
.env-flap { position: absolute; inset: 0; transform-origin: 50% 0; transform-style: preserve-3d; transform: perspective(1800px) rotateX(0deg); }
.env-face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.env-front { filter: drop-shadow(0 6px 7px rgba(45, 22, 18, .2)); }
.env-front .env-shape { --m: var(--flap-shape); }
.env-inside { transform: rotateX(180deg); }
.env-inside .env-shape { --m: var(--inside-shape); background: linear-gradient(color-mix(in srgb, var(--e-lining) 82%, black), var(--e-lining) 60%); }
.env-invocation { position: absolute; left: 10%; right: 10%; top: 8.5%; margin: 0; text-align: center; font: 400 calc(var(--env-w) * .037)/1.35 var(--font-accent); color: var(--e-ink); letter-spacing: .05em; }
.env-crest { position: absolute; left: 50%; top: var(--crest-y); width: var(--crest-w); translate: -50% -50%; pointer-events: none; }
.env-crest img, .env-crest svg { display: block; width: 100%; height: auto; }
/* Square paintings (a medallion, a peacock) are kept short so they never crowd the printed line above them. */
.env-crest img { width: auto; max-width: 100%; max-height: calc(var(--env-h) * .19); margin-inline: auto; }
.env-spray { color: var(--e-foil); fill: currentColor; }
.env-spray .petal { fill: none; stroke: currentColor; stroke-width: 1.5; }
/* The seal: tap it to open. A ring breathes out from it now and then, and a glint crosses the wax. */
.env-seal {
  left: 50%; top: calc(var(--seal-y) * 100%); z-index: 8; width: calc(var(--env-w) * .25); aspect-ratio: 1;
  padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; translate: -50% -50%;
  filter: drop-shadow(0 6px 7px rgba(50, 12, 18, .35)); -webkit-tap-highlight-color: transparent;
  animation: inv-seal-in .8s cubic-bezier(.3, 1.4, .5, 1) .9s both;
}
.env-seal img { width: 100%; height: 100%; object-fit: contain; }
.env-seal::before {
  content: ""; position: absolute; inset: 7%; border-radius: 50%; border: 1.5px solid var(--e-foil); opacity: 0; pointer-events: none;
  animation: inv-seal-halo 3.4s ease-out 2.4s infinite;
}
.env-seal::after {
  content: ""; position: absolute; inset: 12%; border-radius: 50%; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 240, 225, .42) 50%, transparent 60%) 160% 0 / 260% 100% no-repeat;
  animation: inv-seal-glint 5s ease-in-out 2.2s infinite;
}
.env-seal:focus-visible { outline: 2px solid var(--e-foil); outline-offset: 6px; }
/* The card inside: dotted border, arched double frame, the names. */
.env-card { z-index: 3; left: 4%; top: 5%; width: 92%; height: 93%; display: grid; place-items: center; text-align: center; }
.env-card::before {
  content: ""; position: absolute; inset: 0; border-radius: 3px;
  background: url("art/card-paper.webp") 0 0 / 460px repeat, color-mix(in srgb, var(--paper) 55%, white);
  box-shadow: 0 1px 2px rgba(45, 22, 18, .14), 0 22px 34px -22px rgba(45, 22, 18, .45);
  transition: opacity .5s ease;
}
.env-frame { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .45s ease; }
.env-frame .dots { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 0 7.5; opacity: .8; }
.env-frame .line { fill: none; stroke: var(--gold); stroke-width: 1.8; }
.env-frame .line.thin { stroke-width: 1; opacity: .6; }
.env-card-text { position: relative; display: grid; justify-items: center; gap: calc(var(--env-w) * .028); padding: 0 14%; }
.env-card .kicker { color: var(--gold-text); font-size: max(10px, calc(var(--env-w) * .027)); }
.env-card .cover-names { display: grid; justify-items: center; font-size: calc(var(--env-w) * .13); line-height: 1.04; font-style: italic; }
.env-card .amp { font-size: .55em; padding: .12em 0; }
html:not([lang="en"]) .env-card .cover-names { font-style: normal; } /* Indic scripts: no slanted letters */
.env-card .cover-date { display: flex; align-items: center; gap: .9em; color: var(--ink); font-size: max(11px, calc(var(--env-w) * .031)); }
.env-card .cover-date::before, .env-card .cover-date::after { content: ""; width: 2.2em; height: 1px; background: var(--gold); }
.env-actions { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; animation: inv-enter 1s var(--ease) 1.1s both; }
.env-hint { margin: 0; font: 600 11.5px/1.4 var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-text); animation: inv-hint 3.2s ease-in-out 2.4s infinite; }
html:not([lang="en"]) .env-hint { letter-spacing: .02em; text-transform: none; font-size: 13px; }
.cover.has-scene .env-hint { background: color-mix(in srgb, var(--paper) 80%, transparent); padding: 3px 10px; border-radius: 999px; }
@media (orientation: landscape) {
  .cover.has-envelope { --env-h: min(100svh - 150px, (100cqi - 80px) / 1.5); --env-w: calc(var(--env-h) * 1.5); --flap: .62; }
  .env {
    --flap: var(--flap-wide); --seal-y: var(--seal-y-wide); --crest-y: var(--crest-y-wide); --crest-w: var(--crest-w-wide);
    --pocket: var(--pocket-wide); --flap-shape: var(--flap-shape-wide); --inside-shape: var(--inside-shape-wide);
  }
  .only-tall { display: none; }
  .only-wide { display: block; }
  .env-invocation { top: 10%; font-size: calc(var(--env-h) * .036); }
  .env-seal { width: calc(var(--env-h) * .19); }

  .env-card { left: 3%; width: 94%; }
  .env-card-text { gap: calc(var(--env-h) * .03); }
  .env-card .kicker { font-size: max(10px, calc(var(--env-h) * .026)); }
  .env-card .cover-names { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 .26em; font-size: calc(var(--env-h) * .13); }
  .env-card .amp { padding: 0; }
  .env-card .cover-date { font-size: max(11px, calc(var(--env-h) * .03)); }
}
/* Photo materials (a style's "materials"): the cloth or paper itself, a photographed liner, and a woven band along
   a straight flap with the liner peeking out below it. "soft" envelopes are cloth-covered: rounded, padded, lit
   from the top left, with a deeper shadow under the flap. */
.env[data-lining-photo] .env-back { background: linear-gradient(rgba(35, 12, 12, .42), transparent 26%), var(--env-lining-tex), var(--e-lining); }
.env[data-lining-photo] .env-inside .env-shape { background: linear-gradient(rgba(0, 0, 0, .2), transparent 60%), var(--env-lining-tex), var(--e-lining); }
.env[data-lining-photo] :is(.env-back, .env-inside .env-shape)::after { content: none; }
.env-edge-band {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--env-h) * .03);
  background: var(--env-band) 0 50% / auto 100% repeat-x, var(--e-foil);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 -1px 0 rgba(60, 35, 5, .45), 0 1px 1px rgba(30, 10, 5, .35);
}
.env-edge-band::after {
  content: ""; position: absolute; left: .6%; right: .6%; top: 100%; height: calc(var(--env-h) * .013); border-radius: 0 0 4px 4px;
  background: linear-gradient(rgba(60, 30, 0, .35), transparent 75%), var(--env-lining-tex, none), var(--e-lining);
  box-shadow: 0 2px 3px rgba(30, 10, 5, .3);
}
/* A hem: a woven border along the bottom of the envelope (a style's materials.hem, one seamless repeat). */
.env-hem {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--env-w) * .12);
  background: var(--env-hem) 0 50% / auto 100% repeat-x;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .35), 0 -2px 3px rgba(40, 20, 10, .12);
}
@media (orientation: landscape) { .env-hem { height: calc(var(--env-h) * .1); } }
.env[data-soft] { --env-weave: linear-gradient(165deg, rgba(255, 255, 255, .12), transparent 42%, rgba(0, 0, 0, .16)); }
.env[data-soft] .env-shape { border-radius: calc(var(--env-w) * .022); }
.env[data-soft] :is(.env-pocket, .env-front) .env-shape {
  box-shadow: inset 0 calc(var(--env-w) * .01) calc(var(--env-w) * .02) rgba(255, 255, 255, .14), inset 0 calc(var(--env-w) * -.014) calc(var(--env-w) * .035) rgba(0, 0, 0, .3), inset 0 0 calc(var(--env-w) * .02) rgba(0, 0, 0, .18);
}
.env[data-soft] .env-back { border-radius: calc(var(--env-w) * .022); box-shadow: 0 2px 3px rgba(40, 15, 15, .25), 0 26px 36px -18px rgba(40, 15, 15, .5); }
.env[data-soft] .env-front { filter: drop-shadow(0 3px 2px rgba(30, 5, 10, .35)) drop-shadow(0 12px 14px rgba(30, 5, 10, .2)); }
.env-card-line { margin: 0 0 calc(var(--env-w) * .01); font-size: max(12px, calc(var(--env-w) * .032)); color: var(--accent); }
/* Extras that hold the envelope shut: a parandi tassel hanging from the seal (Punjabi), a mauli thread tied
   round it (Gujarati), a kasavu band (Kerala) or a satin ribbon (Muslim). They slip off as the seal lifts. */
.env-tassel { left: 50%; top: calc(var(--seal-y) * 100%); z-index: 7; width: calc(var(--env-w) * .09); translate: -50% 0; transform-origin: 50% 0; overflow: visible; animation: inv-tassel 4.8s ease-in-out infinite; }
.env-tassel .cord, .env-tassel .fringe { fill: none; stroke: var(--e-accent); stroke-linecap: round; }
.env-tassel .cord { stroke-width: 2.6; }
.env-tassel .fringe { stroke-width: 1.5; }
.env-tassel .knot { fill: var(--e-foil); }
.env-tassel .cap { fill: var(--e-accent); }
.env-tassel .tie { stroke: var(--e-foil); stroke-width: 3; }
.env-thread, .env-ribbon, .env-band { left: -1%; right: -1%; top: calc(var(--seal-y) * 100%); z-index: 7; translate: 0 -50%; pointer-events: none; }
.env-thread {
  height: max(5px, calc(var(--env-h) * .009)); border-radius: 3px; box-shadow: 0 2px 3px rgba(40, 10, 10, .3);
  background: repeating-linear-gradient(60deg, var(--e-accent) 0 5px, var(--e-accent2) 5px 9px);
}
.env-thread::before, .env-thread::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: max(5px, calc(var(--env-h) * .009)); height: calc(var(--env-w) * .17);
  border-radius: 3px; background: inherit; transform-origin: 50% 0;
}
.env-thread::before { rotate: 24deg; }
.env-thread::after { rotate: -18deg; }
.env-ribbon {
  height: max(9px, calc(var(--env-h) * .024)); box-shadow: 0 3px 5px rgba(10, 30, 20, .35);
  background: linear-gradient(color-mix(in srgb, var(--e-foil) 70%, black), var(--e-foil) 28%, color-mix(in srgb, var(--e-foil) 40%, white) 50%, var(--e-foil) 72%, color-mix(in srgb, var(--e-foil) 70%, black));
}
.env-band {
  height: 15%; box-shadow: 0 4px 8px rgba(60, 45, 20, .25);
  background: linear-gradient(var(--e-foil) 0 7%, transparent 7% 11%, var(--e-foil) 11% 13%, transparent 13% 87%, var(--e-foil) 87% 89%, transparent 89% 93%, var(--e-foil) 93%), var(--texture), var(--e-paper);
}
@keyframes inv-tassel { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
/* The palace gate (Rajasthani): two doors under a jharokha arch, hinged on their outer edges. Each door has the
   painted peacock (the right one mirrored) and a blue-pottery lining on its back. */
.env-gate .env-door-wrap { top: 0; bottom: 0; width: 50%; z-index: 5; }
.env-gate .env-door-wrap.left { left: 0; }
.env-gate .env-door-wrap.right { right: 0; }
.env-door { position: absolute; inset: 0; transform-style: preserve-3d; transform: perspective(1800px) rotateY(0deg); }
.left > .env-door { transform-origin: 0 50%; }
.right > .env-door { transform-origin: 100% 50%; }
.env-door .env-shape { -webkit-mask: none; mask: none; }
.env-door .env-inside { transform: rotateY(180deg); }
.env-door .env-inside .env-shape { background: var(--e-lining); }
.left > .env-door .env-front::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 10px; background: linear-gradient(to left, rgba(40, 10, 10, .28), transparent); }
.right > .env-door .env-front::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 10px; background: linear-gradient(to right, rgba(40, 10, 10, .28), transparent); }
.right > .env-door .env-crest img { scale: -1 1; }
.env-gate .env-crest img { max-height: calc(var(--env-h) * .26); }
@media (orientation: landscape) {
  .env-tassel { width: calc(var(--env-h) * .075); }
  .env-gate .env-crest img { max-height: calc(var(--env-h) * .36); }
}
.env-gate .env-invocation { z-index: 6; top: 4.5%; }
.cover.has-envelope.is-revealing :is(.env-thread, .env-ribbon, .env-band) { animation: inv-env-slip .6s cubic-bezier(.5, 0, .7, .4) .05s forwards; }
.cover.has-envelope.is-revealing .env-tassel { animation: inv-tassel-off .6s cubic-bezier(.5, 0, .7, .4) .1s forwards; }
.cover.has-envelope.is-revealing .env-gate .env-invocation { animation: inv-fade-out .3s ease forwards; }
.cover.has-envelope.is-revealing .env.env-gate { animation: inv-gate-zoom 2.6s cubic-bezier(.45, 0, .25, 1) .15s forwards; }
.cover.has-envelope.is-revealing .left > .env-door { animation: inv-door-left 1.05s cubic-bezier(.45, 0, .25, 1) .35s forwards; }
.cover.has-envelope.is-revealing .right > .env-door { animation: inv-door-right 1.05s cubic-bezier(.45, 0, .25, 1) .35s forwards; }
.cover.has-envelope.is-revealing .env-gate .env-door-wrap { animation: inv-fade-out .5s ease 1.2s forwards; }
.cover.has-envelope.is-revealing .env-gate .env-card { animation: inv-gate-card 1.2s cubic-bezier(.45, 0, .2, 1) 1.1s forwards; }
@keyframes inv-env-slip { to { translate: 0 120%; opacity: 0; } }
@keyframes inv-tassel-off { to { translate: -50% 60%; rotate: 14deg; opacity: 0; } }
@keyframes inv-door-left { to { transform: perspective(1800px) rotateY(-150deg); } }
@keyframes inv-door-right { to { transform: perspective(1800px) rotateY(150deg); } }
@keyframes inv-gate-zoom { 0% { scale: 1; } 30%, 66% { scale: .84; } 100% { scale: 1; } }
@keyframes inv-gate-card { 0% { z-index: 3; scale: .97; } 40% { z-index: 7; scale: 1.02; } 100% { z-index: 7; scale: 1; } }
/* Window light: soft leaf shadows sway across the table, with a warm beam of sun. */
.cover-leaves {
  position: absolute; inset: -10%; z-index: 5; pointer-events: none; opacity: .2;
  background: url("art/light-leaves.svg") 0 0 / 100% 100% no-repeat; mix-blend-mode: multiply;
  transform-origin: 0 0; animation: inv-leaves 12s ease-in-out infinite alternate; transition: opacity .8s ease;
}
.cover-beam {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; mix-blend-mode: soft-light; transition: opacity .8s ease;
  background: linear-gradient(118deg, transparent 16%, rgba(255, 244, 222, .55) 32%, transparent 50%, transparent 60%, rgba(255, 244, 222, .4) 71%, transparent 86%);
}
.cover.has-envelope.is-revealing .cover-leaves { opacity: .1; }
.cover.has-envelope.is-entering :is(.cover-leaves, .cover-beam) { opacity: 0; }
.cover.has-envelope.is-revealing .env-actions { animation: inv-fade-out .4s ease forwards; pointer-events: none; }
.cover.has-envelope.is-revealing .env-seal { pointer-events: none; animation: inv-seal-off .6s cubic-bezier(.5, 0, .6, .5) forwards; }
.cover.has-envelope.is-revealing .env-seal::before, .cover.has-envelope.is-revealing .env-seal::after { animation: none; opacity: 0; }
.cover.has-envelope.is-revealing .env { animation: inv-env-zoom 2.6s cubic-bezier(.45, 0, .25, 1) .15s forwards; }
.cover.has-envelope.is-revealing .env-flap { animation: inv-env-flap .85s cubic-bezier(.45, 0, .25, 1) .35s forwards; }
.cover.has-envelope.is-revealing .env-flap-wrap { animation: inv-env-under .85s cubic-bezier(.45, 0, .25, 1) .35s forwards, inv-env-drop .7s cubic-bezier(.55, 0, .7, .4) 1.95s forwards; }
.cover.has-envelope.is-revealing :is(.env-back, .env-pocket) { animation: inv-env-drop .7s cubic-bezier(.55, 0, .7, .4) 1.95s forwards; }
.cover.has-envelope.is-revealing .env-card { animation: inv-env-card 1.65s cubic-bezier(.45, 0, .2, 1) 1.1s forwards; }
.cover.has-envelope.is-entering .env-frame { opacity: 0; }
.cover.has-envelope.is-entering .env-card::before { opacity: 0; }
@keyframes inv-env-in { from { opacity: 0; translate: 0 22px; scale: .96; } }
@keyframes inv-seal-in { from { opacity: 0; scale: 1.35; } }
@keyframes inv-seal-halo { 0% { opacity: .75; scale: .96; } 100% { opacity: 0; scale: 1.6; } }
@keyframes inv-seal-off { 0% { scale: 1; } 18% { scale: .9; } 42% { scale: 1.08; translate: -50% -62%; rotate: -5deg; opacity: 1; } 100% { scale: .92; translate: -50% -150%; rotate: -16deg; opacity: 0; } }
@keyframes inv-seal-glint { 0%, 70% { background-position: 160% 0; } 100% { background-position: -60% 0; } }
@keyframes inv-hint { 50% { opacity: .5; } }
@keyframes inv-leaves { from { rotate: -1deg; translate: -1.5% -.5%; } to { rotate: 1.2deg; translate: 1% .8%; } }
@keyframes inv-env-zoom {
  0% { scale: 1; translate: 0 0; }
  32%, 68% { scale: .6; translate: 0 calc(var(--env-h) * var(--flap) * .3); }
  100% { scale: 1; translate: 0 0; }
}
@keyframes inv-env-flap { to { transform: perspective(1800px) rotateX(180deg); } }
/* Same timing as the turn, so the open flap drops behind the card just as it passes upright. */
@keyframes inv-env-under { 0%, 49% { z-index: 5; } 50%, 100% { z-index: 1; } }
@keyframes inv-env-card {
  0% { translate: 0 0; z-index: 3; }
  48% { translate: 0 -66%; z-index: 3; }
  49% { z-index: 7; }
  100% { translate: 0 0; z-index: 7; }
}
@keyframes inv-env-drop { to { translate: 0 70%; opacity: 0; } }

.cover.is-revealing .curtain-half.left { transform-origin: 0 0; animation: inv-curtain-left 1.5s cubic-bezier(.55, 0, .25, 1) .1s forwards; }
.cover.is-revealing .curtain-half.right { transform-origin: 100% 0; animation: inv-curtain-right 1.5s cubic-bezier(.55, 0, .25, 1) .1s forwards; }
.cover.is-revealing .cover-actions { opacity: 0; pointer-events: none; }
.cover.is-revealing .cover-names { animation: inv-names-glow 1.6s ease-out .9s both; }
.akshata { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.akshata i { position: absolute; top: -12px; left: var(--x); background: var(--c); opacity: 0; animation: inv-akshata var(--dur) cubic-bezier(.3, .1, .6, 1) var(--delay) forwards; }
.akshata i.grain { width: 4px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 .5px rgba(150, 110, 40, .35); }
.akshata i.petal { width: 11px; height: 7px; border-radius: 80% 15% 80% 20%; }

/* ---------- Opening, beat 2: walk into the mandap ---------- */
.cover::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 58%, color-mix(in srgb, white 72%, var(--paper)) 0%, color-mix(in srgb, var(--paper) 88%, transparent) 42%, transparent 78%);
  transition: opacity .9s ease;
}
.cover-top, .cover-stage, .cover-ring, .cover-dust { transition: translate 1s cubic-bezier(.6, 0, .75, .35), scale 1s cubic-bezier(.55, 0, .75, .35), opacity .8s ease; }
.cover-stage { transform-origin: 50% 70%; }
.cover.is-entering::after { opacity: 1; }
.cover.is-entering .cover-top { translate: 0 -115%; }
.cover.is-entering .cover-stage { scale: 2.4; translate: 0 16%; opacity: 0; }
.cover.is-entering .cover-ring { scale: 1.7; opacity: 0; }
.cover.is-entering .cover-dust, .cover.is-entering .cover-actions { opacity: 0; }
.cover.is-entering :is(.invocation, .kicker, .cover-date) { animation: inv-fade-out .45s ease forwards; }
.cover.is-entering .cover-names { position: relative; z-index: 4; }

/* ---------- Opening, beat 3: the names travel into the unfolding welcome card ---------- */
::view-transition-group(invite-names) { animation-duration: .95s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(invite-names) { animation: inv-fade-out .5s ease both; }
::view-transition-new(invite-names) { animation: inv-fade-in .6s ease .25s both; }
::view-transition-old(root) { animation: inv-root-out .8s ease both; }
::view-transition-new(root) { animation: inv-fade-in .8s ease .15s both; }
::view-transition-new(invite-card) { animation: inv-unfold 1.05s cubic-bezier(.2, .8, .2, 1) both; }
.welcome-card.is-arriving > :is(.invocation, .welcome-line, .welcome-date) { animation: inv-enter .8s var(--ease) both; }
.welcome-card.is-arriving > .invocation { animation-delay: .45s; }
.welcome-card.is-arriving > .welcome-line { animation-delay: .6s; }
.welcome-card.is-arriving > .welcome-date { animation-delay: .9s; }

/* ---------- Painted ornaments ---------- */
.corner.is-painted { width: clamp(54px, 12cqi, 96px); }
.corner.is-painted img { width: 100%; }
.divider { width: min(70%, 320px); margin: 6px auto 4px; }
.divider img { width: 100%; }
.elders { margin-top: 26px; font: 400 16px/1.7 var(--font-accent); font-style: italic; opacity: .9; }

/* ---------- Chapter styles set by the theme: open and night ---------- */
.ch--open .frame { max-width: 980px; background: none; border: 0; box-shadow: none; padding-inline: 0; }
.ch--open .corner { display: none; }
.ch--open .greet-scene { width: min(100%, 880px); }
.ch--open .ch-copy { max-width: 52ch; }

/* Night chapters fade in from the page colour and back out into it, so there is never a hard edge.
   The fades are layers of the chapter's own background (no overlay element, so no hairline seam), and they
   pass through a warm glow, like dusk light, instead of the grey a straight cream-to-maroon blend gives. */
.ch--night {
  --card: transparent; --fade: clamp(90px, 15cqi, 170px);
  color: var(--paper); isolation: isolate; padding-block: clamp(110px, 17cqi, 200px);
  background:
    var(--texture),
    linear-gradient(var(--paper) 0%, color-mix(in srgb, var(--paper) 72%, transparent) 28%, color-mix(in srgb, var(--bloom) 26%, transparent) 62%, transparent 100%) top / 100% var(--fade) no-repeat,
    linear-gradient(transparent 0%, color-mix(in srgb, var(--bloom) 26%, transparent) 38%, color-mix(in srgb, var(--paper) 72%, transparent) 72%, var(--paper) 100%) bottom / 100% var(--fade) no-repeat,
    radial-gradient(ellipse 90% 70% at 50% 45%, color-mix(in srgb, var(--accent) 88%, var(--bloom)), var(--accent-deep) 75%);
}
.ch--night.ch--framed .frame { background: color-mix(in srgb, var(--accent-deep) 55%, transparent); border-color: color-mix(in srgb, var(--gold-soft) 45%, transparent); box-shadow: 0 0 0 6px transparent, 0 0 0 7px color-mix(in srgb, var(--gold-soft) 30%, transparent); }
.ch--night :is(.ch-title, .union-copy h2, .d-day, .cd-unit b, .signature) { color: var(--gold-soft); }
.ch--night :is(.ch-kicker, .union-date, .d-week, .cd-unit span, .kicker) { color: color-mix(in srgb, var(--gold-soft) 85%, white); }
.ch--night :is(.ch-copy, .union-line, .d-month, .d-time, .countdown-label) { color: color-mix(in srgb, var(--paper) 92%, transparent); }
.ch--night .corner { color: var(--gold-soft); }
.ch--night .date-frame path, .ch--night .date-frame .finial { stroke: var(--gold-soft); }
.ch--night .date-frame .finial { fill: var(--gold-soft); }
.ch--night .cd-unit { background: color-mix(in srgb, var(--accent-deep) 70%, black); border-color: color-mix(in srgb, var(--gold-soft) 40%, transparent); }
.ch--night .btn { background: var(--gold-soft); border-color: var(--gold-soft); color: var(--accent-deep); }
.ch--night .btn:hover { background: color-mix(in srgb, var(--gold-soft) 85%, white); }
.ch--night .btn-ghost { background: transparent; color: var(--gold-soft); }
.ch--night .btn-ghost:hover { background: color-mix(in srgb, var(--gold-soft) 12%, transparent); }
.ch--night .union-rangoli { opacity: .42; }
.ch--night .union-copy::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-deep) 80%, transparent) 50%, transparent); }
.ch--night .date-figure img { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--bloom) 35%, transparent)); }
.glows { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.glows i { position: absolute; left: var(--x); top: var(--y); width: var(--s); aspect-ratio: 1; border-radius: 50%; translate: -50% -50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--bloom) 60%, transparent), transparent 65%); animation: inv-flicker 3.4s ease-in-out var(--delay) infinite; }

/* ---------- Date reveal: the tassel scroll (layout.dateReveal "scroll") ----------
   The date is printed on a scroll between two gold rods. --unroll (0 to 1) shows the paper down to the lower
   rod; pulling the tassel moves it. Registered so the browser can animate it. */
@property --unroll { syntax: "<number>"; inherits: true; initial-value: 0; }
.date-frame.is-scroll { --unroll: 0; transition: --unroll .9s cubic-bezier(.2, .8, .2, 1); }
.date-frame.is-scroll.is-dragging { transition: none; }
.date-frame.is-scroll.is-unrolled { --unroll: 1; }
.date-frame.is-scroll .date-face {
  inset: 7% 7% 7%; border-radius: 3px;
  background: var(--env-paper, none) 50% 50% / 240px repeat, var(--card);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent), 0 16px 28px -18px rgba(60, 20, 30, .35);
  clip-path: inset(0 0 calc((1 - var(--unroll)) * 100%) 0);
}
.date-scroll { position: absolute; inset: 7% 2% 7%; pointer-events: none; }
.date-scroll .rod {
  position: absolute; left: 0; right: 0; height: 12px; border-radius: 6px;
  background: linear-gradient(color-mix(in srgb, var(--gold-soft) 85%, white), var(--gold) 55%, color-mix(in srgb, var(--gold) 70%, black));
  box-shadow: 0 3px 6px rgba(60, 30, 10, .3);
}
.date-scroll .rod::before, .date-scroll .rod::after { content: ""; position: absolute; top: -3px; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--gold-soft) 80%, white), var(--gold) 60%, color-mix(in srgb, var(--gold) 60%, black)); }
.date-scroll .rod::before { left: -9px; }
.date-scroll .rod::after { right: -9px; }
.date-scroll .rod.top { top: -6px; }
.date-scroll .rod.bottom { top: calc(var(--unroll) * 100% - 6px); pointer-events: auto; touch-action: none; cursor: grab; }
.date-frame.is-unrolled .rod.bottom { cursor: default; }
.date-scroll .tassel { position: absolute; left: 50%; top: 6px; width: 40px; margin-left: -20px; transform-origin: 50% 0; pointer-events: auto; cursor: grab; }
.date-scroll .tassel img { width: 100%; }
.date-scroll .tassel i { display: block; width: 14px; height: 46px; margin: 0 auto; border-radius: 3px 3px 7px 7px; background: repeating-linear-gradient(90deg, var(--gold) 0 2px, var(--gold-soft) 2px 4px); }
.scroll-hint { position: absolute; left: 0; right: 0; top: 34%; text-align: center; font: 600 12px/1.4 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); transition: opacity .5s ease; }
.scroll-hint.is-gone { opacity: 0; }
/* Room under the scroll for the tassel hanging from the lower rod. */
.date-stage:has(.is-scroll) + .date-tools { margin-top: 64px; }
.ch--night .scroll-hint { color: var(--gold-soft); }
/* layout.gallery "arch": photos in arched frames, upright. */
.ch-gallery.is-arch .photo-btn { rotate: 0deg; }
.ch-gallery.is-arch .photo-frame { padding: 10px; border-radius: 999px 999px 14px 14px; }
.ch-gallery.is-arch .photo-frame img { aspect-ratio: 3 / 4; border-radius: 999px 999px 8px 8px; }
.ch-gallery { text-align: center; }
.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(78cqi, 420px); gap: clamp(18px, 4cqi, 36px);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  padding: 26px max(16px, calc(50% - 210px)) 30px; margin: 10px -16px 0; outline: none;
}
.gallery::-webkit-scrollbar { display: none; }
.photo { margin: 0; scroll-snap-align: center; display: grid; justify-items: center; gap: 12px; }
.photo-btn { padding: 0; border: 0; background: none; cursor: zoom-in; rotate: var(--tilt); transition: rotate .4s var(--ease), transform .4s var(--ease); }
.photo-btn:hover { rotate: 0deg; transform: translateY(-4px); }
.photo-frame { display: block; padding: 12px 12px 14px; background: var(--card); border: 1px solid var(--frame-line); box-shadow: inset 0 0 0 4px var(--card), inset 0 0 0 5px color-mix(in srgb, var(--gold) 40%, transparent), 0 26px 40px -26px rgba(60, 20, 20, .55); }
.photo-frame img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.photo figcaption { font: 400 16px/1.5 var(--font-accent); max-width: 30ch; }
.gallery-nav { display: flex; justify-content: center; align-items: center; gap: 14px; }
.gallery-dots { display: flex; gap: 8px; }
.gallery-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--frame-line); transition: background .3s, transform .3s; }
.gallery-dots i.on { background: var(--accent); transform: scale(1.25); }
.sample-note { margin-top: 12px; font-size: 13px; opacity: .7; }
.lightbox { width: min(94vw, 760px); max-height: 94svh; padding: 16px; border: 1px solid var(--frame-line); background: var(--paper); color: var(--ink); }
.lightbox::backdrop { background: rgba(30, 10, 12, .82); }
.lightbox figure { margin: 0; display: grid; gap: 10px; }
.lightbox img { width: 100%; max-height: 72svh; object-fit: contain; }
.lightbox figcaption { font: 400 17px/1.5 var(--font-accent); text-align: center; }
.lightbox-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
body:has(.lightbox[open]) { overflow: hidden; }

/* ---------- Music dock: the couple's song in the official player ---------- */
.music-dock {
  position: fixed; z-index: 55; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom));
  padding: 8px; border-radius: 14px; border: 1px solid var(--frame-line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 18px 40px -20px rgba(40, 10, 16, .55);
  animation: inv-dock-in .5s var(--ease) both;
}
.dock-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 6px; }
.dock-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 12px/1.3 var(--font-body); color: var(--accent); }
.dock-stop { flex: none; padding: 4px 10px; border: 1px solid var(--frame-line); border-radius: 999px; background: var(--paper); color: var(--accent); font: 600 11.5px/1 var(--font-body); cursor: pointer; }
.music-dock iframe { display: block; border: 0; border-radius: 10px; }
.music-dock.youtube { width: 224px; }
.music-dock.youtube iframe { width: 208px; height: 208px; background: #000; } /* YouTube's minimum player size is 200 x 200 */
.music-dock.spotify { width: min(340px, calc(100vw - 24px)); }
.music-dock.spotify iframe { width: 100%; height: 152px; }
@keyframes inv-dock-in { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Scenes: full-screen paintings (theme.json "scenes") ----------
   One landscape painting per scene. Full screen shows all of it; tablets and phones get centre cuts
   (picked by <picture>), and object-fit: cover fills any screen shape without stretching. */
.has-scene { isolation: isolate; }
.scene { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.scene img { width: 100%; height: 100%; max-width: none; object-fit: cover; }

/* Cover: the hall is the painting, so the separate rangoli rings step aside, and the words sit in the
   plain wall above the mandap with a soft halo of paper light behind them. */
.cover.has-scene { justify-content: flex-start; background: var(--paper); }
.cover.has-scene .cover-ring { display: none; }
.cover.has-scene .cover-center { margin-block: clamp(96px, 17svh, 190px) auto; }
.cover.has-scene .cover-center::before {
  content: ""; position: absolute; inset: -6% -14%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--paper) 78%, transparent) 40%, transparent);
}
.cover.has-scene .skip { background: color-mix(in srgb, var(--paper) 80%, transparent); padding: 3px 10px; border-radius: 999px; border: 0; }
/* Opening, beat 2 with a scene: the guest walks into the hall towards the mandap. */
.cover .scene img { transform-origin: 50% 72%; transition: scale 1.1s cubic-bezier(.55, 0, .75, .35), opacity .9s ease; }
.cover.is-entering .scene img { scale: 1.55; }

/* Depth on the opening. The painting sits far back: it breathes slowly and drifts a little against the
   pointer or tilt (--px/--py from the engine). The near layers (scenes.cover.front) hang at the top corners
   and move more, then swing out of view as the guest walks in. */
.cover .scene { translate: calc(var(--px, 0) * -12px) calc(var(--py, 0) * -8px); animation: inv-scene-breathe 24s ease-in-out infinite alternate; }
.cover-front { position: absolute; z-index: 3; top: -2px; width: clamp(104px, 17cqi, 290px); pointer-events: none; transition: translate 1s cubic-bezier(.6, 0, .75, .35), opacity .8s ease; }
.cover-front.left { left: -1.5%; }
.cover-front.right { right: -1.5%; }
.cover-front img { width: 100%; transform-origin: 50% 0; translate: calc(var(--px, 0) * 26px) calc(var(--py, 0) * 12px); animation: inv-swing 7s ease-in-out infinite; }
.cover-front.right img { scale: -1 1; animation-delay: -3.5s; }
.cover.is-entering .cover-front.left { translate: -110% -12%; opacity: 0; }
.cover.is-entering .cover-front.right { translate: 110% -12%; opacity: 0; }
@keyframes inv-scene-breathe { from { transform: scale(1.03); } to { transform: scale(1.075); } }
/* Chapter paintings drift gently against the scroll, where the browser supports scroll-linked animation. */
@supports (animation-timeline: view()) {
  :is(.ch.has-scene, .welcome-card.has-scene) > .scene img { scale: 1.08; animation: inv-scene-drift linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  @keyframes inv-scene-drift { from { translate: 0 -3.5%; } to { translate: 0 3.5%; } }
}

/* The couple's own photo in an arch on the welcome card (couple.photo), when the wedding has one. */
.welcome-photo { width: min(44cqi, 220px); aspect-ratio: 3 / 4; margin: 2px auto 4px; border-radius: 999px 999px 12px 12px; overflow: hidden;
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--frame-line), 0 20px 30px -20px rgba(60, 20, 30, .45); }
.welcome-photo img { width: 100%; height: 100%; object-fit: cover; }

/* Welcome: the card becomes the whole first screen, with the words in the plain paper between the
   painted friezes. Its lower edge still melts into the page. */
.welcome-card.has-scene {
  --card-w: 100cqi;
  width: 100%; min-height: 100svh; aspect-ratio: auto; background: none;
  padding: clamp(150px, 24svh, 250px) 24px clamp(130px, 21svh, 230px);
  -webkit-mask-image: linear-gradient(#000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 40px), transparent);
}
.ch-welcome.has-scene { padding: 0; }
.welcome-card.has-scene .welcome-names { font-size: clamp(48px, 9cqi, 104px); }
.welcome-card.has-scene .welcome-line { max-width: 34ch; }
.welcome-card.has-scene .scroll-cue { margin-top: clamp(14px, 3svh, 30px); }

/* Night chapter with a scene: the painting is a full screen of its own. Above and below it the page
   fades through dusk light, as before, and the painting's own edges are feathered into that. */
.ch--night.has-scene { display: grid; place-items: center; min-height: calc(100svh + 2 * var(--fade)); padding-block: calc(var(--fade) + 40px); }
.ch--night.has-scene > .scene {
  inset: var(--fade) 0;
  -webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
/* A scene behind a light chapter (any chapter except the welcome): also a full screen, its top and bottom
   edges feathered into the page so it sits in the scroll without a seam. */
.ch.has-scene:not(.ch--night, .ch-welcome) { min-height: 100svh; }
.ch.has-scene:not(.ch--night, .ch-welcome) > .scene {
  -webkit-mask-image: linear-gradient(transparent, #000 56px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(transparent, #000 56px, #000 calc(100% - 56px), transparent);
}
.ch-union.has-scene .union-rangoli { display: none; }
/* Over a light painting the paper halo only needs to be a soft lift, not a white disc. */
.ch-union.has-scene:not(.ch--night) .union-copy::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--paper) 55%, transparent) 25%, transparent); }
.ch-union.has-scene .union-copy { margin-bottom: 8svh; }

/* ---------- Motion primitives ---------- */
[data-reveal] { opacity: 0; transition: opacity .9s var(--ease), transform .9s var(--ease), clip-path 1.2s var(--ease); transition-delay: var(--d, 0ms); }
[data-reveal="rise"] { transform: translateY(26px); }
[data-reveal="drop"] { transform: translateY(-70px); transition-duration: 1s; }
[data-reveal="slide-left"] { transform: translateX(-28px); }
[data-reveal="slide-right"] { transform: translateX(28px); }
[data-reveal="zoom"] { transform: scale(.92); }
/* "draw" clips the child, not the observed element: a fully clipped target never reports as intersecting. */
[data-reveal="draw"] > * { clip-path: inset(0 50%); transition: clip-path 1.4s var(--ease) var(--d, 0ms); }
[data-reveal].is-in { opacity: 1; transform: none; }
[data-reveal="draw"].is-in > * { clip-path: inset(0); }

[data-loop] { animation-duration: var(--loop-speed, 5.8s); animation-timing-function: ease-in-out; animation-iteration-count: infinite; animation-delay: var(--loop-delay, 0s); animation-play-state: paused; }
[data-loop].is-on { animation-play-state: running; }
[data-loop="float"] { animation-name: inv-float; }
[data-loop="sway"] { animation-name: inv-sway; --loop-speed: 6s; }
[data-loop="swing"] { animation-name: inv-swing; --loop-speed: 5.2s; }
[data-loop="breathe"] { animation-name: inv-breathe; --loop-speed: 6s; }
[data-loop="spin"] { animation-name: inv-spin; animation-timing-function: linear; --loop-speed: 65s; }
[data-loop="spin-reverse"] { animation-name: inv-spin; animation-direction: reverse; animation-timing-function: linear; --loop-speed: 55s; }
[data-loop="glow"] { animation-name: inv-glow; --loop-speed: 5s; }

@keyframes inv-enter { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes inv-stage { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes inv-card { from { opacity: .3; transform: translateY(22px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes inv-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes inv-sway { 0%, 100% { transform: rotate(-.7deg); } 50% { transform: rotate(.7deg); } }
@keyframes inv-swing { 0%, 100% { transform: rotate(-1.8deg); } 50% { transform: rotate(1.8deg); } }
@keyframes inv-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025) translateY(-3px); } }
@keyframes inv-spin { to { transform: rotate(360deg); } }
@keyframes inv-glow { 0%, 100% { filter: brightness(1) drop-shadow(0 0 3px color-mix(in srgb, var(--gold) 25%, transparent)); } 50% { filter: brightness(1.12) drop-shadow(0 0 10px color-mix(in srgb, var(--gold) 55%, transparent)); } }
@keyframes inv-bob { 0%, 100% { transform: translateY(-2px); opacity: .6; } 50% { transform: translateY(4px); opacity: 1; } }
@keyframes inv-glint { 0%, 62% { left: -40%; } 88%, 100% { left: 140%; } }
@keyframes inv-dust { 0% { opacity: 0; transform: translate3d(0, 0, 0); } 15% { opacity: .55; } 80% { opacity: .25; } 100% { opacity: 0; transform: translate3d(var(--drift), -72vh, 0); } }
@keyframes inv-petal { 0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0); } 10% { opacity: .75; } 85% { opacity: .55; } 100% { opacity: 0; transform: translate3d(var(--drift), 112vh, 0) rotate(var(--rot)); } }
@keyframes inv-burst { 0% { opacity: 0; transform: translate(0, 0) scale(.2); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); } }

@keyframes inv-cloth-hold { 0%, 100% { transform: rotate(-.35deg) translateY(0); } 50% { transform: rotate(.35deg) translateY(2px); } }
@keyframes inv-fold-left { 0% { transform: rotateY(0); } 14% { transform: rotateY(7deg); } 72% { opacity: 1; } 100% { transform: rotateY(-124deg); opacity: 0; } }
@keyframes inv-fold-right { 0% { transform: rotateY(0); } 14% { transform: rotateY(-7deg); } 72% { opacity: 1; } 100% { transform: rotateY(124deg); opacity: 0; } }
@keyframes inv-fold-breathe { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(var(--lift, -2deg)); } }
@keyframes inv-curtain-sway { 0%, 100% { transform: rotate(-.5deg); } 50% { transform: rotate(.5deg); } }
@keyframes inv-curtain-left { 0% { transform: none; } 14% { transform: translateX(3%); } 78% { opacity: 1; } 100% { transform: translateX(-46%) scaleX(.26); opacity: 0; } }
@keyframes inv-curtain-right { 0% { transform: none; } 14% { transform: translateX(-3%); } 78% { opacity: 1; } 100% { transform: translateX(46%) scaleX(.26); opacity: 0; } }
@keyframes inv-cloth-lower { 0% { transform: translateY(0); } 18% { transform: translateY(-10px) scaleY(1.02); } 100% { transform: translateY(125%) rotate(2.5deg); opacity: 0; } }
@keyframes inv-names-glow { 0% { text-shadow: 0 0 0 transparent; } 40% { text-shadow: 0 0 28px color-mix(in srgb, var(--gold-soft) 90%, transparent); } 100% { text-shadow: 0 0 0 transparent; } }
@keyframes inv-akshata { 0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0); } 12% { opacity: 1; } 85% { opacity: .9; } 100% { opacity: 0; transform: translate3d(var(--drift), 82svh, 0) rotate(var(--rot)); } }
@keyframes inv-flicker { 0%, 100% { opacity: .55; scale: 1; } 30% { opacity: .9; scale: 1.08; } 60% { opacity: .65; scale: .96; } }

@keyframes inv-fade-out { to { opacity: 0; } }
@keyframes inv-fade-in { from { opacity: 0; } }
@keyframes inv-root-out { to { opacity: 0; transform: scale(1.04); } }
@keyframes inv-unfold { from { clip-path: inset(46% 4% 46% 4%); opacity: .2; transform: translateY(18px); } to { clip-path: inset(0); opacity: 1; transform: none; } }

/* Wide letter-spacing suits English capitals but pulls apart the joined letters of Indian scripts
   (Devanagari, Gurmukhi and the rest), so small labels keep their spacing only in English. */
html:not([lang="en"]) :is(.kicker, .ch-kicker, .day-no, .ev-wear-label, .ev-month, .welcome-date, .union-date, .d-week, .cd-unit span, .wn small, .scroll-cue, .cover-date, .venue-date) {
  letter-spacing: .02em;
}

/* ---------- Responsive: phone, tablet and full screen ----------
   Phone: up to 599px wide. Tablet: 600 to 1023px. Full screen: 1024px and wider.
   Scenes switch pictures by screen shape (see "Scenes"); the rules below arrange the content. */

/* Full screen: more air, larger headings, content laid out side by side. */
@container (min-width: 1024px) {
  .ch { padding-block: clamp(80px, 9cqi, 140px); }
  .ch-title { font-size: clamp(48px, 4.4cqi, 68px); }
  .ch-copy { font-size: 20px; }
  .cover:not(.has-antarpat) .cover-names { font-size: clamp(64px, 6.2cqi, 104px); }
  /* The foliage frames the text column instead of hugging the far edges of a wide screen. */
  .foliage.left { left: max(0px, calc(50% - 640px)); }
  .foliage.right { right: max(0px, calc(50% - 640px)); }
  .gallery { grid-auto-columns: 400px; }
  /* Venue: the painting beside the details. */
  .ch-venue .frame { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 56px; align-items: center; max-width: 1080px; text-align: left; }
  .ch-venue .frame > * { grid-column: 2; justify-self: start; }
  .ch-venue .venue-art { grid-column: 1; grid-row: 1 / span 6; justify-self: stretch; width: 100%; margin: 0; }
  .ch-venue .venue-address { margin-inline: 0; }
}
/* Narrow tablets: ceremonies in two columns. */
@container (max-width: 760px) {
  .events > .event { flex-basis: calc((100% - var(--gap)) / 2); }
  .events > .event:nth-child(3n + 1)::before { display: block; }
  .events > .event:nth-child(2n + 1)::before { display: none; }
}
@media (max-width: 599px) { body { font-size: 16px; } }
@container (max-width: 599px) {
  .events { --gap: 40px; }
  .events > .event { flex-basis: min(100%, 340px); }
  .events > .event + .event::before, .events > .event:nth-child(n)::before {
    display: block; top: auto; bottom: 100%; right: auto; left: 50%; width: 0; height: var(--gap);
    border-top: 0; border-left: 2px dotted color-mix(in srgb, var(--gold) 65%, transparent);
  }
  .events > .event:first-child::before { display: none; }
  .families { grid-template-columns: 1fr; gap: 22px; }
  .cd-unit { min-width: 0; flex: 1; max-width: 72px; }
  .cd-unit b { font-size: 26px; }
  .ch--framed .frame { box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--frame-line); }
  /* On phones the welcome card runs edge to edge, like the first screen of the page. */
  .ch-welcome { padding: 0 0 20px; }
  .welcome-card { --card-w: 100cqi; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cover, .foil { transition: none; }
  .enter, .cover-stage img, .welcome-card.just-opened, .scroll-cue svg, .btn-open::after { animation: none; }
  [data-reveal] { opacity: 1; transform: none; clip-path: none; transition: none; }
  [data-loop] { animation: none; }
  .date-frame path { stroke-dashoffset: 0; transition: none; }
  .petals, .cover-dust, .burst { display: none; }
  .antarpat-cloth, .curtain-half, .fold-half, .glows i, .env-seal::after, .env-seal::before, .env, .env-seal, .env-actions, .env-hint, .cover-leaves, .env-tassel { animation: none; }
  .date-frame.is-scroll { transition: none; }
  .cover .scene, .cover-front img, .welcome-names b { animation: none !important; translate: none; }
  :is(.ch.has-scene, .welcome-card.has-scene) > .scene img { animation: none !important; translate: none; scale: none; }
  .akshata, .glows { display: none; }
  .photo-btn { rotate: 0deg; transition: none; }
  .welcome-card.is-arriving > * { animation: none; }
  .music-dock { animation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
