/* Catalogue additions keep the existing Stack palette and card radius. */
#demos .grid.demos{grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch}
#demos .grid.demos .wk,#demos .grid.demos .wk:nth-child(n+4){grid-column:auto}
#demos .filt{flex-wrap:wrap;gap:8px;margin-top:28px}
#demos .tab{min-height:44px;line-height:1.3}
#demos .tab[aria-pressed=true]{background:var(--accent);color:var(--card-ink);border-color:var(--accent)}
#demos .template-card{display:flex;flex-direction:column;min-width:0}
#demos .template-card{cursor:pointer}
#demos .template-card:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
#demos .template-card[hidden]{display:none}
#demos .template-card .shot{flex:none;aspect-ratio:16/10}
#demos .template-card button.shot{position:relative;width:100%;padding:0;border:0;color:inherit;cursor:pointer;text-align:left}
#demos .template-shot-hint{position:absolute;right:14px;bottom:14px;display:inline-flex;align-items:center;gap:10px;padding:9px 12px;border-radius:999px;background:rgba(14,17,22,.86);color:#fff;font:600 13px/1.2 var(--f);opacity:0;transform:translateY(5px);transition:opacity .2s,transform .2s;backdrop-filter:blur(8px)}
#demos .template-shot-hint i{font-style:normal;font-size:16px}
#demos .template-card:hover .template-shot-hint,#demos .template-card:focus-within .template-shot-hint{opacity:1;transform:none}
#demos .template-card .cap{display:flex;flex-direction:column;padding:20px;flex:1;gap:0}
.template-heading{display:flex;justify-content:space-between;gap:12px;align-items:baseline;flex-wrap:wrap}
.template-level{font-size:13px;line-height:1.4;color:var(--mute)}
.template-niche{display:block;font-size:14px;color:var(--ink);line-height:1.4;margin-top:6px}
.template-description{font-size:14px;line-height:1.5;color:var(--mute);margin:12px 0 20px}
.template-card-meta{display:flex;justify-content:space-between;gap:12px;padding:13px 0 16px;border-top:1px solid var(--line);font-size:13px;line-height:1.4;color:var(--mute)}
.template-card-meta strong{flex:none;color:var(--ink);font-weight:600}
.template-card-meta strong s{display:block;color:var(--mute);font-size:11px;font-weight:400}
.template-actions{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-top:auto}
.template-actions a,.template-actions button{min-height:44px;display:inline-flex;align-items:center;font:600 14px/1.3 var(--f)}
#demos .template-actions .want{position:static;opacity:1;border-radius:999px;padding:11px 14px;margin:0;justify-self:auto}
.template-more{padding:0;border:0;background:transparent;color:var(--ink);cursor:pointer;text-decoration:underline;text-underline-offset:5px;text-decoration-color:var(--line)}
.template-more:hover{text-decoration-color:currentColor}
#works .template-preview{display:flex;flex-direction:column}
#works .template-preview .wcap{position:static;padding:14px 16px;gap:4px;text-shadow:none;opacity:1;transform:none}
#works .template-preview .wcap b,#works .template-preview:hover .wcap b{background:none;color:var(--fg,var(--ink));animation:none}
#works .template-preview .wcap i{color:var(--fg2,var(--mute));font-size:14px}

.template-dialog-open{overflow:hidden}
.template-dialog{width:min(1240px,calc(100% - 32px));max-width:none;max-height:min(860px,calc(100dvh - 32px));padding:0;border:0;border-radius:24px;background:var(--b1);color:var(--ink);box-shadow:0 32px 100px rgba(0,0,0,.65);overflow:hidden}
.template-dialog::backdrop{background:rgba(4,6,10,.78);backdrop-filter:blur(7px)}
.template-dialog-shell{display:grid;grid-template-columns:minmax(0,7fr) minmax(340px,5fr);min-height:650px;max-height:min(860px,calc(100dvh - 32px))}
.template-dialog-close{position:absolute;z-index:5;top:16px;right:16px;width:44px;height:44px;border:1px solid rgba(244,242,237,.14);border-radius:50%;background:rgba(14,17,22,.8);color:#fff;font:300 28px/1 var(--f);cursor:pointer;backdrop-filter:blur(8px)}
.template-gallery{display:flex;flex-direction:column;min-width:0;padding:18px;background:#0e1116}
.template-gallery-frame{position:relative;display:flex;align-items:center;justify-content:center;flex:1;min-height:0;overflow:hidden;border-radius:14px;background:#090b0f}
.template-gallery-frame img{display:block;width:100%;height:100%;max-height:750px;object-fit:contain;transition:opacity .16s ease,transform .24s ease}
.template-gallery-frame img.is-changing{opacity:.45;transform:scale(.995)}
.template-gallery-arrow{position:absolute;top:50%;display:grid;place-items:center;width:52px;height:52px;padding:0;border:1px solid rgba(244,242,237,.2);border-radius:50%;background:rgba(14,17,22,.84);color:#f4f2ed;cursor:pointer;overflow:hidden;isolation:isolate;transform:translateY(-50%);box-shadow:0 14px 34px rgba(0,0,0,.38),inset 0 0 0 1px rgba(255,255,255,.035);backdrop-filter:blur(10px);transition:transform .28s cubic-bezier(.2,.8,.2,1),border-color .2s,box-shadow .28s}
.template-gallery-arrow::before{content:'';position:absolute;inset:3px;z-index:-1;border-radius:50%;background:var(--accent);transform:scale(0);transition:transform .28s cubic-bezier(.2,.8,.2,1)}
.template-gallery-arrow svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;transition:transform .28s cubic-bezier(.2,.8,.2,1)}
.template-gallery-arrow.is-prev svg{transform:rotate(180deg)}
.template-gallery-arrow:hover{color:var(--card-ink);border-color:rgba(255,90,31,.7);transform:translateY(-50%) scale(1.08);box-shadow:0 18px 42px rgba(0,0,0,.44),0 0 0 5px rgba(255,90,31,.11)}
.template-gallery-arrow:hover::before{transform:scale(1)}
.template-gallery-arrow.is-next:hover svg{transform:translateX(2px)}
.template-gallery-arrow.is-prev:hover svg{transform:rotate(180deg) translateX(2px)}
.template-gallery-arrow:active{transform:translateY(-50%) scale(.97)}
.template-gallery-arrow:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
.template-gallery-arrow.is-prev{left:16px}.template-gallery-arrow.is-next{right:16px}
.template-gallery-count{position:absolute;right:16px;bottom:16px;padding:7px 10px;border-radius:999px;background:rgba(14,17,22,.76);color:#fff;font-size:12px;backdrop-filter:blur(8px)}
.template-gallery-foot{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:48px;padding:12px 2px 0;color:rgba(255,255,255,.72);font-size:13px}
.template-gallery-dots{display:flex;gap:7px}
.template-gallery-dots button{width:8px;height:8px;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.26);cursor:pointer;transition:width .2s,background .2s}
.template-gallery-dots button[aria-current=true]{width:24px;border-radius:999px;background:var(--accent)}
.template-dialog-copy{overflow:auto;padding:54px 44px 34px}
.template-dialog-kicker{display:inline-flex;padding:7px 10px;border-radius:999px;background:rgba(255,90,31,.13);color:var(--accent);font-size:12px;font-weight:600}
.template-dialog-copy h2{margin:22px 0 4px;font-size:clamp(36px,4vw,58px);line-height:.95;letter-spacing:-.045em}
.template-dialog-niche{margin:0;color:var(--fg2);font-size:18px}
.template-dialog-description{margin:24px 0;color:var(--mute);font-size:15px;line-height:1.65}
.template-dialog-meta{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:0 0 28px}
.template-dialog-meta div{padding:15px;border:1px solid var(--line);border-radius:14px;background:rgba(244,242,237,.025)}
.template-dialog-meta dt{color:var(--mute);font-size:11px;line-height:1.35}.template-dialog-meta dd{margin:6px 0 0;color:var(--ink);font-size:14px;font-weight:600;line-height:1.35}
.template-dialog-list-title{font-size:13px;color:var(--mute)}
.template-dialog-copy ul{margin:12px 0 28px;padding:0;list-style:none}
.template-dialog-copy li{position:relative;padding:10px 0 10px 22px;border-bottom:1px solid var(--line);font-size:14px}
.template-dialog-copy li::before{content:'↗';position:absolute;left:0;color:var(--accent)}
.template-dialog-actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.template-dialog-actions .btn{border-radius:999px}
.template-live{min-height:44px;display:inline-flex;align-items:center;color:var(--ink);font-size:14px;text-decoration:underline;text-underline-offset:5px;text-decoration-color:var(--line)}
.template-live:hover{text-decoration-color:currentColor}
.template-dialog-note{margin:18px 0 0;color:var(--dim);font-size:11px;line-height:1.45}
@media(max-width:960px){#demos .grid.demos{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.template-dialog{width:min(720px,calc(100% - 20px));max-height:calc(100dvh - 20px)}.template-dialog-shell{grid-template-columns:1fr;max-height:calc(100dvh - 20px);overflow:auto}.template-gallery{min-height:420px}.template-dialog-copy{overflow:visible;padding:36px 28px 28px}}
@media(max-width:640px){#demos .grid.demos{grid-template-columns:minmax(0,1fr)}#demos .template-card .cap{padding:18px}.template-heading{gap:8px}.template-actions{gap:8px 12px}.template-card-meta{align-items:flex-end}.template-shot-hint{opacity:1;transform:none}.template-dialog{width:100%;max-height:100dvh;margin:auto 0 0;border-radius:22px 22px 0 0}.template-dialog-shell{max-height:94dvh}.template-gallery{min-height:auto;padding:10px}.template-gallery-frame{aspect-ratio:16/10}.template-gallery-arrow{width:44px;height:44px}.template-gallery-arrow.is-prev{left:10px}.template-gallery-arrow.is-next{right:10px}.template-gallery-foot{padding:10px 4px 0}.template-dialog-copy{padding:28px 20px 24px}.template-dialog-copy h2{font-size:42px}.template-dialog-meta{grid-template-columns:1fr}.template-dialog-close{top:10px;right:10px}.template-dialog-actions{align-items:stretch;flex-direction:column}.template-dialog-actions a{justify-content:center;width:100%}}
@media(prefers-reduced-motion:reduce){#demos .template-card,#works .template-preview{transition:none}}
