/* styles.css — theme_03 "Swiss Grid Technical Ledger" for aylsa.com
   Tokens: bg #f4f4f0 · surface #ffffff · ink #111111 · accent #d9381e · muted #4b5563 */

:root {
  --bg: #f4f4f0;
  --surface: #ffffff;
  --ink: #111111;
  --accent: #d9381e;
  --muted: #4b5563;
  --hairline: #c9c9c2;
  --hairline-soft: #ddd9cf;
  --pass: #1a7f37;
  --warn: #9a6700;
  --fail: #b42318;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--ink);
  background: var(--surface);
}

.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 28px;
}

.disclosure-strip {
  margin: 0 -24px 22px;
  padding: 9px 24px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
.disclosure-strip a { color: #ffd9d2; }

.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 0 0 14px;
  font-weight: 800;
}
h1 .dot { color: var(--accent); }

.lede {
  max-width: 62ch;
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 14px;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--hairline);
  padding-top: 12px;
}

/* ---------- Swiss grid shell ---------- */

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.module {
  margin-top: 48px;
  border-top: 2px solid var(--ink);
  padding-top: 20px;
}

.module-head {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 20px;
}

.mod-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 0;
  text-align: center;
  letter-spacing: 0.08em;
}

.module h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hint { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 70ch; }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.col-4 { grid-column: span 4; padding: 18px; border-right: 1px solid var(--hairline-soft); }
.col-4:last-child { border-right: 0; }
.col-6 { grid-column: span 6; padding: 18px; }
.col-6:first-child { border-right: 1px solid var(--hairline-soft); }

@media (max-width: 860px) {
  .col-4, .col-6 { grid-column: span 12; border-right: 0; border-bottom: 1px solid var(--hairline-soft); }
  .col-4:last-child, .col-6:first-child { border-bottom: 0; }
}

/* ---------- Forms ---------- */

.field {
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 7px 9px;
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 0;
}
.field input:focus, .field select:focus { border-color: var(--accent); }

.features {
  margin-top: 4px;
  border: 1px solid var(--hairline);
  border-top: 2px solid var(--ink);
  padding: 12px 16px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 13px;
}
.features legend {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px;
}
.features label { display: flex; align-items: center; gap: 7px; }
.features input { accent-color: var(--accent); }

/* ---------- Verdict + tables ---------- */

.verdict {
  margin: 18px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--ink);
  border-left: 6px solid var(--pass);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.verdict.warn { border-left-color: var(--warn); }
.verdict.fail { border-left-color: var(--fail); }

.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); background: var(--surface); margin-top: 18px; }

table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
}
table.ledger th, table.ledger td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline-soft);
  vertical-align: top;
}
table.ledger thead th {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
  background: var(--bg);
}
table.ledger tbody tr:last-child td { border-bottom: 0; }
table.ledger th[scope], table.ledger td:first-child { font-weight: 600; }

.st-pass { color: var(--pass); font-weight: 700; }
.st-warn { color: var(--warn); font-weight: 700; }
.st-fail { color: var(--fail); font-weight: 700; }

/* ---------- KPI strip ---------- */

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--hairline);
  background: var(--surface);
  margin-bottom: 18px;
}
.kpi-box { padding: 14px 16px; border-right: 1px solid var(--hairline-soft); }
.kpi-box:last-child { border-right: 0; }
.kpi-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi-num {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.kpi-box.warn .kpi-num { color: var(--warn); }

/* ---------- Chart + split ---------- */

.split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 0;
  border: 1px solid var(--hairline);
  background: var(--surface);
}
.chart-panel { margin: 0; padding: 14px; border-right: 1px solid var(--hairline-soft); }
.col-side { margin-top: 0; border: 0; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .chart-panel { border-right: 0; border-bottom: 1px solid var(--hairline-soft); }
}

/* ---------- Checklist ---------- */

.checklist-score {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--ink);
  border-left: 6px solid var(--accent);
  background: var(--surface);
  padding: 12px 16px;
  margin-bottom: 14px;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--hairline);
  background: var(--surface);
  columns: 2;
  column-gap: 0;
}
@media (max-width: 700px) { .checklist { columns: 1; } }
.checklist li {
  padding: 9px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  break-inside: avoid;
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 13.5px;
}
.checklist li .cid { font-family: var(--mono); font-size: 11px; color: var(--muted); min-width: 30px; }
.checklist li .mk { font-weight: 700; min-width: 34px; }

/* ---------- Actions / code ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.btn {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 9px 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  border-radius: 0;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

.status-line { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

.code-box {
  margin: 0;
  padding: 16px;
  background: var(--ink);
  color: #e8e6df;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  max-height: 420px;
  overflow-y: auto;
}

/* ---------- Reference ---------- */

.ref-h {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ref-p { font-size: 14px; color: var(--ink); margin: 0 0 12px; max-width: 60ch; }
.ref-p code, .hint code { font-family: var(--mono); font-size: 0.92em; background: var(--bg); padding: 1px 4px; border: 1px solid var(--hairline-soft); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--surface);
  padding: 28px 24px 40px;
  max-width: 1180px;
  margin: 0 auto;
  font-size: 13.5px;
}
.site-footer p { margin: 0 0 8px; }
.legal-links a { margin-right: 14px; }
.fine { color: var(--muted); font-size: 12px; margin-top: 12px !important; }
