/* ==========================================================================
   Axiom Document & Documentation Pages CSS
   Brand Tokens: Paper (#f5f2ea), Ink (#14161a), Pass (#0b6b4a), Terminal (#0f1216)
   ========================================================================== */
@font-face { font-family: "Source Serif 4"; src: url("/fonts/SourceSerif4.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/HankenGrotesk.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --paper: #f5f2ea;
  --paper-2: #ebe7db;
  --paper-card: #ffffff;
  --ink: #14161a;
  --ink-2: #4a505b;
  --rule: rgba(20, 22, 26, 0.14);
  --rule-strong: rgba(20, 22, 26, 0.28);
  --pass: #0b6b4a;
  --pass-light: #e6f4ea;
  --stop: #b3261e;
  --stop-light: #fce8e6;
  --term: #0f1216;
  --term-2: #161b21;
  --term-ink: #e8e6df;
  --term-dim: #a3a9b3;
  --term-pass: #52d6a0;
  --term-stop: #ff8a80;
  --term-accent: #38bdf8;
  --display: "Source Serif 4", Georgia, serif;
  --text: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --wire: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --t-s: 0.875rem;
  --t-b: 1rem;
  --t-l: 1.125rem;
  --t-h3: 1.35rem;
  --t-h2: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --t-h1: clamp(2.1rem, 1.4rem + 2.5vw, 3.2rem);
  --radius-sm: 6px;
  --radius-md: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); color: var(--ink); font-family: var(--text); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
a { color: var(--ink); text-underline-offset: 0.2em; }
a:hover { color: var(--pass); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

/* Skip Link */
.skip { position: absolute; left: -999px; top: 8px; background: var(--term); color: var(--term-ink); padding: 8px 14px; border-radius: var(--radius-sm); z-index: 100; text-decoration: none; }
.skip:focus { left: 8px; }

/* Site Header */
.site-head { border-bottom: 1px solid var(--rule); background: rgba(245, 242, 234, 0.92); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 40; }
.site-head .in { max-width: 1080px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.mark { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 1.3rem; text-decoration: none; color: var(--ink); letter-spacing: -0.02em; }
.mark i { width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 50%; display: inline-block; position: relative; }
.mark i::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: currentColor; }
.site-head nav { display: flex; gap: 6px 18px; flex-wrap: wrap; flex: 1; align-items: center; }
.site-head nav a { font-size: var(--t-s); font-weight: 500; color: var(--ink-2); text-decoration: none; padding: 4px 0; }
.site-head nav a:hover, .site-head nav a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: underline; }
.site-head .btn-nav { margin-left: auto; display: inline-flex; align-items: center; padding: 8px 18px; background: var(--ink); color: var(--paper); border-radius: 999px; font-size: var(--t-s); font-weight: 600; text-decoration: none; transition: background 0.2s; }
.site-head .btn-nav:hover { background: #000; color: #fff; }

/* Main Article Container */
main { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 32px 20px 80px; }
.crumbs { font-size: var(--t-s); color: var(--ink-2); margin-bottom: 24px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span[aria-hidden] { color: var(--rule-strong); }

main h1 { font-family: var(--display); font-size: var(--t-h1); line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 16px; color: var(--ink); }
.meta { font-size: var(--t-s); color: var(--ink-2); margin-bottom: 28px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* 40-60 Word Answer-First Inverted Pyramid */
.answer { font-size: var(--t-l); line-height: 1.6; color: var(--ink); background: var(--paper-2); border-left: 4px solid var(--pass); padding: 18px 22px; border-radius: 0 var(--radius-md) var(--radius-md) 0; margin-bottom: 36px; }
.answer strong { color: var(--ink); font-weight: 700; }

main section { margin-top: 48px; }
main h2 { font-family: var(--display); font-size: var(--t-h2); line-height: 1.25; letter-spacing: -0.015em; margin-bottom: 16px; color: var(--ink); }
main h3 { font-family: var(--display); font-size: var(--t-h3); margin: 28px 0 10px; color: var(--ink); }
main p { color: #2d333b; margin-bottom: 16px; }
main ul, main ol { margin: 0 0 20px 24px; color: #2d333b; }
main li { margin-bottom: 8px; }
main strong { color: var(--ink); }

/* Code and Terminal Blocks */
pre, code { font-family: var(--wire); }
code { background: var(--paper-2); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; border: 1px solid var(--rule); }
.terminal-block { background: var(--term); color: var(--term-ink); border-radius: var(--radius-md); padding: 20px 22px; margin: 24px 0; overflow-x: auto; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.terminal-block .term-bar { font-size: 0.75rem; color: var(--term-dim); border-bottom: 1px solid var(--term-rule); padding-bottom: 10px; margin-bottom: 14px; display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: 0.05em; font-family: var(--wire); }
.terminal-block pre { margin: 0; font-size: 0.88rem; line-height: 1.5; color: var(--term-ink); background: transparent; }
.terminal-block code { background: transparent; border: none; padding: 0; color: inherit; }
.terminal-block .tok-kw { color: var(--term-accent); }
.terminal-block .tok-str { color: var(--term-pass); }
.terminal-block .tok-num { color: #f59e0b; }
.terminal-block .tok-com { color: var(--term-dim); font-style: italic; }

/* Table Wrappers */
.table-wrap { overflow-x: auto; margin: 24px 0 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius-md); background: var(--paper-card); }
table { width: 100%; border-collapse: collapse; font-size: var(--t-s); min-width: 580px; }
caption { text-align: left; padding: 10px 16px; font-size: 0.8rem; color: var(--ink-2); caption-side: bottom; }
th { text-align: left; font-size: 0.8rem; font-weight: 700; color: var(--ink); padding: 12px 16px; border-bottom: 2px solid var(--rule-strong); background: var(--paper-2); text-transform: uppercase; letter-spacing: 0.04em; }
td { padding: 12px 16px; border-bottom: 1px solid var(--rule); color: #2d333b; vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
td:first-child, th[scope="row"] { color: var(--ink); font-weight: 600; }
.td-pass { background: var(--pass-light); color: var(--pass); font-weight: 600; }
.td-stop { background: var(--stop-light); color: var(--stop); font-weight: 600; }

/* Number and Category Tags */
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--rule-strong); vertical-align: middle; white-space: nowrap; line-height: 1.4; }
.tag.spec { background: var(--term); color: var(--term-pass); border-color: var(--term); }
.tag.security { background: var(--stop-light); color: var(--stop); border-color: rgba(179, 38, 30, 0.3); }
.tag.benchmark { background: var(--pass-light); color: var(--pass); border-color: rgba(11, 107, 74, 0.3); }
.tag.arch { background: #e0f2fe; color: #0369a1; border-color: rgba(3, 105, 161, 0.3); }

/* Callout Box */
.callout { background: var(--paper-card); border: 1px solid var(--rule-strong); border-left: 4px solid var(--ink); border-radius: var(--radius-md); padding: 18px 22px; margin: 24px 0; }
.callout p:last-child { margin-bottom: 0; }

/* FAQ Section */
.faq-item { border-bottom: 1px solid var(--rule); padding: 20px 0; }
.faq-item:first-of-type { border-top: 1px solid var(--rule); }
.faq-q { font-family: var(--display); font-size: var(--t-h3); margin-bottom: 8px; color: var(--ink); }
.faq-a { color: #2d333b; margin-bottom: 0; }

/* Related Navigation Grid */
.related { margin-top: 48px; }
.related ul { list-style: none; margin: 0; display: grid; gap: 14px; }
.related a { display: block; padding: 16px 20px; border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-card); text-decoration: none; color: var(--ink); font-weight: 600; transition: border-color 0.2s, box-shadow 0.2s; }
.related a:hover { border-color: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.related a small { display: block; font-weight: 400; color: var(--ink-2); margin-top: 4px; font-size: var(--t-s); }

/* CTA Band */
.cta-band { margin-top: 60px; padding: 32px 28px; border: 1px solid var(--rule-strong); border-radius: var(--radius-md); background: var(--paper-2); }
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { margin-bottom: 22px; color: var(--ink-2); }
.btn-primary { display: inline-flex; align-items: center; padding: 12px 24px; background: var(--ink); color: var(--paper); border-radius: 999px; font-weight: 600; text-decoration: none; transition: background 0.2s; }
.btn-primary:hover { background: #000; color: #fff; }
.btn-secondary { display: inline-flex; align-items: center; padding: 12px 24px; border: 1px solid var(--rule-strong); background: var(--paper-card); color: var(--ink); border-radius: 999px; font-weight: 600; text-decoration: none; margin-left: 10px; transition: border-color 0.2s; }
.btn-secondary:hover { border-color: var(--ink); }

/* Site Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 36px 20px 48px; background: var(--paper); }
.site-foot .in { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-foot nav a { font-size: var(--t-s); color: var(--ink-2); text-decoration: none; }
.site-foot nav a:hover { color: var(--ink); text-decoration: underline; }
.site-foot p { font-size: 0.8rem; color: var(--ink-2); }
