/* ==========================================================================
   Higher Ed Futures
   A register of institution-level evidence.

   Design notes
   - Jurisdiction is the spine of this content, so it is a structural column,
     not a decoration. Every record carries it in a sticky left rail.
   - Monospace is reserved for record data: jurisdictions, sources, dates,
     counts, navigation. Serif is reserved for argument. Nothing crosses over.
   - No entry numbering. The registers are lists, not sequences; numbering
     would imply an order that is not in the evidence.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Cool bond paper rather than warm cream — this is a register, not a magazine. */
  --paper:        #eef1f4;
  --paper-deep:   #e3e8ed;
  --surface:      #fbfcfd;
  --ink:          #101820;
  --ink-2:        #4b5763;
  --ink-3:        #6c7885;
  --rule:         #d3dae1;
  --rule-strong:  #b6c0ca;

  --accent:       #0a5b6b;   /* deep teal, carried over from the original site */
  --accent-soft:  #dceef1;
  --accent-ink:   #063f4b;
  --signal:       #9a6410;   /* ochre marker: current page, live rules */
  --signal-soft:  #f6e9cf;

  --shadow: 0 1px 2px rgb(16 24 32 / 4%), 0 8px 24px -12px rgb(16 24 32 / 12%);

  --serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --shell: 68rem;
  --measure: 38rem;
  --rail: 9rem;

  --step: 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --paper:        #0d1319;
  --paper-deep:   #080d12;
  --surface:      #141d25;
  --ink:          #e7edf2;
  --ink-2:        #9dabb7;
  --ink-3:        #7d8b98;
  --rule:         #24313b;
  --rule-strong:  #35454f;

  --accent:       #5cbcd2;
  --accent-soft:  #10333c;
  --accent-ink:   #9fdcea;
  --signal:       #e9bc5c;
  --signal-soft:  #2e2513;

  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 28px -14px rgb(0 0 0 / 70%);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 46em) {
  body { font-size: 1.125rem; }
}

/* Hairline grid in the page margins — bond-paper ruling, not decoration for
   its own sake: it marks the shell the whole register is set inside. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(50% - var(--shell) / 2 - 1px),
      var(--rule) calc(50% - var(--shell) / 2 - 1px),
      var(--rule) calc(50% - var(--shell) / 2),
      transparent calc(50% - var(--shell) / 2)),
    linear-gradient(to left, transparent calc(50% - var(--shell) / 2 - 1px),
      var(--rule) calc(50% - var(--shell) / 2 - 1px),
      var(--rule) calc(50% - var(--shell) / 2),
      transparent calc(50% - var(--shell) / 2));
  opacity: 0.55;
}

@media (max-width: 74em) {
  body::before { display: none; }
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 1.5rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 46em) {
  .shell { padding-inline: 3rem; }
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--signal-soft);
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 60;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  padding: 0.65rem 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  text-decoration: none;
  transition: top var(--step);
}

.skip:focus { top: 1rem; }

/* --------------------------------------------------------------------------
   3. Shared utility type
   -------------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 2px;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
}

[data-theme="dark"] .tag { color: var(--accent-ink); }

/* --------------------------------------------------------------------------
   4. Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--rule);
}

@supports (backdrop-filter: blur(1px)) {
  .topbar { backdrop-filter: saturate(1.4) blur(12px); }
}

.topbar .shell {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 3.75rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  padding: 0.5rem 0;
}

.wordmark:hover { color: var(--accent); }

.topbar nav ul {
  display: flex;
  gap: 0 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.topbar nav a {
  display: block;
  position: relative;
  padding: 0.45rem 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--step);
}

.topbar nav a:hover { color: var(--ink); }

.topbar nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.topbar nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.15rem;
  height: 2px;
  background: var(--signal);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: color var(--step), border-color var(--step);
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.theme-toggle svg { width: 0.95rem; height: 0.95rem; }
.theme-toggle .icon-dark { display: none; }
[data-theme="dark"] .theme-toggle .icon-light { display: none; }
[data-theme="dark"] .theme-toggle .icon-dark { display: block; }

/* On narrow screens the nav drops to its own scrollable row.
   No hamburger: five items, all of them worth showing. */
@media (max-width: 52em) {
  .topbar .shell {
    padding-block: 0.5rem;
    align-items: center;
  }

  .topbar nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--rule);
    margin-inline: -1.5rem;
    padding-inline: 1.5rem;
  }

  .topbar nav::-webkit-scrollbar { display: none; }

  .topbar nav {
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
    mask-image: linear-gradient(to right, #000 88%, transparent);
  }
  .topbar nav ul { gap: 0 1.15rem; }
  .topbar nav a { padding: 0.6rem 0; white-space: nowrap; }
}

/* --------------------------------------------------------------------------
   5. Masthead
   -------------------------------------------------------------------------- */

.masthead {
  padding-block: 4rem 2.5rem;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 46em) {
  .masthead { padding-block: 6rem 3rem; }
}

.masthead .eyebrow { margin-bottom: 1.75rem; }

.masthead h1 {
  font-family: var(--serif);
  font-variation-settings: "opsz" 72;
  font-weight: 350;
  font-size: clamp(2.6rem, 8.5vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
  margin: 0;
  max-width: 15ch;
}

.masthead h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}

.masthead .standfirst {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 34rem;
  margin: 1.75rem 0 0;
  font-weight: 350;
}

/* The ledger strip. The hero fact of the site is its own coverage, so the
   counts are the hero — set as record data, in mono. */
.ledger {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 3rem 0 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.ledger div {
  flex: 1 1 7rem;
  padding: 1rem 1.25rem 1.1rem 0;
}

.ledger dt {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.3rem;
}

.ledger dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   6. Page header (section pages)
   -------------------------------------------------------------------------- */

.page-head {
  padding-block: 3.25rem 2.25rem;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 46em) {
  .page-head { padding-block: 4.5rem 2.75rem; }
}

.page-head h1 {
  font-variation-settings: "opsz" 60;
  font-weight: 350;
  font-size: clamp(2.1rem, 6vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.024em;
  margin: 1.5rem 0 0;
}

.page-head .lead {
  font-size: clamp(1.1rem, 2.1vw, 1.32rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: var(--measure);
  margin: 1.5rem 0 0;
  font-weight: 350;
}

.page-head .count {
  display: inline-block;
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-top: 1px solid var(--rule-strong);
  padding-top: 0.6rem;
}

/* --------------------------------------------------------------------------
   7. Body prose
   -------------------------------------------------------------------------- */

.prose {
  padding-block: 2.75rem;
}

.prose > * { max-width: var(--measure); }

.prose > p {
  margin: 0 0 1.15rem;
}

.prose > p:last-child { margin-bottom: 0; }

.prose .scope {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink-3);
  border-left: 2px solid var(--rule-strong);
  padding-left: 1rem;
  margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   8. Register index (jump list on section pages)
   -------------------------------------------------------------------------- */

.index {
  padding-block: 2.5rem 0;
}

.index h2 {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1.1rem;
}

.index ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  columns: 1;
}

@media (min-width: 40em) {
  .index ol { columns: 2; column-gap: 3rem; }
}

.index li {
  break-inside: avoid;
  border-bottom: 1px solid var(--rule);
}

.index + .records { padding-top: 3rem; }

.index a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  text-decoration: none;
  color: var(--ink);
  transition: color var(--step);
}

.index a:hover { color: var(--accent); }
.index a:hover .index-name { text-decoration: underline; text-underline-offset: 0.15em; }

.index-name { font-size: 0.98rem; }

.index-place {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   9. Records — the signature element
   The jurisdiction rail sticks alongside the entry as you read it, because
   "which country" is the question this whole register exists to answer.
   -------------------------------------------------------------------------- */

.records { padding-block: 1.5rem 4rem; }

.record {
  padding-block: 2.5rem;
  border-top: 1px solid var(--rule);
}

.record:first-child { border-top: 1px solid var(--ink); }

@media (min-width: 52em) {
  .record {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    gap: 0 3rem;
  }
}

.record-rail {
  align-self: start;
}

@media (min-width: 52em) {
  .record-rail {
    position: sticky;
    top: 6rem;
  }
}

.record-place {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1.4;
  padding-top: 0.55rem;
  border-top: 2px solid var(--signal);
  display: inline-block;
}

@media (max-width: 51.99em) {
  .record-rail { margin-bottom: 0.9rem; }
}

.record-body { min-width: 0; }

.record h2 {
  font-variation-settings: "opsz" 36;
  font-weight: 400;
  font-size: clamp(1.45rem, 3.2vw, 1.9rem);
  line-height: 1.18;
  letter-spacing: -0.016em;
  margin: 0 0 0.9rem;
  scroll-margin-top: 6.5rem;
}

.record h2 a {
  color: inherit;
  text-decoration: none;
}

/* Anchor affordance: a quiet section mark that only appears on hover. */
.record h2 a::after {
  content: "¶";
  font-family: var(--mono);
  font-size: 0.55em;
  color: var(--accent);
  margin-left: 0.45em;
  opacity: 0;
  transition: opacity var(--step);
}

.record h2 a:hover::after,
.record h2 a:focus-visible::after { opacity: 1; }

.record-body p {
  margin: 0 0 1.05rem;
  max-width: var(--measure);
}

.record-body p:last-child { margin-bottom: 0; }

.record-body em { font-style: italic; }

.source {
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--ink-3);
  margin: 1.4rem 0 0 !important;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
}

.source a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding-bottom: 1px;
  transition: border-color var(--step);
}

.source a:hover { border-bottom-color: var(--accent); }

/* Outbound marker — tells you the link leaves the site before you click it. */
.source a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.9em;
  color: var(--ink-3);
}

.source-none { font-style: italic; }

/* --------------------------------------------------------------------------
   10. Register cards (home)
   -------------------------------------------------------------------------- */

.registers {
  padding-block: 3.5rem 1rem;
}

.registers > .eyebrow {
  margin-bottom: 1.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--ink);
}

.register-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--rule);
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 46em) {
  .register-grid { grid-template-columns: 1fr 1fr; }
}

.register {
  position: relative;
  background: var(--paper);
  padding: 1.9rem 0 2.1rem;
  transition: background var(--step);
}

@media (min-width: 46em) {
  .register { padding: 2.1rem 2rem 2.3rem; }
  .register:nth-child(odd) { padding-left: 0; }
  .register:nth-child(even) { padding-right: 0; }
}

.register:hover { background: var(--surface); }

.register h2 {
  font-variation-settings: "opsz" 40;
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.15;
  letter-spacing: -0.018em;
  margin: 0 0 0.7rem;
}

.register h2 a {
  color: var(--ink);
  text-decoration: none;
}

/* Whole card is the click target; the heading link stays the accessible name. */
.register h2 a::before {
  content: "";
  position: absolute;
  inset: 0;
}

.register:hover h2 a { color: var(--accent); }

.register p {
  margin: 0;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.6;
}

/* Scoped to beat `.register p`, which would otherwise zero the margin. */
.register p.register-meta {
  margin-top: 1.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.65rem;
  line-height: 1.7;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.register p.register-meta strong {
  display: block;
  color: var(--ink);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   11. Table (assessment)
   -------------------------------------------------------------------------- */

.table-wrap {
  margin: 2.5rem 0 1rem;
}

.table-caption {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--ink);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th:first-child { width: 8.5rem; }
thead th:nth-child(2) { width: 40%; }

thead th {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  vertical-align: bottom;
  padding: 0.9rem 1.25rem 0.9rem 0;
  border-bottom: 1px solid var(--rule-strong);
}

tbody td {
  vertical-align: top;
  text-align: left;
  padding: 1rem 1.25rem 1rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.97rem;
  line-height: 1.5;
}

tbody tr:hover td { background: var(--surface); }

tbody td:first-child {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}

/* Below 46em the table stacks into labelled records rather than
   forcing a horizontal scroll on three columns of prose. */
@media (max-width: 45.99em) {
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { display: block; border-bottom: 1px solid var(--rule); padding: 1.1rem 0; }
  tbody tr:hover td { background: none; }
  tbody td { display: block; border: 0; padding: 0 0 0.75rem; }
  tbody td:last-child { padding-bottom: 0; }
  tbody td:first-child { margin-bottom: 0.5rem; }

  tbody td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 0.2rem;
  }
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */

footer {
  background: var(--paper-deep);
  border-top: 1px solid var(--rule);
  padding-block: 2.75rem 3rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 46em) {
  .footer-grid {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 3rem;
  }
}

footer p {
  margin: 0 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.65;
  color: var(--ink-3);
  max-width: 34rem;
}

footer p:last-child { margin-bottom: 0; }

footer a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

footer a:hover { border-bottom-color: var(--accent); }

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav a {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-2);
  border-bottom-color: transparent;
}

.footer-nav a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }

/* --------------------------------------------------------------------------
   13. Motion + print
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .topbar, .theme-toggle, .index, .skip, body::before { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .record { display: block; page-break-inside: avoid; }
  .source a::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
  footer { background: none; }
}

/* --------------------------------------------------------------------------
   Note to Bot — editorial instructions, kept visible but secondary
   -------------------------------------------------------------------------- */

.note-to-bot {
  max-width: var(--measure);
  margin: 1.1rem 0 1.25rem;
  padding: 0.7rem 0 0.75rem 1rem;
  border-left: 2px solid var(--rule-strong);
  color: var(--ink-3);
  font-size: 0.88em;
  line-height: 1.55;
}

.note-to-bot-kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin: 0 0 0.3rem;
  color: var(--ink-3);
}

.note-to-bot p {
  margin: 0;
  max-width: var(--measure);
}

.register .note-to-bot {
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}

/* Home topbar with no wordmark: keep nav on the left, theme toggle on the right. */
.topbar .shell:not(:has(.wordmark)) nav {
  margin-right: auto;
}
