/* Templates page, combined from the two approved design versions:
   Version A for the 3D hero, the "How a template works" theatre, "Three ways to start",
   sharing, forms and the close; Version B for the library wall and the length slider.
   Wide screens (1024px+ and 600px+ tall): the theatre and the library wall are pinned and
   play with scroll on a 1440x824 design frame that is scaled to fit. Smaller screens,
   reduced motion, ?reveal=off or no JavaScript: the same content is shown finished and stacked. */

.templates-page{--hh:85px;--g:clamp(20px,4.45vw,64px);line-height:normal;overflow-x:clip;color:#083333}
.templates-page section{scroll-margin-top:90px}
.templates-page h1,.templates-page h2,.templates-page h3{font-family:inherit;color:inherit;font-weight:inherit;text-wrap:balance;margin:0}
.templates-page h1 span,.templates-page h2 span,.templates-page h2 em{color:inherit;margin-top:0}
.templates-page p{text-wrap:pretty;margin:0}
:where(.templates-page) ul,:where(.templates-page) ol{list-style:none;margin:0;padding:0}
.templates-page button{font-family:inherit;color:inherit;cursor:pointer}
.templates-page :focus-visible{outline:2px solid #083333;outline-offset:4px}
.templates-page ::selection{background:#E8D3C0}
.templates-page summary{list-style:none;cursor:pointer}
.templates-page summary::-webkit-details-marker{display:none}
.templates-page svg{flex-shrink:0}
.tp-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.tp-wrap{width:min(1240px,calc(100% - 2 * var(--g)));margin-inline:auto}

/* Motion vocabulary */
@keyframes tp-line{from{transform:translateY(110%)}to{transform:none}}
@keyframes tp-rise{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}
@keyframes tp-deal{from{opacity:0;transform:translate3d(-60px,180px,-240px) rotateX(-35deg) rotateZ(-8deg)}to{opacity:1;transform:none}}
@keyframes tp-bob{from{transform:translate3d(0,6px,0)}to{transform:translate3d(0,-10px,14px)}}
@keyframes tp-mq{to{transform:translateX(-50%)}}
@keyframes tp-type{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
@keyframes tp-pop{from{opacity:0;transform:translate3d(0,24px,70px) scale(.96)}to{opacity:1;transform:translate3d(0,0,70px)}}
@keyframes tp-pop-flat{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@keyframes tp-fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes tp-swap{from{opacity:0;transform:translateY(10px);filter:blur(4px)}to{opacity:1;transform:none;filter:none}}
@keyframes tp-scan{0%{top:6%;opacity:0}8%{opacity:1}70%{top:92%;opacity:1}80%,100%{top:92%;opacity:0}}
@keyframes tp-fld{0%,10%{box-shadow:0 0 0 0 rgba(8,51,51,0)}20%,85%{box-shadow:0 0 0 2px rgba(8,51,51,.5)}100%{box-shadow:0 0 0 0 rgba(8,51,51,0)}}
@keyframes tp-spin{from{transform:rotateX(-18deg) rotateY(0)}to{transform:rotateX(-18deg) rotateY(360deg)}}
.tp-l{display:block;overflow:hidden;padding:0 .08em .08em 0;margin-bottom:-.08em}
.tp-l>span{display:block;animation:tp-line 1.2s cubic-bezier(.16,1,.3,1) both}
.tp-in{animation:tp-rise 1s cubic-bezier(.16,1,.3,1) both}
.rv{opacity:var(--v,1);transform:translateY(calc((1 - var(--v,1)) * 28px));transition:opacity .9s cubic-bezier(.2,.7,.2,1) var(--d,0s),transform 1s cubic-bezier(.2,.7,.2,1) var(--d,0s)}
.rz-btn{transition:transform .25s cubic-bezier(.2,.8,.2,1),box-shadow .25s ease,background .2s ease}
.rz-btn:hover{transform:translateY(-2px);box-shadow:0 12px 28px -14px rgba(8,51,51,.6)}
.rz-ghost{transition:background .2s ease}
.rz-ghost:hover{background:rgba(8,51,51,.06)}

/* Shared parts */
.tp-kicker{display:flex;align-items:center;gap:12px;font-size:13px;font-weight:500;letter-spacing:.12em;text-transform:uppercase;color:rgba(8,51,51,.72)}
.tp-h2{margin-top:18px!important;font-weight:300;font-size:clamp(2.1rem,1.2rem + 3vw,3.6rem);line-height:1.02;letter-spacing:-.042em}
.tp-h2 em,.tp-h1 em{font-style:italic;font-weight:300}
.tp-h3{margin-top:18px!important;font-weight:300;font-size:clamp(1.9rem,1.3rem + 1.4vw,2.4rem);line-height:1.08;letter-spacing:-.035em}
.tp-body{margin-top:18px!important;max-width:470px;font-size:17px;line-height:1.55;color:rgba(8,51,51,.86)}
.tp-actions{display:flex;flex-wrap:wrap;gap:10px}
.tp-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:50px;padding:0 22px;border-radius:999px;background:#083333;color:#F6F0E9;font-size:15.5px;font-weight:500}
.tp-btn:hover{color:#F6F0E9;background:#164848}
.tp-ghost{display:inline-flex;align-items:center;justify-content:center;min-height:50px;padding:0 20px;border-radius:999px;border:1px solid rgba(8,51,51,.25);color:#083333;font-size:15.5px}
.tp-ghost:hover{color:#083333}
.tp-tag{display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:6px;background:rgba(8,51,51,.13);font-size:11.5px;font-weight:500;color:#083333}
.tp-bi{display:inline-flex;align-items:center;gap:4px;height:22px;padding:0 8px;border-radius:6px;background:#E6EAF3;font-size:11.5px;font-weight:500;color:#34529A}
.tp-row-tags{display:flex;justify-content:space-between;align-items:center;gap:8px}
.tp-sks{display:flex;flex-direction:column;gap:9px;margin-top:12px}
.tp-sks i{display:block;height:7px;border-radius:4px;background:rgba(8,51,51,.09)}
.tp-chip{display:inline-flex;align-items:center;height:26px;padding:0 9px;border:1px dashed #E0A33A;border-radius:6px;background:#FFF8E8;color:#8F520A;font-size:12px;font-weight:500;white-space:nowrap}
.tp-card{position:relative;box-sizing:border-box;border-radius:16px;background:#FAF6F2;border:1px solid #E0D9CC;box-shadow:0 50px 90px -50px rgba(8,51,51,.5);overflow:hidden}
.tp-createpill{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 16px;border-radius:9px;background:#083333;color:#F6F0E9;font-size:13px;font-weight:500;box-shadow:0 24px 40px -18px rgba(8,51,51,.7);white-space:nowrap}
a.tp-createpill:hover{color:#F6F0E9;background:#164848}
.tp-br{color:#B0532C}

/* ---------- 1. Hero ---------- */
.tp-hero{position:relative;padding-top:56px;overflow:hidden;background:#FCF6EF}
.tp-hero-bg{position:absolute;inset:0;background-image:radial-gradient(rgba(8,51,51,.13) 1px,transparent 1.2px);background-size:22px 22px;-webkit-mask-image:radial-gradient(70% 60% at 72% 42%,#000 20%,transparent 75%);mask-image:radial-gradient(70% 60% at 72% 42%,#000 20%,transparent 75%)}
.tp-hero-grid{position:relative;display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.tp-hero-copy{position:relative;z-index:3;display:flex;flex-direction:column;align-items:flex-start}
.tp-h1{margin-top:24px!important;font-weight:300;font-size:clamp(2.7rem,1.1rem + 5.8vw,88px);line-height:.98;letter-spacing:-.047em}
.tp-lead{margin-top:26px!important;max-width:470px;font-size:clamp(17px,1rem + .3vw,20px);line-height:1.5;color:rgba(8,51,51,.86)}
.tp-hero-copy .tp-actions{margin-top:30px}
.tp-deck-box{--dk:.54;position:relative;width:calc(600px * var(--dk));height:calc(640px * var(--dk));margin:8px auto 0}
.tp-deck{position:absolute;left:0;top:0;width:600px;height:760px;transform:scale(var(--dk));transform-origin:0 0;perspective:1700px;perspective-origin:40% 35%}
.tp-hexw{position:absolute;left:30px;top:50px;transform:translateY(calc(var(--hp,0) * 80px))}
.tp-rig{position:absolute;inset:0;transform-style:preserve-3d;transform:rotateX(calc(15deg + var(--my,0) * -5deg + var(--hp,0) * 22deg)) rotateY(calc(-26deg + var(--mx,0) * 8deg + var(--hp,0) * 10deg)) rotateZ(3deg)}
.tp-sheet{position:absolute;left:96px;top:150px;width:340px;height:440px;transform-style:preserve-3d;transform:translate3d(calc(var(--i) * 40px),calc(var(--i) * -36px),calc(var(--i) * (-78px - var(--hp,0) * 110px)))}
.tp-deal{position:absolute;inset:0;transform-style:preserve-3d;animation:tp-deal 1.5s cubic-bezier(.16,1,.3,1) both;animation-delay:calc(.25s + (4 - var(--i,0)) * .1s)}
.tp-bob{position:absolute;inset:0;transform-style:preserve-3d;animation:tp-bob 7s ease-in-out infinite alternate;animation-delay:calc(var(--i,0) * -1.4s)}
.tp-paper{position:absolute;inset:0;box-sizing:border-box;border-radius:14px;background:#FAF6F2;border:1px solid #E0D9CC;box-shadow:0 50px 80px -50px rgba(8,51,51,.55),0 18px 30px -24px rgba(8,51,51,.35);padding:22px 22px 0;overflow:hidden}
.tp-paper::after{content:"";position:absolute;inset:0;background:linear-gradient(160deg,rgba(255,255,255,.55),rgba(255,255,255,0) 40%);pointer-events:none}
.tp-sh-title{margin-top:16px!important;font-size:18px;font-weight:500}
.tp-sh-main{font-size:20px;letter-spacing:-.01em}
.tp-sh-desc{margin-top:6px!important;font-size:11.5px;line-height:1.5;color:rgba(8,51,51,.72)}
.tp-sh-rule{margin-top:14px;height:1px;background:#E0D9CC}
.tp-sh-h{margin-top:14px!important;font-size:12px;font-weight:500}
.tp-sh-p{margin-top:6px!important;font-size:12px;line-height:1.5;color:rgba(8,51,51,.75)}
.tp-sh-list{margin-top:8px;display:flex;flex-direction:column;gap:8px;font-size:11.5px;line-height:1.5;color:rgba(8,51,51,.8)}
.tp-sh-list span{color:rgba(8,51,51,.55)}
.tp-chip-float{position:absolute;left:330px;top:560px;transform:translateZ(120px);transform-style:preserve-3d}
.tp-chip-float .tp-bob{position:relative;inset:auto;animation-duration:6s;animation-delay:-2s}
.tp-chip-float .tp-createpill{animation:tp-rise 1s cubic-bezier(.16,1,.3,1) 1.2s both}
.tp-marquee{position:relative;z-index:2;margin-top:28px;height:72px;border-top:1px solid rgba(8,51,51,.12);display:flex;align-items:center;overflow:hidden}
.tp-mq{display:flex;width:max-content;animation:tp-mq 46s linear infinite}
.tp-mq:hover{animation-play-state:paused}
.tp-mq-set{display:flex;align-items:center;gap:34px;padding-right:34px;font-size:clamp(17px,1rem + .4vw,22px);font-weight:300;color:rgba(8,51,51,.72);white-space:nowrap}
.tp-mq-set i{display:block;width:12px;height:11px;background:#DAB697;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%)}
@media (max-width:379px){.tp-deck-box{--dk:.45}}
@media (min-width:600px){.tp-deck-box{--dk:.7}}
@media (min-width:1024px){
  .tp-hero{padding-top:0;min-height:clamp(660px,calc(100svh - var(--hh)),900px);display:flex;flex-direction:column}
  .tp-hero-grid{flex:1;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0}
  .tp-hero-copy{padding:40px 0}
  .tp-deck-box{--dk:.84;margin:0 -30px 0 -80px}
  .tp-marquee{margin-top:auto}
}
@media (min-width:1280px){.tp-deck-box{--dk:.96;margin-right:-10px}}
@media (min-width:1024px) and (max-height:820px){.tp-deck-box{--dk:.78}}
@media (min-width:1024px) and (max-height:700px){.tp-deck-box{--dk:.66}}

/* ---------- 2. How a template works ---------- */
.tp-theatre{background:linear-gradient(#FCF6EF,#F6F0E9 8%,#F6F0E9 92%,#FCF6EF);padding:96px 0 100px}
.tp-theatre .tp-frame{width:min(1240px,calc(100% - 2 * var(--g)));margin-inline:auto;display:grid;gap:32px;grid-template-areas:"head" "caps" "tr" "tpl" "note" "foot"}
.tp-th-head{grid-area:head}
.tp-caps{grid-area:caps;display:grid;gap:24px 32px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.tp-cap-n{font-size:12px;font-weight:500;color:rgba(8,51,51,.62)}
.tp-cap h3{margin-top:8px;font-size:22px;font-weight:400;letter-spacing:-.02em}
.tp-cap p{margin-top:8px;font-size:15px;line-height:1.5;color:rgba(8,51,51,.8)}
.tp-tpl{grid-area:tpl;padding:0 14px 22px}
.tp-note{grid-area:note}
.tp-transcript{grid-area:tr;justify-self:start;width:min(100%,380px);padding:14px 16px 16px;border-radius:14px;background:#FCF6EF;border-color:rgba(8,51,51,.14);box-shadow:0 30px 60px -30px rgba(8,51,51,.55)}
.tp-th-foot{grid-area:foot;font-size:13px;color:rgba(8,51,51,.72)}
.tp-cn{display:none}
@media (min-width:760px){.tp-theatre .tp-frame{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);grid-template-areas:"head head" "caps caps" "tr tr" "tpl note" "foot foot"}}
/* Card internals share one vertical rhythm so template lines and note lines sit level */
.tp-tpl-hd{box-sizing:border-box;height:110px;margin:0 -14px;padding:20px 22px 0;border-bottom:1px solid #E0D9CC}
.tp-tpl-title{margin-top:12px!important;font-size:19px;font-weight:500}
.tp-tpl-desc{margin-top:6px!important;font-size:11.5px;color:rgba(8,51,51,.72);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tp-r,.tp-n{box-sizing:border-box;height:34px;margin-top:6px!important;padding:0 8px;border-radius:7px;font-size:12.5px;line-height:17px;color:rgba(8,51,51,.86)}
.tp-r{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;transition:background-color .6s ease}
.tp-r0{height:24px;line-height:24px;margin-top:9px!important;-webkit-line-clamp:1}
.tp-lbl{box-sizing:border-box;height:18px;margin:8px 0 0 8px!important;font-size:12.5px;font-weight:500}
.tp-lbl+.tp-r,.tp-lbl+.tp-n{margin-top:8px!important}
.tp-lbl-pmh{margin-top:10px!important}
.tp-sks-pad{padding:0 8px;margin-top:10px}
.tp-ok{background:rgba(8,51,51,.07)}
.tp-miss{background:#FFF4D6}
.tp-note-bar{box-sizing:border-box;height:44px;padding:0 14px 0 16px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #E0D9CC}
.tp-note-title{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:500}
.tp-srcpill{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 10px;border-radius:999px;background:#EFE7DD;font-size:11px;color:rgba(8,51,51,.8);white-space:nowrap}
.tp-banner{box-sizing:border-box;height:36px;padding:0 12px 0 16px;display:flex;align-items:center;justify-content:space-between;gap:10px;background:#FFF6DA;border-bottom:1px solid #F1DFA6;font-size:12px;color:#744B00}
.tp-banner>span:first-child{display:flex;align-items:center;gap:7px;white-space:nowrap;overflow:hidden}
.tp-banner b{font-weight:500}
.tp-fill13{flex:none;height:24px;padding:0 10px;display:inline-flex;align-items:center;border-radius:999px;border:1px solid #E0B040;font-size:11px}
/* Smaller screens: let the banner wrap instead of cutting its sentence off. */
@media (max-width:1023px){.tp-banner{height:auto;min-height:36px;padding-block:8px}.tp-banner>span:first-child{display:block;white-space:normal;line-height:1.4}.tp-banner>span:first-child svg{display:inline-block;vertical-align:-2px;margin-right:6px}}
.tp-toolbar{box-sizing:border-box;height:31px;padding:0 16px;display:flex;align-items:center;gap:16px;border-bottom:1px solid #E0D9CC;font-size:12px;color:rgba(8,51,51,.7)}
.tp-note-body{position:relative;padding:0 14px}
.tp-skel{display:none}
.tp-n{font-size:13px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;padding-left:16px}
.tp-n.tp-r0{-webkit-line-clamp:1}
.tp-pinned .tp-n:not(.tp-r0){line-height:34px;-webkit-line-clamp:1}
.tp-nc{display:flex;align-items:center;gap:8px}
html:not(.tp-pinned) .tp-nc{flex-wrap:wrap;height:auto;min-height:34px;padding-block:4px;overflow:visible}
.tp-note-foot{margin:14px 12px 12px;height:30px;padding:0 12px;display:flex;align-items:center;gap:8px;border-radius:8px;background:#FFF8E3;border:1px solid #F1DFA6;font-size:11px;color:#744B00}
.tp-tr-hd{display:flex;justify-content:space-between;align-items:center;font-size:11.5px;color:rgba(8,51,51,.72)}
.tp-tr-title{display:flex;align-items:center;gap:8px;font-weight:500;color:#083333}
.tp-wave{display:flex;align-items:center;gap:2px;height:14px}
.tp-wave i{display:block;width:2px;border-radius:2px;background:#083333;height:8px}
.tp-wave i:nth-child(2){height:12px}.tp-wave i:nth-child(4){height:14px}.tp-wave i:nth-child(5){height:5px}
.tp-transcript p{margin-top:8px!important;font-size:12.5px;line-height:1.5}
.tp-transcript p+p{margin-top:4px!important}
.tp-transcript b{font-weight:500}
.tp-tr-clin{color:rgba(8,51,51,.8)}

/* ---------- 3. Three ways to start ---------- */
.tp-ways{padding:110px 0}
.tp-sec-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:20px 60px}
.tp-sec-head .tp-body{margin-top:0!important;max-width:420px}
.tp-ways-grid{margin-top:56px;display:grid;gap:40px}
.tp-way-list{display:flex;flex-direction:column;gap:8px}
.tp-way{display:flex;gap:20px;align-items:flex-start;width:100%;text-align:left;padding:22px 24px;border-radius:22px;border:1px solid transparent;background:transparent;transition:background .35s ease,border-color .35s ease,transform .35s cubic-bezier(.2,.8,.2,1)}
.tp-way:hover{background:rgba(239,231,221,.55);transform:translateX(4px)}
.tp-way.is-on{background:#F6F0E9;border-color:rgba(8,51,51,.12)}
.tp-way-n{min-width:22px;padding-top:7px;font-size:14px;font-weight:500;color:#8A6440}
.tp-way-txt{display:flex;flex-direction:column;gap:6px;flex:1}
.tp-way-t{font-size:clamp(21px,1rem + .8vw,26px);letter-spacing:-.02em}
.tp-way-d{font-size:15.5px;line-height:1.5;color:rgba(8,51,51,.8)}
.tp-way-bar{display:none;height:2px;margin-top:12px;border-radius:2px;background:rgba(8,51,51,.1);overflow:hidden}
.tp-way-bar i{display:block;height:100%;background:#083333;transform-origin:0 50%;animation:tp-fill 6.5s linear both}
.tp-ways.is-cycling .tp-way.is-on .tp-way-bar{display:block}
.tp-mstage{position:relative;perspective:1500px;padding:6px 0 0}
.tp-modal3d{position:relative;max-width:540px;margin-inline:auto;transform-style:preserve-3d}
.tp-modal{position:relative;box-sizing:border-box;padding:26px;border-radius:18px;background:#FAF6F2;border:1px solid #E0D9CC;box-shadow:0 70px 110px -60px rgba(8,51,51,.6),inset 0 2px 0 rgba(255,255,255,.7)}
.tp-modal-top{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:rgba(8,51,51,.8)}
.tp-modal-top>span{display:flex;align-items:center;gap:8px}
.tp-modal-intro{margin:12px 0 0 22px!important;font-size:13px;line-height:1.5;color:rgba(8,51,51,.78)}
.tp-input{position:relative;margin-top:18px;height:150px;border-radius:12px;border:1px solid #E0D9CC;background:#F4EEE6}
.tp-pane{position:absolute;left:18px;right:18px;top:16px;display:none;flex-direction:column;gap:4px;font-size:14px;line-height:1.5}
.tp-mstage[data-active="0"] [data-pane="0"],.tp-mstage[data-active="1"] [data-pane="1"],.tp-mstage[data-active="2"] [data-pane="2"]{display:flex}
.tp-pane-tip{left:40px;color:rgba(8,51,51,.55)}
.tp-typed{display:block;white-space:nowrap;overflow:hidden;animation:tp-type 1.5s steps(44,end) var(--td,0s) both}
.tp-input-bar{position:absolute;left:14px;right:12px;bottom:10px;display:flex;justify-content:space-between;align-items:center}
.tp-attach{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 8px;border-radius:8px;font-size:12.5px;color:rgba(8,51,51,.8);transition:background .3s ease}
.tp-mstage[data-active="1"] .tp-attach{background:#EFE7DD;color:#083333}
.tp-send{width:32px;height:32px;border-radius:8px;display:grid;place-items:center;color:#F6F0E9;background:#083333;transition:background .3s ease}
.tp-mstage[data-active="2"] .tp-send{background:#B9C3C0}
.tp-or{margin-top:22px;display:flex;align-items:center;gap:12px;font-size:12.5px;color:rgba(8,51,51,.72)}
.tp-or span{height:1px;flex:1;background:#E0D9CC}
.tp-modal-btns{margin-top:16px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tp-mb{height:40px;display:flex;align-items:center;justify-content:center;border-radius:8px;border:1px solid #E0D9CC;background:#FCF8F3;font-size:13.5px;font-weight:500;transition:box-shadow .3s ease}
.tp-mb-dark{background:#083333;border-color:#083333;color:#F6F0E9}
.tp-mstage[data-active="2"] .tp-mb-dark{box-shadow:0 0 0 3px rgba(8,51,51,.18)}
.tp-result{position:relative;display:none;box-sizing:border-box;width:min(290px,92%);margin:-26px 0 0 auto;padding:16px 18px;border-radius:14px;background:#FCF6EF;border:1px solid rgba(8,51,51,.14);box-shadow:0 40px 70px -34px rgba(8,51,51,.6)}
.tp-mstage[data-active="0"] [data-result="0"]{display:block;animation:tp-pop-flat .9s cubic-bezier(.16,1,.3,1) 4.2s both}
.tp-mstage[data-active="1"] [data-result="1"],.tp-mstage[data-active="2"] [data-result="2"]{display:block;animation:tp-pop-flat .9s cubic-bezier(.16,1,.3,1) .2s both}
.tp-result-k{font-size:11.5px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:rgba(8,51,51,.62)}
.tp-rh{margin-top:8px!important;font-size:13px;font-weight:500}
.tp-result-k+.tp-rh{margin-top:10px!important}
.tp-rp{font-size:12px;color:rgba(8,51,51,.72)}
.tp-file{display:flex;align-items:center;gap:12px}
.tp-file-ic{width:38px;height:46px;border-radius:6px;background:#EFE7DD;display:grid;place-items:center}
.tp-file b{display:block;font-size:13px;font-weight:500}
.tp-file small{display:block;margin-top:2px;font-size:11.5px;color:rgba(8,51,51,.7)}
.tp-progress{margin-top:12px;height:4px;border-radius:4px;background:rgba(8,51,51,.1);overflow:hidden}
.tp-progress i{display:block;height:4px;background:#083333;transform-origin:0 50%;animation:tp-fill 2.2s cubic-bezier(.5,0,.2,1) .4s both}
.tp-result-title{font-size:16px;font-weight:500}
.tp-result .tp-sks{margin-top:8px}
.tp-addh{margin-top:14px!important;display:flex;align-items:center;gap:6px;font-size:12.5px;color:rgba(8,51,51,.75)}
@media (max-width:599px){
  .tp-typed{white-space:normal;animation-name:tp-rise;animation-duration:.8s;animation-timing-function:ease}
  .tp-input{height:170px}
  .tp-modal{padding:20px}
  .tp-way{padding:18px}
}
@media (min-width:1024px){
  .tp-ways-grid{grid-template-columns:500px minmax(0,1fr);gap:60px;align-items:start}
  .tp-mstage{padding:10px 40px 90px 0}
  .tp-modal3d{transform:rotateY(calc(-9deg + var(--mx,0) * 5deg)) rotateX(calc(5deg + var(--my,0) * -4deg));transition:transform 1s cubic-bezier(.2,.8,.2,1)}
  .tp-result{position:absolute;right:-40px;bottom:-70px;width:280px;margin:0;transform:translateZ(70px)}
  .tp-mstage[data-active="0"] [data-result="0"]{animation-name:tp-pop}
  .tp-mstage[data-active="1"] [data-result="1"],.tp-mstage[data-active="2"] [data-result="2"]{animation-name:tp-pop}
  .tp-result-file{bottom:-40px}
}

/* ---------- 4. Library wall ---------- */
.tp-wall{background:#F6F0E9;padding:100px 0 90px}
.tp-wall-head{width:min(1240px,calc(100% - 2 * var(--g)));margin-inline:auto;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:20px 60px}
.tp-wall-side{max-width:380px}
.tp-wall-side .tp-body{margin-top:0!important}
.tp-wall-rail{display:none}
.tp-track-wrap{margin-top:40px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding:0 var(--g);padding:24px 0 36px;scrollbar-width:thin}
.tp-track{display:flex;gap:24px;width:max-content;padding:0 var(--g)}
.tp-spec{flex:none;position:relative;box-sizing:border-box;width:290px;height:460px;scroll-snap-align:start;border-radius:6px;background:#FAF6F2;border:1px solid #E0D9CC;box-shadow:0 40px 70px -46px rgba(8,51,51,.5);padding:24px 24px 0;transition:transform .5s cubic-bezier(.2,.8,.2,1),box-shadow .5s ease}
.tp-spec:nth-child(odd){transform:rotate(-1.1deg)}
.tp-spec:nth-child(even){transform:rotate(.9deg) translateY(14px)}
.tp-spec:hover{transform:rotate(0) translateY(-10px);box-shadow:0 60px 90px -50px rgba(8,51,51,.6)}
.tp-spec-k{font-size:12px;font-weight:500;letter-spacing:.1em;text-transform:uppercase;color:rgba(8,51,51,.72)}
.tp-spec h3{margin-top:16px;font-size:24px;font-weight:400;line-height:1.15;letter-spacing:-.02em}
.tp-spec-rule{margin:18px 0;height:1px;background:#E0D9CC}
.tp-spec-h{margin-top:14px!important;font-size:13px;font-weight:500}
.tp-spec-rule+.tp-spec-h,.tp-spec-rule+.tp-spec-p{margin-top:0!important}
.tp-spec-p{margin-top:6px!important;font-size:13px;line-height:1.5;color:rgba(8,51,51,.78)}
.tp-spec .tp-sks{margin-top:14px;gap:10px}
.tp-spec-foot{position:absolute;left:24px;right:24px;bottom:18px;display:flex;justify-content:space-between;font-size:12px;color:rgba(8,51,51,.72)}
.tp-spec-own{background:transparent;border:1.5px dashed rgba(8,51,51,.32);box-shadow:none;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:16px;padding:36px}
.tp-spec-own h3{margin-top:0}
.tp-own-br{font-size:76px;font-weight:300;line-height:1}

/* ---------- 5. Length slider ---------- */
.tp-dial{padding:120px 0}
.tp-dial-grid{display:grid;gap:56px}
.tp-len{margin-top:44px}
.tp-len-top{display:flex;justify-content:space-between;align-items:baseline;font-size:15px}
.tp-len-top label{font-weight:500}
.tp-len-top output{color:rgba(8,51,51,.75)}
.tp-rng{--fill:50%;-webkit-appearance:none;appearance:none;display:block;width:100%;height:44px;margin:8px 0 0;background:transparent;cursor:pointer}
.tp-rng::-webkit-slider-runnable-track{height:2px;background:linear-gradient(to right,#083333 var(--fill),rgba(8,51,51,.18) var(--fill))}
.tp-rng::-moz-range-track{height:2px;background:rgba(8,51,51,.18)}
.tp-rng::-moz-range-progress{height:2px;background:#083333}
.tp-rng::-webkit-slider-thumb{-webkit-appearance:none;width:24px;height:24px;margin-top:-11px;border-radius:50%;background:#083333;border:4px solid #FCF6EF;box-shadow:0 0 0 1px #083333,0 8px 18px -6px rgba(8,51,51,.6);transition:transform .2s ease}
.tp-rng::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:#083333;border:4px solid #FCF6EF;box-shadow:0 0 0 1px #083333}
.tp-rng:active::-webkit-slider-thumb{transform:scale(1.15)}
.tp-ticks{display:flex;justify-content:space-between}
.tp-tick{min-height:44px;padding:0;border:0;background:transparent;font-size:14px;color:rgba(8,51,51,.66)}
.tp-tick.is-on{color:#083333;font-weight:500}
.tp-ask{margin-top:30px;padding:18px;border-radius:16px;border:1px solid #E0D9CC;background:#FAF6F2}
.tp-ask p{font-size:13px;color:rgba(8,51,51,.72)}
.tp-askbtn{margin-top:12px;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border-radius:999px;border:1px solid rgba(8,51,51,.22);background:transparent;font-size:14px;text-align:left;transition:background .25s ease,border-color .25s ease,color .25s ease}
.tp-askbtn:hover{background:#EFE7DD}
.tp-askbtn[aria-pressed="true"]{background:#083333;border-color:#083333;color:#F6F0E9}
.tp-dial-note{position:relative}
.tp-bigbr{position:absolute;left:-30px;top:-40px;font-size:220px;line-height:1;font-weight:300;color:rgba(184,90,51,.14);pointer-events:none}
.tp-dnote{box-shadow:0 70px 110px -70px rgba(8,51,51,.6)}
.tp-dnote-hd{height:54px;padding:0 24px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #E0D9CC}
.tp-dnote-hd span:first-child{font-size:15px;font-weight:500}
.tp-dnote-hd span:last-child{font-size:12px;color:rgba(8,51,51,.72)}
.tp-dnote-body{padding:24px 28px 20px;display:flex;flex-direction:column;gap:16px;min-height:420px}
.tp-dnote-body.is-swap{animation:tp-swap .6s cubic-bezier(.16,1,.3,1) both}
.tp-dh{font-size:13px;font-weight:500}
.tp-dt{margin-top:6px!important;font-size:16px;line-height:1.6;color:rgba(8,51,51,.9)}
.tp-dt mark{background:#F4E4D8;color:inherit;border-radius:6px;padding:2px 6px;margin-left:-6px;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.tp-dnote-body .tp-chip{margin-top:8px}
.tp-dnote-foot{padding:0 24px 18px;font-size:11.5px;color:rgba(8,51,51,.72)}
@media (min-width:1024px){.tp-dial-grid{grid-template-columns:440px minmax(0,1fr);gap:80px;align-items:start}}
@media (max-width:600px){.tp-bigbr{font-size:140px;left:-10px;top:-34px}.tp-dnote-body{padding:20px;min-height:0}}

/* ---------- 6. Share and forms ---------- */
.tp-duo{padding:20px 0 110px}
.tp-duo-grid{display:grid;gap:24px}
.tp-panel{position:relative;box-sizing:border-box;display:flex;flex-direction:column;border-radius:28px;background:#F6F0E9;padding:clamp(28px,4vw,48px);overflow:hidden}
.tp-panel .tp-body{margin-top:16px!important}
.tp-fanbox{position:relative;height:250px;margin-top:36px;perspective:1000px}
.tp-fan{position:absolute;left:50%;top:10px;box-sizing:border-box;width:250px;height:170px;margin-left:-125px;padding:16px;border-radius:12px;background:#FAF6F2;border:1px solid #E0D9CC;box-shadow:0 30px 50px -34px rgba(8,51,51,.5);transition:transform 1.3s cubic-bezier(.16,1,.3,1) .15s}
.tp-fan p{margin-top:10px!important;font-size:14px;font-weight:500}
.tp-fan .tp-sks{gap:8px}
.tp-fan-l{transform:translate3d(calc(var(--v,1) * -150px),calc(var(--v,1) * 50px),-60px) rotate(calc(var(--v,1) * -9deg))}
.tp-fan-r{transform:translate3d(calc(var(--v,1) * 150px),calc(var(--v,1) * 50px),-60px) rotate(calc(var(--v,1) * 9deg))}
.tp-fan-c{transform:translate3d(0,calc(var(--v,1) * 10px),40px)}
.tp-fan-top{display:flex;justify-content:space-between;align-items:center}
.tp-avs{display:flex}
.tp-avs b{width:24px;height:24px;margin-left:-7px;border-radius:50%;border:2px solid #FAF6F2;display:grid;place-items:center;font-size:9px;font-weight:500}
.tp-avs b:first-child{margin-left:0}
.tp-fan small{margin-top:14px;display:flex;align-items:center;gap:6px;font-size:12px;color:rgba(8,51,51,.75)}
.tp-pdf{position:relative;margin:32px 0 0;padding:18px 22px;border-radius:14px;background:#FAF6F2;border:1px solid #E0D9CC;box-shadow:0 30px 60px -40px rgba(8,51,51,.5);overflow:hidden}
.tp-scan{position:absolute;left:0;right:0;top:6%;height:2px;background:#083333;box-shadow:0 0 18px 4px rgba(8,51,51,.25);animation:tp-scan 4.8s cubic-bezier(.45,0,.55,1) infinite}
.tp-pdf-hd{display:flex;justify-content:space-between;gap:12px;font-size:11.5px;color:rgba(8,51,51,.72)}
.tp-pdf-hd b{font-weight:500;color:#083333}
.tp-pdf-grid{margin-top:14px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;font-size:12px}
.tp-pdf-grid span{display:block;color:rgba(8,51,51,.72)}
.tp-fld{margin-top:4px;height:30px;padding:0 10px;display:flex;align-items:center;border-radius:6px;background:#EFE7DD;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;animation:tp-fld 4.8s ease infinite}
.tp-chip-lg{margin-top:4px;height:30px}
.tp-pdf figcaption{margin-top:14px;font-size:11.5px;line-height:1.5;color:rgba(8,51,51,.72)}
@media (min-width:900px){.tp-duo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tp-panel{min-height:620px}.tp-fanbox,.tp-pdf{margin-top:auto}}
@media (max-width:600px){.tp-fanbox{height:200px;transform:scale(.72);transform-origin:50% 0;margin-bottom:-40px}}
@media (max-width:480px){.tp-pdf-grid{grid-template-columns:1fr}}

/* ---------- 7. Questions ---------- */
.tp-faq{padding:110px 0}
.tp-faq-grid{display:grid;gap:40px}
.tp-faq-list{border-top:1px solid rgba(8,51,51,.14)}
.tp-faq-list details{border-bottom:1px solid rgba(8,51,51,.14)}
.tp-faq-list summary{display:flex;justify-content:space-between;align-items:center;gap:24px;min-height:84px;padding:14px 0;font-size:clamp(17px,1rem + .4vw,20px)}
.tp-plus{flex:none;transition:transform .35s ease}
.tp-faq-list details[open] .tp-plus{transform:rotate(45deg)}
.tp-faq-list details>div p{padding:0 48px 26px 0;font-size:16px;line-height:1.6;color:rgba(8,51,51,.82)}
@media (min-width:1024px){.tp-faq-grid{grid-template-columns:420px minmax(0,1fr);gap:80px}}

/* ---------- 8. Close ---------- */
.tp-close{padding:0 0 120px}
.tp-close-inner{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;text-align:center;padding:clamp(56px,8vw,96px) 24px;border-radius:32px;background:#F6F0E9}
.tp-prism-wrap{width:120px;height:150px;margin-bottom:36px;perspective:900px}
.tp-prism{position:relative;width:120px;height:150px;transform-style:preserve-3d;transform:rotateX(-18deg) rotateY(-20deg);animation:tp-spin 18s linear infinite}
.tp-prism i{position:absolute;left:30px;top:0;box-sizing:border-box;width:60px;height:150px;background:#0C3B3B;border:1px solid rgba(246,240,233,.12)}
.tp-prism b{position:absolute;left:0;top:23px;width:120px;height:104px;background:#164848;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%)}
.tp-close h2{font-weight:300;font-size:clamp(2.4rem,1.4rem + 3.6vw,72px);line-height:1;letter-spacing:-.045em}
.tp-close-inner>p{margin-top:20px!important;font-size:18px;color:rgba(8,51,51,.82)}
.tp-close .tp-actions{margin-top:32px;justify-content:center}

/* ---------- Pinned scenes (wide screens with motion) ---------- */
html:not(.tp-pinned) .tp-pin-only{display:none!important}
.tp-pinned .tp-scene{height:calc(100vh - var(--hh) + var(--dist,2000px));padding:0}
.tp-pinned .tp-pin{position:sticky;top:var(--hh);height:calc(100vh - var(--hh));overflow:hidden}
.tp-pinned .tp-stage{position:absolute;left:50%;top:50%;width:1440px;height:824px;transform:translate(-50%,-50%) scale(var(--s,1));transform-origin:center center}
.tp-pinned .tp-frame{position:absolute;left:0;top:0;width:1440px!important;height:824px;margin:0!important;display:block!important}

/* Theatre */
.tp-pinned .tp-th-head{position:absolute;left:100px;top:34px;width:1240px;display:flex;justify-content:space-between;align-items:flex-end}
.tp-pinned .tp-theatre .tp-h2{font-size:54px}
.tp-rail{width:440px}
.tp-rail-labels{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;font-size:12px;color:rgba(8,51,51,.72)}
.tp-rail-bar{margin-top:10px;height:2px;border-radius:2px;background:rgba(8,51,51,.1);overflow:hidden}
.tp-rail-bar i{display:block;height:2px;background:#083333;width:calc(var(--p,1) * 100%)}
.tp-pinned .tp-caps{position:absolute;left:100px;top:170px;width:300px;display:block}
.tp-pinned .tp-cap{position:absolute;left:0;right:0;transition:opacity .6s ease}
.tp-pinned .tp-cap:nth-child(2){top:140px}.tp-pinned .tp-cap:nth-child(3){top:280px}.tp-pinned .tp-cap:nth-child(4){top:420px}
.tp-pinned .tp-tpl{position:absolute;left:440px;top:170px;width:380px;height:560px;transform:perspective(1400px) rotateY(calc(16deg * (1 - var(--p,1))));transform-origin:0 50%}
.tp-pinned .tp-cn{display:block;position:absolute;left:820px;top:170px;overflow:visible}
.tp-pinned .tp-note{position:absolute;left:900px;top:170px;width:440px;height:560px;transform:perspective(1400px) rotateY(calc(-14deg * (1 - var(--p,1))));transform-origin:100% 50%}
.tp-pinned .tp-note-foot{position:absolute;left:0;right:0;bottom:0;margin:0 12px 10px}
.tp-pinned .tp-transcript{position:absolute;left:472px;top:640px;width:360px;z-index:3}
.tp-pinned .tp-th-foot{position:absolute;left:100px;top:760px}
.tp-pinned .tp-skel{display:flex;position:absolute;left:30px;right:40px;top:186px;flex-direction:column;gap:22px;opacity:0;transition:opacity .6s ease}
.tp-pinned .tp-skel i{display:block;height:7px;border-radius:4px;background:rgba(8,51,51,.09)}
.tp-s1,.tp-s2,.tp-s3{transition:opacity .7s cubic-bezier(.16,1,.3,1),transform .8s cubic-bezier(.16,1,.3,1)}
.tp-theatre[data-step="0"] .tp-s1,.tp-theatre[data-step="0"] .tp-s2,.tp-theatre[data-step="0"] .tp-s3,
.tp-theatre[data-step="1"] .tp-s2,.tp-theatre[data-step="1"] .tp-s3,
.tp-theatre[data-step="2"] .tp-s3{opacity:0;transform:translateY(10px)}
.tp-theatre[data-step="0"] .tp-skel,.tp-theatre[data-step="1"] .tp-skel{opacity:1}
.tp-theatre[data-step="0"] .tp-ok,.tp-theatre[data-step="1"] .tp-ok,
.tp-theatre[data-step="0"] .tp-miss,.tp-theatre[data-step="1"] .tp-miss,.tp-theatre[data-step="2"] .tp-miss{background:transparent}
.tp-theatre[data-step] .tp-cap{opacity:.3}
.tp-theatre[data-step="0"] [data-cap="0"],.tp-theatre[data-step="1"] [data-cap="1"],.tp-theatre[data-step="2"] [data-cap="2"],.tp-theatre[data-step="3"] [data-cap="3"]{opacity:1}

/* Library wall */
.tp-pinned .tp-wall-head{position:absolute;left:100px;top:56px;width:1240px}
.tp-pinned .tp-wall .tp-h2{font-size:56px}
.tp-pinned .tp-wall-rail{display:block;margin-top:18px;height:2px;background:rgba(8,51,51,.12);overflow:hidden}
.tp-pinned .tp-wall-rail i{display:block;height:2px;background:#083333;width:calc(12% + var(--p,0) * 88%)}
.tp-pinned .tp-track-wrap{position:absolute;left:0;top:262px;width:1440px;margin:0;padding:0;overflow:visible;scroll-snap-type:none}
.tp-pinned .tp-track{padding:0 0 0 100px;gap:32px;transform:translateX(calc(var(--p,0) * -1332px));will-change:transform}
.tp-pinned .tp-spec{width:340px;height:500px;padding:26px 26px 0}
.tp-pinned .tp-spec h3{font-size:26px}

/* Reduced motion, ?reveal=off */
.tp-motion-off .templates-page *,.tp-motion-off .templates-page *::before,.tp-motion-off .templates-page *::after{animation:none!important;transition:none!important}
.tp-motion-off .tp-scan{display:none}
.tp-motion-off .tp-rig{transform:rotateX(15deg) rotateY(-26deg) rotateZ(3deg)}
@media (prefers-reduced-motion:reduce){
  .templates-page *,.templates-page *::before,.templates-page *::after{animation:none!important;transition:none!important}
  .tp-scan{display:none}
}
