/* Agilu site styles (S5v final: B wordmark and type, C mark, one cyan accent).
   System fonts only, no external resources. Class names are fixed: site.js and
   scripts/check_site.py depend on them. */
:root {
  --bg: #ffffff;
  --fg: #16181b;
  --muted: #575c63;
  --line: #8b9097;
  --panel: #f4f5f6;
  --accent: #0a7381;
  --accent-fg: #ffffff;
  --term-bg: #16181b;
  --term-fg: #e8e9eb;
  --warn-bg: #fff2b3;
  --warn-fg: #3d3300;
  --warn-line: #9a8200;
  --ok-fg: #1d6b35;
  --err-fg: #a3262a;
  --bar: #6c7178;
  --bar-line: #42464c;
  --nofit-line: #6c7178;
  --focus: #065a66;
  --font: "Segoe UI", Seravek, "Gill Sans Nova", Ubuntu, "Noto Sans", "DejaVu Sans", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --fs-1: 2.25rem;
  --fs-2: 1.375rem;
  --fs-3: 1.0625rem;
  --fs-4: 0.875rem;
  --fs-5: 0.9375rem;
  --lh: 1.6;
  --measure: 760px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 16px;
  --sp-4: 32px;
  --sp-5: 64px;
  --radius: 2px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214;
    --fg: #ececed;
    --muted: #a2a7ad;
    --line: #696e75;
    --panel: #1a1c1f;
    --accent: #55c3cc;
    --accent-fg: #111214;
    --term-bg: #08090a;
    --term-fg: #e3e5e8;
    --warn-bg: #3a3312;
    --warn-fg: #f1e5a8;
    --warn-line: #a38f33;
    --ok-fg: #7fd193;
    --err-fg: #f08a8d;
    --bar: #8e949b;
    --bar-line: #b9bec4;
    --nofit-line: #8e949b;
    --focus: #8adde3;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111214;
  --fg: #ececed;
  --muted: #a2a7ad;
  --line: #696e75;
  --panel: #1a1c1f;
  --accent: #55c3cc;
  --accent-fg: #111214;
  --term-bg: #08090a;
  --term-fg: #e3e5e8;
  --warn-bg: #3a3312;
  --warn-fg: #f1e5a8;
  --warn-line: #a38f33;
  --ok-fg: #7fd193;
  --err-fg: #f08a8d;
  --bar: #8e949b;
  --bar-line: #b9bec4;
  --nofit-line: #8e949b;
  --focus: #8adde3;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-3);
  line-height: var(--lh);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness 120ms ease-out;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--sp-3); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: var(--sp-3); min-height: 72px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; color: var(--fg); text-decoration: none; padding: var(--sp-1) 0; }
.brand img { display: block; height: 32px; width: auto; }
.site-nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); }
.site-nav a { color: var(--fg); text-decoration: none; font-size: var(--fs-5); }
.site-nav a:hover { text-decoration: underline; }
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--sp-5);
  padding: var(--sp-4) 0 var(--sp-5);
  color: var(--muted);
  font-size: var(--fs-4);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); }
.site-footer nav a { color: var(--muted); }
.tm { font-size: var(--fs-4); margin: var(--sp-3) 0 0; max-width: 68ch; }

/* Text */
main { padding: var(--sp-4) 0 var(--sp-3); }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.005em; }
h1 { font-size: var(--fs-1); line-height: 1.15; margin: var(--sp-4) 0 var(--sp-3); }
h2 { font-size: var(--fs-2); line-height: 1.3; margin: var(--sp-5) 0 var(--sp-3); }
h3 { font-size: var(--fs-3); line-height: 1.4; margin: var(--sp-4) 0 var(--sp-2); }
p { margin: 0 0 var(--sp-3); }
.lead { font-size: 1.25rem; line-height: 1.45; max-width: 36em; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-4); }
ul.plain { padding-left: 1.25em; margin: 0 0 var(--sp-3); }
ul.plain li { margin-bottom: var(--sp-2); }
ul.plain li::marker { color: var(--muted); }

/* Mode switching (S5b): waitlist copy is the default, site.js adds .is-release on <html> */
.mode-release { display: none; }
html.is-release .mode-waitlist { display: none; }
html.is-release .mode-release { display: block; }
html.is-release span.mode-release { display: inline; }

/* Numbers block and comparison table */
.perf { margin: var(--sp-5) 0 var(--sp-4); }
.perf h2, .perf h3 { margin-top: 0; }
.perf ul { padding-left: 1.25em; margin: 0 0 var(--sp-3); }
.perf li { margin-bottom: var(--sp-2); }
.num { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.caveat { font-size: var(--fs-4); color: var(--muted); margin: 0 0 var(--sp-2); max-width: 68ch; }
.table-scroll { overflow-x: auto; margin: 0 0 var(--sp-4); }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-5); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-weight: 500; vertical-align: bottom; border-bottom: 2px solid var(--fg); }
td.num, th.num-head { text-align: right; }
td.num { font-weight: 600; }
table.cmp-table { min-width: 560px; }
.cmp-table th[scope="row"] { font-weight: 400; }
td.nofit, td.na { text-align: right; color: var(--muted); font-size: var(--fs-4); }
/* Agilu column (C3 fixed order, C4): bold label + thin accent rule on the left */
.cmp-table tr > :nth-child(2) { border-left: 2px solid var(--accent); }
.cmp-table thead th:nth-child(2) { font-weight: 700; }

/* In-table bars (C1-C9): decorative, aria-hidden, one fill, linear from 0, min 2px */
.cmp-table.bars { table-layout: fixed; }
.cmp-table.bars th:first-child { width: 32%; }
.bar {
  display: block;
  height: 8px;
  margin-top: 6px;
  width: max(2px, var(--w));
  background: var(--bar);
  box-shadow: inset 0 0 0 1px var(--bar-line);
}
.bar.nofit-box { width: 100%; background: transparent; box-shadow: none; border: 1px dashed var(--nofit-line); }

/* Forms */
.form-block { border-top: 1px solid var(--line); padding: var(--sp-4) 0 0; margin: var(--sp-5) 0 0; }
.form-block h2 { margin-top: 0; }
label { display: block; font-weight: 600; margin: var(--sp-3) 0 var(--sp-1); }
.hint { display: block; font-weight: 400; font-size: var(--fs-4); color: var(--muted); }
input[type="email"], input[type="text"], textarea {
  width: 100%;
  max-width: 100%;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
textarea { min-height: 160px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: var(--sp-3) 0 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: var(--sp-1); }
.radio { display: block; font-weight: 400; margin: var(--sp-1) 0; }
.radio input { margin-right: var(--sp-2); }
.counter { font-size: var(--fs-4); color: var(--muted); text-align: right; margin-top: var(--sp-1); }
.counter.over { color: var(--err-fg); font-weight: 600; }
.turnstile-box { margin: var(--sp-3) 0 var(--sp-2); min-height: 65px; }

button, .button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  background: var(--fg);
  color: var(--bg);
  border: 1px solid var(--fg);
  border-radius: var(--radius);
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  margin-top: var(--sp-2);
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}
button:hover, .button:hover { background: var(--muted); border-color: var(--muted); }
button[disabled], .button[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
button[disabled]:hover { background: var(--fg); border-color: var(--fg); }

.status { margin: var(--sp-3) 0 0; min-height: 1.5em; }
.status.ok { color: var(--ok-fg); }
.status.err { color: var(--err-fg); }
.warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: var(--sp-3) 0;
}
.notice-line { font-weight: 600; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Demo and legal blocks */
.demo { margin: var(--sp-3) 0; }
.demo-caption { font-size: var(--fs-4); color: var(--muted); margin-bottom: var(--sp-1); }
.terminal, pre.legal {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: var(--radius);
}
.terminal { background: var(--term-bg); color: var(--term-fg); padding: 14px 16px; overflow-x: auto; margin: 0; }
.doc-version { color: var(--muted); font-size: var(--fs-5); }
pre.legal { background: var(--panel); border: 1px solid var(--line); padding: var(--sp-3); margin: var(--sp-3) 0; }

@media (max-width: 480px) {
  h1 { font-size: 1.75rem; }
  h2 { margin-top: var(--sp-4); }
  .site-header .wrap { min-height: 56px; }
  th, td { padding: 8px 6px; }
}

/* Motion: only hover underline and background, 120 ms; off when reduced motion is asked for */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
