/* Long-form article pages. Loaded after style.css and uses its colours, type and
   motion tokens. Interactive parts start hidden or static and are switched on by
   article.js, so the page reads the same without JavaScript. */

/* Buttons here are real <button>s, which don't inherit the page font. */
button.button { font-family: inherit; cursor: pointer; }

/* Reading progress */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 7; pointer-events: none;
}
.progress span {
  display: block; height: 100%; background: var(--text);
  transform: scaleX(0); transform-origin: 0 50%;
}

/* Hero */
.article-hero { padding-top: 40px; padding-bottom: 48px; position: relative; isolation: isolate; }
.article-hero h1 { font-size: clamp(40px, 6.6vw, 74px); max-width: 15ch; }
.article-hero .lede { max-width: 700px; }
.back {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 20px -2px;
  color: var(--muted); text-decoration: none; font-size: 15px;
}
.back:hover { color: var(--text); }
.back span { transition: transform var(--dur-quick) var(--spring); }
@media (hover: hover) and (pointer: fine) {
  .back:hover span { transform: translateX(-4px); }
}
.byline {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0; color: var(--faint); font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.byline span:first-child { color: var(--text); font-weight: 600; }
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; margin: 40px 0 0; background: var(--line);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.facts div { background: var(--bg); padding: 18px 22px; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
@media (prefers-reduced-motion: no-preference) {
  .article-hero > :not(h1) { animation: hero-in var(--dur-enter) var(--spring) backwards; }
  .article-hero > .label { animation-delay: 40ms; }
  .article-hero > .lede { animation-delay: 120ms; }
  .article-hero > .byline { animation-delay: 180ms; }
  .article-hero > .facts { animation-delay: 260ms; }
}

/* Layout: contents beside the article on wide screens, a drawer on small ones */
.article-layout { border-top: 1px solid var(--line); padding-top: 8px; }
.toc-side { display: none; }
@media (min-width: 1100px) {
  .article-layout {
    display: grid; grid-template-columns: 200px minmax(0, 720px); gap: 72px; align-items: start;
  }
  .toc-side { display: block; position: sticky; top: 84px; padding-top: 56px; }
  .toc-mobile { display: none; }
}
.toc { display: block; position: static; width: auto; margin: 0; overflow: visible; }
.toc-title {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--muted); margin: 0 0 12px;
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a {
  display: block; min-height: 0; padding: 7px 0 7px 16px; margin-left: -1px; border-radius: 0;
  border-left: 1px solid transparent; color: var(--muted); font-size: 14.5px; line-height: 1.35;
  text-decoration: none; background: none; transition: color var(--dur-quick), border-color var(--dur-quick);
}
.toc a:hover { color: var(--text); background: none; }
.toc a[aria-current] { color: var(--text); border-left-color: var(--text); font-weight: 600; }
.toc-mobile {
  margin: 32px 0 0; border: 1px solid var(--line); border-radius: 16px; padding: 0 18px;
  background: var(--panel);
}
.toc-mobile summary { margin: 0; color: var(--text); font-weight: 600; min-height: 52px; }
.toc-mobile .toc ol { margin: 0 0 14px; }
.toc-mobile .toc a { padding: 9px 0 9px 16px; font-size: 15.5px; }

/* Prose */
.prose { min-width: 0; max-width: 720px; font-size: 18.5px; line-height: 1.72; padding-bottom: 24px; }
.prose > section { padding-top: 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose h2 {
  font-size: clamp(30px, 4vw, 40px); margin: 88px 0 20px; scroll-margin-top: 84px; text-wrap: balance;
}
.prose > section:first-of-type h2 { margin-top: 56px; }
.prose h2 .num {
  display: block; font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.16em;
  color: var(--muted); margin-bottom: 14px;
}
.prose h3 { font-size: 22px; margin: 44px 0 10px; letter-spacing: -0.02em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0 0 0.55em; padding-left: 0.2em; }
.prose li::marker { color: var(--faint); }
.prose strong { font-weight: 650; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose :not(pre) > code {
  font-family: var(--mono); font-size: 0.84em; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.08em 0.36em; overflow-wrap: anywhere;
}
.prose q { quotes: "\201C" "\201D"; }
.dropcap::first-letter {
  float: left; font-size: 4.15em; line-height: 0.86; font-weight: 750; letter-spacing: -0.04em;
  margin: 0.06em 0.1em 0 0;
}
.pull {
  margin: 44px 0; padding: 4px 0 4px 26px; border-left: 2px solid var(--text);
}
.pull p {
  margin: 0; font-size: clamp(25px, 3.2vw, 32px); line-height: 1.22; font-weight: 650;
  letter-spacing: -0.025em; text-wrap: balance;
}
.steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.steps li { counter-increment: step; position: relative; padding-left: 46px; margin-bottom: 0.9em; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.15em;
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; font-family: var(--mono); font-size: 13px; color: var(--muted);
}
.checks { list-style: none; padding-left: 0 !important; }
.checks li { position: relative; padding-left: 34px; }
.checks li::before {
  content: "\2713"; position: absolute; left: 0; top: 0.1em; width: 22px; height: 22px; border-radius: 50%;
  background: var(--text); color: var(--bg); font-size: 13px; display: grid; place-items: center; line-height: 1;
}

/* Figures */
.prose figure { margin: 40px 0; }
.prose figcaption { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin-top: 12px; max-width: 640px; }
figure.code pre {
  margin: 0; padding: 18px 20px; overflow-x: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; font: 13.5px/1.65 var(--mono); tab-size: 4;
}
figure.code code { font-family: inherit; }
figure.code .c { color: var(--faint); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.table-scroll:focus-visible { outline-offset: 3px; }

/* 1. Call flow */
.flow-stage {
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px 14px;
}
.flow-svg { display: block; width: 100%; max-width: 640px; height: auto; aspect-ratio: 556 / 432; margin: 0 auto; overflow: visible; }
.flow-svg text { font-family: var(--font); }
.flow-engine { fill: color-mix(in srgb, var(--text) 3%, transparent); stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 4 5; }
.flow-engine-label, .flow-note { fill: var(--faint); font-family: var(--mono) !important; font-size: 10.5px; letter-spacing: 0.06em; }
.flow-links path { fill: none; stroke: var(--faint); stroke-width: 1.5; }
.flow-links .flow-return { stroke-dasharray: 5 5; }
.flow-head { fill: var(--faint); }
.flow-node { cursor: pointer; outline: none; }
.flow-node rect {
  fill: var(--bg); stroke: var(--line); stroke-width: 1.5;
  transition: fill var(--dur-quick), stroke var(--dur-quick);
}
.flow-name { fill: var(--text); font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; transition: fill var(--dur-quick); }
.flow-sub { fill: var(--muted); font-size: 10.5px; transition: fill var(--dur-quick); }
.flow-node:hover rect { stroke: var(--faint); }
.flow-node:focus-visible rect { stroke: var(--text); stroke-width: 3; }
.flow-node.selected rect { stroke: var(--text); stroke-width: 2.5; }
.flow-node.lit rect { fill: var(--text); stroke: var(--text); }
.flow-node.lit .flow-name, .flow-node.lit .flow-sub { fill: var(--bg); }
.flow-packet { fill: var(--text); stroke: var(--bg); stroke-width: 3; paint-order: stroke; opacity: 0; transition: opacity var(--dur-quick); }
.flow.playing .flow-packet { opacity: 1; }
.flow.back .flow-packet { fill: var(--bg); stroke: var(--text); stroke-width: 3; }
.flow-node.lit ~ .flow-packet, .flow.back .flow-node.lit ~ .flow-packet { stroke: var(--panel); }
.flow-controls { display: flex; gap: 18px; align-items: flex-start; margin-top: 16px; }
.flow-controls .button { flex: none; min-width: 132px; }
.flow-panel { margin: 0 !important; flex: 1; min-height: 6.4em; color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.flow-panel strong { color: var(--text); }
.flow-fallback { font-size: 16px; }
@media (max-width: 560px) {
  .flow-stage { margin: 0 -12px; padding: 10px 4px; border-radius: 18px; }
  .flow-name { font-size: 18px; transform: translateY(8px); }
  .flow-sub, .flow-note, .flow-engine-label { display: none; }
  .flow-controls { flex-direction: column; gap: 12px; }
  .flow-panel { min-height: 9.8em; }
}

/* 2. Conversation replay */
.replay {
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 20px;
}
.replay-head { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.replay-lanes { display: grid; grid-template-columns: repeat(2, minmax(0, auto)); gap: 8px 22px; }
.lane { display: flex; align-items: center; gap: 10px; }
.lane-name {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--faint); min-width: 7.5em; transition: color var(--dur-quick);
}
.wave { display: inline-flex; align-items: center; gap: 3px; height: 26px; }
.wave i {
  display: block; width: 3px; height: 24px; border-radius: 2px; background: var(--line);
  transform: scaleY(0.18); transition: background-color var(--dur-quick), transform var(--dur-quick);
}
.lane.speaking .lane-name { color: var(--text); }
.lane.speaking .wave i { background: var(--text); transform: scaleY(0.6); }
.lane.thinking .lane-name { color: var(--muted); }
.lane.thinking .wave i { background: var(--faint); }
@media (prefers-reduced-motion: no-preference) {
  .lane.speaking .wave i { animation: wave 0.9s ease-in-out infinite alternate; }
  .lane.thinking .wave i { animation: think 1.2s ease-in-out infinite; }
  .wave i:nth-child(3n) { animation-duration: 0.7s; animation-delay: -0.2s; }
  .wave i:nth-child(3n+1) { animation-duration: 1.05s; animation-delay: -0.5s; }
  .wave i:nth-child(4n) { animation-delay: -0.35s; }
  .wave i:nth-child(5n+2) { animation-duration: 0.8s; animation-delay: -0.65s; }
  .lane.thinking .wave i:nth-child(n) { animation-duration: 1.2s; }
  .lane.thinking .wave i:nth-child(2n) { animation-delay: -0.6s; }
}
@keyframes wave { from { transform: scaleY(0.15); } to { transform: scaleY(1); } }
@keyframes think { 0%, 100% { transform: scaleY(0.15); } 50% { transform: scaleY(0.4); } }
.replay-controls { display: flex; gap: 8px; }
.replay-controls .button { min-height: 40px; padding: 0 16px; font-size: 14px; }
.replay-controls #replay-play { min-width: 128px; }
.transcript { list-style: none; padding: 0 !important; margin: 0 !important; display: flex; flex-direction: column; gap: 12px; }
.turn { margin: 0 !important; padding: 0 !important; max-width: 86%; display: flex; flex-direction: column; gap: 4px; }
.turn .who { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint); }
.turn p {
  margin: 0 !important; font-size: 16.5px; line-height: 1.5; padding: 11px 16px; border-radius: 18px 18px 18px 6px;
  background: var(--bg); border: 1px solid var(--line);
}
.turn.caller { align-self: flex-end; align-items: flex-end; }
.turn.caller p { background: var(--text); color: var(--bg); border-color: var(--text); border-radius: 18px 18px 6px 18px; }
.turn.system { align-self: center; max-width: 100%; }
.turn.system p {
  background: none; border: 1px dashed var(--line); color: var(--muted); font-size: 14px;
  border-radius: 999px; padding: 6px 16px; text-align: center;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 9px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chip.tool { border-style: dashed; }
.untyped { color: transparent; }
.turn.caller .untyped { color: transparent; }
.replay.enhanced .turn { transition: opacity var(--dur-move) var(--spring), transform var(--dur-move) var(--spring); }
.replay.enhanced .chips { transition: opacity var(--dur-quick); }
.replay.enhanced .turn[data-state="pending"] { opacity: 0.16; }
.replay.enhanced .turn[data-state="pending"] .chips,
.replay.enhanced .turn[data-state="waiting"] .chips,
.replay.enhanced .turn[data-state="speaking"] .chips { opacity: 0; }
.replay.enhanced .turn[data-state="waiting"] { opacity: 0.4; }
@media (prefers-reduced-motion: no-preference) {
  .replay.enhanced .turn[data-state="pending"] { transform: translateY(6px); }
}
@media (max-width: 560px) {
  .replay { margin: 0 -12px; padding: 16px 14px; border-radius: 18px; }
  .turn { max-width: 94%; }
  .replay-lanes { grid-template-columns: 1fr; }
  .lane-name { min-width: 8.5em; }
}

/* 3. Latency budget */
.budget {
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px;
}
.budget-toggles { border: 0; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.budget-toggles legend {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 10px; padding: 0;
}
.budget-toggles label {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px 0 12px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 15px; cursor: pointer; background: var(--bg);
  transition: border-color var(--dur-quick), background-color var(--dur-quick), color var(--dur-quick);
}
.budget-toggles label:hover { border-color: var(--faint); }
.budget-toggles label:has(input:checked) { background: var(--text); color: var(--bg); border-color: var(--text); }
.budget-toggles input { width: 18px; height: 18px; margin: 0; accent-color: var(--bg); }
.budget-toggles label:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.budget-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 14px !important; }
.budget-label { width: 100%; color: var(--muted); font-size: 14px; }
.budget-total strong { font-size: clamp(40px, 7vw, 56px); line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; font-weight: 750; min-width: 3.6ch; }
.budget-verdict { color: var(--muted); font-size: 15.5px; }
.budget-track { position: relative; height: 72px; padding-top: 24px; }
.budget-bar {
  position: relative; z-index: 1; display: flex; height: 40px; border-radius: 10px; overflow: hidden;
  background: color-mix(in srgb, var(--text) 4%, transparent); outline: 1px solid var(--line);
}
.seg { display: block; height: 100%; width: 0; flex: none; transition: width var(--dur-move) var(--spring); }
.seg + .seg { box-shadow: inset 1px 0 0 var(--panel); }
.s-end { background: var(--text); }
.s-stt { background: color-mix(in srgb, var(--text) 68%, var(--bg)); }
.s-llm { background: color-mix(in srgb, var(--text) 42%, var(--bg)); }
.s-tts { background: repeating-linear-gradient(135deg, var(--text) 0 2px, color-mix(in srgb, var(--text) 14%, var(--bg)) 2px 7px); }
.s-net { background: color-mix(in srgb, var(--text) 20%, var(--bg)); }
.budget-mark { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--faint); z-index: 2; }
.budget-mark span {
  position: absolute; top: 0; left: 6px; white-space: nowrap; font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.m-before { left: calc(6950 / 7500 * 100%); }
.m-before span { left: auto; right: 6px; }
.m-after { left: calc(2670 / 7500 * 100%); }
.budget-zone { position: absolute; top: 24px; height: 40px; right: 0; z-index: 0; }
.budget-zone span {
  position: absolute; bottom: -22px; left: 6px; font-size: 11.5px; color: var(--faint); white-space: nowrap; font-style: italic;
}
.z-hello { left: calc(3000 / 7500 * 100%); right: calc(100% - 4500 / 7500 * 100%); border-left: 1px solid var(--line); }
.z-dropped { left: calc(4500 / 7500 * 100%); border-left: 1px solid var(--line); }
.budget-axis { position: relative; height: 34px; margin-top: 4px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.budget-axis span { position: absolute; top: 12px; transform: translateX(-50%); }
.budget-axis span:nth-child(1) { left: 0; transform: none; }
.budget-axis span:nth-child(2) { left: calc(1000 / 7500 * 100%); }
.budget-axis span:nth-child(3) { left: calc(2000 / 7500 * 100%); }
.budget-axis span:nth-child(4) { left: calc(3000 / 7500 * 100%); }
.budget-axis span:nth-child(5) { left: calc(4000 / 7500 * 100%); }
.budget-axis span:nth-child(6) { left: calc(5000 / 7500 * 100%); }
.budget-axis span:nth-child(7) { left: calc(6000 / 7500 * 100%); }
.budget-axis span:nth-child(8) { left: calc(7000 / 7500 * 100%); }
.budget-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 22px; }
.budget-buttons .button { min-height: 40px; font-size: 14px; padding: 0 16px; }
.budget .table-scroll { background: var(--bg); }
.budget-table, .settings-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.budget-table caption, .settings-table caption {
  text-align: left; padding: 14px 16px 4px; font-family: var(--mono); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.budget-table th, .budget-table td, .settings-table th, .settings-table td {
  text-align: left; padding: 10px 16px; border-top: 1px solid var(--line); vertical-align: top;
}
.budget-table thead th, .settings-table thead th {
  font-weight: 500; font-size: 13px; color: var(--muted); border-top: 0;
}
.budget-table td, .budget-table tfoot th { font-variant-numeric: tabular-nums; white-space: nowrap; }
.budget-table tbody th { font-weight: 500; }
.budget-table tfoot th, .budget-table tfoot td { font-weight: 700; }
.budget-now { color: var(--text); font-weight: 600; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 10px; vertical-align: -1px; outline: 1px solid var(--line); }
@media (max-width: 560px) {
  .budget { margin: 0 -12px; padding: 18px 14px; border-radius: 18px; }
  .budget-toggles label { font-size: 14px; }
  .budget-mark span { display: none; }
  .budget-table th, .budget-table td { padding: 9px 10px; font-size: 14px; }
  .budget-table th, .budget-table td { font-size: 13.5px; padding: 9px 8px; }
  .budget-table tbody th { white-space: normal; }
}

/* 4. SL2100 settings */
.settings-tools { display: grid; gap: 8px; margin-bottom: 14px; }
.settings-tools label {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
}
.settings-tools input {
  width: 100%; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: 16px var(--font);
  transition: border-color var(--dur-quick);
}
.settings-tools input::placeholder { color: var(--faint); }
.settings-tools input:hover { border-color: var(--faint); }
.settings-tools input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-color: var(--text); }
.settings-count { margin: 0 !important; font-size: 13.5px; color: var(--faint); min-height: 1.5em; }
.settings-table { font-size: 14.5px; }
.settings-table tbody th { font-family: var(--mono); font-size: 13px; font-weight: 600; white-space: nowrap; }
.settings-table td:nth-child(4) { color: var(--muted); }
.settings-table code { font-size: 0.86em; }
.settings-empty td { color: var(--muted); text-align: center; padding: 24px; }
.settings .table-scroll { max-height: 560px; overflow-y: auto; }
.settings-table thead th { position: sticky; top: 0; background: var(--bg); z-index: 1; box-shadow: 0 1px 0 var(--line); }
@media (max-width: 680px) {
  /* Each program becomes a small card. */
  .settings .table-scroll { max-height: 620px; }
  .settings-table thead { display: none; }
  .settings-table, .settings-table tbody, .settings-table tr, .settings-table th, .settings-table td { display: block; }
  .settings-table tr { padding: 12px 16px; border-top: 1px solid var(--line); }
  .settings-table tr[hidden] { display: none; }
  .settings-table tbody th, .settings-table td { padding: 0; border: 0; }
  .settings-table tbody th { font-size: 14px; margin-bottom: 2px; }
  .settings-table td:nth-child(3) { margin-top: 4px; }
  .settings-table td:nth-child(3)::before { content: "Value: "; color: var(--faint); }
  .settings-table td:nth-child(4) { font-size: 14px; margin-top: 2px; }
  .settings-empty td { padding: 12px 0; }
}

/* Safeguard layers */
.layers ol {
  list-style: none; padding: 0 !important; margin: 0 !important; counter-reset: layer;
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.layers li {
  counter-increment: layer; margin: 0 !important; display: grid; grid-template-columns: 34px 150px 1fr;
  gap: 4px 12px; align-items: baseline; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 15.5px; line-height: 1.5;
}
.layers li:first-child { border-top: 0; }
.layers li::before { content: counter(layer, decimal-leading-zero); font-family: var(--mono); font-size: 12px; color: var(--faint); }
.layers li span { color: var(--muted); }
.layers li:nth-child(4) { background: var(--text); color: var(--bg); }
.layers li:nth-child(4)::before, .layers li:nth-child(4) span { color: color-mix(in srgb, var(--bg) 70%, var(--text)); }
@media (max-width: 560px) {
  .layers li { grid-template-columns: 30px 1fr; }
  .layers li span { grid-column: 2; }
}

/* "Try to trick it" */
.tricks { display: grid; gap: 10px; margin: 24px 0 8px; }
.trick { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); transition: border-color var(--dur-quick); }
.trick:hover, .trick[open] { border-color: var(--faint); }
.trick summary {
  margin: 0; padding: 14px 18px; color: var(--text); font-size: 16px; line-height: 1.45; gap: 12px;
  min-height: 56px; align-items: flex-start;
}
.trick summary::before { margin-right: 0; color: var(--faint); flex: none; padding-top: 1px; }
.trick summary:hover { color: var(--text); }
.trick-q { flex: 1; font-weight: 600; }
.tag {
  flex: none; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; color: var(--muted); white-space: nowrap;
  margin-top: 2px;
}
.trick-a { padding: 0 18px 4px 44px; }
.trick-a p { font-size: 16px; color: var(--muted); }
.trick-a q { color: var(--text); }
@media (max-width: 560px) {
  .trick summary { flex-wrap: wrap; }
  .trick-q { flex-basis: calc(100% - 30px); }
  .tag { margin-left: 22px; }
  .trick-a { padding-left: 18px; }
}

/* Links at the end */
.repo-links { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.repo-links li { margin: 0; padding: 0; }
.prose .repo-links a {
  display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 16px 18px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
  transition: border-color var(--dur-quick), transform var(--dur-move) var(--spring);
}
.repo-links a:hover { border-color: var(--faint); }
@media (hover: hover) and (pointer: fine) {
  .repo-links a:hover { transform: translateY(-2px); }
}
.repo-links strong { font-family: var(--mono); font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.repo-links span { color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.thanks { color: var(--muted); font-size: 15.5px; }
.end-actions { margin-top: 28px; }

@media (max-width: 760px) {
  .article-hero { padding-top: 24px; }
  .prose { font-size: 17.5px; }
  .prose h2 { margin-top: 72px; scroll-margin-top: 112px; }
  .facts dd { font-size: 22px; }
}

/* Scroll motion (motion.js adds .motion, .reveal and .in) */
.motion .prose h2 .num { transition: transform var(--dur-enter) var(--spring), opacity var(--dur-enter) var(--spring); transition-delay: calc(var(--d, 0ms) + 120ms); }
.motion .prose h2.reveal:not(.in) .num { opacity: 0; transform: translateX(-14px); }
.motion .prose figure.reveal { transform: translateY(36px) scale(.97); }
.motion .prose figure.reveal.in { transform: none; }
.motion .layers li.reveal { transform: translateX(-18px); }
.motion .layers li.reveal.in { transform: none; }
.motion .toc-side .toc li.reveal { transform: translateX(-10px); }
.motion .toc-side .toc li.reveal.in { transform: none; }
.motion .budget-table tbody tr { transition: background-color var(--dur-move) var(--spring); }
.motion .budget-table tbody tr.changed { background-color: var(--glow, rgba(127,127,127,.12)); transition-duration: 0s; }
@media (hover: hover) and (pointer: fine) {
  .motion .trick.reveal.in:hover, .motion .layers li.reveal.in:hover { transform: translateY(-2px); }
  .motion .layers li { transition: transform var(--dur-move) var(--spring), opacity var(--dur-enter) var(--spring); }
}

@media (prefers-reduced-motion: reduce) {
  .wave i { transform: scaleY(0.18); }
  .lane.speaking .wave i { transform: scaleY(0.6); }
}
