/* Pointfix documentation. Design tokens match the landing page (../index.html). */
:root {
  --bg: #f7f6f2; --surface: #ffffff; --sunken: #efeee8; --ink: #1c1f1b; --ink-2: #464b44; --muted: #6b7067; --faint: #9a9e94;
  --line: #e2e1da; --line-strong: #d3d2ca; --brand: #d95b36; --brand-ink: #b8461f; --brand-soft: #fbe9e2;
  --review: #a86d0c; --done: #2d7550; --code: #1d211d; --code-ink: #d7dfd1; --code-key: #e7a37f; --code-str: #b6d39c;
  --warn-soft: #fbf1dc; --done-soft: #e3f1e8;
  --shadow: 0 1px 2px rgba(40, 32, 20, .06), 0 12px 32px -12px rgba(40, 32, 20, .18);
  --r: 14px; --max: 1240px;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141613; --surface: #1c1f1b; --sunken: #232722; --ink: #ecede7; --ink-2: #c8ccc2; --muted: #9ba196; --faint: #70766c;
  --line: #2c302a; --line-strong: #3a3f37; --brand: #e5704c; --brand-ink: #f08d6c; --brand-soft: #3a2219;
  --review: #e3b35f; --done: #8fcfa8; --code: #10120f; --warn-soft: #2e2615; --done-soft: #17261c;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -16px rgba(0,0,0,.6);
} }
:root[data-theme="dark"] {
  --bg: #141613; --surface: #1c1f1b; --sunken: #232722; --ink: #ecede7; --ink-2: #c8ccc2; --muted: #9ba196; --faint: #70766c;
  --line: #2c302a; --line-strong: #3a3f37; --brand: #e5704c; --brand-ink: #f08d6c; --brand-soft: #3a2219;
  --review: #e3b35f; --done: #8fcfa8; --code: #10120f; --warn-soft: #2e2615; --done-soft: #17261c;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -16px rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
code, pre, kbd { font-family: var(--mono); }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--surface); padding: 8px 12px; }
.wrap { width: min(var(--max), 100% - 40px); margin-inline: auto; }

/* Header (same as the landing page) */
.nav { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; letter-spacing: -.02em; text-decoration: none; color: inherit; }
.brand img { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 24px; margin-left: auto; font-size: 14.5px; }
.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }
.nav-links a[aria-current] { font-weight: 600; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 18px; font: 600 14px/1 var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--ink); color: var(--bg); }
.menu-toggle { display: none; margin-left: auto; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 14px/1 var(--sans); cursor: pointer; }

/* Layout */
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr) 200px; gap: 48px; align-items: start; padding: 40px 0 72px; }
.sidebar { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; font-size: 14.5px; padding-bottom: 16px; }
.sidebar h2 { margin: 22px 0 6px; font: 600 12px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sidebar h2:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.sidebar a:hover { background: var(--sunken); color: var(--ink); }
.sidebar a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.sidebar .ext::after { content: " ↗"; color: var(--muted); }
main { min-width: 0; grid-column: 2; grid-row: 1; }
.toc { grid-column: 3; grid-row: 1; position: sticky; top: 88px; font-size: 13.5px; }
.toc h2 { margin: 0 0 8px; font: 600 12px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--line); display: grid; gap: 6px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }

/* Article */
article { max-width: 760px; }
.eyebrow { font: 500 13px/1 var(--sans); color: var(--brand-ink); }
h1, h2, h3 { letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(32px, 4vw, 42px); line-height: 1.1; font-weight: 700; letter-spacing: -.035em; margin: 12px 0 14px; }
.lede { font-size: 18px; color: var(--ink-2); margin: 0 0 28px; text-wrap: pretty; }
article h2 { font-size: 25px; line-height: 1.2; font-weight: 650; margin: 52px 0 12px; padding-top: 4px; }
article h3 { font-size: 18px; font-weight: 600; margin: 30px 0 8px; letter-spacing: -.01em; }
article p, article li { color: var(--ink-2); }
article strong { color: var(--ink); font-weight: 600; }
article a { color: var(--brand-ink); text-underline-offset: 2px; }
article a:hover { color: var(--ink); }
article ul, article ol { padding-left: 22px; }
article li { margin: 4px 0; }
:not(pre) > code { font-size: .88em; padding: 1px 5px; border-radius: 5px; background: var(--sunken); color: var(--ink); overflow-wrap: anywhere; }
kbd { font-size: .82em; padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--ink); white-space: nowrap; }
pre { margin: 16px 0 20px; padding: 16px 18px; border-radius: 12px; background: var(--code); color: var(--code-ink); font-size: 13px; line-height: 1.65; overflow-x: auto; tab-size: 2; }
pre code { font-size: inherit; }
pre .c { color: #8d968a; } pre .k { color: var(--code-key); } pre .s { color: var(--code-str); }
.table-wrap { margin: 16px 0 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
caption { text-align: left; padding: 12px 14px 0; font-weight: 600; color: var(--ink); }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--ink); background: var(--sunken); font-size: 13.5px; }
tr:last-child td { border-bottom: 0; }
td { color: var(--ink-2); }
td code { white-space: nowrap; }
td.wrap-code code { white-space: normal; }
.callout { margin: 20px 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.callout p { margin: 0; } .callout p + p, .callout ul { margin-top: 8px; }
.callout > strong:first-child { display: block; margin-bottom: 4px; }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--review) 35%, transparent); }
.callout.ok { background: var(--done-soft); border-color: color-mix(in srgb, var(--done) 35%, transparent); }
.steps-list { counter-reset: s; list-style: none; padding: 0; }
.steps-list > li { counter-increment: s; position: relative; padding-left: 40px; margin: 18px 0; }
.steps-list > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font: 600 13px/26px var(--mono); text-align: center; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; padding: 0; list-style: none; }
.cards a { display: grid; gap: 4px; height: 100%; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.cards a:hover { border-color: var(--ink-2); }
.cards b { font-weight: 600; } .cards span { color: var(--muted); font-size: 14.5px; }
.cards li { margin: 0; }
figure { margin: 24px 0; }
figure img { border-radius: 18px; box-shadow: var(--shadow); }
figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.flow { font: 13px/1.6 var(--mono); white-space: pre-wrap; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { display: grid; gap: 2px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--ink-2); }
.pager small { color: var(--muted); font-size: 13px; }
.pager .next { text-align: right; grid-column: 2; }

footer { padding: 40px 0 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
footer nav { display: flex; gap: 20px; }
footer a { text-decoration: none; color: inherit; } footer a:hover { color: var(--ink); }
footer .brand { color: var(--ink); }
footer p { margin: 0; flex-basis: 100%; max-width: 72ch; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
  .toc { grid-column: 2; grid-row: 1; position: static; margin-bottom: 28px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .toc ul { border: 0; padding: 0; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  main { grid-row: 2; }
  .sidebar { grid-row: 1 / span 2; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav .btn { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 24px; }
  .sidebar { position: static; max-height: none; grid-row: 1; margin-bottom: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .js .sidebar:not(.open) { display: none; }
  .toc { grid-column: 1; grid-row: 2; }
  main { grid-column: 1; grid-row: 3; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .cards { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; }
  pre { font-size: 12px; padding: 14px; }
  article h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
