:root {
  --ink: #171611;
  --ink-2: #4d4a42;
  --muted: #7c786e;
  --line: #e4dfd4;
  --bg: #fbf9f4;
  --paper: #fff;
  --soft: #f2eee5;
  --accent: #f0512b;
  --accent-dark: #c83d1d;
  --accent-soft: #fde8e1;
  --forest: #0f2b23;
  --max: 1240px;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 16px/1.65 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
svg { display: block; }
.shell { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.skip { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 9px 14px; border-radius: 8px; background: var(--ink); color: #fff; transform: translateY(-150%); }
.skip:focus { transform: none; }

.topbar { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(228,223,212,.9); background: rgba(251,249,244,.9); backdrop-filter: blur(16px) saturate(150%); }
.topbar .shell { height: 72px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font: 800 23px/1 var(--display); letter-spacing: -.035em; }
.brand-mark { width: 17px; height: 20px; }
.brand-divider { width: 1px; height: 24px; background: var(--line); }
.docs-label { font: 600 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top-link { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.top-link:hover { color: var(--accent-dark); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 17px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; transition: .16s ease; }
.button:hover { background: var(--accent); border-color: var(--accent); }
.button.secondary { background: transparent; color: var(--ink); }
.button.secondary:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.menu-button { display: none; margin-left: auto; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); place-items: center; cursor: pointer; }

.hero { position: relative; z-index: 2; padding: 76px 0 54px; border-bottom: 1px solid var(--line); overflow: visible; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 72px; align-items: center; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 18px; color: var(--accent-dark); font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--accent); }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.03em; }
h1 { font-family: var(--display); max-width: 760px; margin: 0; font-size: clamp(44px, 6vw, 72px); font-weight: 800; }
h2, h3 { font-family: var(--body); letter-spacing: -.02em; }
.hero-copy { max-width: 680px; margin: 22px 0 0; font-size: 19px; color: var(--ink-2); }
.search { position: relative; display: block; margin-top: 44px; max-width: 640px; }
.search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 58px; padding: 0 52px; border: 1px solid var(--line); border-radius: 14px; outline: 0; background: var(--paper); color: var(--ink); box-shadow: 0 12px 35px rgba(20,19,15,.06); font-size: 16px; }
.search input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(240,81,43,.13), 0 12px 35px rgba(20,19,15,.06); }
.search kbd { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); color: var(--muted); font: 600 11px/1.3 var(--mono); }
.search:focus-within kbd { display: none; }
.search-suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 9px); z-index: 20; overflow: hidden; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 18px 50px rgba(20,19,15,.14); }
.search-suggestions[hidden] { display: none; }
.search-result { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 9px; }
.search-result:hover, .search-result.is-active { background: var(--soft); }
.search-result-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-dark); }
.search-result-copy { min-width: 0; }
.search-result strong { display: block; overflow: hidden; color: var(--ink); font: 700 15px/1.3 var(--body); text-overflow: ellipsis; white-space: nowrap; }
.search-result small { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.search-result-arrow { color: var(--accent-dark); font-weight: 700; }
.search-empty { margin: 0; padding: 16px; color: var(--muted); text-align: center; font-size: 14px; }
.hero-art { position: relative; min-height: 290px; }
.art-card { position: absolute; border: 1px solid rgba(20,19,15,.14); border-radius: 18px; background: var(--paper); box-shadow: 0 20px 60px rgba(20,19,15,.11); }
.art-card.back { inset: 26px 25px 23px 30px; transform: rotate(5deg); background: var(--accent-soft); }
.art-card.front { inset: 8px 45px 42px 5px; padding: 24px; transform: rotate(-3deg); }
.art-dots { display: flex; gap: 5px; margin-bottom: 28px; }
.art-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.art-dots i:first-child { background: var(--accent); }
.art-line { height: 9px; margin: 10px 0; border-radius: 8px; background: var(--soft); }
.art-line.dark { width: 72%; height: 14px; background: var(--ink); }
.art-line.short { width: 58%; }
.art-play { position: absolute; right: 30px; bottom: 24px; width: 55px; height: 55px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; }

.docs-home { position: relative; z-index: 1; padding: 62px 0 100px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.section-heading h2 { margin: 0; font-size: 30px; }
.section-heading p { margin: 0; color: var(--muted); }
.article-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.article-card { grid-column: span 2; min-height: 245px; display: flex; flex-direction: column; padding: 25px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.article-card:nth-child(4), .article-card:nth-child(5) { grid-column: span 3; }
.article-card:hover { transform: translateY(-3px); border-color: #cfc8ba; box-shadow: 0 16px 40px rgba(20,19,15,.08); }
.card-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 38px; border-radius: 12px; background: var(--soft); color: var(--ink); }
.article-card:nth-child(2) .card-icon, .article-card:nth-child(5) .card-icon { background: var(--accent-soft); color: var(--accent-dark); }
.article-card:nth-child(3) .card-icon { background: #e1ece3; color: var(--forest); }
.card-meta { margin: 0 0 8px; color: var(--muted); font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.article-card h3 { margin: 0; font-size: 23px; }
.article-card p { margin: 10px 0 20px; color: var(--ink-2); line-height: 1.55; }
.card-link { margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: var(--accent-dark); font-weight: 700; font-size: 14px; }
.card-link span { transition: transform .15s; }
.article-card:hover .card-link span { transform: translateX(4px); }
.support { margin-top: 46px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 30px 34px; border-radius: 18px; color: #fff; background: var(--forest); background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.028) 0 2px, transparent 2px 13px); }
.support h2 { margin: 0 0 7px; font-size: 25px; }
.support p { margin: 0; color: rgba(255,255,255,.72); }
.support .button { background: #fff; border-color: #fff; color: var(--forest); flex: none; }
.support .button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.doc-layout { display: grid; grid-template-columns: 248px minmax(0, 760px) 180px; gap: 54px; align-items: start; padding-top: 54px; padding-bottom: 100px; }
.side-nav, .toc { position: sticky; top: 105px; }
.side-nav-title, .toc-title { margin: 0 0 12px; color: var(--muted); font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .09em; }
.side-nav ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.side-nav a { display: block; margin: 2px 0; padding: 9px 11px; border-radius: 8px; color: var(--ink-2); font-size: 14px; line-height: 1.35; }
.side-nav a:hover { background: var(--soft); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.side-nav-back { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 0 23px !important; padding-left: 0 !important; color: var(--accent-dark) !important; font-weight: 700; }
.side-nav-back:hover { background: transparent !important; }
.toc a { display: block; padding: 6px 0 6px 13px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.4; }
.toc a:hover, .toc a.active { border-left-color: var(--accent); color: var(--ink); }
.article-head { padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.crumbs { display: flex; gap: 8px; align-items: center; margin-bottom: 22px; color: var(--muted); font-size: 13px; }
.crumbs a:hover { color: var(--accent-dark); }
.article-head h1 { font-size: clamp(38px, 5vw, 55px); }
.article-head .lede { max-width: 650px; margin: 18px 0 14px; color: var(--ink-2); font-size: 19px; line-height: 1.55; }
.read-time { color: var(--muted); font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.article-body { padding-top: 14px; }
.article-body section { padding-top: 34px; scroll-margin-top: 90px; }
.article-body h2 { margin: 0 0 14px; font-size: 29px; }
.article-body h3 { margin: 27px 0 10px; font-size: 20px; }
.article-body p { margin: 0 0 15px; color: var(--ink-2); }
.article-body ul, .article-body ol { margin: 12px 0 20px; padding-left: 23px; color: var(--ink-2); }
.article-body li { margin: 8px 0; padding-left: 4px; }
.article-body strong { color: var(--ink); }
.steps { list-style: none !important; padding: 0 !important; counter-reset: steps; }
.steps > li { position: relative; min-height: 52px; padding: 0 0 25px 54px; counter-increment: steps; }
.steps > li::before { content: counter(steps); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font: 700 13px/1 var(--mono); }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 37px; bottom: -1px; width: 1px; background: var(--line); }
.note { margin: 24px 0; padding: 18px 20px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--accent-soft); color: var(--ink-2); }
.note strong { display: block; margin-bottom: 3px; color: var(--accent-dark); }
.code { overflow-x: auto; margin: 20px 0; padding: 17px 19px; border-radius: 12px; background: #211f1b; color: #f8f2e7; font: 13px/1.65 var(--mono); }
.article-next { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.article-next a { display: flex; justify-content: space-between; gap: 24px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.article-next small { display: block; margin-bottom: 4px; color: var(--muted); font: 600 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.article-next strong { font-family: var(--body); font-size: 18px; }

footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 13px; }
footer .shell { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer nav { display: flex; gap: 20px; }
footer a:hover { color: var(--accent-dark); }

@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr 290px; gap: 38px; }
  .doc-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 42px; }
  .toc { display: none; }
}
@media (max-width: 780px) {
  .shell { padding: 0 20px; }
  .top-actions { display: none; }
  .menu-button { display: grid; }
  body.menu-open .top-actions { display: grid; position: fixed; inset: 72px 0 auto; padding: 18px 20px 22px; border-bottom: 1px solid var(--line); background: var(--bg); }
  body.menu-open .top-actions .button, body.menu-open .top-actions .top-link { width: 100%; text-align: center; }
  .hero { padding: 54px 0 45px; }
  .hero-grid { display: block; }
  .hero-art { display: none; }
  .article-grid { grid-template-columns: 1fr; }
  .article-card, .article-card:nth-child(4), .article-card:nth-child(5) { grid-column: auto; min-height: 220px; }
  .support { align-items: flex-start; flex-direction: column; }
  .doc-layout { display: block; padding-top: 34px; }
  .side-nav { position: static; margin-bottom: 35px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
  .side-nav-title { display: none; }
  .side-nav ul { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .side-nav li { flex: none; }
  .side-nav a { border: 1px solid var(--line); background: var(--paper); white-space: nowrap; }
  .side-nav-back { border: 0 !important; background: transparent !important; }
}
@media (max-width: 480px) {
  .brand-divider, .docs-label { display: none; }
  h1 { font-size: 40px; }
  .search kbd { display: none; }
  .search input { padding-right: 18px; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 8px; }
  .article-head h1 { font-size: 36px; }
  footer .shell { display: block; }
  footer nav { margin-top: 12px; flex-wrap: wrap; }
}

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