/* ==========================================================================
   Toolkit decks (template-parts/toolkit/decks.php, assets/js/toolkit.js).
   Default = a plain list of cards per category (no JS, reduced motion).
   .tk.is-live (set by toolkit.js) = pinned stage: a stack of cards that fans out while you
   scroll, folds back and flies away, then the next category's deck comes in.
   ========================================================================== */

.tk { --tk-w: 200px; position: relative; }
.tk__head { text-align: center; }
.tk__title {
	margin: 0;
	font: 400 clamp(56px, 8vw, 128px)/1 "Ailerons", "Orbitron", var(--font-display);
	letter-spacing: .14em; text-transform: uppercase;
	margin-right: -.14em; /* letter-spacing trails the last letter; keep the word centred */
}
.tk__subs { position: relative; height: 1.6em; margin-top: 14px; font-size: clamp(16px, 1.4vw, 20px); color: var(--fg-2, #cfcfcf); }
.tk__sub { margin: 0; max-width: none; text-align: center; }
.tk__cue { display: none; }

/* ---------- plain list (fallback) ---------- */
.tk__decks { display: flex; flex-direction: column; gap: 48px; margin-top: 32px; padding-inline: var(--gutter-x, 24px); }
.tk:not(.is-live) .tk__subs { display: none; }
.tk__deck-title { margin: 0 0 18px; font-size: clamp(18px, 1.6vw, 22px); text-align: center; color: var(--fg-2, #cfcfcf); }
.tk__cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 0; padding: 0; list-style: none; }
.tk__slot { width: var(--tk-w); }

/* ---------- card ---------- */
.tk-card {
	--c-bg: #15161b; --c-fg: #fff; --c-pill: rgba(255, 255, 255, .14);
	position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .7em;
	width: var(--tk-w); aspect-ratio: 5 / 7; padding: 12%;
	border-radius: calc(var(--tk-w) * .085);
	background: var(--c-bg); color: var(--c-fg);
	box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .08);
	font-size: calc(var(--tk-w) * .1);
	text-align: center;
	transition: transform 450ms cubic-bezier(.16, 1, .3, 1), box-shadow 450ms;
}
.tk-card__name {
	margin: 0; color: inherit;
	font: 800 1.6em/1.05 var(--font-display); letter-spacing: calc(var(--display-ls, -0.03em) - .05em);
	text-wrap: balance; /* whole words only: names wrap between words, never inside one */
}
.tk-card__role {
	padding: .45em .9em; border-radius: 99px; background: var(--c-pill);
	font: 700 max(.5em, 10px)/1.15 var(--font-body); letter-spacing: .03em; max-width: 100%; text-wrap: balance;
}
.tk-card__tag {
	position: absolute; top: 9%; left: 50%; transform: translateX(-50%);
	padding: .35em .8em; border: 1px solid currentColor; border-radius: 99px;
	font: 700 max(.42em, 9px)/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; opacity: .8;
}
.tk-card--violet { --c-bg: #2a1f5c; --c-fg: #cdbbff; }
.tk-card--plum   { --c-bg: #3b1238; --c-fg: #ff9be0; }
.tk-card--blue   { --c-bg: #0c2a4b; --c-fg: #6cc3ff; }
.tk-card--ink    { --c-bg: #0d0e12; --c-fg: #f2f2f2; }
.tk-card--lime   { --c-bg: #d6ff3d; --c-fg: #0a0a0d; --c-pill: rgba(0, 0, 0, .12); }
.tk-card--orange { --c-bg: #ff8a00; --c-fg: #0a0a0d; --c-pill: rgba(0, 0, 0, .14); }
.tk-card--red    { --c-bg: #5c1013; --c-fg: #ff7a6b; }
.tk-card--paper  { --c-bg: #f3eee5; --c-fg: #0a0a0d; --c-pill: rgba(0, 0, 0, .1); }
.tk-card--steel  { --c-bg: #27313d; --c-fg: #e6edf4; }
.tk-card--accent { --c-bg: var(--accent, #ff5a1f); --c-fg: #0a0a0d; --c-pill: rgba(0, 0, 0, .16); }

/* ---------- live: pinned stage ---------- */
.tk.is-live { height: calc(var(--decks) * 210vh + 60vh); margin-top: calc((var(--header-h) + 48px) * -1); }
.tk.is-live .tk__stage {
	position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
	display: flex; flex-direction: column;
	padding-top: calc(var(--header-h) + clamp(20px, 5vh, 56px));
}
.tk.is-live .tk__sub { position: absolute; inset: 0; opacity: 0; transform: translateY(10px); transition: opacity 500ms, transform 600ms cubic-bezier(.16, 1, .3, 1); }
.tk.is-live .tk__sub.is-on { opacity: 1; transform: none; }
.tk.is-live .tk__decks { position: relative; flex: 1; margin: 0; padding: 0; display: block; }
.tk.is-live .tk__deck { position: absolute; inset: 0; visibility: hidden; }
.tk.is-live .tk__deck.is-on { visibility: visible; }
.tk.is-live .tk__deck-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tk.is-live .tk__cards { display: block; position: absolute; inset: 0; }
.tk.is-live .tk__slot {
	position: absolute; left: 50%; top: 50%;
	margin: calc(var(--tk-w) * -.7) 0 0 calc(var(--tk-w) * -.5);
	will-change: transform;
}
.tk.is-live .tk__cue {
	display: block; position: absolute; left: 50%; bottom: 22px; margin: 0; transform: translateX(-50%);
	color: var(--mute, #8a8a8a); font: 700 11px/1 var(--font-body); letter-spacing: .28em; text-transform: uppercase;
	transition: opacity 400ms;
}
.tk.is-live.is-moving .tk__cue { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
	.tk.is-live .tk__deck.is-fanned .tk__slot:hover { z-index: 60 !important; }
	.tk.is-live .tk__deck.is-fanned .tk__slot:hover .tk-card { transform: translateY(-22px) rotate(-2deg) scale(1.04); box-shadow: 0 30px 60px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .14); }
}
@media (max-width: 767px) {
	.tk.is-live .tk__stage { padding-top: calc(var(--header-h) + 18px); padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
	.tk__subs { margin-top: 8px; font-size: 15px; }
	.tk.is-live .tk__cue { display: none; }
}
