/*
 * Audit site stylesheet — terse, fast, low-decoration.
 * Aesthetic target: MDN reference pages, BSD man page rendering.
 */

:root {
  --bg: #fdfdfd;
  --fg: #1a1a1a;
  --muted: #6a6a6a;
  --link: #0a4d8a;
  --link-visited: #5e35b1;
  --border: #e0e0e0;
  --code-bg: #f4f4f4;
  --warn-bg: #fff5e0;
  --warn-fg: #8a4500;
  --warn-border: #e0b070;
  --max-w: 56rem;
  --mono: ui-monospace, 'SF Mono', Menlo, 'Cascadia Mono', Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 15px; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
}

.site-header,
.site-footer,
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-weight: 600;
  text-decoration: none;
  font-size: 1.05rem;
  color: var(--fg);
}

.site-header nav {
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.site-header nav a { color: var(--link); }

.site-footer {
  margin-top: 4rem;
  padding-top: 1rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

main {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

a { color: var(--link); }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }

h1 { font-size: 1.8rem; margin: 0.2rem 0 0.5rem; line-height: 1.2; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.5rem; padding-top: 0.4rem; border-top: 1px solid var(--border); }
h3 { font-size: 1rem; margin: 1.25rem 0 0.4rem; }

code, .hash {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
.hash { word-break: break-all; }

.breadcrumb {
  color: var(--muted);
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
}

.muted { color: var(--muted); }

.warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
  padding: 0.25rem 0.6rem;
  border-left: 3px solid var(--warn-border);
  display: inline-block;
}

.sep { color: var(--muted); margin: 0 0.25rem; }

.cite {
  font-size: 0.78em;
  text-decoration: none;
  color: var(--link);
  vertical-align: super;
}
.cite:hover { text-decoration: underline; }

.description {
  font-size: 1.05rem;
  margin: 0.5rem 0 1rem;
}

/* Spec dl — two-column */
dl.specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1.25rem;
  margin: 0;
}
dl.specs dt {
  color: var(--muted);
  font-weight: 500;
}
dl.specs dd { margin: 0; }

/* Tables */
table.data {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.93rem;
}
table.data th,
table.data td {
  text-align: left;
  vertical-align: top;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
table.data th {
  background: var(--code-bg);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.data tr:hover td { background: #fafafa; }

/* Capabilities */
ul.capabilities {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
ul.capabilities li {
  margin: 0.4rem 0 0.6rem;
  padding-left: 0;
}
.cap-notes {
  color: var(--fg);
  font-size: 0.93rem;
  margin-top: 0.15rem;
}

/* References */
ul.references {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
ul.references li {
  margin: 0.5rem 0 0.8rem;
  padding-left: 0;
}
.ref-meta {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 0.1rem;
}

/* Index page */
.hero {
  padding: 0.5rem 0 1rem;
}
.lede {
  font-size: 1.05rem;
  color: var(--fg);
  max-width: 44rem;
  margin: 0;
}
.stats dl {
  display: flex;
  gap: 2rem;
  margin: 1rem 0 0;
  flex-wrap: wrap;
}
.stats dt {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}
.stats dd { margin: 0; font-size: 1.5rem; font-weight: 600; }

.module-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.module-list li {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
}
.module-list li:last-child { border-bottom: none; }
.module-list a { text-decoration: none; }
.module-list a:hover strong { text-decoration: underline; }
.module-list strong { font-size: 1.05rem; }
.module-list .hp {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.1rem 0.5rem;
  background: var(--code-bg);
  font-size: 0.85rem;
  color: var(--muted);
  border-radius: 3px;
  font-family: var(--mono);
}
.module-list .desc {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* PDF frame on source pages */
.pdf-frame {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-top: 0.5rem;
}

/* Tighten on small screens */
@media (max-width: 38rem) {
  html { font-size: 14px; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.1rem; }
  table.data { font-size: 0.85rem; }
  table.data th, table.data td { padding: 0.3rem 0.4rem; }
  dl.specs { grid-template-columns: 1fr; gap: 0 0.5rem; }
  dl.specs dt { margin-top: 0.4rem; }
}
