@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxjPQ.ttf)
    format('truetype');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8-qxjPQ.ttf)
    format('truetype');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FO_F.ttf) format('truetype');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk7PFO_F.ttf) format('truetype');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk4jE-_F.ttf) format('truetype');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk4aE-_F.ttf) format('truetype');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(fonts/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk59E-_F.ttf) format('truetype');
}

:root {
  --paper: #fafbf8;
  --ink: #202c29;
  --muted: #60716b;
  --line: #d6dfd8;
  --green: #227653;
  --cpu: #3267b3;
  --gpu: #a76819;
  --npu: #227653;
  --ram: #766197;
  --red: #b6534b;
  --font: 'Manrope', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
}
button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  padding: 10px 15px;
  transition:
    background 0.18s,
    color 0.18s,
    border-color 0.18s;
}
button:hover {
  background: #e9eee7;
  border-color: #9eb3a5;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 5px;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
}
.shell {
  max-width: 1552px;
  padding: 0 clamp(24px, 5vw, 88px);
  margin: auto;
}
.masthead {
  min-height: 91px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 1.3px;
  line-height: 1.6;
}
.brand-chip {
  border: 1px solid #95b2a0;
  font-size: 27px;
  font-weight: 750;
  width: 42px;
  height: 42px;
  text-align: center;
  line-height: 36px;
  border-radius: 8px 2px 8px 2px;
}
.edition {
  font: 10px var(--mono);
  letter-spacing: 1.1px;
  color: var(--muted);
}
.edition span {
  margin-left: 28px;
  color: var(--green);
}
.quiet {
  font-size: 12px;
  border: 0;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 31px 0 28px;
  gap: 30px;
}
.eyebrow {
  font: 10px var(--mono);
  letter-spacing: 1.3px;
  color: var(--green);
  margin: 0 0 12px;
}
h1 {
  font-size: clamp(28px, 3vw, 43px);
  font-weight: 650;
  letter-spacing: -1.7px;
  line-height: 1.12;
  margin: 0;
}
.intro-copy {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0 0 2px;
}
#chapters {
  display: grid;
  grid-template-columns: repeat(var(--chapter-count, 14), minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
#chapters button {
  text-align: left;
  border: 0;
  border-radius: 0;
  padding: 14px 10px 14px 2px;
  position: relative;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}
#chapters small {
  display: block;
  font: 9px var(--mono);
  margin-bottom: 7px;
  color: #7b8a83;
}
#chapters button[aria-current='step'] {
  color: var(--green);
  background: linear-gradient(0deg, #e8eee580, transparent);
}
#chapters button[aria-current='step']:after {
  content: '';
  position: absolute;
  left: 0;
  right: 16px;
  bottom: -1px;
  height: 2px;
  background: var(--green);
}
main {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 65px);
  padding: 28px 0 20px;
  align-items: start;
}
.chapter-copy {
  padding-top: 42px;
}
h2 {
  font-size: 32px;
  line-height: 1.14;
  letter-spacing: -1px;
  font-weight: 650;
  margin: 0 0 17px;
}
#chapter-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
  margin: 0;
  max-width: 29ch;
}
.facts {
  margin-top: 25px;
}
.fact {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  display: grid;
  gap: 5px;
}
.fact small {
  font: 9px var(--mono);
  letter-spacing: 1px;
  color: #7b8a83;
}
.fact span {
  font-size: 12px;
}
.chapter-source {
  font-size: 10px;
  line-height: 1.7;
  margin-top: 12px;
  color: var(--muted);
}
.chapter-source a {
  color: var(--muted);
}
.legend {
  display: flex;
  align-items: center;
  gap: 18px;
  font: 9px var(--mono);
  height: 27px;
  letter-spacing: 0.4px;
}
.legend > span:not(:last-child):before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 2px;
  margin-right: 6px;
}
.legend-note {
  margin-left: auto;
  font: 10px var(--font);
  color: #7b8a83;
}
.cpu {
  --tone: var(--cpu);
  color: var(--cpu);
}
.gpu {
  --tone: var(--gpu);
  color: var(--gpu);
}
.npu {
  --tone: var(--npu);
  color: var(--npu);
}
.ram {
  --tone: var(--ram);
  color: var(--ram);
}
.red {
  --tone: var(--red);
  color: var(--red);
}
.neutral {
  --tone: #687970;
  color: #687970;
}
.stage {
  aspect-ratio: 1000/550;
  position: relative;
  min-width: 0;
}
.stage svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.stage .bg-grid {
  opacity: 0.27;
}
.stage text {
  font: 12px var(--font);
  fill: var(--ink);
  pointer-events: none;
}
.stage .micro {
  font: 9px var(--mono);
  fill: var(--muted);
  letter-spacing: 0.35px;
}
.stage .label {
  font: 11px var(--mono);
  fill: currentColor;
  letter-spacing: 0.6px;
}
.stage .title {
  font-size: 18px;
  font-weight: 700;
  fill: currentColor;
}
.stage .tiny {
  font-size: 10px;
  fill: var(--muted);
}
.stage .big {
  font-size: 28px;
  fill: currentColor;
  font-weight: 650;
}
.stage .formula {
  font: 12px var(--mono);
  fill: currentColor;
}
.stage .shell-box {
  fill: color-mix(in srgb, var(--tone) 3%, var(--paper));
  stroke: color-mix(in srgb, var(--tone) 50%, var(--paper));
  stroke-width: 1.1;
}
.stage .rule {
  stroke: color-mix(in srgb, var(--tone) 24%, var(--paper));
  stroke-width: 1;
}
.stage .cell {
  fill: color-mix(in srgb, var(--tone) 8%, var(--paper));
  stroke: color-mix(in srgb, var(--tone) 35%, var(--paper));
  stroke-width: 0.8;
}
.stage .cell.hot {
  fill: color-mix(in srgb, var(--tone) 25%, var(--paper));
}
.stage [data-step] {
  opacity: 0.14;
  transition: opacity 0.45s var(--ease);
}
.stage [data-step].seen {
  opacity: 1;
}
.stage .node {
  cursor: pointer;
  outline: none;
}
.stage .node:hover .shell-box,
.stage .node:focus-visible .shell-box,
.stage .node.selected .shell-box {
  stroke: var(--tone);
  stroke-width: 2;
  fill: color-mix(in srgb, var(--tone) 9%, var(--paper));
}
.stage .wire {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-dasharray: 5 7;
  opacity: 0.8;
}
.stage .wire.flowing {
  animation: wire-flow 1.5s linear infinite;
}
.stage .packet {
  fill: currentColor;
  opacity: 0;
}
.stage .packet.active {
  opacity: 1;
}
.stage .scan.active {
  animation: scan 2.2s var(--ease) infinite;
}
.stage .pulse.active {
  animation: pulse 1.2s ease-in-out infinite alternate;
}
.stage.paused * {
  animation-play-state: paused !important;
}
.stage .subdued {
  opacity: 0.55;
}
.step-caption {
  display: flex;
  gap: 15px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 13px 0;
  min-height: 56px;
}
#step-number {
  font: 11px var(--mono);
  color: var(--green);
  white-space: nowrap;
  padding-top: 1px;
}
.step-caption p {
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}
.playback {
  display: flex;
  gap: 8px;
  align-items: center;
}
.playback button {
  font-size: 11px;
  padding: 8px 11px;
  min-height: 33px;
}
.playback .play {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  min-width: 36px;
}
.playback input {
  flex: 1;
  min-width: 20px;
  accent-color: var(--green);
  height: 3px;
  margin: 0 12px;
}
.inspector {
  display: flex;
  align-items: baseline;
  gap: 24px;
  background: #edf1e9;
  border: 1px solid #dbe3d6;
  padding: 14px 19px;
  min-height: 59px;
}
.inspector-label {
  font: 9px var(--mono);
  letter-spacing: 1px;
  color: var(--green);
  white-space: nowrap;
}
.inspector p {
  margin: 0;
  font-size: 12px;
  line-height: 1.75;
}
.inspector button {
  padding: 0 8px;
  margin-left: auto;
  border: 0;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
footer button {
  border: 0;
  font-size: 12px;
}
footer button:last-child {
  background: var(--ink);
  color: var(--paper);
  padding: 11px 20px;
}
footer p {
  font: 10px var(--mono);
  color: var(--muted);
  letter-spacing: 0.5px;
}
.fineprint {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 9px;
  color: #7a8881;
  padding: 12px 0 20px;
}
.reading {
  border-top: 1px solid var(--line);
}
summary {
  cursor: pointer;
  padding: 17px 0;
  font-size: 12px;
  list-style: none;
  font-weight: 600;
}
summary span {
  float: right;
}
.reading[open] summary span {
  transform: rotate(45deg);
}
#notes {
  padding: 0 0 22px;
  max-width: 1000px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
#notes h3 {
  color: var(--ink);
  font-size: 15px;
  margin: 18px 0 6px;
}
#notes ul {
  padding-left: 20px;
}
#notes code {
  font: 11px var(--mono);
  background: #e9eee7;
  padding: 2px 5px;
  color: var(--green);
}
.credits {
  border-top: 1px solid var(--line);
  padding: 20px 0 25px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
}
.credits span {
  float: right;
}
dialog {
  width: min(800px, calc(100% - 32px));
  max-height: 88vh;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 32px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 25px 100px #12251b26;
}
dialog::backdrop {
  background: #172c2755;
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
}
.dialog-head button {
  font-size: 20px;
  border: 0;
}
.dialog-head h2 {
  font-size: 29px;
}
dialog p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
dialog h3 {
  font-size: 16px;
  margin-top: 24px;
}
.source-row {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.source-row a {
  font-weight: 600;
  font-size: 12px;
}
.source-row p {
  font-size: 11px;
  margin: 5px 0;
}
.skip {
  position: fixed;
  top: -100px;
  left: 10px;
  z-index: 9;
  padding: 12px;
  background: var(--paper);
}
.skip:focus {
  top: 10px;
}
@keyframes wire-flow {
  to {
    stroke-dashoffset: -48;
  }
}
@keyframes pulse {
  to {
    opacity: 0.4;
  }
}
@keyframes scan {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(160px);
  }
}
@media (min-width: 1600px) {
  main {
    grid-template-columns: 255px 1fr;
  }
  .stage {
    aspect-ratio: 1000/540;
  }
  .chapter-copy {
    padding-top: 55px;
  }
  h2 {
    font-size: 37px;
  }
}
@media (max-width: 1000px) {
  .edition {
    display: none;
  }
  main {
    grid-template-columns: 190px 1fr;
    gap: 25px;
  }
  .chapter-copy {
    padding-top: 26px;
  }
  h2 {
    font-size: 28px;
  }
  .stage {
    min-height: 380px;
  }
  .legend {
    gap: 10px;
  }
  #chapters {
    grid-template-columns: repeat(6, 1fr);
  }
  #chapters button {
    padding: 9px 3px;
  }
  #chapters small {
    display: inline;
    margin-right: 8px;
  }
  .intro {
    padding: 25px 0;
  }
  .inspector-label {
    white-space: normal;
  }
  .credits span {
    float: none;
    display: block;
  }
}
@media (max-width: 700px) {
  .shell {
    padding: 0 18px;
  }
  .masthead {
    min-height: 74px;
  }
  .intro-copy {
    display: none;
  }
  .intro {
    padding: 22px 0;
  }
  h1 {
    font-size: 30px;
  }
  main {
    display: block;
    padding-top: 22px;
  }
  .chapter-copy {
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }
  .chapter-copy h2 {
    font-size: 29px;
    grid-column: 1;
  }
  .chapter-copy > .eyebrow {
    grid-column: 1/-1;
  }
  .chapter-copy > p#chapter-description {
    grid-column: 2;
    grid-row: 2/4;
    font-size: 12px;
    max-width: unset;
  }
  .facts {
    display: none;
  }
  .chapter-source {
    grid-column: 1/-1;
    margin: 0 0 17px;
  }
  .legend-note {
    display: none;
  }
  .stage {
    min-height: 0;
    overflow-x: auto;
    aspect-ratio: auto;
  }
  .stage svg {
    min-width: 700px;
    height: 390px;
  }
  .step-caption {
    min-height: 68px;
  }
  .inspector {
    display: block;
    padding: 15px;
  }
  .inspector p {
    margin-top: 6px;
  }
  .fineprint span:last-child {
    display: none;
  }
  .reading summary {
    font-size: 12px;
  }
  footer p {
    font-size: 9px;
  }
  .playback {
    gap: 5px;
  }
  .playback input {
    margin: 0 4px;
  }
  #chapters button {
    font-size: 10px;
  }
  #chapters small {
    font-size: 8px;
    margin-right: 5px;
  }
  dialog {
    padding: 23px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .stage [data-step] {
    transition: none;
  }
  .stage .packet {
    display: none;
  }
}

.cache-explorer {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px;
  border: 1px solid var(--line);
  margin-top: 20px;
}
.cache-explorer input {
  accent-color: var(--ram);
  flex: 1;
  min-width: 160px;
}
.cache-explorer output {
  font-family: var(--mono);
  color: var(--ram);
}
.cache-explorer small {
  width: 100%;
}
@media (min-width: 701px) and (max-width: 1000px) {
  #chapters {
    grid-template-columns: repeat(7, 1fr);
  }
  main {
    display: block;
  }
  .chapter-copy {
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
  }
  .chapter-copy > .eyebrow {
    grid-column: 1/-1;
  }
  .chapter-copy h2 {
    grid-column: 1;
  }
  .chapter-copy #chapter-description {
    grid-column: 2;
    grid-row: 2/4;
    max-width: unset;
  }
  .chapter-copy .facts {
    display: none;
  }
  .chapter-source {
    grid-column: 1/-1;
    margin: 0 0 18px;
  }
  .stage {
    min-height: 0;
    aspect-ratio: 1000/550;
  }
  .legend-note {
    display: block;
  }
  .intro h1 {
    letter-spacing: -1px;
  }
}
@media (max-width: 700px) {
  #chapters {
    grid-template-columns: repeat(5, 1fr);
  }
  .stage:after {
    content: 'Swipe diagram horizontally to explore →';
    display: block;
    font-size: 10px;
    color: var(--muted);
    padding: 8px 0;
  }
  .fineprint {
    font-size: 10px;
  }
}

@media (min-width: 1001px) {
  .masthead {
    min-height: 70px;
  }
  .intro {
    padding: 22px 0 20px;
  }
  .stage {
    height: clamp(300px, calc(100vh - 560px), 460px);
    aspect-ratio: auto;
  }
  main {
    padding: 22px 0 18px;
  }
  .chapter-copy {
    padding-top: 24px;
  }
  .facts {
    margin-top: 19px;
  }
  .fact {
    padding: 10px 0;
  }
  h2 {
    font-size: 30px;
  }
  footer {
    padding: 12px 0;
  }
}

/* The closing chapter reuses the same geometry as focus moves through each pass. */
.stage .overview-title {
  font-size: 15px;
  font-weight: 700;
  fill: currentColor;
}
.stage .overview-sub {
  font: 8px var(--mono);
  fill: var(--muted);
  letter-spacing: 0.15px;
}
.stage .overview-quote {
  font-size: 20px;
  font-weight: 650;
  fill: currentColor;
}
.stage .overview-status {
  font-size: 12px;
  fill: var(--green);
}
.stage .overview-node.running .shell-box {
  stroke: var(--tone);
  stroke-width: 2;
  fill: color-mix(in srgb, var(--tone) 10%, var(--paper));
}
.stage [data-overall-token] {
  transition: opacity 0.3s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .stage [data-overall-token] {
    transition: none;
  }
}

/* Give the complete request the width needed to read its seven-stage pipeline. */
main.overview-layout {
  display: block;
}
.overview-layout .chapter-copy {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) 1.15fr;
  column-gap: 40px;
  padding-top: 0;
}
.overview-layout .chapter-copy > .eyebrow {
  grid-column: 1/-1;
}
.overview-layout .chapter-copy h2 {
  grid-column: 1;
  margin-bottom: 10px;
}
.overview-layout #chapter-description {
  grid-column: 2;
  grid-row: 2/4;
  max-width: none;
}
.overview-layout .facts {
  display: none;
}
.overview-layout .chapter-source {
  grid-column: 1/-1;
  margin: 0 0 18px;
}
.overview-layout .stage {
  height: auto;
  aspect-ratio: 1000/550;
}
@media (max-width: 700px) {
  .overview-layout .chapter-copy {
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
  }
  .overview-layout .stage {
    aspect-ratio: auto;
  }
}

/* Two narrative parts stay readable as the talk grows. */
@media (min-width: 1001px) { #chapters { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
#chapters button:nth-child(8) { border-top: 2px solid var(--npu); }
