/* mpCGC — shared skeleton (Draft C base, refined) */
:root {
  --bg: #f8f9fb;
  --panel: #ffffff;
  --ink: #0a1929;
  --ink-mid: #2c3e50;
  --ink-soft: #6b7d8d;
  --rule: #e1e6ec;
  --rule-soft: #eef1f5;
  --teal: #4a5d2f;        /* olive — drawn from logo */
  --teal-soft: #e9ecdf;
  --sand: #c9803a;
  --sand-soft: #f6e6d4;
  --shadow-sm: 0 1px 2px rgba(10,25,41,.04);
  --shadow-md: 0 2px 8px rgba(10,25,41,.06), 0 0 0 1px var(--rule);
}
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
.serif { font-family: 'IBM Plex Serif', Georgia, serif; }
.mono  { font-family: 'IBM Plex Mono', Menlo, monospace; }

/* App-shell layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

/* Left rail */
aside.rail {
  background: var(--panel); border-right: 1px solid var(--rule);
  padding: 22px 18px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
aside.rail .brand {
  display: flex; align-items: center; gap: 10px; padding: 0 6px 18px;
  border-bottom: 1px solid var(--rule-soft); margin-bottom: 12px;
  text-decoration: none; color: var(--ink);
}
aside.rail .brand img.logo {
  width: 56px; height: 56px; object-fit: contain;
}
aside.rail .brand .nm {
  font-weight: 700; font-size: 17px; letter-spacing: -.005em;
  font-family: 'IBM Plex Sans', sans-serif;
}
aside.rail .brand .nm small {
  display: block; font-weight: 400; color: var(--ink-soft);
  font-size: 10.5px; margin-top: 2px; letter-spacing: 0;
}
aside.rail .gp {
  margin: 16px 0 6px; padding: 0 6px;
  font-size: 10.5px; color: var(--ink-soft); text-transform: uppercase;
  letter-spacing: .08em; font-weight: 600;
}
aside.rail a.nav {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 6px; color: var(--ink-mid); font-size: 13.5px; font-weight: 500;
  text-decoration: none; margin-bottom: 1px;
}
aside.rail a.nav:hover { background: var(--rule-soft); color: var(--ink); text-decoration: none; }
aside.rail a.nav.active { background: var(--teal-soft); color: var(--teal); font-weight: 600; }
aside.rail a.nav .badge {
  margin-left: auto; font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px; color: var(--ink-soft); font-weight: 400;
}

/* Main content */
main.main { display: flex; flex-direction: column; min-width: 0; }

/* Top bar */
header.bar {
  background: var(--panel); border-bottom: 1px solid var(--rule);
  padding: 12px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  position: sticky; top: 0; z-index: 50;
}
header.bar .search {
  flex: 1; max-width: 720px; display: flex; align-items: center;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 6px;
  padding: 6px 10px; gap: 8px;
}
header.bar .search:focus-within { border-color: var(--teal); background: #fff; }
header.bar .search svg { width: 16px; height: 16px; color: var(--ink-soft); flex-shrink: 0; }
header.bar .search input {
  flex: 1; border: none; background: transparent; padding: 4px 0;
  font-size: 13.5px; outline: none; font-family: inherit;
}
header.bar .search kbd {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; padding: 2px 5px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 3px;
  color: var(--ink-soft);
}
header.bar .actions { display: flex; align-items: center; gap: 16px; }
header.bar .actions a { font-size: 13px; color: var(--ink-soft); }
header.bar .actions a:hover { color: var(--ink); }

/* Page title block (used on family/taxonomy/MAG pages) */
section.page-title {
  padding: 28px 32px 18px;
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--rule);
}
section.page-title .crumbs { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
section.page-title .crumbs a { color: var(--ink-soft); }
section.page-title h1 {
  font-family: 'IBM Plex Serif', serif;
  font-size: 28px; font-weight: 600; letter-spacing: -.012em;
  line-height: 1.25;
}
section.page-title h1 small {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px; font-weight: 400; color: var(--ink-soft);
  display: block; margin-top: 4px; letter-spacing: 0;
}
section.page-title .stats {
  display: flex; gap: 36px; margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--rule-soft); flex-wrap: wrap;
}
section.page-title .stat .v {
  font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -.01em;
}
section.page-title .stat .l {
  font-size: 11px; color: var(--ink-soft); text-transform: uppercase;
  letter-spacing: .06em; margin-top: 2px;
}

/* Section content */
section.body { padding: 28px 32px; }
section.body h2 {
  font-size: 18px; font-weight: 600; margin-bottom: 6px; letter-spacing: -.005em;
  display: flex; align-items: baseline; justify-content: space-between;
}
section.body h2 .meta {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  color: var(--ink-soft); font-weight: 400;
}
section.body p.sub { color: var(--ink-soft); margin-bottom: 14px; font-size: 13.5px; }
section.body .panel {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 8px;
  padding: 20px; margin-bottom: 24px;
}
section.body .panel.flush { padding: 0; overflow: hidden; }
section.body iframe.embed {
  width: 100%; border: none; display: block;
}
section.body iframe.embed.phylo { height: 1100px; }
section.body iframe.embed.ssn   { height: 780px; }
section.body iframe.embed.scone { height: 760px; }
section.body iframe.embed.sunburst { height: 920px; }

/* Tables */
table.data {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
table.data thead th {
  text-align: left; padding: 10px 14px; background: var(--bg);
  font-weight: 600; color: var(--ink-mid); font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--rule);
}
table.data tbody td {
  padding: 9px 14px; border-bottom: 1px solid var(--rule-soft);
}
table.data tbody tr:hover td { background: #fafbfc; }
table.data th.r { text-align: right; }
table.data tbody td.r { text-align: right; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--ink-mid); }
table.data tbody td.mono { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; }

/* Key/value table */
table.kv { width: 100%; font-size: 13.5px; }
table.kv th {
  text-align: left; padding: 6px 12px 6px 0; color: var(--ink-soft);
  font-weight: 500; vertical-align: top; width: 200px;
}
table.kv td { padding: 6px 0; }

/* Hero strip (for non-page-title heroes — used on home + statistics) */
section.hero-strip {
  padding: 36px 32px 28px;
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--rule);
}
section.hero-strip h1 {
  font-family: 'IBM Plex Serif', serif;
  font-size: 30px; font-weight: 600; letter-spacing: -.015em;
  line-height: 1.2; max-width: 820px;
}
section.hero-strip h1 .em { color: var(--teal); }
section.hero-strip p.lede {
  font-size: 15px; color: var(--ink-soft); max-width: 720px; margin-top: 10px;
}
section.hero-strip .stats {
  display: grid; grid-template-columns: repeat(6, max-content); gap: 36px;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule-soft);
}
section.hero-strip .stat .v {
  font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.01em;
}
section.hero-strip .stat .l {
  font-size: 11px; color: var(--ink-soft); text-transform: uppercase;
  letter-spacing: .06em; margin-top: 2px;
}

/* Browse cards (used on home) */
section.cards { padding: 36px 32px; }
section.cards .head { margin-bottom: 16px; display: flex; align-items: baseline; justify-content: space-between; }
section.cards .head h2 { font-size: 19px; font-weight: 600; letter-spacing: -.005em; }
section.cards .head .more { font-size: 13px; color: var(--teal); }
section.cards .grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.tile {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 8px;
  padding: 16px 18px; transition: all .15s ease;
  display: flex; flex-direction: column; gap: 4px;
  text-decoration: none; color: var(--ink);
}
.tile:hover { border-color: var(--teal); box-shadow: var(--shadow-sm); text-decoration: none; }
.tile .top { display: flex; justify-content: space-between; align-items: baseline; }
.tile .top .name { font-size: 15px; font-weight: 600; color: var(--ink); }
.tile .top .tag {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px;
  padding: 2px 6px; border-radius: 3px;
  background: var(--teal-soft); color: var(--teal); font-weight: 500;
}
.tile .meta {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-mid);
  margin-top: 6px; display: flex; justify-content: space-between;
}
.tile.sand { border-top: 2px solid var(--sand); }
.tile.sand .top .tag { background: var(--sand-soft); color: var(--sand); }
.tile.teal { border-top: 2px solid var(--teal); }

/* Footer */
footer.foot {
  padding: 24px 32px; border-top: 1px solid var(--rule); margin-top: auto;
  background: var(--panel);
  font-size: 12.5px; color: var(--ink-soft);
  display: flex; justify-content: space-between; align-items: center;
}
footer.foot .left { display: flex; gap: 24px; }
footer.foot a { color: var(--ink-soft); }
footer.foot a:hover { color: var(--ink); }
footer.foot .v { font-family: 'IBM Plex Mono', monospace; font-size: 11px; }

/* Pills / badges */
.pill {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 12px;
  background: var(--teal-soft); color: var(--teal); font-weight: 500;
  font-family: 'IBM Plex Sans', sans-serif;
}
.pill.sand { background: var(--sand-soft); color: var(--sand); }
.pill.gray { background: var(--rule-soft); color: var(--ink-soft); }

/* Two-col content layout for prose pages (about) */
.prose { max-width: 760px; }
.prose h2 { font-family: 'IBM Plex Serif', serif; font-size: 22px; font-weight: 600; margin: 28px 0 8px; letter-spacing: -.01em; }
.prose h3 { font-size: 15px; font-weight: 600; margin: 18px 0 6px; color: var(--ink-mid); }
.prose p { margin-bottom: 12px; }
.prose ul { margin: 8px 0 12px 24px; }
.prose code { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; background: var(--rule-soft); padding: 1px 5px; border-radius: 3px; }
