/* The Swaraj Saga: visual foundation (phone-first; spec §5.1–5.3, §8.3).
   Bengali display face: Noto Serif Bengali 700, upright (the couple's pick, 23 Nov; Galada before it), served as a
   text= subset of the display strings; the র্ন reph in স্বর্নাভ checked on WebKit at 360 and 430. If a string ever
   breaks, add its selector to the .display--safe rule. */

:root {
  /* Motion (motion pass spec §6): arrivals ease out strongly; travel eases in and out; sheets use the iOS drawer curve. */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-io: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --ivory: #FBF5EA;
  --blush: #F3DCD4;
  --sindoor: #B3121F;
  --maroon: #6B0F1A;
  --gold: #C9A24A;
  --gold-light: #E9C46A; /* the gate's glow: gold text that must read on velvet (>= 4.5:1) */
  --ink: #2B1A14;
  --ink-soft: #5A4036;
  --paper: #FFFCF5;
  --script: "Pinyon Script", "Cormorant Garamond", cursive;
  --pad: 20px;
  --fab-t: max(12px, env(safe-area-inset-top));
  /* iOS 26+ floats Safari's toolbar over the page bottom: 16px extra clearance. */
  --fab-b: calc(max(12px, env(safe-area-inset-bottom)) + 16px);
  /* wide screens: controls stay on the 480px column */
  --fab-r: max(12px, env(safe-area-inset-right), calc(50% - 228px));
  --fab-l: max(12px, env(safe-area-inset-left), calc(50% - 228px));
  --velvet: radial-gradient(120% 60% at 50% 0%, rgba(214, 60, 70, .28), transparent 70%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .13) 0, rgba(255, 255, 255, .03) 18px, rgba(0, 0, 0, .13) 36px),
    linear-gradient(#7c1220, #560b15);
}
/* Font roles per language (Task 7 sets <html lang>); lang="bn" islands keep Bengali fonts. English is Cormorant,
   sized up to Bengali's visual size. Tiro Bangla sets all Bengali text (polish 1: Noto Serif Bengali dropped). */
:root, :lang(bn) {
  --display: "Noto Serif Bengali", "Tiro Bangla", serif; /* upright and bold (the couple's pick, 23 Nov; was the slanted Galada) */
  --head: "Tiro Bangla", serif;
  --body: "Tiro Bangla", serif;
  --lh: 1.75;
  font-size-adjust: none;
}
:lang(en) {
  --display: "Cormorant Garamond", "Tiro Bangla", Georgia, serif;
  --head: "Cormorant Garamond", "Tiro Bangla", Georgia, serif;
  --body: "Cormorant Garamond", "Tiro Bangla", Georgia, serif;
  --lh: 1.5;
  font-size-adjust: .46;
}
/* A Latin run inside Bengali copy ("WhatsApp", the proposal; markup() in dict.js): read as English, set in the line's
   own face (Tiro Bangla's Latin), a touch smaller so its capitals don't stand taller than the Bengali mid-sentence. */
:lang(bn) > span[lang="en"] { font-size: .9em; font-size-adjust: inherit; }
.nowrap { white-space: nowrap; } /* a time range: markup() wraps it */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* focused controls and scrolled-to content land above the floating controls, not under them */
  scroll-padding-bottom: calc(var(--fab-b) + 64px);
  background: var(--maroon);
}
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 17px/var(--lh) var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { background: var(--ivory); }
h1, h2, h3, h4, p, figure, ul { margin: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
/* A feature whose module couldn't load or start: app.js marks its controls .off, so none is left doing nothing. */
.js-only.off { display: none !important; }
:focus-visible { outline: 3px solid var(--sindoor); outline-offset: 3px; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* == Type roles == */
.display { font-family: var(--display); font-weight: 400; font-synthesis: none; }
.display strong { font-weight: inherit; }
.display:lang(en) { font-family: var(--script); font-size-adjust: none; }
.script { font-family: var(--script); font-size-adjust: none; }
.display--safe { font-family: "Tiro Bangla", serif; }

/* The couple's SR logo (render.js; user, 22 Nov): gold and blush, lifted off its paper with its transparency. One image,
   sized by width. .logo-mark is the same shape as a flat colour (a CSS mask): pressed into the wax seal, inked on a stamp. */
.logo { display: block; flex: none; width: 150px; height: auto; margin-inline: auto; }
.logo-mark {
  display: block;
  aspect-ratio: 360 / 295;
  background: currentColor;
  -webkit-mask: url(../img/logo-sr.webp) center / contain no-repeat;
  mask: url(../img/logo-sr.webp) center / contain no-repeat;
}

/* == Sections == */
.sec {
  --bg: var(--ivory);
  position: relative;
  padding: 40px var(--pad) 64px;
  text-align: center;
  background: var(--bg);
}
/* লাল পাড়: a tant saree's red border (svg/par.svg, one woven repeat) sits on every seam, half on each section. */
.page + .page > .sec::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 0; right: 0; top: -10.5px;
  height: 21px;
  background: url(../svg/par.svg) 50% 0 / 10px 21px repeat-x;
  pointer-events: none;
}
.sec--invitation, .sec--date, .sec--venues { --bg: var(--blush); }
.sec--story { background: var(--velvet); background-color: var(--maroon); color: var(--ivory); } /* a solid base under the gradients */
/* Grounds (motion spec §7b): warm paper and maroon velvet alternate down the page, each with a faint gold alpona
   lattice (svg/alpona-lattice.svg carries its own 13% opacity); the paper also warms towards its edges. */
.ground--paper {
  background: url(../svg/alpona-lattice.svg) 0 0 / 72px,
    radial-gradient(140% 100% at 50% 45%, transparent 55%, rgba(201, 162, 74, .14)), var(--bg);
}
.ground--velvet { background: url(../svg/alpona-lattice.svg) 0 0 / 72px, var(--velvet); background-color: var(--maroon); color: var(--ivory); }
.sec--closing { background: var(--velvet); background-color: var(--maroon); color: var(--ivory); }

/* Stamp, title, divider: one compact block (about 176px with the section's top padding at 375px). */
/* Room for the display face's ascenders and vowel signs inside the title's own painted area (its ink-in paints through the text), set for good:
   padding and an equal negative margin leave the layout as it was, and a box that never changes cannot move the
   page through scroll anchoring; nor may a title be the anchor at all: its stamp, ink and divider animate as it
   arrives, and Chrome re-anchored on them, shifting the page ~15px (motion review, measured on the Pixel 7). */
.sec__title {
  overflow-anchor: none;
  padding-block: .2em;
  margin: -.2em 0 calc(20px - .2em);
  font: 400 40px/1.25 var(--display);
  color: var(--sindoor);
  text-wrap: balance;
}
.sec__title:lang(en) { font-weight: 600; font-size: 34px; }
.sec__title::before {
  content: "";
  display: block;
  width: 36px; height: 43px;
  margin: 0 auto 6px;
  background: var(--stamp) center / contain no-repeat;
  rotate: -5deg;
  filter: drop-shadow(0 2px 2px rgba(43, 26, 20, .2));
}
.sec__title::after {
  content: "";
  display: block;
  width: 150px; height: 15px;
  margin: 4px auto 0;
  background: url(../svg/divider.svg) center / contain no-repeat;
}
.sec--story .sec__title, .sec--closing .sec__title, .ground--velvet .sec__title { color: var(--gold); }
#invitation { --stamp: url(../svg/stamp-invitation.svg); }
#couple { --stamp: url(../svg/stamp-couple.svg); }
#date { --stamp: url(../svg/stamp-date.svg); }
#countdown { --stamp: url(../svg/stamp-countdown.svg); }
#story { --stamp: url(../svg/stamp-story.svg); }
#events { --stamp: url(../svg/stamp-events.svg); }
#venues { --stamp: url(../svg/stamp-venues.svg); }
#closing { --stamp: url(../svg/stamp-closing.svg); }

/* == Painting slots and their ornament stand-ins == */
.ornament-fallback, .hero__art img, .invitation__art img, .flip__face img, .chapter__frame img, .event__vignette img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* the stand-in, and the backdrop while a painting loads or if it fails */
  background: url(../svg/alpona-rosette.svg) center / 64% auto no-repeat,
    radial-gradient(circle, rgba(179, 18, 31, .13) 1.3px, transparent 1.8px) 0 0 / 16px 16px,
    radial-gradient(closest-side, var(--ivory), var(--blush));
}
/* 3:4 pat arch: portraits, chapters and the invitation's left page. */
.invitation__art, .flip, .chapter__frame { position: relative; aspect-ratio: 3 / 4; }
.invitation__art > *, .flip__face > :first-child, .chapter__frame > * {
  -webkit-mask: url(../svg/arch-mask.svg) 0 0 / 100% 100% no-repeat;
}
.invitation__art::after, .flip__face::after, .chapter__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url(../svg/arch-frame.svg) 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}

/* == 1 · Hero == */
.sec:focus { outline: none; } /* focused by script (gate lift, stamp jump) as a landing point, not a control */
.sec--hero {
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--fab-t) + 46px) var(--pad) calc(var(--fab-b) + 54px); /* room under the toran; the hint ends above the song chip's row */
  background: var(--maroon);
  color: var(--ivory);
}
.hero__art { position: absolute; inset: 0; z-index: -1; }
.hero__art > * { background-size: min(78%, 340px, 62vh) auto, 16px 16px, auto; background-position: 50% 36%, 0 0, 0 0; }
/* Slow zoom on the painting (never on the stand-in). A scaled element paints like a positioned one, so z-index -1
   keeps it under the scrim (::before) and the frame (::after). */
@media (prefers-reduced-motion: no-preference) {
  .hero__art img { position: relative; z-index: -1; transform-origin: 50% 30%; animation: hero-zoom 24s ease-in-out infinite alternate; }
}
@keyframes hero-zoom { to { scale: 1.08; } }
.hero__art::before { /* scrim: the bottom-anchored text block (~240px) always sits on >= .9, however short the hero */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(58, 6, 13, .97), rgba(74, 8, 16, .9) 260px, rgba(74, 8, 16, 0) 380px),
    linear-gradient(rgba(74, 8, 16, .86), rgba(74, 8, 16, .2) 22%, rgba(74, 8, 16, 0) 32%);
}
.hero__art::after {
  content: "";
  position: absolute;
  inset: max(10px, env(safe-area-inset-top)) 10px 10px;
  border: 34px solid transparent;
  border-image: url(../svg/alpona-frame.svg) 40 / 34px round;
  pointer-events: none;
}
.hero__eyebrow { margin-bottom: auto; font: 30px/1.4 var(--display); text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
/* English: gold invitation capitals (Cinzel Decorative, the couple's pick, 23 Nov); Bengali: the upright display face */
.hero__eyebrow:lang(en) { font: 700 25px/1.4 "Cinzel Decorative", "Cormorant Garamond", serif; letter-spacing: .1em; color: var(--gold-light); text-shadow: 0 2px 10px rgba(30, 0, 6, .55); }
/* A soft velvet pool behind the logo keeps its gold legible wherever the names' height puts it on the painting. */
.sec--hero .logo {
  width: 92px; /* with the one-line English names, the logo and words stay below the couple's faces (the couple's review, 23 Nov) */
  margin-bottom: 2px;
  background: radial-gradient(closest-side, rgba(58, 6, 13, .62), rgba(58, 6, 13, 0));
  filter: drop-shadow(0 1px 3px rgba(30, 0, 6, .6));
}
.hero__names {
  margin: 4px 0 2px;
  font-size: clamp(44px, 13.6vw, 60px);
  line-height: 1.3;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .4);
}
/* English: the names on one line, sized to the screen (two lines pushed the logo up over the faces on short screens) */
.hero__names:lang(en) { font-size: clamp(30px, 10.4vw, 46px); line-height: 1.25; white-space: nowrap; }
.hero__dates { font: 17px/1.6 var(--head); font-size: clamp(15.5px, 4.5vw, 17px); max-width: 20em; text-wrap: balance; } /* clear of the frame on a 360px phone */
.hero__tag { margin-top: 2px; font: 600 18px/1.4 "Cormorant Garamond", Georgia, serif; letter-spacing: .04em; color: var(--gold); }
.hero__scroll { margin-top: 14px; font: 13.5px/1.4 var(--body); opacity: .85; }
.hero__scroll::after {
  content: "";
  display: block;
  width: 9px; height: 9px;
  margin: 6px auto 0;
  border: solid var(--gold);
  border-width: 0 1.5px 1.5px 0;
  rotate: 45deg;
  animation: bob 2.4s ease-in-out 2; /* nudges twice, then rests */
}
@keyframes bob { 50% { translate: 0 5px; } }

/* == 2 · Invitation == */
.invitation__book { display: grid; justify-items: center; }
.invitation__art { width: 58%; max-width: 230px; margin-bottom: -44px; z-index: 1; filter: drop-shadow(0 10px 14px rgba(107, 15, 26, .28)); }
.letter {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 72px 30px 46px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(107, 15, 26, .08), 0 18px 36px -18px rgba(107, 15, 26, .35);
  font: 17px/1.95 var(--head);
  text-wrap: balance;
}
.letter::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 30px solid transparent;
  border-image: url(../svg/alpona-frame.svg) 40 / 30px round;
  pointer-events: none;
}
.letter > p:first-of-type { color: var(--sindoor); margin-bottom: .9em; }
.letter > p:first-of-type::before {
  content: "";
  display: block;
  width: 46px; height: 51px;
  margin: 0 auto 4px;
  background: url(../svg/ganesha.svg) center / contain no-repeat;
}
.letter .letter__names { margin: .25em 0 .3em; font-size: 40px; line-height: 1.4; color: var(--sindoor); }
.letter p:nth-last-child(-n+2) { color: var(--maroon); font-size: 19px; } /* sign-off */
.letter p:nth-last-child(2) { margin-top: 1em; }
.letter p:last-child { font-size: 21px; }

/* == 3 · Bride and groom == */
.couple__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@supports (grid-template-rows: subgrid) {
  .couple__grid { grid-template-rows: repeat(5, auto); }
  .person { display: grid; grid-row: span 5; grid-template-rows: subgrid; }
}
.flip {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
}
.scratch, .flip { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.flip__face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* visibility swaps at the half-turn too, so no WebKit layer can bleed through the hidden side */
  transition: transform .5s var(--ease-io), visibility 0s .25s, opacity .35s; /* the half-turn swaps the faces */
}
.flip__face > * { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.flip__back { transform: rotateY(180deg); visibility: hidden; }
.flip[aria-pressed="true"] .flip__front { transform: rotateY(-180deg); visibility: hidden; }
.flip[aria-pressed="true"] .flip__back { transform: rotateY(0); visibility: visible; }
.flip__label {
  position: absolute;
  left: 50%;
  bottom: 7%;
  z-index: 1;
  translate: -50% 0;
  padding: 1px 12px;
  border-radius: 999px;
  background: var(--sindoor);
  color: var(--ivory);
  font: 14px/1.7 var(--head);
  white-space: nowrap;
}
/* "ছোটবেলা দেখুন": the front face's tap hint, once the app runs (the back face answers with "ছোটবেলায়") */
.flip__hint {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 7%;
  z-index: 1;
  translate: -50% 0;
  padding: 1px 12px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--maroon);
  box-shadow: inset 0 0 0 1.5px var(--gold), 0 4px 10px -4px rgba(43, 8, 14, .45);
  font: 14.5px/1.75 var(--head);
  white-space: nowrap;
}
.app .flip:not(.off) .flip__hint { display: block; }
.person__side { margin-top: 16px; font: 15px/1.5 var(--head); color: var(--sindoor); }
/* A gold diamond each side, drawn into the text's own inline box (its end padding), so each stays with its word
   when the line wraps ("◆ The Groom's / Family ◆"), never alone on a line. */
.person__side > span {
  padding-inline: 19px;
  --dia: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 .5 7.5 4 4 7.5.5 4z' fill='%23C9A24A'/%3E%3C/svg%3E");
  background: var(--dia) 5px 55% / 7px 7px no-repeat, var(--dia) calc(100% - 5px) 55% / 7px 7px no-repeat;
}
.person__name { font: 400 19px/1.45 var(--head); color: var(--maroon); }
.sec--couple { padding-top: 62px; } /* room for the গাঁদা string */
.sec--couple .person__side, .sec--couple .person__name { color: var(--gold-light); }
.sec--couple .person__parents, .sec--couple .person__love { color: rgba(251, 245, 234, .92); }
.person--groom .person__side > span {
  padding-inline: 21px;
  background: url(../svg/motif-topor.svg) 3px 40% / 11px 15px no-repeat, url(../svg/motif-topor.svg) calc(100% - 3px) 40% / 11px 15px no-repeat;
}
.person--bride .person__side > span {
  padding-inline: 23px;
  background: url(../svg/motif-mukut.svg) 2px 45% / 15px 12px no-repeat, url(../svg/motif-mukut.svg) calc(100% - 2px) 45% / 15px 12px no-repeat;
}
.person__parents { margin-top: 6px; font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); text-wrap: balance; }
.person__love {
  margin-top: 12px;
  padding-top: 16px;
  font-size: 14.5px;
  line-height: 1.7;
  text-wrap: pretty;
  background: url(../svg/divider.svg) 50% 0 / 88px 9px no-repeat;
}

/* == 4 · The date == */
/* No wider than 280px, so a thumb flick beside it always scrolls; on it, a vertical swipe scrolls too (pan-y). */
.date__card {
  position: relative;
  max-width: 280px;
  margin: 0 auto;
  padding: 30px 18px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--gold), 0 16px 30px -16px rgba(107, 15, 26, .4);
}
.date__reveal { font: 22px/1.5 var(--head); color: var(--sindoor); text-wrap: balance; }
.date__line { display: block; }
.date__line + .date__line { margin-top: 4px; font-size: 19px; color: var(--maroon); }
.date__line:empty { display: none; } /* English has no মাঘ line */
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; touch-action: pan-y; }

/* == 5 · Countdown (needs the app to tick: four empty tiles otherwise) == */
/* Without the app the countdown can't tick: its title, label and clock hide, and the এক নজরে card (plain HTML,
   real links) stands on its own. */
html:not(.app) .sec--countdown > :not(.glance) { display: none; }
.countdown__label { font: 18px/1.5 var(--head); color: var(--ink-soft); }
/* The days are the moment: one large numeral; hours, minutes and seconds follow quietly on one line. */
.countdown__clock { margin: 0 0 30px; color: var(--maroon); }
.cd-days { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.cd-num { display: inline-block; }
.cd-num.is-rolling { animation: cd-roll .38s var(--ease-out) both; }
@keyframes cd-roll { from { opacity: 0; translate: 0 55%; } }
.cd-days .cd-num { min-width: 1ch; font: 400 clamp(56px, 18vw, 84px)/1.12 var(--head); font-size-adjust: none; }
.cd-days .cd-num:lang(en) { font-weight: 600; }
.cd-days .cd-label { font: 24px/1 var(--head); color: var(--sindoor); }
.cd-days .cd-label:lang(bn) { translate: 0 7px; } /* the audit: Bengali digits sit low on the baseline, so দিন rode ~8px high */
.cd-rest { font: 15.5px/1.6 var(--head); color: var(--ink-soft); }
.cd-rest .cd-num { display: inline-block; min-width: 1.2em; text-align: end; color: var(--maroon); } /* steady while ticking */
.cd-dot { display: inline-block; width: 4px; height: 4px; margin: 0 10px; rotate: 45deg; background: var(--gold); vertical-align: middle; }
.countdown__thanks { margin-bottom: 30px; font: 19px/1.7 var(--head); color: var(--maroon); }

/* এক নজরে: the practical heart, a calm paper card (the sheets' double gold rule) with the two answers people
   come back for. Time leads each row; a hairline divides them. */
.glance {
  max-width: 400px;
  margin: 0 auto 28px;
  padding: 22px 20px 4px;
  border-radius: 18px;
  background: var(--paper);
  text-align: start;
  box-shadow: inset 0 0 0 1.5px var(--gold), inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(201, 162, 74, .5), 0 14px 28px -18px rgba(107, 15, 26, .5);
}
.glance__title { font: 400 21px/1.45 var(--head); color: var(--maroon); text-align: center; }
.glance__title::after { content: ""; display: block; width: 120px; height: 12px; margin: 6px auto 0; background: url(../svg/divider.svg) center / contain no-repeat; }
.glance__list { padding: 0; list-style: none; }
.glance__row { padding: 16px 4px 18px; }
.glance__row + .glance__row { border-top: 1px solid rgba(201, 162, 74, .55); }
.glance__name { font: 400 19px/1.4 var(--head); color: var(--maroon); }
.glance__when { font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); }
.glance__time { margin-top: 4px; font: 28px/1.25 var(--head); color: var(--sindoor); white-space: nowrap; }
.glance__lagna { margin-top: 2px; font-size: 15.5px; line-height: 1.5; color: var(--ink-soft); }
.glance__where { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.glance__venue { flex: 1; font-size: 15.5px; line-height: 1.5; text-wrap: pretty; }
.glance__where .btn { flex: none; padding-inline: 14px; }
.glance__more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border-top: 1px solid rgba(201, 162, 74, .55);
  color: var(--sindoor);
  font: 15.5px/1.4 var(--head);
  text-decoration: underline;
  text-decoration-color: rgba(179, 18, 31, .35);
  text-underline-offset: 5px;
  -webkit-tap-highlight-color: transparent;
}
.glance__arrow { width: 8px; height: 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; rotate: 45deg; translate: 0 -3px; }

/* == Buttons == */
.btn, .story-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 46px;
  min-height: 46px;
  padding: 8px 18px;
  border: 1.5px solid var(--sindoor);
  border-radius: 999px;
  background: transparent;
  color: var(--sindoor);
  font: 15.5px/1.35 var(--head);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s, color .2s, scale 120ms var(--ease-out), translate 150ms var(--ease-out);
}
.btn:active { background: var(--sindoor); color: var(--ivory); }
@media (hover: hover) { .btn:hover { background: var(--sindoor); color: var(--ivory); } }
/* Press feedback (motion pass): every control answers the finger at once by shrinking a touch (.97, 120ms; the
   portrait card, which moves whole, .985). A mouse also lifts a button 1px. Reduced motion keeps only the colour. */
.glance__more, .fab--lang, .fab--music button, .dlg__x, .cal-opt, .flip { transition: scale 120ms var(--ease-out); }
.btn:active, .story-open:active, .glance__more:active, .fab--nav:active, .fab--lang:active, .fab--music button:active,
.dlg__x:active, .cal-opt:active { scale: .97; }
.flip:active { scale: .985; }
@media (hover: hover) and (pointer: fine) { .btn:hover, .story-open:hover { translate: 0 -1px; } }
.btn--cal-all { display: flex; width: fit-content; max-width: 100%; margin: 0 auto; padding: 10px 24px; background: var(--sindoor); color: var(--ivory); box-shadow: 0 8px 18px -10px rgba(179, 18, 31, .8); }
.sec--events > .btn--cal-all { margin: -4px auto 30px; }
/* Drawn icons in the button's own colour (the ✉ technique): a pin for maps, a calendar page for the calendar. */
.btn--map::before, .btn--cal::before {
  content: "";
  flex: none;
  width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: url(../svg/icon-pin.svg) center / contain no-repeat;
  mask: url(../svg/icon-pin.svg) center / contain no-repeat;
}
.btn--cal::before { -webkit-mask-image: url(../svg/icon-cal.svg); mask-image: url(../svg/icon-cal.svg); }

/* == 6 · Our story: framed paintings on a red wall == */
.chapters { display: grid; gap: 58px; counter-reset: ch; }
.chapter { counter-increment: ch; }
.chapter::before { /* hanging wire from a nail, tied to the frame's two corner rosettes */
  content: "";
  display: block;
  width: min(62.4%, 240px);
  height: 66px;
  margin: 0 auto -32px;
  background: radial-gradient(circle at 50% 3px, var(--gold) 2.5px, transparent 3px),
    linear-gradient(to bottom right, transparent calc(50% - .8px), rgba(201, 162, 74, .85) 50%, transparent calc(50% + .8px)) 0 0 / 50% 100% no-repeat,
    linear-gradient(to bottom left, transparent calc(50% - .8px), rgba(201, 162, 74, .85) 50%, transparent calc(50% + .8px)) 100% 0 / 50% 100% no-repeat;
}
.chapter__frame { width: min(78%, 300px); margin: 0 auto; filter: drop-shadow(0 16px 14px rgba(20, 0, 4, .45)); rotate: -1.2deg; }
.chapter:nth-child(even) .chapter__frame { rotate: 1.2deg; }
.chapter__frame::before { /* chapter number medallion */
  content: counter(ch, bengali);
  position: absolute;
  left: 50%;
  bottom: -15px;
  z-index: 1;
  translate: -50% 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--maroon);
  box-shadow: 0 0 0 2px var(--gold);
  color: var(--ivory);
  font: 17px/34px var(--head);
}
.chapter__frame:lang(en)::before { content: counter(ch); font-variant-numeric: lining-nums; } /* the audit: old-style 1 read as I, 3 4 5 7 sat low */
.chapter figcaption { margin-top: 30px; }
.chapter__title { font: 400 22px/1.4 var(--head); }
.chapter__caption { max-width: 30em; margin: 6px auto 0; font-size: 15.5px; line-height: 1.75; color: rgba(251, 245, 234, .92); text-wrap: pretty; }
.story-open { display: flex; margin: 52px auto 0; padding: 10px 26px; border: 0; background: var(--ivory); color: var(--maroon); font-size: 17px; box-shadow: 0 0 0 2px var(--gold), 0 0 0 6px rgba(201, 162, 74, .3); }
.sec--story :focus-visible, .sec--closing :focus-visible, .spotlight :focus-visible { outline-color: var(--gold); }

#story-letter {
  width: min(92vw, 440px);
  max-height: 84vh;
  max-height: min(84svh, calc(100svh - 2 * var(--fab-b) - 32px)); /* centred: clear of iOS 26's bottom toolbar */
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--gold), 0 30px 80px rgba(0, 0, 0, .5);
  overflow: hidden;
}
#story-letter[open] { display: flex; flex-direction: column; }
.story-letter__text { overflow-y: auto; overscroll-behavior: contain; padding: 30px 24px 12px; text-align: start; font-size: 16.5px; line-height: 1.85; }
.story-letter__text p + p { margin-top: 1.1em; }
.story-letter__title { flex: none; padding: 22px 50px 2px; font-size: 28px; line-height: 1.35; color: var(--sindoor); text-align: center; text-wrap: balance; }
.story-letter__title::after { content: ""; display: block; width: 150px; height: 14px; margin: 6px auto 0; background: url(../svg/divider.svg) center / contain no-repeat; }
.story-letter__text .story-letter__sign { margin-top: 1.4em; font-size: 30px; line-height: 1.4; text-align: end; color: var(--sindoor); }
#story-letter form { flex: none; padding: 12px; border-top: 1px solid rgba(201, 162, 74, .6); text-align: center; }

/* == 7 · Events: arched cards, grouped by day on a thin gold timeline == */
/* The rail runs down the left gutter, beside the cards (they keep their full width); each day is a dot on it. */
.events__list { position: relative; }
.events__list::before {
  content: "";
  position: absolute;
  left: calc(var(--pad) / -2);
  top: 14px; bottom: 0;
  width: 1px;
  background: linear-gradient(var(--gold) 0 calc(100% - 120px), rgba(201, 162, 74, 0));
}
.day + .day { margin-top: 34px; }
.day__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-left: 4px;
  font: 17px/1.5 var(--head);
  color: var(--maroon);
  text-align: start;
}
.day__head::before { /* the day's dot, on the rail */
  content: "";
  position: absolute;
  left: calc(var(--pad) / -2 - 4px);
  top: calc(.75em + 1px);
  width: 9px; height: 9px;
  translate: 0 -50%;
  border-radius: 50%;
  background: var(--sindoor);
  box-shadow: 0 0 0 2.5px var(--ivory), 0 0 0 3.5px var(--gold);
}
.day__head::after { content: ""; flex: 1; min-width: 16px; height: 1px; background: linear-gradient(90deg, rgba(201, 162, 74, .85), rgba(201, 162, 74, 0)); }
.day__events { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 10px; }
.event {
  position: relative;
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 20px 20px;
  border-radius: 50% 50% 14px 14px / 92px 92px 14px 14px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--gold), 0 12px 26px -16px rgba(107, 15, 26, .5);
}
.event::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(179, 18, 31, .35);
  border-radius: inherit;
  pointer-events: none;
}
/* The two families' versions of one ritual sit side by side (stacked only below 360px). */
.event[data-pair] { grid-column: auto; padding: 22px 10px 14px; border-radius: 50% 50% 12px 12px / 64px 64px 12px 12px; }
@media (max-width: 359px) { .event[data-pair] { grid-column: 1 / -1; } }
.event__vignette {
  position: relative;
  isolation: isolate; /* its alpona ring (::before, below) sits behind the picture, above the card */
  width: 108px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--gold);
}
.event__vignette > img { border-radius: 50%; } /* the picture is clipped round itself, so the ring can reach outside it */
.event[data-pair] .event__vignette { width: 84px; }
.event__tag { margin: 18px 0 8px; padding: 1px 12px; border-radius: 999px; font: 13.5px/1.75 var(--head); }
.event--kanya .event__tag { background: var(--sindoor); color: var(--ivory); }
.event--bor .event__tag { box-shadow: inset 0 0 0 1.5px var(--maroon); color: var(--maroon); }
.event--boubhat .event__tag { background: var(--gold); color: var(--ink); }
.event__name { font: 400 23px/1.4 var(--head); color: var(--maroon); }
.event[data-pair] .event__name { font-size: 19px; }
.event__time { margin-top: 2px; font: 20px/1.5 var(--head); color: var(--sindoor); white-space: nowrap; }
.event__venue { margin-top: 6px; font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); text-wrap: balance; }
.event__yellow { margin-top: 10px; padding: 3px 12px; border-radius: 14px; text-wrap: balance; background: rgba(230, 170, 20, .2); font: 14px/1.7 var(--head); }
.event__yellow::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-inline-end: 7px; border-radius: 50%; background: #E3A51A; vertical-align: 1px; }
.event__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; margin-top: auto; padding-top: 16px; }
.event__actions .btn { flex: 1 1 auto; padding-inline: 14px; white-space: nowrap; }
.event[data-pair] .event__actions { flex-direction: column; }
.event[data-pair] .btn { padding-inline: 10px; }

.event.spotlight { margin-block: 12px; padding: 34px 22px 26px; background: var(--velvet); background-color: var(--maroon); color: var(--ivory); box-shadow: inset 0 0 0 2px var(--gold), 0 18px 34px -16px rgba(60, 4, 12, .8); }
.spotlight::before { border-color: rgba(201, 162, 74, .7); }
.spotlight .event__vignette { width: 148px; box-shadow: 0 0 0 3px #6d0f1b, 0 0 0 5px var(--gold); }
.spotlight .event__tag { box-shadow: inset 0 0 0 1px var(--gold); }
.spotlight .event__name { font: 400 46px/1.35 var(--display); color: var(--gold); }
.spotlight .event__name:lang(en) { font-size: 34px; }
.spotlight .event__when { margin-top: 2px; font: 16.5px/1.5 var(--head); color: var(--blush); text-wrap: balance; }
.spotlight .event__time { font-size: 30px; color: var(--ivory); }
.spotlight .event__lagna { margin-top: 8px; padding: 6px 18px; border-block: 1px solid rgba(201, 162, 74, .8); font: 16.5px/1.55 var(--head); }
.spotlight .event__venue { color: rgba(251, 245, 234, .88); }
.spotlight .btn { border-color: var(--gold); color: var(--ivory); }
.spotlight .btn:active { background: var(--gold); color: var(--ink); }
@media (hover: hover) { .spotlight .btn:hover { background: var(--gold); color: var(--ink); } }

/* == 8 · Venues: addressed like envelopes == */
.sec--venues .venue { color: var(--ink); box-shadow: 0 16px 30px -16px rgba(20, 0, 4, .75); } /* a paper card on the velvet: its own ink, lifted off */
.venue {
  position: relative;
  max-width: 420px;
  margin: 0 auto 22px;
  padding: 28px 22px 22px;
  border-radius: 6px;
  background: var(--paper);
  text-align: start;
  box-shadow: 0 12px 26px -18px rgba(107, 15, 26, .55);
  overflow: hidden;
}
.venue::before { /* airmail edge */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--sindoor) 0 9px, transparent 9px 14px, var(--gold) 14px 23px, transparent 23px 28px);
}
.venue__tag { padding-right: 34px; font: 19px/1.45 var(--head); color: var(--sindoor); } /* room for the pin */
.venue__address { margin-top: 4px; font-size: 16px; line-height: 1.7; text-wrap: balance; }
.venue__events {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin: 14px 0 18px;
  padding: 12px 0 0;
  border-top: 1px dashed rgba(201, 162, 74, .9);
  list-style: none;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.venue__events li::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 8px; rotate: 45deg; background: var(--gold); vertical-align: 2px; }
.venue .btn { width: 100%; }

/* == 9 · Closing == */
.sec--closing { padding-bottom: calc(var(--fab-b) + 84px); }
.closing__note { max-width: 30em; margin: 0 auto; font-size: 17px; line-height: 1.75; text-wrap: pretty; }
.closing__names { margin-top: 26px; font-size: 48px; line-height: 1.35; color: var(--gold); }
.closing__names-en { font-size: 34px; line-height: 1.4; }
.closing__dates { margin-top: 12px; font: 16px/1.6 var(--head); }
.closing__tag { margin-top: 4px; font: 600 18px/1.4 "Cormorant Garamond", Georgia, serif; letter-spacing: .04em; color: var(--gold-light); }
/* The page ends as it began: on the logo, large, with the site's name and "made with love" signed beneath. */
.closing__seal { margin-top: 33px; } /* room for the thread's circle above the logo */ /* measured: a stamp jump lands every line clear of the controls on all four test phones */
.closing__seal .logo { width: 96px; } /* measured: clear of the ♪ and the English "Sections" pill after a stamp jump on the 375x667 iPhone SE */
.closing__site { margin-top: 12px; font: 600 17px/1.4 "Cormorant Garamond", Georgia, serif; letter-spacing: .03em; color: var(--gold-light); }
.closing__love { margin-top: 2px; font-size: 14px; opacity: .85; }

/* == Floating controls (always inside the safe area; never moved by scroll handlers) == */
.fab { position: fixed; z-index: 40; }
.fab--lang {
  z-index: 50; /* above the gate: the language can be switched before the tap */
  top: var(--fab-t);
  right: var(--fab-r);
  min-width: 52px;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(251, 245, 234, .94);
  color: var(--maroon);
  box-shadow: 0 0 0 1.5px var(--gold), 0 6px 16px rgba(43, 8, 14, .25);
  font: 600 16px/1 "Cormorant Garamond", "Tiro Bangla", serif;
  letter-spacing: .06em;
  cursor: pointer;
}
/* The section menu: a labelled pill (envelope + সূচি). Out of the way while the hero holds the screen (nav.js adds
   .is-on once it has scrolled past); keyboard focus shows it regardless. */
.fab--nav {
  bottom: var(--fab-b);
  right: var(--fab-r);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px 0 16px;
  border: 0;
  border-radius: 999px;
  background: radial-gradient(120% 150% at 35% 20%, #cc2533, var(--sindoor) 55%, #8b0e18);
  color: var(--ivory);
  box-shadow: 0 0 0 2px var(--ivory), 0 0 0 3.5px var(--gold), 0 8px 18px rgba(43, 8, 14, .4);
  font: 16px/1 var(--head);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease-out, scale 120ms var(--ease-out);
}
.fab--nav:lang(en) { padding-inline: 14px 16px; font-size: 15px; } /* "Sections" is twice as long as সূচি */
.fab--nav.is-on, .fab--nav:focus-visible { opacity: 1; pointer-events: auto; }
.fab--nav::before { /* drawn envelope: the ✉ glyph turns into a colour emoji on iOS */
  content: "";
  flex: none;
  width: 20px; height: 15px;
  background: currentColor;
  -webkit-mask: url(../svg/envelope.svg) center / contain no-repeat;
  mask: url(../svg/envelope.svg) center / contain no-repeat;
}
/* Music: one mute button, always there (the hero too), so sound can be stopped at once. */
.fab--music {
  bottom: calc(var(--fab-b) + 1px);
  left: var(--fab-l);
  display: flex;
  border-radius: 999px;
  background: rgba(251, 245, 234, .94);
  box-shadow: 0 0 0 1.5px var(--gold), 0 6px 16px rgba(43, 8, 14, .25);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.fab--music button {
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--maroon);
  font-size: 20px;
  cursor: pointer;
}
.fab button, button.fab { -webkit-tap-highlight-color: transparent; }
.fab:focus-visible, .fab :focus-visible { outline: 3px solid var(--sindoor); outline-offset: 3px; box-shadow: 0 0 0 3px var(--ivory); }
/* music states: muted (struck note), and "▶ tap to resume" (the only button) */
.music-mute { position: relative; }
.music-mute[aria-pressed="true"] { color: var(--ink-soft); }
.music-mute[aria-pressed="true"]::after { content: ""; position: absolute; inset: 21px 10px; border-radius: 1px; background: var(--sindoor); rotate: -45deg; }
.fab--music.is-stalled > :not(.music-resume) { display: none; }
.fab--music .music-resume { width: auto; padding: 0 16px; border-radius: 999px; background: var(--sindoor); color: var(--ivory); font: 15px/1.2 var(--head); white-space: nowrap; }

/* == 0 · The gate (gate.js mounts it; it is never in the static HTML) == */
/* Velvet covers the page until gate.js mounts the gate, so the hero never flashes first. If JS never arrives,
   the cover lifts itself after 4s and the page reads as plain HTML. */
.js:not(.gated) body::after { content: ""; position: fixed; inset: 0; z-index: 45; background: var(--velvet); animation: cover-off 0s 4s forwards; }
@keyframes cover-off { to { visibility: hidden; } }
.gate-on { overflow: hidden; }
.gate {
  position: fixed;
  inset: 0;
  z-index: 45;
  overflow: hidden;
  background: radial-gradient(closest-side, rgba(233, 196, 106, .3), rgba(201, 162, 74, .08) 60%, transparent) 50% 44% / 150vmin 150vmin no-repeat, var(--velvet);
  background-color: var(--maroon);
  color: var(--ivory);
  text-align: center;
  touch-action: none;
  overscroll-behavior: none;
}
.gate__open { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gate__open:focus-visible { outline: none; }
.gate__open:focus-visible .gate__tap { outline: 2px solid var(--gold); outline-offset: 4px; }
/* The pair of leaves, held together like শুভদৃষ্টি: one painted leaf (tip up, 2:3, leaf in its middle 70%), the right one
   mirrored, overlapping at the centre and fanning out from the stems. Each turns about its own stem's end. The
   image's corner sparkle (Google Flow's AI mark) stays in view, below the lobes and above the tap prompt. */
.gate__leaf {
  position: absolute;
  top: 45%;
  height: min(80vh, 160vw);
  height: min(80svh, 160vw); /* same reference as the fixed gate it is positioned in (iOS <= 18 vh is the large viewport) */
  aspect-ratio: 2 / 3;
  filter: drop-shadow(0 20px 24px rgba(25, 0, 6, .55));
  will-change: transform;
}
.gate__leaf img { width: 100%; height: 100%; }
.gate__leaf--l { right: 50%; translate: 23% -50%; transform-origin: 47% 89%; transform: rotate(-4deg); }
.gate__leaf--r { left: 50%; translate: -23% -50%; transform-origin: 53% 89%; transform: rotate(4deg); }
.gate__leaf--r img { scale: -1 1; }
.gate__tap {
  position: absolute;
  left: 50%;
  bottom: calc(var(--fab-b) + 14px);
  translate: -50% 0;
  padding: 0 12px;
  white-space: nowrap;
  font-size: 29px;
  line-height: 1.45;
  color: var(--ivory);
  text-shadow: 0 2px 12px rgba(30, 0, 6, .6);
  animation: breathe 2.8s ease-in-out infinite;
}
.gate__tap::before { content: ""; display: block; width: 150px; height: 15px; margin: 0 auto 4px; background: url(../svg/divider.svg) center / contain no-repeat; }
.is-opening .gate__tap { animation: none; } /* let GSAP own its opacity */
/* iPhones: the silent-mode hint, one quiet line under the prompt (which steps up to make room). Taps pass through. */
.gate--hint .gate__tap { bottom: calc(var(--fab-b) + 26px); }
.gate__hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--fab-b) - 4px);
  width: max-content;
  max-width: calc(100% - 48px);
  translate: -50% 0;
  font: 14.5px/1.5 var(--body);
  color: var(--blush);
  opacity: .85;
  text-align: center;
  text-wrap: balance;
  pointer-events: none;
}
@keyframes breathe { 50% { opacity: .66; } }
.gate__reveal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--fab-t) var(--pad) 8vh; }
.gate__reveal > * { opacity: 0; }
.gate__frame { /* the hero's alpona frame, so the reveal hands over to the hero beneath it */
  position: absolute;
  inset: max(10px, env(safe-area-inset-top)) 10px 10px;
  border: 34px solid transparent;
  border-image: url(../svg/alpona-frame.svg) 40 / 34px round;
}
.gate__ganesha { width: min(136px, 36vw); height: auto; filter: drop-shadow(0 0 16px rgba(233, 196, 106, .45)); }
.gate__bless { margin-top: 18px; font-size: 21px; line-height: 1.5; color: var(--blush); }
.gate__names { margin-top: 14px; font-size: clamp(46px, 14vw, 64px); line-height: 1.3; color: var(--gold); text-shadow: 0 3px 18px rgba(30, 0, 6, .45); }
.gate__names::after { content: ""; display: block; width: 180px; height: 18px; margin: 12px auto 0; background: url(../svg/divider.svg) center / contain no-repeat; }
/* No GSAP: plain fades */
.gate--fade .gate__open, .gate--fade .gate__hint { opacity: 0; transition: opacity .9s; }
.gate--fade .gate__reveal > * { opacity: 1; transition: opacity 1.2s .6s; }
.gate--fade { opacity: 0; transition: opacity 1s 3.4s; }

/* == Tablet and desktop: the phone column on velvet with alpona side panels == */
@media (min-width: 520px) {
  body { background: var(--velvet); background-color: var(--maroon); background-attachment: fixed; }
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url(../svg/alpona-rosette.svg) 0 0 / 150px 150px;
    opacity: .14;
    pointer-events: none;
  }
  main { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; box-shadow: 0 0 0 1px rgba(201, 162, 74, .6), 0 0 70px rgba(0, 0, 0, .55); }
}

/* == Reduce motion: no animation, no movement (end events still fire); the flip becomes a crossfade == */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .flip__face { transform: none !important; visibility: visible !important; transition: opacity .35s ease !important; }
  :active { scale: none !important; translate: none !important; } /* press feedback is the colour change alone */
  .flip__back, .flip[aria-pressed="true"] .flip__front { opacity: 0; }
  .flip[aria-pressed="true"] .flip__back { opacity: 1; }
}

/* == Scratch card + reveal (Task 9) == */
.scratch__hint { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font: 600 20px/1 var(--head); color: var(--maroon); text-shadow: 0 1px 0 rgba(255, 255, 255, .5); transition: opacity .3s ease-out; }
.scratch--started .scratch__hint { opacity: 0; } /* the prompt steps aside once the guest starts rubbing */
.scratch__reveal { display: block; margin: 14px auto 0; }
/* The foil's sheen: a light band whose opacity breathes (compositor-only), over the foil until scratching starts. */
.scratch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 28%, rgba(255, 249, 228, .5) 46%, rgba(255, 249, 228, .15) 54%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}
/* While the card is on screen (ornaments.js), the light band sweeps across the foil, rests a moment, and sweeps again
   (the couple's review, 23 Nov). The first stroke stops it for good: these selectors outrank .is-sheen. */
.scratch.is-sheen::after { opacity: 1; background-size: 250% 100%; background-repeat: no-repeat; animation: sheen 2.4s ease-in-out infinite both; }
.scratch.scratch--started::after, .scratch.scratch--done::after { animation: none; opacity: 0; }
@keyframes sheen { 0% { background-position: 130% 0; } 55%, 100% { background-position: -30% 0; } }
.date__reveal.is-revealed { animation: date-settle .5s var(--ease-out) both; }
@keyframes date-settle { from { opacity: .5; scale: .96; } }
.petal-burst { position: absolute; left: 50%; top: 50%; width: 10px; height: 14px; border-radius: 80% 0 80% 0; background: var(--sindoor); pointer-events: none; animation: petal 1.1s ease-out forwards; }
@keyframes petal { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .scratch::after { animation: none; } }

/* == Task 10: sheets (calendar menu, stamp menu), the envelope, petals == */
.modal-open { overflow: hidden; } /* the page can't scroll behind an open sheet or letter */
dialog:not([open]) { display: none; } /* browsers without <dialog> */
/* Bottom sheets: inside the safe area, clear of iOS 26's floating toolbar; the body scrolls, the frame stays. */
.sheet {
  width: min(calc(100% - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)), 420px);
  max-width: none;
  max-height: calc(100% - var(--fab-t) - var(--fab-b) - 12px);
  margin: auto auto var(--fab-b);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--gold), inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(201, 162, 74, .5), 0 26px 60px rgba(30, 0, 6, .45);
  overflow: hidden;
  text-align: center;
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop, #story-letter::backdrop { background: rgba(43, 8, 14, .66); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sheet[open], #story-letter[open] { animation: sheet-in .34s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { opacity: 0; translate: 0 18px; } }
/* The সূচি sheet grows out of the সূচি button's corner (bottom right) on the iOS drawer curve. */
.stamp-sheet[open] { transform-origin: 100% 100%; animation: sheet-grow .32s var(--ease-drawer); }
@keyframes sheet-grow { from { opacity: 0; scale: .96; } }
@media (min-width: 520px) { .sheet { margin: auto; } }
.sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 22px 20px 20px; }
.sheet__title { margin: 0 36px 14px; font: 400 21px/1.45 var(--head); color: var(--maroon); text-wrap: balance; }
.sheet__title::after { content: ""; display: block; width: 120px; height: 12px; margin: 8px auto 0; background: url(../svg/divider.svg) center / contain no-repeat; }
.sheet__eyebrow { display: block; font-size: 14px; color: var(--sindoor); }
.sheet__title:focus, .story-letter__title:focus { outline: none; } /* focused on opening, as a landing point */
.dlg__x {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 1;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  /* the audit (23 Nov): drawn, so it sits dead centre (the glyph sat low), on an ivory disc the list slides under */
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B0F1A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 0 0 1px rgba(201, 162, 74, .55), 0 6px 14px -6px rgba(60, 4, 12, .45);
  color: var(--maroon);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dlg__x > span { display: none; } /* the ✕ glyph: the drawing replaces it; the button keeps its label */
.dlg__x:active { background-color: #F1E2D6; }
/* <dialog> without showModal(): the `open` attribute plus this overlay */
.dlg--fallback {
  position: fixed;
  inset: 0;
  z-index: 60;
  height: -webkit-fit-content;
  height: fit-content;
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 100vmax rgba(43, 8, 14, .7);
}
#story-letter.dlg--fallback { margin: auto; }

/* Calendar options: the phone's own route first (filled), the other one tap away. */
.cal-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  margin-top: 10px;
  padding: 8px 18px;
  border: 1.5px solid var(--sindoor);
  border-radius: 16px;
  color: var(--sindoor);
  font: 16px/1.4 var(--head);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.cal-opt--first { background: var(--sindoor); color: var(--ivory); box-shadow: 0 8px 18px -10px rgba(179, 18, 31, .8); }
.cal-opt:active { background: var(--maroon); color: var(--ivory); }
.cal-opt__sub { font-size: 13.5px; line-height: 1.45; opacity: .82; }
.cal-opt--each { margin-top: 8px; padding: 7px 52px 7px 16px; text-align: start; color: var(--maroon); border-color: rgba(179, 18, 31, .55); }
.cal-opt--each::after { /* + until tapped, then a tick: drawn, so they sit dead centre whatever the font (a glyph sat low) */
  content: "";
  position: absolute;
  right: 12px; top: 50%;
  translate: 0 -50%;
  width: 28px; height: 28px;
  box-sizing: border-box;
  border: 1.5px solid var(--sindoor);
  border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B3121F' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 6.5v11M6.5 12h11'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.cal-opt--each.is-added::after { background: var(--sindoor) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FBF5EA' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.8 12.4l3.4 3.4 7-7.4'/%3E%3C/svg%3E") center / 100% no-repeat; }
.cal-opt__name { font-size: 16px; }
.cal-menu__note { margin: 0 4px 2px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.cal-menu__or { display: flex; align-items: center; gap: 12px; margin: 16px 8px 2px; font-size: 14px; color: var(--ink-soft); }
.cal-menu__or::before, .cal-menu__or::after { content: ""; flex: 1; height: 1px; background: rgba(201, 162, 74, .8); }
.cal-menu__or + .cal-menu__note { margin-top: 8px; }
/* iPhone "add all": the 9 Google rows wait, folded, behind one row; the Apple file stays the one clear choice. */
.cal-more { margin-top: 10px; }
.cal-more > summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 8px 48px 8px 18px;
  border: 1.5px solid rgba(179, 18, 31, .55);
  border-radius: 16px;
  color: var(--maroon);
  font: 16px/1.4 var(--head);
  text-align: start;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cal-more > summary::-webkit-details-marker { display: none; }
.cal-more > summary::after { /* chevron: down when folded, up when open */
  content: "";
  position: absolute;
  right: 22px; top: 50%;
  width: 9px; height: 9px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  translate: 0 -70%;
  rotate: 45deg;
  transition: rotate .25s, translate .25s;
}
.cal-more[open] > summary::after { translate: 0 -25%; rotate: 225deg; }
.cal-more > .cal-menu__note { margin-top: 12px; }

/* The stamp menu: the two most-asked jumps, then an album page of postage stamps (the current section's stamp is
   postmarked), then the song. */
.quicks { display: flex; gap: 10px; margin: 0 2px 12px; }
.quicks .btn { flex: 1; padding-inline: 10px; font-size: 16px; }
.music-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 4px 0;
  padding-top: 14px;
  border-top: 1px solid rgba(201, 162, 74, .6);
  text-align: start;
}
.music-row__now { font: 15.5px/1.45 var(--head); color: var(--ink-soft); }
.music-row__song { color: var(--maroon); }
.music-row .btn { flex: none; }
.stamps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 6px; }
.stamp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 2px 8px;
  border-radius: 14px;
  color: var(--maroon);
  font: 14px/1.35 var(--head);
  text-decoration: none;
  text-wrap: balance;
  -webkit-tap-highlight-color: transparent;
}
.stamp img { width: 52px; height: auto; rotate: -4deg; filter: drop-shadow(0 2px 2px rgba(43, 26, 20, .25)); transition: rotate .25s, scale .25s; }
.stamp:nth-child(even) img { rotate: 3deg; }
.stamp:active img { scale: .93; }
.stamp[aria-current] { background: rgba(179, 18, 31, .07); color: var(--sindoor); }
.stamp[aria-current] img { rotate: 0deg; scale: 1.06; }
/* The current stamp is cancelled: the logo struck over its corner in maroon ink, trailed by three wavy lines. */
.stamp .logo-mark { display: none; }
.stamp[aria-current] .logo-mark {
  width: 46px;
  display: block;
  position: absolute;
  z-index: 1;
  top: -3px; right: calc(50% - 51px);
  color: rgba(107, 15, 26, .78);
  rotate: -12deg;
}
.stamp[aria-current]::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 9px; right: calc(50% - 14px);
  width: 40px; height: 15px;
  background: url(../svg/cancel.svg) center / contain no-repeat;
  opacity: .7;
  rotate: -12deg;
}
@media (prefers-reduced-motion: no-preference) {
  .stamp-sheet[open] .stamp { animation: stamp-in .42s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i) * 28ms + 60ms); }
}
@keyframes stamp-in { from { opacity: 0; translate: 0 10px; } }

/* == 2 · The envelope with its alpona seal (motion.js adds it while the card is folded, then removes it) == */
.invitation__book { position: relative; }
.envelope {
  position: absolute;
  z-index: 3;
  top: 30px; left: 50%;
  width: min(82%, 300px);
  aspect-ratio: 3 / 2;
  translate: -50% 0;
  border-radius: 6px;
  background: linear-gradient(165deg, #9a1826, var(--maroon) 72%);
  box-shadow: inset 0 0 0 1.5px var(--gold), inset 0 0 0 6px rgba(201, 162, 74, 0), inset 0 0 0 7px rgba(201, 162, 74, .4), 0 22px 34px -16px rgba(60, 4, 12, .75);
  perspective: 700px;
  pointer-events: none;
}
.envelope::before { /* the bottom fold: two creases rising from the corners */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, transparent calc(50% - .7px), rgba(201, 162, 74, .7) 50%, transparent calc(50% + .7px)) 0 100% / 50% 62% no-repeat,
    linear-gradient(to top left, transparent calc(50% - .7px), rgba(201, 162, 74, .7) 50%, transparent calc(50% + .7px)) 100% 100% / 50% 62% no-repeat;
}
.envelope__flap { position: absolute; inset: 0 0 auto; height: 62%; transform-origin: 50% 0; background: var(--gold); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.envelope__flap::before { content: ""; position: absolute; inset: 0 3px 3.5px; background: linear-gradient(#ad1d2c, #7c1220); clip-path: polygon(0 0, 100% 0, 50% 100%); }
/* Sindoor wax, pooled a little unevenly past the die; the logo is pressed into it (dark in the hollow, a lit lower lip). */
.envelope__seal {
  position: absolute;
  z-index: 1;
  left: 50%; top: 62%;
  display: grid;
  place-items: center;
  width: 74px;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 47% 53% 49% 51% / 53% 47% 52% 48%;
  background: radial-gradient(circle at 36% 30%, #e24751, var(--sindoor) 44%, #860b16);
  box-shadow: inset 0 2px 2px rgba(255, 196, 186, .45), inset 0 -3px 5px rgba(50, 0, 6, .45), 0 6px 14px rgba(30, 0, 6, .55);
}
.envelope__seal .logo-mark {
  width: 60px;
  color: rgba(74, 2, 10, .66);
  filter: drop-shadow(0 1px 0 rgba(255, 176, 166, .45));
}

/* == Petals (hero, story, closing; at most 12): on the page column, never in the way of a tap == */
.petal-layer { position: fixed; z-index: 30; top: 0; bottom: 0; left: 50%; width: min(100%, 480px); translate: -50% 0; overflow: hidden; pointer-events: none; }
.petal { position: absolute; left: 0; top: 0; width: 11px; height: 15px; border-radius: 85% 0 85% 0; will-change: transform; }
.petal--rose { background: linear-gradient(135deg, #e5566a, #a3101e); }
.petal--marigold { width: 10px; height: 12px; border-radius: 60% 60% 50% 50% / 70% 70% 30% 30%; background: radial-gradient(circle at 35% 30%, #ffcf5c, #e8861a 75%); }

/* == Bengali wedding motifs (motion spec §7b): line art in the empty areas, never on text == */
.motif { display: block; flex: none; pointer-events: none; background: center / contain no-repeat; }
.motif--mangal-ghat { position: absolute; top: 46px; width: 38px; height: 46px; background-image: url(../svg/motif-mangal-ghat.svg); }
.motif--tl { left: 12px; }
.motif--tr { right: 12px; }
.motif--prajapati { width: 56px; height: auto; margin: 0 auto 8px; overflow: visible; }
.motif--garland { position: absolute; top: 13px; left: 0; right: 0; height: 36px; background: url(../svg/motif-garland.svg) 50% 0 / 124px 35px repeat-x; }
.date__card .motif--shankh { position: absolute; top: 50%; width: 26px; height: 38px; margin-top: -19px; background-image: url(../svg/motif-shankh.svg); }
.date__card .motif--l { left: -34px; rotate: -10deg; } /* measured: tilted, still inside a 360px screen */
.date__card .motif--r { right: -34px; rotate: 10deg; scale: -1 1; }
/* মাছ জোড়া: the two fish are the two halves of one picture, so each can swim on its own */
.motif--fish-pair { position: relative; width: 88px; height: 34px; margin: 0 auto 24px; } /* clear of the English numerals, which sit lower */
.motif--fish-pair::before, .motif--fish-pair::after { content: ""; position: absolute; top: 0; bottom: 0; width: 50%; background: url(../svg/motif-fish-pair.svg) 0 0 / 88px 34px no-repeat; }
.motif--fish-pair::before { left: 0; }
.motif--fish-pair::after { right: 0; background-position: 100% 0; }
.day { position: relative; }
.day__head { padding-right: 58px; }
.day > .motif { position: absolute; right: 2px; top: 0; height: 27px; }
.day > .motif--tabla { width: 37px; background-image: url(../svg/motif-tabla.svg); }
.day > .motif--mangal-ghat { width: 23px; background-image: url(../svg/motif-mangal-ghat.svg); }
.day > .motif--palki { width: 52px; top: 2px; background-image: url(../svg/motif-palki.svg); }
.day > .motif--fish-pair { width: 54px; height: 21px; top: 3px; margin: 0; }
.day > .motif--fish-pair::before, .day > .motif--fish-pair::after { background-size: 54px 21px; }
.motif--palki { width: 112px; height: 54px; margin: 10px auto 0; background-image: url(../svg/motif-palki.svg); }

/* Arrivals (ornaments.js): each motif rises 6px into place, once; the fish swim 8px towards each other. */
.motif.m-wait { opacity: 0; }
.motif.m-in { animation: motif-in .6s var(--ease-out) both; }
@keyframes motif-in { from { opacity: 0; translate: 0 6px; } }
.date__card .motif.m-in { animation-name: motif-in-turned; }
@keyframes motif-in-turned { from { opacity: 0; translate: 0 6px; } }
.motif--fish-pair.m-in { animation: motif-fade .5s var(--ease-out) both; }
.motif--fish-pair.m-in::before { animation: fish-l .9s var(--ease-out) both; }
.motif--fish-pair.m-in::after { animation: fish-r .9s var(--ease-out) both; }
@keyframes motif-fade { from { opacity: 0; } }
@keyframes fish-l { from { translate: -8px 0; } }
@keyframes fish-r { from { translate: 8px 0; } }

/* == The hero's toran (motion pass Task 3): marigold swags across the top edge, under the frame's corners == */
.toran { position: absolute; z-index: 1; top: 0; left: 0; width: 100%; height: auto; pointer-events: none; }

/* == The leaves breathe while the guest decides, and a gold sheen runs along them now and then (the couple's review,
   23 Nov: on until the tap, no longer twice and still) == */
.gate__leaf.is-waiting img { animation: leaf-breathe 2.4s ease-in-out infinite; }
@keyframes leaf-breathe { 50% { translate: 0 -2px; rotate: .6deg; } }
.gate__leaf.is-waiting::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 232, 170, .5) 50%, transparent 58%) 140% 0 / 260% 100% no-repeat;
  -webkit-mask: url(../img/paan-leaf.webp) center / 100% 100% no-repeat;
  mask: url(../img/paan-leaf.webp) center / 100% 100% no-repeat;
  animation: leaf-sheen 4s .9s ease-in-out infinite both;
  pointer-events: none;
}
.gate__leaf--r.is-waiting::after { scale: -1 1; }
@keyframes leaf-sheen { 0% { background-position: 140% 0; } 40%, 100% { background-position: -40% 0; } } /* a sweep, then a rest */

/* == The song chip and the equaliser (motion spec §8) == */
.music-note { display: block; line-height: 1; }
.eq { display: none; height: 16px; align-items: flex-end; justify-content: center; gap: 3px; }
.eq i { width: 3px; height: 16px; border-radius: 2px; background: currentColor; transform-origin: 50% 100%; animation: eq .9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-duration: 1.15s; animation-delay: -.4s; }
.eq i:nth-child(3) { animation-duration: .75s; animation-delay: -.2s; }
@keyframes eq { from { scale: 1 .25; } to { scale: 1 1; } }
.fab--music.is-playing .eq { display: flex; }
.fab--music.is-playing .music-note { display: none; }
.fab--music .music-chip { /* not the round button: .fab--music button sizes that one */
  width: auto; border-radius: 999px;
  display: flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 12px 0 0; /* compact (the couple's review): the tap height stays 44 */
  border: 0; background: none;
  color: var(--maroon); font: 13px/1.2 var(--head); white-space: nowrap; cursor: pointer;
  clip-path: inset(0 0 0 0 round 999px);
  transition: clip-path 220ms var(--ease-out), opacity 220ms var(--ease-out), visibility 0s, scale 120ms var(--ease-out);
}
.fab--music:not(.is-open) .music-chip {
  position: absolute; left: 44px; /* out of the flex row: the button returns to its round self */
  clip-path: inset(0 100% 0 0 round 999px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: clip-path 180ms var(--ease-out), opacity 180ms var(--ease-out), visibility 0s 180ms;
}
.music-chip:active { scale: .97; }
.music-chip__song { transition: filter 140ms ease, opacity 140ms ease; }
.music-chip.is-swapping .music-chip__song { filter: blur(2px); opacity: .35; }
.music-chip__swap { width: 14px; height: 10.5px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12' fill='none' stroke='%23C9A24A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 3.5h12M10 .8l3 2.7-3 2.7M15 8.5H3M6 5.8 3 8.5l3 2.7'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (prefers-reduced-motion: reduce) {
  .eq i { animation: none; }
  .eq i:nth-child(1) { scale: 1 .5; } .eq i:nth-child(3) { scale: 1 .7; }
}

/* == Section titles arrive (ornaments.js; motion spec §7): the stamp presses down, the words ink in left to right
   (their own colour painted through a moving edge: whole lines, so joined letters stay whole), the divider unfurls
   from its centre. m-in is cleared when they finish: the rest state is the plain CSS above. == */
.sec__title.m-wait { -webkit-text-fill-color: transparent; }
.sec__title.m-wait::before { opacity: 0; }
.sec__title.m-wait::after { clip-path: inset(0 50%); }
.sec__title.m-in {
  -webkit-text-fill-color: transparent;
  background: linear-gradient(90deg, currentColor 46%, transparent 54%) 100% 0 / 220% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text;
  animation: title-ink .6s .08s var(--ease-io) both;
}
.sec__title.m-in::before { animation: stamp-press .24s var(--ease-out) both; }
.sec__title.m-in::after { animation: divider-unfurl .7s .2s var(--ease-out) both; }
@keyframes title-ink { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes stamp-press { from { opacity: 0; scale: 1.12; rotate: -8deg; } }
@keyframes divider-unfurl { from { clip-path: inset(0 50%); } to { clip-path: inset(0); } }
#countdown .sec__title.m-in::before { animation: stamp-press .24s var(--ease-out) both, hourglass-turn .6s .3s var(--ease-io) both; }
@keyframes hourglass-turn { from { rotate: -185deg; } }

/* == বর ও কনে arrives: the arch glint, the photos rising, the গাঁটছড়া (ornaments.js) == */
.arch-line { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; opacity: 0; }
.arch-line path { fill: none; stroke: #FFE6A6; stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px rgba(255, 220, 140, .8)); }
.person.m-wait .flip__front img { clip-path: inset(100% 0 0 0); }
.person.m-in .flip__front img { animation: photo-rise .7s var(--ease-out) both; }
.person--bride.m-in .flip__front img { animation-delay: .12s; }
@keyframes photo-rise { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
.couple__grid { position: relative; container-type: inline-size; }
.knot { position: absolute; z-index: 1; left: 50%; top: calc((100cqw - 14px) / 2 * 4 / 3 + 2px); width: 72px; height: auto; translate: -50% 0; pointer-events: none; }
.knot.m-wait { opacity: 0; }
.sec--couple .person__side { margin-top: 38px; } /* the গাঁটছড়া hangs between the arches and the labels */

/* == The envelope's mandala and the wax seal's chips (motion.js) == */
.envelope__mandala img { display: block; width: 100%; height: auto; }
.envelope__mandala { overflow: hidden; border-radius: 50%; aspect-ratio: 1; }
.envelope__mandala { position: absolute; z-index: 0; /* first in the book: under the card's pages, under the envelope */ left: 50%; width: min(100%, 320px); height: auto; translate: -50% -50%; pointer-events: none; }
.seal-chip { position: absolute; z-index: 2; left: 50%; top: 62%; /* on the seal */ width: 9px; height: 7px; margin: -3px -4px; border-radius: 40% 60% 45% 55%; background: radial-gradient(circle at 35% 30%, #e24751, #860b16); }

/* == The লাল সুতো (thread.js; motion spec §2): red with a pale-gold glow, drawn by scroll, a gold bead at its tip == */
.thread { position: absolute; z-index: 0; top: 0; left: 0; width: 100%; overflow: visible; pointer-events: none; }
.thread path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.thread__glow { stroke: #F3D58C; stroke-width: 3.8; opacity: .5; }
.thread__red { stroke: #D21B30; stroke-width: 2; }
.thread__bead { fill: #E9C46A; filter: drop-shadow(0 0 4px rgba(255, 215, 120, .9)); transition: opacity .2s; }
/* the events' spine: the same red, drawn down the gold rail; each day's dot lights as the spine reaches it */
.events__spine { position: absolute; z-index: 1; left: calc(var(--pad) / -2 - .5px); top: 14px; bottom: 120px; width: 2px; border-radius: 1px; background: #D21B30; transform-origin: 50% 0; transform: scaleY(1); pointer-events: none; }
.day__head::before { transition: background-color .35s var(--ease-out), box-shadow .35s var(--ease-out), translate .5s var(--ease-out); }
.day__head.is-dim::before { background: var(--ivory); box-shadow: 0 0 0 2.5px var(--ivory), 0 0 0 3.5px rgba(201, 162, 74, .6); }
/* chapters develop from muted to full colour in the middle of the screen; the wire and the medallion settle */
.chapter.m-wait .chapter__frame img { filter: saturate(.35) brightness(.85); clip-path: inset(0 100% 0 0); }
.chapter.m-wait:nth-child(even) .chapter__frame img { clip-path: inset(0 0 0 100%); }
.chapter.m-in .chapter__frame img { animation: develop .9s var(--ease-out) both, wipe-l .8s var(--ease-out) both; }
.chapter.m-in:nth-child(even) .chapter__frame img { animation-name: develop, wipe-r; }
@keyframes develop { from { filter: saturate(.35) brightness(.85); } }
.chapter.m-wait::before, .chapter.m-wait .chapter__frame::before { opacity: 0; }
.chapter.m-in::before { animation: motif-fade .6s var(--ease-out) both; }
.chapter.m-in .chapter__frame::before { animation: medal-settle .5s .25s var(--ease-out) both; }
@keyframes medal-settle { from { opacity: 0; scale: .9; } }
/* each event picture gets a gold ring drawn round its edge; the wedding card's fire flickers, then holds its glow */
.vig-ring { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; rotate: -90deg; pointer-events: none; }
.vig-ring circle { fill: none; stroke: #E9C46A; stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 0; }
.event.m-wait .vig-ring circle { stroke-dashoffset: 1; }
.event.m-in .vig-ring circle { animation: ring-draw .7s .25s var(--ease-out) both; } /* once the card has risen */
@keyframes ring-draw { from { stroke-dashoffset: 1; } }
.spotlight .event__vignette::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 58%, rgba(255, 190, 90, .45), transparent 62%); opacity: .6; pointer-events: none; }
.spotlight.m-in .event__vignette::after { animation: flame-glow 4s ease-in-out both; }
@keyframes flame-glow { 0% { opacity: .2; } 10% { opacity: .85; } 20% { opacity: .5; } 32% { opacity: .9; } 45% { opacity: .55; } 60% { opacity: .8; } 75% { opacity: .5; } 100% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .events__spine { transform: none !important; } }

/* == কোথায়: a map pin in each card's corner drops into place, with a squash and one ripple (ornaments.js) == */
.venue__pin { position: absolute; z-index: 1; top: 24px; right: 18px; width: 20px; height: 27px; background: url(../svg/pin.svg) center / contain no-repeat; transform-origin: 50% 100%; }
.venue__pin::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 16px; height: 6px; margin-left: -8px; border: 1.5px solid var(--sindoor); border-radius: 50%; opacity: 0; }
.venue.m-wait .venue__pin { opacity: 0; translate: 0 -12px; }
.venue.m-in .venue__pin { animation: pin-drop .55s .35s var(--ease-out) both; } /* after the card is laid down */
.venue.m-in .venue__pin::after { animation: pin-ripple .6s .8s ease-out both; }
@keyframes pin-drop { 0% { opacity: 0; translate: 0 -12px; } 70% { opacity: 1; translate: 0 0; scale: 1.04 .94; } 100% { scale: 1 1; } }
@keyframes pin-ripple { from { opacity: .55; scale: .8; } to { opacity: 0; scale: 1.7; } }

/* == The finale (ornaments.js): five প্রদীপ, lit by default; on arrival they light left to right, flicker, then hold == */
/* two each side of the logo, standing on its baseline: positioned, so they add no height to the closing */
.diyas { position: absolute; left: -100px; right: -100px; bottom: 2px; display: flex; gap: 8px; pointer-events: none; }
.diya { width: 26px; height: auto; overflow: visible; }
.diya:nth-child(2) { margin-right: auto; }
.diya__flame { transform-box: fill-box; transform-origin: 50% 85%; transition: opacity .3s var(--ease-out), scale .3s var(--ease-out); }
.diyas.m-wait .diya__flame, .diyas.is-lighting .diya:not(.is-lit) .diya__flame { opacity: 0; scale: .6; }
.diyas.is-flicker .diya.is-lit .diya__flame { animation: flicker .9s ease-in-out infinite; }
.diyas.is-flicker .diya:nth-child(2n) .diya__flame { animation-duration: 1.1s; animation-delay: -.3s; }
.diyas.is-flicker .diya:nth-child(3n) .diya__flame { animation-duration: .8s; animation-delay: -.5s; }
@keyframes flicker { 0%, 100% { scale: 1 1; rotate: 0deg; } 25% { scale: .94 1.07; rotate: -2deg; } 50% { scale: 1.05 .95; } 75% { scale: .97 1.04; rotate: 2deg; } }
/* the names ink in; the thread's bow ties round the logo; a glint runs once across its foil */
#closing.m-wait .closing__names { clip-path: inset(-30% 100% -30% -8%); }
#closing.m-in .closing__names { animation: ink-wipe .8s .45s var(--ease-io) both; } /* after the note */
@keyframes ink-wipe { from { clip-path: inset(-30% 100% -30% -8%); } to { clip-path: inset(-30% -8% -30% -8%); } }
.closing__mark { position: relative; width: 96px; margin-inline: auto; }
.closing__mark .logo { width: 100%; }
/* the thread's circle holds the whole logo (corners included: the couple's review, 23 Nov), centred on it: the drawing's
   loop is centred at (75, 70) of 150 x 150 units, radius 66; at 148px a unit is .987px */
.bow { position: absolute; z-index: 1; left: calc(50% - 74px); top: calc(50% - 69px); width: 148px; height: auto; overflow: visible; pointer-events: none; }
#closing.m-wait .bow { opacity: 0; }
.closing__mark::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(255, 240, 200, .85) 50%, transparent 60%) 150% 0 / 260% 100% no-repeat;
  -webkit-mask: url(../img/logo-sr.webp) center / contain no-repeat; mask: url(../img/logo-sr.webp) center / contain no-repeat; opacity: 0; pointer-events: none; }
#closing.m-in .closing__mark::after { animation: logo-glint .9s 1.6s ease-in-out both; }
@keyframes logo-glint { from { opacity: 1; background-position: 150% 0; } to { opacity: 1; background-position: -50% 0; } }
.closing__site { margin-top: 42px; } /* below the bow's tie, at the foot of its circle */

/* == Scroll entrances (docs/superpowers/specs/2026-11-23-scroll-entrances-design.md): each section's content arrives in
   its own way, once, on the same m-wait / m-in arrival as its ornaments (lib/arrive.js). Reduced motion: none armed. == */
@keyframes rise { from { opacity: 0; translate: 0 var(--rise, 10px); } }
/* বর ও কনে: each person's words rise in under their photo, just after it has risen into its arch */
.person.m-wait :is(.person__side, .person__name, .person__parents, .person__love) { opacity: 0; }
.person.m-in :is(.person__side, .person__name, .person__parents, .person__love) { animation: rise .6s var(--ease-out) both; }
.person.m-in .person__side { animation-delay: .45s; }
.person.m-in .person__name { animation-delay: .52s; }
.person.m-in .person__parents { animation-delay: .59s; }
.person.m-in .person__love { animation-delay: .66s; }
.person--bride.m-in .person__side { animation-delay: .57s; }
.person--bride.m-in .person__name { animation-delay: .64s; }
.person--bride.m-in .person__parents { animation-delay: .71s; }
.person--bride.m-in .person__love { animation-delay: .78s; }
/* শুভ দিন: the foil card is laid down like a card on a table; the reveal button follows */
.date__card.m-wait { opacity: 0; }
.date__card.m-in { animation: card-lay .6s var(--ease-out) both; }
@keyframes card-lay { from { opacity: 0; translate: 0 16px; rotate: -2deg; scale: .97; } }
.date__card.m-wait + .scratch__reveal { opacity: 0; }
.date__card.m-in + .scratch__reveal { animation: rise .5s .25s var(--ease-out) both; }
/* আর মাত্র: the এক নজরে rows are written in one after another, like entries in a ledger */
/* written in left to right (a wipe, not a slide: a sideways move nudged WebKit's scroll by a pixel) */
.glance__row.m-wait { opacity: 0; clip-path: inset(0 100% 0 0); }
.glance__row.m-in { animation: ledger-in .6s var(--ease-out) both; }
.glance__row.m-in:nth-child(2) { animation-delay: 80ms; }
@keyframes ledger-in { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
/* কোথায়: each airmail card is laid down like a letter, then its pin drops (above) */
.venue.m-wait { opacity: 0; }
.venue.m-in { animation: letter-lay .7s var(--ease-out) both; }
@keyframes letter-lay { from { opacity: 0; translate: 0 20px; rotate: -1.5deg; } }
/* আসবেন কিন্তু: the note first, then the names ink in (above), then the English names, the dates and the hashtag */
#closing.m-wait :is(.closing__note, .closing__names-en, .closing__dates, .closing__tag) { opacity: 0; }
#closing.m-in .closing__note { animation: rise .6s var(--ease-out) both; }
#closing.m-in :is(.closing__names-en, .closing__dates, .closing__tag) { --rise: 8px; animation: rise .5s 1s var(--ease-out) both; }
#closing.m-in .closing__dates { animation-delay: 1.1s; }
#closing.m-in .closing__tag { animation-delay: 1.2s; }
/* আমাদের গল্প: each painting wipes in from the side the red thread runs beside it (chapter 1 the left lane, then
   alternating: thread.js routeThread) with a 12px glide from that side, inside the page margin; its words follow */
@keyframes wipe-l { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes wipe-r { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0); } }
.chapter.m-in .chapter__frame { animation: glide-l .8s var(--ease-out) both; }
.chapter.m-in:nth-child(even) .chapter__frame { animation-name: glide-r; }
@keyframes glide-l { from { translate: -12px 0; } }
@keyframes glide-r { from { translate: 12px 0; } }
.chapter.m-wait figcaption { opacity: 0; }
.chapter.m-in figcaption { --rise: 12px; animation: rise .6s .15s var(--ease-out) both; }
.story-open.m-wait { opacity: 0; }
.story-open.m-in { animation: rise .6s var(--ease-out) both; }
/* অনুষ্ঠানসূচি: each card rises in, one after another; each day's heading writes in just before them */
.event.m-wait { opacity: 0; }
.event.m-in { --rise: 16px; animation: rise .6s var(--ease-out) both; }
.day__events > .event.m-in:nth-child(2) { animation-delay: 80ms; }
.day__events > .event.m-in:nth-child(3) { animation-delay: 160ms; }
.day__head { transition: color .5s var(--ease-out), translate .5s var(--ease-out); }
/* the words wait from the start and write in as the heading arrives (thread.js, at 85%, before its cards); the dot keeps
   its place on the rail and still lights with the spine (.is-dim). A transition takes the arriving state's timing. */
.day__head.m-wait { color: transparent; translate: -10px 0; transition: none; }
.day__head.m-wait::before { translate: 10px -50%; transition: background-color .35s var(--ease-out), box-shadow .35s var(--ease-out); }
/* শুভ দিন: the reveal's sparkles and বাজি (fireworks.js), on one canvas the size of the section, under the controls */
.fireworks { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; }
/* == More Bengali wedding objects where the page looked empty (the couple's review, 23 Nov) == */
/* the বরণ pair beside the invitation's arch, each centred in the margin the painting leaves */
.motif--kulo, .motif--chalon { position: absolute; z-index: 0; top: 108px; width: 52px; height: 50px; }
.motif--kulo { left: calc((100% - min(58%, 230px)) / 4 - 26px); rotate: -8deg; background-image: url(../svg/motif-kulo.svg); }
.motif--chalon { right: calc((100% - min(58%, 230px)) / 4 - 26px); background-image: url(../svg/motif-chalon.svg); }
/* the সিঁদুর কৌটো under the date card */
.motif--sindur-kouto { width: 36px; height: 45px; margin: 22px auto 0; background-image: url(../svg/motif-sindur-kouto.svg); }
/* the groom's টোপর and the bride's মুকুট in আর মাত্র's corners; a pair of পান in আমাদের গল্প's */
.motif--topor, .motif--mukut, .motif--paan { position: absolute; top: 46px; }
.motif--topor { width: 30px; height: 39px; background-image: url(../svg/motif-topor.svg); }
.motif--mukut { top: 50px; width: 44px; height: 35px; background-image: url(../svg/motif-mukut.svg); }
.motif--paan { width: 30px; height: 39px; background-image: url(../svg/motif-paan.svg); }
.motif--paan.motif--tr { scale: -1 1; }
/* == Ambient loops (the couple's review, 23 Nov: "keep the elements moving in the page"). Each runs only while its
   element is on screen (.is-live, lib/arrive.js whileOnScreen), never during its arrival (.m-in), never on a slow
   device and never under reduced motion (no .is-live is ever set). Transforms and opacity only. == */
/* the invitation's alpona halo, centred behind the painting, turning slowly */
.envelope__mandala.is-resting { opacity: .4; scale: .82; }
.envelope__mandala.is-resting img { rotate: 20deg; } /* where the opening left it (GSAP turned it there) */
.envelope__mandala.is-live img { animation: mandala-turn 90s linear infinite; }
@keyframes mandala-turn { from { rotate: 20deg; } to { rotate: 380deg; } }
/* the প্রজাপতি folds its wings twice every few seconds, as a resting butterfly does */
.motif--prajapati.is-live .wing { transform-box: view-box; transform-origin: 32px 27px; animation: wing-flap 3.6s ease-in-out infinite; } /* only once the opening (GSAP, its own pivot) is done */
@keyframes wing-flap { 0%, 60%, 100% { scale: 1 1; } 68% { scale: .4 1; } 76% { scale: 1 1; } 84% { scale: .5 1; } 92% { scale: 1 1; } }
/* the motifs: a bob, a rock, a turn, a sway, a swim, a beat */
.motif.is-live:not(.m-in) { animation: motif-bob 4.2s ease-in-out infinite; }
.motif--tr.is-live:not(.m-in), .motif--r.is-live:not(.m-in) { animation-delay: -2.1s; }
@keyframes motif-bob { 50% { translate: 0 -3px; } } /* not "bob": that one nudges the hero's scroll chevron */
.motif--kulo.is-live:not(.m-in) { animation: kulo-rock 5s ease-in-out infinite; }
@keyframes kulo-rock { 50% { rotate: -2deg; } }
.motif--chalon.is-live:not(.m-in) { animation: chalon-turn 30s linear infinite; }
@keyframes chalon-turn { to { rotate: 360deg; } }
.motif--paan { transform-origin: 50% 0; }
.motif--paan.is-live:not(.m-in) { animation: paan-sway 5s ease-in-out infinite; }
.motif--paan.motif--tr.is-live:not(.m-in) { animation-delay: -2.5s; }
@keyframes paan-sway { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }
.motif--fish-pair.is-live:not(.m-in) { animation: none; }
.motif--fish-pair.is-live:not(.m-in)::before { animation: swim-l 3.2s ease-in-out infinite; }
.motif--fish-pair.is-live:not(.m-in)::after { animation: swim-r 3.2s ease-in-out infinite; }
@keyframes swim-l { 50% { translate: -3px 0; } }
@keyframes swim-r { 50% { translate: 3px 0; } }
.motif--tabla.is-live:not(.m-in) { animation: tabla-beat 2.4s ease-in-out infinite; }
@keyframes tabla-beat { 10%, 30% { scale: 1.06; } 20%, 40% { scale: 1; } }
.motif--palki.is-live:not(.m-in) { animation: palki-carry 2.2s ease-in-out infinite; }
@keyframes palki-carry { 25% { translate: 0 -2px; rotate: -1deg; } 75% { translate: 0 -1px; rotate: 1deg; } }
.motif--garland.is-live:not(.m-in) { animation: motif-bob 6s ease-in-out infinite; }
/* the velvet curtains: a second set of folds, half a fold over, sways and breathes over the first, so the folds
   seem to move. It reaches 40px past each side, clipped by the section (overflow-x: clip), so it can never widen the
   page; where clip isn't supported (iOS 15) the curtain simply stays still. */
@supports (overflow: clip) {
  .ground--velvet, .sec--story, .sec--closing { overflow-x: clip; isolation: isolate; }
  .ground--velvet::after, .sec--story::after, .sec--closing::after {
    content: ""; position: absolute; z-index: -1; inset: 0 -40px; pointer-events: none; opacity: 0;
    background: repeating-linear-gradient(90deg, rgba(255, 236, 220, .09) 0, rgba(20, 0, 4, .16) 18px, rgba(255, 236, 220, .09) 36px);
  }
  .ground--velvet.is-live::after, .sec--story.is-live::after, .sec--closing.is-live::after { animation: curtain-sway 8s ease-in-out infinite; }
  @keyframes curtain-sway { 0%, 100% { translate: -18px 0; opacity: .2; } 50% { translate: 18px 0; opacity: .9; } }
}
/* == Each event picture wears an alpona ring (the couple's review, 23 Nov): 24 gold petals and sindoor dots just
   outside its gold border, turning slowly while it is on screen (ornaments.js; none on a slow phone or under
   reduced motion, where it simply rests). == */
.event__vignette::before { content: ""; position: absolute; z-index: -1; inset: -14px; background: url(../svg/alpona-ring.svg) center / contain no-repeat; pointer-events: none; }
.event__vignette.is-live::before { animation: alpona-turn 40s linear infinite; }
.event--bor .event__vignette.is-live::before { animation-direction: reverse; } /* the two families' rings turn towards each other */
@keyframes alpona-turn { to { rotate: 360deg; } }
/* == More life on the opening screen (the couple's review, 23 Nov). The gate clips its own box (overflow: hidden), so
   nothing here can widen the page; none of it exists or moves under reduced motion. == */
/* a faint alpona turning slowly behind the leaves */
.gate__mandala { position: absolute; left: 50%; top: 45%; width: min(118vmin, 560px); aspect-ratio: 1; translate: -50% -50%; opacity: .16; background: url(../svg/alpona-rosette.svg) center / contain no-repeat; pointer-events: none; animation: gate-turn 120s linear infinite; }
@keyframes gate-turn { to { rotate: 360deg; } }
/* gold sparks drifting up the velvet */
.gate__motes { position: absolute; inset: 0; pointer-events: none; }
.gate__mote { position: absolute; left: var(--x); bottom: -12px; width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(circle, #FFF1C4 0, rgba(233, 196, 106, .75) 45%, transparent 72%); opacity: 0; animation: mote-rise var(--t) var(--d) linear infinite; }
@keyframes mote-rise { 0% { opacity: 0; translate: 0 0; } 12% { opacity: .9; } 80% { opacity: .65; } 100% { opacity: 0; translate: var(--dx) -105vh; } }
/* at the tap, warm light pours out from between the leaves as they part */
.gate__glow { position: absolute; left: 50%; top: 45%; width: 90vmin; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 232, 170, .85), rgba(233, 196, 106, .35) 45%, transparent); opacity: 0; pointer-events: none; }
.gate.is-opening .gate__glow { animation: gate-glow 2s ease-out both; }
@keyframes gate-glow { 0% { opacity: 0; scale: .4; } 25% { opacity: .9; } 100% { opacity: 0; scale: 1.5; } }
@media (prefers-reduced-motion: reduce) { .gate__mandala, .gate.is-opening .gate__glow { animation: none; } }
/* == The audit (23 Nov) == */
/* the two families' cards side by side line up: two lines kept for the name, and the "wear yellow" note and the
   buttons settle at the foot of each card */
.event[data-pair] .event__name { display: grid; align-content: center; min-height: calc(2 * 1.4em); }
.event[data-pair] .event__yellow { margin-top: auto; }
.event[data-pair] .event__yellow + .event__actions { margin-top: 0; }
/* no single word left alone on a last line */
.event__name, .cal-opt__name, .cal-menu__note, .music-row__now { text-wrap: balance; }
/* == Page to page (the couple's review, 23 Nov; stage.js): each page holds and dims while the next fades in and slides
   over it. The opening page holds with its foot on the screen's foot, any other page with its foot on the middle
   line (stage.js sets each held page's top). Only with stage.js running (main.fade): under reduced motion or without
   script the page simply scrolls. The room a held page needs below it (an empty block after it in its box: a sticky box
   never moves into its parent's padding) is given back by the next box's negative margin, so the page is exactly as long as before. == */
main.fade { background: #1f0207; } /* what a page fades in from, and what shows round the opening page as it settles back */
main.fade > .page:not(:last-child)::after { content: ""; display: block; height: 50vh; height: 50lvh; }
main.fade > .page + .page { margin-top: -50vh; margin-top: -50lvh; }
main.fade > .page:first-child::after { height: 100vh; height: 100lvh; }
main.fade > .page:first-child + .page { margin-top: -100vh; margin-top: -100lvh; }
/* held pages: each its own layer group, so its veil dims only itself and the next page always lies over it */
main.fade > .page:not(:last-child) > .sec { position: sticky; isolation: isolate; }
.sec__veil { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; height: min(100%, 100lvh); z-index: 10; background: #1f0207; opacity: var(--dim, 0); pointer-events: none; }
.sec--hero.is-covered .hero__art img { animation-play-state: paused; } /* covered: its slow zoom rests */
