:root {
  --paper: #F6F5F1;
  --surface: #FFFFFF;
  --ink: #0E1512;
  --ink-2: #45504A;
  --ink-3: #6B7570;
  --rule: #DDDCD4;
  --accent: #0F6B4A;
  --font-display: 'Newsreader', Georgia, serif;
  --font-body: 'Geist', system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --gutter: clamp(1rem, 5vw, 6rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { font-family: var(--font-body); background: var(--paper); color: var(--ink); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #0B5A3D; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { display: block; max-width: 100%; }

.site-header { position: sticky; top: 0; z-index: 10; background: rgba(246,245,241,0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); }
.site-header .wrap { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.brand img { height: 36px; width: auto; }
.brand span { font-size: 0.9rem; font-weight: 600; letter-spacing: 0.14em; white-space: nowrap; }
.brand span b { color: var(--accent); font-weight: 600; }
.lang { display: flex; gap: 6px; font-family: var(--font-mono); font-size: 0.8rem; }
.lang a { padding: 8px 12px; min-height: 36px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-2); text-decoration: none; }
.lang a:hover { border-color: var(--ink); color: var(--ink); }
@media (max-width: 480px) { .brand span { display: none; } }

main { padding: clamp(3rem, 2rem + 4vw, 6rem) 0 clamp(4rem, 3rem + 4vw, 7rem); }
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.toc { position: sticky; top: 104px; font-size: 0.875rem; }
.toc p { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.75rem; }
.toc ol { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--ink); }
@media (max-width: 860px) { .doc { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

.eyebrow { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.4rem, 1.6rem + 3vw, 3.75rem); line-height: 1.05; letter-spacing: -0.02em; margin: 0.75rem 0 1rem; }
.meta { color: var(--ink-3); font-size: 0.9rem; }
.summary { margin: 2rem 0 1rem; padding: 1.5rem 1.75rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; }
.summary strong { display: block; margin-bottom: 0.5rem; }
.summary ul { padding-left: 1.1rem; color: var(--ink-2); }

article section { padding: 2rem 0; border-top: 1px solid var(--rule); }
article section:first-of-type { margin-top: 2rem; }
h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 0.9rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 0.4rem; }
article p, article li { color: var(--ink-2); max-width: 68ch; }
article p + p, article ul + p, article ol + p, article .table-wrap + p { margin-top: 0.75rem; }
article ul, article ol { padding-left: 1.2rem; margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.35rem; }
article strong { color: var(--ink); font-weight: 600; }

.table-wrap { overflow-x: auto; margin-top: 0.75rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; background: var(--surface); }
td { color: var(--ink-2); }

.steps { counter-reset: s; list-style: none; padding-left: 0 !important; }
.steps li { counter-increment: s; position: relative; padding-left: 2.75rem; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 0.85rem; font-weight: 600; }
.code { font-family: var(--font-mono); font-size: 0.9rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 0.1rem 0.45rem; color: var(--ink); }

.lang-divider { margin: 4rem 0 0; padding-top: 3rem; border-top: 2px solid var(--ink); }

.site-footer { border-top: 1px solid var(--rule); padding: 2rem 0; font-size: 0.875rem; color: var(--ink-3); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
