* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--sans); }
a { color: var(--blue-dark); text-underline-offset: .18em; }
a:hover { color: var(--blue); }
button, a { -webkit-tap-highlight-color: transparent; }
button, .button { font: 700 .95rem/1 var(--sans); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.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; }
.skip-link { position: fixed; z-index: 100; top: .75rem; left: .75rem; padding: .85rem 1rem; background: var(--ink); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.site-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.site-rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--rule); padding: 2.4rem 1.4rem 1.5rem; background: white; }
.brand { display: inline-block; color: var(--ink); font: 700 1.55rem/1.02 var(--display); text-decoration: none; }
.rail-note { margin: 1rem 0 1.8rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); color: var(--body); font-size: .73rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.guide-nav ol { margin: 0; padding: 0; list-style: none; }
.guide-nav a { display: grid; grid-template-columns: 1.55rem 1fr; gap: .55rem; min-height: 44px; align-items: center; padding: .55rem .65rem; border-left: 3px solid transparent; color: var(--body); text-decoration: none; font-size: .88rem; line-height: 1.25; }
.guide-nav a span { font-size: .72rem; font-weight: 800; color: #71819c; }
.guide-nav a:hover { background: var(--sky); color: var(--ink); }
.guide-nav a[aria-current='page'] { border-left-color: var(--blue); background: var(--sky); color: var(--blue-dark); font-weight: 800; }
.rail-source { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .72rem; line-height: 1.45; }
.mobile-header { display: none; }
main { width: min(100%, 1180px); padding: 3.4rem clamp(2rem, 5vw, 5rem) 6rem; }
main > * { max-width: 940px; margin-inline: auto; }
h1, h2 { font-family: var(--display); letter-spacing: -.025em; }
h1 { margin: 0; font-size: clamp(2.65rem, 5vw, 4.8rem); line-height: .98; }
h2 { margin: 0 0 .75rem; font-size: clamp(1.55rem, 2.7vw, 2.35rem); line-height: 1.08; }
h3 { margin: 0 0 .35rem; font-size: .79rem; letter-spacing: .08em; text-transform: uppercase; }
p { color: var(--body); }
code { font-family: var(--mono); }
.page-intro { padding-bottom: 2rem; border-bottom: 1px solid var(--rule); }
.page-intro h1 { font-size: clamp(2.55rem, 4.4vw, 4.3rem); }
.page-intro p { max-width: 750px; margin: 1rem 0 0; font-size: 1.17rem; }
.home-hero { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(480px, 1.1fr); gap: 2.4rem; align-items: center; max-width: 1180px; padding: 1rem 0 2rem; }
.hero-copy h1 { font-family: var(--sans); font-weight: 850; font-size: clamp(2.5rem, 3.8vw, 3.5rem); line-height: 1.06; letter-spacing: -.045em; }
.hero-copy > p { margin: 1rem 0; font-size: 1.25rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: .9rem 1.2rem; border: 2px solid var(--blue); border-radius: .4rem; text-decoration: none; }
.button.primary { background: var(--blue); color: white; }
.button.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button.secondary { background: white; color: var(--blue-dark); }
.hero-visual { padding: 2.1rem; background: var(--sky); border-radius: 42% 17% 35% 20% / 18% 30% 16% 30%; }
.flow-diagram { margin: 0; padding: 2rem; background: white; box-shadow: var(--shadow); list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; position: relative; }
.flow-diagram li { position: relative; }
.flow-diagram li:not(:last-child)::after { content: '→'; position: absolute; right: -.85rem; top: 1.1rem; color: var(--ink); font-size: 1.3rem; }
.flow-icon { width: 52px; height: 52px; padding: .65rem; margin-bottom: .8rem; color: var(--blue); background: var(--sky); border-radius: .65rem; }
.flow-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.flow-diagram strong, .flow-diagram span { display: block; }
.flow-diagram strong { font-size: .9rem; }
.flow-diagram span { color: var(--body); font-size: .78rem; line-height: 1.4; }
.home-section, .split-explainer { display: grid; grid-template-columns: 1.1fr .9fr; gap: 4rem; padding: var(--space-7) 0; border-top: 1px solid var(--rule); }
.section-number { margin: 0 0 .5rem; color: var(--coral); font-weight: 900; letter-spacing: .12em; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 0; color: var(--body); }
.checklist svg { flex: 0 0 24px; width: 24px; fill: none; stroke: var(--blue); stroke-width: 2.2; }
.checklist.text-only li::before { content: '✓'; color: var(--success); font-weight: 900; }
.checklist.text-only svg { display: none; }
.callout { margin-block: 2.5rem; padding: 1.5rem 1.7rem; border-left: 5px solid var(--blue); background: var(--sky); }
.callout h2 { font: 800 1rem/1.3 var(--sans); letter-spacing: 0; }
.callout p { margin: .35rem 0 0; }
.callout-warning { border-color: var(--coral); background: #fff1ee; }
.learning-path, .what-stays, main > section:not(.home-hero, .home-section, .callout, .guide-step, .page-intro) { padding-block: 2.7rem; }
.learning-path ol, .handoff-flow ol { display: grid; grid-template-columns: repeat(4, 1fr); margin: 1.5rem 0 0; padding: 0; list-style: none; counter-reset: item; border-top: 1px solid var(--rule); }
.learning-path li, .handoff-flow li { padding: 1.2rem 1rem 0 0; counter-increment: item; }
.learning-path li::before, .handoff-flow li::before { content: '0' counter(item); display: block; color: var(--coral); font-weight: 900; }
.learning-path strong, .learning-path span, .handoff-flow strong, .handoff-flow span { display: block; }
.learning-path span, .handoff-flow span { color: var(--body); font-size: .9rem; }
.open-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.progress-note { display: flex; justify-content: space-between; margin: 1.2rem 0; color: var(--body); }
.guide-step { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 1.2rem; padding: 2.5rem 0; border-bottom: 1px solid var(--rule); }
.step-number { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--coral); color: white; font: 800 1.25rem/1 var(--sans); }
.step-grid { display: grid; grid-template-columns: minmax(160px, .65fr) minmax(280px, 1.5fr) minmax(180px, .8fr); gap: 1.2rem; align-items: start; }
.step-grid p { margin-top: 0; }
.step-grid > div { min-width: 0; }
.code-toolbar > span { min-width: 0; overflow-wrap: anywhere; }
main p code, .checklist code { overflow-wrap: anywhere; }
.step-grid > div:last-child h3:not(:first-child) { margin-top: 1.2rem; }
details { margin-top: 1rem; padding: .8rem 1rem; background: var(--sky); }
summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 800; }
.code-sample { overflow: hidden; border-radius: .45rem; background: var(--code); color: white; box-shadow: 0 8px 24px rgba(7,19,47,.14); }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; padding: .55rem .65rem .55rem 1rem; border-bottom: 1px solid #30405b; color: #cbd8ea; font-size: .75rem; }
.code-toolbar button { min-height: 36px; padding: .4rem .7rem; border: 1px solid #4c96ff; border-radius: .3rem; background: transparent; color: white; cursor: pointer; }
pre { margin: 0; padding: 1rem; overflow: auto; font: .82rem/1.55 var(--mono); white-space: pre; }
.copy-status { min-height: 2.1rem; margin: 0; padding: .45rem 1rem; background: #172740; color: #cbd8ea; font-size: .75rem; }
.source-note { margin-top: 2rem; }
.status-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0 2rem; padding: 1.2rem; background: var(--sky); }
.status-legend dt { font-weight: 800; }
.status-legend dd { margin: .2rem 0 0 1.3rem; color: var(--body); font-size: .84rem; }
.status { display: inline-block; width: .75rem; height: .75rem; margin-right: .5rem; border-radius: 50%; }
.documented { background: var(--success); }.tested { background: var(--blue); }.experimental { background: var(--coral); }
.tool-table-wrap { overflow-x: auto; }
.tool-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tool-table th, .tool-table td { padding: 1rem .8rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.tool-table thead th { color: var(--body); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.term-rows > div, .glossary > div, .plain-rule dl > div { display: grid; grid-template-columns: 190px 1fr; gap: 1.3rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.term-rows h2, .glossary dt, .plain-rule dt { margin: 0; font: 800 1.05rem/1.3 var(--sans); }
.term-rows p, .glossary dd, .plain-rule dd { margin: 0; color: var(--body); }
.number-list { padding-left: 1.4rem; }
.number-list li { padding: .45rem 0 .45rem .5rem; color: var(--body); }
.example-list article { display: grid; grid-template-columns: 70px 220px 1fr; gap: 1rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); }
.example-list article p { margin: 0; }
.faq-list details { background: white; border-top: 1px solid var(--rule); margin: 0; padding: .5rem 0; }
.faq-list summary { font-size: 1.05rem; }
.download-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 2rem; background: var(--sky); }
.checksum { display: block; overflow-wrap: anywhere; margin-bottom: .5rem; }
.prompt-section { padding-top: 1rem; }
.prompt-block pre { max-height: min(62vh, 720px); white-space: pre-wrap; }
.choice-badge { display: inline-block; margin-left: .4rem; padding: .18rem .45rem; border-radius: 999px; background: var(--blue); color: white; font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; }
footer { border-top: 1px solid var(--rule); padding: 1.2rem; text-align: center; }
footer p { margin: 0; font-size: .78rem; }

@media (min-width: 981px) and (max-width: 1280px) {
  .home-hero { grid-template-columns: 1fr; min-height: auto; }
}

@media (max-width: 980px) {
  .mobile-header { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: .85rem 1.2rem; border-bottom: 1px solid var(--rule); background: rgba(255,255,255,.97); }
  .site-shell { display: block; }
  .site-rail { position: fixed; z-index: 25; top: 72px; right: 0; bottom: 0; left: 0; height: auto; padding: 1rem 1.2rem 2rem; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  .site-rail.is-open { visibility: visible; opacity: 1; pointer-events: auto; }
  .rail-brand, .rail-note { display: none; }
  body.menu-open { overflow: hidden; }
  .menu-button { width: 48px; height: 48px; border: 0; background: transparent; cursor: pointer; }
  .menu-button > .menu-icon, .menu-button > .menu-icon::before, .menu-button > .menu-icon::after { display: block; width: 28px; height: 3px; margin: auto; background: var(--ink); content: ''; transition: transform .2s; }
  .menu-button > .menu-icon::before { transform: translateY(-9px); }
  .menu-button > .menu-icon::after { transform: translateY(6px); }
  .menu-button[aria-expanded='true'] > span:last-child { background: transparent; }
  .menu-button[aria-expanded='true'] > span:last-child::before { transform: translateY(3px) rotate(45deg); }
  .menu-button[aria-expanded='true'] > span:last-child::after { transform: rotate(-45deg); }
  main { width: 100%; padding: 2.5rem clamp(1.2rem, 5vw, 3rem) 4rem; }
  .home-hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-copy h1 { max-width: 22ch; }
  .home-section { grid-template-columns: 1fr; gap: 2rem; }
  .step-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  main { padding-top: 2rem; }
  h1 { font-size: 2.6rem; }
  .hero-copy h1 { font-size: clamp(2.2rem, 10vw, 2.8rem); }
  .hero-actions { display: grid; }
  .button { width: 100%; }
  .hero-visual { padding: 1.1rem; border-radius: 1.5rem; }
  .flow-diagram { grid-template-columns: 1fr; padding: 1.3rem; }
  .flow-diagram li { display: grid; grid-template-columns: 56px 1fr; gap: .8rem; }
  .flow-diagram li:not(:last-child)::after { content: '↓'; left: 1.15rem; right: auto; top: 3.3rem; }
  .flow-icon { width: 48px; height: 48px; }
  .open-columns, .split-explainer, .status-legend, .download-panel { grid-template-columns: 1fr; }
  .learning-path ol, .handoff-flow ol { grid-template-columns: 1fr 1fr; }
  .guide-step { grid-template-columns: 42px minmax(0, 1fr); gap: .8rem; }
  .step-number { width: 40px; height: 40px; }
  .term-rows > div, .glossary > div, .plain-rule dl > div, .example-list article { grid-template-columns: 1fr; gap: .35rem; }
  pre { font-size: .76rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.nav-group { margin: 1rem .65rem .45rem; font-size: .72rem; font-weight: 800; color: var(--body); }

/* A growing library: readable pages, restrained navigation, clear content state. */
body { font-size: 1.125rem; }
.site-rail { background: #f6f8fc; padding-top: 1.8rem; }
.guide-nav a { display: block; padding: .6rem .75rem; font-size: .95rem; }
.nav-group { font-size: .8rem; letter-spacing: .025em; margin-top: 1.4rem; }
.rail-note { font-size: .75rem; letter-spacing: .05em; text-transform: none; }
main { width: 100%; }
.content-meta { font-size: .9rem; margin: 0 auto 1.4rem; color: var(--body); }
.topic-list article { padding: 1.6rem 0; border-bottom: 1px solid var(--rule); }
.topic-list article[hidden] { display: none; }
.topic-list h2 { font: 700 1.4rem/1.25 var(--sans); letter-spacing: -.015em; }
.topic-list p { margin: .6rem 0; }
.topic-category { font-size: .9rem; }
label[for='guide-search'] { display: block; font-weight: 700; margin: 1.5rem 0 .5rem; }
#guide-search { width: 100%; min-height: 48px; padding: .8rem 1rem; border: 2px solid #64748b; border-radius: .4rem; background: #f3f6fb; color: var(--ink); font: inherit; }
#guide-search:focus { background: white; }
.update-entry { padding: 1.5rem 0; border-bottom: 1px solid var(--rule); }
.update-entry time { display: block; font-size: .95rem; margin-bottom: .8rem; color: var(--body); }
.page-next { border-top: 1px solid var(--rule); margin-top: 2rem; }
.page-next h2 { font: 700 1.25rem var(--sans); }
.code-toolbar button { min-width: 44px; min-height: 44px; }
.prompt-section pre { max-height: min(60vh, 680px); white-space: pre-wrap; overflow-wrap: anywhere; }
button:disabled { opacity: .55; cursor: not-allowed; }
.button:active, .code-toolbar button:active { transform: translateY(1px); }
@media (forced-colors: active) { .button, #guide-search, .code-toolbar button { border-color: ButtonText; } :focus-visible { outline-color: Highlight; } }
.work-setup pre { max-height: min(60vh, 680px); white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 981px) { .guide-step:has(.work-setup) .step-grid { grid-template-columns: 1fr; } }

h1, h2 { font-family: var(--sans); }
.page-intro h1 { font-size: clamp(2.2rem, 3.5vw, 3.5rem); line-height: 1.1; }
h2 { font-size: clamp(1.55rem, 2.3vw, 2.1rem); line-height: 1.2; }
@media (max-width: 980px) { .menu-button { display: flex; align-items: center; gap: .65rem; width: auto; padding: .5rem; } .menu-button > .menu-icon { margin: 0; } .menu-label { font-size: 1rem; } }
.code-sample pre { max-height: min(60vh, 680px); white-space: pre-wrap; overflow-wrap: anywhere; }
