/* Voice agent demo: page frame (Matt's world), call player, transcript, "What happened" panel (booking card in clinic world). */

:root {
  /* Matt's world */
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --tray: #ECE9E1;
  --ink: #16150F;
  --ink-2: #5B5850;
  --ink-3: #8C887E;
  --line: #DEDAD0;
  --edge: #CFCABD;
  --signal: #F04D1A;
  --signal-12: rgb(240 77 26 / .12);
  --ok: #1E7A4A;
  --ok-soft: #E3EFE7;

  /* Clinic world */
  --c-bg: #F7F3EE;
  --c-surface: #FFFFFF;
  --c-text: #2B2420;
  --c-text-2: #6E625A;
  --c-line: #E3D9D0;
  --c-primary: #1F3B36;
  --c-primary-soft: #DCE6E2;
  --c-accent: #A8673F;

  /* Waveform tracks */
  --trk-agent: #1F3B36;
  --trk-caller: #A8673F;

  --sh-1: 0 1px 2px rgb(22 21 15 / .06);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);

  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --serif: "Newsreader", Georgia, serif;
  --c-sans: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0E0C;
    --surface: #171714;
    --tray: #1F1F1B;
    --ink: #EEECE6;
    --ink-2: #A8A59C;
    --ink-3: #75726A;
    --line: #2C2B26;
    --edge: #3A3933;
    --signal: #FF6236;
    --signal-12: rgb(255 98 54 / .12);
    --ok: #3FB97A;
    --ok-soft: rgb(63 185 122 / .12);

    --c-bg: #13110F;
    --c-surface: #1C1916;
    --c-text: #F1EAE3;
    --c-text-2: #B3A79D;
    --c-line: #2E2925;
    --c-primary: #7FB5A8;
    --c-primary-soft: #1E2E2A;
    --c-accent: #D49470;

    --trk-agent: #7FB5A8;
    --trk-caller: #D49470;
    --sh-1: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/26px var(--sans);
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 120ms;
}
a:hover { color: var(--signal); }
button { font: inherit; color: inherit; }
svg { flex: none; }
svg[viewBox="0 0 24 24"] {
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Top bar ---------- */
.topbar { border-bottom: 1px solid var(--line); font-size: 13px; line-height: 20px; color: var(--ink-2); }
.topbar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding-top: 8px; padding-bottom: 8px; }
.topbar .sep { color: var(--ink-3); }
.topbar a { color: var(--ink); }
.topbar a:hover { color: var(--signal); }
@media (max-width: 640px) { /* two clean lines on phone: no dangling "·" */
  .topbar .wrap > :nth-child(4) { display: none; }
  .topbar .wrap > :last-child { flex-basis: 100%; }
}

/* ---------- Intro ---------- */
.intro { padding-top: 64px; padding-bottom: 40px; }
.eyebrow {
  margin: 0 0 16px;
  font: 500 12px/16px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
h1 {
  margin: 0; max-width: 21ch;
  font-weight: 600; font-size: clamp(32px, 4.4vw, 48px); line-height: 1.08; letter-spacing: -.025em;
}
.lede { margin: 16px 0 0; max-width: 62ch; font-size: 18px; line-height: 28px; color: var(--ink-2); }
.stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.chip-mono {
  padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  font: 400 12px/16px var(--mono); color: var(--ink-2);
}
.dotsep { color: var(--ink-3); }

/* ---------- Call header ---------- */
.callhead {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 0 4px; border-top: 1px solid var(--line);
}
.ch-icon {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--tray); color: var(--ink-2);
}
.ch-icon svg { width: 20px; height: 20px; }
.ch-main { min-width: 0; }
.ch-title { margin: 0; font-weight: 600; font-size: 20px; line-height: 26px; letter-spacing: -.01em; }
.ch-meta {
  display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 2px 0 0;
  font-size: 14px; line-height: 20px; color: var(--ink-2);
}
.ch-meta .mono { font-size: 12.5px; color: var(--ink-3); }
.ch-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.ch-dur { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.ch-dur svg { width: 16px; height: 16px; color: var(--ink-3); }
.ch-dur .mono { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px;
  font: 500 12px/16px var(--mono); color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 999px; white-space: nowrap;
}
.pill svg { width: 12px; height: 12px; stroke-width: 2; }
.pill[data-s=ok] { color: var(--ok); border-color: currentColor; }
.pill[data-s=warn] { color: var(--ink-2); }

/* ---------- Player ---------- */
.dock { padding: 14px 0 16px; }
.player {
  padding: 14px 20px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh-1);
}
.pl-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 12px; }
.pl-label { font: 500 12px/16px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.live {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px;
  font: 500 11px/16px var(--mono); color: var(--ink); border: 1px solid var(--signal); border-radius: 999px;
}
.live .pdot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); animation: pulse 1.2s var(--ease-io) infinite; }
.pl-source {
  margin-left: auto; padding: 2px 8px; border: 1px dashed var(--edge); border-radius: 6px;
  font-size: 12.5px; line-height: 18px; color: var(--ink-2);
}

/* Waveform */
.wave { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 12px; }
.wave-gutter { display: flex; flex-direction: column; gap: 8px; }
.trk-label {
  display: flex; align-items: center; gap: 6px; height: 56px;
  font: 500 11px/16px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.sw-agent { background: var(--trk-agent); }
.sw-caller { background: var(--trk-caller); }
.wave-main { position: relative; min-width: 0; }
.wave-hit { position: relative; height: 120px; cursor: pointer; touch-action: none; }
.wave-hit:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
#wave { display: block; width: 100%; height: 120px; }
.markers { position: absolute; inset: 0; pointer-events: none; }
.mk {
  position: absolute; top: -2px; bottom: -2px; width: 0;
  border-left: 1px dashed var(--ink-3); opacity: .55;
}
.mk::after {
  content: ""; position: absolute; left: -4px; top: 56px; width: 7px; height: 7px;
  background: var(--ink-2); transform: rotate(45deg);
}
.playhead {
  position: absolute; top: -6px; bottom: -6px; left: 0; width: 1px; margin-left: -.5px;
  background: var(--ink); pointer-events: none;
}
.playhead::before {
  content: ""; position: absolute; top: -3px; left: -3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink); transition: background-color 200ms;
}
body[data-playing=true] .playhead::before { background: var(--signal); }
body[data-mode=idle] .playhead, body[data-mode=static] .playhead { opacity: 0; }

.axis { position: relative; height: 22px; margin-top: 6px; border-top: 1px solid var(--line); }
.tick { position: absolute; top: 0; width: 1px; height: 4px; background: var(--line); }
.tick.major { height: 6px; background: var(--edge); }
.tick span {
  position: absolute; top: 6px; left: 4px; white-space: nowrap;
  font: 400 11px/14px var(--mono); color: var(--ink-3);
}

/* Before-play cover */
.cover {
  position: absolute; inset: -6px -6px -6px -6px; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  border-radius: 8px;
}
.cover[hidden] { display: none; }
.cover-play {
  display: inline-flex; align-items: center; gap: 14px; padding: 8px 22px 8px 8px;
  background: var(--ink); color: var(--bg); border: 0; border-radius: 999px; cursor: pointer;
  text-align: left; transition: transform 120ms var(--ease-out);
}
.cover-play:hover { transform: translateY(-1px); }
.cover-play:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.cp-dot { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--bg); color: var(--ink); }
.cp-dot svg { width: 18px; height: 18px; fill: currentColor; margin-left: 2px; }
.cp-text { display: flex; flex-direction: column; font: 600 18px/22px var(--sans); letter-spacing: -.01em; }
.cp-text small { margin-top: 2px; font: 400 12px/16px var(--mono); letter-spacing: 0; opacity: .7; }
.textbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: 500 14px/20px var(--sans); color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: color 120ms;
}
.textbtn svg { width: 16px; height: 16px; }
.textbtn:hover { color: var(--signal); }

/* Controls */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.ctl-play {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  background: var(--ink); color: var(--bg); border: 0; border-radius: 50%; cursor: pointer;
  transition: transform 120ms var(--ease-out);
}
.ctl-play:hover { transform: scale(1.04); }
.ctl-play svg { width: 16px; height: 16px; }
.ctl-play .i-play { fill: currentColor; margin-left: 2px; }
.ctl-play .i-pause { fill: currentColor; }
.ctl-play .i-pause, .ctl-play .i-replay { display: none; }
body[data-playing=true] .ctl-play .i-play { display: none; }
body[data-playing=true] .ctl-play .i-pause { display: block; }
body[data-mode=ended] .ctl-play .i-play { display: none; }
body[data-mode=ended] .ctl-play .i-replay { display: block; }
.ctl {
  display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 9px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  font: 500 12px/16px var(--mono); color: var(--ink-2); transition: border-color 120ms, color 120ms;
}
.ctl:hover { border-color: var(--ink); color: var(--ink); }
.ctl svg { width: 15px; height: 15px; }
.speed { display: inline-flex; padding: 2px; background: var(--tray); border-radius: 6px; }
.speed button {
  height: 28px; padding: 0 9px; border: 0; border-radius: 4px; background: none; cursor: pointer;
  font: 500 12px/16px var(--mono); color: var(--ink-2); transition: background-color 120ms, color 120ms;
}
.speed button[aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.time { margin-left: auto; font: 400 13px/20px var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  font: 500 13px/18px var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  transition: border-color 120ms;
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost svg { width: 14px; height: 14px; }

/* ---------- Transcript + panel ---------- */
.body {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px; align-items: start;
  padding-top: 16px; padding-bottom: 96px;
}
.tx { grid-column: span 8; min-width: 0; }
.side { grid-column: span 4; min-width: 0; }
.tx-box { position: relative; }
.tx-scroll {
  position: relative; height: clamp(440px, calc(100vh - 340px), 640px); overflow-y: auto; overscroll-behavior: contain;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.tx-scroll:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.rows > .row:first-child { border-top: 0; }

.tx-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; }
.tx-head h2, .pn-head h2 { margin: 0; font-weight: 600; font-size: 18px; line-height: 24px; letter-spacing: -.01em; }
.tx-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tx-empty {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 18px 0;
  font-size: 14px; line-height: 20px; color: var(--ink-3);
}
.tx-empty svg { width: 18px; height: 18px; }

.rows { margin: 0; padding: 0; list-style: none; }
.row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--line);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
.row.pre { opacity: 0; transform: translateY(8px); transition: none; }
.stamp {
  align-self: start; justify-self: start; margin-top: 1px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 400 12px/22px var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums;
  text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: color 120ms, text-decoration-color 120ms;
}
.stamp:hover { color: var(--ink); text-decoration-color: currentColor; }
.r-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 22px; }
.spk {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 12px/16px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.eq { display: inline-flex; align-items: flex-end; gap: 1.5px; width: 10px; height: 10px; }
.eq i { display: block; width: 2px; height: 100%; border-radius: 1px; background: var(--trk); transform-origin: bottom; transform: scaleY(.45); }
.eq i:nth-child(2) { transform: scaleY(.8); }
.row--agent { --trk: var(--trk-agent); }
.row--caller { --trk: var(--trk-caller); }
.row.is-live .spk { color: var(--ink); }
.row.is-live .eq i { animation: eq 700ms var(--ease-io) infinite alternate; }
.row.is-live .eq i:nth-child(2) { animation-delay: -250ms; }
.row.is-live .eq i:nth-child(3) { animation-delay: -480ms; }
.lat {
  padding: 0 6px; border: 1px solid var(--line); border-radius: 4px;
  font: 400 11px/18px var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.r-head .lat:first-of-type { margin-left: auto; }
.r-text { margin: 4px 0 0; font-size: 16px; line-height: 26px; color: var(--ink); max-width: 64ch; }
.w { opacity: .35; transition: opacity 120ms linear; }
.w.on { opacity: 1; }

/* System rows */
.sys { padding: 10px 0; }
.sys .stamp { line-height: 18px; }
.s-body { min-width: 0; padding: 1px 0 1px 12px; border-left: 1px solid var(--edge); transition: border-color 200ms; }
.s-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 7px; margin: 0;
  font: 400 12px/18px var(--mono); color: var(--ink-2);
}
.s-line b { font-weight: 500; color: var(--ink); }
.s-st { display: grid; place-items: center; width: 14px; height: 14px; }
.s-ok { display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); color: #fff; }
.s-ok svg { width: 9px; height: 9px; stroke-width: 2.5; }
.s-spin {
  display: none; width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid var(--line); border-top-color: var(--signal); animation: spin 700ms linear infinite;
}
.s-ms { font-variant-numeric: tabular-nums; }
.s-args {
  margin: 3px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 400 11.5px/16px var(--mono); color: var(--ink-3);
}
.sys[data-state=running] .s-body { border-left-color: var(--signal); }
.sys[data-state=running] .s-ok { display: none; }
.sys[data-state=running] .s-spin { display: block; }
.sys[data-state=done] .s-ok { animation: pop 240ms var(--ease-back); }

/* What happened */
.panel {
  padding: 18px 20px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh-1);
}
.pn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pn-head .mono { font-size: 11px; color: var(--ink-3); }
.fields { margin: 0; }
.fd { padding: 10px 0; border-top: 1px solid var(--line); }
.fd:first-child { border-top: 0; }
.fd dt { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.fd-at { font-size: 11px; color: var(--ink-3); opacity: 0; transition: opacity 200ms; }
.fd dd { display: grid; margin: 4px 0 0; min-height: 22px; }
.fd dd > * { grid-area: 1 / 1; align-self: center; }
.sk {
  width: 62%; height: 10px; border-radius: 4px; background: var(--tray);
  transition: opacity 200ms;
}
body[data-playing=true] .sk {
  background: linear-gradient(90deg, var(--tray) 0%, var(--line) 50%, var(--tray) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.fd:nth-child(2) .sk { width: 74%; }
.fd:nth-child(3) .sk { width: 52%; }
.val { font-size: 15px; line-height: 22px; font-weight: 500; color: var(--ink); opacity: 0; transition: opacity 200ms; }
.fd.is-on .sk { opacity: 0; }
.fd.is-on .val, .fd.is-on .fd-at { opacity: 1; }

/* Booking card (clinic world) */
.bk { margin-top: 12px; }
.clinic { font-family: var(--c-sans); color: var(--c-text); }
.bk-wait {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  border: 1px dashed var(--c-line); border-radius: 12px;
  font-size: 13px; line-height: 19px; color: var(--c-text-2);
}
.bk-wait svg { width: 16px; height: 16px; margin-top: 1px; }
.bk-wait code { font: 400 12px/19px var(--mono); color: var(--c-text); }
.bk-card {
  display: none; padding: 16px 16px 14px; background: var(--c-bg);
  border: 1px solid var(--c-line); border-radius: 12px;
}
.bk.is-on .bk-wait { display: none; }
.bk.is-on .bk-card { display: block; }
.bk-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.bk-brand { margin: 0; font: 400 17px/20px var(--serif); letter-spacing: -.01em; }
.bk-brand small {
  display: block; margin-top: 1px;
  font: 500 9.5px/13px var(--c-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--c-text-2);
}
.bk-ok {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px;
  font: 600 12px/16px var(--c-sans); color: var(--ok); background: var(--ok-soft); border-radius: 999px;
}
.bk-ok svg { width: 12px; height: 12px; stroke-width: 2.25; }
.bk-line { margin: 0; }
.bk-treat { font: 400 21px/26px var(--serif); letter-spacing: -.01em; }
.bk-when { margin-top: 6px; font-size: 15px; line-height: 22px; font-weight: 600; }
.bk-who { font-size: 14px; line-height: 20px; color: var(--c-text-2); }
.bk-id { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--c-line); font-size: 12px; line-height: 16px; }
.bk-src { color: var(--c-text-2); }
.bk-link { display: inline-block; margin-top: 12px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--c-text); }
.bk-link:hover { color: var(--c-accent); }

/* assembly */
.bk-card .bk-line, .bk-card .bk-link, .bk-card .bk-brand {
  opacity: 0; transform: translateY(4px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.bk-card .bk-ok { opacity: 0; transform: scale(.96); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
.bk.is-in .bk-card .bk-brand { opacity: 1; transform: none; }
.bk.is-in .bk-treat { opacity: 1; transform: none; transition-delay: 60ms; }
.bk.is-in .bk-when { opacity: 1; transform: none; transition-delay: 140ms; }
.bk.is-in .bk-who { opacity: 1; transform: none; transition-delay: 220ms; }
.bk.is-in .bk-id { opacity: 1; transform: none; transition-delay: 300ms; }
.bk.is-in .bk-ok { opacity: 1; transform: scale(1); transition-delay: 420ms; }
.bk.is-in .bk-link { opacity: 1; transform: none; transition-delay: 560ms; }
.bk.is-instant .bk-card * { transition: none !important; }

.guard {
  display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding-top: 14px;
  border-top: 1px solid var(--line); font-size: 13px; line-height: 19px; color: var(--ink-2);
}
.guard svg { width: 16px; height: 16px; margin-top: 1px; color: var(--ink-3); }

/* Jump to live */
.jump {
  position: absolute; left: 50%; bottom: 16px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px 8px 12px;
  background: var(--ink); color: var(--bg); border: 0; border-radius: 999px; cursor: pointer;
  font: 500 13px/18px var(--sans); box-shadow: 0 8px 24px -6px rgb(22 21 15 / .12), 0 2px 6px rgb(22 21 15 / .06);
  opacity: 0; pointer-events: none; transform: translate(-50%, 4px);
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.jump svg { width: 15px; height: 15px; }
.jump.is-on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }

/* ---------- How it's handled ---------- */
.explain { padding-bottom: 128px; }
.explain h2 { margin: 0 0 24px; font-weight: 600; font-size: 32px; line-height: 38px; letter-spacing: -.02em; }
.steps-list { margin: 0; max-width: 880px; }
.steps-list > div {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.steps-list > div:last-child { border-bottom: 1px solid var(--line); }
.steps-list dt { font: 500 13px/26px var(--mono); color: var(--ink); }
.steps-list dd { margin: 0; color: var(--ink-2); }

/* ---------- More from this demo set (same as the Try-it page) ---------- */
.more { border-top: 1px solid var(--line); }
.more-inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 32px; padding-top: 24px; padding-bottom: 32px; }
.more-label { font: 500 12px/16px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.more a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line); transition: color 120ms; }
.more a:hover { color: var(--signal); text-decoration-color: currentColor; }

/* ---------- Motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .body { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .tx, .side { grid-column: auto; }
  .tx-scroll { height: clamp(420px, 62vh, 600px); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .intro { padding-top: 40px; padding-bottom: 32px; }
  .callhead { flex-wrap: wrap; gap: 10px; }
  .ch-icon { display: none; }
  .ch-right { margin-left: 0; }
  .dock { padding: 8px 0 10px; }
  .player { padding: 12px 12px 12px; }
  .pl-top { margin-bottom: 10px; }
  .pl-source { margin-left: 0; font-size: 12px; line-height: 16px; }
  .wave { grid-template-columns: 14px minmax(0, 1fr); column-gap: 8px; }
  .trk-label { font-size: 0; letter-spacing: 0; gap: 0; }
  .cover { padding: 0 8px; gap: 10px 16px; }
  .cp-text { font-size: 16px; }
  .ctl { padding: 0 7px; }
  .time { font-size: 12px; }
  .row { grid-template-columns: 44px minmax(0, 1fr); column-gap: 10px; }
  .r-head .lat:first-of-type { margin-left: 0; }
  .r-text { font-size: 15px; line-height: 24px; }
  .body { padding-bottom: 64px; }
  .explain { padding-bottom: 64px; }
  .steps-list > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .row, .row.pre { transform: none; transition: opacity 120ms; }
  .w { opacity: 1; transition: none; }
  .row.is-live .eq i, .live .pdot, .s-spin, body[data-playing=true] .sk { animation: none; }
  .sys[data-state=done] .s-ok { animation: none; }
  .bk-card .bk-line, .bk-card .bk-link, .bk-card .bk-brand, .bk-card .bk-ok { transform: none; transition: opacity 120ms; transition-delay: 0ms !important; }
  .jump { transform: translate(-50%, 0); }
  .cover-play:hover, .ctl-play:hover { transform: none; }
}

/* Reduced motion, catch-all: anything animated or transitioned above settles instantly; scrolling is never smoothed. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 1ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
}

/* Focus ring for everything interactive that has no ring of its own. */
a:focus-visible, button:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:not([tabindex="-1"]):focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
