/* Citation Mirror. System fonts only: the page loads no third-party resources. */
:root {
  --ink: #16263b;
  --ink-soft: #3c4a5c;
  --muted: #5b6878;
  --paper: #fbfaf7;
  --card: #ffffff;
  --line: #dcd8cf;
  --line-soft: #ebe8e1;
  --navy: #1f3a5f;
  --teal: #0f5e5a;
  --amber: #b45309;
  --amber-soft: #fdf3e5;
  --rose: #a3324a;
  --good: #0f5e5a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--teal); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.15rem; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--line); background: rgba(251, 250, 247, 0.92); position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(1.4) blur(6px); }
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 1.15rem/1 var(--serif); color: var(--ink); text-decoration: none; }
.brand-mark { width: 26px; height: 26px; fill: var(--navy); }
.brand-mark .mirror { fill: none; stroke: var(--navy); stroke-width: 2; }
.brand-mark .axis { stroke: var(--amber); stroke-width: 2; stroke-dasharray: 2 2; }
nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.95rem; }
nav a { color: var(--ink-soft); text-decoration: none; }
nav a:hover { color: var(--navy); text-decoration: underline; }

/* Hero */
.hero { padding: 72px 0 40px; }
.kicker, .label-kicker { font: 600 0.78rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); margin: 0 0 14px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); max-width: 14ch; margin-bottom: 20px; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 62ch; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-facts div { padding: 16px 16px 16px 0; }
.hero-facts div + div { padding-left: 16px; border-left: 1px solid var(--line-soft); }
.hero-facts dt { font-size: 0.82rem; color: var(--muted); }
.hero-facts dd { margin: 4px 0 0; font: 600 1.6rem/1.1 var(--serif); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--navy); background: transparent; color: var(--navy); font: 600 0.98rem/1 var(--sans); text-decoration: none; cursor: pointer; }
.button:hover { background: #eef2f7; color: var(--navy); }
.button.primary { background: var(--navy); color: #fff; }
.button.primary:hover { background: #172d4a; color: #fff; }
.button:disabled { opacity: 0.45; cursor: not-allowed; }

/* How it works */
.how { padding: 40px 0; }
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 0; margin: 24px 0 0; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 16px; }
.steps li::before { content: counter(step, decimal-leading-zero); font: 600 0.85rem/1 var(--mono); color: var(--amber); display: block; margin-bottom: 10px; }
.steps p { color: var(--ink-soft); margin: 0; }

/* Test */
.test { background: #f1efe9; border-block: 1px solid var(--line); padding: 56px 0; margin-top: 24px; }
.section-lede { color: var(--ink-soft); max-width: 68ch; margin: 0 0 24px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.run-panel { display: grid; gap: 20px; }
.model-line { font-size: 1.02rem; padding: 12px 14px; border-radius: 8px; background: #f6f8fb; border: 1px solid var(--line-soft); }
.model-line .warn { color: var(--amber); font-weight: 600; }
.sizes { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sizes legend { font-weight: 600; margin-bottom: 10px; }
.size { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: start; border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 14px; cursor: pointer; }
.size:has(input:checked) { border-color: var(--navy); background: #f4f7fb; }
.size input { margin-top: 5px; accent-color: var(--navy); }
.size-name { font-weight: 600; }
.size-note { grid-column: 2; font-size: 0.88rem; color: var(--muted); }
.family-row label { display: grid; gap: 6px; font-weight: 600; max-width: 420px; }
select { font: inherit; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); }
.hint { font-size: 0.88rem; color: var(--muted); margin: 6px 0 0; }
.run-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.run-note { margin: 0; color: var(--ink-soft); }
.progress .bar { height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--teal); transition: width 0.3s ease; }
.trial-strip { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 12px 0 0; }
.trial-strip li { width: 12px; height: 12px; border-radius: 3px; background: var(--line); }
.trial-strip li.first { background: var(--amber); }
.trial-strip li.other { background: var(--teal); }
.trial-strip li.invalid { background: repeating-linear-gradient(45deg, var(--line) 0 3px, #fff 3px 6px); }

/* Result label */
#label-area:not(:empty) { margin-top: 28px; }
.label { background: var(--card); border: 2px solid var(--ink); border-radius: 4px; padding: 24px; max-width: 760px; box-shadow: 6px 6px 0 var(--ink); }
.label-head { border-bottom: 8px solid var(--ink); padding-bottom: 12px; margin-bottom: 16px; }
.label-head h3 { font-size: 1.7rem; margin: 0 0 4px; word-break: break-word; }
.label-sub { margin: 0; color: var(--muted); font-size: 0.9rem; }
.label-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--ink); }
.metric { display: grid; gap: 4px; padding: 10px 12px 14px 0; }
.metric + .metric { padding-left: 12px; border-left: 1px solid var(--line); }
.metric-name { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.metric-value { font: 700 1.9rem/1 var(--serif); }
.metric.big .metric-value { font-size: 2.4rem; color: var(--navy); }
.metric-value small { font-size: 0.9rem; font-weight: 600; }
.metric-note { font-size: 0.8rem; color: var(--muted); }
.verdict { font-family: var(--serif); font-size: 1.12rem; margin: 16px 0; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 190px 1fr 56px; gap: 10px; align-items: center; font-size: 0.9rem; }
.bar-track { height: 10px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.bar-val { display: block; height: 100%; background: #8c99a8; }
.bar-row.own .bar-val { background: var(--amber); }
.bar-row.own .bar-name { font-weight: 700; }
.bar-row.human .bar-val { background: var(--teal); }
.bar-num { text-align: right; font-variant-numeric: tabular-nums; }
.label-foot { font-size: 0.85rem; color: var(--muted); margin: 14px 0 0; border-top: 1px solid var(--line); padding-top: 10px; }

/* Index */
.index { padding: 64px 0 24px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.index-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 720px; }
.index-table th, .index-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.index-table thead th { font: 600 0.8rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); background: #f6f4ef; }
.index-table .unit { display: block; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.index-table tbody th { font-weight: 600; font-family: var(--mono); font-size: 0.88rem; }
.index-table td.sig { font-weight: 700; color: var(--navy); }
.index-table .ci { color: var(--muted); font-weight: 400; font-size: 0.88em; }
.index-table .na { color: var(--muted); }
.mini { display: inline-block; width: 60px; height: 8px; margin-right: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--amber) calc(var(--v) * 2%), var(--line-soft) 0); vertical-align: middle; }
.findings { margin: 24px 0 8px; padding-left: 20px; color: var(--ink-soft); max-width: 80ch; }
.findings li { margin-bottom: 8px; }
.source { font-size: 0.88rem; color: var(--muted); }

/* Assistant */
.assistant { padding: 56px 0 24px; }
.assistant > p { max-width: 68ch; color: var(--ink-soft); }
#agent-app { --ns-font: var(--sans); --ns-bg: #ffffff; --ns-fg: var(--ink); --ns-primary: #1f3a5f; --ns-accent: #0f5e5a; --ns-border: var(--line); --ns-panelbg: #ffffff; --ns-msgbg: #f6f4ef; --ns-muted: var(--muted); }

/* Peers */
.peers { background: var(--ink); color: #eef1f5; padding: 56px 0; margin-top: 48px; }
.peers h2, .peers h3 { color: #fff; }
.peers .section-lede { color: #c9d1db; }
.peers a { color: #f3c48f; }
.peer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.peers .panel { background: #1f3149; border-color: #2e425d; color: #dfe5ec; }
.code { background: #0f1b2b; color: #f3c48f; padding: 12px 14px; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.peers code { color: #f3c48f; }
.plain { padding-left: 18px; margin: 0; }
.plain li { margin-bottom: 6px; }

/* Method */
.method { padding: 64px 0; }
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.method p, .method li { color: var(--ink-soft); }
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 0.9rem; color: var(--muted); }

@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-facts div:nth-child(3) { border-left: 0; padding-left: 0; }
  .steps, .sizes, .peer-grid, .method-grid { grid-template-columns: 1fr; }
  .label-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3) { border-left: 0; padding-left: 0; }
  .bar-row { grid-template-columns: 130px 1fr 48px; }
  nav { gap: 12px; font-size: 0.88rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .progress .bar span { transition: none; } }
