/* Template previews (/templates/1-4). Everything is scoped to [data-tpl] so the real site is untouched. */
.th{display:none}
[data-tpl] .home .stage{display:none}
[data-tpl] .th{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(6px,1.5dvh,14px);
  padding:calc(env(safe-area-inset-top) + 44px) 24px 0;text-align:center;position:relative}
[data-tpl] .home .foot{height:calc(104px + env(safe-area-inset-bottom))}
[data-tpl] .home .go{top:12px;animation-delay:2.9s}

.tp-layer{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:0}
/* big bouquets on the first screens, small ones everywhere else; always behind text and buttons */
[data-tpl] .app[data-s="home"] .info-chip{opacity:0;pointer-events:none}
[data-tpl] .th .bi-wrap{margin-bottom:clamp(2px,1dvh,10px)}
[data-tpl] .app:not([data-s="home"]):not([data-s="lang"]) .fl-corner{--k:.56}
[data-tpl] .app[data-s="home"] :is(.fl-tl,.fl-tr){--k:.8}
[data-tpl] .app[data-s="puzzle"] .fl-corner{--k:.46}

/* landing pieces, shared */
.th-kicker{font-weight:700;font-size:clamp(13px,1.9dvh,15px);letter-spacing:.42em;text-transform:uppercase;padding-left:.42em;color:var(--grass-d)}
.th-inv{font-weight:400;line-height:1;font-size:clamp(50px,8.2dvh,64px)}
.th-photo{position:relative;flex:none}
.th-photo img{display:block;width:100%;height:100%;object-fit:cover}
.th-tape,.th-frame,.th-cap{display:none}
.th-names{font-weight:700;font-size:clamp(25px,3.9dvh,31px);letter-spacing:.3em;text-transform:uppercase;padding-left:.3em}
.th-names .amp{font-family:'Great Vibes',cursive;letter-spacing:0;text-transform:none;color:var(--rose);font-size:1.3em;padding:0 .1em;font-weight:400}
.th-date{font-size:clamp(16px,2.4dvh,19px);letter-spacing:.26em;font-weight:600;color:var(--grass-d);padding-left:.26em}
.home.play .th>*{animation:thUp 1.2s cubic-bezier(.22,.8,.24,1) both}
.home.play .th>.bi-wrap{animation-delay:.1s}
.home.play .th>.th-kicker{animation-delay:.2s}
.home.play .th>.th-inv{animation-delay:.35s}
.home.play .th>.th-photo{animation:thPop 1.6s cubic-bezier(.3,1.35,.45,1) .6s both}
.home.play .th>.th-names{animation-delay:2s}
.home.play .th>.th-date{animation-delay:2.3s}
.home.seen .th>*{animation:none!important}
/* keep the photo steady while screens slide (stops shimmer on iPhone) */
[data-tpl] .home{will-change:transform,opacity}
.th-photo,.th-photo img{-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:translateZ(0)}
@keyframes thUp{from{opacity:0;transform:translateY(16px)}}
@keyframes thPop{from{opacity:0;transform:scale(.7) rotate(-6deg);filter:blur(5px)}}
.home:not(.play) .th>*{opacity:0}

/* ================= 1 & 2 · Secret Garden (2 = white roses): mint, round photo ================= */
:is([data-tpl="1"],[data-tpl="2"]) .th-kicker{display:none}
:is([data-tpl="1"],[data-tpl="2"]) .th-inv{font-family:'Great Vibes',cursive;color:var(--grass-d);text-shadow:0 2px 0 #fff,0 0 18px #fff}
:is([data-tpl="1"],[data-tpl="2"]) .th-photo{width:min(62vw,32dvh,260px);aspect-ratio:1;border-radius:50%;padding:7px;background:#fffdf7;
  box-shadow:0 0 0 1.5px var(--pink),0 22px 50px rgba(50,90,40,.25)}
:is([data-tpl="1"],[data-tpl="2"]) .th-photo img{border-radius:50%}
:is([data-tpl="1"],[data-tpl="2"]) .th-photo::after{content:"";position:absolute;inset:-14px;border-radius:50%;border:1.5px solid var(--rose);opacity:0;animation:thRing 3.4s ease-out 3.4s infinite}
@keyframes thRing{0%{opacity:.7;transform:scale(.96)}100%{opacity:0;transform:scale(1.18)}}

/* ================= 3 · Polaroid Garden: sage linen, taped polaroid ================= */
[data-tpl="3"] body{background:#c6dab3}
[data-tpl="3"] .app{background:
  repeating-linear-gradient(45deg,rgba(255,255,255,.07) 0 2px,transparent 2px 6px),
  repeating-linear-gradient(-45deg,rgba(94,148,55,.04) 0 2px,transparent 2px 6px),
  radial-gradient(85% 60% at 50% 42%,#f7fbf2 0%,#e3efd8 50%,#cde1bb 100%)}
[data-tpl="3"] .th-kicker{display:none}
[data-tpl="3"] .th-inv{font-family:'Dancing Script',cursive;font-weight:600;color:var(--grass-d);font-size:clamp(46px,7.4dvh,58px)}
[data-tpl="3"] .th-photo{width:min(60vw,30dvh,250px);background:#fff;padding:11px 11px 50px;border-radius:3px;rotate:-4deg;margin:10px 0 4px;
  box-shadow:0 2px 4px rgba(0,0,0,.08),0 24px 44px rgba(120,60,80,.25)}
[data-tpl="3"] .th-photo img{aspect-ratio:1;height:auto}
[data-tpl="3"] .th-tape{display:block;position:absolute;left:50%;top:-14px;width:96px;height:28px;translate:-50% 0;rotate:3deg;z-index:2;
  background:repeating-linear-gradient(90deg,rgba(246,195,207,.85) 0 8px,rgba(242,176,192,.85) 8px 16px);box-shadow:0 2px 4px rgba(0,0,0,.08)}
[data-tpl="3"] .th-cap{display:block;position:absolute;left:0;right:0;bottom:9px;font-family:'Dancing Script',cursive;font-weight:600;font-size:26px;color:#2b2b2b}
[data-tpl="3"] .home.seen .th>.th-photo{animation:thSway 6s ease-in-out infinite!important}
[data-tpl="3"] .home.play .th>.th-photo{animation:thSway 6s ease-in-out 2.4s infinite,thPop 1.6s cubic-bezier(.3,1.35,.45,1) .6s both}
@keyframes thSway{0%,100%{rotate:-4deg}50%{rotate:-1.5deg}}
[data-tpl="3"] .th-names{display:none}
[data-tpl="3"] .th-date{color:#2b2b2b;font-size:clamp(17px,2.6dvh,20px)}
[data-tpl="3"] .script,[data-tpl="3"] .cycle{color:var(--grass-d)}
[data-tpl="3"] .btn{background:#1d1d1d;color:#fffdf7;box-shadow:0 10px 24px rgba(60,20,30,.22)}
[data-tpl="3"] .btn.ghost{background:rgba(255,255,255,.75);color:#1d1d1d;box-shadow:inset 0 0 0 1.5px #1d1d1d}
[data-tpl="3"] .go{background:#1d1d1d}
[data-tpl="3"] .go::after{border-color:#1d1d1d}
[data-tpl="3"] .card,[data-tpl="3"] .sug,[data-tpl="3"] .person,[data-tpl="3"] .opt{background:#fff;border-color:#dfead3}

/* ================= 4 · Botanical Card: photo on top, cream card below ================= */
[data-tpl="4"] body{background:#c6dab3}
[data-tpl="4"] .app{background:linear-gradient(#eef6e6 0%,#e1eed5 55%,#cfe2bf 100%)}
[data-tpl="4"] .th{justify-content:flex-start;padding-top:calc(40dvh)}
[data-tpl="4"] .app[data-s="home"] .fl-tl,[data-tpl="4"] .app[data-s="home"] .fl-tr{opacity:0;transition:opacity .8s}
[data-tpl="4"] .fl-tl,[data-tpl="4"] .fl-tr{transition:opacity .8s}
[data-tpl="4"] .th-photo{position:absolute;left:0;right:0;top:0;height:54%;width:auto;
  -webkit-mask:linear-gradient(#000 72%,transparent);mask:linear-gradient(#000 72%,transparent)}
[data-tpl="4"] .th-photo img{object-position:50% 40%}
[data-tpl="4"] .home.play .th>.th-photo{animation:thFade 1.8s ease .2s both,thKB 16s ease-in-out 2s infinite alternate}
@keyframes thFade{from{opacity:0;filter:blur(8px)}}
@keyframes thKB{to{transform:scale(1.05)}}
[data-tpl="4"] .th-kicker{order:3;color:var(--grass-d);margin-top:2px}
[data-tpl="4"] .th-inv{font-family:'Italianno',cursive;color:var(--grass-d);font-size:clamp(60px,9.6dvh,76px);order:1}
[data-tpl="4"] .th-names{order:2;font-family:'Playfair Display',serif;font-style:italic;font-weight:500;letter-spacing:.02em;text-transform:none;padding:0;font-size:clamp(34px,5.4dvh,42px);color:#161616}
[data-tpl="4"] .th-names .amp{font-family:'Italianno',cursive;font-size:1.25em}
[data-tpl="4"] .th-kicker{display:none}
[data-tpl="4"] .th-date{order:4;color:#161616;border-top:1px solid #cfe0bf;border-bottom:1px solid #cfe0bf;padding:8px 0 8px .26em;width:min(80%,280px)}
[data-tpl="4"] .script,[data-tpl="4"] .cycle{color:var(--grass-d)}
[data-tpl="4"] .card,[data-tpl="4"] .sug,[data-tpl="4"] .person,[data-tpl="4"] .opt{background:#fffdf8;border-color:#dce9cf}

.tp-ff{display:none}
[data-tpl] .screen{z-index:1}
