:root {
  color-scheme: light;
  --paper: #f7f9f7;
  --surface: #ffffff;
  --ink: #172225;
  --muted: #5d6b6e;
  --line: #d8dfdc;
  --line-strong: #b7c3bf;
  --green: #0f766e;
  --green-deep: #0b514d;
  --green-soft: #e8f4f1;
  --blue: #315f91;
  --blue-soft: #edf3f9;
  --amber: #a6530b;
  --amber-soft: #fff3df;
  --red: #a83b32;
  --red-soft: #fbefed;
  --code: #172024;
  --code-ink: #eaf0ed;
  --topbar-height: 60px;
  --sidebar-width: 264px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 28px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: var(--green-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--green);
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  font-size: 0.9em;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  border: 1px solid var(--green);
  border-radius: 4px;
  background: var(--surface);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  min-height: var(--topbar-height);
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 5px;
  background: var(--green);
  color: #ffffff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 19px;
  line-height: 1;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.top-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.top-links a:hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.nav-scrim {
  display: none;
}

.docs-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  padding-top: var(--topbar-height);
}

.sidebar {
  position: fixed;
  z-index: 20;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #f1f5f2;
}

.sidebar-inner {
  padding: 26px 20px 40px;
}

.search-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.doc-search {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.doc-search:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.search-empty {
  margin: 10px 4px 0;
  color: var(--red);
  font-size: 13px;
}

.nav-group {
  margin-top: 25px;
}

.nav-group[hidden],
.section-nav a[hidden] {
  display: none;
}

.nav-group-title {
  margin: 0 8px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.section-nav a {
  display: block;
  margin: 1px 0;
  padding: 6px 8px;
  border-left: 2px solid transparent;
  color: #455357;
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.section-nav a:hover {
  color: var(--ink);
}

.section-nav a.active {
  border-left-color: var(--green);
  color: var(--green-deep);
  font-weight: 750;
}

main {
  grid-column: 2;
  width: min(100%, 960px);
  padding: 48px 64px 80px;
}

.doc-section {
  padding: 18px 0 70px;
  border-bottom: 1px solid var(--line);
}

.doc-section + .doc-section {
  padding-top: 64px;
}

.intro {
  padding-top: 22px;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 42px;
}

h2 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: 30px;
}

h3 {
  margin-bottom: 9px;
  font-size: 18px;
}

p,
ul {
  max-width: 760px;
}

.lead {
  max-width: 790px;
  margin: 0 0 18px;
  color: #2c3c40;
  font-size: 21px;
  line-height: 1.45;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 820px;
  margin: 32px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.quick-facts div {
  min-width: 0;
  padding: 15px 18px 15px 0;
}

.quick-facts div + div {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.quick-facts dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.quick-facts dd {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.note {
  max-width: 820px;
  margin: 28px 0 0;
  padding: 15px 18px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  color: #30465d;
}

.note strong {
  color: #213a53;
}

.note-warm {
  border-left-color: var(--amber);
  background: var(--amber-soft);
  color: #61401f;
}

.note-warm strong {
  color: #4c2f15;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 42px;
  margin: 38px 0 26px;
}

.setup-path {
  min-width: 0;
  padding-top: 18px;
  border-top: 3px solid var(--green);
}

.path-number {
  margin: 0 0 4px;
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.example-list {
  max-width: 860px;
  margin: 36px 0 44px;
  border-bottom: 1px solid var(--line-strong);
}

.feature-example {
  display: grid;
  grid-template-columns: minmax(190px, 0.65fr) minmax(0, 1.35fr);
  gap: 12px 38px;
  padding: 32px 0;
  border-top: 1px solid var(--line-strong);
}

.example-copy p {
  margin-top: 0;
}

.example-number {
  margin-bottom: 7px;
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.example-code-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feature-example > .example-code-pair {
  grid-column: 1 / -1;
}

.feature-example .command-block {
  margin-top: 0;
}

.feature-example .matrix-diagram {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.command-block {
  position: relative;
  max-width: 820px;
  margin: 20px 0 26px;
  overflow: hidden;
  border: 1px solid #273438;
  border-radius: 6px;
  background: var(--code);
  color: var(--code-ink);
}

.command-label {
  min-height: 34px;
  padding: 7px 84px 6px 14px;
  border-bottom: 1px solid #344246;
  color: #a9b9b4;
  font-size: 12px;
  font-weight: 700;
}

.command-block pre {
  margin: 0;
  overflow-x: auto;
  padding: 16px 18px 18px;
  font-size: 13px;
  line-height: 1.7;
}

.command-block code {
  font-size: inherit;
}

.copy-button {
  position: absolute;
  top: 5px;
  right: 6px;
  min-width: 62px;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid #506165;
  border-radius: 4px;
  background: #243034;
  color: #dce6e2;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.copy-button:hover {
  border-color: #81938e;
  background: #2d3b3f;
}

.copy-button:focus-visible,
.nav-toggle:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.diagram {
  max-width: 860px;
  margin: 34px 0;
  padding: 26px 0 30px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.diagram figcaption {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.diagram-node {
  display: flex;
  min-width: 0;
  min-height: 68px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  text-align: center;
}

.diagram-node strong {
  line-height: 1.3;
}

.diagram-node span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.diagram-node.compact {
  min-height: 78px;
}

.node-user {
  border-color: #9bb2c9;
  background: var(--blue-soft);
}

.node-lev {
  border-color: #79aaa4;
  background: var(--green-soft);
  color: var(--green-deep);
}

.node-upstream {
  border-color: #d3ad76;
  background: var(--amber-soft);
}

.node-output {
  border-color: #aab6b2;
  background: #f0f3f2;
}

.node-paper {
  border-color: #d2a28f;
  background: #fbf1ed;
}

.node-current {
  border-color: #8da8c3;
  background: var(--blue-soft);
}

.node-storage {
  border-style: dashed;
  border-color: #79aaa4;
  background: #f0f8f6;
}

.stack-stage {
  display: grid;
  width: min(100%, 650px);
  margin: 0 auto;
  justify-items: stretch;
}

.stack-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.diagram-connector.vertical {
  width: 1px;
  height: 24px;
  margin: 0 auto;
  background: var(--line-strong);
}

.diagram-connector.vertical.split {
  position: relative;
  width: 52%;
  border-top: 1px solid var(--line-strong);
  background: transparent;
}

.diagram-connector.vertical.split::before,
.diagram-connector.vertical.split::after {
  position: absolute;
  top: 0;
  width: 1px;
  height: 24px;
  background: var(--line-strong);
  content: "";
}

.diagram-connector.vertical.split::before {
  left: 0;
}

.diagram-connector.vertical.split::after {
  right: 0;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipeline li {
  position: relative;
  min-width: 0;
  padding: 0 18px;
  text-align: center;
}

.pipeline li:not(:last-child)::after {
  position: absolute;
  top: 17px;
  right: -6px;
  color: var(--line-strong);
  content: ">";
  font-family: "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
}

.step-index {
  display: grid;
  width: 34px;
  height: 34px;
  margin: 0 auto 9px;
  place-items: center;
  border: 1px solid #79aaa4;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-deep);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.pipeline strong,
.pipeline small {
  display: block;
}

.pipeline strong {
  font-size: 14px;
}

.pipeline small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.environment-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(140px, 0.75fr) 48px minmax(0, 1fr);
  align-items: center;
  gap: 0;
}

.environment-inputs,
.environment-outputs {
  display: grid;
  gap: 12px;
}

.diagram-connector.horizontal {
  position: relative;
  height: 1px;
  background: var(--line-strong);
}

.diagram-connector.horizontal::after {
  position: absolute;
  top: -5px;
  right: 0;
  color: var(--line-strong);
  content: ">";
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
}

.cache-stage {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(70px, 0.25fr) minmax(230px, 1fr);
  align-items: center;
}

.cache-projects,
.cache-stores {
  display: grid;
  gap: 10px;
}

.cache-projects .diagram-node {
  min-height: 50px;
}

.cache-lines {
  display: grid;
  gap: 9px;
  padding: 0 14px;
}

.cache-lines span {
  display: block;
  height: 1px;
  background: var(--line-strong);
}

.boundary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 42px;
  max-width: 820px;
  margin: 32px 0;
}

.boundary-grid > div {
  padding-top: 16px;
  border-top: 2px solid var(--green);
}

.boundary-grid > div + div {
  border-top-color: var(--red);
}

.check-list,
.plain-list {
  margin: 0;
  padding-left: 19px;
}

.check-list li,
.plain-list li {
  margin: 7px 0;
}

.benchmark-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.55fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
}

.benchmark-lane {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.benchmark-lane strong,
.benchmark-lane span {
  padding: 10px 13px;
}

.benchmark-lane strong {
  border-bottom: 1px solid var(--line);
}

.benchmark-lane span {
  color: var(--muted);
  font-size: 12px;
}

.benchmark-lane span + span {
  border-top: 1px solid var(--line);
}

.lane-paper strong {
  background: var(--red-soft);
  color: #6f2d28;
}

.lane-current strong {
  background: var(--blue-soft);
  color: #284d74;
}

.benchmark-result {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  border-top: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  text-align: center;
}

.benchmark-result span,
.benchmark-result small {
  color: var(--muted);
  font-size: 11px;
}

.benchmark-result strong {
  margin: 4px 0;
  color: var(--green-deep);
}

.matrix-stage {
  display: grid;
  grid-template-columns: minmax(170px, 0.65fr) 72px minmax(0, 1.35fr);
  align-items: center;
  width: min(100%, 680px);
  margin: 0 auto;
}

.matrix-fanout {
  position: relative;
  height: 116px;
}

.matrix-fanout::before,
.matrix-fanout::after,
.matrix-fanout span {
  position: absolute;
  background: var(--line-strong);
  content: "";
}

.matrix-fanout::before {
  top: 50%;
  right: 50%;
  left: 0;
  height: 1px;
}

.matrix-fanout::after {
  top: 25%;
  bottom: 25%;
  left: 50%;
  width: 1px;
}

.matrix-fanout span {
  right: 0;
  left: 50%;
  height: 1px;
}

.matrix-fanout span:first-child {
  top: 25%;
}

.matrix-fanout span:last-child {
  top: 75%;
}

.matrix-environments {
  display: grid;
  gap: 12px;
}

.table-wrap {
  max-width: 900px;
  margin: 28px 0;
  overflow-x: auto;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  min-width: 120px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  background: #eef2ef;
  color: #334145;
  font-size: 12px;
}

tbody th {
  min-width: 210px;
  font-weight: 700;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

.failure-list {
  max-width: 820px;
  margin-top: 30px;
}

.failure-list article {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  gap: 28px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.failure-list article:last-child {
  border-bottom: 1px solid var(--line);
}

.failure-list h3,
.failure-list p {
  margin: 0;
}

.command-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 860px;
  margin: 30px 0;
  border-top: 1px solid var(--line-strong);
}

.command-map div {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 13px 14px 13px 0;
  border-bottom: 1px solid var(--line);
}

.command-map div:nth-child(odd) {
  padding-right: 22px;
}

.command-map div:nth-child(even) {
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.command-map code {
  color: var(--green-deep);
  font-weight: 750;
}

.command-map span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.site-footer {
  display: flex;
  max-width: 860px;
  justify-content: space-between;
  gap: 30px;
  padding: 34px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.site-footer p:first-child {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 960px) {
  main {
    padding-right: 38px;
    padding-left: 38px;
  }

  .environment-stage {
    grid-template-columns: minmax(0, 1fr) 32px minmax(125px, 0.8fr) 32px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 16px;
  }

  .nav-toggle {
    display: inline-block;
  }

  .top-links {
    display: none;
  }

  .docs-shell {
    display: block;
  }

  .sidebar {
    width: min(86vw, 310px);
    transform: translateX(-105%);
    transition: transform 160ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .nav-scrim {
    position: fixed;
    z-index: 15;
    inset: var(--topbar-height) 0 0 0;
    border: 0;
    background: rgba(16, 28, 31, 0.38);
  }

  body.nav-open .nav-scrim {
    display: block;
  }

  main {
    width: 100%;
    padding: 34px 22px 64px;
  }

  .doc-section {
    padding-bottom: 54px;
  }

  .doc-section + .doc-section {
    padding-top: 50px;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 26px;
  }

  .lead {
    font-size: 19px;
  }

  .quick-facts,
  .path-grid,
  .boundary-grid,
  .command-map,
  .feature-example,
  .example-code-pair {
    grid-template-columns: 1fr;
  }

  .quick-facts div {
    padding: 12px 0;
  }

  .quick-facts div + div {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .path-grid {
    gap: 28px;
  }

  .pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 0;
  }

  .pipeline li:nth-child(2)::after {
    display: none;
  }

  .environment-stage {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .diagram-connector.horizontal {
    width: 1px;
    height: 24px;
    margin: 0 auto;
  }

  .diagram-connector.horizontal::after {
    top: auto;
    right: -4px;
    bottom: -8px;
    transform: rotate(90deg);
  }

  .cache-stage {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cache-lines {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 0 24px;
  }

  .cache-lines span {
    width: 1px;
    height: 18px;
    margin: 0 auto;
  }

  .benchmark-stage {
    grid-template-columns: 1fr;
  }

  .feature-example {
    gap: 8px;
  }

  .matrix-stage {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .matrix-fanout {
    width: 1px;
    height: 28px;
    margin: 0 auto;
    background: var(--line-strong);
  }

  .matrix-fanout::before,
  .matrix-fanout::after,
  .matrix-fanout span {
    display: none;
  }

  .benchmark-result {
    min-height: 74px;
    border-top: 1px solid var(--line);
    border-right: 2px solid var(--green);
    border-bottom: 1px solid var(--line);
    border-left: 2px solid var(--green);
  }

  .failure-list article {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .command-map div,
  .command-map div:nth-child(odd),
  .command-map div:nth-child(even) {
    grid-template-columns: 112px minmax(0, 1fr);
    padding: 13px 0;
    border-left: 0;
  }

  .site-footer {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 430px) {
  main {
    padding-right: 16px;
    padding-left: 16px;
  }

  .stack-pair {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .diagram-connector.vertical.split {
    width: 1px;
    border-top: 0;
    background: var(--line-strong);
  }

  .diagram-connector.vertical.split::before,
  .diagram-connector.vertical.split::after {
    display: none;
  }

  .pipeline {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .pipeline li:not(:last-child)::after {
    top: auto;
    right: 50%;
    bottom: -18px;
    transform: rotate(90deg);
  }

  .command-map div,
  .command-map div:nth-child(odd),
  .command-map div:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .sidebar {
    transition: none;
  }
}
