/* witchproject.com — theme_03 Swiss Grid Technical Ledger */
:root {
  --bg: #f4f4f0;
  --surface: #ffffff;
  --ink: #111111;
  --accent: #d9381e;
  --muted: #4b5563;
  --line: #d8d8d2;
  --warn: #a16207;
  --fail: #b3261e;
  --info: #1d4ed8;
  --ok: #15803d;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 100;
  font-family: var(--mono); text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 24px;
  border-bottom: 1px solid var(--ink);
  background: var(--surface);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand-mark { color: var(--accent); font-size: 18px; font-weight: 700; }
.brand-name { font-weight: 700; letter-spacing: 0.06em; font-size: 17px; text-transform: uppercase; }
.brand-sub { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.topnav { display: flex; gap: 16px; flex-wrap: wrap; }
.topnav a {
  color: var(--ink); text-decoration: none; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600;
  border-bottom: 2px solid transparent; padding-bottom: 2px;
}
.topnav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.disclosure-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 8px 24px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.disclosure-strip a { color: var(--accent); }

main { max-width: 1280px; margin: 0 auto; padding: 24px 24px 64px; }

/* Swiss 12-column hairline grid: sections sit on hairline rules */
.hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  border: 1px solid var(--ink);
  background: var(--surface);
  margin-bottom: 28px;
}
.hero > * { padding: 18px 20px; }
.hero .hero-lead { grid-column: 1 / 9; border-right: 1px solid var(--line); }
.hero .hero-rail { grid-column: 9 / 13; background: var(--bg); }
@media (max-width: 900px) {
  .hero .hero-lead, .hero .hero-rail { grid-column: 1 / 13; border-right: 0; border-bottom: 1px solid var(--line); }
}
.hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.05;
}
.hero h1 .accent { color: var(--accent); }
.hero p { max-width: 74ch; color: var(--muted); margin: 0; font-size: 14px; }
.hero .meta {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  display: flex; flex-direction: column; gap: 6px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.hero .meta strong { color: var(--ink); }

section { margin: 34px 0; }
h2 {
  font-size: 20px; margin: 0 0 6px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 8px;
}
h2 .idx { color: var(--accent); margin-right: 10px; font-family: var(--mono); font-size: 13px; }
.section-sub { color: var(--muted); font-size: 12px; margin: 0 0 16px; max-width: 82ch; text-transform: uppercase; letter-spacing: 0.04em; }

/* Wizard — ledger panels on hairline grid */
.wizard {
  background: var(--surface);
  border: 1px solid var(--ink);
}
.step-tabs {
  display: flex; gap: 0; padding: 0;
  border-bottom: 1px solid var(--ink);
  background: var(--bg);
  flex-wrap: wrap;
}
.stepbtn {
  appearance: none; border: 0; border-right: 1px solid var(--line);
  background: transparent;
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  color: var(--muted); padding: 11px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: 0.07em;
}
.stepbtn:last-child { border-right: 0; }
.stepbtn .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  background: var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 11px; font-weight: 700;
}
.stepbtn.active { color: var(--bg); background: var(--ink); }
.stepbtn.active .n { background: var(--accent); color: #fff; }
.stepbtn.done { color: var(--ok); }
.stepbtn.done .n { background: var(--ok); color: #fff; }

.progress-wrap { padding: 10px 16px 0; border-bottom: 1px solid var(--line); }
.progress-track {
  height: 6px; background: var(--line); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 25%; background: var(--accent);
  transition: width 0.25s ease;
}
.step-status {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  margin-top: 5px; text-transform: uppercase; letter-spacing: 0.08em;
}

.wizard-panel { padding: 18px 16px 8px; }
.wizard-panel[hidden] { display: none; }

.console {
  display: grid;
  grid-template-columns: minmax(320px, 430px) 1fr;
  gap: 0;
  align-items: start;
}
.console > div + div { border-left: 1px solid var(--line); }
.console > div { padding-left: 0; }
.console > div + div { padding-left: 18px; }
@media (max-width: 960px) {
  .console { grid-template-columns: 1fr; }
  .console > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 16px;
}
.panel h3 {
  font-size: 13px; margin: 0 0 12px;
  color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700;
}

.field { margin-bottom: 12px; }
.field label {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--muted); font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.07em;
}
.field label output { color: var(--accent); font-family: var(--mono); }
.field input[type="range"], .field select {
  width: 100%; accent-color: var(--accent);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); padding: 6px;
  font-size: 13px; font-family: var(--mono);
}
.field input[type="range"] { padding: 0; }
.field .hint { font-size: 10px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-field { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); text-transform: uppercase; letter-spacing: 0.04em; }
.check-field input { accent-color: var(--accent); width: 15px; height: 15px; }

.preset-row { display: flex; gap: 0; flex-wrap: wrap; margin-bottom: 14px; border: 1px solid var(--line); }
.btn {
  background: var(--surface); color: var(--ink);
  border: 0; border-right: 1px solid var(--line);
  padding: 8px 14px; font-size: 11px; font-weight: 700;
  cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.07em;
}
.btn:last-child { border-right: 0; }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--ink); }
.btn[disabled] { opacity: 0.4; cursor: default; }
.btn[disabled]:hover { background: var(--surface); color: var(--ink); }
.btn.primary[disabled]:hover { background: var(--accent); color: #fff; }

/* Telemetry — ledger readouts */
.telemetry { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; margin-bottom: 14px; border: 1px solid var(--line); }
.readout {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 10px 12px;
}
.readout:last-child { border-right: 0; }
.readout .k { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.readout .v { font-family: var(--mono); font-size: 17px; color: var(--accent); margin-top: 2px; }
.readout .v.warn { color: var(--warn); }
.readout .v.fail { color: var(--fail); }
.readout .u { font-size: 10px; color: var(--muted); }

.gauge-wrap { margin: 6px 0 14px; }
.gauge-wrap svg { width: 100%; height: auto; display: block; }
.gauge-label { font-size: 10px; color: var(--muted); text-align: center; margin-top: 4px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.07em; }

.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 10px; color: var(--muted); margin-top: 6px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.chart-legend span::before { content: "■ "; }
.chart-legend .l1::before { color: var(--accent); }
.chart-legend .l2::before { color: var(--ink); }
.chart-legend .l3::before { color: var(--warn); }

/* Audit sheet — ledger table */
.audit { width: 100%; border-collapse: collapse; font-size: 11px; }
.audit th, .audit td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.audit th { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 9px; letter-spacing: 0.08em; border-bottom: 1px solid var(--ink); }
.badge {
  display: inline-block; padding: 2px 8px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.badge.pass { color: var(--ok); }
.badge.fail { color: var(--fail); }
.badge.warn { color: var(--warn); }
.badge.info { color: var(--info); }

.verdict-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.verdict-row .k { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }

.export-row { display: flex; gap: 0; flex-wrap: wrap; margin-top: 14px; border: 1px solid var(--line); }
.receipt {
  margin-top: 14px; background: var(--bg); border: 1px solid var(--line);
  padding: 12px; font-family: var(--mono); font-size: 11px;
  white-space: pre-wrap; word-break: break-all; color: var(--muted);
  max-height: 260px; overflow: auto;
}
.receipt .sha { color: var(--accent); }

/* Wizard nav */
.wizard-nav {
  display: flex; justify-content: space-between; gap: 0;
  border-top: 1px solid var(--ink);
  background: var(--bg);
}
.wizard-nav .btn { flex: 1; border-right: 1px solid var(--line); padding: 12px; }
.wizard-nav .btn:last-child { border-right: 0; }

/* Reference sections — numbered ledger cards */
.ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; border: 1px solid var(--ink); }
.ref-card { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 16px; }
.ref-card:last-child { border-right: 0; }
@media (max-width: 700px) { .ref-card { border-right: 0; border-bottom: 1px solid var(--line); } }
.ref-card h3 { font-size: 12px; color: var(--accent); margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.07em; }
.ref-card table { width: 100%; border-collapse: collapse; font-size: 11px; }
.ref-card td, .ref-card th { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.ref-card th { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; }
.ref-card p { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

.prose { max-width: 78ch; color: var(--muted); }
.prose h3 { color: var(--ink); font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; }
.prose code { font-family: var(--mono); background: var(--bg); padding: 1px 5px; border: 1px solid var(--line); color: var(--accent); font-size: 11px; }
.prose ul { padding-left: 20px; }

footer.site-footer {
  border-top: 1px solid var(--ink); background: var(--surface);
  padding: 26px 24px 40px; margin-top: 40px;
}
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-inner .col { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.footer-inner .col a { color: var(--muted); text-decoration: none; margin-right: 14px; }
.footer-inner .col a:hover { color: var(--accent); }
.footer-inner .legal { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress-fill { transition: none; }
}
