/* Fenner — folha de estilo do site.
   Paleta tirada do leão azul do logotipo: marinho profundo, azul elétrico e ciano. */

:root {
  --bg: #fbfcfe;
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --text: #0f1b2d;
  --muted: #546580;
  --line: #e1e8f2;
  --accent: #1d63d6;
  --accent-strong: #134cae;
  --accent-soft: #e8f0fd;
  --cyan: #0891b2;
  --code-bg: #f4f7fc;
  --code-line: #dfe7f3;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 8px 24px rgba(15, 27, 45, .06);

  --tok-k: #7a3ee0;
  --tok-t: #0b7a94;
  --tok-s: #17803d;
  --tok-c: #667892;
  --tok-n: #b0560a;
  --tok-d: #c0246b;
  --tok-m: #5b63d6;
  --tok-f: #1d63d6;
  --tok-o: #c0246b;

  --note: #1d63d6;
  --tip: #12804a;
  --warn: #b4690e;
  --delphi: #7a3ee0;
  --status: #546580;

  --topbar-h: 58px;
  --radius: 10px;
  --font: ui-sans-serif, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, "SF Mono", Menlo, "Liberation Mono", monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #080f1f;
  --surface: #0d1730;
  --surface-2: #101c3a;
  --text: #dbe5f6;
  --muted: #8c9dba;
  --line: #1b2a4a;
  --accent: #5aa8ff;
  --accent-strong: #8cc2ff;
  --accent-soft: #11224a;
  --cyan: #46c6e6;
  --code-bg: #0a1429;
  --code-line: #1a2848;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);

  --tok-k: #c3a6ff;
  --tok-t: #5fd3ec;
  --tok-s: #8fe3a8;
  --tok-c: #7f91ad;
  --tok-n: #f2b676;
  --tok-d: #ff9fc9;
  --tok-m: #9aa4ff;
  --tok-f: #7db8ff;
  --tok-o: #ff9fc9;

  --note: #5aa8ff;
  --tip: #4fd18b;
  --warn: #f0b35a;
  --delphi: #c3a6ff;
  --status: #8c9dba;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080f1f;
    --surface: #0d1730;
    --surface-2: #101c3a;
    --text: #dbe5f6;
    --muted: #8c9dba;
    --line: #1b2a4a;
    --accent: #5aa8ff;
    --accent-strong: #8cc2ff;
    --accent-soft: #11224a;
    --cyan: #46c6e6;
    --code-bg: #0a1429;
    --code-line: #1a2848;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
    --tok-k: #c3a6ff;
    --tok-t: #5fd3ec;
    --tok-s: #8fe3a8;
    --tok-c: #7f91ad;
    --tok-n: #f2b676;
    --tok-d: #ff9fc9;
    --tok-m: #9aa4ff;
    --tok-f: #7db8ff;
    --tok-o: #ff9fc9;
    --note: #5aa8ff;
    --tip: #4fd18b;
    --warn: #f0b35a;
    --delphi: #c3a6ff;
    --status: #8c9dba;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 18px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1440px; margin: 0 auto; height: 100%; padding: 0 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 50%; }
.top-links { display: flex; gap: 4px; margin-left: 8px; }
.top-links a { white-space: nowrap; color: var(--muted); font-size: .93rem; font-weight: 500; padding: 6px 11px; border-radius: 8px; }
.top-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.search { position: relative; margin-left: auto; width: min(340px, 36vw); }
.search input {
  width: 100%; height: 36px; padding: 0 34px 0 12px; font: inherit; font-size: .92rem;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search-hint { position: absolute; right: 9px; top: 7px; pointer-events: none; }
kbd {
  font-family: var(--mono); font-size: .78em; padding: 1px 6px; border-radius: 5px;
  background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; color: var(--muted);
}
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); border-radius: 9px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.menu-btn { display: none; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

.search-results {
  position: absolute; top: 44px; right: 0; width: min(560px, 92vw); max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60;
}
.search-results a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a.sel { background: var(--accent-soft); text-decoration: none; }
.search-results .r-title { font-weight: 600; font-size: .95rem; }
.search-results .r-meta { color: var(--muted); font-size: .78rem; margin-top: 1px; }
.search-results .r-snippet { color: var(--muted); font-size: .85rem; line-height: 1.45; margin-top: 3px; }
.search-results mark { background: color-mix(in srgb, var(--accent) 25%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 14px; color: var(--muted); font-size: .92rem; }

/* ---------- layout de documentação ---------- */
.layout {
  max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: 272px minmax(0, 1fr) 236px; gap: 0 12px;
  padding: 0 20px;
}
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 22px 14px 40px 0;
  font-size: .93rem; scrollbar-width: thin;
}
.nav-section { margin-bottom: 4px; }
.nav-section summary {
  list-style: none; cursor: pointer; padding: 7px 10px; border-radius: 8px;
  font-weight: 700; font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between;
}
.nav-section summary::-webkit-details-marker { display: none; }
.nav-section summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.nav-section[open] summary::after { transform: rotate(45deg); }
.nav-section summary:hover { background: var(--surface-2); color: var(--text); }
.nav-section ul { list-style: none; margin: 2px 0 10px; padding: 0 0 0 10px; border-left: 1px solid var(--line); margin-left: 12px; }
.nav-section li a { display: block; padding: 5px 11px; color: var(--text); opacity: .82; border-radius: 7px; }
.nav-section li a:hover { background: var(--surface-2); opacity: 1; text-decoration: none; }
.nav-section li a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; opacity: 1; }
.sidebar-backdrop { display: none; }

.content { min-width: 0; padding: 34px 20px 70px; }
.toc-col { position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 34px 0 40px 6px; scrollbar-width: thin; }
.toc-title { font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 3px 12px; margin-left: -1px; border-left: 2px solid transparent; font-size: .86rem; line-height: 1.4; color: var(--muted); }
.toc li.lvl3 a { padding-left: 24px; font-size: .83rem; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

/* ---------- texto ---------- */
.prose { max-width: 780px; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.prose h1 { font-size: 2.35rem; line-height: 1.15; letter-spacing: -.025em; margin: 0 0 14px; }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--muted); margin: 0 0 26px; }
.prose h2 { font-size: 1.55rem; letter-spacing: -.018em; line-height: 1.25; margin: 2.6em 0 .6em; padding-top: .9em; border-top: 1px solid var(--line); }
.prose h2:first-of-type { border-top: 0; margin-top: 1.3em; padding-top: 0; }
.prose h3 { font-size: 1.2rem; letter-spacing: -.01em; margin: 2em 0 .5em; }
.prose h4 { font-size: 1rem; margin: 1.6em 0 .4em; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.prose p { margin: 0 0 1.05em; }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose li > ul, .prose li > ol { margin: .3em 0 .3em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.anchor { margin-left: .4em; font-weight: 400; opacity: 0; color: var(--muted); font-size: .8em; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: .8; }
.anchor:hover { text-decoration: none; color: var(--accent); }
.prose :not(pre) > code {
  font-family: var(--mono); font-size: .86em; padding: .12em .38em; border-radius: 6px;
  background: var(--code-bg); border: 1px solid var(--code-line);
}
.prose strong { font-weight: 650; }
blockquote { margin: 1.2em 0; padding: .2em 1.1em; border-left: 3px solid var(--line); color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 0 0 1.3em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 9px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
td { line-height: 1.55; }

/* ---------- blocos de código ---------- */
.code { margin: 0 0 1.3em; border: 1px solid var(--code-line); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.code figcaption {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px 6px 14px; font-family: var(--mono); font-size: .76rem; color: var(--muted);
  border-bottom: 1px solid var(--code-line); background: color-mix(in srgb, var(--code-bg) 60%, var(--surface-2));
}
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; tab-size: 2; }
.code pre code { font-family: var(--mono); font-size: .87rem; line-height: 1.6; color: var(--text); white-space: pre; }
.copy { font: inherit; font-size: .72rem; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 2px 9px; cursor: pointer; }
.copy:hover { color: var(--text); border-color: var(--code-line); background: var(--surface); }
.copy.done { color: var(--tip); }
.output { margin-top: -1px; border-top-style: dashed; }
.example { margin: 0 0 1.4em; }
.example > .code { margin-bottom: 0; }
.example > .code + .code { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: -1px; }
.example > .code:not(:last-child) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.example .output pre code { color: var(--muted); }
.example-note { font-size: .88rem; color: var(--muted); margin: .5em 0 0; }
.tok-k { color: var(--tok-k); font-weight: 600; }
.tok-t { color: var(--tok-t); }
.tok-s { color: var(--tok-s); }
.tok-c { color: var(--tok-c); font-style: italic; }
.tok-n { color: var(--tok-n); }
.tok-d { color: var(--tok-d); }
.tok-m { color: var(--tok-m); }
.tok-f { color: var(--tok-f); }
.tok-o { color: var(--tok-o); }

/* ---------- destaques ---------- */
.callout { margin: 1.3em 0; padding: 12px 16px 4px; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); background: var(--surface); }
.callout-title { font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 4px; }
.callout p:last-child { margin-bottom: .8em; }
.callout.note { border-left-color: var(--note); } .callout.note .callout-title { color: var(--note); }
.callout.tip { border-left-color: var(--tip); } .callout.tip .callout-title { color: var(--tip); }
.callout.warn { border-left-color: var(--warn); } .callout.warn .callout-title { color: var(--warn); }
.callout.delphi { border-left-color: var(--delphi); } .callout.delphi .callout-title { color: var(--delphi); }
.callout.status { border-left-color: var(--status); } .callout.status .callout-title { color: var(--status); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 780px; margin-top: 3.2em; }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font-weight: 600; }
.pager a span { display: block; font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .next { text-align: right; grid-column: 2; }
.pager .prev { grid-column: 1; }

.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: 1440px; margin: 0 auto; padding: 26px 20px; display: flex; flex-wrap: wrap; gap: 12px 30px; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

/* ---------- página inicial ---------- */
.hero {
  position: relative; overflow: hidden; color: #eaf2ff;
  background:
    radial-gradient(900px 420px at 82% 8%, rgba(70, 160, 255, .38), transparent 62%),
    radial-gradient(700px 380px at 6% 100%, rgba(20, 90, 200, .45), transparent 60%),
    linear-gradient(160deg, #050c1c 0%, #0a1d44 55%, #0d2f6d 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(140, 190, 255, .16) 1px, transparent 1.2px); background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%); -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero-inner { position: relative; max-width: 1240px; margin: 0 auto; padding: 64px 24px 74px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 44px; align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 4rem); line-height: 1.04; letter-spacing: -.035em; margin: 0 0 18px; color: #fff; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #7cc4ff, #4ee0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub { font-size: 1.2rem; line-height: 1.6; color: #b9cdee; margin: 0 0 28px; max-width: 34em; }
.hero .logo-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-weight: 700; color: #9fc6ff; letter-spacing: .02em; }
.hero .logo-mark img { border-radius: 50%; box-shadow: 0 0 0 2px rgba(120, 180, 255, .35), 0 0 30px rgba(70, 150, 255, .5); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 10px; font-weight: 650; font-size: 1rem; border: 1px solid transparent; }
.btn:hover { text-decoration: none; }
.btn.primary { background: linear-gradient(180deg, #4aa3ff, #2377e6); color: #fff; box-shadow: 0 6px 22px rgba(35, 119, 230, .45); }
.btn.primary:hover { background: linear-gradient(180deg, #62b0ff, #2d80ee); }
.btn.ghost { color: #dcebff; border-color: rgba(160, 200, 255, .35); background: rgba(255, 255, 255, .04); }
.btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.hero-code { position: relative; min-width: 0; }
.hero-code .code { margin: 0; background: rgba(5, 12, 30, .72); border-color: rgba(120, 170, 255, .28); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); backdrop-filter: blur(6px); }
.hero-code .code figcaption { background: rgba(120, 170, 255, .08); border-color: rgba(120, 170, 255, .2); color: #8aa6d6; }
.hero-code .code pre code { color: #dbe8ff; font-size: .86rem; }
.hero-code .copy { color: #8aa6d6; }
.hero-code .copy:hover { background: rgba(120, 170, 255, .14); color: #fff; border-color: rgba(120, 170, 255, .25); }
.hero .tok-k { color: #c9b2ff; } .hero .tok-t { color: #6fdcf2; } .hero .tok-s { color: #98e8b0; }
.hero .tok-c { color: #7c93b8; } .hero .tok-n { color: #f5c07f; } .hero .tok-f { color: #85bdff; }
.hero .tok-d, .hero .tok-o { color: #ffa8d0; } .hero .tok-m { color: #a7afff; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.badge { font-size: .8rem; padding: 4px 11px; border-radius: 999px; background: rgba(120, 170, 255, .12); border: 1px solid rgba(120, 170, 255, .25); color: #b7d0f5; }

.section { max-width: 1240px; margin: 0 auto; padding: 70px 24px 6px; }
.section h2 { font-size: 2rem; letter-spacing: -.025em; margin: 0 0 8px; }
.section .section-lead { color: var(--muted); font-size: 1.1rem; max-width: 40em; margin: 0 0 30px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  display: block; padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s;
}
a.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.card .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; font-family: var(--mono); font-weight: 700; font-size: .95rem; }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.6; }
.card .more { display: inline-block; margin-top: 12px; font-size: .9rem; font-weight: 600; color: var(--accent); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.split .code { margin: 0; }
.split h3 { font-size: 1.4rem; letter-spacing: -.02em; margin: 0 0 10px; }
.split p { color: var(--muted); }
.split ul { color: var(--muted); padding-left: 1.2em; }
.split li { margin: .35em 0; }
.split li strong { color: var(--text); }

.steps { counter-reset: step; display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step { position: relative; padding: 20px 20px 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: .9rem; margin-bottom: 10px; }
.split .steps { grid-template-columns: minmax(0, 1fr); }
.split .step { display: grid; grid-template-columns: 28px 1fr; column-gap: 14px; align-items: start; }
.split .step::before { margin-bottom: 0; grid-row: 1 / span 2; }
.step h3 { margin: 0 0 4px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); font-size: .94rem; }
.step code { font-family: var(--mono); font-size: .85em; background: var(--code-bg); border: 1px solid var(--code-line); border-radius: 5px; padding: 1px 5px; }

.band { margin-top: 70px; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band .section { padding-top: 60px; padding-bottom: 64px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.stat strong { display: block; font-size: 2rem; letter-spacing: -.03em; color: var(--accent); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .92rem; }
body.home .footer { margin-top: 70px; }

/* ---------- responsivo ---------- */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
  .toc-col { display: none; }
}
@media (max-width: 1000px) {
  .top-links { display: none; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); padding: 44px 20px 54px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .layout { display: block; padding: 0 16px; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar-h); bottom: 0; width: min(320px, 86vw); height: auto; z-index: 45;
    background: var(--bg); border-right: 1px solid var(--line); padding: 16px 12px 40px; transform: translateX(-102%); transition: transform .2s;
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(5, 10, 25, .5); z-index: 44; }
  .content { padding: 26px 2px 56px; }
  .prose h1 { font-size: 1.95rem; }
  .search { width: auto; flex: 1; }
  .search-results { position: fixed; top: calc(var(--topbar-h) + 6px); left: 8px; right: 8px; width: auto; max-height: calc(100vh - var(--topbar-h) - 20px); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pager { grid-template-columns: 1fr; }
  .pager .next, .pager .prev { grid-column: 1; text-align: left; }
  .search-hint { display: none; }
  .hero h1 { font-size: 2.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .topbar, .sidebar, .toc-col, .pager, .footer, .copy { display: none !important; }
  .layout { display: block; }
  body { background: #fff; color: #000; }
}

.community { text-align: center; padding-top: 40px; padding-bottom: 48px; }
.community .btn-row { justify-content: center; }
