/* ============================================================
   Law School Compute Index — stylesheet
   Serif (IBM Plex Serif) for editorial voice, Sans (IBM Plex Sans)
   for interface chrome, Mono (IBM Plex Mono) for data/specs —
   a deliberate pairing: the legal register and the systems register,
   sharing one type family the same way this site tries to connect
   the two worlds.
   ============================================================ */

:root {
  --bg: #F1F3F1;
  --surface: #FFFFFF;
  --surface-alt: #E7EBE7;
  --ink: #14191D;
  --ink-soft: #4A555C;
  --ink-faint: #79837F;
  --line: #D6DBD5;
  --line-strong: #B7BEB6;
  --accent: #1B6E6E;
  --accent-ink: #0D4444;
  --accent-tint: #DDEBEA;

  /* tier colors: encode "how good is the GPU signal", not decoration */
  --tier-frontier: #9A3412;
  --tier-frontier-tint: #FBE7DC;
  --tier-modern: #166534;
  --tier-modern-tint: #E3F1E6;
  --tier-older: #854D0E;
  --tier-older-tint: #F6EAD3;
  --tier-unspecified: #1D4ED8;
  --tier-unspecified-tint: #E2E9FC;
  --tier-neutral: #63706B;
  --tier-neutral-tint: #E7EBE7;

  --radius: 6px;
  --serif: "IBM Plex Serif", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); }
a:hover { color: var(--accent); }

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

/* ---------------- header ---------------- */

header.masthead {
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 40px 0 28px;
}

.masthead-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.masthead h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink);
}

.masthead p.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0;
  max-width: 46ch;
}

.masthead-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
  text-align: right;
  line-height: 1.6;
  white-space: nowrap;
}

/* ---------------- notice strip (disclaimer + corrections) ---------------- */

.notice-strip {
  background: var(--accent-tint);
  border-bottom: 1px solid var(--line);
  border-top: 3px solid var(--tier-older);
}

.notice-strip .wrap {
  padding: 12px 24px 14px;
}

.disclaimer {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--accent-ink);
  max-width: 82ch;
}
.disclaimer strong { color: var(--tier-older); }

.notice-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
}

.pulled-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-ink);
}

.notice-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-left: auto;
}

.notice-links a {
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}
.notice-links a:hover { color: var(--tier-frontier); border-color: var(--tier-frontier); }

.toolbar-hint {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--ink-faint);
  max-width: 90ch;
}
.toolbar-hint em { font-style: normal; color: var(--ink-soft); font-weight: 600; }

.sort-hint {
  margin: 0 0 8px;
  font-size: 11.5px;
  color: var(--ink-faint);
  font-family: var(--mono);
}

/* ---------------- stats row ---------------- */

.stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  padding: 22px 0 6px;
  font-family: var(--mono);
}

.stat .num {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  display: block;
}
.stat .label {
  font-size: 11.5px;
  color: var(--ink-faint);
  text-transform: lowercase;
}

/* ---------------- toolbar ---------------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 14px 0 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.toolbar input[type="search"] {
  flex: 1 1 260px;
  min-width: 200px;
  height: 38px;
  padding: 0 14px;
  font-family: var(--sans);
  font-size: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.toolbar input[type="search"]:focus,
.toolbar select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.toolbar select {
  height: 38px;
  padding: 0 30px 0 12px;
  font-family: var(--sans);
  font-size: 13.5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%234A555C'/></svg>") no-repeat right 12px center;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  max-width: 220px;
}

.toolbar .reset-btn {
  height: 38px;
  padding: 0 14px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}
.toolbar .reset-btn:hover { border-color: var(--ink-soft); color: var(--ink); }

.result-count {
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
  padding-top: 8px;
}

/* ---------------- table ---------------- */

.table-scroll {
  overflow-x: auto;
  margin: 14px 0 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table.schools {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.schools thead th {
  text-align: left;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--surface-alt);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

table.schools thead th[data-key] {
  cursor: pointer;
  user-select: none;
}
table.schools thead th[data-key]:hover { color: var(--ink); background: var(--accent-tint); }
table.schools thead th[aria-sort="ascending"],
table.schools thead th[aria-sort="descending"] { color: var(--accent-ink); }
table.schools thead th[aria-sort="ascending"]::after { content: " \25B2"; font-size: 9px; }
table.schools thead th[aria-sort="descending"]::after { content: " \25BC"; font-size: 9px; }

table.schools tbody tr {
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
table.schools tbody tr:hover { background: var(--accent-tint); }
table.schools tbody tr.expanded { background: var(--accent-tint); }

table.schools td {
  padding: 11px 14px;
  vertical-align: top;
}

td.col-state { color: var(--ink-faint); white-space: nowrap; font-size: 12.5px; }
td.col-school { font-weight: 600; color: var(--ink); }
td.col-univ { color: var(--ink-soft); }
td.col-resource { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
td.col-gpu { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }

.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.tier-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.tier-frontier   { background: var(--tier-frontier-tint);    color: var(--tier-frontier); }
.tier-frontier .tier-dot { background: var(--tier-frontier); }
.tier-modern     { background: var(--tier-modern-tint);      color: var(--tier-modern); }
.tier-modern .tier-dot { background: var(--tier-modern); }
.tier-older      { background: var(--tier-older-tint);       color: var(--tier-older); }
.tier-older .tier-dot { background: var(--tier-older); }
.tier-unspecified{ background: var(--tier-unspecified-tint); color: var(--tier-unspecified); }
.tier-unspecified .tier-dot { background: var(--tier-unspecified); }
.tier-undetailed, .tier-cpuonly, .tier-none, .tier-standalone, .tier-construction {
  background: var(--tier-neutral-tint); color: var(--tier-neutral);
}
.tier-undetailed .tier-dot, .tier-cpuonly .tier-dot, .tier-none .tier-dot,
.tier-standalone .tier-dot, .tier-construction .tier-dot { background: var(--tier-neutral); }

/* expanded detail row */
tr.detail-row td {
  padding: 0 14px 18px;
  background: var(--accent-tint);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 24px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-strong);
}
.detail-block .k {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-bottom: 3px;
}
.detail-block .v { font-size: 13px; color: var(--ink); line-height: 1.5; }
.detail-block .v a { word-break: break-all; }
.network-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 9px;
  margin: 2px 6px 2px 0;
  color: var(--accent-ink);
}
.caveat-block .v { color: var(--tier-frontier); }

.detail-block-wide { grid-column: 1 / -1; }
.source-list {
  margin: 0;
  padding-left: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
}
.source-list li { margin-bottom: 4px; word-break: break-all; }
.source-list a { color: var(--accent-ink); }
.source-list a:hover { color: var(--tier-frontier); }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-faint);
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
}

/* ---------------- legend ---------------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 4px 0 18px;
  font-size: 12px;
  color: var(--ink-soft);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .tier-dot { width: 8px; height: 8px; }

/* ---------------- footer ---------------- */

footer {
  border-top: 1px solid var(--line-strong);
  background: var(--surface);
  margin-top: 40px;
  padding: 34px 0 40px;
}

footer h2 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 10px;
}

footer p {
  color: var(--ink-soft);
  font-size: 13.5px;
  max-width: 70ch;
  margin: 0 0 14px;
}

.footer-signoff {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  font-size: 13.5px;
  color: var(--ink-soft);
}
.footer-signoff strong { color: var(--ink); }
.footer-signoff a { font-weight: 600; }

/* ---------------- responsive: collapse table to stacked rows ---------------- */

@media (max-width: 760px) {
  .masthead-inner { flex-direction: column; align-items: flex-start; }
  .masthead-meta { text-align: left; }

  table.schools thead { display: none; }
  table.schools, table.schools tbody, table.schools tr, table.schools td { display: block; width: 100%; }
  table.schools tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.schools td { padding: 3px 0; }
  td.col-state::before,
  td.col-univ::before,
  td.col-resource::before,
  td.col-tier::before,
  td.col-gpu::before,
  td.col-slurm::before {
    content: attr(data-label);
    display: inline-block;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    color: var(--ink-faint);
    width: 74px;
  }
  tr.detail-row td { padding: 0 0 14px; }
}

/* focus visibility */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.coverage-note {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--accent-ink);
  max-width: 100ch;
  padding: 6px 10px;
  border-left: 3px solid var(--tier-older);
  background: var(--surface);
}
.coverage-note a { color: var(--accent-ink); font-weight: 600; }
