/* design-a kit: fonts, the page reset the site ships (Tailwind v4 preflight,
   the parts a loop can feel), the live-stage base, the toggle, and the shared
   pointer pieces. Load after tokens.css and before a loop's style.css.
   Every rule that a builder may want to override has zero specificity
   (:where) or is a custom property. */

/* ── fonts (v3, 12 Oct 2026): the page loads Proza Libre (500, 700), Chivo (500) and the two Noto Indic faces by the Google Fonts
      CSS URL named in the page head; no font file is saved or served here (the Anybody, Manrope and JetBrains Mono faces are retired).
      The two local metric fallbacks below stand in until a web face arrives, set so the swap changes width by 2 percent or less and
      line height by nothing (size-adjust measured against the web face; the ascent, descent and gap overrides are the web face's
      own metrics divided by size-adjust). They sit second in --display, --body, --ui and --mono (tokens.css). ── */
@font-face{font-family:"Proza Libre Fallback";font-weight:500;src:local("Arial"),local("Liberation Sans"),local("Arimo");size-adjust:110%;ascent-override:90.12%;descent-override:33.30%;line-gap-override:0%}
@font-face{font-family:"Proza Libre Fallback";font-weight:700;src:local("Arial Bold"),local("Arial-BoldMT"),local("Liberation Sans Bold"),local("Arimo Bold");size-adjust:105.5%;ascent-override:93.96%;descent-override:34.72%;line-gap-override:0%}
@font-face{font-family:"Chivo Fallback";font-weight:500;src:local("Arial"),local("Liberation Sans"),local("Arimo");size-adjust:106.5%;ascent-override:88.27%;descent-override:23.52%;line-gap-override:0%}

/* ── reset: mirrors the Tailwind v4 preflight the site loads, so a poster
      paints the same here and after the port ── */
*, ::before, ::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; tab-size: 4; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: bolder; }
ol, ul, menu { list-style: none; }
img, svg, video, canvas { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; background-color: transparent; border-radius: 0; }
[hidden]:where(:not([hidden="until-found"])) { display: none !important; }

/* ── the page around a loop (section context; mirrors the v5 classes) ── */
.kl-page {
  background: var(--surface-light); color: var(--dark-surface);
  font-family: var(--body); font-weight: 500;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
/* Chivo is loaded at 500 and Proza Libre at 500 and 700 only: a heavier or lighter ask resolves to a loaded weight, and nothing is faked. */
.kl-page, .kl-page * { font-synthesis: none; font-kerning: normal; }
.kl-section { padding-block: var(--py-section); overflow-x: clip; color: var(--dark-surface); background: var(--surface-light); }
.kl-section[data-ground="chamber"] { background: var(--dark-surface); color: var(--surface-light); }
.kl-section[data-ground="gradient-red"] { background: var(--gradient-red); }
.kl-section[data-ground="gradient-green"] { background: var(--gradient-green); }
.kl-section[data-ground="pink"] { background: var(--pastel-pink); }
.kl-section[data-ground="sheet"] { background: var(--sheet); }
.kl-container { width: var(--container-wide); margin-inline: auto; }
.kl-container[data-width="base"] { width: var(--container); }
@media (max-width: 767px) { .kl-container, .kl-container[data-width="base"] { width: auto; padding-inline: 16px; } }
/* type voices, as the live page renders them (8 Oct 2026, localhost:4420) */
.kl-h1 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; line-height: .93; font-size: clamp(40px, 4.2vw, 96px); }
.kl-pillar { display: inline-flex; align-items: center; padding: 8px 14px 7px; border-radius: var(--r-1); background: var(--dark-surface); color: var(--surface-light); font-family: var(--body); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 28px; line-height: 1; }
[data-ground="chamber"] .kl-pillar { background: var(--sheet); color: var(--dark-surface); box-shadow: var(--shadow-2); }
.kl-h2 { font-family: var(--body); font-weight: 700; letter-spacing: -.005em; font-size: clamp(28px, 3.6vw, 52px); line-height: 1.05; }
.kl-h3 { font-family: var(--body); font-weight: 700; font-size: 24px; line-height: 30px; }
.kl-line { font-family: var(--body); font-weight: 500; font-size: 18px; line-height: 1.5; letter-spacing: .01em; max-width: 60ch; }
.kl-label { font-family: var(--body); font-weight: 700; font-size: 14px; line-height: 1.3; letter-spacing: .04em; text-transform: uppercase; }
@media (max-width: 767px) {
  .kl-pillar { font-size: 22px; }
  .kl-h3 { font-size: 20px; line-height: 26px; }
  .kl-line { font-size: 16px; }
}

/* ══ the live stage ══════════════════════════════════════════════════════
   The stage reserves its own box in the loop's style.css (aspect-ratio and
   container units with pixel floors). Never size it from script. */
.kl-stage {
  position: relative;
  display: block;
  margin: 0;
  container-type: inline-size;
  contain: layout paint;
  overflow: clip;
  isolation: isolate;
  /* knobs a loop may set on its own stage */
  --kl-floor: 15px;                       /* text floor at rendered size (desktop) */
  --kl-toggle-ink: var(--dark-surface);
  --kl-toggle-bg: var(--sheet);
  --kl-toggle-hover: var(--btn-light-hover);
  --kl-ring: var(--dark-surface);         /* focus ring colour; use --ring-chamber on dark */
}
@media (max-width: 767px) { .kl-stage { --kl-floor: 14px; } }

/* The animated layer. A camera move is a transform on this node only. */
.kl-camera { position: absolute; inset: 0; transform-origin: 0 0; }

/* Identity transforms on every animated HTML node, so the server poster
   paints exactly like a GSAP frame (same stacking contexts, same containing
   blocks). Zero specificity: a loop's own transform rule wins. SVG children
   are left alone: GSAP writes their transform attribute, which any CSS
   transform would override. */
:where(.kl-stage [data-k]:not(svg *)) { transform: translate(0px, 0px); }

/* Words pre-split for typing, and any inline node GSAP moves, must be boxes. */
:where(.kl-stage) .kl-w, :where(.kl-stage) span[data-k] { display: inline-block; }

/* The hidden sentence(s). */
.kl-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ── the toggle: one small round icon button, bottom right of the stage.
      Icon follows data-state (pause | play | replay); the runner keeps
      aria-label in step ("Pause" | "Play" | "Replay"). Keep the bottom-right
      52 px corner of every composition free of content. ── */
.kl-toggle {
  position: absolute; right: 8px; bottom: 8px; z-index: 10;
  display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0; margin: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--kl-toggle-ink);
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.kl-toggle::before {
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  background: var(--kl-toggle-bg);
  box-shadow: inset 0 0 0 1.5px var(--kl-toggle-ink);
  transition: background-color var(--dur-color) var(--ease-out);
}
.kl-toggle::after {
  content: ""; position: relative; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--kl-icon) center / contain no-repeat; mask: var(--kl-icon) center / contain no-repeat;
  --kl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 19h4V5H6v14zm8-14v14h4V5h-4z'/%3E%3C/svg%3E");
}
.kl-toggle[data-state="play"]::after {
  --kl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
}
.kl-toggle[data-state="replay"]::after {
  --kl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z'/%3E%3C/svg%3E");
}
.kl-toggle:focus { outline: none; }
.kl-toggle:focus-visible { outline: 3px solid var(--kl-ring); outline-offset: -1px; }
@media (hover: hover) and (pointer: fine) {
  html:not([data-wheel]) .kl-toggle:hover::before { background: var(--kl-toggle-hover); }
}
@media (max-width: 767px) {
  .kl-toggle { width: 44px; height: 44px; right: 6px; bottom: 6px; }
  .kl-toggle::before { inset: 6px; }
}
@media (forced-colors: active) {
  .kl-toggle::before { box-shadow: none; border: 1.5px solid ButtonText; }
  .kl-toggle::after { background: ButtonText; }
}

/* ── a tap stage names its control: a labelled pill (icon and the word), same corner, same size in every
      state (Play, Pause, Replay), so the control can be found without guessing. aria-label is unchanged. ── */
.kl-stage[data-kl-play="tap"] .kl-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 104px; height: 40px; padding: 0 4px 0 0;
  border-radius: 999px; background: var(--kl-toggle-bg);
  box-shadow: inset 0 0 0 1.5px var(--kl-toggle-ink);
  font-family: var(--ui); font-weight: 500; font-size: 15px; line-height: 1; letter-spacing: 0;
  transition: background-color var(--dur-color) var(--ease-out);
}
.kl-stage[data-kl-play="tap"] .kl-toggle::before {
  content: ""; position: static; inset: auto; flex: none; width: 14px; height: 14px; border-radius: 0; box-shadow: none; transition: none;
  background: currentColor;
  -webkit-mask: var(--kl-icon) center / contain no-repeat; mask: var(--kl-icon) center / contain no-repeat;
  --kl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 19h4V5H6v14zm8-14v14h4V5h-4z'/%3E%3C/svg%3E");
}
.kl-stage[data-kl-play="tap"] .kl-toggle[data-state="play"]::before {
  --kl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
}
.kl-stage[data-kl-play="tap"] .kl-toggle[data-state="replay"]::before {
  --kl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z'/%3E%3C/svg%3E");
}
.kl-stage[data-kl-play="tap"] .kl-toggle::after {
  content: "Pause"; position: static; width: auto; height: auto; background: none; -webkit-mask: none; mask: none; color: inherit;
}
.kl-stage[data-kl-play="tap"] .kl-toggle[data-state="play"]::after { content: "Play"; }
.kl-stage[data-kl-play="tap"] .kl-toggle[data-state="replay"]::after { content: "Replay"; }
@media (hover: hover) and (pointer: fine) {
  html:not([data-wheel]) .kl-stage[data-kl-play="tap"] .kl-toggle:hover { background: var(--kl-toggle-hover); }
}
@media (max-width: 767px) {
  .kl-stage[data-kl-play="tap"] .kl-toggle { width: 104px; height: 44px; right: 6px; bottom: 6px; }
}
@media (forced-colors: active) {
  .kl-stage[data-kl-play="tap"] .kl-toggle { box-shadow: none; border: 1.5px solid ButtonText; }
  .kl-stage[data-kl-play="tap"] .kl-toggle::before { background: ButtonText; }
}

/* ── the page control, .pd-ctl (BUILD-PLAN-v3 B1, MOTION-MAP 4.0 Controls, SYSTEM 7): the one 44 px round ghost button in a band's tab row,
      outside the figure, marked data-kl-ctl="<stage id>". The runner keeps aria-label and data-state (play, pause, replay) in step.
      Hover fill 150 ms on a fine pointer only; press scale(.97) in 90 ms, release 120; focus a 2 px ring, 3 px offset, instant.
      The icon swaps by opacity in 150 ms, the arriving icon growing from scale .9 (the pause icon is ::before; play and replay share ::after,
      which changes its picture in place). Colour is the band's own ink (currentColor). Nothing here animates on its own. ── */
.pd-ctl {
  position: relative; flex: none; width: 44px; height: 44px; padding: 0; margin: 0; border: 0; border-radius: 50%;
  background-color: transparent; color: inherit; cursor: pointer; box-shadow: inset 0 0 0 1.5px currentColor;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform var(--dur-release) var(--ease-out), background-color var(--dur-color) var(--ease-out);
}
.pd-ctl::before, .pd-ctl::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; background: currentColor;
  -webkit-mask: var(--pd-icon) center / contain no-repeat; mask: var(--pd-icon) center / contain no-repeat;
}
/* the pause picture: shown in data-state="pause" only */
.pd-ctl::before {
  --pd-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 19h4V5H6v14zm8-14v14h4V5h-4z'/%3E%3C/svg%3E");
  opacity: 0; transform: scale(var(--icon-scale));
  transition: opacity var(--dur-color) var(--ease-out), transform 0s linear var(--dur-color);   /* leaves by opacity, then waits at .9 for its next entrance */
}
.pd-ctl[data-state="pause"]::before { opacity: 1; transform: scale(1); transition: opacity var(--dur-color) var(--ease-out), transform var(--dur-color) var(--ease-out); }
/* the replay picture (the rest state) and the play picture */
.pd-ctl::after {
  --pd-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z'/%3E%3C/svg%3E");
  opacity: 1; transform: scale(1); transition: opacity var(--dur-color) var(--ease-out), transform var(--dur-color) var(--ease-out);
}
.pd-ctl[data-state="play"]::after {
  --pd-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
}
.pd-ctl[data-state="pause"]::after { opacity: 0; transform: scale(var(--icon-scale)); transition: opacity var(--dur-color) var(--ease-out), transform 0s linear var(--dur-color); }
.pd-ctl:active { transform: scale(var(--press-scale)); transition-duration: var(--dur-press), var(--dur-color); }
.pd-ctl:focus { outline: none; }
.pd-ctl:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; transition: none; }
@media (hover: hover) and (pointer: fine) {
  html:not([data-wheel]) .pd-ctl:hover { background-color: color-mix(in srgb, currentColor 16%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .pd-ctl, .pd-ctl::before, .pd-ctl::after { transition: none !important; }
}
@media (forced-colors: active) {
  .pd-ctl { box-shadow: none; border: 1.5px solid ButtonText; }
  .pd-ctl::before, .pd-ctl::after { background: ButtonText; }
}

/* ── shared pointer pieces (hidden in every poster; a builder moves them with
      x/y transforms set inside build, never with left/top) ── */
/* Simulated arrow cursor, desktop compositions. Its tip sits on (x, y). */
.kl-cursor {
  position: absolute; left: 0; top: 0; z-index: 6;
  width: 20px; height: 24px; margin: -2px 0 0 -2px;
  opacity: 0; pointer-events: none; transform-origin: 2px 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24'%3E%3Cpath d='M2 2v17.5l4.8-4.4 3.2 7 3-1.4-3.1-6.8H16z' fill='%230b2a2b' stroke='%23f6f6f6' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
}
/* Tap dot, phone compositions: a 28 px soft disc with a ring, centred on (x, y). */
.kl-tap {
  position: absolute; left: 0; top: 0; z-index: 6;
  width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  background: rgba(11, 42, 43, .32);
  box-shadow: 0 0 0 2px var(--surface-light), 0 0 0 3.5px var(--dark-surface);
  opacity: 0; pointer-events: none;
}
/* The ring that expands from the press point (scale about .4 to 1.6, fading). */
.kl-press {
  position: absolute; left: 0; top: 0; z-index: 5;
  width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 2px solid var(--kl-press, var(--dark-surface));
  opacity: 0; pointer-events: none;
}

/* ── digit strip: an exact integer that rolls. The window shows one line;
      the strip's LAST digit is the poster value (the strip sits on the
      window's bottom edge), so the poster needs no transform. Roll it with
      yPercent: (n - 1 - k) / n * 100 shows digit index k of n. ── */
.kl-digit {
  position: relative; display: inline-block; vertical-align: top;
  width: 1ch; height: var(--kl-lh, 1.15em); line-height: var(--kl-lh, 1.15em);
  overflow: clip; font-variant-numeric: tabular-nums;
}
.kl-digit > .kl-strip { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; }
.kl-digit > .kl-strip > span { display: block; height: var(--kl-lh, 1.15em); text-align: center; }

@media print {
  .kl-toggle, .pd-ctl { display: none; }
}
