/* HabitatMech site styles.
   Deliberately dependency-free: the site is 3,000+ static pages generated in
   CI, so every kilobyte of framework is paid for thousands of times, and a
   corpus browser is almost entirely tables and definition lists anyway. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1a1d21;
  --muted: #5b6470;
  --line: #dfe3e8;
  --accent: #2b6a4d;
  --accent-soft: #e8f1ec;
  --code-bg: #f4f6f8;
  --warn: #8a5a00;
  --warn-soft: #fdf4e3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --fg: #e6e9ec;
    --muted: #9aa4b0;
    --line: #2b3138;
    --accent: #7fc9a3;
    --accent-soft: #1b2a23;
    --code-bg: #1c2126;
    --warn: #e0b361;
    --warn-soft: #2a2113;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1.25rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap { max-width: 60rem; margin: 0 auto; }
.wrap.wide { max-width: 76rem; }

header.site {
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
  padding: 1.25rem 0 1rem;
}
header.site a.brand {
  font-weight: 700; font-size: 1.1rem; color: var(--fg); text-decoration: none;
}
header.site nav { margin-top: .4rem; font-size: .9rem; }
header.site nav a { color: var(--muted); text-decoration: none; margin-right: 1rem; }
header.site nav a:hover, header.site nav a:focus { color: var(--accent); text-decoration: underline; }

h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 .35rem; }
h2 { font-size: 1.15rem; margin: 2.2rem 0 .6rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
h3 { font-size: 1rem; margin: 1.4rem 0 .4rem; }
p { margin: .6rem 0; }
a { color: var(--accent); }

.lede { color: var(--muted); font-size: 1.02rem; }

code, .curie {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .87em;
  background: var(--code-bg);
  padding: .1em .35em;
  border-radius: 3px;
}

table { border-collapse: collapse; width: 100%; margin: .8rem 0; font-size: .93rem; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-block; font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  padding: .12rem .5rem; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); border: 1px solid transparent; white-space: nowrap;
}
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.plain { background: var(--code-bg); color: var(--muted); }

.meta { color: var(--muted); font-size: .9rem; margin: .3rem 0 1rem; }
.meta .sep { margin: 0 .45rem; opacity: .5; }

/* A plain proportional bar. No chart library for one distribution. */
.bar { background: var(--code-bg); border-radius: 3px; height: .55rem; overflow: hidden; min-width: 3rem; }
.bar > span { display: block; height: 100%; background: var(--accent); }

ul.plain { list-style: none; padding: 0; margin: .5rem 0; }
ul.plain li { padding: .3rem 0; border-bottom: 1px solid var(--line); }

/* Curation decisions. Unnumbered because the count is not the point and a
   record with one decision should not read as "1." of an implied series. */
ol.events { list-style: none; padding: 0; margin: .5rem 0; }
ol.events li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
ol.events li > p { margin: .4rem 0 0; }
ol.events .meta { margin: 0 0 0 .4rem; display: inline; }

.note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: .7rem .9rem;
  margin: 1.1rem 0;
  font-size: .93rem;
  border-radius: 0 4px 4px 0;
}
.note.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.note p:first-child { margin-top: 0; }
.note p:last-child { margin-bottom: 0; }

footer.site {
  margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .85rem;
}

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin: 1.2rem 0; }
.card { border: 1px solid var(--line); border-radius: 6px; padding: .8rem .9rem; }
.card .n { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.card .k { color: var(--muted); font-size: .84rem; }

.searchbox {
  width: 100%; padding: .55rem .7rem; font-size: 1rem; margin: .6rem 0 1rem;
  border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--fg);
}

caption {
  caption-side: top; text-align: left; color: var(--muted);
  font-size: .82rem; text-transform: uppercase; letter-spacing: .03em;
  padding-bottom: .3rem;
}

/* Available to screen readers, absent from the visual layout. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Filter hides rows by class rather than inline style, so the browser can
   batch the change instead of laying out per row per keystroke (#34). */
.is-hidden { display: none; }

.pager { margin: 1rem 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.pager a, .pager span { padding: .15rem .5rem; border-radius: 4px; }
.pager a { background: var(--code-bg); }
