/**
 * Shared template engine styles. Theme-agnostic: every visual identity
 * (colour, type, motif) comes from each template's theme.css, which sets
 * the --t-* custom properties consumed here. Animate transform/opacity
 * only. Respects prefers-reduced-motion throughout.
 */

:root{
  --t-bg: #141210;
  --t-bg-2: #1c1915;
  --t-ink: #F6F0E4;
  --t-ink-soft: rgba(246,240,228,.78);
  --t-accent: #B8924A;
  --t-accent-2: #5B1A1F;
  --t-muted: rgba(246,240,228,.5);
  --t-paper: #F6F0E4;
  --t-font-display: 'Cormorant Garamond', serif;
  --t-font-body: 'Cormorant Garamond', serif;
  --t-font-bn-display: 'Tiro Bangla', serif;
  --t-font-bn-body: 'Hind Siliguri', sans-serif;
  --t-font-script: 'Pinyon Script', cursive;
  --t-radius: 18px;

  --e-ease: cubic-bezier(.22,1,.36,1);
  --e-dur-s: 320ms;
  --e-dur-m: 700ms;
  --e-dur-l: 1300ms;
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){ html{ scroll-behavior: auto; } }

html,body{ height: 100%; }
body{
  margin: 0;
  background: var(--t-bg);
  color: var(--t-ink);
  font-family: var(--t-font-body);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
html.lang-bn body{ font-family: var(--t-font-bn-body); font-size: 17px; line-height: 1.75; }

img{ max-width: 100%; display: block; }
button{ font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1,h2,h3{ font-family: var(--t-font-display); font-weight: 500; margin: 0; }
html.lang-bn h1, html.lang-bn h2, html.lang-bn h3{ font-family: var(--t-font-bn-display); font-weight: 600; }
p{ margin: 0; }

.t-engine{ position: relative; }

/* Chapters */
.chapter{
  min-height: 100svh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; padding: 64px 22px; text-align: center;
}
.chapter[data-reveal-el]{ opacity: 0; transform: translateY(26px); transition: opacity var(--e-dur-l) var(--e-ease), transform var(--e-dur-l) var(--e-ease); }
.chapter[data-reveal-el].is-visible{ opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce){
  .chapter[data-reveal-el]{ opacity: 1; transform: none; transition: none; }
}

/* ---------- Cover ---------- */
.cover{
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--t-bg); gap: 26px; padding: 24px;
  transition: opacity var(--e-dur-l) var(--e-ease), visibility var(--e-dur-l) var(--e-ease);
}
.cover[data-open="true"]{ opacity: 0; visibility: hidden; pointer-events: none; }
.cover__eyebrow{ font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--t-muted); }
.cover__name{ font-size: clamp(2.1rem, 9vw, 3.6rem); color: var(--t-accent); font-style: italic; letter-spacing: .01em; }
html.lang-bn .cover__name{ font-style: normal; }
.cover__tap{
  margin-top: 18px; width: 86px; height: 86px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--t-accent) 55%, transparent);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.cover__tap::before{
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--t-accent) 35%, transparent);
  animation: t-pulse 2.6s var(--e-ease) infinite;
}
@keyframes t-pulse{
  0%{ transform: scale(.86); opacity: .9; }
  70%{ transform: scale(1.28); opacity: 0; }
  100%{ transform: scale(1.28); opacity: 0; }
}
@media (prefers-reduced-motion: reduce){ .cover__tap::before{ animation: none; opacity: .5; } }
.cover__tap span{ font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--t-ink); }
.cover__hint{ font-size: 13.5px; color: var(--t-muted); max-width: 260px; }

/* ---------- Headline (word mask reveal) ---------- */
.headline{ display: flex; flex-wrap: wrap; justify-content: center; gap: .32em; max-width: 820px; }
.headline__word{ overflow: hidden; display: inline-block; }
.headline__word span{
  display: inline-block; transform: translateY(110%); opacity: 0;
  transition: transform var(--e-dur-l) var(--e-ease), opacity var(--e-dur-l) var(--e-ease);
}
.is-visible .headline__word span{ transform: translateY(0); opacity: 1; }
.headline--title span{ font-size: clamp(2.3rem, 7vw, 4.2rem); color: var(--t-ink); }
.headline--sub{ margin-top: 14px; }
.headline--sub span{ font-size: clamp(1.1rem, 3vw, 1.5rem); color: var(--t-accent); font-style: italic; }
html.lang-bn .headline--sub span{ font-style: normal; }

/* ---------- Album ---------- */
.album{ width: 100%; max-width: 980px; }
.album__grid{ display: grid; gap: 28px; grid-template-columns: repeat(2, 1fr); padding-top: 18px; }
@media (min-width: 640px){ .album__grid{ grid-template-columns: repeat(3, 1fr); } }
.album__item{
  position: relative; background: var(--t-paper); padding: 10px 10px 34px; border-radius: 4px;
  box-shadow: 0 14px 30px -14px rgba(0,0,0,.55);
  transform: rotate(var(--r, -2deg)) translateY(0); transition: transform var(--e-dur-m) var(--e-ease), box-shadow var(--e-dur-m) var(--e-ease);
}
.album__item:nth-child(3n+1){ --r: -3deg; }
.album__item:nth-child(3n+2){ --r: 2deg; }
.album__item:nth-child(3n+3){ --r: -1.4deg; }
.album__item img{ width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; }
.album__item.is-lifted{ transform: rotate(0deg) translateY(-10px) scale(1.04); box-shadow: 0 28px 50px -16px rgba(0,0,0,.6); z-index: 2; }
.album__item .tape{
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%) rotate(-3deg);
  width: 64px; height: 22px; background: color-mix(in srgb, var(--t-accent) 35%, #fff 65%); opacity: .75;
}

/* ---------- Hold to wish ---------- */
.wish{ display: flex; flex-direction: column; align-items: center; gap: 22px; }
.wish__prompt{ font-size: clamp(1.1rem, 3.4vw, 1.5rem); color: var(--t-ink); max-width: 480px; min-height: 2.6em; }
.wish__stage{ position: relative; width: 190px; height: 190px; display: flex; align-items: center; justify-content: center; }
.wish__ring{ position: absolute; inset: 0; transform: rotate(-90deg); }
.wish__ring circle{ fill: none; stroke-width: 3; }
.wish__ring .track{ stroke: color-mix(in srgb, var(--t-ink) 18%, transparent); }
.wish__ring .fill{ stroke: var(--t-accent); stroke-linecap: round; transition: stroke-dashoffset 80ms linear; }
.wish__object{
  width: 86px; height: 86px; display: flex; align-items: center; justify-content: center;
  transition: transform var(--e-dur-m) var(--e-ease), filter var(--e-dur-m) var(--e-ease);
  touch-action: none; cursor: pointer; user-select: none;
}
.wish__object svg{ width: 100%; height: 100%; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--t-accent) 55%, transparent)); }
.wish__object.is-holding{ transform: scale(1.1); }
.wish__object.is-complete{ transform: translateY(-120px) scale(1.25); filter: brightness(1.3); }
.wish__early{ font-size: 14px; color: var(--t-muted); max-width: 320px; min-height: 1.4em; opacity: 0; transition: opacity var(--e-dur-s) var(--e-ease); }
.wish__early.is-visible{ opacity: 1; }
.wish__done{ font-size: 15px; color: var(--t-accent); opacity: 0; transition: opacity var(--e-dur-m) var(--e-ease); max-width: 360px; }
.wish__done.is-visible{ opacity: 1; }
.wish__hint{ font-size: 13px; color: var(--t-muted); letter-spacing: .04em; }
.wish__canvas{ position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ---------- Letter ---------- */
.letter{ width: 100%; max-width: 620px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.letter__page{ min-height: 180px; display: flex; align-items: center; }
.letter__text{ font-size: clamp(1.05rem, 2.6vw, 1.3rem); line-height: 1.8; color: var(--t-ink-soft); }
.letter__nav{ display: flex; align-items: center; gap: 18px; }
.letter__dots{ display: flex; gap: 8px; }
.letter__dots span{ width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--t-ink) 28%, transparent); transition: background var(--e-dur-s) var(--e-ease), transform var(--e-dur-s) var(--e-ease); }
.letter__dots span.is-active{ background: var(--t-accent); transform: scale(1.3); }
.letter__btn{ width: 48px; height: 48px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--t-accent) 45%, transparent); display: flex; align-items: center; justify-content: center; transition: background var(--e-dur-s) var(--e-ease); }
.letter__btn:hover{ background: color-mix(in srgb, var(--t-accent) 14%, transparent); }
.letter__btn svg{ width: 18px; height: 18px; }
.letter__btn[disabled]{ opacity: .3; pointer-events: none; }

/* ---------- Finale ---------- */
.finale__mark{ font-family: var(--t-font-script); font-size: clamp(2.4rem, 9vw, 3.6rem); color: var(--t-accent); margin-bottom: 18px; }
.finale__text{ font-size: clamp(1.05rem, 2.6vw, 1.3rem); color: var(--t-ink-soft); max-width: 520px; }
.finale__credit{ position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 11.5px; letter-spacing: .05em; color: var(--t-muted); }
.finale__credit a{ color: inherit; }

/* ---------- Lang toggle ---------- */
.t-lang{
  position: fixed; top: 16px; right: 16px; z-index: 70;
  display: inline-flex; border: 1px solid color-mix(in srgb, var(--t-accent) 45%, transparent); border-radius: 999px; padding: 3px; gap: 2px;
  background: color-mix(in srgb, var(--t-bg) 70%, transparent); backdrop-filter: blur(6px);
}
.t-lang button{ padding: 6px 11px; border-radius: 999px; font-size: 12px; color: var(--t-muted); }
.t-lang button.is-active{ background: var(--t-accent); color: var(--t-bg); }

/* ---------- Reveal art (scroll-linked) ---------- */
.reveal{ pointer-events: none; }
.reveal__panel{
  position: absolute; top: 0; bottom: 0; width: 52%;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.14) 0 3px, transparent 3px 22px),
    linear-gradient(180deg, color-mix(in srgb, var(--t-bg-2) 92%, var(--t-accent) 8%), var(--t-bg-2));
  box-shadow: inset -30px 0 60px -30px rgba(0,0,0,.5);
  will-change: transform;
}
.reveal__panel--left{ left: 0; transform-origin: left center; }
.reveal__panel--right{ right: 0; transform-origin: right center; box-shadow: inset 30px 0 60px -30px rgba(0,0,0,.5); }

.reveal__scrim{ position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--t-bg-2) 70%, transparent), var(--t-bg)); }
.reveal__stars{ position: absolute; inset: 0; }
.reveal__star{ position: absolute; border-radius: 50%; background: var(--t-ink); opacity: 0; box-shadow: 0 0 8px color-mix(in srgb, var(--t-ink) 70%, transparent); transform: scale(.4); will-change: opacity, transform; }

.reveal__photo{
  position: absolute; inset: 0; margin: auto; width: min(76vw, 320px); height: min(78vw, 420px);
  background: var(--t-paper); padding: 14px 14px 42px; box-shadow: 0 22px 54px -16px rgba(0,0,0,.6);
  will-change: transform, opacity;
}
.reveal__photo img{ width: 100%; height: 100%; object-fit: cover; }
.reveal__photo .tape{ position: absolute; top: -10px; left: 50%; transform: translateX(-50%) rotate(-3deg); width: 72px; height: 24px; background: color-mix(in srgb, var(--t-accent) 35%, #fff 65%); opacity: .75; }

/* ---------- Event cards (wedding/holud) ---------- */
.events{ width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 18px; }
.event-card{ border: 1px solid color-mix(in srgb, var(--t-accent) 30%, transparent); border-radius: var(--t-radius); padding: 22px 24px; text-align: left; }
.event-card__name{ font-family: var(--t-font-display); font-size: 1.3rem; color: var(--t-accent); margin-bottom: 6px; }
.event-card__row{ font-size: 14.5px; color: var(--t-ink-soft); margin-bottom: 4px; }
.event-card__maps{ margin-top: 12px; display: inline-flex; font-size: 13px; color: var(--t-accent); border-bottom: 1px solid currentColor; }

.sr-only{ position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
