/* Hamza & Tahia — the story: one continuous, scroll-scrubbed illustrated film in ivory, champagne and soft gold. */
:root {
  --serif: 'Cormorant Garamond', Georgia, serif; --script: 'Great Vibes', cursive; --caps: 'Marcellus', serif;
  --ivory: #f6efe3; --paper: #fffaf1; --ink: #3f3226; --cocoa: #5a4530; --gold: #a07a42; --rose: #9c4f5a;
  --halo: 0 0 2px var(--paper), 0 0 8px rgba(255,250,241,.95), 0 0 18px rgba(255,248,236,.8);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--ivory); }
body { margin: 0; font-family: var(--serif); color: var(--ink); -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums; }
body.locked { overflow: hidden; height: 100svh; }
p, h2, h3 { margin: 0; }

#track { width: 1px; }
/* phones fill the screen; on wider screens the story stays a tall phone-shaped column on an ivory page */
#stage, #ui { margin: 0 auto; width: min(100%, 62svh); }
#stage { position: fixed; inset: 0; overflow: hidden; background: var(--ivory); }
.scene { position: absolute; inset: 0; overflow: hidden; opacity: 0; display: none; will-change: transform, opacity; }
.kb { position: absolute; inset: 0; will-change: transform; }
.scene img, .kb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
img.x { opacity: 0; }
.kb > img.sprite { inset: auto; left: 0; top: 0; width: auto; height: auto; object-fit: fill; will-change: transform; }
#s-lane, #s-a5b, #s-a6 { transform-origin: 0 0; overflow: visible; }
#s-lane img, #s-a5b img, #s-a6 img { inset: auto; object-fit: fill; }
.kb > img.photo { inset: auto; object-fit: cover; }
.kb > img.photo[hidden] { display: none; }   /* carry the whole painting; the stage clips */
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* the card in her hand (drawn flat at 600×800, mapped with matrix3d) */
.mapped { transform-origin: 0 0; }
#cardFace { position: absolute; left: 0; top: 0; width: 600px; height: 800px; overflow: hidden; border-radius: 6px; transform-origin: 0 0; display: none; will-change: transform, opacity; }
.face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; }
.face > svg, .face > p { position: relative; z-index: 1; opacity: var(--inkA, 1); }
.face .vine { width: 220px; height: 30px; margin-top: 64px; }
.face p { margin-top: 16px; font: italic 500 58px / 1.1 var(--serif); color: #6b5a40; text-align: center; }
.face .pic { position: absolute; left: 40px; right: 40px; top: 330px; bottom: 48px; border-radius: 2px;
  box-shadow: 0 0 0 900px #fdf8ee, inset 0 0 0 1.5px rgba(160,122,66,.55); background: rgba(253,248,238,var(--picA, 1)); }

/* words */
#ui { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
@media (min-aspect-ratio: 2/3) { #stage { box-shadow: 0 0 60px rgba(90,65,30,.12); } }
#ui button, #ui a { pointer-events: auto; }
.copy { position: absolute; left: 50%; transform: translateX(-50%); width: min(90%, 400px); text-align: center; opacity: 0; visibility: hidden; }
.nm { font: 400 clamp(38px, min(11vw, 6.82svh), 52px) / 1.05 var(--serif); color: #fffaf0; letter-spacing: .02em; text-shadow: 0 1px 2px rgba(90,60,30,.55), 0 2px 18px rgba(90,60,30,.7); }
#c-names { top: max(8svh, 48px); }
#c-names .amp { margin: 0; font: 400 clamp(30px, min(8.5vw, 5.3svh), 40px) / 1 var(--script); color: var(--rose); text-shadow: 0 0 2px #fffaf0, 0 0 10px rgba(255,250,240,.95), 0 0 22px rgba(255,246,228,.9); }
#c-names .nm { color: #4a3520; text-shadow: 0 0 2px #fffaf0, 0 0 10px rgba(255,250,240,.95), 0 0 24px rgba(255,246,228,.9); }
.foot { bottom: max(5svh, 28px); font: 400 12px var(--caps); letter-spacing: .22em; text-transform: uppercase; color: #fffaf0; text-shadow: 0 1px 8px rgba(40,25,10,.6); }

.panel { padding: 22px 20px; background: rgba(255,250,241,.9); border-radius: 18px; border: 1px solid rgba(160,122,66,.28); box-shadow: 0 10px 40px rgba(40,25,10,.22); }
.pill { pointer-events: auto; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; font: 500 15px var(--serif); letter-spacing: .02em; cursor: pointer;
  background: rgba(255,250,241,.94); color: var(--cocoa); box-shadow: 0 4px 16px rgba(40,25,10,.18); transition: transform .2s; }
.pill.solid { background: var(--cocoa); color: var(--paper); }
.pill:active { transform: scale(.97); }
#walkShadow { position: absolute; left: 0; top: 0; width: 100px; height: 20px; border-radius: 50%; background: radial-gradient(closest-side, rgba(70,45,20,.38), rgba(70,45,20,0)); pointer-events: none; will-change: transform, opacity; }
#music { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; min-height: 34px; padding: 0 14px; font-size: 13px; background: rgba(255,250,241,.9); color: var(--cocoa); border: 1px solid rgba(160,122,66,.35); }
#music[hidden] { display: none; }
#music.ask { background: var(--cocoa); color: #fffaf1; border-color: var(--cocoa); animation: ask 2.4s ease-in-out infinite; }
@keyframes ask { 50% { box-shadow: 0 0 0 6px rgba(90,69,48,.18); } }
#keep { position: absolute; right: 14px; bottom: max(16px, env(safe-area-inset-bottom)); min-height: 32px; display: flex; align-items: center; margin: 0; font-size: 13px; opacity: 0; transition: opacity .5s; pointer-events: none; }
#keep.on { opacity: 1; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* opening screen: used only for the link preview (#og); guests go straight into the story */
.gate { display: none !important; }
.og .gate { display: flex !important; }
/* gate */
.gate { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center;
  background: var(--ivory) url(../img/cover.webp) center / cover no-repeat; pointer-events: auto;
  transition: opacity 1.2s cubic-bezier(.33,0,.2,1), transform 1.5s cubic-bezier(.16,1,.3,1), visibility 0s 1.2s; }
.gate.gone { opacity: 0; visibility: hidden; transform: scale(1.04); pointer-events: none; }
.gate > * { text-shadow: var(--halo); }
.pill:disabled { opacity: .65; }
.gate .pre { font: italic 400 17px var(--serif); color: #7a6448; }
.mono { font: 400 clamp(44px, min(12.5vw, 7.75svh), 76px) / 1.05 var(--script); white-space: nowrap; color: #8a6a3c; }
.mono span { color: var(--rose); font-size: .7em; }
.gdate { font: 400 13px var(--caps); letter-spacing: .2em; color: #6e5634; }
.gate .pill { margin-top: 18px; min-height: 52px; padding: 0 30px; font-size: 17px; text-shadow: none; }
.gate .sound { font: italic 400 14px var(--serif); color: #7a6448; }

/* celebrations */
#c-events { top: 0; bottom: max(3svh, 16px); padding-top: calc(min(100%, 520px) * .2 + env(safe-area-inset-top)); width: min(92%, 400px); display: flex; flex-direction: column; gap: 9px; justify-content: flex-start; }
.garland { position: absolute; top: max(0px, env(safe-area-inset-top)); left: 50%; width: 100%; max-width: 520px; transform: translateX(-50%); height: auto; }
.script { font: 400 clamp(38px, min(11vw, 6.82svh), 48px) / 1 var(--script); color: var(--rose); text-shadow: 0 0 2px #fffaf1, 0 0 6px #fffaf1, 0 0 14px rgba(255,250,241,.95), 0 0 26px rgba(255,248,236,.9); margin: 0 0 6px; }
.ev { position: relative; padding: 12px 14px 10px 58px; text-align: left; background: rgba(255,251,244,.94); border-radius: 14px; box-shadow: 0 6px 20px rgba(80,50,20,.12); border: 1px solid rgba(160,122,66,.3);
  opacity: 0; will-change: transform, opacity; }
.ev .ic { position: absolute; left: 12px; top: 14px; width: 34px; height: 34px; }
.ev h3 { font: 500 23px / 1.1 var(--serif); color: var(--ink); }
.ev .when { font: 500 15px var(--serif); color: var(--rose); margin-top: 2px; }
.ev .where { font: 400 15px / 1.3 var(--serif); color: #4a3b30; margin-top: 2px; }
.ev .note { font: italic 500 14.5px / 1.35 var(--serif); color: #8a5a2a; margin-top: 3px; }
.ev .links { display: flex; gap: 18px; margin-top: 4px; }
.ev a { font: 400 11.5px var(--caps); letter-spacing: .12em; text-transform: uppercase; color: var(--cocoa); text-decoration: none; padding: 8px 0 4px; }


/* test hook */
.settle .gate { transition: none; }
@media (prefers-reduced-motion: reduce) { #keep.on { animation: none; } }

/* link-preview capture (#og): spread the opening screen across a wide frame */
.og #stage, .og #ui { width: 100%; }
.og .gate > * { zoom: 1.3; }
.og .gate { background: radial-gradient(ellipse 34% 44% at 50% 50%, rgba(255,250,241,.92) 0 55%, rgba(255,250,241,0) 100%), var(--ivory) url(../img/cover.webp) center 8% / 100% auto no-repeat; }

/* the celebrations: title near the top, the three cards centred in the space below it */
#c-events .ev:first-of-type { margin-top: auto; }
#c-events .ev:last-of-type { margin-bottom: auto; }

/* the families, written on the clouds: dark ink on ivory, spread down the whole screen */
#c-family { top: 0; bottom: 0; width: min(88%, 420px); display: flex; flex-direction: column; justify-content: space-evenly; align-items: center;
  padding: max(7svh, 44px) 0 max(7svh, 44px); }
#c-family p { margin: 0; text-shadow: 0 0 2px #fffaf1, 0 0 10px rgba(255,250,241,.9); }
#c-family .bless { font: italic 400 clamp(22px, min(6.4vw, 3.97svh), 28px) / 1.3 var(--serif); color: var(--cocoa); }
#c-family .fam { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#c-family .nm { font: 400 clamp(40px, min(12vw, 7.2svh), 58px) / 1 var(--serif); color: var(--ink); letter-spacing: .02em; }
#c-family .par { font: italic 500 clamp(16px, min(4.5vw, 2.79svh), 19px) / 1.35 var(--serif); color: #6e5634; }
#c-family .rel { font: 500 clamp(11px, min(3.2vw, 1.95svh), 13px) / 1 var(--serif); letter-spacing: .28em; text-transform: uppercase; color: var(--cocoa); margin: 4px 0 2px; }
#c-family .wed { font: 400 clamp(30px, min(8.6vw, 5.2svh), 40px) / 1.1 var(--script); color: var(--rose); }

/* watch again: a quiet text button under the celebrations */
.again { align-self: center; margin-top: 6px; padding: 10px 18px; border: 0; background: none; cursor: pointer; pointer-events: auto;
  font: 400 12px var(--caps); letter-spacing: .14em; text-transform: uppercase; color: var(--cocoa);
  text-shadow: 0 0 2px #fffaf1, 0 0 8px rgba(255,250,241,.95), 0 0 16px rgba(255,248,236,.9); }
.again:active { transform: scale(.97); }
