/* theme_07 — High-Contrast Blueprint Spec
   bg #0f172a · surface #1e293b · ink #f8fafc · accent #f59e0b · muted #94a3b8 */

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #273549;
  --ink: #f8fafc;
  --accent: #f59e0b;
  --accent-ink: #0f172a;
  --muted: #94a3b8;
  --line: #334155;
  --ok: #34d399;
  --warn: #fbbf24;
  --fail: #f87171;
  --info: #60a5fa;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.5rem 1rem; z-index: 100; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0.75rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.05rem;
}
.brand em { font-style: normal; color: var(--accent); }
.brand-mark { width: 28px; height: 28px; }
.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: 0.9rem;
  padding: 0.25rem 0.1rem; border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--ink); border-bottom-color: var(--accent); }

/* disclosure bar — above the fold */
.disclosure-bar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.85rem;
  padding: 0.55rem 1.25rem;
  text-align: center;
}
.disclosure-bar a { color: var(--accent); }

/* hero */
main { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem 3rem; }
.hero { padding: 2.5rem 0 2rem; max-width: 46rem; }
.eyebrow {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 0.5rem;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 1rem; }
h1 .accent { color: var(--accent); }
.lede { color: var(--muted); font-size: 1.05rem; margin: 0 0 1.25rem; }
.hero-facts { display: flex; gap: 1.5rem; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.hero-facts li {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.6rem 0.9rem; font-size: 0.88rem; color: var(--muted);
}
.hero-facts strong { color: var(--ink); display: block; font-size: 0.95rem; }

/* workbench grid: asymmetric 65/35 */
.workbench-grid {
  display: grid;
  grid-template-columns: 65fr 35fr;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 3rem;
}
.workbench-main { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.inspector { display: flex; flex-direction: column; gap: 1.25rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
}
.panel.sticky { position: sticky; top: 4.5rem; }
.panel-head h2 { margin: 0 0 0.25rem; font-size: 1.15rem; }
.panel-sub { margin: 0 0 1rem; color: var(--muted); font-size: 0.85rem; }

/* preset selector */
.preset-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.preset-btn {
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 0.7rem 0.8rem; cursor: pointer; text-align: left;
  font-family: var(--sans); font-size: 0.85rem;
}
.preset-btn .preset-id { font-family: var(--mono); color: var(--accent); font-size: 0.72rem; display: block; }
.preset-btn[aria-checked="true"], .preset-btn.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.preset-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.preset-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem 1rem; margin: 0 0 1rem; font-size: 0.85rem; }
.preset-meta dt { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.preset-meta dd { margin: 0; font-family: var(--mono); }

/* controls */
.controls { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: end; }
.control { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.8rem; color: var(--muted); }
.control span { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.control input[type="number"] {
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.5rem 0.6rem; font-family: var(--mono); width: 12rem;
}
.control input[type="range"] { width: 14rem; accent-color: var(--accent); }
.control input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.control output { color: var(--accent); font-family: var(--mono); }

/* rule results */
.rule-results { display: flex; flex-direction: column; gap: 0.45rem; }
.rule-row {
  display: grid; grid-template-columns: 92px 1fr auto;
  gap: 0.75rem; align-items: baseline;
  padding: 0.5rem 0.7rem; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--line);
  font-size: 0.85rem;
}
.rule-id { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); }
.rule-msg { color: var(--muted); }
.rule-verdict { font-family: var(--mono); font-size: 0.75rem; font-weight: 700; }
.rule-row.pass .rule-verdict { color: var(--ok); }
.rule-row.fail .rule-verdict { color: var(--fail); }
.rule-row.warn .rule-verdict { color: var(--warn); }
.rule-row.info .rule-verdict { color: var(--info); }
.rule-row.fail { border-left: 3px solid var(--fail); }
.rule-row.warn { border-left: 3px solid var(--warn); }
.rule-row.info { border-left: 3px solid var(--info); }
.rule-row.pass { border-left: 3px solid var(--ok); }
.rule-detail { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

/* audit trail */
.audit-list { margin: 0; padding-left: 1.25rem; font-size: 0.85rem; display: grid; gap: 0.5rem; }
.audit-list li { color: var(--muted); }
.audit-list .rule-id { color: var(--accent); font-family: var(--mono); font-size: 0.75rem; margin-right: 0.35rem; }

/* chart */
.chart-wrap { display: flex; flex-direction: column; gap: 0.75rem; }
#growth-chart { width: 100%; height: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); font-family: var(--mono); }
.chart-legend span::before { content: "■"; margin-right: 0.35rem; }
.metric-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem; margin-top: 0.5rem;
}
.metric {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.7rem 0.8rem;
}
.metric .m-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.metric .m-value { font-family: var(--mono); font-size: 1.15rem; font-weight: 700; color: var(--accent); }
.metric .m-sub { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

/* inspector */
.spec-list { display: grid; grid-template-columns: 1fr; gap: 0.4rem; margin: 0 0 1rem; font-size: 0.85rem; }
.spec-list dt { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.spec-list dd { margin: -0.35rem 0 0.35rem; font-family: var(--mono); word-break: break-all; }
.inspector-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn {
  font-family: var(--sans); font-size: 0.85rem; cursor: pointer;
  border-radius: 6px; padding: 0.5rem 0.9rem;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.btn:hover, .btn:focus-visible { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn-ghost { background: transparent; }
.receipt-line { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); margin: 0.75rem 0 0; word-break: break-all; }

/* sections */
.section { margin-bottom: 3rem; }
.section h2 { font-size: 1.5rem; margin: 0 0 0.75rem; }
.sec-tag {
  font-family: var(--mono); font-size: 0.7rem; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px; padding: 0.15rem 0.6rem;
  vertical-align: middle; font-weight: 400;
}
.section > p { color: var(--muted); max-width: 60rem; }
.subhead { font-size: 1.1rem; margin: 1.5rem 0 0.6rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td {
  padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line);
}
.data-table th { background: var(--surface-2); font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table tr:last-child td { border-bottom: none; }
.data-table td { font-family: var(--mono); }
.data-table td:first-child { font-family: var(--sans); }

ul.notes { color: var(--muted); max-width: 60rem; }
ul.notes code { font-family: var(--mono); color: var(--accent); font-size: 0.85em; }

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 2rem;
}
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.footer-brand { font-weight: 700; margin: 0 0 0.5rem; }
.footer-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.footer-nav a { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.footer-nav a:hover { color: var(--accent); }
.footer-legal { color: var(--muted); font-size: 0.78rem; margin: 0; max-width: 60rem; }

/* responsive */
@media (max-width: 900px) {
  .workbench-grid { grid-template-columns: 1fr; }
  .panel.sticky { position: static; }
  .controls { flex-direction: column; align-items: stretch; }
  .control input[type="range"] { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
