/* materral docs. One stylesheet for every page. */
:root {
  color-scheme: dark;
  --bg: #0a0c0d;
  --tile: #121516;
  --tile-2: #171b1c;
  --ink: #fff;
  --ink-2: rgba(255, 255, 255, .78);
  --muted: #858585;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --focus: #d8ebf1;
  --glacier: #a9cbd8;
  --moss: #9cc4a8;
  --larch: #d8c48a;
  --rose: #e0a3a3;
  --top: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sans: 'DM Sans', Arial, Helvetica, sans-serif;
  --head: 'Host Grotesk', 'DM Sans', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
/* Colour sits on the root only, so the fixed grain layer stays visible above it and below the content. */
html { background: var(--bg); scroll-padding-top: calc(var(--top) + 20px); }
html, body { margin: 0; }
body { font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--ink); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:is(a, button, input, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 8px 14px; background: #fff; color: #0a0c0d; border-radius: 999px; text-decoration: none; font-size: 14px; }
.skip:focus { top: 12px; }

/* Grain: a fixed layer under every piece of text and UI. */
.grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07; background-repeat: repeat; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 20px; background: rgba(10, 12, 13, .82); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer; }
.menu-btn svg { width: 18px; height: 18px; }
.menu-btn:hover { background: rgba(255, 255, 255, .1); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; text-decoration: none; flex: 0 0 auto; }
.brand img { width: 16px; height: auto; display: block; }
.brand b { font-family: Arial, Helvetica, sans-serif; font-weight: 700; font-size: 19px; letter-spacing: -.035em; padding-right: .035em; }
.brand .tag { font-size: 13px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line-2); line-height: 1; }
.search { position: relative; flex: 1 1 auto; max-width: 380px; margin-left: 12px; min-width: 0; }
.search input { width: 100%; height: 40px; padding: 0 40px 0 38px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .05); color: #fff; font: inherit; font-size: 14px; transition: border-color 160ms var(--ease), background-color 160ms var(--ease); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .07); }
.search input::-webkit-search-cancel-button { display: none; }
.search .s-ico { position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.search.has-text kbd { display: none; }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, .08); color: var(--muted); font-family: var(--mono); font-size: 12px; line-height: 18px; text-align: center; }
.results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40; max-height: min(420px, 70vh); overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: #15191a; border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55), inset 0 0 0 1px var(--line); }
.results a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; font-size: 14px; line-height: 1.35; }
.results a span { display: block; font-size: 12px; color: var(--muted); }
.results a:hover, .results a.is-active { background: rgba(255, 255, 255, .08); }
.results .empty { padding: 10px; font-size: 14px; color: var(--muted); }
.top-links { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: 0 0 auto; }
.top-links a.link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.top-links a.link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #0a0c0d; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background-color 180ms var(--ease), transform 180ms var(--ease); }
.pill:hover { background: #fff; transform: translateY(-1px); }
.pill svg { width: 12px; height: 12px; }

/* ---------- three-column layout ---------- */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr) 220px; max-width: 1360px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--top); align-self: start; height: calc(100vh - var(--top)); overflow-y: auto; padding: 28px 16px 40px 20px; }
.nav-group + .nav-group { margin-top: 26px; }
.nav-group h2 { margin: 0 0 8px; padding: 0 10px; font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-group ul { margin: 0; padding: 0; list-style: none; }
.nav-group a { display: block; padding: 6px 10px; border-radius: 6px; font-size: 15px; line-height: 1.35; color: var(--ink-2); text-decoration: none; transition: background-color 140ms var(--ease), color 140ms var(--ease); }
.nav-group a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-group a[aria-current="page"] { background: var(--tile-2); color: #fff; box-shadow: inset 2px 0 0 #fff; }
.nav-group li.no-match { display: none; }
.nav-group.no-match { display: none; }
.nav-none { padding: 0 10px; font-size: 14px; color: var(--muted); }
.drawer-links { display: none; }

.main { min-width: 0; padding: 44px 40px 80px; }
.content { max-width: 760px; }
.toc { position: sticky; top: var(--top); align-self: start; max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 44px 20px 40px 0; }
.toc h2 { margin: 0 0 10px; font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.toc a { display: block; margin-left: -1px; padding: 4px 0 4px 12px; border-left: 1px solid transparent; font-size: 13px; line-height: 1.4; color: var(--muted); text-decoration: none; }
.toc a:hover { color: #fff; }
.toc a.is-active { color: #fff; border-left-color: #fff; }
.toc li.l3 a { padding-left: 24px; }

/* ---------- content typography ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.content h1 { margin: 0; font-family: var(--head); font-weight: 400; font-size: clamp(32px, 4vw, 44px); line-height: 1.08; letter-spacing: -.03em; }
.content h1 .muted, .content h2 .muted { color: var(--muted); }
.lede { margin: 18px 0 0; font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.content h2 { margin: 56px 0 0; font-family: var(--head); font-weight: 400; font-size: 26px; line-height: 1.2; letter-spacing: -.02em; }
.content h3 { margin: 32px 0 0; font-family: var(--head); font-weight: 500; font-size: 18px; line-height: 1.3; letter-spacing: -.01em; }
.content :is(h2, h3) a.anchor { margin-left: 8px; color: var(--muted); text-decoration: none; opacity: 0; transition: opacity 140ms; }
.content :is(h2, h3):hover a.anchor, .content a.anchor:focus { opacity: 1; }
.content p, .content ul, .content ol { margin: 14px 0 0; }
.content ul, .content ol { padding-left: 22px; }
.content li + li { margin-top: 6px; }
.content li::marker { color: var(--muted); }
.content a:not(.card):not(.anchor):not(.pill) { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; }
.content a:not(.card):not(.anchor):not(.pill):hover { text-decoration-color: #fff; }
.content strong { font-weight: 500; color: #fff; }
.sec { color: var(--muted); }
.small { font-size: 14px; }
code { font-family: var(--mono); font-size: .88em; padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow-wrap: anywhere; }

/* code blocks */
.code { position: relative; margin: 18px 0 0; }
.code pre { margin: 0; padding: 40px 18px 16px; overflow-x: auto; background: var(--tile); border-radius: 8px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; color: #e6e8e9; }
.code pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; }
.code .copy { position: absolute; top: 8px; right: 8px; height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .08); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; opacity: .8; transition: opacity 140ms, background-color 140ms; }
.code .copy:hover { opacity: 1; background: rgba(255, 255, 255, .14); }
.code .copy.done { color: var(--moss); }
.code .lang { position: absolute; top: 14px; left: 18px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; pointer-events: none; }

/* tables */
.table { margin: 18px 0 0; overflow-x: auto; background: var(--tile); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; }
thead th { font-weight: 500; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr + tr td, tbody tr + tr th { border-top: 1px solid var(--line); }
tbody th { font-weight: 500; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td, tfoot th { border-top: 1px solid var(--line-2); font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }

/* status chips */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.st.ok { color: var(--moss); }
.st.part { color: var(--larch); }
.st.no { color: var(--rose); }
.st.info { color: var(--glacier); }

/* callouts */
.note { margin: 20px 0 0; padding: 14px 16px; background: var(--tile); border-radius: 8px; box-shadow: inset 2px 0 0 var(--glacier); font-size: 15px; color: var(--ink-2); }
.note.warn { box-shadow: inset 2px 0 0 var(--larch); }
.note.example { box-shadow: inset 2px 0 0 var(--muted); }
.note > :first-child { margin-top: 0; }
.note strong:first-child { color: #fff; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 32px 0 0; }
.card { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 170px; padding: 20px; border-radius: 6px; background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%), var(--tile); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); text-decoration: none; transition: background-color 200ms var(--ease), transform 200ms var(--ease); }
.card:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 45%), #161a1b; transform: translateY(-2px); }
.card .k { font-size: 13px; color: var(--muted); }
.card h3 { margin: 0; font-family: var(--sans); font-size: 16px; font-weight: 500; }
.card p { margin: 6px 0 0; font-size: 15px; line-height: 1.4; color: var(--muted); }
.card .arrow { position: absolute; top: 20px; right: 20px; width: 14px; height: 14px; color: var(--muted); transition: transform 200ms var(--ease), color 200ms; }
.card:hover .arrow { transform: translateX(3px); color: #fff; }

/* steps */
ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps > li { position: relative; counter-increment: step; padding: 18px 20px 18px 64px; background: var(--tile); border-radius: 8px; }
ol.steps > li + li { margin-top: 10px; }
ol.steps > li::before { content: counter(step); position: absolute; left: 20px; top: 18px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #0a0c0d; font-size: 14px; font-weight: 500; }
ol.steps h3 { margin: 2px 0 0; font-size: 17px; }
ol.steps p { margin: 6px 0 0; color: var(--ink-2); }

/* definition lists (glossary) */
dl.terms { margin: 18px 0 0; }
dl.terms dt { margin-top: 22px; font-weight: 500; color: #fff; }
dl.terms dd { margin: 4px 0 0; color: var(--ink-2); }

/* FAQ */
details.q { background: var(--tile); border-radius: 8px; }
details.q + details.q { margin-top: 8px; }
details.q summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; cursor: pointer; list-style: none; font-weight: 500; }
details.q summary::-webkit-details-marker { display: none; }
details.q summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--muted); transition: transform 200ms var(--ease); }
details.q[open] summary::after { transform: rotate(45deg); }
details.q .a { padding: 0 18px 16px; color: var(--ink-2); }
details.q .a > :first-child { margin-top: 0; }

/* formula */
.formula { margin: 18px 0 0; padding: 16px 18px; background: var(--tile); border-radius: 8px; font-family: var(--mono); font-size: 14px; overflow-x: auto; white-space: nowrap; }

/* prev / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 72px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.pager a { display: block; padding: 16px 18px; border-radius: 8px; background: var(--tile); text-decoration: none; transition: background-color 160ms; }
.pager a:hover { background: #161a1b; }
.pager span { display: block; font-size: 13px; color: var(--muted); }
.pager b { display: block; margin-top: 2px; font-weight: 500; }
.pager .next { grid-column: 2; text-align: right; }
.foot { margin-top: 40px; font-size: 13px; color: var(--muted); }

/* 404 */
.lost { padding-top: 40px; }
.lost .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.ghost { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: 14px; text-decoration: none; }
.ghost:hover { background: rgba(255, 255, 255, .14); }

.scrim { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 232px minmax(0, 1fr) 190px; }
  .main { padding: 40px 28px 72px; }
}
@media (max-width: 900px) {
  .layout { display: block; }
  .toc { display: none; }
  .menu-btn { display: inline-flex; }
  .brand .tag { display: none; }
  .search { margin-left: 4px; }
  .sidebar { position: fixed; z-index: 25; top: var(--top); left: 0; bottom: 0; height: auto; width: min(300px, 86vw); padding: 24px 16px 40px; background: #0d1011; box-shadow: 1px 0 0 var(--line); transform: translateX(-102%); visibility: hidden; transition: transform 240ms var(--ease), visibility 0s linear 240ms; }
  .nav-open .sidebar { transform: none; visibility: visible; transition: transform 240ms var(--ease); }
  .scrim { display: block; position: fixed; z-index: 24; inset: var(--top) 0 0 0; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity 240ms var(--ease); }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .nav-open { overflow: hidden; }
  .main { padding: 32px 20px 64px; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; gap: 26px; }
}
@media (max-width: 600px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .top-links { display: none; }
  .drawer-links { display: grid; gap: 8px; margin-top: 28px; padding: 0 10px; }
  .drawer-links .ghost { justify-content: center; }
  .content h1 { font-size: 30px; }
  .lede { font-size: 17px; }
  .content h2 { font-size: 23px; margin-top: 44px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  th, td { padding: 9px 11px; }
  ol.steps > li { padding: 16px 16px 16px 56px; }
  ol.steps > li::before { left: 16px; top: 16px; }
}
@media (max-width: 380px) {
  .brand b { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* introduction: the story, the crashes, the product */
.content.intro { max-width: 900px; }
.intro .hero-h { font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -.04em; }
.intro .lede { font-size: 20px; max-width: 680px; }
.film { margin: 28px 0 0; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 0 0 1px var(--line); }
.film video { display: block; width: 100%; height: auto; }
.crash { margin: 22px 0 0; padding: 22px 22px 14px; border-radius: 12px; background: var(--tile); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.crash .when { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.crash h3 { margin: 6px 0 0 !important; font-size: 22px !important; }
.crash .stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 16px 0 6px; }
.crash .stat b { display: block; font-family: var(--head); font-weight: 500; font-size: 34px; line-height: 1; letter-spacing: -.03em; color: var(--larch); }
.crash .stat span { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
.crash svg, .crash img.chart { display: block; width: 100%; height: auto; margin-top: 8px; }
.crash .src { margin: 8px 0 0 !important; font-size: 13px; color: var(--muted); }
.shot { margin: 22px 0 0; border-radius: 12px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 0 0 1px var(--line); }
.shot img { display: block; width: 100%; height: auto; }
.cap { margin: 10px 0 0 !important; font-size: 14px; color: var(--muted); }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 10px; margin: 24px 0 0; }
.flow .node { padding: 18px; border-radius: 12px; background: var(--tile); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.flow .node .k { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.flow .node h4 { margin: 6px 0 0; font-family: var(--head); font-weight: 500; font-size: 20px; letter-spacing: -.01em; }
.flow .node p { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.flow .node.mid { box-shadow: inset 0 0 0 1px rgba(169, 203, 216, .35); }
.flow .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.flow .chips span { padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: 12px; color: var(--ink-2); }
.flow .arr { display: flex; align-items: center; color: var(--muted); }
.flow .arr svg { width: 22px; height: 22px; }
@media (max-width: 900px) { .flow { grid-template-columns: 1fr; } .flow .arr { justify-content: center; transform: rotate(90deg); } }
@media (max-width: 640px) { .crash { padding: 18px 16px 12px; } .crash .stats { gap: 8px 18px; } .crash .stat b { font-size: 24px; } .crash .stat span { font-size: 12px; } .intro .lede { font-size: 18px; } }
