/* CMMMech — the shared Mech look.
   Brand pastel pair: terracotta blush (A) + mineral sand (B), terracotta red accent.
   Generated by scripts/render_pages.py. */

:root {
  --pastel-a: #F7DDD6;      /* terracotta blush */
  --pastel-b: #F5EBE1;      /* mineral sand */
  --accent: #b54b3f;        /* terracotta red */
  --accent-hover: #9c3f35;
  --ink: #1a1a1a;
  --muted: #555;
  --card: #ffffff;
  --line: rgba(0, 0, 0, .10);
  --code: rgba(0, 0, 0, .05);
  --surface: rgba(255, 255, 255, .60);
  --badge-bg: rgba(181, 75, 63, .12);
  --badge-text: #8e2f24;
  --support-bg: #e2f5e8;
  --support-text: #1d733a;
  --partial-bg: #fff3cd;
  --partial-text: #856404;
  --refute-bg: #f8d7da;
  --refute-text: #721c24;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--pastel-b);
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .75rem 1.4rem;
  background: linear-gradient(135deg, var(--pastel-a), var(--pastel-b));
  border-bottom: 1px solid var(--line);
}
header .brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -.01em;
}
header nav {
  display: flex;
  gap: 1rem;
}
header nav a {
  color: var(--muted);
  font-weight: 500;
}
header nav a:hover {
  color: var(--accent);
}

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 3rem;
}

h1 { letter-spacing: -.02em; margin: .3em 0 .35em; }
h2 {
  font-size: 1.35rem;
  margin: 1.6em 0 .4em;
  padding-bottom: .2em;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
h3 { font-size: 1.1rem; margin: 1.2em 0 .3em; }

p.lede {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

.breadcrumbs {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: .8rem;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

/* Badges */
.badge {
  display: inline-block;
  padding: .15em .55em;
  font-size: .8rem;
  font-weight: 600;
  border-radius: 4px;
  background: var(--badge-bg);
  color: var(--badge-text);
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-critical {
  background: #fde8e4;
  color: #b52b1d;
  border: 1px solid rgba(181, 43, 29, .2);
}
.badge-support {
  background: var(--support-bg);
  color: var(--support-text);
}
.badge-partial {
  background: var(--partial-bg);
  color: var(--partial-text);
}
.badge-refute {
  background: var(--refute-bg);
  color: var(--refute-text);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.stat-label {
  font-size: .9rem;
  color: var(--muted);
  margin-top: .2rem;
}

/* Card grids */
.cards {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.cards li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: transform .15s ease, box-shadow .15s ease;
}
.cards li:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}
.cards a { color: var(--ink); text-decoration: none; }
.cards a:hover strong { color: var(--accent); }
.cards .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.cards .count {
  font-size: .9rem;
  color: var(--muted);
  font-weight: 400;
}
.cards .card-desc {
  font-size: .88rem;
  color: var(--muted);
  margin: .4rem 0 0;
}

/* Detail views */
.detail-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 1.2rem 0;
}
.mechanism-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.2rem;
  margin: 1rem 0;
}
.evidence-item {
  border-top: 1px solid var(--line);
  padding: .6rem 0;
  margin-top: .6rem;
  font-size: .92rem;
}

/* Filter form */
.record-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1rem;
  align-items: flex-end;
  margin: 1rem 0 1.2rem;
  padding: 1rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.record-filters > div {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.record-filters label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}
.record-filters input, .record-filters select {
  font: inherit;
  font-size: .9rem;
  padding: .4rem .6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.record-filters button {
  font: inherit;
  font-size: .88rem;
  padding: .42rem .8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.record-filters button:hover {
  background: var(--pastel-a);
}

/* Table styles */
.record-table-scroll {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin: .5rem 0 1.5rem;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: .92rem;
  background: var(--card);
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--line);
}
th {
  background: var(--pastel-a);
  font-weight: 700;
  white-space: nowrap;
}
tbody tr:hover {
  background: rgba(181, 75, 63, .05);
}
.record-desc {
  font-size: .85rem;
  color: var(--muted);
  margin: .25rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

code {
  font-size: .88em;
  background: var(--code);
  padding: 0 .25em;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 26px 24px;
  text-align: center;
  font-size: .88rem;
  color: var(--muted);
  margin-top: 3rem;
}
footer .fam { margin: .35em 0; }
footer .fam a { margin: 0 .25em; white-space: nowrap; }
footer .fam .self {
  margin: 0 .25em;
  white-space: nowrap;
  font-weight: 700;
  color: var(--ink);
}
footer strong { color: var(--ink); }

/* ---- Dark theme ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pastel-a: #34201c;
    --pastel-b: #1f1b18;
    --accent: #e27d72;
    --accent-hover: #f0958b;
    --ink: #f5ebe6;
    --muted: #b5aba4;
    --card: #28221e;
    --line: #3d3530;
    --code: rgba(255, 255, 255, .08);
    --surface: rgba(255, 255, 255, .04);
    --badge-bg: rgba(226, 125, 114, .18);
    --badge-text: #f0a097;
    --support-bg: #1c3624;
    --support-text: #7ad196;
    --partial-bg: #3d3115;
    --partial-text: #e0b443;
    --refute-bg: #3b1c1e;
    --refute-text: #f18c94;
  }
  :root:not([data-theme="light"]) header {
    background: linear-gradient(135deg, #5c3b35, #4a3e36);
  }
  :root:not([data-theme="light"]) header::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #F7DDD6, #F5EBE1);
  }
  :root:not([data-theme="light"]) .record-filters input,
  :root:not([data-theme="light"]) .record-filters select {
    background: #231e1a;
    color: var(--ink);
    border-color: var(--line);
  }
  :root:not([data-theme="light"]) tbody tr:hover {
    background: rgba(226, 125, 114, .08);
  }
}

:root[data-theme="dark"] {
  --pastel-a: #34201c;
  --pastel-b: #1f1b18;
  --accent: #e27d72;
  --accent-hover: #f0958b;
  --ink: #f5ebe6;
  --muted: #b5aba4;
  --card: #28221e;
  --line: #3d3530;
  --code: rgba(255, 255, 255, .08);
  --surface: rgba(255, 255, 255, .04);
  --badge-bg: rgba(226, 125, 114, .18);
  --badge-text: #f0a097;
  --support-bg: #1c3624;
  --support-text: #7ad196;
  --partial-bg: #3d3115;
  --partial-text: #e0b443;
  --refute-bg: #3b1c1e;
  --refute-text: #f18c94;
}
:root[data-theme="dark"] header {
  background: linear-gradient(135deg, #5c3b35, #4a3e36);
}
:root[data-theme="dark"] header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #F7DDD6, #F5EBE1);
}
:root[data-theme="dark"] .record-filters input,
:root[data-theme="dark"] .record-filters select {
  background: #231e1a;
  color: var(--ink);
  border-color: var(--line);
}
:root[data-theme="dark"] tbody tr:hover {
  background: rgba(226, 125, 114, .08);
}
