/* MAQPNA — maqpna.com. No build step, no JavaScript. */

/* Brand tokens — keep in sync with brand/README.md and console/css/console.css.
   Neutral charcoal greys + one teal accent; every text token is >= 4.5:1 on
   --bg, --bg-elev and --bg-sunk in both schemes. */
:root {
  color-scheme: light dark;
  --brand: #383838;         /* MAQPNA charcoal: logo colour */
  --bg: #f7f7f6;            /* paper */
  --bg-elev: #ffffff;
  --bg-sunk: #efefed;
  --ink: #262626;
  --ink-2: #4a4a4a;
  --ink-3: #636363;
  --line: #e2e2df;
  --line-strong: #c9c9c5;
  --accent: #0f766e;        /* teal-700 */
  --accent-ink: #ffffff;
  --accent-soft: #e6f2f0;
  --warn: #9a5b00;
  --tier0: #2563eb;
  --tier1: #7c3aed;
  --tier2: #0f766e;
  --code-bg: #1f1f1f;
  --code-line: #333333;
  --code-ink: #e6e6e6;
  --code-dim: #9a9a9a;
  --code-key: #7dd3fc;
  --code-str: #86efac;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .06), 0 8px 24px rgba(20, 20, 20, .06);
  --max: 1160px;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #ededed;
    --bg: #121212;
    --bg-elev: #1b1b1b;
    --bg-sunk: #0d0d0d;
    --ink: #ededed;
    --ink-2: #c2c2c2;
    --ink-3: #9b9b9b;
    --line: #262626;
    --line-strong: #363636;
    --accent: #5eead4;
    --accent-ink: #04201c;
    --accent-soft: rgba(94, 234, 212, .09);
    --warn: #fbbf24;
    --tier0: #60a5fa;
    --tier1: #a78bfa;
    --tier2: #5eead4;
    --code-bg: #0b0b0b;
    --code-line: #262626;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code, kbd, pre { font-family: var(--mono); font-size: .92em; }
:not(pre) > code {
  background: var(--bg-sunk); border: 1px solid var(--line);
  padding: .08em .38em; border-radius: 5px; font-size: .86em;
}
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.015em; font-weight: 600; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.1rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -.025em; }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 520px) { .wrap { padding: 0 16px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--brand); text-decoration: none; font-weight: 600; letter-spacing: .08em; }
/* Logo mark: 1.9:1, fill follows --brand. Minimum on screen: 32px wide. */
.brand .mark { width: 46px; height: 24px; flex: none; fill: currentColor; }
.brand:hover { color: var(--ink); }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 860px) { .nav-links .hide-sm { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-weight: 500; font-size: .98rem;
  text-decoration: none; border: 1px solid transparent; transition: transform .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: var(--bg-elev); }
.btn-sm { padding: 7px 13px; font-size: .9rem; border-radius: 8px; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Sections ---------- */
section { padding: 96px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 720px) { section { padding: 64px 0; } }
.eyebrow {
  display: inline-block; font: 500 .78rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 46em; }
.section-head { max-width: 760px; margin-bottom: 48px; }
.muted { color: var(--ink-3); }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 96px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; position: relative; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { max-width: 12ch; }
.hero .lede { margin-bottom: 32px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; padding: 0; list-style: none; }
.pill {
  font: 500 .78rem/1 var(--mono); color: var(--ink-2); border: 1px solid var(--line-strong);
  padding: 7px 10px; border-radius: 999px; background: var(--bg-elev);
}

/* Code window */
.code {
  background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow); overflow: hidden;
}
.code-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--code-line); font: .78rem var(--mono); color: var(--code-dim); }
.code-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--code-line); display: inline-block; }
.code-bar span { margin-left: 8px; }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; line-height: 1.65; font-size: .84rem; }
.code .k { color: var(--code-key); }
.code .s { color: var(--code-str); }
.code .c { color: var(--code-dim); }
.code-note { font-size: .82rem; color: var(--ink-3); margin-top: 10px; }

/* ---------- Cards / grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-4 { grid-template-columns: 1fr; } }
.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.card h3 { display: flex; align-items: center; gap: 10px; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .num { font: 500 .78rem var(--mono); color: var(--ink-3); display: block; margin-bottom: 14px; }
.icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.icon svg { width: 20px; height: 20px; }

/* Problem */
.problem { background: var(--bg-sunk); }
.problem .card { box-shadow: none; }
.contrast { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 40px; }
.contrast > div { padding: 24px 26px; background: var(--bg-elev); }
.contrast > div + div { border-left: 1px solid var(--line); }
.contrast h4 { font: 500 .78rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.contrast ul { margin: 0; padding: 0; list-style: none; }
.contrast li { padding: 8px 0 8px 26px; position: relative; color: var(--ink-2); }
.contrast li::before { position: absolute; left: 0; top: 8px; font-family: var(--mono); }
.contrast .bad li::before { content: "×"; color: var(--warn); }
.contrast .good li::before { content: "✓"; color: var(--accent); }
@media (max-width: 720px) { .contrast { grid-template-columns: 1fr; } .contrast > div + div { border-left: 0; border-top: 1px solid var(--line); } }

/* Architecture diagram */
.diagram {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 40px; box-shadow: var(--shadow);
}
.diagram figcaption { font-size: .88rem; color: var(--ink-3); padding: 12px 6px 2px; }
.dg-frame { fill: none; stroke: var(--line-strong); stroke-dasharray: 6 6; }
.dg-zone { fill: var(--bg-sunk); stroke: var(--line); }
.dg-box { fill: var(--bg-elev); stroke: var(--line-strong); stroke-width: 1.2; }
.dg-box-accent { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.4; }
.dg-t0 { stroke: var(--tier0); }
.dg-t1 { stroke: var(--tier1); }
.dg-t2 { stroke: var(--tier2); stroke-width: 2; }
.dg-title { fill: var(--ink); font: 600 14px var(--sans); }
.dg-sub { fill: var(--ink-3); font: 400 11.5px var(--mono); }
.dg-label { fill: var(--ink-3); font: 500 11px var(--mono); letter-spacing: .06em; }
.dg-edge { fill: none; stroke: var(--ink-3); stroke-width: 1.4; }
.dg-edge-accent { fill: none; stroke: var(--accent); stroke-width: 2; }
.dg-dash { stroke-dasharray: 4 4; }
.dg-arrow { fill: var(--ink-3); }
.dg-arrow-accent { fill: var(--accent); }
.dg-tag-t0 { fill: var(--tier0); }
.dg-tag-t1 { fill: var(--tier1); }
.dg-tag-t2 { fill: var(--tier2); }
.dg-scroll { overflow-x: auto; }
.dg-scroll svg { min-width: 760px; }

/* Tier table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 .76rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); background: var(--bg-sunk); }
tr:last-child td { border-bottom: 0; }
.tier-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }

/* Sovereignty */
.sovereignty { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-sunk) 100%); }
.pillar { border-top: 3px solid var(--accent); }
.pillar .q { font: 500 .8rem var(--mono); color: var(--ink-3); margin-bottom: 10px; display: block; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 6px 0 6px 24px; position: relative; color: var(--ink-2); }
.checks li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 9px; height: 5px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.feature-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 28px; }
.feature-list > div { background: var(--bg-elev); padding: 22px 24px; }
.feature-list h3 { font-size: 1.02rem; margin-bottom: .35em; }
.feature-list p { color: var(--ink-2); font-size: .95rem; margin: 0; }
@media (max-width: 900px) { .feature-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .feature-list { grid-template-columns: 1fr; } }
.callout { margin-top: 28px; padding: 18px 22px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); color: var(--ink-2); font-size: .95rem; }
.callout strong { color: var(--ink); }

/* Built on */
.built-on { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; padding: 0; list-style: none; }
.built-on li { font: 500 .88rem var(--mono); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg-elev); color: var(--ink-2); }

/* Pricing */
.plan { display: flex; flex-direction: column; }
.plan .price { font-size: 2rem; font-weight: 600; letter-spacing: -.02em; margin: 6px 0 4px; }
.plan .for { color: var(--ink-3); font-size: .93rem; min-height: 3em; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.plan li { padding: 7px 0 7px 24px; position: relative; color: var(--ink-2); font-size: .95rem; border-top: 1px dashed var(--line); }
.plan li::before { content: "+"; position: absolute; left: 4px; color: var(--accent); font-family: var(--mono); }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.badge { display: inline-block; font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .1em; padding: 4px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); margin-left: 8px; vertical-align: middle; }

/* CTA */
.cta-band { text-align: center; }
.cta-band .lede { margin: 0 auto 28px; }
.cta-band .cta-row { justify-content: center; }

/* Footer */
.site-footer { padding: 48px 0 56px; color: var(--ink-3); font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { font: 500 .76rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 4px 0; }
.site-footer a { color: var(--ink-3); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer .brand { color: var(--brand); }
.footer-brand { margin-bottom: 20px; }
.expansion { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; margin-top: 10px; }
.legal { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Docs page (sovereignty.html) */
.doc { display: grid; grid-template-columns: 220px 1fr; gap: 56px; padding: 56px 0 96px; }
@media (max-width: 900px) { .doc { grid-template-columns: 1fr; } .toc { display: none; } }
.toc { position: sticky; top: 88px; align-self: start; font-size: .9rem; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; color: var(--ink-3); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.prose { max-width: 760px; }
.prose h2 { font-size: 1.7rem; margin-top: 2.2em; padding-top: .2em; }
.prose h3 { margin-top: 1.6em; }
.prose p, .prose li { color: var(--ink-2); }
.prose .code { margin: 1.2em 0 1.6em; }
.prose table { margin: 1em 0 1.6em; }

/* 404 */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 64px 0; }
.notfound .code404 { font: 600 clamp(4rem, 14vw, 9rem)/1 var(--mono); color: var(--accent); letter-spacing: -.04em; }

/* Utilities (no inline styles: keeps CSP free of 'unsafe-inline') */
.mt-lg { margin-top: 56px; }
.tier-dot.t0 { background: var(--tier0); }
.tier-dot.t1 { background: var(--tier1); }
.tier-dot.t2 { background: var(--tier2); }
.code-narrow { max-width: 640px; margin: 0 auto 28px; text-align: left; }
.fine { margin-top: 18px; font-size: .9rem; }
.tagline { margin-top: 12px; }
.notfound .cta-row { justify-content: center; }
