/* Timber docs — plain CSS, no build. Light + dark, left nav, right "on this page". */
:root {
    --bg: #ffffff; --bg-soft: #faf8f5; --fg: #2a1f16; --fg-2: #51463c; --muted: #7a6c5f; --line: #ece6de; --line-2: #e0d8cd;
    --accent: #c2410c; --accent-soft: #fdf0e7; --accent-fg: #fff; --code-bg: #1e1814; --code-fg: #f3e9dc; --inline-bg: #f4eee6;
    --ok: #2f6f4e; --warn: #b45309; --info: #1d6fa5;
    --topbar: 60px; --side: 284px; --toc: 224px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
    --bg: #15110d; --bg-soft: #1b1611; --fg: #f3ebe0; --fg-2: #cfc3b4; --muted: #9a8c7c; --line: #2a231b; --line-2: #382f25;
    --accent: #fb923c; --accent-soft: #2a1d12; --accent-fg: #1a0f05; --code-bg: #0e0b08; --code-fg: #f3e9dc; --inline-bg: #251e17;
    --ok: #5fc391; --warn: #f5b04c; --info: #6cb6e8;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 20px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.7; color: var(--fg); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; } a:hover { text-decoration-thickness: 2px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 200; } .skip:focus { top: 10px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 60; height: var(--topbar); display: flex; align-items: center; gap: 14px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 750; font-size: 18px; letter-spacing: -.02em; }
.brand em { font-style: normal; font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 99px; }
.search-btn { margin-left: auto; display: flex; align-items: center; gap: 10px; width: min(300px, 40vw); padding: 8px 12px; background: var(--bg-soft); border: 1px solid var(--line-2); border-radius: 10px; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.search-btn:hover { border-color: var(--accent); } .search-btn span { flex: 1; text-align: left; }
kbd { font: 600 11px var(--mono); padding: 2px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--bg); color: var(--fg-2); }
.top-links { display: flex; gap: 4px; } .top-links a { color: var(--fg-2); text-decoration: none; font-weight: 550; font-size: 14.5px; padding: 6px 12px; border-radius: 8px; } .top-links a:hover { background: var(--bg-soft); color: var(--accent); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; color: var(--fg-2); cursor: pointer; } .icon-btn:hover { background: var(--bg-soft); }
.menu-btn { display: none; }
.i-sun { display: none; } :root[data-theme="dark"] .i-sun { display: block; } :root[data-theme="dark"] .i-moon { display: none; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); max-width: 1500px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--topbar); align-self: start; height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 24px 12px 40px 20px; border-right: 1px solid var(--line); }
.nav-group { margin-bottom: 22px; }
.nav-title { margin: 0 0 6px 10px; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--fg-2); text-decoration: none; font-size: 14.5px; line-height: 1.4; }
.nav-group a:hover { background: var(--bg-soft); color: var(--fg); }
.nav-group a.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.main { display: grid; grid-template-columns: minmax(0, 1fr) var(--toc); gap: 40px; padding: 0 32px 0 56px; min-width: 0; }
.doc { min-width: 0; max-width: 780px; padding: 44px 0 40px; }
.toc { position: sticky; top: calc(var(--topbar) + 28px); align-self: start; max-height: calc(100vh - var(--topbar) - 56px); overflow-y: auto; padding: 4px 0; font-size: 13.5px; }
.toc p { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.toc a { display: block; padding: 3px 0 3px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.45; }
.toc li.l3 a { padding-left: 28px; } .toc a:hover { color: var(--fg); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

/* ---------- content ---------- */
.crumb { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.doc h1 { font-size: clamp(2rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -.03em; margin: 0 0 .6em; }
.doc h2 { font-size: 1.6rem; letter-spacing: -.02em; line-height: 1.25; margin: 2.2em 0 .6em; padding-top: 1.2em; border-top: 1px solid var(--line); }
.doc h1 + h2, .doc .hero + h2 { border-top: 0; padding-top: 0; margin-top: 1.4em; }
.doc h3 { font-size: 1.2rem; margin: 1.8em 0 .5em; letter-spacing: -.01em; } .doc h4 { font-size: 1rem; margin: 1.5em 0 .4em; }
.anchor { margin-left: .4em; color: var(--line-2); text-decoration: none; font-weight: 400; opacity: 0; transition: opacity .15s; } h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; color: var(--accent); }
.doc p, .doc li { color: var(--fg-2); } .doc p { margin: 0 0 1.1em; } .doc strong { color: var(--fg); }
.doc ul, .doc ol { padding-left: 1.4em; margin: 0 0 1.2em; } .doc li { margin: .3em 0; } .doc li > ul, .doc li > ol { margin: .3em 0 .3em; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.doc code { font: .88em var(--mono); background: var(--inline-bg); padding: .15em .4em; border-radius: 6px; color: var(--fg); }
.doc blockquote { margin: 1.4em 0; padding: .2em 1.2em; border-left: 3px solid var(--accent); background: var(--bg-soft); border-radius: 0 10px 10px 0; } .doc blockquote p { margin: .6em 0; }
.code { position: relative; margin: 1.3em 0; border-radius: 12px; background: var(--code-bg); border: 1px solid var(--line-2); }
.code[data-lang]::before { content: attr(data-lang); position: absolute; top: 9px; left: 14px; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #8d7e6e; }
.code[data-lang] pre { padding-top: 34px; }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; } .code code { background: none; padding: 0; border-radius: 0; color: var(--code-fg); font-size: 13.5px; line-height: 1.65; }
.copy { position: absolute; top: 7px; right: 8px; border: 1px solid #4a3d31; background: #2a221b; color: #d9ccbc; font: 600 11px var(--font); padding: 4px 10px; border-radius: 7px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.code:hover .copy, .copy:focus-visible { opacity: 1; } .copy:hover { background: #3a2f26; }
.table-wrap { overflow-x: auto; margin: 1.3em 0; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; } th, td { text-align: left; padding: 10px 14px; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--bg-soft); font-weight: 650; color: var(--fg); white-space: nowrap; } tr:last-child td { border-bottom: 0; } td code { white-space: nowrap; }
.callout { margin: 1.5em 0; padding: 14px 18px 4px; border-radius: 12px; border: 1px solid var(--line-2); border-left-width: 4px; background: var(--bg-soft); }
.callout-title { margin: 0 0 6px !important; font-weight: 700; font-size: 14px; color: var(--fg) !important; }
.callout-tip { border-left-color: var(--ok); } .callout-note { border-left-color: var(--accent); } .callout-warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 7%, var(--bg)); } .callout-info { border-left-color: var(--info); }
.callout p:last-child { margin-bottom: .8em; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 3.2em; }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--line-2); border-radius: 12px; text-decoration: none; color: var(--fg); transition: border-color .15s, transform .15s; } .pager a:hover { border-color: var(--accent); transform: translateY(-1px); }
.pager small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); } .pager span { font-weight: 650; color: var(--accent); }
.pager .next { text-align: right; grid-column: 2; }
.doc-foot { margin-top: 3em; padding-top: 1.4em; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }

/* ---------- home page ---------- */
.hero { padding: 24px 0 8px; }
.hero .tag { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 13px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 3.6rem); line-height: 1.04; letter-spacing: -.04em; margin: 0 0 .4em; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, #c2410c, #e08a2b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.2rem; color: var(--fg-2); max-width: 36em; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px; font-weight: 650; text-decoration: none; border: 1px solid var(--line-2); color: var(--fg) !important; background: var(--bg); transition: transform .15s, box-shadow .2s; } .btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(180deg, #e0561f, #c2410c); border-color: transparent; color: #fff !important; box-shadow: 0 8px 20px -8px rgba(194, 65, 12, .7), inset 0 1px 0 rgba(255, 255, 255, .3); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 1.6em 0; }
.card { display: block; padding: 18px 20px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg); text-decoration: none; color: inherit; transition: border-color .15s, transform .15s, box-shadow .2s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 30px -18px rgba(194, 65, 12, .5); }
.card b { display: block; color: var(--fg); margin-bottom: 4px; font-size: 1.02rem; } .card span { color: var(--muted); font-size: 14.5px; line-height: 1.5; display: block; }
.card .ic { font-size: 22px; display: block; margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line-2); border-radius: 14px; margin: 1.6em 0; overflow: hidden; }
.stats div { padding: 18px; border-right: 1px solid var(--line); text-align: center; } .stats div:last-child { border-right: 0; }
.stats strong { display: block; font-size: 1.8rem; letter-spacing: -.03em; color: var(--accent); line-height: 1.1; } .stats span { font-size: 13.5px; color: var(--muted); }
.steps { counter-reset: s; list-style: none; padding: 0 !important; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 58px; border: 1px solid var(--line-2); border-radius: 12px; margin: 0; }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-weight: 700; font-size: 14px; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 1.4em 0; } .vs > div { padding: 16px 20px; border: 1px solid var(--line-2); border-radius: 14px; } .vs h4 { margin: 0 0 .4em !important; } .vs ul { margin: 0; }

/* ---------- search ---------- */
.scrim { position: fixed; inset: 0; z-index: 54; background: rgba(20, 12, 6, .45); }
.search[hidden], .scrim[hidden] { display: none; }
.search { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 0; background: rgba(20, 12, 6, .5); backdrop-filter: blur(4px); }
.search-box { width: min(620px, 100%); background: var(--bg); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); overflow: hidden; }
.search-box input { width: 100%; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--fg); font: inherit; font-size: 17px; outline: 0; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--fg); }
.search-results a.sel, .search-results a:hover { background: var(--accent-soft); }
.search-results b { display: block; font-size: 15px; } .search-results small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; } .search-results span { display: block; color: var(--fg-2); font-size: 13.5px; line-height: 1.45; margin-top: 2px; }
.search-results mark { background: color-mix(in srgb, var(--accent) 25%, transparent); color: inherit; border-radius: 3px; }
.search-results .none { padding: 22px; text-align: center; color: var(--muted); }
.search-hint { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .toc { display: none; } .main { grid-template-columns: minmax(0, 1fr); padding: 0 32px; } }
@media (max-width: 900px) {
    .menu-btn { display: inline-grid; } .top-links { display: none; }
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; left: 0; top: var(--topbar); bottom: 0; width: min(320px, 86vw); height: auto; z-index: 58; background: var(--bg); transform: translateX(-102%); transition: transform .25s; border-right: 1px solid var(--line-2); }
    body.nav-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .35); }
    .main { padding: 0 20px; } .vs { grid-template-columns: 1fr; } .search-btn span { display: none; } .search-btn kbd { display: none; } .search-btn { width: auto; }
}
@media print { .topbar, .sidebar, .toc, .pager, .copy, .search { display: none !important; } .shell, .main { display: block; padding: 0; } .code { border-color: #ccc; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
