:root {
  --bg: #0a0c10;
  --bg2: #10141a;
  --bg3: #161b23;
  --term: #07090c;
  --fg: #e9e7e2;
  --fg2: #c4c9d0;
  --muted: #858e9b;
  --faint: #59616d;
  --border: #212732;
  --border2: #2c3442;
  --accent: #5fe3b5;
  --accent-dim: rgba(95, 227, 181, 0.14);
  --user: #8ab4ff;
  --user-dim: rgba(138, 180, 255, 0.1);
  --int: #ffb067;
  --int-dim: rgba(255, 176, 103, 0.1);
  --bad: #ff6b6b;
  --warn: #ffcf5c;
  --mono: 'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
  --sans: -apple-system, system-ui, 'Inter', 'Segoe UI', Helvetica, Arial, sans-serif;
  --nav-h: 52px;
  --rail-w: 320px;
  --gutter: 1.5rem;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
html,
body {
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--bg);
}
body.has-playbar {
  padding-bottom: 88px;
}
::selection {
  background: var(--accent);
  color: #04110c;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  color: #9af0d0;
}
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  overflow-wrap: normal;
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.is-hidden {
  display: none !important;
}

/* timeline state: items below the reading line have not happened yet */
.flow > .item,
.chapter,
.gap,
.card {
  transition:
    opacity 0.45s ease,
    transform 0.45s ease,
    filter 0.45s ease;
}
.is-future {
  opacity: 0.2;
  filter: saturate(0.3);
}
body.playing .is-future {
  opacity: 0.05;
}
.card.is-future {
  opacity: 0;
  transform: translateX(24px);
}
/* inline callouts on narrow screens keep their space, so dim them rather than hide */
@media (max-width: 899px) {
  .card.is-future {
    opacity: 0.2;
    transform: none;
  }
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #04110c;
  padding: 0.5rem 1rem;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
}

.loading {
  font-family: var(--mono);
  color: var(--muted);
  padding: 30vh var(--gutter);
  text-align: center;
}
.load-error {
  max-width: 640px;
  margin: 18vh auto;
  padding: 0 var(--gutter);
}
.load-error h1 {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}
.load-error pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: var(--bad);
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 6.5rem var(--gutter) 4.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: center;
  min-height: min(100svh, 940px);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 75% 35%, rgba(95, 227, 181, 0.07), transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0) 0 0 / 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(95, 227, 181, 0);
  }
}
.hero-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2.3rem, 5.4vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  margin: 0 0 1.5rem;
  perspective: 600px;
  overflow-wrap: anywhere;
}
.hero-title .w {
  display: inline-block;
}
.hero-title .caret {
  display: inline-block;
  width: 0.5em;
  height: 0.85em;
  margin-left: 0.12em;
  background: var(--accent);
  vertical-align: -0.06em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--fg2);
  margin: 0 0 1.2rem;
  max-width: 36em;
}
.intro {
  font-size: 0.98rem;
  color: var(--muted);
  margin: 0 0 2rem;
  max-width: 38em;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--fg);
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.cta:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--fg);
}
.cta .arrow {
  color: var(--accent);
  animation: bob 1.8s ease-in-out infinite;
  display: inline-block;
}
@keyframes bob {
  50% {
    transform: translateY(4px);
  }
}

.term {
  margin: 0;
  background: var(--term);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(95, 227, 181, 0.04);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #131820;
  border-bottom: 1px solid var(--border);
}
.term-bar .tl {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2b313c;
}
.term-bar .tl:nth-child(1) {
  background: #ff5f57;
}
.term-bar .tl:nth-child(2) {
  background: #febc2e;
}
.term-bar .tl:nth-child(3) {
  background: #28c840;
}
.term-bar em {
  margin-left: auto;
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.setup {
  transform: rotate(0.8deg);
  transition: transform 0.4s;
}
.setup:hover {
  transform: none;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0;
}
.step {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.4rem;
  padding: 0.95rem 1.2rem;
}
.step + .step {
  border-top: 1px dashed var(--border);
}
.step-n {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  padding-top: 0.15rem;
}
.step-label {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 0.98rem;
}
.step-note {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}
.cmd {
  display: flex;
  align-items: stretch;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.cmd pre {
  margin: 0;
  padding: 0.6rem 0.8rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--fg);
}
.copy {
  flex: none;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0 0.9rem;
  cursor: pointer;
  transition:
    color 0.2s,
    background 0.2s;
}
.copy:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ---------------------------------------------------------------- stats */

.stats {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gutter) 5rem;
}
.stats-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.stat {
  padding: 1.3rem 1.3rem 1.2rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.stat dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.stat dd {
  margin: 0;
}
.stat-v {
  display: block;
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--fg);
  overflow-wrap: anywhere;
}
.stat-sub {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
}

/* ---------------------------------------------------------------- chapter nav */

.chapnav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 12, 16, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.chapnav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.chap-now {
  flex: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.chap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.3rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.chap-list::-webkit-scrollbar {
  display: none;
}
.chap-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}
.chap-btn .n {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
}
.chap-btn:hover {
  color: var(--fg);
}
.chap-btn.current {
  color: var(--fg);
  border-color: var(--border2);
  background: var(--bg2);
}
.chap-btn.current .n {
  color: var(--accent);
}
.chap-progress {
  height: 2px;
  background: transparent;
}
.chap-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--user));
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 0.25s linear;
}

/* ---------------------------------------------------------------- transcript layout */

.replay {
  position: relative;
}
.transcript {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.5rem var(--gutter) max(6rem, 55vh);
}
.seg {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
  column-gap: 3rem;
}
.seg > .flow {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  position: relative;
  padding: 0.4rem 0 0.4rem 1.6rem;
  border-left: 1px solid var(--border);
}
.seg > .rail {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
.rail-stack {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  display: grid;
  gap: 1rem;
  padding-top: 0.4rem;
}

.card {
  position: relative;
  background: linear-gradient(180deg, var(--bg2), rgba(16, 20, 26, 0.6));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.05rem 1.15rem 1.1rem;
}
.card::before {
  content: '';
  position: absolute;
  left: -3rem;
  top: 1.45rem;
  width: 2.4rem;
  border-top: 1px dashed var(--border2);
}
.card-k {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.04rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.card-body {
  margin: 0;
  color: var(--fg2);
  font-size: 0.9rem;
  line-height: 1.55;
}

.chapter {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 3.5rem 0 1.4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}
.chapter:first-child {
  margin-top: 0;
}
.ch-n {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
}
.chapter h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.ch-t {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--faint);
}

.gap {
  display: flex;
  justify-content: center;
  margin: 1.4rem 0;
}
.gap span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
  letter-spacing: 0.08em;
  padding: 0.2rem 0.8rem;
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: var(--bg);
}
.transcript > .gap {
  margin: 2rem 0 0;
}

/* timeline node on each item */
.flow > .item {
  position: relative;
  margin: 0.35rem 0;
}
.flow > .item::before {
  content: '';
  position: absolute;
  left: calc(-1.6rem - 4px);
  top: 0.95rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border2);
}
.flow > .turn::before {
  top: 1.25rem;
}
.flow > .turn.user::before {
  background: var(--user);
  border-color: var(--user);
}
.flow > .turn.interject::before {
  background: var(--int);
  border-color: var(--int);
}
.flow > .turn.agent::before {
  background: var(--accent);
  border-color: var(--accent);
}
.flow > .is-err::before {
  border-color: var(--bad);
}

/* ---------------------------------------------------------------- turns */

.turn {
  margin: 1.1rem 0 !important;
}
.turn-h {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.turn-h time {
  margin-left: auto;
  color: var(--faint);
  letter-spacing: 0.04em;
}
.who {
  color: var(--fg2);
}
.user .who {
  color: var(--user);
}
.interject .who {
  color: var(--int);
}
.agent .who {
  color: var(--accent);
}
.tag {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--border2);
  border-radius: 999px;
  color: var(--muted);
}
.tag-int {
  border-color: rgba(255, 176, 103, 0.45);
  color: var(--int);
}

.msg {
  display: flex;
  gap: 0.7rem;
  background: var(--user-dim);
  border: 1px solid rgba(138, 180, 255, 0.22);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.interject .msg {
  background: var(--int-dim);
  border-color: rgba(255, 176, 103, 0.35);
  border-left: 3px solid var(--int);
}
.prompt-mark {
  flex: none;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--user);
}
.interject .prompt-mark {
  color: var(--int);
}
.msg-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-width: 0;
  font-size: 0.98rem;
}
.untyped {
  visibility: hidden;
}
/* zero-width caret, so it never reflows the text being typed */
.type-caret {
  display: inline-block;
  width: 0;
  height: 1.15em;
  vertical-align: -0.2em;
  border-left: 2px solid var(--user);
  margin-right: -2px;
  animation: blink 1s steps(1) infinite;
}
.interject .type-caret {
  border-color: var(--int);
}
.is-typing .type-caret {
  animation: none;
}
.is-typed .type-caret {
  display: none;
}

.md {
  font-size: 0.98rem;
  color: var(--fg);
  overflow-wrap: break-word;
  min-width: 0;
}
.md > :first-child {
  margin-top: 0;
}
.md > :last-child {
  margin-bottom: 0;
}
.md p,
.md ul,
.md ol {
  margin: 0 0 0.8rem;
}
.md ul,
.md ol {
  padding-left: 1.3rem;
}
.md li {
  margin: 0.2rem 0;
}
.md h1,
.md h2,
.md h3,
.md h4 {
  font-size: 1.05rem;
  margin: 1.3rem 0 0.5rem;
  letter-spacing: -0.01em;
}
.md h2 {
  font-size: 1.12rem;
}
.md strong {
  color: #fff;
}
.md pre {
  background: var(--term);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.5;
  max-width: 100%;
}
.md table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin: 0 0 0.8rem;
  max-width: 100%;
}
.md th,
.md td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.6rem;
  text-align: left;
  vertical-align: top;
}
.md th {
  background: var(--bg2);
}
.md blockquote {
  margin: 0 0 0.8rem;
  padding: 0.4rem 1rem;
  border-left: 3px solid var(--border2);
  color: var(--fg2);
}
.md-plain {
  white-space: pre-wrap;
}

/* ---------------------------------------------------------------- tool lines + accordions */

.sig {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.42rem 0.65rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--fg2);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.sig:hover {
  background: var(--bg2);
  border-color: var(--border);
}
.open > .sig {
  background: var(--bg2);
  border-color: var(--border2);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.chev {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(-45deg);
  transition: transform 0.2s;
  margin: 0 0.15rem 0 0.05rem;
}
.sig[aria-expanded='true'] .chev {
  transform: rotate(45deg);
  border-color: var(--accent);
}
.sig-main {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.srv {
  color: var(--accent);
  margin-right: 0.45rem;
}
.fn {
  color: var(--fg);
}
.arg {
  color: var(--muted);
}
.sig-meta {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.dur {
  color: var(--faint);
  font-size: 0.74rem;
}
.badge {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  border: 1px solid;
}
.badge.ok {
  color: var(--accent);
  border-color: rgba(95, 227, 181, 0.35);
}
.badge.err {
  color: var(--bad);
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.08);
}
.badge.warn {
  color: var(--warn);
  border-color: rgba(255, 207, 92, 0.4);
  text-transform: none;
  letter-spacing: 0;
}
.is-err > .sig .fn {
  color: #ffb3b3;
}

.group > .sig {
  border: 1px dashed var(--border2);
  color: var(--fg2);
}
.group > .sig:hover,
.group.open > .sig {
  border-style: solid;
}
.hourglass {
  margin-right: 0.45rem;
}
.grp-label {
  color: var(--fg2);
}

.acc-body {
  border: 1px solid var(--border2);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--term);
  padding: 0.8rem 0.9rem 0.95rem;
  min-width: 0;
}
.group > .acc-body {
  background: transparent;
  padding: 0.5rem 0.4rem 0.6rem;
}
.group-list .tool {
  margin: 0.15rem 0;
}
.acc-meta {
  margin: 0 0 0.7rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
  overflow-wrap: anywhere;
}
.io {
  margin: 0 0 0.8rem;
  min-width: 0;
}
.io:last-child {
  margin-bottom: 0;
}
.io h4 {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.io-out.is-err h4 {
  color: var(--bad);
}
.result {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 0.5rem;
  overscroll-behavior: contain;
}
.result .blk {
  margin-bottom: 0.5rem;
}
.result .blk:last-child {
  margin-bottom: 0;
}
.result .blk pre {
  max-height: none;
  border: 0;
  background: transparent;
  padding: 0.2rem 0.3rem;
}
.blk {
  margin: 0 0 0.6rem;
  min-width: 0;
}
.blk figcaption,
.blk-path {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
  overflow-wrap: anywhere;
}
.blk pre {
  margin: 0;
  max-height: 60vh;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--fg2);
  tab-size: 4;
  overscroll-behavior: contain;
}
.blk.wrap pre,
.blk.json pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.blk.shell pre {
  color: var(--fg);
}
.blk.del pre {
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.05);
}
.blk.add pre {
  border-color: rgba(95, 227, 181, 0.35);
  background: rgba(95, 227, 181, 0.05);
}
.empty {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--faint);
}
.note {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- outro */

.outro {
  border-top: 1px solid var(--border);
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(95, 227, 181, 0.06), transparent 70%);
}
.outro-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 5rem var(--gutter) 5rem;
}
.outro-k {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}
.outro-note {
  color: var(--fg2);
  font-size: 1rem;
  margin: 0 0 1.6rem;
}
.outro-links {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.outro-links a {
  font-family: var(--mono);
  font-size: 0.9rem;
}
.outro-links a::before {
  content: '→ ';
  color: var(--faint);
}
.to-top {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
}

/* ---------------------------------------------------------------- playback bar */

.playbar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 40;
  transform: translateX(-50%);
  width: min(1100px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.55rem 0.9rem 0.55rem 0.6rem;
  background: rgba(16, 20, 26, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border2);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.playbar[hidden] {
  display: none;
}
.pb-play {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #04110c;
  cursor: pointer;
  transition: transform 0.15s;
}
.pb-play:hover {
  transform: scale(1.06);
}
.pb-play svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.pb-play .i-pause {
  display: none;
}
.playbar.playing .i-play {
  display: none;
}
.playbar.playing .i-pause {
  display: block;
}
.pb-speeds {
  flex: none;
  display: flex;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}
.pb-speeds button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  cursor: pointer;
}
.pb-speeds button[aria-pressed='true'] {
  background: var(--bg3);
  color: var(--accent);
}
.pb-scrub {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 28px;
  display: flex;
  align-items: center;
}
.pb-ticks {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 0;
  pointer-events: none;
}
.tick {
  position: absolute;
  top: -11px;
  width: 12px;
  height: 22px;
  margin-left: -6px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}
.tick::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 2px;
  height: 18px;
  border-radius: 1px;
  background: var(--user);
  opacity: 0.75;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
.tick:hover::before,
.tick:focus-visible::before {
  opacity: 1;
  transform: scaleY(1.2);
}
/* compressed waits: hatched, dimmer stretches of the track */
.wait-span {
  position: absolute;
  top: -4px;
  height: 8px;
  min-width: 3px;
  border-radius: 2px;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 207, 92, 0.55) 0 2px,
    transparent 2px 5px
  );
  opacity: 0.7;
}
.pb-ff {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(-50%, 6px);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 207, 92, 0.12);
  border: 1px solid rgba(255, 207, 92, 0.45);
  color: var(--warn);
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.pb-ff.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
.playbar.ff .pb-clock {
  color: var(--warn);
}
.pb-scrub input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  margin: 0;
  cursor: pointer;
  position: relative;
}
.pb-scrub input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
}
.pb-scrub input[type='range']::-moz-range-track {
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
}
.pb-scrub input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--fg);
  border: 3px solid var(--accent);
}
.pb-scrub input[type='range']::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fg);
  border: 3px solid var(--accent);
}
.pb-clock {
  flex: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg2);
  min-width: 4.6em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- narrow screens */

@media (max-width: 899px) {
  :root {
    --gutter: 1rem;
    --nav-h: 46px;
  }
  html {
    font-size: 16px;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-top: 4rem;
    min-height: 0;
  }
  .setup {
    transform: none;
  }
  .seg {
    display: block;
  }
  .seg > .flow {
    padding-left: 1.1rem;
  }
  .flow > .item::before {
    left: calc(-1.1rem - 4px);
  }
  .rail-stack {
    position: static;
    padding: 0.8rem 0 0.4rem;
  }
  .card {
    border-left: 3px solid var(--accent);
  }
  .card::before {
    display: none;
  }
  .chapter {
    flex-wrap: wrap;
    gap: 0.3rem 0.8rem;
  }
  .chap-now {
    display: none;
  }
  body.has-playbar {
    padding-bottom: 120px;
  }
  .playbar {
    flex-wrap: wrap;
    gap: 0.5rem 0.7rem;
    bottom: 8px;
    width: calc(100% - 16px);
    padding: 0.5rem 0.7rem;
  }
  .pb-scrub {
    order: 4;
    flex-basis: 100%;
  }
  .pb-clock {
    margin-left: auto;
  }
  .pb-play {
    width: 36px;
    height: 36px;
  }
  .sig {
    font-size: 0.76rem;
    gap: 0.45rem;
    padding: 0.42rem 0.4rem;
  }
  .sig-meta .dur {
    display: none;
  }
  .group .sig-meta .dur {
    display: none;
  }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: 2.1rem;
  }
  .stat-v {
    font-size: 1.4rem;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pb-speeds button {
    padding: 0.25rem 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
body.static *,
body.static *::before,
body.static *::after {
  animation: none !important;
  transition: none !important;
}

/* Story images (cards and outro): figures the session produced. */
.card-fig,
.outro-fig {
  margin: 0.85rem 0 0;
}
.card-fig img,
.outro-fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}
.outro-fig {
  max-width: 640px;
  margin: 0 auto 1.4rem;
}
.card-fig figcaption,
.outro-fig figcaption {
  margin-top: 0.45rem;
  color: var(--fg2);
  font-size: 0.8rem;
  line-height: 1.45;
}

/* Session date, top-right of the hero. */
.date-badge {
  position: absolute;
  top: 1.5rem;
  right: var(--gutter);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid rgba(95, 227, 181, 0.35);
  background: rgba(95, 227, 181, 0.06);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
}

/* Session configuration chips under the subtitle. */
.session-chips {
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.session-chips li {
  font-family: var(--mono);
  font-size: 0.76rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.22rem 0.55rem;
  background: var(--bg2);
}
.session-chips .k {
  color: var(--fg2);
  margin-right: 0.4rem;
}
.session-chips .v {
  color: var(--fg);
}

/* Attribution line in the outro. */
.credit {
  margin: 1.6rem 0 0;
  color: var(--fg2);
  font-family: var(--mono);
  font-size: 0.72rem;
}
.credit a {
  color: inherit;
}
