/* Cheapest Online Colleges: simple and minimal. Two self-hosted fonts.
   Space Grotesk (sans): logo, navigation, headings (600), table of contents, footer,
                         tables, ranking labels (.rank) and tuition figures (.fig).
   Source Serif 4 (serif): article paragraphs, lists, blockquotes and italics, regular weight at 17 to 18px. */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/SpaceGrotesk-400-700.woff2) format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/SourceSerif4.woff2) format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/SourceSerif4-italic.woff2) format("woff2");
}

:root {
  --bg: #ffffff;
  --fg: #16191c;
  --muted: #5d6872;
  --line: #e4e7ea;
  --accent: #0b6b4d;
  --measure: 40rem;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101315;
    --fg: #e7ebee;
    --muted: #9aa5ae;
    --line: #272d32;
    --accent: #5fd3a8;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.125rem/1.7 var(--serif);
  text-rendering: optimizeLegibility;
}
.wrap { max-width: var(--measure); margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--fg); color: var(--bg); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg); }
.site-header .wrap { max-width: 56rem; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.9rem; padding-bottom: 0.9rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font: 700 1.2rem/1 var(--sans); letter-spacing: -0.02em; color: var(--fg); text-decoration: none; padding: 0.15rem 0; min-width: 0; }
.brand .mark { width: 1.5rem; height: auto; flex: none; }
.mk-ink { fill: var(--fg); }
.mk-accent { fill: var(--accent); }
.menu { position: relative; flex: none; }
.menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; margin-right: -0.5rem; border-radius: 6px; color: var(--fg); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--line); }
.burger { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu[open] .burger path { d: path("M5 5L19 19M5 19L19 5"); }
.site-header nav { position: absolute; right: -0.5rem; top: calc(100% + 0.4rem); min-width: 13rem; display: flex; flex-direction: column; padding: 0.4rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); font: 500 1rem/1.4 var(--sans); }
.site-header nav a { display: block; padding: 0.6rem 0.8rem; border-radius: 5px; color: var(--fg); text-decoration: none; }
.site-header nav a:hover { background: var(--line); }
.site-header nav a[aria-current] { color: var(--accent); }

/* article */
main { padding-top: 3.5rem; padding-bottom: 4rem; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--sans); color: var(--fg); letter-spacing: -0.015em; text-wrap: balance; }
.prose h1 { font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.1; font-weight: 600; margin: 0 0 1.5rem; letter-spacing: -0.025em; }
.prose h2 { font-size: 1.75rem; line-height: 1.2; font-weight: 600; margin: 3.5rem 0 0.75rem; }
.prose h3 { font-size: 1.2rem; line-height: 1.3; font-weight: 600; margin: 2rem 0 0.5rem; }
.prose h4 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.25rem; }
.prose p, .prose ul, .prose ol, .prose figure, .prose blockquote, .prose table { margin: 0 0 1.15rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.35rem 0; padding-left: 0.2rem; }
.prose li::marker { color: var(--muted); }
.prose strong { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose blockquote { border-left: 2px solid var(--accent); padding-left: 1rem; color: var(--muted); font-style: italic; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: 4px; }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figcaption { color: var(--muted); font: 0.85rem/1.4 var(--sans); margin-top: 0.4rem; }
.prose table { width: 100%; border-collapse: collapse; font: 0.95rem/1.5 var(--sans); }
.prose th, .prose td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 700; }

/* home page: comparison first, then profiles */
.home .prose h1 { font-size: clamp(2.5rem, 8vw, 3.75rem); letter-spacing: -0.03em; margin-bottom: 1.25rem; }
.home .prose h1 + p { font-size: 1.25rem; line-height: 1.55; }
.jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.5rem; margin: 2rem 0 0; padding: 0.8rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 500 0.9rem/1.4 var(--sans); }
.jump a { color: var(--accent); }
.home .prose h2#compare { margin-top: 2.5rem; }

/* comparison table: wider than the reading column on desktop */
.breakout { position: relative; left: 50%; width: min(56rem, 100vw - 2.5rem); transform: translateX(-50%); margin: 0 0 0.5rem; }
.table-scroll { overflow-x: auto; }
.prose table.compare { width: 100%; margin: 0; font: 0.98rem/1.4 var(--sans); }
.compare th, .compare td { padding: 0.85rem 0.75rem; text-align: left; vertical-align: baseline; border-bottom: 1px solid var(--line); }
.compare thead th { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--fg); white-space: nowrap; padding-top: 0.5rem; }
.compare thead th.num { white-space: normal; }
.compare th[scope="row"] { font-weight: 600; }
.compare th[scope="row"] a { color: var(--fg); text-decoration: none; }
.compare th[scope="row"] a:hover { color: var(--accent); text-decoration: underline; }
.compare .rank-cell { color: var(--muted); width: 3.5rem; }
.compare .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.compare tbody td.num { font-size: 1.05rem; }
.compare th:first-child, .compare td:first-child { padding-left: 0; }
.compare th:last-child, .compare td:last-child { padding-right: 0; }
.table-note { font: 0.85rem/1.5 var(--sans); color: var(--muted); margin: 0.75rem 0 3rem; }
@media (max-width: 40rem) { .compare .loc { display: none; } }

/* school profiles: same layout every time */
.prose h2.school, .prose h3.school { font-size: 1.45rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.prose h2 + h3.school { margin-top: 1.25rem; padding-top: 0; border-top: 0; }
.stats { display: flex; flex-wrap: wrap; gap: 0.75rem 3rem; margin: 0.9rem 0 1.4rem; padding: 0; font-family: var(--sans); }
.stats div { margin: 0; }
.stats dt { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.2rem; }
.stats.long dd { font-size: 1.5rem; }
.stats dd { margin: 0; font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* data: figures and ranking labels use the sans */
.fig { font-family: var(--sans); font-weight: 450; font-size: 0.95em; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.prose p.rank { font: 600 0.8rem/1.4 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.35rem; }
.prose h2 + p.rank { margin-top: -0.25rem; }

/* table of contents */
.toc { text-align: center; margin: 0 0 2rem; padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 0.95rem/1.5 var(--sans); }
.toc p { margin: 0 0 0.5rem; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.toc summary { cursor: pointer; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: " +"; }
.toc details[open] summary::after { content: " –"; }
.toc details ol { margin-top: 0.75rem; }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc li { margin: 0.3rem 0; }
.toc a { color: var(--fg); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
:target { scroll-margin-top: 1rem; }

/* plain lists of guides */
.list, .prose .list { list-style: none; padding: 0; margin: 0; font-family: var(--sans); }
.list li { margin: 0; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.list a { color: var(--fg); text-decoration: none; }
.list a:hover { color: var(--accent); text-decoration: underline; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; font-family: var(--sans); font-size: 0.9rem; color: var(--muted); }
.footer-guides { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.footer-guides .foot-h { margin: 0 0 0.5rem; font-size: 0.75rem; letter-spacing: 0.07em; text-transform: uppercase; font-weight: 700; }
.footer-guides .foot-h a { color: var(--muted); text-decoration: none; }
.footer-guides .list li { padding: 0.25rem 0; border: 0; line-height: 1.4; }
.footer-guides .list a { color: var(--fg); }
.fine { margin: 2rem 0 0; font-size: 0.8rem; }

@media (max-width: 30rem) {
  body { font-size: 1.0625rem; }
  main { padding-top: 2.25rem; }
}
@media print {
  .site-header .menu, .site-footer, .skip { display: none; }
}
