/* kit.css: the motion kit (plan 2026-11-11-2305 U8; spec docs/site-relaunch/round-three/specs/motion-kit.md).
   Markup from lib/site/parts/kit.ts, behavior from public/site/js/kit.js. Every rule outside a
   [data-kit-live] or [data-kit-state] selector styles the printed still, which is the finished state.
   Only transform, opacity and clip-path animate. Linked on every site page through the round-three seam (KTD16). */

:root {
  --kit-fast: 180ms;
  --kit-base: 320ms;
  --kit-slow: 600ms;
  --kit-strike: var(--coral, #cc5a4e);
  --kit-accent: var(--amber, #e8930c);
}

.kit-caption { margin: 10px 0 0; font-size: .88rem; line-height: 1.45; color: var(--muted, var(--ink-2)); }

/* The Uwee: a cut-out at its end position. In a moment its picture enters from the nearest edge. */
.kit-uwee { display: block; width: 96px; pointer-events: none; }
.kit-uwee img { display: block; width: 100%; height: auto; }

/* Build five SW2: no Play again button; a part plays again when it is scrolled back into view (kit.js rearm). */

@keyframes kit-enter { from { opacity: 0; transform: translateX(28px); } }
@keyframes kit-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes kit-arrive { from { opacity: 0; transform: translateY(6px); } }
@keyframes kit-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ------------------------------------------------------------------------------------------- */
/* 1. Before and after, dragged */

.kit-compare { margin: 0; }
.kit-compare__panes { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kit-compare__pane { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius-sm, 10px); background: var(--card, #fff); }
.kit-compare__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kit-compare__text { padding: 18px 20px; }
.kit-compare__text > p:last-child:not(.label) { margin: 6px 0 4px; font-family: var(--display); font-size: clamp(1.2rem, 1.7vw, 1.6rem); line-height: 1.25; }
.kit-compare__label {
  position: absolute; top: 10px; left: 10px; z-index: 1; padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; line-height: 1.3; color: var(--on-dark, #eef2f9); background: rgba(17, 22, 39, .8);
}
.kit-compare__pane:has(.kit-compare__text) .kit-compare__label { position: static; display: inline-block; margin: 14px 0 0 20px; }
/* The still: the Uwee stands between the two panes, at their foot. The line, the handle and the range wait for kit.js. */
.kit-compare__divider { position: absolute; left: 50%; bottom: -6px; z-index: 2; transform: translateX(-50%); pointer-events: none; }
.kit-compare__handle, .kit-compare__range { display: none; }
.kit-compare .kit-uwee { width: 84px; }

/* Text panes in the still (lead, wave 3): the carrier stands under the two cards, never over a line; on a phone the
   cards stack so each line keeps its width. */
.kit-compare:not([data-kit-live]) .kit-compare__panes:has(.kit-compare__text) { padding-bottom: 72px; }
.kit-compare:not([data-kit-live]) .kit-compare__panes:has(.kit-compare__text) .kit-compare__divider { bottom: 0; }
@media (max-width: 419px) {
  .kit-compare .kit-compare__panes:has(.kit-compare__text) { grid-template-columns: 1fr; padding-bottom: 72px; }
  .kit-compare .kit-compare__panes:has(.kit-compare__text) .kit-compare__divider { bottom: 0; }
}
@media (min-width: 420px) {
  .kit-compare[data-kit-live] .kit-compare__panes { grid-template-columns: 1fr; gap: 0; overflow: hidden; border-radius: var(--radius-sm, 10px); }
  .kit-compare[data-kit-live] .kit-compare__pane { grid-area: 1 / 1; border-radius: 0; }
  .kit-compare[data-kit-live] .kit-compare__pane--after { clip-path: inset(0 0 0 var(--kit-pos, 50%)); }
  .kit-compare[data-kit-live] .kit-compare__pane--after .kit-compare__label { left: auto; right: 10px; }
  .kit-compare[data-kit-live] .kit-compare__pane--after:has(.kit-compare__text) .kit-compare__label { margin: 14px 20px 0 0; float: right; }
  /* Text panes (lead, wave 3): each pane's words sit in their own half, so the still at 50% reads both lines in full
     and the drag wipes one away. Stacked whole-width, the after line hid under the clip and its half read empty. */
  .kit-compare[data-kit-live] .kit-compare__pane--before .kit-compare__text { margin-right: 50%; padding-right: 36px; }
  .kit-compare[data-kit-live] .kit-compare__pane--after .kit-compare__text { clear: both; margin-left: 50%; padding-left: 36px; }
  .kit-compare[data-kit-live] .kit-compare__divider { inset: 0; left: 0; bottom: 0; transform: translateX(var(--kit-pos, 50%)); }
  .kit-compare[data-kit-live] .kit-compare__divider::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(17, 22, 39, .18);
  }
  .kit-compare[data-kit-live] .kit-compare__handle {
    display: block; position: absolute; top: 50%; left: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px;
    border-radius: 50%; background: #fff; box-shadow: 0 4px 14px rgba(17, 22, 39, .22);
  }
  .kit-compare[data-kit-live] .kit-compare__handle::before {
    content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 10px;
    background: linear-gradient(90deg, var(--ink, #15171c) 0 2px, transparent 2px 12px, var(--ink, #15171c) 12px);
  }
  .kit-compare[data-kit-live] .kit-uwee { position: absolute; left: 0; bottom: 0; transform: translateX(-50%); }
  .kit-compare[data-kit-live] .kit-compare__range {
    display: block; position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; margin: 0;
    opacity: 0; cursor: ew-resize; touch-action: pan-y; -webkit-appearance: none; appearance: none; background: transparent;
  }
  .kit-compare[data-kit-live] .kit-compare__panes:has(.kit-compare__range:focus-visible) .kit-compare__handle { outline: 2px solid var(--kit-accent); outline-offset: 3px; }

  /* The moment: the divider nudges 50, 38, 62, 50 once (1.4 s). */
  .kit-compare[data-kit-state="playing"] .kit-compare__pane--after { animation: kit-nudge-clip 1400ms var(--ease) both; }
  .kit-compare[data-kit-state="playing"] .kit-compare__divider { animation: kit-nudge-move 1400ms var(--ease) both; }
  .kit-compare[data-kit-state="playing"] .kit-uwee img { animation: kit-enter 240ms var(--ease) both; }
}
@keyframes kit-nudge-clip {
  0%, 100% { clip-path: inset(0 0 0 50%); }
  30% { clip-path: inset(0 0 0 38%); }
  72% { clip-path: inset(0 0 0 62%); }
}
@keyframes kit-nudge-move {
  0%, 100% { transform: translateX(50%); }
  30% { transform: translateX(38%); }
  72% { transform: translateX(62%); }
}

/* ------------------------------------------------------------------------------------------- */
/* 2. The check, live */

.kit-check { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; column-gap: 12px; }
.kit-check > .kit-caption { grid-column: 1 / -1; justify-self: start; }
.kit-check__card {
  min-width: 0; padding: 18px 20px; border-radius: var(--radius, 18px);
  background: var(--card, #fff); border: 1px solid var(--rule, rgba(21, 23, 28, .12)); color: var(--fg, var(--ink));
}
.kit-check__context { margin-bottom: 12px; }
.kit-check__lines { display: grid; gap: 8px; margin: 0; }
.kit-check__was { position: relative; display: block; text-decoration: none; color: var(--muted, var(--ink-3)); }
/* The drawn strike: the line's own text, transparent, struck, laid over it, so it can sweep by clip-path. */
.kit-check__was::after {
  content: attr(data-strike); position: absolute; inset: 0; pointer-events: none; color: transparent;
  text-decoration: line-through; text-decoration-color: var(--kit-strike); text-decoration-thickness: 2px;
}
.kit-check__now { display: block; text-decoration: none; font-weight: 600; color: var(--fg, var(--ink)); }
.kit-check__source {
  display: inline-block; margin-top: 12px; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; line-height: 1.4; color: var(--muted, var(--ink-2)); background: var(--studio-2, #ebe8e1);
}
[data-ground="navy"] .kit-check__source, [data-ground="ink"] .kit-check__source { background: rgba(238, 242, 249, .1); }
/* Build five SW12b (Sarah ZmpbUNTEOlKa): the Uwee stands inside the card at its lower right, 120 px (was 88 px beside
   it), and the card's words keep a column clear of it. Narrow screens (was 72 px under the card's corner): 88 px,
   after the words, at the card's lower right. */
.kit-check__card { position: relative; }
.kit-check__card:has(> .kit-uwee) { padding-right: 148px; min-height: 150px; }
.kit-check__card > .kit-uwee { position: absolute; right: 14px; bottom: 0; width: 120px; }
@media (max-width: 560px) {
  .kit-check__card:has(> .kit-uwee) { padding-right: 20px; min-height: 0; }
  .kit-check__card > .kit-uwee { position: static; width: 88px; margin: 6px 0 -18px auto; }
}

.kit-check[data-kit-state="armed"] .kit-check__was::after,
.kit-check[data-kit-state="armed"] .kit-check__now { clip-path: inset(0 100% 0 0); }
.kit-check[data-kit-state="armed"] .kit-check__source { opacity: 0; transform: translateY(6px); }
.kit-check[data-kit-state="armed"] .kit-uwee img { opacity: 0; transform: translateX(28px); }
/* 2.4 s: unstruck for 500 ms, the Uwee steps in, the strike draws (400 ms), the true line writes in (600 ms), the chip arrives (180 ms). */
.kit-check[data-kit-state="playing"] .kit-uwee img { animation: kit-enter 240ms var(--ease) 260ms both; }
.kit-check[data-kit-state="playing"] .kit-check__was::after { animation: kit-wipe 400ms var(--ease) 500ms both; }
.kit-check[data-kit-state="playing"] .kit-check__now { animation: kit-wipe 600ms var(--ease) 900ms both; }
.kit-check[data-kit-state="playing"] .kit-check__source { animation: kit-arrive 180ms var(--ease) 1500ms both; }

/* ------------------------------------------------------------------------------------------- */
/* 3. Work that builds as you reach it */

.kit-build { position: relative; }
.kit-build__list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.kit-build__table { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
.kit-build__table caption { caption-side: top; text-align: left; font-weight: 600; padding-bottom: 4px; }
.kit-build__table th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted, var(--ink-2)); }
.kit-build__carry { display: flex; justify-content: flex-end; margin-top: -28px; pointer-events: none; }

.kit-build[data-kit-state="armed"] .kit-build__step { opacity: 0; transform: translateY(10px); }
.kit-build[data-kit-state="armed"] .kit-bar__fill { transform: translateX(calc(var(--kit-from, 0) * 100%)) scaleX(0); }
.kit-build[data-kit-state="armed"] .kit-build__carry .kit-uwee img { opacity: 0; transform: translateX(28px); }
.kit-build[data-kit-state="playing"] .kit-build__step { animation: kit-rise var(--kit-base) var(--ease) var(--kit-delay, 0ms) both; }
.kit-build[data-kit-state="playing"] .kit-bar__fill { animation: kit-grow var(--kit-base) var(--ease) var(--kit-delay, 0ms) both; }
.kit-build[data-kit-state="playing"] .kit-build__carry .kit-uwee img { animation: kit-enter 240ms var(--ease) var(--kit-delay, 0ms) both; }
@keyframes kit-grow { from { transform: translateX(calc(var(--kit-from, 0) * 100%)) scaleX(0); } }

/* A bar: label, track, value; the value is printed from the first paint. */
.kit-bar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(72px, 2fr) auto; align-items: center; gap: 12px; }
.kit-bar__track { position: relative; display: block; height: 10px; overflow: hidden; border-radius: 999px; background: var(--rule, rgba(21, 23, 28, .12)); }
.kit-bar__fill {
  position: absolute; inset: 0; border-radius: 999px; background: var(--muted, var(--ink-3));
  transform-origin: left center; transform: translateX(calc(var(--kit-from, 0) * 100%)) scaleX(var(--kit-span, 1));
}
.kit-bar--open .kit-bar__fill { border-radius: 999px 0 0 999px; -webkit-mask-image: linear-gradient(90deg, #000 72%, transparent); mask-image: linear-gradient(90deg, #000 72%, transparent); }
.kit-bar__value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; white-space: nowrap; }
@media (max-width: 720px) {
  .kit-bar { grid-template-columns: 1fr auto; }
  .kit-bar__track { grid-column: 1 / -1; grid-row: 2; }
}

/* ------------------------------------------------------------------------------------------- */
/* 4. The tabbed stage */

.kit-stage { position: relative; }
.kit-stage__strip { display: none; }
.kit-stage__panels { display: grid; gap: 28px; }
.kit-stage__heading { margin: 0 0 10px; }
.kit-stage > .kit-uwee { width: 72px; margin: 0 0 6px auto; }

.kit-stage[data-kit-live] .kit-stage__strip {
  display: block; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin-bottom: 18px;
}
.kit-stage[data-kit-live] .kit-stage__strip::-webkit-scrollbar { display: none; }
.kit-stage[data-kit-live] .kit-stage__tabs { display: flex; gap: 6px; width: max-content; min-width: 100%; border-bottom: 1px solid var(--rule, rgba(21, 23, 28, .14)); }
.kit-stage__tab {
  position: relative; min-height: 44px; padding: 0 16px; font: inherit; font-size: .92rem; font-weight: 600;
  color: var(--muted, var(--ink-2)); background: transparent; border: 0; cursor: pointer; white-space: nowrap;
}
.kit-stage__tab::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--kit-accent);
  transform: scaleX(0); transition: transform var(--kit-fast) var(--ease);
}
.kit-stage__tab[aria-selected="true"] { color: var(--fg, var(--ink)); }
.kit-stage__tab[aria-selected="true"]::after { transform: scaleX(1); }
.kit-stage__tab:focus-visible { outline: 2px solid var(--kit-accent); outline-offset: -2px; border-radius: 8px; }
.kit-stage[data-kit-live] .kit-stage__panels { gap: 0; }
.kit-stage[data-kit-live] .kit-stage__panel { grid-area: 1 / 1; transition: opacity 220ms var(--ease), visibility 0s; }
.kit-stage[data-kit-live] .kit-stage__panel[data-kit-off] { opacity: 0; visibility: hidden; transition: opacity 220ms var(--ease), visibility 0s 220ms; }
/* Phones: four short tab labels fit the row without a sideways scroll (a longer set still scrolls). */
@media (max-width: 480px) {
  .kit-stage[data-kit-live] .kit-stage__tabs { gap: 0; }
  .kit-stage__tab { padding: 0 9px; font-size: .84rem; }
  .kit-stage__tab::after { left: 7px; right: 7px; }
}
/* One column (under 1100px): the stage follows the step on show, so a short step leaves no blank under it. */
@media (max-width: 1099px) { .kit-stage[data-kit-live] .kit-stage__panel[data-kit-off] { display: none; } }
.kit-stage[data-kit-live] .kit-stage__panel:focus-visible { outline: 2px solid var(--kit-accent); outline-offset: 4px; border-radius: 6px; }
.kit-stage[data-kit-live] .kit-stage__heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kit-stage[data-kit-live] > .kit-uwee { position: absolute; top: 0; left: 0; margin: 0; transform: translateX(var(--kit-tab-x, 0px)); transition: transform 300ms var(--ease); }
.kit-stage[data-kit-live]:has(> .kit-uwee) { padding-top: 76px; } /* padding, not the strip's margin, which would collapse through the stage */

/* ------------------------------------------------------------------------------------------- */
/* 6. Small life */

.kit-status { display: inline-flex; align-items: center; gap: 7px; }
.kit-dot { position: relative; display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted, var(--ink-3)); }
.kit-dot--live { background: var(--viridian, #217a55); }
.kit-dot--live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: kit-pulse 2.4s var(--ease) infinite; }
.kit-dot--done-for-you { background: var(--kit-accent); }
.kit-dot--coming { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted, var(--ink-3)); }
@keyframes kit-pulse { 0% { opacity: .55; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(2.4); } }

@media (hover: hover) and (pointer: fine) {
  .kit-lift { position: relative; isolation: isolate; transition: transform var(--kit-fast) var(--ease); }
  /* The deeper shadow is a layer that fades in: box-shadow itself never animates. */
  .kit-lift::after {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
    box-shadow: 0 16px 36px rgba(17, 22, 39, .16); opacity: 0; transition: opacity var(--kit-fast) var(--ease);
  }
  .kit-lift:hover, .kit-lift:focus-visible, .kit-lift:focus-within { transform: translateY(-3px); }
  .kit-lift:hover::after, .kit-lift:focus-visible::after, .kit-lift:focus-within::after { opacity: 1; }
}

.kit-breath { overflow: hidden; }
.kit-breath > img, .kit-breath > picture, .kit-breath > video { display: block; animation: kit-breath 9s ease-in-out infinite; }
@keyframes kit-breath { 50% { transform: scale(1.015); } }

/* ------------------------------------------------------------------------------------------- */
/* 7. The fold */

.kit-fold__summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 8px; }
/* Every fold shows that it opens: a small chevron beside the label, pointing down while closed and up once open (a flex
   summary drops the browser's own marker). Drawn in CSS, not a "+" and a minus sign: the open fold's minus read as a stray
   dash (build five SW13, Sarah AQmuVUGaROom, Ulke1RS21_qe, 3qh0aAVogyqw, xyxzZa8tbGcS). Same muted color and about the
   size the "+" was. The fold stays a real <details>. */
.kit-fold__summary { list-style: none; }
.kit-fold__summary::-webkit-details-marker { display: none; }
.kit-fold__summary::after { content: ""; flex: none; box-sizing: border-box; width: .5em; height: .5em; margin: -.25em .2em 0; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.kit-fold[open] > .kit-fold__summary::after { content: ""; margin-top: .25em; transform: rotate(-135deg); }
.kit-fold__body { padding-top: 8px; }

/* ------------------------------------------------------------------------------------------- */
/* 8. Step clips */

.kit-clip { margin: 0; }
.kit-clip__frame { position: relative; overflow: hidden; border-radius: var(--radius-sm, 10px); background: var(--navy, #111627); }
.kit-clip__video { display: block; width: 100%; height: 100%; object-fit: cover; }
.kit-clip__play {
  display: none; position: absolute; left: 14px; bottom: 14px; min-height: 40px; padding: 0 16px 0 36px;
  font: inherit; font-size: .88rem; font-weight: 600; color: var(--ink, #15171c); background: #fff;
  border: 0; border-radius: 999px; cursor: pointer; box-shadow: 0 4px 14px rgba(17, 22, 39, .22);
}
.kit-clip__play::before {
  content: ""; position: absolute; left: 16px; top: 50%; margin-top: -6px;
  border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor;
}
.kit-clip[data-kit-live]:not([data-kit-state="playing"]) .kit-clip__play { display: block; }
.kit-clip__play:focus-visible { outline: 2px solid var(--kit-accent); outline-offset: 2px; }

/* ------------------------------------------------------------------------------------------- */
/* 9. Copy a code block. The block scrolls inside itself; the page never scrolls sideways. */

.kit-copy { display: grid; justify-items: end; gap: 6px; min-width: 0; }
.kit-copy__pre {
  justify-self: stretch; margin: 0; max-width: 100%; overflow-x: auto; white-space: pre; padding: 14px 16px;
  border-radius: var(--radius-sm, 10px); background: var(--navy, #111627); color: var(--on-dark, #eef2f9);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; line-height: 1.55;
}
.kit-copy__btn {
  min-height: 36px; padding: 0 14px; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
  color: var(--fg, var(--ink)); background: transparent; border: 1px solid var(--rule, rgba(21, 23, 28, .14)); border-radius: 999px;
}
.kit-copy__btn[hidden] { display: none; }
.kit-copy__btn:focus-visible { outline: 2px solid var(--kit-accent); outline-offset: 2px; }

/* ------------------------------------------------------------------------------------------- */
/* Reduced motion: every ambient loop and every transition stops. A visitor's own Play still plays. */

@media (prefers-reduced-motion: reduce) {
  .kit-dot--live::after, .kit-breath > img, .kit-breath > picture, .kit-breath > video { animation: none; }
  .kit-lift, .kit-lift::after, .kit-stage__tab::after, .kit-stage[data-kit-live] .kit-stage__panel,
  .kit-stage[data-kit-live] .kit-stage__panel[data-kit-off], .kit-stage[data-kit-live] > .kit-uwee { transition: none; }
  .kit-lift:hover, .kit-lift:focus-visible, .kit-lift:focus-within { transform: none; }
}
