/* Beyond the School Score — self-hosted styles, no external requests.
   Calm, civic, trustworthy: warm off-white ground, one deep-teal accent
   used ONLY for links, headings and UI. Data values are always neutral
   ink — never colored, never arrowed, never iconed as better/worse.
   Mobile-first; WCAG AA contrast; dark mode via prefers-color-scheme. */

:root {
  --bg: #faf7f1;
  --panel: #ffffff;
  --ink: #1c1b18;
  --muted: #5c5950;
  --line: #e0dbcf;
  --accent: #0e5a66;
  --accent-soft: #e7f0f0;
  --focus: #b45309;
  /* cover band (landing page only): white on deep teal, 7.9:1 */
  --band-bg: #0e5a66;
  --band-ink: #ffffff;
  --band-muted: #d3e6e8;      /* 6.1:1 on --band-bg */
  --band-dot: rgba(255, 255, 255, .11);
  --band-mark: #e8c27a;
  --band-focus: #fbbf24;      /* 4.7:1 on --band-bg */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16191a;
    --panel: #1f2324;
    --ink: #e9e7e1;
    --muted: #a8a59b;
    --line: #353a3b;
    --accent: #7fc8d1;
    --accent-soft: #1d2c2e;
    --focus: #fbbf24;
    --band-bg: #123b41;
    --band-ink: #eef6f6;
    --band-muted: #b5d3d6;    /* 7.6:1 on --band-bg */
    --band-dot: rgba(255, 255, 255, .07);
    --band-mark: #d9b46a;
    --band-focus: #fbbf24;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
main { max-width: 62rem; margin: 0 auto; padding: 0 1.1rem 3.5rem; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0;
  background: var(--panel); padding: .5rem 1rem; z-index: 10; }
.skip-link:focus { left: .5rem; }

/* ---- site header ---- */
header.site {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.site-inner {
  max-width: 62rem; margin: 0 auto; padding: .65rem 1.1rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.4rem;
}
.brand {
  font-weight: 800; font-size: 1.08rem; letter-spacing: -.012em;
  color: var(--accent); text-decoration: none; white-space: nowrap;
}
header.site nav { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem;
  font-size: .9rem; }
header.site nav a { color: var(--ink); text-decoration: none; }
header.site nav a:hover { color: var(--accent); text-decoration: underline; }
.hdr-search { margin-left: auto; flex: 0 1 15rem; }
.hdr-search input { width: 100%; padding: .38rem .7rem; font-size: .92rem; }
.hdr-results-wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.1rem; }

/* ---- type ---- */
h1 { font-size: 1.85rem; line-height: 1.18; font-weight: 750;
  letter-spacing: -.015em; margin: 0; text-wrap: balance; }
h2 { font-size: 1.12rem; font-weight: 700; color: var(--accent);
  margin: 0 0 .7rem; }
h3 { font-size: 1rem; margin: 1.1rem 0 .35rem; }
p { margin: .5rem 0; }
.prose, .prose p, .prose li { max-width: 68ch; }
.muted, .sub { color: var(--muted); }
.vintage { display: block; font-size: .78rem; color: var(--muted);
  font-weight: 400; }
.caption-note { display: block; font-size: .82rem; color: var(--muted);
  font-weight: 400; margin: .1rem 0 0; }
.median { font-size: .85rem; color: var(--muted); }
.secondary-note { display: block; font-size: .8rem; color: var(--muted);
  font-weight: 400; margin-top: .15rem; white-space: normal; }

.prose h2 { margin-top: 1.8rem; }
.prose table.metrics { margin: .6rem 0 1rem; }
.is-home .hdr-search { display: none; }
.card table.metrics + table.metrics { margin-top: 1.1rem; }
.card h3:first-of-type { margin-top: .2rem; }

/* ---- inputs & buttons ---- */
input[type="search"], input[type="text"], select {
  font: inherit; padding: .5rem .7rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink);
}
.btnrow { display: flex; gap: .6rem; flex-wrap: wrap; margin: .8rem 0 0; }
.btnrow a, .btnrow button {
  font: inherit; font-size: .9rem; font-weight: 600;
  padding: .42rem .95rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--panel);
  color: var(--accent); text-decoration: none;
}
.btnrow a:hover, .btnrow button:hover { background: var(--accent-soft); }

/* ---- cards ---- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 1.1rem 1.25rem; margin: 1.1rem 0;
}
.card > :last-child { margin-bottom: 0; }

/* ---- school header ---- */
.page-head { padding: 1.5rem 0 .2rem; }
.title-row { display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .2rem .9rem; }
.title-row .meta { color: var(--muted); font-size: .98rem; }
.notice { margin: .7rem 0 .2rem; padding: .6rem .9rem;
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: 6px; max-width: 46rem; font-size: .95rem; }
.notice p { margin: 0; }
.notice .notice-src { margin-top: .25rem; font-size: .8rem;
  color: var(--muted); }
.notice-closed { border-left-color: var(--muted); }
.contact { margin: .35rem 0 0; font-size: .95rem; }
.contact .vintage { display: inline; }
.linkrow { display: flex; flex-wrap: wrap; gap: .15rem 1.2rem;
  margin: .45rem 0 0; font-size: .88rem; }

/* ---- at a glance ---- */
.glance { margin: 1.3rem 0 .4rem; }
.glance-grid { display: grid; gap: .7rem;
  grid-template-columns: repeat(3, 1fr); }
@media (min-width: 1000px) {
  .glance-grid { grid-template-columns: repeat(6, 1fr); }
}
.gcard {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: .8rem .9rem;
  display: flex; flex-direction: column; gap: .12rem;
}
.gcard .glabel { font-size: .82rem; color: var(--muted); line-height: 1.3;
  min-height: 2.6em; }
.gcard .gvalue { font-size: 1.7rem; font-weight: 700; line-height: 1.15;
  font-variant-numeric: tabular-nums; color: var(--ink); }
.gcard .gvalue .state-suppressed, .gcard .gvalue .state-not_reported,
.gcard .gvalue .state-not_applicable { font-size: 1.05rem; font-weight: 600;
  font-style: italic; }
.gcard .gcap { font-size: .74rem; color: var(--muted); }
.gcard .median { font-size: .8rem; margin-top: auto; padding-top: .3rem; }

/* ---- metric tables (rows inside cards) ---- */
table.metrics { width: 100%; border-collapse: collapse; }
table.metrics caption { text-align: left; font-weight: 700;
  padding: 0 0 .35rem; }
table.metrics th, table.metrics td {
  text-align: left; padding: .6rem .6rem .6rem 0;
  border-top: 1px solid var(--line); vertical-align: top; font-weight: 400;
}
table.metrics tbody tr:first-child th,
table.metrics tbody tr:first-child td { border-top: none; }
table.metrics.rows { table-layout: fixed; }
table.metrics th[scope="row"] { font-weight: 600; width: 46%; }
table.metrics.rows td.num { width: 22%; white-space: normal; }
table.metrics.rows td.ctx { width: 32%; }
table.metrics thead th { font-size: .8rem; color: var(--muted);
  font-weight: 600; border-top: none; padding-top: 0; }
table.metrics td.num { font-variant-numeric: tabular-nums;
  font-weight: 650; white-space: nowrap; }
table.metrics td.num .state-suppressed,
table.metrics td.num .state-not_reported,
table.metrics td.num .state-not_applicable { font-weight: 500;
  font-style: italic; }
table.metrics td.ctx { color: var(--muted); font-size: .88rem; }
details.note { margin-top: .2rem; font-size: .86rem; font-weight: 400; }
details.note summary { cursor: pointer; color: var(--accent); }
details.note div { padding: .35rem 0 .1rem; color: var(--muted);
  max-width: 60ch; }

/* compact one-row tables (grades, class-size buckets) */
table.strip th, table.strip td { text-align: center; padding: .4rem .3rem; }
table.strip thead th { font-size: .82rem; }
table.strip td.num { font-weight: 650; }

/* ---- home ---- */
.hero { padding: 2.4rem 0 1.2rem; }
.hero .eyebrow { font-size: .8rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent); font-weight: 700; }
.hero h1 { font-size: 2.3rem; margin: .3rem 0 .5rem; }
.hero .purpose { font-size: 1.08rem; color: var(--muted); max-width: 44rem;
  margin: 0 0 1.1rem; }
.hero input[type="search"] { width: 100%; max-width: 38rem;
  font-size: 1.1rem; padding: .8rem 1rem; border-width: 2px;
  border-color: var(--accent); }
.search-filters { display: flex; gap: .5rem .7rem; align-items: center;
  flex-wrap: wrap; margin: .7rem 0 0; font-size: .88rem;
  color: var(--muted); }
.search-filters select { padding: .3rem .45rem; font-size: .88rem;
  max-width: 100%; }
.howto-grid { display: grid; gap: .7rem; margin: 1.4rem 0;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.howto-grid .card { margin: 0; padding: .9rem 1rem; font-size: .93rem; }
.howto-grid strong { display: block; color: var(--accent);
  margin-bottom: .15rem; }
ul.plain { list-style: none; padding: 0; margin: 0; }

/* ---- cover (brand landing page) ----
   The header merges into a full-width teal band; the content is the
   same as ever: name, purpose, state chooser. The dot texture is pure
   decoration and carries no data. */
.is-landing main { max-width: none; padding: 0 0 3.5rem; }
.cover-wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.1rem; }
.is-landing header.site { background: var(--band-bg); border-bottom: 0;
  --focus: var(--band-focus);
  /* header height is fractional; paint over the sub-pixel seam so no
     hairline of page background shows between header and band */
  position: relative; z-index: 2; box-shadow: 0 2px 0 var(--band-bg); }
.is-landing .brand { color: var(--band-ink); }
.is-landing header.site nav a { color: var(--band-muted); }
.is-landing header.site nav a:hover { color: var(--band-ink); }
.band { position: relative; overflow: hidden; background: var(--band-bg);
  color: var(--band-ink); --focus: var(--band-focus); }
.band::after { content: ""; position: absolute; top: 0; right: 0;
  bottom: 0; width: min(46%, 32rem); pointer-events: none;
  background-image: radial-gradient(var(--band-dot) 1.6px,
                                    transparent 1.8px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to left, #000 35%, transparent);
  mask-image: linear-gradient(to left, #000 35%, transparent); }
.band-inner { position: relative; z-index: 1;
  padding-top: 3.6rem; padding-bottom: 4.4rem; }
.band h1 { font-size: clamp(2.35rem, 1.3rem + 3.8vw, 3.7rem);
  line-height: 1.04; letter-spacing: -.028em; font-weight: 800;
  max-width: 13ch; margin: 0 0 1.15rem; }
.band h1::before { content: ""; display: block; width: 3rem; height: 4px;
  border-radius: 2px; background: var(--band-mark); margin-bottom: 1.4rem; }
.band .purpose { font-size: clamp(1.08rem, 1rem + .45vw, 1.32rem);
  line-height: 1.55; color: var(--band-muted); max-width: 40rem;
  margin: 0; }
.band .no-rank { color: var(--band-ink); font-weight: 700;
  white-space: nowrap; }
.chooser { padding-top: 2.7rem; }
.chooser h2 { font-size: .8rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .9rem; }
.state-list li { max-width: 36rem; }
.state-live { display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: .1rem 1rem; padding: 1.15rem 1.35rem;
  background: var(--panel); color: var(--ink); text-decoration: none;
  border: 1px solid var(--line); border-left: 5px solid var(--accent);
  border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  transition: box-shadow .15s ease, transform .15s ease; }
.state-live:hover { box-shadow: 0 8px 22px rgba(14, 90, 102, .16);
  transform: translateY(-1px); }
.state-live .state-name { font-size: 1.5rem; font-weight: 750;
  line-height: 1.2; color: var(--accent); }
.state-live .state-sub { color: var(--muted); font-size: .95rem; }
.state-live .state-arrow { grid-column: 2; grid-row: 1 / span 2;
  font-size: 1.6rem; color: var(--accent);
  transition: transform .15s ease; }
.state-live:hover .state-arrow { transform: translateX(4px); }
.coming { display: flex; flex-wrap: wrap; align-items: center;
  gap: .45rem; margin: 1.15rem 0 0; font-size: .9rem;
  color: var(--muted); }
.coming-label { font-weight: 600; margin-right: .15rem; }
.chip { border: 1px dashed var(--line); border-radius: 999px;
  padding: .18rem .75rem; }
@media (prefers-reduced-motion: reduce) {
  .state-live, .state-live .state-arrow { transition: none; }
  .state-live:hover, .state-live:hover .state-arrow { transform: none; }
}
.grid-list { display: grid; gap: .1rem 1.6rem;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); }
.grid-list li { padding: .4rem 0; border-bottom: 1px solid var(--line);
  font-size: .95rem; line-height: 1.35; }
.grid-list .muted { display: block; font-size: .8rem; }

/* ---- search results ---- */
#hdr-results .search-results, #home-results .search-results {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; margin: .5rem 0; max-height: 22rem;
  overflow-y: auto; }
#hdr-results li, #home-results li { padding: .4rem .85rem;
  border-bottom: 1px solid var(--line); }
#hdr-results li:last-child, #home-results li:last-child {
  border-bottom: none; }
.search-none { color: var(--muted); }
.add-compare { font-size: .78rem; white-space: nowrap; }

/* ---- compare ---- */
#compare-root { overflow-x: auto; }
table.compare th[scope="col"] { min-width: 9.5rem; vertical-align: top; }
table.compare thead th { font-size: .95rem; color: var(--ink); }
table.compare th .remove-col { display: block; font-size: .72rem;
  font-weight: 400; }
table.compare td .median { display: block; font-weight: 400; }

/* ---- footer ---- */
footer.site { border-top: 1px solid var(--line); margin-top: 2.5rem;
  background: var(--panel); }
footer.site .site-inner { display: block; padding: 1.1rem 1.1rem 2.2rem;
  font-size: .84rem; color: var(--muted); }
footer.site p { max-width: 70ch; }

/* ---- small screens: stack, never hide the district median ---- */
@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero { padding-top: 1.5rem; }
  .site-inner { gap: .35rem .9rem; padding: .55rem 1.1rem; }
  .hdr-search { flex: 1 1 100%; margin-left: 0; order: 3; }
  header.site nav { font-size: .85rem; gap: .2rem .9rem; }
  .glance-grid { grid-template-columns: 1fr 1fr; gap: .55rem; }
  .gcard .gvalue { font-size: 1.45rem; }
  .card { padding: .95rem 1rem; }
  table.metrics.rows, table.metrics.rows tbody, table.metrics.rows tr,
  table.metrics.rows th, table.metrics.rows td { display: block;
    width: auto; }
  table.metrics.rows tr { border-top: 1px solid var(--line);
    padding: .6rem 0; }
  table.metrics.rows tbody tr:first-child { border-top: none;
    padding-top: 0; }
  table.metrics.rows th, table.metrics.rows td { border: none; padding: 0; }
  table.metrics.rows td.num { margin-top: .25rem; font-size: 1.12rem;
    width: auto; }
  table.metrics.rows td.ctx { margin-top: .1rem; width: auto; }
  table.metrics.rows th[scope="row"] { width: auto; }
  table.strip thead th { font-size: .72rem; padding: .3rem .1rem; }
  table.strip td.num { font-size: .92rem; padding: .35rem .1rem; }
  .band-inner { padding-top: 2.4rem; padding-bottom: 2.9rem; }
  .band h1::before { margin-bottom: 1.1rem; }
  .band::after { width: 62%; }
  .chooser { padding-top: 1.9rem; }
  .state-live { padding: 1rem 1.1rem; }
  .state-live .state-name { font-size: 1.35rem; }
}

@media print {
  header.site nav, .hdr-search, .hdr-results-wrap, .btnrow, .skip-link,
  .search-filters, #home-results, details.note, .linkrow { display: none !important; }
  :root { --bg: #fff; --panel: #fff; --ink: #000; --muted: #333;
    --line: #999; --accent: #000; --accent-soft: #fff;
    --band-bg: #fff; --band-ink: #000; --band-muted: #333; }
  .band::after, .band h1::before { display: none; }
  .band-inner { padding-top: 0; padding-bottom: 1rem; }
  .state-live { box-shadow: none; }
  body { font-size: 10.5pt; }
  main { max-width: none; padding: 0; }
  .card, .gcard { break-inside: avoid; border-color: #999; }
  .glance-grid { grid-template-columns: repeat(3, 1fr); }
  a { color: #000; text-decoration: none; }
  h2 { break-after: avoid; }
  table.compare { font-size: 9pt; }
}
