:root {
  color-scheme: light;
  --paper: #ffffff;
  --panel: #ffffff;
  --paper-deep: #ecece7;
  --ink: #26251e;
  --muted: #6f6e67;
  --faint: #96958e;
  --line: #deded8;
  --line-soft: #e9e9e4;
  --accent: #e6532f;
  --accent-soft: #fff0ea;
  --code: #24241f;
  --header-height: 50px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header-brand { display: flex; align-items: center; gap: 11px; }
.header-brand > span { width: 1px; height: 16px; background: var(--line); }
.brand { font-size: 17px; font-weight: 740; letter-spacing: -.04em; text-decoration: none; }
.docs-label { color: var(--muted); font-size: 13px; text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.site-nav a { padding: 7px 10px; color: var(--muted); border-radius: 5px; text-decoration: none; }
.site-nav a:hover { color: var(--ink); background: var(--paper-deep); }
.site-nav .header-source { color: var(--ink); border: 1px solid var(--line); background: var(--panel); }
.language-menu { position: relative; }
.language-menu summary {
  min-width: 48px;
  padding: 7px 23px 7px 9px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  list-style: none;
}
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 9px;
  width: 5px;
  height: 5px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .15s ease;
}
.language-menu[open] summary::after { transform: translateY(-25%) rotate(225deg); }
.language-menu summary:hover { background: var(--paper-deep); }
.language-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 168px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 12px 32px rgba(38, 37, 30, .12);
}
.language-options a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  color: var(--muted);
  border-radius: 4px;
  text-decoration: none;
}
.language-options a:hover { color: var(--ink); background: var(--paper-deep); }
.language-options a.active { color: var(--ink); background: #f4f4f0; font-weight: 650; }
.language-options small { color: var(--faint); font-size: 9px; font-weight: 500; }

.docs-layout { min-height: 100vh; padding-top: var(--header-height); }
.mobile-doc-nav { display: none; }

.docs-main { min-width: 0; }
.article-grid {
  width: min(100%, 984px);
  margin: 0 auto;
  padding: 31px 32px 80px;
  display: grid;
  grid-template-columns: minmax(0, 640px) 232px;
  gap: 48px;
  align-items: start;
}
.article-body { min-width: 0; font-size: 15px; line-height: 1.72; }
.breadcrumb { display: flex; gap: 8px; margin: 0 0 35px; color: var(--faint); font-size: 12px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.article-hero { margin: 0 0 44px; padding-bottom: 34px; }
.eyebrow { margin: 0 0 13px; color: var(--accent); font-size: 10px; font-weight: 740; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3 { color: var(--ink); font-family: inherit; }
h1 { margin: 0; max-width: 590px; font-size: clamp(36px, 4vw, 46px); font-weight: 690; line-height: 1.08; letter-spacing: -.045em; }
.dek { max-width: 610px; margin: 18px 0 0; color: #5b5a54; font-size: 16px; line-height: 1.62; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; color: var(--faint); font-size: 11px; }
.hero-meta span { position: relative; }
.hero-meta span + span::before { content: "·"; position: absolute; left: -11px; color: #b5b4ad; }
.hero-meta strong { color: var(--muted); font-weight: 650; }
.article-body > p { color: #44433e; }
.article-body > p:first-of-type { font-size: 16px; line-height: 1.7; }
.article-body h2 { margin: 58px 0 17px; padding-top: 10px; font-size: 25px; font-weight: 680; line-height: 1.25; letter-spacing: -.025em; }
.article-body h2::before { content: "#"; display: inline-block; width: 0; margin-left: -18px; color: transparent; font-weight: 500; transition: color .15s ease; }
.article-body h2:hover::before { color: #b9b8b1; }
.article-body h3 { margin: 36px 0 12px; font-size: 18px; font-weight: 680; line-height: 1.35; letter-spacing: -.015em; }
.article-body p { margin: 0 0 19px; }
.article-body ul, .article-body ol { margin: 0 0 24px; padding-left: 1.35em; }
.article-body li { margin: 7px 0; }

.summary { margin: 0 0 32px; padding: 18px 20px; color: #808080; background: #fafafa; border: 1px solid #ededed; border-radius: 7px; }
.summary p { margin: 0; color: inherit; font-size: 14px; line-height: 1.68; }
.summary code { background: rgba(255,255,255,.55); }
.comparison { width: 100%; margin: 23px 0 32px; border: 1px solid var(--line); border-collapse: separate; border-spacing: 0; border-radius: 7px; overflow: hidden; font-size: 12px; line-height: 1.5; }
.comparison th, .comparison td { padding: 12px 13px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; vertical-align: top; }
.comparison tr:last-child td { border-bottom: 0; }
.comparison th:last-child, .comparison td:last-child { border-right: 0; }
.comparison th { background: var(--paper-deep); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.repo-card { margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.repo-card h3 { margin: 0 0 11px; font-size: 16px; }
.repo-card p:last-of-type { margin-bottom: 16px; }
.pill { display: inline-block; margin: 0 5px 5px 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--paper); font: 620 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.catalog { margin: 26px 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.catalog details { background: var(--panel); border-bottom: 1px solid var(--line); }
.catalog details:last-child { border-bottom: 0; }
.catalog summary { display: flex; justify-content: space-between; gap: 20px; padding: 14px 16px; cursor: pointer; font-size: 13px; font-weight: 680; }
.catalog details[open] summary { background: var(--paper-deep); }
.catalog summary span { color: var(--faint); font-size: 11px; font-weight: 500; }
.skill-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; margin: 0; padding: 15px 16px 17px; list-style: none; }
.skill-list li { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.skill-list a { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; }
pre { margin: 20px 0 26px; padding: 17px 18px; overflow-x: auto; overscroll-behavior-inline: contain; background: var(--code); color: #f5f2e9; border: 1px solid #171713; border-radius: 7px; scrollbar-color: #5b5b56 transparent; scrollbar-width: thin; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
pre::-webkit-scrollbar { height: 8px; }
pre::-webkit-scrollbar-track { background: transparent; }
pre::-webkit-scrollbar-thumb { min-width: 36px; background: #5b5b56; border: 2px solid var(--code); border-radius: 999px; }
pre::-webkit-scrollbar-thumb:hover { background: #777770; }
code { padding: .12em .32em; background: var(--paper-deep); border-radius: 3px; font: .84em/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
pre code { padding: 0; background: transparent; font-size: inherit; }
.callout { margin: 25px 0; padding: 17px 19px; border-left: 3px solid var(--accent); background: #fff3ee; border-radius: 0 6px 6px 0; }
.callout p:last-child { margin-bottom: 0; }
.steps { counter-reset: steps; padding: 0 !important; list-style: none; }
.steps li { position: relative; min-height: 32px; margin: 0; padding: 0 0 21px 44px; }
.steps li::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 1px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li::before { counter-increment: steps; content: counter(steps); position: absolute; left: 0; top: 0; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--muted); font: 700 10px/1 ui-monospace, monospace; }
.faq { margin-bottom: 62px; border-top: 1px solid var(--line); }
.faq details { padding: 15px 0; border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-size: 14px; font-weight: 650; }
.faq details p { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.sources { padding: 18px 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.sources p { margin: 0; }

.toc { position: sticky; top: 78px; align-self: start; padding-left: 2px; }
.toc > p { margin: 0 0 11px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.toc ol { margin: 0; padding: 0 0 18px; border-bottom: 1px solid var(--line-soft); list-style: none; }
.toc li { margin: 0; }
.toc a { display: block; padding: 4px 0; color: var(--muted); font-size: 11px; line-height: 1.45; text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc-actions { padding-top: 15px; }
.toc-actions a { color: var(--faint); }

.site-footer { width: min(100% - 64px, 920px); margin: 0 auto; padding: 24px 0 38px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--faint); font-size: 10px; }
.site-footer a { color: var(--muted); text-decoration: none; }

.blog-index { width: min(calc(100% - 40px), 900px); margin: 0 auto; padding: 125px 0 140px; }
.blog-index .eyebrow { margin-bottom: 18px; }
.blog-index h1 { font-size: clamp(48px, 9vw, 88px); }
.post-card { display: grid; grid-template-columns: 1fr auto; gap: 40px; margin-top: 64px; padding: 28px 0; border-top: 1px solid var(--line); text-decoration: none; }
.post-card h2 { margin: 0 0 12px; font-size: clamp(24px, 4vw, 38px); line-height: 1.16; letter-spacing: -.03em; }
.post-card p { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.65; }
.post-card time { color: var(--faint); font-size: 11px; }

@media (max-width: 1080px) {
  .article-grid { grid-template-columns: minmax(0, 640px); justify-content: center; }
  .toc { display: none; }
}
@media (max-width: 760px) {
  :root { --header-height: 50px; }
  .site-nav a:first-child { display: none; }
  .mobile-doc-nav { display: block; position: sticky; top: var(--header-height); z-index: 20; margin-top: var(--header-height); background: var(--paper); border-bottom: 1px solid var(--line); }
  .mobile-doc-nav summary { display: flex; justify-content: space-between; padding: 12px 18px; cursor: pointer; font-size: 12px; font-weight: 650; list-style: none; }
  .mobile-doc-nav summary::-webkit-details-marker { display: none; }
  .mobile-doc-nav summary span { color: var(--faint); font-size: 10px; font-weight: 500; }
  .mobile-doc-nav nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 0 14px 13px; }
  .mobile-doc-nav a { padding: 8px; color: var(--muted); border: 1px solid var(--line-soft); border-radius: 4px; font-size: 11px; text-decoration: none; }
  .docs-layout { padding-top: 0; }
  .article-grid { display: block; width: 100%; padding: 25px 20px 62px; }
  .breadcrumb { margin-bottom: 26px; }
  .article-hero { margin-bottom: 32px; padding-bottom: 26px; }
  h1 { font-size: 36px; }
  .article-body h2 { margin-top: 48px; font-size: 23px; }
  .article-body h2::before { display: none; }
  .comparison { display: block; overflow-x: auto; white-space: nowrap; }
  .skill-list { grid-template-columns: 1fr; }
  .site-footer { width: calc(100% - 40px); }
}
@media (max-width: 520px) {
  .docs-label { display: none; }
  .header-brand > span { display: none; }
  .dek { font-size: 15px; }
  .hero-meta { display: grid; gap: 5px; }
  .hero-meta span + span::before { display: none; }
  .summary, .repo-card { padding: 17px; }
  .post-card { grid-template-columns: 1fr; gap: 14px; }
  .site-footer { display: block; }
  .site-footer span { display: block; margin-top: 7px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
