:root {
  color-scheme: light;
  --type-small: clamp(12px, .82vw, 14px);
  --type-large: clamp(42px, 6vw, 88px);
  --page: #dfe8ed;
  --surface: #cbd8de;
  --raised: #f3f8fa;
  --ink: #0d1217;
  --soft: #4d5d65;
  --muted: #4f6068;
  --blue: #4057ce;
  --orange: #b85b28;
  --green: #2f7c5a;
  --violet: #7459a6;
  --max: 1460px;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, .42), transparent 34%, rgba(87, 107, 122, .1) 72%, transparent),
    repeating-linear-gradient(0deg, rgba(13, 18, 23, .025) 0 1px, transparent 1px 8px),
    var(--page);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--type-small);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main, section, article, div, nav { min-width: 0; }
a { color: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
code, pre { font: inherit; }
::selection { background: color-mix(in srgb, var(--blue) 24%, transparent); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: max(8px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  transform: translateY(-180%);
  padding: 9px 12px;
  background: var(--ink);
  color: white;
  text-decoration: none;
}
.skip-link:focus { transform: none; }

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  min-height: calc(54px + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: env(safe-area-inset-top) max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--page) 94%, white);
}
.brand,
.topbar nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: var(--type-small);
  text-decoration: none;
}
.brand { justify-self: start; font-weight: 700; white-space: nowrap; }
.brand span { margin: 0 .55ch; color: var(--muted); font-weight: 400; }
.topbar nav { display: flex; align-items: center; gap: 14px; }
.topbar nav a { color: var(--soft); }
.topbar nav a:hover { color: var(--ink); }

.docs-layout {
  width: min(var(--max), 100%);
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  gap: 12px;
  margin: 0 auto;
  padding: 12px;
}

.side {
  position: sticky;
  top: calc(66px + env(safe-area-inset-top));
  height: calc(100vh - 78px - env(safe-area-inset-top));
  height: calc(100svh - 78px - env(safe-area-inset-top));
  align-self: start;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 15px 10px 12px;
  background: var(--ink);
  color: #edf5f8;
}
.side-title { padding: 5px 10px 14px; color: #9babb4; font-weight: 700; }
.side nav { display: grid; gap: 2px; }
.side nav a {
  min-height: 44px;
  display: grid;
  grid-template-columns: 3ch minmax(0, 1fr);
  align-items: center;
  padding: 0 10px;
  color: #c6d0d5;
  text-decoration: none;
}
.side nav a span { color: #73848e; }
.side nav a:hover,
.side nav a:focus-visible { background: var(--blue); color: white; }
.side nav a:hover span,
.side nav a:focus-visible span { color: white; }
.side > p { margin: auto 10px 0; color: #81919a; }

main { display: grid; gap: 12px; }
.hero,
.doc-section,
.docs-footer { scroll-margin-top: 74px; }

.hero {
  min-height: 376px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 330px);
  background: var(--surface);
  overflow: hidden;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 5vw, 72px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .38), transparent 50%),
    repeating-linear-gradient(90deg, transparent 0 29px, rgba(13, 18, 23, .025) 29px 30px);
}
.eyebrow,
.label {
  margin: 0;
  color: var(--soft);
  font-size: var(--type-small);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero h1 {
  margin: auto 0;
  font-size: var(--type-large);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.07em;
}
.mobile-break { display: none; }
.lede { max-width: 62ch; margin: 18px 0 0; color: var(--soft); }
.hero-meter {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  background: var(--ink);
  color: white;
}
.hero-meter span {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 18px 22px;
}
.hero-meter span:nth-child(2) { background: var(--blue); }
.hero-meter b { color: white; font-weight: 400; }

.doc-section {
  padding: clamp(22px, 3vw, 42px);
  background: color-mix(in srgb, var(--raised) 92%, transparent);
}
.doc-section:nth-of-type(odd) { background: color-mix(in srgb, var(--surface) 78%, var(--raised)); }
.section-head {
  display: grid;
  grid-template-columns: 4ch minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 24px;
}
.section-head > span { color: var(--blue); font-weight: 700; }
.section-head p,
.section-head h2 { margin: 0; font-size: var(--type-small); }
.section-head p { color: var(--soft); text-transform: uppercase; }
.section-head h2 { margin-top: 3px; font-weight: 700; }
h3 { margin: 0 0 10px; font-size: var(--type-small); }
p { overflow-wrap: anywhere; }
.section-intro { max-width: 76ch; margin: 0 0 20px; color: var(--soft); }

.split,
.quick-grid,
.mode-grid,
.command-grid,
.safety-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 10px;
  margin-top: 10px;
}
.split > article,
.quick-grid > article,
.mode-grid > article,
.command-grid > article,
.safety-grid > article {
  padding: 16px;
  background: var(--raised);
}
.split.compact > article { background: color-mix(in srgb, var(--surface) 62%, var(--raised)); }
article > :last-child { margin-bottom: 0; }
.clean-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.clean-list li::before { content: "› "; color: var(--blue); font-weight: 700; }

pre {
  max-width: 100%;
  margin: 10px 0 0;
  overflow: auto;
  padding: 13px 14px;
  background: var(--ink);
  color: #edf5f8;
  line-height: 1.5;
  white-space: pre;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
p code,
li code,
dd code { color: var(--blue); font-weight: 600; }
.accent-card.blue { background: var(--blue); color: white; }
.accent-card.blue p { color: white; }
.accent-card.blue pre { background: color-mix(in srgb, var(--ink) 88%, var(--blue)); }
.code-card .label { color: var(--muted); }

.drop {
  margin-top: 10px;
  background: var(--surface);
}
.drop summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.drop summary::-webkit-details-marker { display: none; }
.drop summary::before { width: 2ch; content: "+"; color: var(--blue); }
.drop[open] summary::before { content: "−"; }
.drop-body { padding: 0 15px 15px; }

.mode-grid article { min-height: 132px; display: flex; flex-direction: column; }
.mode-grid strong { color: var(--blue); }
.mode-grid > article > code { margin: auto 0 7px; font-weight: 700; }
.mode-grid p { margin: 0; color: var(--soft); }
.doc-section > h3 { margin-top: 24px; }

.key-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 10px 0 0;
}
.key-grid div {
  display: grid;
  grid-template-columns: minmax(100px, .8fr) minmax(0, 1.6fr);
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
}
.key-grid dt { font-weight: 700; }
.key-grid dd { margin: 0; color: var(--soft); }
.command-grid article { display: grid; align-content: start; gap: 6px; }
.command-grid .label { margin-bottom: 5px; }
.command-grid code { overflow-wrap: anywhere; }

.provider-cloud,
.tool-strip,
.precedence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.provider-cloud { margin-bottom: 16px; }
.provider-cloud span,
.tool-strip span,
.precedence span {
  padding: 8px 10px;
  background: var(--surface);
  font-weight: 600;
}
.provider-cloud span:nth-child(4n + 1) { background: color-mix(in srgb, var(--blue) 20%, var(--raised)); }
.provider-cloud span:nth-child(4n + 2) { background: color-mix(in srgb, var(--orange) 20%, var(--raised)); }
.provider-cloud span:nth-child(4n + 3) { background: color-mix(in srgb, var(--green) 20%, var(--raised)); }

.context-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.context-card { min-height: 230px; display: flex; flex-direction: column; padding: 18px; color: white; }
.context-card h3 { margin: auto 0 12px; }
.context-card p:last-child { margin: 0; color: white; }
.context-card .label { color: white; }
.context-card code { color: white; }
.context-card.dark { background: var(--ink); }
.context-card.orange { background: var(--orange); }
.context-card.green { background: var(--green); }

.tool-strip { margin-bottom: 14px; }
.tool-strip span { min-width: 8ch; text-align: center; background: var(--ink); color: white; }
.tool-strip .muted-tool { background: var(--surface); color: var(--soft); }
.safety-grid strong { color: var(--blue); }
.note { margin: 16px 0 0; color: var(--soft); }

.session-visual {
  min-height: 126px;
  display: grid;
  grid-template-columns: max-content minmax(24px, 1fr) max-content minmax(24px, 1fr) max-content;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  overflow-x: auto;
  padding: 18px;
  background: var(--ink);
  color: white;
}
.session-visual span { padding: 8px 10px; background: #283139; white-space: nowrap; }
.session-visual .active { background: var(--blue); }
.session-visual i { height: 4px; background: #5f707a; }
.session-visual b { grid-column: 3; grid-row: 2; width: 4px; height: 100%; justify-self: center; background: #5f707a; }
.session-visual .branch { grid-column: 4 / 6; grid-row: 2; justify-self: start; background: var(--violet); }

.resource-map { display: grid; gap: 5px; }
.resource-map > div {
  display: grid;
  grid-template-columns: 10ch repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 11px 12px;
  background: var(--surface);
}
.resource-map span { color: var(--blue); font-weight: 700; }
.resource-map code { overflow-wrap: anywhere; }

.precedence { align-items: center; }
.precedence b { color: var(--blue); }
.option-list { display: grid; gap: 2px; padding: 0 15px 15px; }
.option-list p {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 9px 10px;
  background: var(--raised);
}
.option-list span { color: var(--soft); }
.release-card {
  display: grid;
  grid-template-columns: minmax(130px, .35fr) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  padding: 18px;
  background: var(--ink);
  color: white;
}
.release-card p,
.release-card h3 { margin: 0; }
.release-card .label { color: #94a4ac; }
.release-card a { min-height: 44px; display: inline-flex; align-items: center; color: #bfcbd1; text-decoration: none; }
.release-card a:hover { color: white; }

.docs-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 90px;
  padding: 16px 20px max(16px, env(safe-area-inset-bottom));
  background: var(--surface);
  color: var(--soft);
}
.docs-footer p { margin: 0; }
.docs-footer a { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); font-weight: 700; text-decoration: none; }

@media (max-width: 1335px) {
  .mobile-break { display: initial; }
}

@media (max-width: 900px) {
  .docs-layout { display: block; padding: 0; }
  .side {
    top: calc(54px + env(safe-area-inset-top));
    z-index: 40;
    width: 100%;
    height: 48px;
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
    white-space: nowrap;
    scrollbar-width: none;
  }
  .side::-webkit-scrollbar { display: none; }
  .side-title,
  .side > p { display: none; }
  .side nav { display: flex; width: max-content; gap: 0; }
  .side nav a { min-width: auto; grid-template-columns: 3ch auto; padding: 0 10px; }
  main { gap: 8px; padding: 8px; }
  .hero,
  .doc-section,
  .docs-footer { scroll-margin-top: calc(112px + env(safe-area-inset-top)); }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(210px, 260px); }
  .resource-map > div { grid-template-columns: 9ch repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  main {
    padding-right: max(6px, env(safe-area-inset-right));
    padding-left: max(6px, env(safe-area-inset-left));
  }
  .hero { min-height: 0; grid-template-columns: minmax(0, 1fr); }
  .hero-copy { min-height: 310px; padding: 26px 20px; }
  .hero-meter { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto; }
  .hero-meter span { min-height: 92px; padding: 14px; }
  .key-grid { grid-template-columns: minmax(0, 1fr); }
  .context-stack { grid-template-columns: minmax(0, 1fr); }
  .context-card { min-height: 190px; }
  .resource-map > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .resource-map > div code { padding-left: 3ch; }
  .release-card { grid-template-columns: minmax(0, 1fr) auto auto; }
  .release-card > p { grid-column: 1 / -1; grid-row: 2; }
  .docs-footer { grid-template-columns: minmax(0, 1fr) auto; }
  .docs-footer p:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 520px) {
  :root { --type-large: clamp(34px, 10vw, 48px); }
  .topbar { gap: 6px; padding-right: max(10px, env(safe-area-inset-right)); padding-left: max(10px, env(safe-area-inset-left)); }
  .topbar nav { gap: 4px; }
  .topbar nav a { padding: 0 5px; }
  .doc-section { padding: 20px 14px; }
  .hero-meter { grid-template-columns: minmax(0, 1fr); }
  .hero-meter span { min-height: 64px; }
  .key-grid div { grid-template-columns: minmax(96px, .75fr) minmax(0, 1.25fr); }
  .option-list p { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .release-card { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .release-card > p,
  .release-card a { grid-column: 1; grid-row: auto; }
  .docs-footer { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .docs-footer p:nth-child(2) { grid-column: 1; grid-row: auto; }
}

@media (max-width: 430px) {
  .topbar nav a:first-child { display: none; }
  .hero-copy { min-height: 280px; }
  .session-visual { padding: 14px 10px; }
}

@media (max-width: 380px) {
  :root { --type-large: 36px; }
  .brand span { margin-right: .35ch; margin-left: .35ch; }
  .side nav a { padding-right: 8px; padding-left: 8px; }
  .key-grid div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
