/* Inline figures for "The Test Kitchen and the Line". Uses the v5 tokens from archive.css.
   One colour rule across every figure: red is the new, uncertain or exploring part; ink is the fixed, rule-bound part.
   Everything is readable without JS; kitchen.js only adds .armed and .on so the pieces settle in as they scroll in. */

.tk { container-type: inline-size; margin: 44px 0 48px; padding-top: 14px; border-top: 1px solid var(--hair); }
.tk-kicker { font: 500 12px/1.35 var(--mono); letter-spacing: .02em; color: var(--muted); }
.tk p + p { margin-top: 0; }
.tk figcaption { margin-top: 22px; padding-top: 12px; border-top: 1px dashed var(--dash); font-size: 15px; line-height: 1.6; color: var(--muted); }
.tk-card { background: var(--sheet); border-radius: 10px; box-shadow: var(--lift); }

/* ---------- the short answer ---------- */
.tk-short { margin: 32px 0 8px; padding: 18px 22px 20px; max-width: 40em; background: var(--sheet); border-radius: 10px; box-shadow: var(--lift); font: 400 16.5px/1.55 var(--sans); }
.tk-short ol { margin-top: 10px; counter-reset: tk; display: grid; gap: 10px; }
.tk-short li { counter-increment: tk; position: relative; padding-left: 30px; color: var(--muted); }
.tk-short li::before { content: counter(tk); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--red); color: #fff; font: 600 11.5px/20px var(--mono); text-align: center; }
.tk-short li > span { color: var(--ink); font-weight: 600; }

/* ---------- exploring vs executing bars ---------- */
.tk-legend { display: flex; align-items: center; gap: 6px 8px; margin-top: 10px; font: 500 12px/1 var(--mono); color: var(--muted); }
.tk-sw { width: 14px; height: 10px; border-radius: 2px; }
.tk-sw-e { margin-left: 10px; }
.tk-sw-x, .tk-bar i { background: var(--red); }
.tk-sw-e, .tk-bar { background: repeating-linear-gradient(-45deg, rgba(18, 20, 24, .2) 0 2px, rgba(18, 20, 24, .09) 2px 5px); }
.tk-bars { margin-top: 18px; display: grid; gap: 18px; }
.tk-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "team pct" "bar bar" "keep keep"; gap: 6px 12px; align-items: baseline; }
.tk-team { grid-area: team; font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.tk-pct { grid-area: pct; font: 500 12px/1.3 var(--mono); color: var(--red-ink); white-space: nowrap; }
.tk-bar { grid-area: bar; display: block; height: 14px; border-radius: 3px; overflow: hidden; }
.tk-bar i { display: block; height: 100%; width: calc(var(--x) * 1%); border-right: 2px solid var(--sheet); transform-origin: 0 50%; }
.tk-keep { grid-area: keep; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
@container (min-width: 600px) {
  .tk-bars li { grid-template-columns: 12.5em minmax(0, 1fr) 9.5em; grid-template-areas: "team bar pct" ". keep keep"; align-items: center; column-gap: 16px; }
  .tk-pct { text-align: left; }
}

/* ---------- one workflow, two tracks ---------- */
.tk-lanes { display: none; }
.tk-steps { margin-top: 18px; display: grid; gap: 10px; }
.tk-step { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; padding: 12px 14px 13px; background: var(--sheet); border-radius: 10px; box-shadow: var(--lift); border-left: 3px solid var(--ink); }
.tk-step.tk-p { border-left-color: var(--red); margin-left: 28px; }
.tk-step > * { grid-column: 2; }
.tk-n { grid-column: 1; grid-row: 1 / span 3; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 12px/24px var(--mono); text-align: center; }
.tk-p .tk-n { background: var(--red); }
.tk-tag { font: 500 11px/1.4 var(--mono); letter-spacing: .03em; text-transform: lowercase; color: var(--muted); }
.tk-p .tk-tag { color: var(--red-ink); }
.tk-step b { font-weight: 600; font-size: 16px; line-height: 1.3; }
.tk-step b + span { font-size: 14.5px; line-height: 1.45; color: var(--muted); margin-top: 2px; }
@container (min-width: 600px) {
  .tk-lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 16px; }
  .tk-lane { padding: 8px 0 8px 12px; font-weight: 600; font-size: 15px; line-height: 1.3; border-left: 3px solid var(--ink); }
  .tk-lane small { display: block; font: 500 11.5px/1.5 var(--mono); color: var(--muted); }
  .tk-lane-p { border-left-color: var(--red); }
  .tk-steps { grid-template-columns: 1fr 1fr; column-gap: 28px; margin-top: 12px; background: linear-gradient(var(--dash), var(--dash)) 50% 0 / 1px 100% no-repeat; }
  .tk-step.tk-d { grid-column: 1; }
  .tk-step.tk-p { grid-column: 2; margin-left: 0; }
  .tk-steps li:nth-child(1) { grid-row: 1; } .tk-steps li:nth-child(2) { grid-row: 2; } .tk-steps li:nth-child(3) { grid-row: 3; }
  .tk-steps li:nth-child(4) { grid-row: 4; } .tk-steps li:nth-child(5) { grid-row: 5; } .tk-steps li:nth-child(6) { grid-row: 6; }
  .tk-tag { display: none; }
}

/* ---------- the radius of a mistake ---------- */
.tk-axis { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 12px; font: 500 11.5px/1.35 var(--mono); color: var(--muted); background: linear-gradient(90deg, rgba(224, 48, 30, .12), var(--red)) 0 0 / 100% 4px no-repeat; }
.tk-axis span:last-child { text-align: right; color: var(--red-ink); }
.tk-levels { margin-top: 16px; display: grid; gap: 12px; }
.tk-levels li { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-content: start; padding: 14px 16px 15px; background: var(--sheet); border-radius: 10px; box-shadow: var(--lift); }
.tk-levels li > :not(svg) { grid-column: 2; }
.tk-ring { grid-row: 1 / span 4; width: 48px; height: 48px; }
.tk-ring circle { fill: none; stroke: var(--dash); stroke-width: 1.5; }
.tk-ring circle.on { fill: rgba(224, 48, 30, .16); stroke: var(--red); }
.tk-levels b { font-weight: 600; font-size: 16.5px; line-height: 1.3; }
.tk-who { font-size: 14.5px; line-height: 1.45; color: var(--ink); margin-bottom: 6px; }
.tk-eg { font-size: 14px; line-height: 1.45; color: var(--muted); }
.tk-eg em { font: 500 11.5px/1 var(--mono); font-style: normal; color: var(--faint); margin-right: 4px; }
@container (min-width: 600px) {
  .tk-levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tk-levels li { grid-template-columns: minmax(0, 1fr); }
  .tk-levels li > :not(svg) { grid-column: 1; }
  .tk-ring { grid-row: auto; margin-bottom: 10px; }
}

/* ---------- intelligence and authority ---------- */
.tk-roles { margin-top: 18px; display: grid; gap: 28px; }
.tk-roles li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 15px; background: var(--sheet); border-radius: 10px; box-shadow: var(--lift); }
.tk-roles li:not(:last-child)::after { content: ""; position: absolute; left: 50%; bottom: -19px; width: 9px; height: 9px; margin-left: -5px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); rotate: 45deg; }
.tk-kind { align-self: flex-start; margin-bottom: 6px; padding: 3px 8px 4px; border-radius: 999px; font: 500 11px/1 var(--mono); letter-spacing: .02em; color: var(--red-ink); box-shadow: inset 0 0 0 1px var(--red); }
.tk-kind-a { color: #fff; background: var(--ink); box-shadow: none; }
.tk-kind-c { color: var(--muted); box-shadow: none; outline: 1px dashed var(--dash); outline-offset: -1px; }
.tk-roles b { font-weight: 600; font-size: 17px; line-height: 1.25; }
.tk-roles .tk-who { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.tk-roles .tk-eg { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--hair-2); color: var(--ink); font-size: 14.5px; }
@container (min-width: 640px) {
  .tk-roles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
  .tk-roles li:not(:last-child)::after { left: auto; right: -15px; bottom: auto; top: 50%; margin: -5px 0 0; rotate: -45deg; }
}

/* ---------- copilot to coworker ---------- */
.tk-rungs { margin-top: 18px; display: grid; gap: 8px; }
.tk-rungs li { display: grid; gap: 2px; padding: 12px 14px 13px; border-radius: 10px; background: var(--sheet); box-shadow: var(--lift); }
.tk-rungs li:nth-child(2) { margin-left: 16px; } .tk-rungs li:nth-child(3) { margin-left: 32px; } .tk-rungs li:nth-child(4) { margin-left: 48px; box-shadow: inset 0 0 0 1.5px var(--red), var(--lift); }
.tk-rungs b { font-weight: 600; font-size: 16.5px; line-height: 1.25; }
.tk-rungs span { font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.tk-ends { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; font: 500 11.5px/1 var(--mono); color: var(--muted); background: linear-gradient(90deg, var(--dash), var(--red)) 0 0 / 100% 1.5px no-repeat; }
.tk-ends span:last-child { color: var(--red-ink); }
@container (min-width: 600px) {
  .tk-rungs { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 10px; }
  .tk-rungs li:nth-child(n) { margin-left: 0; }
  .tk-rungs li:nth-child(1) { margin-top: 63px; } .tk-rungs li:nth-child(2) { margin-top: 42px; } .tk-rungs li:nth-child(3) { margin-top: 21px; }
}

/* ---------- settling in (only once kitchen.js has armed the figure) ---------- */
.tk.armed [style*="--i"] { translate: 0 10px; }
.tk.on [style*="--i"] { translate: 0 0; transition: translate .6s cubic-bezier(.22, 1, .36, 1) calc(var(--i) * 90ms); }
.tk.armed .tk-bar i { transform: scaleX(0); }
.tk.on .tk-bar i { transform: scaleX(1); transition: transform .8s cubic-bezier(.22, 1, .36, 1) .1s; }
