:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --bg-hero: linear-gradient(180deg, #fff2ea 0%, #fff7f3 38%, #ffffff 78%);
  --text: #1a1a1a;
  --muted: #5e5e5e;
  --faint: #8a8a8a;
  --line: #ececec;
  --line-strong: #e4e4e7;
  --card: #ffffff;
  --orange: #ff552a;
  --link: #f04b16;
  --code-bg: #f3f4f6;
  --code-kw: #c4550a;
  --code-str: #d6336c;
  --code-cmt: #8b909a;
  --shadow: 0 16px 50px rgba(20, 16, 12, 0.12);
  --nav-h: 64px;
  --banner-h: 30px;
  --offset: 94px;
  --sidebar: 268px;
  --max: 1180px;
  --serif: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --admon-bg: #f8fbff;
  --admon-border: #c9ddfb;
  --active-nav: #f2f2f3;
  --hero-code-bg: #fff8f4;
  --hero-code-border: #f3c7ad;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #161616;
  --bg-soft: #222224;
  --bg-hero: linear-gradient(180deg, #2a1812 0%, #1c1412 40%, #161616 80%);
  --text: #f4f4f5;
  --muted: #c4c4c8;
  --faint: #9b9ba1;
  --line: #2e2e32;
  --line-strong: #3a3a3e;
  --card: #1e1e20;
  --link: #ff7a4d;
  --code-bg: #2a2a2e;
  --code-kw: #ff9a62;
  --code-str: #ff8ab3;
  --code-cmt: #9aa0aa;
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
  --admon-bg: #1a2433;
  --admon-border: #35527a;
  --active-nav: #2c2c30;
  --hero-code-bg: #241915;
  --hero-code-border: #6a3d2a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--serif);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}
body.banner-hidden { --offset: var(--nav-h); --banner-h: 0px; }
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
img { max-width: 100%; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--orange);
  color: white;
  padding: 8px 12px;
  z-index: 100;
}
.skip:focus { top: 8px; }

.banner {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--banner-h);
  background: var(--orange);
  color: white;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 14.5px;
}
body.banner-hidden .banner { display: none; }
.banner a { color: white; }
.banner a:hover { text-decoration: underline; }
.banner-close {
  position: absolute;
  right: 10px;
  top: 2px;
  border: 0;
  background: transparent;
  color: white;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  width: 26px;
  height: 26px;
}

.navbar {
  position: fixed;
  top: var(--banner-h);
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 40;
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 2px;
  font-weight: 750;
  font-size: 26px;
  letter-spacing: -0.045em;
  margin-right: 18px;
  color: var(--text);
}
.brand .flame { width: 22px; height: 22px; flex: none; }
.brand svg, .flame { display: block; }
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-links a {
  padding: 8px 12px;
  color: var(--text);
  font-size: 15.5px;
}
.nav-links a.active { text-decoration: underline; text-underline-offset: 8px; }
.nav-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn, .version-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn:hover, .version-btn:hover { background: var(--bg-soft); }
.version-btn { width: auto; padding: 0 8px; font-size: 14.5px; gap: 4px; display: flex; align-items: center; }
.version-wrap { position: relative; }
.version-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 140px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
}
.version-wrap.open .version-menu { display: block; }
.version-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
}
.version-menu a:hover, .version-menu a.active { background: var(--active-nav); }
.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: var(--bg-soft);
  color: var(--muted);
  border-radius: 10px;
  height: 36px;
  padding: 0 8px 0 10px;
  cursor: pointer;
}
.search-btn span { font-size: 14px; }
kbd {
  font-family: var(--serif);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12px;
  color: var(--muted);
}
.menu-toggle { display: none; }
html[data-theme="light"] .icon-sun,
html[data-theme="dark"] .icon-moon { display: none; }
.sidebar a.child { padding-left: 22px; }

.page { padding-top: var(--offset); }

.hero {
  background: var(--bg-hero);
  padding: 54px 0 20px;
}
.wrap { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.72fr);
  gap: 48px;
  align-items: end;
}
.display {
  font-size: clamp(76px, 9vw, 112px);
  line-height: 0.9;
  letter-spacing: -0.055em;
  font-weight: 760;
  margin: 0 0 28px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.display .flame { width: 78px; height: 78px; }
.lede { font-size: 20px; font-weight: 560; margin: 0 0 16px; }
.hero p { font-size: 18px; max-width: 640px; margin: 0 0 16px; }
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 196px;
  height: 40px;
  padding: 0 22px;
  border-radius: 2px;
  color: white !important;
  background-image: linear-gradient(105deg, #fd2b01 5%, #ed810c 100%);
  margin: 8px 0 14px;
  font-size: 16px;
}
.cta:hover { filter: brightness(1.05); }
.meta { color: var(--faint) !important; font-size: 13.5px !important; }
.meta a { color: var(--faint); }
.meta a:hover { color: var(--link); }
.hero-links a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.hero-links a strong { display: block; font-size: 16px; font-weight: 680; }
.hero-links a span { color: var(--muted); font-size: 14.5px; }
.hero-links svg { margin-top: 3px; color: #8d8d8d; }

.section { padding: 72px 0; }
.section h2.center, h2.center {
  text-align: center;
  font-size: clamp(36px, 5vw, 52px);
  letter-spacing: -0.035em;
  margin: 0 0 36px;
  font-weight: 720;
}
.cards-3, .cards-2 {
  display: grid;
  gap: 18px;
}
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 22px 18px;
}
.card h3 { margin: 10px 0 8px; font-size: 20px; letter-spacing: -0.02em; }
.card p { margin: 0; color: var(--muted); }
.icon-orange { color: #f15a24; }

.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 42px;
  align-items: center;
  margin: 78px 0;
}
.split h2 { font-size: 40px; letter-spacing: -0.035em; margin: 8px 0 12px; }
.split p { color: var(--text); font-size: 18px; margin: 0; }
.split a { color: var(--link); }

.code-panel, pre, .code {
  font-family: var(--mono);
}
pre.code-panel {
  background: var(--hero-code-bg);
  border: 1px solid var(--hero-code-border);
  border-radius: 16px;
  padding: 22px 22px 18px;
  overflow: auto;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
}
.code-panel .kw { color: var(--code-kw); }
.code-panel .fn { color: var(--code-kw); }
.code-panel .cm { color: var(--code-cmt); }

.phases { display: grid; gap: 22px; max-width: 860px; margin: 0 auto; }
.phase {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.phase .kicker { font-size: 13px; letter-spacing: 0.08em; color: var(--faint); font-weight: 650; }
.badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--bg-soft);
}
.badge.done { color: #15803d; background: #e9f8ef; }
.badge.now { color: #c2410c; background: #fff1e8; }
html[data-theme="dark"] .badge.done { background: #143222; color: #86efac; }
html[data-theme="dark"] .badge.now { background: #3a2418; color: #fdba74; }
.phase h3 { margin: 0 0 6px; font-size: 20px; }
.phase p { margin: 0; color: var(--muted); }

.oss {
  max-width: 820px;
  margin: 10px auto 0;
  text-align: center;
  font-size: 18px;
}
.oss a { color: var(--link); }

.start-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 28px;
}
.start-grid h3 { margin: 0 0 8px; font-size: 14px; letter-spacing: 0.08em; color: var(--faint); font-weight: 700; }
.start-grid a { display: block; padding: 12px 0; border-top: 1px solid var(--line); }
.start-grid a strong { display: block; }
.start-grid a span { color: var(--muted); font-size: 14.5px; }

.footer {
  border-top: 1px solid var(--line);
  padding: 22px 24px 28px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.footer nav { display: flex; gap: 16px; color: var(--muted); }
.footer nav a:hover { color: var(--text); }
.footer-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.linkish {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14.5px;
}
.footer .cta { min-width: 0; height: 36px; margin: 0; }

.article {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 72px;
}
.article h1, .docs-main h1 {
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 8px 0 16px;
}
.version-pill {
  display: inline-block;
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 13px;
  color: var(--muted);
}
.article p, .docs-main p { font-size: 16.5px; }
.article a, .docs-main a, .prose a { color: var(--link); }
.article h2, .docs-main h2 { font-size: 30px; letter-spacing: -0.03em; margin: 36px 0 12px; }
.article h3, .docs-main h3 { font-size: 22px; margin: 28px 0 8px; }
.article ul, .docs-main ul { padding-left: 22px; }
.article li, .docs-main li { margin: 6px 0; }

.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 22px 0 18px; }
.tabs button {
  border: 0;
  background: transparent;
  padding: 8px 2px 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
}
.tabs button.active { color: var(--text); box-shadow: inset 0 -2px 0 #111; }
html[data-theme="dark"] .tabs button.active { box-shadow: inset 0 -2px 0 #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
ol.steps { padding-left: 22px; }
ol.steps li { margin: 14px 0 18px; }

pre {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 14px 16px;
  overflow: auto;
  position: relative;
  font-size: 14px;
  line-height: 1.55;
}
pre code { font-family: var(--mono); }
.tok-kw { color: var(--code-kw); }
.tok-str { color: var(--code-str); }
.tok-cm { color: var(--code-cmt); }
.tok-prompt { color: #9aa0a6; }
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  border-radius: 6px;
  width: 28px;
  height: 28px;
}
.copy:hover { background: rgba(0,0,0,0.05); color: var(--text); }

.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) 210px;
  min-height: calc(100vh - var(--offset));
}
.sidebar, .toc {
  position: sticky;
  top: var(--offset);
  height: calc(100vh - var(--offset));
  overflow: auto;
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 18px 10px 40px 16px;
}
.sidebar .manual-label {
  color: var(--faint);
  font-size: 14px;
  padding: 6px 10px 12px;
}
.side-cat { margin: 2px 0 8px; }
.side-cat > button, .side-cat > a.cat {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 720;
  font-size: 14.5px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.side-links { display: grid; padding: 0 0 6px; }
.side-links a, .sidebar a.leaf {
  display: block;
  padding: 6px 10px 6px 14px;
  border-radius: 8px;
  color: #3f3f46;
  font-size: 14.5px;
}
html[data-theme="dark"] .side-links a, html[data-theme="dark"] .sidebar a.leaf { color: #d4d4d8; }
.side-links a:hover, .sidebar a.leaf:hover { background: var(--bg-soft); }
.side-links a.active {
  background: var(--active-nav);
  color: var(--text);
  font-weight: 650;
}
.side-cat.collapsed .side-links { display: none; }
.chev { transition: transform 0.15s ease; color: var(--faint); font-size: 12px; }
.side-cat.collapsed .chev { transform: rotate(-90deg); }

.docs-main { padding: 22px 36px 80px; max-width: 920px; }
.crumbs { color: var(--faint); font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--faint); }
.crumbs a:hover { color: var(--link); }
.admonition {
  border: 1px solid var(--admon-border);
  background: var(--admon-bg);
  border-radius: 8px;
  padding: 14px 16px 14px 46px;
  position: relative;
  margin: 18px 0;
}
.admonition::before {
  content: "i";
  position: absolute;
  left: 16px;
  top: 16px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #60a5fa;
  color: #3b82f6;
  font-size: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.pager a { color: var(--text) !important; max-width: 46%; }
.pager .next { margin-left: auto; text-align: right; }
.pager small { color: var(--faint); display: block; }
.pager strong { font-size: 16px; }

.toc { padding: 26px 16px 40px 8px; font-size: 13.5px; }
.toc-tools { display: grid; gap: 8px; margin-bottom: 16px; }
.toc-tools button, .toc-tools a {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  font-size: 13.5px;
  padding: 0;
}
.toc a { display: block; color: var(--muted); padding: 5px 0 5px 10px; border-left: 1px solid var(--line); }
.toc a:hover { color: var(--text); }

.hub { width: min(1040px, calc(100% - 48px)); margin: 0 auto; padding: 36px 0 70px; }
.hub h1 { font-size: 52px; letter-spacing: -0.04em; margin-bottom: 8px; }
.eyebrow {
  letter-spacing: 0.08em;
  font-size: 13px;
  color: var(--faint);
  font-weight: 700;
  margin: 28px 0 12px;
}
.hub-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 18px 16px;
  min-height: 112px;
  color: var(--text) !important;
}
.hub-card:hover { border-color: #f0b8a4; }
.hub-card strong { display: block; margin-bottom: 4px; }
.hub-card span { color: var(--muted); font-size: 14.5px; }
.band {
  background: linear-gradient(90deg, #ff4d1c, #ff8a1e);
  color: white;
  padding: 54px 0 28px;
}
.band h2 { text-align: center; font-size: 42px; margin: 0 0 8px; }
.band-inner { width: min(1040px, calc(100% - 48px)); margin: 0 auto 28px; }
.shortcut-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 28px; color: var(--text); padding-top: 28px; }
.shortcut-grid h3 { margin-top: 0; }
.shortcut-grid a { color: var(--link); display: block; padding: 4px 0; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 650; }
tr:last-child td { border-bottom: 0; }
code, .inline {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
}
pre code { background: transparent; padding: 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0 28px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.stat b { display: block; font-size: 32px; letter-spacing: -0.04em; }
.event {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 12px 0;
  background: var(--card);
}
.event time { color: var(--faint); font-size: 14px; }
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.people span, .chip {
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 14px;
}

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.45);
  z-index: 80;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.modal-back.open { display: flex; }
.modal {
  width: min(640px, 100%);
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal header, .search-head {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.modal input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}
.results { max-height: 420px; overflow: auto; }
.results a { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.results a:hover, .results a.active { background: var(--bg-soft); }
.results small { color: var(--faint); display: block; }
.empty { padding: 20px 14px; color: var(--muted); }
.privacy { width: min(460px, 100%); padding: 8px 8px 16px; }
.privacy h3 { margin: 8px 14px; }
.privacy p { margin: 0 14px 12px; color: var(--muted); }

.checks { list-style: none; padding-left: 0; }
.checks li { padding: 4px 0; }

pre.code-panel {
  background: var(--hero-code-bg);
  border: 1px solid var(--hero-code-border);
  border-radius: 16px;
  padding: 22px 22px 18px;
}
@media (max-width: 1100px) {
  .docs-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
  .hero-grid, .cards-3, .start-grid, .shortcut-grid, .stats { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .menu-toggle { display: grid; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
  }
  .nav-links.open { display: flex; }
  .search-btn span, .search-btn kbd { display: none; }
  .hero-grid, .cards-3, .cards-2, .start-grid, .shortcut-grid, .stats { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; position: fixed; z-index: 30; background: var(--bg); width: min(320px, 88vw); }
  body.sidebar-open .sidebar { display: block; }
  .docs-main { padding: 18px 16px 64px; }
  .display { font-size: 68px; }
  .display .flame { width: 48px; height: 48px; }
  .wrap, .article, .hub { width: min(100% - 32px, 760px); }
  .footer-actions { margin-left: 0; }
}
