/* ==========================================================================
   Wedding invitation: "Zahra" x Tajik.
   Champagne paper, bevelled gold, pearls, ivory suzani flowers,
   Nastaliq calligraphy, 8-point stars and pomegranates.
   ========================================================================== */
:root {
  --outer: #E6D7BC;
  --paper: #F6EFE3;
  --paper-2: #EFE5D3;
  --cream: #FBF7EE;
  --gold-d: #8A6420;
  --gold: #C49A45;
  --gold-l: #F2D78C;
  --title: #7A5A2A;
  --ink: #4E3D2C;
  --ink-2: #806A52;
  --pom: #7A2333;
  --turq: #2A8C88;
  --line: rgba(196, 154, 69, .5);

  --metal: linear-gradient(135deg, #8A6420 0%, #E7C676 22%, #FFF2C4 38%, #C49A45 55%, #F2D78C 74%, #8F6A25 100%);
  --pearl: radial-gradient(circle at 35% 30%, #FFFFFF 0%, #F6F1E7 35%, #D8CDBC 80%, #B7AA96 100%);

  --script: "Cormorant Garamond", "Times New Roman", serif;
  --text: "Spectral", Georgia, serif;
  --nastaliq: "Noto Nastaliq Urdu", "Geeza Pro", serif;
  --page-w: 480px;
  --gutter: 24px;
  --ease: cubic-bezier(.22, .7, .2, 1);

  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .24 0 0 0 0 .16 .08 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23C49A45' stroke-opacity='.2' stroke-width='.8'%3E%3Crect x='22' y='22' width='12' height='12'/%3E%3Crect x='22' y='22' width='12' height='12' transform='rotate(45 28 28)'/%3E%3Cpath d='M0 0l8 8M56 0l-8 8M0 56l8-8M56 56l-8-8'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--noise), var(--outer);
  color: var(--ink);
  font: 400 17px/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; height: 100svh; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nastaliq { font-family: var(--nastaliq); font-style: normal; line-height: 2.3; }

/* ivory suzani flower bed: a small tile rendered once by app.js, then repeated */
.flowers { background: var(--flowers, none) center / 96px 110px repeat, #EFE3CC; }

/* ---------- Page column ---------- */
.page {
  max-width: var(--page-w); margin: 0 auto;
  background: var(--noise), var(--paper);
  box-shadow: 0 0 80px rgba(90, 60, 20, .25);
  overflow: hidden;
}
/* clip (not hidden) keeps the flower section's sticky scrolling working */
@supports (overflow: clip) { .page { overflow: clip; } }
section { position: relative; padding: 64px var(--gutter); text-align: center; }

.eyebrow { font: italic 15px/1.4 var(--text); letter-spacing: .06em; color: var(--ink-2); }
.script { font-family: var(--script); font-style: italic; font-weight: 500; color: var(--title); }
.title { font-size: 42px; line-height: 1.05; margin-bottom: 18px; }
.filigree { width: 220px; height: 38px; display: block; margin: 0 auto 30px; overflow: visible; }
.filigree.sm { width: 180px; height: 30px; margin: 10px auto 18px; }

/* gold-framed card with pearls */
.gframe {
  position: relative; max-width: 380px; margin: 0 auto; padding: 10px; border-radius: 6px;
  background: var(--metal);
  box-shadow: 0 16px 34px rgba(90, 60, 20, .22), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(90, 60, 20, .4);
}
.gin {
  position: relative; padding: 34px 22px 30px; border-radius: 3px;
  background: var(--noise), var(--cream);
  box-shadow: inset 0 0 0 1px #B98E3E, inset 0 0 0 5px var(--cream), inset 0 0 0 6px rgba(196, 154, 69, .55), inset 0 3px 10px rgba(90, 60, 20, .16);
}
.pearl { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: var(--pearl); box-shadow: 0 1px 2px rgba(60, 40, 10, .4); }
.p-tl { left: -16px; top: -16px; } .p-tr { right: -16px; top: -16px; }
.p-bl { left: -16px; bottom: -16px; } .p-br { right: -16px; bottom: -16px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px; border-radius: 6px;
  font: 500 19px/1 var(--script); letter-spacing: .02em; text-decoration: none;
  transition: transform .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-gold {
  border: 0; color: #3E2A0C; background: var(--metal);
  box-shadow: 0 6px 14px rgba(90, 60, 20, .3), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(90, 60, 20, .45);
}
.btn-gold::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: skewX(-20deg); animation: shine 4s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 140%; } }
.btn-line { border: 1px solid var(--gold); color: var(--ink); background: rgba(255, 255, 255, .45); }
.btn-line:hover { background: var(--cream); }

/* ---------- Language + music ---------- */
.topbar {
  position: fixed; z-index: 70; inset: 0 0 auto 0;
  max-width: var(--page-w); margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 14px 0; pointer-events: none;
}
.lang {
  pointer-events: auto; display: inline-flex; padding: 3px;
  background: rgba(251, 247, 238, .82);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--gold); border-radius: 999px;
  box-shadow: 0 4px 12px rgba(90, 60, 20, .12);
}
.lang button { border: 0; background: none; color: var(--ink); padding: 6px 13px; border-radius: 999px; min-height: 32px; font: 500 16px/1 var(--script); }
.lang button[aria-pressed="true"] { background: var(--metal); color: #3E2A0C; }

.music-btn {
  position: fixed; z-index: 60;
  right: max(16px, calc(50vw - var(--page-w) / 2 + 16px));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
  width: 50px; height: 50px; border-radius: 50%; padding: 0; border: 0;
  display: grid; place-items: center;
  background: var(--metal);
  box-shadow: 0 6px 16px rgba(90, 60, 20, .35), inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 3px var(--cream), 0 0 0 4px var(--gold);
}
.music-btn svg { width: 20px; height: 20px; fill: #4A3311; }
.music-btn .ico-off { display: none; }
.music-btn[aria-pressed="false"] .ico-on { display: none; }
.music-btn[aria-pressed="false"] .ico-off { display: block; margin-left: 3px; }
.music-btn.is-playing::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--gold); animation: ring 2.6s ease-out infinite;
}
@keyframes ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }

/* ==========================================================================
   1. Opening: mother-of-pearl envelope
   ========================================================================== */
.cover {
  position: fixed; inset: 0; z-index: 40; overflow: hidden; color: var(--ink);
  background: var(--noise), radial-gradient(ellipse 85% 60% at 50% 48%, #FFFDF8 0%, #F1E9DC 55%, #DCCDB6 100%);
}
.cover.is-gone { display: none; }
.dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }

/* pearl material: suzani flowers on a milky, shell-like base */
.pearl-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 30% 20%, rgba(255, 255, 255, .75), transparent 70%),
    radial-gradient(ellipse 60% 60% at 80% 85%, rgba(232, 222, 238, .55), transparent 70%),
    linear-gradient(rgba(250, 246, 239, .42), rgba(250, 246, 239, .42)),
    var(--flowers, none) center / 150px 172px repeat,
    linear-gradient(160deg, #FBF8F2 0%, #EFE6D8 45%, #F7F1E8 70%, #E9DFD0 100%);
}
/* light falling on each flap, so the folds read in 3D */
.flap::after, .ft-front::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.fl-l::after { background: linear-gradient(90deg, rgba(255, 255, 255, .35), rgba(120, 92, 55, .14) 52%); }
.fl-r::after { background: linear-gradient(270deg, rgba(255, 255, 255, .2), rgba(120, 92, 55, .2) 52%); }
.fl-b::after { background: linear-gradient(0deg, rgba(255, 255, 255, .25), rgba(120, 92, 55, .1) 55%); }
.ft-front::after { background: linear-gradient(180deg, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0) 40%, rgba(120, 92, 55, .12) 58%); }
/* slow rainbow sheen gliding across the shell */
.irid { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.irid i {
  position: absolute; top: -20%; bottom: -20%; left: -100%; width: 300%;
  background: linear-gradient(105deg,
    transparent 30%, rgba(255, 210, 228, .32) 38%, rgba(214, 232, 255, .34) 44%,
    rgba(220, 255, 236, .28) 50%, rgba(255, 246, 214, .3) 56%, transparent 64%);
  animation: irid 7s ease-in-out infinite alternate;
}
@keyframes irid { from { transform: translateX(-22%); } to { transform: translateX(22%); } }

/* --- envelope --- */
.env-scene {
  position: absolute; left: 50%; top: 52%; z-index: 3; cursor: pointer;
  width: min(78vw, 320px, calc((100svh - 240px) * .7)); aspect-ratio: .7;
  transform: translate(-50%, -50%); perspective: 1100px;
  transition: transform 1.5s cubic-bezier(.55, 0, .25, 1), opacity 1s ease .4s;
}
.env-float { position: absolute; inset: 0; transform-style: preserve-3d; animation: envFloat 7s ease-in-out infinite; }
@keyframes envFloat {
  0%, 100% { transform: rotateX(16deg) rotateY(-16deg) rotateZ(-2deg) translateY(0); }
  50% { transform: rotateX(8deg) rotateY(14deg) rotateZ(1.5deg) translateY(-12px); }
}
.env3d {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s ease-out;
}
.env3d .pearl-bg { background-size: auto, auto, auto, 88px 101px, auto; }
.env-shadow {
  position: absolute; left: 6%; right: 6%; bottom: -12%; height: 12%; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(90, 65, 30, .38), transparent 70%);
  filter: blur(6px); animation: shadowPulse 7s ease-in-out infinite;
}
@keyframes shadowPulse { 50% { transform: scale(.88); opacity: .7; } }
/* back panel, with a paper edge so it has thickness */
.env-back {
  position: absolute; inset: 0; border-radius: 6px;
  background: linear-gradient(170deg, #E1D5C2, #F2EBE0 55%, #D9CBB5);
  box-shadow: 0 0 0 1px rgba(150, 120, 80, .35), 0 34px 50px -18px rgba(80, 55, 20, .5), 0 10px 20px -8px rgba(80, 55, 20, .25);
}
.env-back::before { content: ""; position: absolute; inset: 0; border-radius: 6px; background: #CBBBA1; transform: translateZ(-3px); }
/* card inside the envelope */
.mcard {
  position: absolute; left: 5%; right: 5%; top: 4%; bottom: 4%; border-radius: 4px; overflow: hidden;
  transform: translateZ(2px); box-shadow: 0 2px 8px rgba(80, 60, 30, .22);
  transition: transform 1.4s cubic-bezier(.45, 0, .2, 1);
}
.mcart { position: absolute; left: 13%; top: 7%; width: 74%; height: 86%; overflow: visible; }
.m-ribbon {
  position: absolute; left: 0; right: 0; top: 50%; height: 7%; transform: translateY(-50%);
  background: linear-gradient(180deg, #CDB894 0%, #F7EFE0 18%, #FFFFFF 30%, #E6D7BE 55%, #FFFCF5 76%, #C9B28A 100%);
  box-shadow: 0 2px 5px rgba(90, 70, 40, .25);
}
.m-bow { position: absolute; left: 50%; top: 50%; width: 46%; aspect-ratio: 200 / 150; transform: translate(-50%, -48%); overflow: visible; }
/* front pocket */
.pocket { position: absolute; inset: 0; border-radius: 6px; overflow: hidden; transform: translateZ(4px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8); }
.flap { position: absolute; inset: 0; }
.fl-l { clip-path: polygon(0 0, 52% 50%, 0 100%); }
.fl-r { clip-path: polygon(100% 0, 48% 50%, 100% 100%); }
.fl-b { clip-path: polygon(0 100%, 50% 45%, 100% 100%); }
.fl-l .pearl-bg { filter: brightness(.97); }
.fl-r .pearl-bg { filter: brightness(.94); }
.env-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.env-lines path { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ln-sh { stroke: rgba(100, 75, 40, .3); stroke-width: 16; filter: blur(6px); }
.ln-hi { stroke: rgba(255, 255, 255, .9); stroke-width: 1.2; }

.flap-top {
  position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 50% 0;
  transform: translateZ(6px) rotateX(0deg);
  transition: transform 1.5s cubic-bezier(.5, 0, .25, 1) .35s;
}
.ft-front, .ft-back { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 58%); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ft-front { border-radius: 6px 6px 0 0; }
.ft-back { transform: rotateX(180deg); background: linear-gradient(0deg, #D8CAB3, #F4EDE2 70%); }

/* gold wax seal at the tip of the top flap */
.seal {
  position: absolute; left: 33%; top: 58%; width: 34%; aspect-ratio: 1; margin-top: -17%;
  padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer;
  transform: translateZ(9px);
  filter: drop-shadow(0 6px 10px rgba(80, 55, 20, .35)) drop-shadow(0 0 14px rgba(255, 228, 160, .7));
  animation: sealGlow 2.6s ease-in-out infinite;
  transition: transform 1.5s cubic-bezier(.55, .05, .25, 1), opacity .9s ease .5s;
  -webkit-tap-highlight-color: transparent;
}
.seal svg { width: 100%; height: 100%; display: block; overflow: visible; }
.seal::after { /* tap ring */
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 236, 190, .9); animation: tapRing 2.6s ease-out infinite;
}
.lid-initials { font: italic 500 36px var(--script); fill: #6E4E16; letter-spacing: .04em; }
@keyframes sealGlow { 50% { filter: drop-shadow(0 6px 10px rgba(80, 55, 20, .35)) drop-shadow(0 0 26px rgba(255, 236, 180, 1)) drop-shadow(0 0 50px rgba(255, 210, 120, .6)); } }
@keyframes tapRing { 70% { box-shadow: 0 0 0 24px rgba(255, 236, 190, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 236, 190, 0); } }

.cover-top {
  position: absolute; z-index: 5; left: 0; right: 0; top: max(78px, calc(env(safe-area-inset-top) + 60px));
  text-align: center; pointer-events: none; transition: opacity .5s;
}
.cover-kicker { font: italic 500 22px/1.2 var(--script); color: var(--title); text-shadow: 0 1px 0 #fff; }
.cover-hint {
  position: absolute; z-index: 5; left: 0; right: 0; bottom: max(26px, env(safe-area-inset-bottom));
  text-align: center; pointer-events: none;
  font: italic 500 20px/1.2 var(--script); color: var(--title); text-shadow: 0 1px 0 #fff;
  animation: hint 2.4s ease-in-out infinite; transition: opacity .5s;
}
@keyframes hint { 50% { opacity: .4; } }

/* --- inner card --- */
.ecard { position: absolute; inset: 0; z-index: 4; opacity: 0; visibility: hidden; transform: scale(.5) translateY(-14%); transform-origin: 50% 40%; }
.ecart {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(78vw, 330px, calc(78svh * .6)); aspect-ratio: 240 / 400;
}
.cart-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cart-fill { fill: #F8F3EA; }
.cart-edge { fill: none; stroke: #FFFFFF; stroke-width: 5; filter: url(#ivoryRelief); }
.cart-dots { fill: none; stroke: #D9BF85; stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 0 7; }
.cart-text {
  position: absolute; inset: 16% 12%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; opacity: 0; transform: translateY(10px);
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
}
.cart-kicker { font: italic 16px/1.35 var(--text); color: var(--ink-2); max-width: 15em; }
.cart-names { display: flex; flex-direction: column; font: italic 500 46px/1 var(--script); color: var(--title); }
.cart-names .amp { font-size: .5em; color: var(--gold); line-height: 1.6; }
.cart-date { margin-top: 16px; font-size: 14px; letter-spacing: .28em; color: var(--ink-2); }

.ribbon {
  position: absolute; top: 50%; height: 46px; margin-top: -23px; width: 51%;
  background: linear-gradient(180deg, #CDB894 0%, #F7EFE0 18%, #FFFFFF 30%, #E6D7BE 55%, #FFFCF5 76%, #C9B28A 100%);
  box-shadow: 0 5px 12px rgba(90, 70, 40, .28), inset 0 1px 0 #B99A5E, inset 0 -1px 0 #A88A52;
  transition: transform 1.3s cubic-bezier(.6, 0, .3, 1), opacity 1s ease .4s;
}
.rb-l { left: 0; } .rb-r { right: 0; }
.bow {
  position: absolute; left: 50%; top: 50%; width: 190px; height: 142px; margin: -72px 0 0 -95px; overflow: visible;
  filter: drop-shadow(0 6px 10px rgba(90, 70, 40, .25));
  transition: transform 1s cubic-bezier(.5, 0, .3, 1), opacity .8s ease .15s;
}

.flash {
  position: absolute; inset: 0; z-index: 7; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, #FFFFFF, #FBF6EE 60%, #F1E8DA);
}

/* --- opening sequence (classes added by JS) --- */
.cover.is-opening .seal { animation: none; pointer-events: none; transform: translateZ(170px) scale(.9); opacity: 0; transition: transform .9s cubic-bezier(.3, .6, .3, 1), opacity .6s ease .2s; }
.cover.is-opening .seal::after { animation: none; }
.cover.is-opening .env-float, .cover.is-opening .env-shadow { animation-play-state: paused; }
.cover.is-opening .flap-top { transform: translateZ(-3px) rotateX(180deg); }
.cover.is-opening .cover-top, .cover.is-opening .cover-hint { opacity: 0; animation: none; }
.cover.is-rising .mcard { transform: translateZ(2px) translateY(-56%); }
.cover.is-diving .env-scene { transform: translate(-50%, -50%) translateY(30%) scale(2.6); opacity: 0; }
.cover.is-diving .ecard { opacity: 1; visibility: visible; transform: none; transition: transform 1.5s cubic-bezier(.45, 0, .2, 1), opacity .9s ease .25s; }
.cover.is-untying .bow { transform: scale(1.35) rotate(-8deg); opacity: 0; }
.cover.is-untying .rb-l { transform: translateX(-104%) skewY(-6deg); opacity: 0; }
.cover.is-untying .rb-r { transform: translateX(104%) skewY(6deg); opacity: 0; }
.cover.is-untying .cart-text { opacity: 1; transform: none; transition-delay: .7s; }
.cover.is-revealing { opacity: 0; transition: opacity 1s ease; }

/* --- cinematic video opening (cover gets .mode-video) --- */
.vcover, .vc-btn { display: none; }
.cover.mode-video > :not(.vcover):not(.vc-btn) { display: none; }
.cover.mode-video { background: #E9E1D3; }
.cover.mode-video .vcover { display: block; position: absolute; inset: 0; }
.vcover video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.mode-video .vc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  position: absolute; z-index: 2; left: 50%; bottom: max(44px, calc(env(safe-area-inset-bottom) + 28px));
  transform: translateX(-50%); min-height: 46px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: rgba(250, 245, 236, .86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font: 500 12px/1 var(--text); letter-spacing: .26em; text-transform: uppercase; color: var(--ink);
  box-shadow: 0 6px 20px rgba(70, 50, 20, .18), inset 0 1px 0 #fff;
  animation: vcPulse 2.6s ease-in-out infinite; transition: opacity .4s ease;
  -webkit-tap-highlight-color: transparent;
}
@keyframes vcPulse { 50% { box-shadow: 0 6px 26px rgba(70, 50, 20, .26), 0 0 0 7px rgba(250, 245, 236, .35), inset 0 1px 0 #fff; } }
.cover.mode-video.is-playing .vc-btn { opacity: 0; pointer-events: none; animation: none; }

/* ==========================================================================
   2. Hero
   ========================================================================== */
/* first screen: a full-screen scene with the names in the sky, like a film still.
   With a video opening, the photo is the video's last frame, so the hand-off is seamless. */
.hero { padding: 0 var(--gutter) 40px; }
.hero-stage {
  position: relative; height: 100svh; min-height: 560px; margin: 0 calc(var(--gutter) * -1);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: max(17svh, 110px) var(--gutter) 0; overflow: hidden; isolation: isolate;
}
.hero-stage .eyebrow { margin-bottom: 14px; color: var(--ink); text-shadow: 0 0 14px rgba(255, 250, 240, .9); }
.hero-stage .hero-names { text-shadow: 0 1px 16px rgba(255, 250, 240, .85), 0 0 2px rgba(255, 250, 240, .6); }
.hero-bg { position: absolute; inset: 0; z-index: -1; background: var(--paper-2); }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.hero-bg::after { /* soft light behind the names + fade into the paper at the bottom */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 34% at 50% 30%, rgba(252, 248, 240, .72), rgba(252, 248, 240, 0) 78%),
    linear-gradient(180deg, rgba(246, 239, 227, 0) 72%, var(--paper) 100%);
}
.scroll-hint {
  position: absolute; left: 0; right: 0; bottom: max(28px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font: italic 500 19px/1 var(--script); color: var(--title); text-shadow: 0 0 10px rgba(255, 250, 240, .9);
  animation: nudge 2.2s ease-in-out infinite;
}
.scroll-hint svg { width: 12px; height: 18px; }
.hero-stage + .hero-invite { margin-top: 36px; }
.hero-names { font: italic 500 60px/.95 var(--script); color: var(--title); display: flex; flex-direction: column; align-items: center; }
.hero-names .amp { font-size: .5em; color: var(--gold); line-height: 1.3; }
.hero-invite { margin-top: 14px; font: italic 17px/1.5 var(--text); color: var(--ink-2); }
.date-reveal { position: relative; margin: 22px 0 26px; }
.hero-date { margin: 16px 0 22px; font: 500 26px/1 var(--script); letter-spacing: .22em; color: var(--title); font-variant-numeric: lining-nums; }
.scroll-cue { display: inline-block; color: var(--gold); width: 26px; height: 16px; animation: nudge 2s ease-in-out infinite; }
.scroll-cue svg { width: 100%; height: 100%; display: block; }
@keyframes nudge { 50% { transform: translateY(5px); } }

/* Invitation letter */
.intro { padding-top: 24px; }
.tagline { font-size: 38px; line-height: 1.1; }
.intro-message { max-width: 32ch; margin: 0 auto; font-size: 17px; line-height: 1.75; }
.intro-hosts { margin-top: 18px; font: italic 15px/1.5 var(--text); color: var(--ink-2); }
.intro-sign { margin-top: 14px; font-size: 32px; line-height: 1.1; }
.intro-sign .amp { color: var(--gold); }

/* Verse */
.verse { padding-top: 0; }
.cartouche {
  max-width: 360px; margin: 0 auto; padding: 22px 20px 20px; border-radius: 14px;
  background: var(--noise), var(--paper-2);
  box-shadow: 0 0 0 1px var(--gold), 0 0 0 5px var(--paper), 0 0 0 6px var(--line);
}
.verse-fa { font-size: 20px; color: var(--gold-d); }
.verse-fa span, .verse-local span { display: block; }
.verse-local { margin-top: 10px; font: italic 16px/1.6 var(--text); }
.cartouche figcaption { margin-top: 12px; font: 500 16px/1.2 var(--script); letter-spacing: .06em; color: var(--ink-2); }

/* ---------- Flowers unfold on scroll ---------- */
.bloom { height: 210vh; padding: 0; }
.bloom-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; place-items: center; }
.bloom-text { padding: 0 52px; opacity: calc(.15 + var(--p, 0) * .85); transform: scale(calc(.94 + var(--p, 0) * .06)); }
.bloom-title { font-size: 40px; line-height: 1.05; margin: 8px 0 14px; }
.bloom-body { max-width: 26ch; margin: 0 auto; font: italic 18px/1.6 var(--text); }
/* silk curtains: folds compress and the panel is gathered into an hourglass, tied back with a tassel */
.bloom-sticky::before { /* soft stage light behind the curtains */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 55% at 50% 45%, #FFFDF7, rgba(255, 253, 247, 0) 70%);
}
.bloom-text { position: relative; }
/* scene behind the curtains: settles back from a slight zoom as they open */
.bloom-media { position: absolute; inset: 0; display: none; }
.bloom.has-media .bloom-media { display: block; }
.bloom.has-media .bloom-sticky::before { display: none; }
.bloom-media img, .bloom-media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(calc(1.14 - var(--p, 0) * .14)); will-change: transform;
}
.bloom-media::after { /* cream glow behind the words so they stay readable */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 78% 42% at 50% 50%, rgba(250, 245, 236, .86), rgba(250, 245, 236, .5) 62%, rgba(250, 245, 236, .12) 100%),
    linear-gradient(180deg, rgba(246, 239, 227, .35), rgba(246, 239, 227, 0) 22%, rgba(246, 239, 227, 0) 80%, rgba(246, 239, 227, .45));
}
.curtain { position: absolute; top: 0; bottom: 0; width: 52%; z-index: 1; --g: calc(var(--p, 0) * 40%); }
.c-l { left: 0; } .c-r { right: 0; }
.drape {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 25%, rgba(70, 45, 10, 0) 75%, rgba(70, 45, 10, .22)),
    var(--noise),
    repeating-linear-gradient(90deg,
      #A98C5F 0px, #CDB48A 5px, #EFE0C2 12px, #FFF8EA 17px, #F2E4C8 22px,
      #D6BE95 29px, #B89B6C 36px, #9E8155 41px, #A98C5F 46px);
  transform: scaleX(calc(1 - var(--p, 0) * .8));
  will-change: transform, clip-path;
}
.c-l .drape {
  transform-origin: 0 50%;
  clip-path: polygon(0 0, 100% 0,
    calc(100% - var(--g) * .12) 20%, calc(100% - var(--g) * .5) 40%, calc(100% - var(--g) * .9) 54%,
    calc(100% - var(--g)) 62%, calc(100% - var(--g) * .9) 70%, calc(100% - var(--g) * .55) 84%,
    calc(100% - var(--g) * .35) 100%, 0 100%);
  box-shadow: inset -10px 0 18px -8px rgba(70, 45, 10, .35);
}
.c-r .drape {
  transform-origin: 100% 50%;
  clip-path: polygon(100% 0, 0 0,
    calc(var(--g) * .12) 20%, calc(var(--g) * .5) 40%, calc(var(--g) * .9) 54%,
    var(--g) 62%, calc(var(--g) * .9) 70%, calc(var(--g) * .55) 84%,
    calc(var(--g) * .35) 100%, 100% 100%);
  box-shadow: inset 10px 0 18px -8px rgba(70, 45, 10, .35);
}
/* gold rope + tassel at the narrowest point */
.tieback {
  position: absolute; top: 62%; width: 34px; height: 76px; margin: -8px 0 0 -17px; z-index: 2;
  opacity: calc((var(--p, 0) - .35) * 3);
  filter: drop-shadow(0 3px 4px rgba(70, 45, 10, .35));
}
.tieback svg { width: 100%; height: 100%; display: block; }
.c-l .tieback { left: calc((1 - var(--p, 0) * .8) * (1 - var(--p, 0) * .4) * 100%); }
.c-r .tieback { right: calc((1 - var(--p, 0) * .8) * (1 - var(--p, 0) * .4) * 100% - 34px); }
.valance {
  position: absolute; left: -2%; top: 0; z-index: 3; width: 104%; height: 76px;
  filter: drop-shadow(0 6px 8px rgba(70, 45, 10, .28));
}
.bloom-hint {
  position: absolute; left: 0; right: 0; bottom: 8%; z-index: 4;
  font: italic 500 19px/1 var(--script); color: var(--title);
  text-shadow: 0 0 10px var(--cream), 0 0 4px var(--cream);
  opacity: calc(1 - var(--p, 0) * 3); animation: hintSoft 2.2s ease-in-out infinite;
}

/* ---------- 3. Countdown ---------- */
.countdown { background: var(--noise), var(--girih), var(--paper-2); }
.cd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 360px; margin: 18px auto 0; }
.cd-cell { position: relative; display: flex; flex-direction: column; align-items: center; }
.cd-cell svg { position: absolute; top: -14px; left: 50%; width: 76px; height: 76px; margin-left: -38px; fill: rgba(251, 247, 238, .9); stroke: var(--gold); stroke-width: 2.2; filter: drop-shadow(0 3px 5px rgba(90, 60, 20, .2)); }
.cd-num { position: relative; height: 48px; display: flex; align-items: center; font: 500 38px/1 var(--script); color: var(--title); font-variant-numeric: lining-nums tabular-nums; }
.cd-lbl { position: relative; margin-top: 22px; font: italic 14px/1 var(--text); color: var(--ink-2); }
.cd-done { font-size: 34px; }

/* ---------- 4. Events: scratch-to-reveal + timeline ---------- */
.events { overflow: hidden; }
.reveal-hint { display: inline-flex; align-items: center; gap: 8px; font: italic 16px/1.3 var(--text); color: var(--ink-2); animation: hint 2.4s ease-in-out infinite; }
.reveal-hint svg { width: 22px; height: 22px; color: var(--gold); animation: rub 1.6s ease-in-out infinite; }
@keyframes rub { 0%, 100% { transform: translateX(-4px) rotate(-8deg); } 50% { transform: translateX(5px) rotate(6deg); } }
.date-reveal.is-revealed .reveal-hint { opacity: 0; height: 0; margin: 0; overflow: hidden; animation: none; transition: opacity .4s, height .4s .2s; }
.scratch-row { display: flex; justify-content: center; gap: 12px; margin: 18px auto 0; }
.sc {
  position: relative; width: 94px; height: 120px; flex: none; border-radius: 8px; overflow: hidden;
  background: var(--noise), var(--cream);
  box-shadow: 0 0 0 3px #D9B866, 0 0 0 4px #8F6A25, 0 0 0 7px var(--paper), 0 0 0 8px var(--line), 0 12px 22px rgba(90, 60, 20, .18);
  touch-action: none; cursor: grab; outline-offset: 10px;
  transition: transform .5s var(--ease);
}
.sc:nth-child(2) { width: 110px; }
.sc-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 6px; }
.sc-value { font: 500 46px/1 var(--script); color: var(--title); font-variant-numeric: lining-nums; }
.sc-month { font-size: 30px; font-style: italic; }
.sc-label { margin-top: 6px; font: italic 13px/1 var(--text); color: var(--ink-2); }
.sc-foil { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .7s ease; }
.sc.is-done { animation: pop .7s var(--ease); }
.sc.is-done .sc-foil { opacity: 0; pointer-events: none; }
.sc.is-done .sc-value { animation: glowText 1.6s ease; }
@keyframes pop { 40% { transform: scale(1.1) rotate(-2deg); } 70% { transform: scale(.97); } }
@keyframes glowText { 0% { text-shadow: 0 0 22px rgba(216, 180, 106, 1); } 100% { text-shadow: none; } }
.reveal-result { margin-top: 20px; font-size: 30px; line-height: 1.15; color: var(--pom); opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .8s var(--ease) .2s, transform .8s var(--ease) .2s; }
.date-reveal.is-revealed .reveal-result { opacity: 1; transform: none; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* --- month calendar: opens after the scratch reveal --- */
.cal { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 1s var(--ease) .5s, opacity .8s ease .5s; }
.cal-inner { overflow: hidden; min-height: 0; }
.date-reveal.is-revealed .cal { grid-template-rows: 1fr; opacity: 1; }
.cal-card {
  position: relative; max-width: 320px; margin: 22px auto 0; padding: 20px 16px 16px; border-radius: 14px;
  background: var(--noise), var(--cream);
  box-shadow: 0 0 0 1px #D9B866, 0 0 0 5px var(--cream), 0 0 0 6px var(--line), 0 14px 26px rgba(90, 60, 20, .14);
  transform: perspective(700px) rotateX(-70deg); transform-origin: 50% 0; transition: transform 1.1s cubic-bezier(.2, .9, .25, 1.15) .6s;
}
.date-reveal.is-revealed .cal-card { transform: none; }
.cal-card::before, .cal-card::after { /* two gold rings, like a desk calendar */
  content: ""; position: absolute; top: -9px; width: 10px; height: 18px; border-radius: 5px;
  background: var(--metal); box-shadow: 0 2px 3px rgba(90, 60, 20, .35);
}
.cal-card::before { left: 28%; } .cal-card::after { right: 28%; }
.cal-head { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-bottom: 12px; }
.cal-head .script { font-size: 30px; line-height: 1; color: var(--title); }
.cal-year { font: italic 15px/1 var(--text); color: var(--ink-2); letter-spacing: .12em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-grid .wk { font: italic 12px/26px var(--text); color: var(--gold-d); }
.cal-grid .wk.we { color: var(--pom); }
.cal-grid .d {
  position: relative; display: grid; place-items: center; height: 34px;
  font: 500 17px/1 var(--script); color: var(--ink); font-variant-numeric: lining-nums;
  opacity: 0; transform: translateY(6px) scale(.7);
  transition: opacity .45s ease, transform .5s cubic-bezier(.3, 1.5, .5, 1);
  transition-delay: calc(1s + var(--i) * 22ms);
}
.cal-grid .d.past { color: rgba(128, 106, 82, .55); }
.date-reveal.is-revealed .cal-grid .d { opacity: 1; transform: none; }
.cal-grid .d.is-day b { position: relative; z-index: 1; font-weight: 600; color: var(--pom); transition: color .4s ease 2.2s, transform .6s cubic-bezier(.3, 1.8, .5, 1) 2.2s; }
.date-reveal.is-revealed .cal-grid .d.is-day b { transform: scale(1.25); }
.cal-ring { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; overflow: visible; pointer-events: none; }
.cal-ring path { fill: none; stroke: url(#goldGrad); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 1px 1px rgba(90, 60, 20, .35)); }
.date-reveal.is-revealed .cal-ring path { animation: drawRing 1.1s cubic-bezier(.6, .1, .3, 1) 1.9s forwards; }
@keyframes drawRing { to { stroke-dashoffset: 0; } }
.cal-pom { position: absolute; z-index: 2; right: -2px; top: -9px; width: 17px; height: 20px; overflow: visible; color: var(--pom); opacity: 0; transform: scale(0) rotate(-30deg); }
.date-reveal.is-revealed .cal-pom { animation: pomPop .6s cubic-bezier(.3, 1.8, .5, 1) 2.9s forwards, pomBeat 1.8s ease-in-out 3.6s infinite; }
@keyframes pomPop { to { opacity: 1; transform: none; } }
@keyframes pomBeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.18); } }
.cal-add { margin: 22px auto 12px; max-width: 26ch; font: italic 16px/1.4 var(--text); color: var(--ink-2); }
.cal-btns { display: grid; gap: 10px; max-width: 320px; margin: 0 auto 6px; }
.cal-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.cal-btn svg { width: 19px; height: 19px; flex: none; }
.cal-add, .cal-btns { opacity: 0; transform: translateY(10px); transition: opacity .7s ease 3.2s, transform .7s var(--ease) 3.2s; }
.date-reveal.is-revealed .cal-add, .date-reveal.is-revealed .cal-btns { opacity: 1; transform: none; }
.confetti i { position: absolute; top: 0; width: 8px; height: 8px; background: var(--c, var(--gold)); transform: rotate(45deg); animation: fall var(--d, 2.6s) cubic-bezier(.25, .6, .4, 1) var(--delay, 0s) forwards; opacity: 0; }
.confetti i:nth-child(3n) { border-radius: 50%; background: var(--pearl); }
@keyframes fall {
  0% { opacity: 1; transform: translate(0, 120px) rotate(45deg) scale(.4); }
  20% { opacity: 1; transform: translate(calc(var(--x) * .35), 60px) rotate(140deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--x), 620px) rotate(520deg) scale(.8); }
}
.events .timeline-wrap { margin-top: 26px; }

.timeline-wrap { position: relative; max-width: 380px; margin: 0 auto; }
.tl-line { position: absolute; top: 12px; bottom: 30px; left: 97px; width: 2px; margin-left: -1px; background: rgba(196, 154, 69, .25); border-radius: 2px; }
.tl-fill { position: absolute; inset: 0; transform-origin: top; transform: scaleY(0); background: linear-gradient(#FFF2C4, var(--gold) 60%, var(--gold-d)); box-shadow: 0 0 10px rgba(216, 180, 106, .9); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; text-align: left; }
.ev { display: grid; grid-template-columns: 84px 28px 1fr; padding-bottom: 26px; }
.ev:last-child { padding-bottom: 0; }
.ev-time { font: 500 30px/1 var(--script); color: var(--title); text-align: right; padding-right: 6px; padding-top: 14px; font-variant-numeric: lining-nums; }
.ev-mark { position: relative; display: flex; justify-content: center; padding-top: 19px; }
.ev-mark::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%; transform: scale(.7);
  background: var(--pearl); box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--line);
  transition: transform .5s var(--ease), box-shadow .5s;
}
.ev-mark::after { content: ""; position: absolute; top: 14px; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; border: 1px solid var(--gold); opacity: 0; }
.ev.is-lit .ev-mark::before { transform: scale(1.1); box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--gold), 0 0 14px 5px rgba(240, 200, 110, .8); }
.ev.is-lit .ev-mark::after { animation: ring 2.4s ease-out infinite; }
.ev:first-child .ev-mark::before { display: none; }
.ev-pom { width: 22px; height: 26px; color: var(--pom); margin-top: -8px; background: var(--paper); border-radius: 50%; transition: transform .5s var(--ease), filter .5s; transform: scale(.7); }
.ev.is-lit .ev-pom { transform: scale(1.1); filter: drop-shadow(0 0 8px rgba(216, 120, 100, .6)); }
.ev-card {
  position: relative; margin-left: 6px; padding: 12px 46px 12px 14px; overflow: hidden;
  background: var(--noise), var(--cream); border-radius: 8px;
  box-shadow: 0 0 0 1px #D9B866, 0 0 0 4px var(--cream), 0 0 0 5px var(--line), 0 10px 20px rgba(90, 60, 20, .1);
}
.ev-card::before { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 50%; background: linear-gradient(100deg, transparent, rgba(255, 236, 190, .75), transparent); transform: skewX(-18deg); opacity: 0; }
.ev.is-in .ev-card::before { animation: sheen 1.3s ease .5s; }
@keyframes sheen { 0% { left: -60%; opacity: 1; } 100% { left: 130%; opacity: 1; } }
.ev-icon { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; color: var(--gold); }
.ev-icon .steam { animation: steam 2.4s ease-in-out infinite; opacity: 0; }
.ev-icon .s2 { animation-delay: .5s; } .ev-icon .s3 { animation-delay: 1s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-5px); } }
.ev-icon .gem { animation: twinkle 2.2s ease-in-out infinite; transform-origin: 18px 13px; }
@keyframes twinkle { 50% { fill-opacity: .9; transform: scale(1.15); } }
.ev-icon .jingles { animation: jingle 1.4s ease-in-out infinite; transform-origin: 24px 24px; }
@keyframes jingle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.ev-title { font: italic 500 25px/1.15 var(--script); color: var(--title); }
.ev-date { font: italic 14px/1.4 var(--text); color: var(--pom); margin-top: 2px; }
.ev-place { margin-top: 4px; font-size: 16px; line-height: 1.4; }
.ev-addr { color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.ev-map { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 7px 13px; border-radius: 6px; background: var(--metal); color: #3E2A0C; font: italic 14px/1 var(--text); text-decoration: none; box-shadow: 0 3px 8px rgba(90, 60, 20, .25), inset 0 1px 0 rgba(255, 255, 255, .7); }
.js .ev[data-reveal] { transform: translateX(34px); }
.js .ev[data-reveal] .ev-time { opacity: 0; transform: translateY(8px); transition: opacity .7s ease .25s, transform .7s var(--ease) .25s; }
.js .ev.is-in .ev-time { opacity: 1; transform: none; }

/* ---------- 5. Location ---------- */
.location { padding-top: 24px; }
/* arched window (Persian arch) holding the venue photo or looping video */
.venue-media {
  position: relative; width: min(100%, 290px); aspect-ratio: 4 / 5; margin: 0 auto 22px; overflow: hidden;
  border-radius: 50% 50% 10px 10px / 30% 30% 10px 10px; background: var(--paper-2);
  box-shadow: 0 0 0 1px #B98E3E, 0 0 0 5px var(--cream), 0 0 0 6px rgba(196, 154, 69, .6), 0 14px 26px rgba(90, 60, 20, .2);
  -webkit-mask-image: -webkit-radial-gradient(white, black);   /* keeps the rounded clip on Safari videos */
}
.venue-media img, .venue-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.venue-media::after { /* soft inner glow along the arch */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 245, 220, .6), inset 0 -40px 50px -30px rgba(60, 40, 10, .25);
}
.loc-name { font: 500 27px/1.2 var(--script); color: var(--title); }
.loc-addr { color: var(--ink-2); margin-top: 2px; }
.map-frame {
  position: relative; margin: 20px auto 0; aspect-ratio: 4 / 3.4; border-radius: 8px; overflow: hidden;
  box-shadow: 0 0 0 1px #B98E3E, 0 0 0 4px var(--cream), 0 0 0 5px var(--line);
  background: var(--noise), var(--girih), var(--paper-2);
}
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-load { position: absolute; inset: 0; border: 0; background: none; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font: italic 500 22px/1.2 var(--script); color: var(--title); }
.map-pin { width: 34px; height: 40px; color: var(--pom); filter: drop-shadow(0 4px 6px rgba(122, 35, 51, .35)); animation: nudge 2s ease-in-out infinite; }
.loc-hint { margin: 22px 0 12px; font: italic 15px/1.3 var(--text); color: var(--ink-2); }
.map-btns { display: grid; gap: 10px; }

/* ---------- Notes ---------- */
.notes { padding-top: 24px; }
.note { position: relative; max-width: 340px; margin: 0 auto; padding: 22px 20px; border-radius: 10px; background: var(--noise), var(--cream); box-shadow: 0 0 0 1px #D9B866, 0 0 0 4px var(--cream), 0 0 0 5px var(--line), 0 10px 20px rgba(90, 60, 20, .08); }
.note + .note { margin-top: 22px; }
.note-bloom { width: 34px; height: 34px; color: var(--gold); display: block; margin: 0 auto 8px; }
.note h3 { font: italic 500 28px/1.15 var(--script); color: var(--title); }
.note p { max-width: 30ch; margin: 6px auto 0; }

/* ---------- 6. Gallery ---------- */
.gallery { padding-left: 14px; padding-right: 14px; }
.grid { columns: 2; column-gap: 12px; }
.grid button {
  display: block; width: 100%; padding: 0; border: 0; margin: 0 0 12px;
  background: var(--paper-2); break-inside: avoid; border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 3px var(--cream), 0 0 0 4px #C49A45, 0 8px 16px rgba(90, 60, 20, .15);
}
.grid button.tall { border-radius: 999px 999px 6px 6px; }
.grid img { width: 100%; height: auto; transition: transform .6s var(--ease), opacity .5s; opacity: 0; }
.grid img.is-loaded { opacity: 1; }
.grid button:active img { transform: scale(.98); }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(28, 20, 10, .95); overflow: hidden; touch-action: pan-y; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
.lb-track { display: flex; height: 100%; transition: transform .35s var(--ease); }
.lb-track.is-dragging { transition: none; }
.lb-slide { flex: 0 0 100%; height: 100%; display: grid; place-items: center; padding: 56px 8px; }
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-close, .lb-nav { position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: var(--cream); width: 44px; height: 44px; border-radius: 50%; font: 300 28px/1 var(--text); display: grid; place-items: center; }
.lb-close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
.lb-nav { top: 50%; translate: 0 -50%; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
.lb-count { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: var(--gold-l); font: 500 17px/1 var(--script); letter-spacing: .12em; }
@media (hover: none) { .lb-nav { display: none; } }

/* ---------- 7. Footer ---------- */
.footer { text-align: center; padding: 50px var(--gutter) max(90px, calc(env(safe-area-inset-bottom) + 80px)); background: var(--noise), var(--paper-2); }
.footer-line { font-size: 32px; line-height: 1.15; }
.footer-names { font: 500 22px/1.2 var(--script); letter-spacing: .06em; color: var(--ink-2); margin-top: 8px; }
.footer-date { margin-top: 6px; font: 500 18px/1 var(--script); letter-spacing: .25em; color: var(--gold-d); font-variant-numeric: lining-nums; }
.replay { margin-top: 28px; }
.made-by { margin-top: 36px; font-size: 13px; color: var(--ink-2); }
.made-by a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--gold); }

/* ---------- Scroll reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (max-width: 370px) {
  :root { --gutter: 20px; }
  .hero-names { font-size: 52px; }
  .title { font-size: 36px; }
  .bloom-title { font-size: 38px; }
  .cart-names { font-size: 40px; }
  .cd-num { font-size: 34px; }
  .cd-cell svg { width: 68px; height: 68px; margin-left: -34px; top: -10px; }
  .tl-line { left: 85px; }
  .ev { grid-template-columns: 72px 26px 1fr; }
  .sc { width: 86px; height: 112px; } .sc:nth-child(2) { width: 104px; }
  .ev-card { padding-right: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .bloom { height: auto; } .bloom-sticky { position: relative; height: auto; padding: 100px 0 60px; } .curtain, .bloom-hint { display: none; }
  .bloom-text { opacity: 1; transform: none; }
}
@keyframes hintSoft { 50% { filter: opacity(.4); } }
