@font-face {
  font-family: Manrope;
  src: url('./assets/fonts/manrope-variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --paper: #f5f7fa;
  --white: #fff;
  --ink: #17263d;
  --muted: #58677c;
  --line: #dce2eb;
  --accent: #365bed;
  --blue-soft: #e9eeff;
  --lime: #d5f269;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 105px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.75 var(--sans); }
a { color: inherit; text-underline-offset: 4px; }
button, input { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
p { margin: 0 0 18px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: clamp(27px, 3.2vw, 39px); font-weight: 720; letter-spacing: -1.6px; }
h3 { font-size: 18px; font-weight: 720; letter-spacing: -.4px; }
code { font: .86em var(--mono); }
pre { margin: 0; font: 12px/1.8 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
pre code { font: inherit; }

/* One compact navigation bar keeps the guide in a single reading column. */
.site-header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 32px; max-width: 1260px; margin: 0 auto; padding: 23px 40px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 18px; font-weight: 800; line-height: 1.25; letter-spacing: -.7px; }
.brand-icon { display: flex; align-items: center; justify-content: center; gap: 2px; width: 38px; height: 38px; background: var(--ink); border-radius: 10px; color: var(--lime); font-size: 23px; font-weight: 750; letter-spacing: -2px; }
.brand-icon span { font-size: 15px; padding-top: 5px; }
.brand small { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); font-weight: 500; letter-spacing: .1px; }
nav { display: flex; gap: 26px; margin-left: auto; }
nav a { font-size: 12px; text-decoration: none; color: var(--muted); font-weight: 650; }
nav a:hover, nav a[aria-current] { color: var(--accent); }
.header-github { display: flex; align-items: center; gap: 15px; text-decoration: none; border: 1px solid var(--line); background: var(--white); border-radius: 7px; padding: 9px 13px; font-size: 11px; font-weight: 700; }
.header-github:hover { border-color: var(--accent); }
main { max-width: 1260px; margin: 0 auto; padding: 0 40px; }

.hero { display: grid; grid-template-columns: .94fr 1.16fr; gap: 44px; align-items: center; padding: 65px 0 40px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 22px; color: var(--muted); font-size: 11px; font-weight: 600; }
.hero-kicker span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
h1 { font-size: clamp(38px, 4.4vw, 61px); line-height: 1.09; font-weight: 800; letter-spacing: -3px; margin-bottom: 23px; }
h1 span { color: var(--accent); }
.lead { max-width: 420px; color: var(--muted); font-size: 16px; line-height: 1.8; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 25px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 24px; padding: 12px 17px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; line-height: 1.7; font-weight: 700; text-decoration: none; }
.primary { color: var(--white); background: var(--accent); }
.primary:hover { background: #2547d1; }
.text-link { font-size: 12px; font-weight: 700; text-decoration-thickness: 1px; }
.hero-facts { display: flex; gap: 18px; margin-top: 27px; color: var(--muted); font-size: 10px; }
.hero-facts span + span { position: relative; }
.hero-facts span + span::before { content: '·'; position: absolute; left: -11px; }
.explainer-figure { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #f3f6fa; }
.figure-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 20px 0; }
.figure-label { font-size: 9px; font-weight: 800; letter-spacing: 1.1px; }
.figure-index { color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: .6px; }
.diagram-link { display: block; }
.explainer-image { display: block; width: 100%; height: auto; }
figcaption { padding: 13px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.7; }
figcaption a { display: inline-block; color: var(--accent); font-weight: 650; margin-left: 3px; }
.click-example { display: flex; align-items: center; justify-content: space-between; gap: 25px; background: var(--ink); border-radius: 10px; padding: 20px 26px; color: var(--white); margin: 0 0 18px; }
.mini-label { color: #b2c5df; font-size: 9px; font-weight: 650; letter-spacing: 1.2px; }
.click-example p { margin: 5px 0 0; font-size: 13px; }
.click-example button { display: inline-flex; align-items: center; gap: 20px; flex: none; background: var(--lime); color: var(--ink); border: none; padding: 12px 15px; border-radius: 6px; font-size: 12px; font-weight: 750; }
#hero-count { font-variant-numeric: tabular-nums; border-left: 1px solid #adc64f; padding-left: 16px; min-width: 34px; }
.boundary { display: flex; gap: 14px; padding: 18px 22px; color: var(--muted); font-size: 12px; background: var(--blue-soft); border-radius: 9px; }
.boundary p { margin: 0; }
.boundary strong { color: var(--ink); }
.boundary a { font-weight: 650; }
.boundary-icon { display: grid; place-items: center; flex: none; width: 21px; height: 21px; margin-top: 1px; border: 1px solid #a5b6e7; border-radius: 50%; font-size: 12px; color: var(--accent); font-weight: 800; }

/* The reading rhythm stays consistent while examples get their own tools. */
.guide-section { padding: 64px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 5px; }
.section-heading { margin-bottom: 28px; }
.eyebrow { margin-bottom: 13px; font-size: 10px; line-height: 1.5; font-weight: 800; letter-spacing: 1.3px; color: var(--accent); }
.section-heading > p:last-child { max-width: 710px; margin: 15px 0 0; color: var(--muted); font-size: 14px; }
.surface-buttons { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #e9edf4; margin-bottom: 16px; }
.surface-buttons button, .sim-modes button { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 10px 16px; color: var(--muted); font-size: 12px; font-weight: 650; }
.surface-buttons button[aria-pressed=true] { background: var(--white); color: var(--ink); border-color: #d8dfeb; box-shadow: 0 1px 3px #18284308; }
.path-panel { border: 1px solid var(--line); border-radius: 10px; background: var(--white); padding: 30px; }
.path-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.path-header h3 { font-size: 24px; letter-spacing: -.9px; }
.path-badge { flex: none; color: #2545b5; background: var(--blue-soft); padding: 5px 8px; border-radius: 4px; font-size: 8px; font-weight: 750; letter-spacing: .6px; }
.path-panel p { max-width: 780px; margin: 14px 0; color: var(--muted); font-size: 13px; }
.path-panel ol { padding-left: 23px; font-size: 13px; line-height: 1.9; }
.path-panel li { padding-left: 5px; margin: 7px 0; }
.path-panel li::marker { color: var(--accent); font-weight: 750; }
.command-box { position: relative; padding: 25px 70px 25px 20px; margin: 20px 0; border-radius: 7px; background: #f0f3f8; border: 1px solid var(--line); color: #24426b; }
.copy { position: absolute; top: 10px; right: 10px; padding: 6px 10px; border: 1px solid #d3dce9; border-radius: 5px; color: var(--muted); background: var(--white); font-size: 10px; font-weight: 650; }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.source-note { margin: 15px 0 0; font-size: 10px; color: var(--muted); }
.glossary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.glossary article { padding: 24px; padding-left: 0; margin: 16px 0; }
.glossary article + article { padding-left: 24px; border-left: 1px solid var(--line); }
.glossary .number { display: inline-grid; place-items: center; margin-bottom: 20px; width: 28px; height: 28px; border-radius: 7px; color: var(--accent); background: var(--blue-soft); font-size: 11px; font-weight: 800; }
.glossary h3 { margin-bottom: 13px; font-size: 16px; }
.glossary p { font-size: 12px; color: var(--muted); }
.concept-tag { font-size: 10px; font-weight: 650; }
.plain-note { border-left: 3px solid var(--accent); padding: 3px 0 3px 18px; margin-top: 28px; color: var(--muted); font-size: 12px; }
.plain-note strong { color: var(--ink); }

.hook-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0 0 24px; }
.hook-options p { margin: 0; padding-left: 15px; border-left: 3px solid var(--accent); font-size: 12px; }
.hook-options p:nth-child(2) { border-color: #9aaaf1; }
.hook-options p:nth-child(3) { border-color: #94af32; }
.hook-options strong, .hook-options span { display: block; }
.hook-options span { color: var(--muted); font-size: 11px; margin-top: 3px; }
.simulation { padding: 27px; background: #eef2fd; border: 1px solid #d3dcf4; border-radius: 10px; }
.sim-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.tiny-tag { font-size: 9px; font-weight: 750; line-height: 1.6; letter-spacing: .7px; color: #34518d; }
.quiet-button { border: none; background: transparent; color: var(--muted); font-size: 11px; padding: 6px; text-decoration: underline; text-underline-offset: 4px; }
.sim-modes { display: flex; gap: 5px; margin-bottom: 24px; }
.sim-modes button { background: #fff8; border-color: #d5dff1; }
.sim-modes button[aria-pressed=true] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.simulation label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 750; }
.simulation input { display: block; width: 100%; padding: 13px 15px; border: 1px solid #bbc9e3; border-radius: 7px; background: var(--white); color: var(--ink); font: 13px/1.6 var(--mono); }
.event-flow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0; font-size: 12px; font-weight: 650; }
.event-flow > span:not([aria-hidden]), .event-flow > strong { text-align: center; padding: 13px 25px; border: 1px solid #b9c9ec; border-radius: 7px; background: #e0e8fc; }
.event-flow > strong { color: var(--ink); background: var(--lime); border-color: #bfd958; font-weight: 750; }
.event-flow .handled { background: transparent !important; border-style: dashed !important; color: var(--muted); }
.sim-bottom { display: flex; align-items: center; gap: 24px; }
.sim-bottom .button { white-space: nowrap; }
.sim-bottom p { margin: 0; color: var(--muted); font-size: 12px; }
.sim-result { padding: 19px; margin-top: 24px; background: #fff9; border: 1px solid #d6e0f3; border-radius: 7px; }
.nav-label { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: 1.2px; }
.sim-result pre { margin-top: 10px; font-size: 12px; }
.explain-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 50px; margin-top: 34px; }
.explain-grid h3 { font-size: 18px; }
.explain-grid dl { margin-bottom: 0; }
.explain-grid dt { margin-top: 18px; font-size: 12px; font-weight: 750; }
.explain-grid dd { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.code-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.code-title { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 650; }
.code-title span { color: var(--muted); font-size: 10px; }
.code-card pre { padding: 23px 18px; color: #28477a; }
.code-card > p { margin: 0; padding: 0 18px 19px; color: var(--muted); font-size: 11px; }

.recipe-browser { display: grid; grid-template-columns: 220px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.recipe-list { display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 12px; border-right: 1px solid var(--line); background: #f0f3f8; }
.recipe-list button { text-align: left; padding: 14px 13px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; }
.recipe-list button small { display: block; margin-top: 6px; font: 9px/1.5 var(--mono); font-weight: 400; }
.recipe-list button[aria-pressed=true] { border-color: #d5e0fd; background: var(--white); color: var(--accent); }
.recipe-detail { min-width: 0; padding: 27px; }
.recipe-detail h3 { margin-bottom: 14px; font-size: 24px; letter-spacing: -.8px; }
.recipe-detail p { color: var(--muted); font-size: 13px; }
.recipe-detail .recipe-expected { color: var(--ink); }
.recipe-detail pre { overflow: auto; max-height: 350px; padding: 20px; background: #f0f3f8; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; white-space: pre; overflow-wrap: normal; tab-size: 2; }
.recipe-detail a { display: inline-block; margin-top: 18px; color: var(--accent); font-size: 11px; font-weight: 650; }
.workshop { padding: 0; margin: 0; list-style: none; }
.workshop li { display: flex; gap: 24px; padding: 26px 0; border-top: 1px solid var(--line); }
.step-number { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--blue-soft); color: var(--accent); font-size: 13px; font-weight: 800; }
.workshop h3 { margin-bottom: 10px; }
.workshop p { max-width: 830px; margin: 0; color: var(--muted); font-size: 13px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 30px; padding: 26px; margin-top: 18px; background: #e9edf4; border-radius: 8px; }
.checks h3 { margin-bottom: 12px; font-size: 17px; }
.checks p { margin: 0; color: var(--muted); font-size: 12px; }
.checks .command-box { margin: 0; background: var(--white); padding: 23px 60px 23px 19px; }
.checks pre { font-size: 11px; }
.faq details { padding: 17px 0; border-top: 1px solid var(--line); }
.faq summary { position: relative; padding: 4px 32px 4px 0; cursor: pointer; list-style: none; font-size: 14px; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { position: absolute; top: 0; right: 5px; content: '+'; color: var(--accent); font-size: 22px; font-weight: 450; }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 15px 35px 0 0; color: var(--muted); font-size: 13px; }
.share-section { padding-bottom: 50px; }
.share-section h2 { font-size: clamp(32px, 4vw, 48px); }
.share-section > p:not(.eyebrow) { max-width: 620px; margin-top: 22px; color: var(--muted); font-size: 14px; }
.reading-list { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--line); }
.reading-list h3 { margin-bottom: 17px; font-size: 13px; }
.reading-list a { display: block; margin: 10px 0; color: var(--muted); font-size: 12px; }
footer { padding: 28px 0 36px; color: var(--muted); font-size: 10px; }
footer p { margin: 0 0 8px; }
.skip { position: fixed; left: 20px; top: -100px; z-index: 20; background: var(--ink); color: var(--white); padding: 12px 20px; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
  .hero { gap: 28px; }
  h1 { font-size: 47px; letter-spacing: -2.2px; }
  .lead { font-size: 14px; }
  .hero-actions { gap: 16px; }
  .glossary article { padding-right: 17px; }
  .glossary article + article { padding-left: 17px; }
  .path-header h3 { font-size: 22px; }
  .explain-grid { gap: 30px; }
}
@media (max-width: 780px) {
  .site-header { padding: 18px 24px; gap: 22px; }
  nav { gap: 18px; }
  nav a { font-size: 11px; }
  .header-github { padding: 8px 11px; font-size: 10px; }
  main { padding: 0 24px; }
  .hero { padding-top: 40px; grid-template-columns: 1fr; gap: 30px; }
  h1 { font-size: clamp(42px, 7vw, 59px); letter-spacing: -2.5px; }
  .hero-copy { max-width: 650px; }
  .lead { font-size: 16px; max-width: 530px; }
  .hero-actions { gap: 24px; }
  .hero-facts { margin-top: 24px; }
  .explainer-figure { max-width: 650px; width: 100%; }
  .explainer-image { max-height: 390px; object-fit: contain; }
  .glossary { grid-template-columns: 1fr 1fr; }
  .glossary article { margin: 0; padding: 24px 20px 24px 0; }
  .glossary article + article { padding-left: 20px; }
  .glossary article:nth-child(3) { border-left: 0; padding-left: 0; }
  .glossary article:nth-child(n+3) { border-top: 1px solid var(--line); }
  .explain-grid { gap: 25px; }
  .recipe-browser { grid-template-columns: 185px minmax(0, 1fr); }
  .recipe-detail { padding: 23px; }
}
@media (max-width: 560px) {
  html { scroll-padding-top: 95px; }
  .site-header { flex-wrap: wrap; justify-content: space-between; gap: 0; padding: 14px 20px 11px; }
  .brand { gap: 10px; font-size: 16px; }
  .brand small { font-size: 9px; }
  .brand-icon { width: 34px; height: 34px; font-size: 21px; border-radius: 8px; }
  .header-github { order: 1; padding: 7px 11px; }
  nav { order: 2; justify-content: space-between; width: 100%; gap: 14px; padding-top: 17px; margin-left: 0; }
  nav a { font-size: 11px; }
  main { padding: 0 20px; }
  .hero { padding: 34px 0 25px; gap: 28px; }
  .hero-kicker { font-size: 10px; margin-bottom: 18px; }
  h1 { font-size: clamp(36px, 9vw, 48px); letter-spacing: -1.9px; margin-bottom: 20px; }
  .lead { font-size: 14px; }
  .hero-actions { align-items: flex-start; gap: 18px; }
  .button { gap: 19px; font-size: 11px; }
  .text-link { font-size: 11px; align-self: center; }
  .hero-facts { font-size: 9px; gap: 16px; }
  .figure-top { padding: 14px 14px 0; gap: 8px; }
  .figure-label { font-size: 8px; }
  .figure-index { font-size: 7px; }
  figcaption { font-size: 9px; padding: 12px 14px; }
  .click-example { padding: 18px; gap: 16px; align-items: flex-start; }
  .mini-label { font-size: 8px; letter-spacing: .7px; }
  .click-example p { font-size: 11px; line-height: 1.7; }
  .click-example button { gap: 10px; padding: 10px 11px; font-size: 10px; }
  #hero-count { min-width: 25px; padding-left: 9px; }
  .boundary { padding: 16px; gap: 10px; font-size: 11px; }
  .boundary-icon { width: 18px; height: 18px; font-size: 10px; }
  .guide-section { padding: 43px 0; }
  h2 { font-size: 29px; letter-spacing: -1.2px; }
  .eyebrow { font-size: 9px; }
  .section-heading > p:last-child { font-size: 13px; }
  .surface-buttons { display: flex; width: 100%; flex-wrap: nowrap; padding: 4px; }
  .surface-buttons button { flex: 1; padding: 10px 8px; font-size: 10px; line-height: 1.6; }
  .path-panel { padding: 20px; }
  .path-header { display: block; }
  .path-header h3 { font-size: 21px; }
  .path-badge { display: inline-block; margin-top: 12px; }
  .path-panel p, .path-panel ol { font-size: 12px; }
  .command-box { padding: 48px 15px 19px; }
  .command-box pre { font-size: 11px; }
  .source-note { font-size: 9px; }
  .glossary h3 { font-size: 16px; }
  .glossary p { font-size: 12px; }
  .glossary article, .glossary article + article { padding-right: 12px; }
  .glossary article + article { padding-left: 16px; }
  .glossary article:nth-child(3) { padding-left: 0; }
  .concept-tag { font-size: 9px; }
  .plain-note { padding-left: 14px; font-size: 11px; }
  .hook-options { gap: 10px; }
  .hook-options p { padding-left: 9px; font-size: 11px; }
  .hook-options span { font-size: 10px; }
  .simulation { padding: 18px; }
  .sim-toolbar .tiny-tag { max-width: 230px; font-size: 8px; letter-spacing: .3px; }
  .quiet-button { font-size: 10px; }
  .sim-modes { gap: 5px; }
  .sim-modes button { padding: 10px 15px; font-size: 11px; }
  .simulation input { font-size: 12px; padding: 12px; }
  .event-flow { gap: 6px; font-size: 10px; }
  .event-flow > span:not([aria-hidden]), .event-flow > strong { padding: 11px 10px; }
  .sim-bottom { flex-direction: column; align-items: flex-start; gap: 13px; }
  .sim-result { padding: 15px; }
  .sim-result pre { font-size: 11px; }
  .explain-grid { grid-template-columns: 1fr; gap: 26px; }
  .code-card pre { font-size: 11px; }
  .recipe-browser { display: block; }
  .recipe-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 9px; border-right: 0; border-bottom: 1px solid var(--line); }
  .recipe-list button { padding: 11px; font-size: 11px; }
  .recipe-list button small { font-size: 8px; }
  .recipe-detail { padding: 20px; }
  .recipe-detail h3 { font-size: 22px; }
  .recipe-detail p { font-size: 12px; }
  .recipe-detail pre { padding: 15px; font-size: 11px; }
  .workshop li { gap: 16px; padding: 23px 0; }
  .workshop h3 { font-size: 17px; }
  .workshop p { font-size: 12px; }
  .checks { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
  .checks .command-box { padding-top: 47px; }
  .faq summary { font-size: 13px; }
  .faq details p { font-size: 12px; }
  .share-section h2 { font-size: 34px; }
  .reading-list { gap: 20px; }
  .reading-list h3 { font-size: 12px; }
  .reading-list a { font-size: 11px; }
  footer { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
