/* Shared by every animated template: page, typography, sections, scroll reveals, sound button, and the opening screen's shell.
   Each template adds its own artwork and opening animation in <slug>.css.
   All motion uses transform and opacity only, so it stays smooth on mid-range phones. */
*{box-sizing:border-box;margin:0;padding:0}
html.locked,html.locked body{overflow:hidden;height:100%}
body{background:var(--to);color:var(--ink);font-family:var(--ui),'Plus Jakarta Sans',system-ui,sans-serif;font-size:17px;line-height:1.6;-webkit-font-smoothing:antialiased;overflow-x:hidden}
a{color:inherit}
.defs{position:absolute;width:0;height:0;overflow:hidden}
:focus-visible{outline:2px solid var(--line);outline-offset:3px}
:root{--ease:cubic-bezier(.2,.7,.2,1);--spring:cubic-bezier(.22,1.3,.36,1)}

/* ---------- opening screen shell ---------- */
.topen{display:none}
.js .topen{position:fixed;inset:0;z-index:20;display:grid;place-items:center;background:radial-gradient(120% 80% at 50% 38%,var(--from) 0%,var(--to) 80%);transition:opacity .9s ease}
.dust{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.topen-in{position:relative;width:100%;display:flex;flex-direction:column;align-items:center;gap:22px;padding:24px 0;text-align:center}
.deva{font-family:'Tiro Devanagari Hindi',serif;font-size:15px;opacity:.9}
.topen-copy{display:flex;flex-direction:column;gap:10px;padding:0 20px;transition:opacity .5s ease,transform .5s ease}
.to-names{font-family:'Parisienne',cursive;font-size:34px;line-height:1.1}
.to-names em{font-family:'Fraunces',serif;font-style:italic;font-size:.5em;opacity:.85}
.script .to-names{font-family:var(--ui),sans-serif;font-weight:600;font-size:26px}
.script .to-names em{font-family:var(--ui),sans-serif;font-style:normal}
.cue{font-size:11px;font-weight:600;letter-spacing:.24em;text-transform:uppercase;opacity:.8;animation:t-pulse 2.4s ease-in-out infinite}
.script .cue{letter-spacing:.02em;font-size:14px;text-transform:none}
@keyframes t-pulse{50%{opacity:.35}}
.topen.open .topen-copy,.topen.open .deva{opacity:0;transform:translateY(10px)}
.topen.lift{opacity:0;pointer-events:none}

/* ---------- page ---------- */
.card{position:relative;max-width:480px;margin:0 auto;background:linear-gradient(180deg,var(--from),var(--to));min-height:100vh;box-shadow:0 0 60px rgba(0,0,0,.3);overflow:hidden}
.thero{position:relative;min-height:min(100svh,820px);padding:28px 26px 60px;display:flex;flex-direction:column;align-items:center}
.frame{position:absolute;pointer-events:none}
.frame path{fill:none;stroke:var(--line);stroke-width:1.3;vector-effect:non-scaling-stroke;stroke-dasharray:1;stroke-dashoffset:0}
.frame .in{stroke-width:.7;opacity:.6}
.thero-in{position:relative;display:flex;flex-direction:column;align-items:center;gap:14px;text-align:center;flex:1}
.cap{font-size:12px;font-weight:600;letter-spacing:.22em;text-transform:uppercase}
.script .cap{letter-spacing:.04em;font-size:15px;text-transform:none}
.dear{font-family:'Fraunces',serif;font-style:italic;font-size:19px}
.script .dear{font-family:var(--ui),sans-serif;font-style:normal}
.names{font-family:'Parisienne',cursive;font-weight:400;font-size:clamp(52px,16vw,74px);line-height:1.02;display:flex;flex-direction:column;align-items:center}
.names em{font-family:'Fraunces',serif;font-style:italic;font-size:.34em;margin:.25em 0;opacity:.85}
.script .names{font-family:var(--ui),sans-serif;font-weight:600;font-size:clamp(40px,12vw,56px);line-height:1.3}
.script .names em{font-family:var(--ui),sans-serif;font-style:normal}
.names.sm{font-size:30px;display:block}
.rule{width:64px;height:1px;background:var(--line);margin:6px 0}
.city{font-family:'Fraunces',serif;font-style:italic;font-size:18px}
.script .city{font-family:var(--ui),sans-serif;font-style:normal}
.scrollcue{margin-top:auto;width:1px;height:38px;background:linear-gradient(var(--line),transparent);animation:t-drop 2.2s ease-in-out infinite;transform-origin:top}
@keyframes t-drop{0%{transform:scaleY(0)}55%{transform:scaleY(1);opacity:1}100%{transform:scaleY(1);opacity:0}}

/* hero entrance, played once the opening has lifted: the frame draws itself, then the text rises in order */
.js .card:not(.entered) .thero .a{opacity:0}
.js .card:not(.entered) .frame path{stroke-dashoffset:1}
.js .card:not(.entered) .crest{opacity:0;scale:.6}
.card.entered .crest{transition:opacity .8s ease,scale .9s var(--spring)}
.card.entered .frame path{transition:stroke-dashoffset 2s var(--ease) .15s}
.card.entered .frame .in{transition-delay:.45s}
.card.entered .thero .a{animation:t-rise .9s var(--ease) both}
.card.entered .thero-in>.a:nth-child(1){animation-delay:.25s}.card.entered .thero-in>.a:nth-child(2){animation-delay:.4s}
.card.entered .thero-in>.a:nth-child(3){animation-delay:.55s}.card.entered .thero-in>.a:nth-child(4){animation-delay:.9s}
.card.entered .thero-in>.a:nth-child(5){animation-delay:1.05s}.card.entered .thero-in>.a:nth-child(6){animation-delay:1.2s}
.card.entered .thero-in>.a:nth-child(7){animation-delay:1.6s}
.card.entered .names .a:nth-child(1){animation-delay:.6s}.card.entered .names .a:nth-child(2){animation-delay:.78s}.card.entered .names .a:nth-child(3){animation-delay:.96s}
@keyframes t-rise{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}

.tsec{position:relative;padding:56px 28px;text-align:center}
.tsec+.tsec::before,.tfoot::before{content:"";position:absolute;top:0;left:28px;right:28px;height:1px;background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--line) 60%,transparent),transparent)}
h2{font-family:'Fraunces',serif;font-weight:500;font-size:28px;line-height:1.2;margin-bottom:24px;color:var(--line)}
.script h2{font-family:var(--ui),sans-serif;font-weight:700;font-size:24px}
.divider{display:block;margin:0 auto 18px;color:var(--line)}
.line{max-width:30ch;margin:0 auto;font-size:18px}
.count{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;max-width:340px;margin:28px auto 0}
.count div{border:1px solid var(--line);border-radius:999px 999px 10px 10px;padding:16px 0 10px;background:color-mix(in srgb,var(--line) 8%,transparent)}
.count b{display:block;font-size:28px;font-weight:600;line-height:1.1;font-variant-numeric:tabular-nums}
.count span{font-size:10px;letter-spacing:.14em;text-transform:uppercase;opacity:.8}
.script .count span{letter-spacing:0;font-size:12px;text-transform:none}

/* functions: a line that fills as you scroll past it */
.tl{list-style:none;position:relative;max-width:340px;margin:0 auto;text-align:left;display:flex;flex-direction:column;gap:14px;padding-left:34px}
.tl-line{position:absolute;left:9px;top:8px;bottom:8px;width:2px;border-radius:2px;background:color-mix(in srgb,var(--line) 22%,transparent);overflow:hidden}
.tl-line i{display:block;width:100%;height:100%;background:var(--line);transform-origin:top;transform:scaleY(var(--p,0))}
.tl li{position:relative;border:1px solid color-mix(in srgb,var(--line) 50%,transparent);border-radius:16px;padding:14px 18px;display:flex;flex-direction:column}
.tl li.main{border-color:var(--line);background:color-mix(in srgb,var(--line) 12%,transparent)}
.tl-dot{position:absolute;left:-33px;top:20px;width:18px;height:18px;border-radius:50%;background:radial-gradient(circle,var(--to) 0 30%,var(--line) 32%);box-shadow:0 0 0 3px var(--to)}
.tl time{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--line)}
.script .tl time{letter-spacing:0;font-size:14px;text-transform:none}
.ev-body{display:flex;flex-direction:column;min-width:0}
.ev-body>b{font-size:20px;font-weight:600}
.ev-venue{font-size:14px;opacity:.85}
/* pieces a template may switch on: a date block, and a progress ring round each countdown number */
.ev-date{display:none;flex-direction:column;align-items:center;justify-content:center;line-height:1.1}
.ev-date b{font-size:24px;font-weight:600}
.ev-date i{font-style:normal;font-size:10px;font-weight:600;letter-spacing:.14em;text-transform:uppercase}
.script .ev-date i{letter-spacing:0;font-size:12px;text-transform:none}
.ev-date em{display:none;font-style:normal}
.ring{display:none}
.ring circle{fill:none}
.rp{stroke-dasharray:1;stroke-dashoffset:calc(1 - var(--f,0));transition:stroke-dashoffset .6s linear}
.tl-cal{align-self:flex-start;margin-top:10px;font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;text-decoration:none;color:var(--line);border-bottom:1px solid color-mix(in srgb,var(--line) 50%,transparent);padding-bottom:1px}
.script .tl-cal{letter-spacing:0;font-size:13px;text-transform:none}
.venue{font-size:22px;font-weight:600}
.tsec .ibtn{margin-top:20px}
.tfoot{position:relative;padding:48px 28px calc(64px + env(safe-area-inset-bottom,0px));text-align:center;display:flex;flex-direction:column;align-items:center;gap:14px}
.tfoot small{font-size:11px;letter-spacing:.14em;text-transform:uppercase;opacity:.6}

/* words around each section */
.eyebrow{font-size:11px;font-weight:700;letter-spacing:.24em;text-transform:uppercase;color:var(--accent,var(--line));margin-bottom:10px}
.script .eyebrow{letter-spacing:.02em;font-size:14px;text-transform:none}
.eyebrow+h2{margin-bottom:14px}
.sub,.quiet{font-family:'Fraunces',serif;font-style:italic;font-size:17px;line-height:1.45;max-width:28ch;margin:0 auto 26px;opacity:.9}
.script .sub,.script .quiet{font-family:var(--ui),sans-serif;font-style:normal;font-size:16px}
.quiet{margin:26px auto 0}
.place .sub{margin:14px auto 0}
p.script{font-family:'Parisienne',cursive;font-size:32px;line-height:1.2;max-width:15ch;margin:0 auto 18px;color:var(--accent,var(--line))}
.script p.script{font-family:var(--ui),sans-serif;font-weight:600;font-size:23px;max-width:20ch}
.count{margin-top:6px}
/* the two families */
.family{display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:30px}
.family h3{font-family:'Fraunces',serif;font-weight:500;font-size:28px;line-height:1.15}
.script .family h3{font-family:var(--ui),sans-serif;font-weight:700;font-size:25px}
.family p{font-size:14.5px;line-height:1.45;max-width:26ch;margin:6px auto 0;opacity:.85}
.fam-and{font-family:'Fraunces',serif;font-style:italic;font-size:20px;color:var(--accent,var(--line));display:flex;align-items:center;gap:14px}
.fam-and::before,.fam-and::after{content:"";width:34px;height:1px;background:currentColor;opacity:.6}
.script .fam-and{font-family:var(--ui),sans-serif;font-style:normal;font-size:16px}
/* each function's drawing and the line about it */
.ev-body{position:relative}
.ev-art{position:absolute;right:0;top:0;width:40px;height:40px;margin:0;color:var(--accent,var(--line))}
.ev-body>time,.ev-body>b{padding-right:48px}
.ev-note{font-family:'Fraunces',serif;font-style:italic;font-size:14.5px;line-height:1.4;margin-top:6px;opacity:.9}
.script .ev-note{font-family:var(--ui),sans-serif;font-style:normal;font-size:14px}
.ev-art svg{animation:t-float 4.5s ease-in-out infinite}
.ev-art .lift{animation:t-lift 2.6s ease-in-out infinite}
.ev-art .flame{transform-box:fill-box;transform-origin:50% 100%;animation:t-flame 1.5s ease-in-out infinite}
@keyframes t-float{50%{transform:translateY(-3px)}}
@keyframes t-lift{50%{transform:translateY(-2.5px)}}
@keyframes t-flame{0%,100%{transform:scale(1) skewX(0)}30%{transform:scale(.95,1.07) skewX(-3deg)}65%{transform:scale(1.03,.95) skewX(3deg)}}
/* notes */
.tsec .body{max-width:30ch;margin:0 auto;font-size:16.5px;line-height:1.6}
.letter{position:relative;max-width:330px;margin:6px auto 0;padding:28px 24px 24px;text-align:left;border-radius:6px;border:1px solid color-mix(in srgb,var(--line) 55%,transparent);background:color-mix(in srgb,var(--line) 9%,transparent)}
.letter::before{content:"\201C";position:absolute;left:16px;top:-6px;font-family:'Fraunces',serif;font-size:64px;line-height:1;color:var(--accent,var(--line));opacity:.55}
.letter p{font-family:'Fraunces',serif;font-style:italic;font-size:18px;line-height:1.55}
.script .letter p{font-family:var(--ui),sans-serif;font-style:normal;font-size:16.5px}
.letter .sign{display:block;margin-top:18px;text-align:right;font-size:13px;letter-spacing:.06em;opacity:.9}
.letter .sign b{font-family:'Parisienne',cursive;font-weight:400;font-size:27px;letter-spacing:0;color:var(--accent,var(--line))}
.script .letter .sign b{font-family:var(--ui),sans-serif;font-weight:700;font-size:19px}
.tfoot .eyebrow{margin:6px 0 -4px}

/* section drawings: the lines draw themselves when the section scrolls into view */
.motif{display:block;width:64px;height:64px;margin:0 auto 14px;color:var(--line)}
.motif svg{display:block;width:100%;height:100%;overflow:visible}
.motif path,.motif circle{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:0}
.js .rv:not(.in) .motif path,.js .rv:not(.in) .motif circle,.js .motif.rv:not(.in) path,.js .motif.rv:not(.in) circle{stroke-dashoffset:1}
.motif path,.motif circle{transition:stroke-dashoffset 1.6s var(--ease) .2s}

/* drift tied to scrolling (see base.js): the element shifts by --sy pixels */
[data-par]{translate:0 calc(var(--sy,0) * 1px)}

/* scroll reveals */
.js .rv{opacity:0;transform:translateY(24px);transition:opacity .9s var(--ease),transform .9s var(--ease)}
.js .rv.in{opacity:1;transform:none}
.js .tl li.rv{transform:translateX(18px)}
.js .tl li.rv.in{transform:none}

/* sound button */
.snd{position:fixed;top:calc(12px + env(safe-area-inset-top,0px));right:12px;z-index:30;width:40px;height:40px;border-radius:50%;border:0;cursor:pointer;
  background:rgba(255,255,255,.92);color:#0E4A47;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 16px rgba(0,0,0,.2)}
.snd[hidden]{display:none}
.snd .snd-off{display:none}
.snd[aria-pressed="true"] .snd-on{display:none}
.snd[aria-pressed="true"] .snd-off{display:inline}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition-duration:.01s!important;transition-delay:0s!important}
  .js .rv,.js .card:not(.entered) .thero .a{opacity:1;transform:none}
}

/* the language switch sits at the top of the invitation and scrolls away with it */
.tpl .ilang{position:absolute}

/* the sample invitation at /demo/<design>: a button to start with this design */
.demo-cta{position:fixed;left:50%;bottom:calc(14px + env(safe-area-inset-bottom,0px));translate:-50% 0;z-index:40;padding:14px 26px;border-radius:999px;background:#F0A81C;color:#172524;
  font:700 15px/1 'Plus Jakarta Sans',system-ui,sans-serif;text-decoration:none;white-space:nowrap;box-shadow:0 10px 26px rgba(0,0,0,.3)}
html.locked .demo-cta{display:none}
/* a clean view for the design's preview picture */
.shot .ilang,.shot .snd,.shot .scrollcue,.shot .demo-cta{display:none!important}
