/* ============================================================
   FOLIO GRID — a page from a fine press, not a dashboard.
   12 columns, 8px baseline, hairline furniture.
   ============================================================ */

/* ---------- Masthead — the real, persistent top nav ---------- */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.masthead-inner {
  display: flex; align-items: center; gap: var(--u3);
  padding: 0 var(--u3); max-width: 1280px; margin: 0 auto; height: 60px;
}
.brand { display: inline-flex; align-items: center; gap: var(--u); text-decoration: none; color: var(--ink); flex: 0 0 auto; }
.brand-mark { width: 26px; height: 26px; flex: 0 0 auto; }
.brand-word { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; letter-spacing: 0.02em; white-space: nowrap; color: var(--ink); }

.nav { display: flex; align-items: center; gap: var(--u3); margin-left: var(--u3); }
.nav-link {
  position: relative; text-decoration: none; color: var(--ink-soft);
  font-family: var(--font-ui); font-weight: 500; font-size: 0.94rem; letter-spacing: 0.01em;
  padding: 6px 2px; white-space: nowrap; transition: color 0.15s;
}
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--rubric); }
.nav-link[aria-current="page"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--rubric); }

.nav-right { display: flex; align-items: center; gap: var(--u2); margin-left: auto; flex: 0 0 auto; }
.nav-search {
  display: inline-flex; align-items: center; gap: var(--u); cursor: pointer;
  background: var(--paper); border: 1px solid var(--hairline); border-radius: 999px;
  padding: 7px var(--u2); color: var(--muted); font: inherit; font-size: 0.86rem;
  transition: border-color 0.15s, color 0.15s;
}
.nav-search:hover { border-color: var(--rubric); color: var(--ink); }
.nav-search svg { color: var(--muted); }
.nav-search:hover svg { color: var(--rubric); }
.nav-search kbd { font-size: 0.68rem; color: var(--muted); background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 4px; padding: 1px 5px; letter-spacing: 0.02em; }
.nav-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; color: var(--ink-soft); text-decoration: none; transition: background 0.15s, color 0.15s; }
.nav-icon:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--rubric); }
.nav-due { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; background: var(--rubric); color: #fff; border-radius: 999px; padding: 5px var(--u2); font-family: var(--font-ui); font-weight: 600; font-size: 0.8rem; }
.nav-due::before { content: '●'; font-size: 0.55em; }
.nav-toggle { display: none; }

.progress-rule {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: var(--rubric); transform-origin: 0 50%; transform: scaleX(var(--read-progress, 0));
}

/* ---------- Breadcrumb (interior pages) ---------- */
.breadcrumb { border-bottom: 1px solid var(--hairline); background: var(--paper); }
.breadcrumb ol {
  display: flex; flex-wrap: wrap; align-items: center;
  max-width: 1280px; margin: 0 auto; padding: 10px var(--u3); list-style: none;
  font-family: var(--font-ui); font-size: 0.82rem;
}
.breadcrumb li { display: inline-flex; align-items: center; color: var(--muted); }
.breadcrumb li + li::before { content: '›'; margin: 0 var(--u); color: var(--hairline); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--rubric); }
.breadcrumb [aria-current="page"] { color: var(--ink-soft); }

@media (max-width: 899px) {
  .nav {
    position: fixed; top: 60px; left: 0; right: 0; z-index: 39;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: var(--paper); border-bottom: 1px solid var(--hairline);
    box-shadow: 0 12px 24px -12px rgba(14, 27, 51, .25);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: transform .18s, opacity .18s;
  }
  .masthead[data-nav-open] .nav { transform: none; opacity: 1; pointer-events: auto; }
  .nav-link { padding: 14px var(--u3); border-top: 1px solid var(--hairline); font-size: 1rem; }
  .nav-link[aria-current="page"]::after { display: none; }
  .nav-link[aria-current="page"] { box-shadow: inset 3px 0 0 var(--rubric); }
  .nav-search-label, .nav-search kbd { display: none; }
  .nav-search { padding: 8px; }
  .nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; width: 38px; height: 38px; background: transparent; border: 0; cursor: pointer; padding: 8px; }
  .nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .18s, opacity .18s; }
  .masthead[data-nav-open] .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .masthead[data-nav-open] .nav-toggle span:nth-child(2) { opacity: 0; }
  .masthead[data-nav-open] .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}
@media (max-width: 520px) { .brand-word { display: none; } }

/* ---------- Page frame ---------- */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--u4) var(--u3) var(--u12);
}

/* ---------- Lesson folio: text block left-of-center + margin column ---------- */
.folio {
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--u3), 1fr)
    [text-start] min(var(--measure), calc(100% - var(--margin-col) - var(--u8) - var(--u6)))
    [text-end] var(--u8)
    [margin-start] var(--margin-col)
    [margin-end] minmax(var(--u3), 2fr)
    [full-end];
  row-gap: var(--u2);
}
.folio > * { grid-column: text; min-width: 0; }
.folio > .margin-note { grid-column: margin; }
.folio > .full-bleed { grid-column: full; }

@media (min-width: 900px) and (max-width: 1199px) {
  :root { --margin-col: 240px; --measure: 60ch; }
}

/* Under 900px: margin collapses to inline tap-to-expand rubric asterisks. */
@media (max-width: 899px) {
  .folio { display: block; padding: 0 var(--u2); }
  .margin-note { margin: var(--u2) 0; }
  .margin-note:not([open]) summary::before { content: '✳ '; color: var(--rubric); }
}
@media (min-width: 900px) {
  .margin-note { position: relative; }
  .margin-note summary { pointer-events: none; }
  .margin-note summary::-webkit-details-marker { display: none; }
  .margin-note summary { list-style: none; }
}

/* Margin column furniture — Tufte sidenotes, key-term cards, why-true boxes. */
.margin-note {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px solid var(--hairline);
  padding-top: var(--u);
  align-self: start;
}
.margin-note .term {
  font-family: var(--font-body);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  color: var(--ink);
  display: block;
}
.margin-note.key-term { border-top-color: var(--faculty, var(--hairline)); }
.margin-note.delta { color: var(--rubric); border-top-color: var(--rubric); }
.margin-note.why-true .answer { display: none; }
.margin-note.why-true.revealed .answer { display: block; }
.margin-note .study-link { font-family: var(--font-ui); font-size: 0.78rem; }

/* Route map (pinned mini-diagram advancing with scroll) */
.route-map { position: sticky; top: 72px; }
.route-map svg .visited { stroke: var(--faculty, var(--gold)); }
.route-map svg .ahead { stroke: var(--hairline); }

/* ---------- Ledgers (catalogs are ledgers, never card grids) ---------- */
.ledger {
  background: var(--stock);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.ledger-head {
  display: grid;
  grid-template-columns: 9ch 1fr auto;
  gap: var(--u3);
  padding: var(--u) var(--u3);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.accession {
  display: grid;
  grid-template-columns: 9ch 1fr auto;
  gap: var(--u3);
  align-items: baseline;
  padding: var(--u2) var(--u3);
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
  position: relative;
}
.accession:last-child { border-bottom: 0; }
a.accession:hover, a.accession:focus-visible { background: color-mix(in srgb, var(--faculty, var(--gold)) 7%, transparent); }
a.accession:hover .accession-title, a.accession:focus-visible .accession-title { color: var(--rubric); }
.accession .call-number { color: var(--muted); }
.accession-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.06rem;
  line-height: 1.25;
}
.accession .abstract { font-size: 0.92rem; margin: 2px 0 0; }
.accession .tags {
  display: flex; gap: var(--u); align-items: center;
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted);
  white-space: nowrap;
}
.accession .tags .band { border: 1px solid var(--hairline); padding: 1px 6px; border-radius: 2px; }
.accession.unlinked { color: var(--muted); }
.accession.unlinked .accession-title { color: var(--muted); font-weight: 500; }
.accession.unlinked .not-yet { font-family: var(--font-ui); font-size: 0.75rem; font-style: normal; }

/* Ledger tab (faculty ink) — a solid inked bar, cream lettering. */
.ledger-tab {
  display: inline-block;
  background: var(--faculty, var(--gold));
  color: #F7F0DE;
  padding: 4px var(--u3) 6px;
  letter-spacing: 0.02em;
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--ink) 14%, transparent);
}

@media (max-width: 899px) {
  .ledger-head { display: none; }
  .accession { grid-template-columns: 1fr; gap: 2px; }
  .accession .call-number { order: -1; }
}

/* ---------- Plates ---------- */
figure.plate {
  margin: var(--u4) 0;
  border: 1px solid var(--hairline);
  background: var(--stock);
  padding: var(--u3);
}
:root[data-theme="dark"] figure.plate,
figure.plate.vitrine { border-color: var(--gold); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) figure.plate { border-color: var(--gold); }
}
figure.plate figcaption {
  margin-top: var(--u2);
  display: flex;
  justify-content: space-between;
  gap: var(--u2);
  align-items: baseline;
  border-top: 1px solid var(--hairline);
  padding-top: var(--u);
}
figure.plate .plate-no {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--faculty, var(--muted));
  white-space: nowrap;
}
figure.plate .plate-caption { font-size: 0.85rem; color: var(--muted); font-style: italic; }
figure.plate .accession-label {
  display: block;
  margin-top: var(--u);
  font-size: 0.66rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Museum plates: warm paper grounds stay inside a gilded hairline in the dark. */
.plate-img { display: block; width: 100%; background: #F6F1E5; }

/* Procedural plate SVG language — ink strokes, hairline furniture. */
.plate-svg { display: block; width: 100%; height: auto; }
.plate-svg .pink { stroke: var(--ink); }
.plate-svg .pfaculty { stroke: var(--faculty, var(--ink)); }
.plate-svg .phair, .plate-svg .phairline-leader { stroke: var(--hairline); }
.plate-svg .pdot { fill: var(--ink); stroke: none; }
.plate-svg .pbar { fill: var(--faculty, var(--ink)); opacity: 0.85; }
.plate-svg .pshade { fill: var(--well); }
.plate-svg .pnode { fill: var(--paper); stroke: var(--ink); stroke-width: 1.3; }
.plate-svg .pframe { fill: none; stroke: var(--hairline); stroke-width: 1; }
.plate-svg text { font-family: var(--font-body); fill: var(--ink); }
.plate-svg .pmono, .plate-svg .phead { font-family: var(--font-mono); fill: var(--muted); letter-spacing: 0.04em; }
.plate-svg .phead { fill: var(--muted); letter-spacing: 0.12em; }
.plate-svg .pmuted { fill: var(--muted); }
.plate-svg .plabel-strong { font-weight: 600; }

/* ---------- Grain (covers, ledger stock, certificates ONLY) ---------- */
.grain { position: relative; isolation: isolate; }
.grain::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .grain::after { opacity: 0.05; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .grain::after { opacity: 0.05; }
}

/* ---------- Covers — dramatic solid-ink slabs, cream lettering ---------- */
.cover {
  /* Deep faculty-tinted ground — resolved HERE so var(--faculty) picks up the
     page's inherited data-ink, not the :root gold fallback. */
  background: color-mix(in srgb, var(--faculty, var(--gold)) 52%, #130E07);
  color: #F5EEDC;
  border-bottom: 3px solid var(--gold);
  padding: var(--u12) var(--u3) var(--u8);
  position: relative;
}
.cover .cover-display { color: #F7F0DE; }
.cover .abstract { color: color-mix(in srgb, #F5EEDC 85%, transparent); }
.cover-inner { max-width: 1280px; margin: 0 auto; position: relative; z-index: 2; }
.cover .plain-descriptor {
  font-family: var(--font-ui);
  color: color-mix(in srgb, #F5EEDC 68%, var(--cover-ground));
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
/* A gilded interior rule on every cover. */
.cover::before {
  content: '';
  position: absolute; inset: 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent);
  pointer-events: none; z-index: 1;
}
/* Academic monogram watermark on the cover slab. */
.cover::after {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background-image: var(--monogram);
  background-size: 230px 230px;
  opacity: 0.12;
  pointer-events: none;
}

/* ---------- Atlas: printed index spread ---------- */
.atlas-band { margin: var(--u6) 0; }
.atlas-band > h2 { border-bottom: 1px solid var(--faculty, var(--hairline)); padding-bottom: var(--u); }
.atlas-school { break-inside: avoid; margin-bottom: var(--u4); }
.atlas-columns { columns: 2; column-gap: var(--u6); }
@media (max-width: 899px) { .atlas-columns { columns: 1; } }
.atlas-dept { display: flex; justify-content: space-between; gap: var(--u2); align-items: baseline; padding: 3px 0; border-bottom: 1px dotted var(--hairline); text-decoration: none; color: inherit; }
.atlas-dept:hover .dept-name { color: var(--rubric); }
.atlas-dept .holdings { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); }

/* Entries sized proportional to real holdings */
.atlas-dept[data-holdings="s"] .dept-name { font-size: 0.9rem; }
.atlas-dept[data-holdings="m"] .dept-name { font-size: 1rem; }
.atlas-dept[data-holdings="l"] .dept-name { font-size: 1.12rem; font-weight: 600; }

/* ---------- Continue ribbon (one obvious next folio) ---------- */
.continue-ribbon {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  background: var(--stock);
  border-top: 1px solid var(--gold);
  padding: var(--u2) var(--u3);
  display: flex;
  justify-content: center;
  gap: var(--u3);
  align-items: baseline;
}
.continue-ribbon a { font-family: var(--font-ui); font-weight: 600; text-decoration: none; }
.continue-ribbon .whats-next { color: var(--muted); font-size: 0.85rem; }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-still-air="on"]) .continue-ribbon {
    border-top: 0;
    background-image: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 18%, var(--gold) 40%, var(--gold) 100%);
    background-size: 240% 3px;
    background-repeat: no-repeat;
    background-position: 0 0;
    animation: gilt-sheen 5s linear infinite;
    padding-top: calc(var(--u2) + 1px);
  }
}

/* ---------- Wells (recessed interactive surfaces) ---------- */
.well {
  background: var(--well);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--u3);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--hairline);
  margin-top: var(--u12);
  padding: var(--u6) var(--u3) var(--u4);
  color: var(--muted);
  font-size: 0.86rem;
}
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: var(--u8); justify-content: space-between; }
.footer-brand { max-width: 30ch; }
.footer-brand .brand { margin-bottom: var(--u2); }
.footer-brand p { margin: 0; color: var(--muted); line-height: 1.5; }
.footer-cols { display: flex; flex-wrap: wrap; gap: var(--u8); }
.footer-col { display: flex; flex-direction: column; gap: var(--u); }
.footer-col h2 { margin: 0 0 var(--u); font-family: var(--font-ui); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.footer-col a { color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; }
.footer-col a:hover { color: var(--rubric); }
.footer-base {
  max-width: 1280px; margin: var(--u6) auto 0; padding-top: var(--u3);
  border-top: 1px solid var(--hairline);
  display: flex; flex-wrap: wrap; gap: var(--u2); justify-content: space-between;
  font-size: 0.78rem; color: var(--muted);
}

/* ============================================================
   THE FRONT DOOR — an immersive establishing shot.
   A dark cover-slab (abundance before absence), the operable
   Call Slip + a playable lesson fragment above the fold, then a
   scroll-drawn 'living index' of everything the University holds.
   ============================================================ */
.hero-cover {
  position: relative;
  background: #081633;                 /* deep royal-navy ground */
  color: #EAF1FF;
  border-bottom: 3px solid var(--gold);
  overflow: hidden;
  isolation: isolate;
}
.hero-cover::before {           /* gilded interior frame */
  content: '';
  position: absolute; inset: 16px;
  border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent);
  pointer-events: none; z-index: 3;
}
.hero-cover::after {            /* academic monogram, stronger on the slab */
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background-image: var(--monogram);
  background-size: 250px 250px;
  opacity: 0.13;
  pointer-events: none;
}

/* Royal gold, shining and animated — the sole metallic sheen, gold only. */
@keyframes gilt-sheen { to { background-position: -220% 0; } }
.hero-cover .page { position: relative; z-index: 2; padding-top: var(--u8); padding-bottom: var(--u8); }
.hero-cover .running-head { color: var(--gold-bright); }
.hero-cover .hero-display { color: #EAF1FF; }
.hero-cover .hero-display .lead-ink { color: var(--gold); text-decoration-color: var(--gold); }
.hero-cover .abstract { color: color-mix(in srgb, #EAF1FF 80%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-still-air="on"]) .hero-cover .hero-display .lead-ink {
    background: linear-gradient(100deg, var(--gold) 28%, var(--gold-bright) 50%, var(--gold) 72%);
    background-size: 220% 100%;
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    -webkit-text-decoration-color: var(--gold-bright);
    text-decoration-color: var(--gold-bright);
    opacity: 1;                 /* reveal-words leaves these at 0; the sheen replaces word-bloom */
    animation: word-bloom 0.5s cubic-bezier(0.2, 0.6, 0.2, 1) both, gilt-sheen 5s linear infinite;
  }
}

/* More animated gold — pulsing gilt frames, shimmering gold edges, sheened bars. */
@keyframes gold-pulse {
  0%, 100% { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
  50% { border-color: var(--gold-bright); }
}
@keyframes gold-edge {
  0%, 100% { border-bottom-color: var(--gold); }
  50% { border-bottom-color: var(--gold-bright); }
}
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-still-air="on"]) .hero-cover::before,
  :root:not([data-still-air="on"]) .cover::before {
    animation: gold-pulse 4.5s ease-in-out infinite;
  }
  :root:not([data-still-air="on"]) .hero-cover,
  :root:not([data-still-air="on"]) .cover {
    animation: gold-edge 5.5s ease-in-out infinite;
  }
  /* The gold Holdings bar gets the metallic sheen sweep. */
  :root:not([data-still-air="on"]) .living-index .index-lead > .ledger-tab {
    background: linear-gradient(100deg, var(--gold) 26%, var(--gold-bright) 50%, var(--gold) 74%);
    background-size: 220% 100%;
    animation: gilt-sheen 5.5s linear infinite;
  }
}

/* The conceptual anchor: a live 'set fresh' ticker, top-right of the slab. */
.scriptorium-live {
  position: absolute; top: var(--u4); right: var(--u4); z-index: 4;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em;
  color: color-mix(in srgb, #F3EAD4 62%, transparent); text-align: right;
  display: flex; align-items: center; gap: var(--u);
}
.scriptorium-live .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--rubric);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--rubric) 70%, transparent);
  animation: nib-pulse 2.4s ease-out infinite;
}
@keyframes nib-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rubric) 65%, transparent); }
  70%, 100% { box-shadow: 0 0 0 9px transparent; }
}

/* A faint quill-ruled backdrop drawn behind the hero text (no gradient — hairlines). */
.hero-cover .quill-field {
  position: absolute; inset: 0; z-index: 1; opacity: 0.5; pointer-events: none;
}

.hero-instruments {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: var(--u4);
  margin-top: var(--u4);
  align-items: start;
}
.hero-cover .home-call-slip,
.hero-cover .home-fragment {
  background: #0B1A38;                 /* solid panel — the monogram must not bleed through */
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  padding: var(--u3);                 /* breathing room — text must not wedge the edge */
}
.hero-cover .home-fragment .ink-widget { margin: 0; }
.hero-cover .home-fragment .ink-widget .prompt { margin-top: var(--u2); }
.fragment-flag {
  margin: 0 0 var(--u); display: inline-block;
  color: #06122B; background: var(--gold-bright);
  font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 700; padding: 2px 10px;
}
.hero-cover .home-call-slip .running-head { color: var(--gold-bright); }
.hero-cover .home-call-slip input[type="search"] {
  background: color-mix(in srgb, #000 26%, transparent); color: #F6EEDA;
  border-color: color-mix(in srgb, var(--gold) 40%, transparent); width: 100%;
}
.hero-cover .home-fragment .plate-svg .pink { stroke: color-mix(in srgb, #F3EAD4 72%, transparent); }
.hero-cover .home-fragment .plate-svg .phair { stroke: color-mix(in srgb, #F3EAD4 22%, transparent); }
.hero-cover .home-fragment .plate-svg text { fill: color-mix(in srgb, #F3EAD4 66%, transparent); }
.hero-cover .home-fragment .ink-status,
.hero-cover .home-fragment .plate-caption { color: color-mix(in srgb, #F3EAD4 60%, transparent); }
.hero-cover .home-fragment .btn { color: #F3EAD4; border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.hero-cover .home-fragment .btn.primary { background: var(--rubric); border-color: var(--rubric); color: #081633; font-weight: 700; }

/* ============================================================
   THE HALL — a walk through a dark, starlit void. Artifacts emerge from the
   black one at a time and recede; equations drift in the air; you float freely
   (drag looks around and stays there). Scroll flies forward; the CTA is the end
   of the hall. JS moves the world + fades each card by depth.
   ============================================================ */
.intro { display: none; }
:root[data-intro="show"] .intro,
.intro.leaving {
  display: block;
  position: fixed; inset: 0; z-index: 200;
  background: #05060D;
  color: #EAF1FF;
  --starfield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='340'%3E%3Ccircle cx='12.4' cy='231.3' r='1.63' fill='%23fff' opacity='0.80'/%3E%3Ccircle cx='135.9' cy='264.1' r='1.48' fill='%23fff' opacity='0.68'/%3E%3Ccircle cx='40.2' cy='168.0' r='0.72' fill='%23fff' opacity='0.25'/%3E%3Ccircle cx='161.4' cy='47.2' r='1.64' fill='%23fff' opacity='0.59'/%3E%3Ccircle cx='58.9' cy='94.4' r='0.73' fill='%23fff' opacity='0.36'/%3E%3Ccircle cx='78.8' cy='127.5' r='1.25' fill='%23fff' opacity='0.31'/%3E%3Ccircle cx='256.7' cy='255.2' r='1.62' fill='%23fff' opacity='0.54'/%3E%3Ccircle cx='134.9' cy='328.8' r='0.60' fill='%23fff' opacity='0.42'/%3E%3Ccircle cx='241.4' cy='325.4' r='1.27' fill='%23fff' opacity='0.39'/%3E%3Ccircle cx='122.9' cy='34.2' r='0.94' fill='%23fff' opacity='0.63'/%3E%3Ccircle cx='118.8' cy='73.6' r='0.93' fill='%23fff' opacity='0.61'/%3E%3Ccircle cx='209.5' cy='132.6' r='0.72' fill='%23fff' opacity='0.73'/%3E%3Ccircle cx='242.5' cy='119.7' r='0.88' fill='%23fff' opacity='0.49'/%3E%3Ccircle cx='40.7' cy='244.6' r='1.39' fill='%23fff' opacity='0.29'/%3E%3Ccircle cx='166.1' cy='316.7' r='0.89' fill='%23fff' opacity='0.46'/%3E%3Ccircle cx='60.7' cy='132.0' r='0.63' fill='%23fff' opacity='0.54'/%3E%3Ccircle cx='328.2' cy='132.5' r='1.39' fill='%23fff' opacity='0.26'/%3E%3Ccircle cx='51.6' cy='93.5' r='0.52' fill='%23fff' opacity='0.86'/%3E%3Ccircle cx='259.8' cy='247.6' r='1.67' fill='%23fff' opacity='0.88'/%3E%3Ccircle cx='185.3' cy='190.2' r='0.41' fill='%23fff' opacity='0.92'/%3E%3Ccircle cx='96.9' cy='247.8' r='0.62' fill='%23fff' opacity='0.45'/%3E%3Ccircle cx='58.0' cy='171.8' r='0.75' fill='%23fff' opacity='0.36'/%3E%3Ccircle cx='189.4' cy='243.0' r='1.60' fill='%23fff' opacity='0.51'/%3E%3Ccircle cx='189.4' cy='135.0' r='1.29' fill='%23fff' opacity='0.71'/%3E%3Ccircle cx='337.8' cy='256.1' r='0.75' fill='%23fff' opacity='0.67'/%3E%3Ccircle cx='271.4' cy='31.8' r='1.47' fill='%23fff' opacity='0.91'/%3E%3Ccircle cx='102.1' cy='173.0' r='0.40' fill='%23fff' opacity='0.87'/%3E%3Ccircle cx='160.1' cy='85.4' r='0.62' fill='%23fff' opacity='0.88'/%3E%3Ccircle cx='186.2' cy='149.6' r='1.26' fill='%23fff' opacity='0.31'/%3E%3Ccircle cx='98.3' cy='102.2' r='0.81' fill='%23fff' opacity='0.23'/%3E%3Ccircle cx='301.5' cy='73.2' r='1.43' fill='%23fff' opacity='0.29'/%3E%3Ccircle cx='246.0' cy='150.9' r='1.65' fill='%23fff' opacity='0.62'/%3E%3Ccircle cx='45.2' cy='195.2' r='1.55' fill='%23fff' opacity='0.28'/%3E%3Ccircle cx='201.4' cy='236.0' r='1.05' fill='%23fff' opacity='0.83'/%3E%3Ccircle cx='72.5' cy='192.5' r='0.61' fill='%23fff' opacity='0.71'/%3E%3Ccircle cx='38.5' cy='187.2' r='1.12' fill='%23fff' opacity='0.28'/%3E%3Ccircle cx='243.9' cy='214.9' r='1.18' fill='%23fff' opacity='0.62'/%3E%3Ccircle cx='79.3' cy='40.1' r='0.52' fill='%23fff' opacity='0.51'/%3E%3Ccircle cx='120.7' cy='83.8' r='0.83' fill='%23fff' opacity='0.84'/%3E%3Ccircle cx='191.9' cy='277.2' r='1.49' fill='%23fff' opacity='0.66'/%3E%3C/svg%3E");
  overflow: hidden;
  /* Faculty inks brightened for the black ground, regardless of site theme. */
  --rubric: #5AA6FF;
  --ink-foundations: #E7B85A; --ink-sciences: #6BB0FF; --ink-minds: #F0857F;
  --ink-making: #57CDB9; --ink-worklife: #D6B06A;
}
:root[data-intro="show"] { overflow: hidden; }
.intro::before {                 /* the star field */
  content: ''; position: absolute; inset: -20%; z-index: 0;
  background-image: var(--starfield); background-repeat: repeat; background-size: 340px 340px;
  opacity: 0.9; pointer-events: none;
}
.intro::after {                  /* soft edge vignette so the far end reads as depth */
  content: ''; position: absolute; inset: 0; z-index: 6; pointer-events: none;
  box-shadow: inset 0 0 200px 40px #05060D;
}

.hall {
  position: absolute; inset: 0; z-index: 1;
  perspective: 1200px; perspective-origin: 50% 48%;
  overflow: hidden; cursor: grab; touch-action: none;
}
.hall.dragging { cursor: grabbing; }
.hall.dragging a { pointer-events: none; }
.hall-world { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }

.hall-card {
  position: absolute; left: 0; top: 0; margin: 0;
  width: auto; max-width: min(440px, 86vw);
  transform: translate(-50%, -50%) translate3d(var(--hx, 0), var(--hy, 0), var(--hz, 0));
  will-change: opacity; backface-visibility: hidden;
}
.hall-title, .hall-cta { width: min(620px, 88vw); text-align: center; }

/* School card — a framed artifact floating in the void, caption beneath (100LS). */
.hall-school { display: block; text-decoration: none; color: #EAF1FF; }
.hall-card-frame {
  display: block; width: fit-content; max-width: 100%; margin-inline: auto; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--gold) 20%, transparent);
  box-shadow: 0 24px 64px -34px rgba(0, 0, 0, .65);
  opacity: .9;                                   /* flimsy — the void shows faintly through */
  transform-origin: 50% 6%;                      /* hangs from near its top edge */
  animation: hall-flutter 6.5s ease-in-out infinite;
  transition: box-shadow .3s ease, border-color .3s ease, opacity .3s ease;
  -webkit-user-drag: none; user-select: none;
}
.hall-school:hover .hall-card-frame { opacity: 1; border-color: color-mix(in srgb, var(--gold) 52%, transparent); box-shadow: 0 34px 84px -28px rgba(0, 0, 0, .78), 0 0 66px -26px color-mix(in srgb, var(--faculty, #fff) 55%, transparent); }
.hall-card, .hall-card-img, .hall-card-frame, .hall-plate { -webkit-user-drag: none; user-select: none; }
/* Tissue in the wind — a gentle multi-axis flutter, hanging from the top. */
@keyframes hall-flutter {
  0%, 100% { transform: rotateZ(-1deg) skewX(0.9deg) rotateY(-2.6deg); }
  50% { transform: rotateZ(1deg) skewX(-0.9deg) rotateY(2.6deg); }
}
@media (prefers-reduced-motion: reduce) { .hall-card-frame { animation: none; } }
.hall-card-img { display: block; max-width: min(440px, 86vw); width: auto; height: auto; max-height: 52vh; margin: 0 auto; }
.hall-plate { display: grid; place-items: center; width: min(400px, 86vw); aspect-ratio: 3 / 2; padding: 22px; background: #0A1220; }
.hall-plate .plate-svg { width: 100%; height: 100%; }
.hall-plate .pfaculty { stroke: var(--faculty, var(--rubric)); }
.hall-plate .pink { stroke: color-mix(in srgb, #EAF1FF 82%, transparent); }
.hall-plate .phair { stroke: color-mix(in srgb, #EAF1FF 22%, transparent); }
.hall-plate text, .hall-plate .pmono { fill: color-mix(in srgb, #EAF1FF 64%, transparent); }

.hall-card-cap { display: block; text-align: center; margin-top: var(--u2); min-width: 260px; margin-inline: auto; }
.hall-card-kicker { display: block; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--faculty, #9BB4D8); margin-bottom: 7px; }
.hall-card-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; letter-spacing: .02em; color: #F4EEE0; margin-bottom: 8px; text-shadow: 0 2px 20px rgba(0,0,0,.5); }
.hall-card-blurb { display: block; font-size: .84rem; line-height: 1.5; color: color-mix(in srgb, #EAF1FF 64%, transparent); max-width: 36ch; margin: 0 auto 10px; }
.hall-card-explore { display: inline-block; font-family: var(--font-ui); font-weight: 700; font-size: .82rem; letter-spacing: .02em; color: var(--faculty, var(--rubric)); opacity: .85; transition: opacity .2s ease, letter-spacing .2s ease; }
.hall-school:hover .hall-card-explore { opacity: 1; letter-spacing: .06em; }

/* Drifting equations in the air (ambient, generated by JS). Hidden at the
   threshold; --eq-op is raised by the engine once you walk in. */
.hall-eq { position: absolute; left: 0; top: 0; font-family: var(--font-mono); white-space: nowrap; pointer-events: none; color: color-mix(in srgb, #EAF1FF 24%, transparent); opacity: var(--eq-op, 0); transition: opacity .5s ease; will-change: transform, opacity; }

/* Twinkling stars over the static field. */
.hall-twinkles { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hall-twinkles i { position: absolute; border-radius: 50%; background: #fff; box-shadow: 0 0 4px rgba(255,255,255,.8); animation: star-twinkle var(--tw, 3s) ease-in-out infinite; }
@keyframes star-twinkle { 0%, 100% { opacity: .1; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
/* Everything in the hall breathes — a slow float. */
.hall-float { display: block; text-align: center; animation: hall-float 7s ease-in-out infinite; }
.hall-card .hall-float { animation-duration: 8.5s; }
@keyframes hall-float { 0%, 100% { transform: translateY(-5px); } 50% { transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .hall-twinkles i { animation: none; opacity: .5; } .hall-eq span, .hall-float { animation: none; } }
.hall-eq b { color: color-mix(in srgb, var(--gold-bright) 40%, transparent); font-weight: 400; }
.hall-eq span { display: inline-block; animation: eq-drift var(--eq-dur, 9s) ease-in-out infinite; }
@keyframes eq-drift { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(6px); } }

/* Title + CTA — light type glowing in the void, no box. */
.intro-eyebrow { font-family: var(--font-body); font-variant-caps: all-small-caps; letter-spacing: .24em; color: var(--rubric); font-size: .95rem; margin: 0; }
.intro-title { font-family: var(--font-display); font-weight: 700; color: #F6F0E2; margin: 14px 0 0; letter-spacing: .015em; text-shadow: 0 2px 40px rgba(0,0,0,.6); }
.hall-title .intro-title { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.06; }
.intro-sub { color: color-mix(in srgb, #EAF1FF 78%, transparent); max-width: 48ch; margin: 16px auto 0; font-size: 1.05rem; line-height: 1.55; }
.intro-cue { color: color-mix(in srgb, #EAF1FF 46%, transparent); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; margin: 18px 0 0; }
.hall-cta .intro-cue { margin-top: 16px; }

/* Loading screen */
.hall-loading { margin-top: var(--u4); }
.hall-loading-label { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: color-mix(in srgb, #EAF1FF 55%, transparent); margin: 0 0 var(--u); }
.hall-loadbar { height: 2px; width: min(320px, 60vw); margin: 0 auto; background: color-mix(in srgb, #EAF1FF 12%, transparent); border-radius: 2px; overflow: hidden; }
.hall-loadbar span { display: block; height: 100%; width: 100%; background: var(--rubric); transform-origin: 0 50%; transform: scaleX(0); transition: transform .3s ease; }
.hall-cue { margin-top: var(--u4); }
.hall-hint, .intro-progress span { transition: opacity .4s ease; }
.intro[data-loading] .hall-hint, .intro[data-loading] .intro-progress { opacity: 0; }

.intro-enter {
  display: inline-block; margin-top: 8px;
  background: var(--rubric); color: #05060D; border: 0; border-radius: 999px;
  padding: 15px 40px; font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; letter-spacing: .05em;
  cursor: pointer; box-shadow: 0 0 60px -12px var(--rubric);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.intro-enter:hover { transform: translateY(-2px); box-shadow: 0 0 80px -8px var(--rubric); color: #05060D; }
.intro-enter:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }

/* HUD */
.hall-hud { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; pointer-events: none; }
.intro-progress { position: absolute; left: 24px; right: 24px; bottom: 46px; height: 2px; background: color-mix(in srgb, #EAF1FF 10%, transparent); border-radius: 2px; overflow: hidden; }
.intro-progress span { display: block; height: 100%; width: 100%; background: var(--rubric); transform-origin: 0 50%; transform: scaleX(0); }
.hall-hint { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; color: color-mix(in srgb, #EAF1FF 42%, transparent); margin: 0; }
.intro-skip {
  position: absolute; top: 22px; right: 24px; z-index: 8;
  background: color-mix(in srgb, #EAF1FF 8%, transparent); border: 1px solid color-mix(in srgb, #EAF1FF 22%, transparent); border-radius: 999px;
  padding: 8px 16px; color: color-mix(in srgb, #EAF1FF 72%, transparent); font-family: var(--font-ui); font-weight: 600; letter-spacing: .04em; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.intro-skip:hover { border-color: var(--rubric); color: #fff; }

.intro.leaving { animation: intro-zoom .9s cubic-bezier(.6, 0, .2, 1) forwards; transform-origin: 50% 50%; }
@keyframes intro-zoom { to { transform: scale(1.5); opacity: 0; } }
.enter-zoom { animation: page-dolly .9s cubic-bezier(.6, 0, .2, 1) both; }
@keyframes page-dolly { from { transform: scale(1.04); } to { transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  :root[data-intro="show"] .hall-title .intro-title { animation: intro-rise .9s .1s cubic-bezier(.2, .7, .2, 1) both; }
  :root[data-intro="show"] .hall-title .intro-sub { animation: intro-rise .8s .35s ease-out both; }
}
@keyframes intro-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 780px) {
  .hall { perspective: 860px; }
  .hall-card { width: 260px; }
  .hall-title, .hall-cta { width: 88vw; max-width: 400px; }
  .hall-card-img, .hall-plate { height: 180px; }
  .hall-title .intro-title { font-size: clamp(1.8rem, 7.5vw, 2.6rem); }
  .intro-enter { padding: 14px 30px; font-size: 1rem; }
  .hall-eq { font-size: .8em; }
}

/* ---------- The Abundance carousel — deep vitrines you drag through ---------- */
.carousel-wrap { position: relative; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--gold); background: color-mix(in srgb, var(--paper) 82%, transparent);
  color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; backdrop-filter: blur(4px);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.carousel-arrow:hover { background: var(--gold); color: #06122B; border-color: var(--gold); }
.carousel-arrow.prev { left: var(--u2); }
.carousel-arrow.next { right: var(--u2); }
@media (max-width: 640px) { .carousel-arrow { display: none; } }
.abundance {
  padding: var(--u8) 0;
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}
.abundance-lead { margin-bottom: var(--u4); }
.abundance-lead .running-head { color: var(--faculty, var(--gold)); font-size: 1rem; }
.abundance-sub { color: var(--muted); }
.carousel {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel.dragging { cursor: grabbing; scroll-behavior: auto; }
.carousel.dragging a { pointer-events: none; }
.carousel-track { display: flex; gap: var(--u3); padding: 0 var(--u4); width: max-content; }
.vitrine {
  flex: 0 0 clamp(240px, 78vw, 320px);
  height: 380px;
  background: color-mix(in srgb, var(--vitrine-ink) 52%, #0A1020);
  color: #F3EAD4;
  border: 1px solid color-mix(in srgb, var(--gold) 42%, transparent);
  padding: var(--u3);
  display: flex; flex-direction: column;
  text-decoration: none;
  position: relative; overflow: hidden;
  transition: transform 0.32s cubic-bezier(0.2,0.7,0.2,1), border-color 0.32s, box-shadow 0.32s;
}
.vitrine::after {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background-image: var(--monogram); background-size: 180px 180px;
  opacity: 0.14; pointer-events: none;
}
.vitrine > * { position: relative; z-index: 1; }
.vitrine:hover, .vitrine:focus-visible {
  transform: translateY(-8px);
  border-color: var(--gold-bright);
  box-shadow: 0 14px 40px color-mix(in srgb, #000 40%, transparent);
}
.vitrine-no { color: color-mix(in srgb, #F3EAD4 60%, transparent); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }
.vitrine-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.75rem;
  line-height: 1.0; letter-spacing: -0.03em; color: #F8F1DE; margin: var(--u2) 0 var(--u);
}
.vitrine-line { font-family: var(--font-body); font-style: italic; font-size: 1rem; line-height: 1.35; color: color-mix(in srgb, #F3EAD4 84%, transparent); }
.vitrine-plain { margin-top: auto; font-family: var(--font-ui); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; color: var(--gold-bright); }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-still-air="on"]) .vitrine { animation: gold-pulse 5s ease-in-out infinite; }
}

/* ---------- Holdings filter chips — reorganize the collection ---------- */
.holdings-filter { display: flex; flex-wrap: wrap; gap: var(--u); margin-bottom: var(--u3); }
.holdings-filter button {
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.76rem; letter-spacing: 0.02em;
  padding: 4px 12px;
}
.holdings-filter button[aria-pressed="true"] {
  border-color: var(--chip-ink, var(--rubric));
  color: var(--chip-ink, var(--rubric));
  box-shadow: inset 0 -2px 0 var(--chip-ink, var(--rubric));
  font-weight: 700;
}
.holding.filtered-out { display: none; }

/* ---------- The living index: abundance of holdings, drawn on scroll ---------- */
.living-index { padding: var(--u8) 0 var(--u6); border-bottom: 1px solid var(--hairline); }
.living-index .index-lead {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: var(--u2); margin-bottom: var(--u4);
}
.holdings-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
.holding {
  background: var(--paper);
  padding: var(--u2) var(--u2) var(--u3);
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 3px;
  min-height: 116px;
  position: relative;
  transition: background 0.18s;
}
.holding::before {           /* faculty ink spine */
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--holding-ink, var(--gold));
}
.holding:hover, .holding:focus-visible { background: var(--faculty-wash); }
.holding .call { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; color: var(--holding-ink, var(--muted)); }
.holding .h-title { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; line-height: 1.14; margin-top: 2px; }
.holding .h-dept { font-size: 0.74rem; color: var(--muted); margin-top: auto; }
.holding.inked .h-title { color: var(--ink); }
.holding.inked::after { content: 'inked'; position: absolute; top: 6px; right: 6px; font-family: var(--font-mono); font-size: 0.54rem; letter-spacing: 0.1em; color: var(--rubric); }

/* Horizontal marquee of call numbers — the archive's breadth, moving. */
.call-marquee { overflow: hidden; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: var(--u) 0; margin: var(--u6) 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.call-marquee .track { display: inline-flex; gap: var(--u4); white-space: nowrap; will-change: transform; animation: marquee 60s linear infinite; }
.call-marquee .track span { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); letter-spacing: 0.06em; }
.call-marquee .track span b { color: var(--faculty, var(--gold)); font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================================
   MOBILE FIT — everything scales within the screen; no sideways scroll.
   ============================================================ */
@media (max-width: 640px) {
  :root { --u12: 60px; --u8: 44px; }
  .page { padding-left: var(--u2); padding-right: var(--u2); }
  .cover { padding: var(--u8) var(--u2) var(--u6); }
  .exam-paper { padding: var(--u4) var(--u2); }
  .hero-instruments { grid-template-columns: 1fr; }
  .scriptorium-live { position: static; justify-content: flex-start; margin-bottom: var(--u2); }
  .holdings-wall { grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr)); }
  .depth-dial { flex-wrap: wrap; }
  .confidence, .segmented, .self-grade, .cert-actions { flex-wrap: wrap; }
  .setting-row { flex-wrap: wrap; gap: var(--u2); }
  input[type="range"] { width: 100%; max-width: 240px; }
  .course-grid { grid-template-columns: 1fr; }
  .instrument-grid { grid-template-columns: 1fr; }

  .masthead-inner { gap: var(--u2); padding: 0 var(--u2); }
}
/* Any grid built from fixed minmax mins must never exceed the viewport. */
.instrument-grid { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.course-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--u6); }
@media (max-width: 899px) { .course-grid { grid-template-columns: 1fr; } }
/* Wide scrollables keep their scroll INSIDE themselves. */
.plate, .exam-paper, .ledger { max-width: 100%; }
figure.plate { overflow-x: auto; }
pre { overflow-x: auto; max-width: 100%; }

/* ============================================================
   HOME — one clean spine: hero · flagship courses · school index · stats.
   ============================================================ */
.home-hero { border-bottom: 1px solid var(--hairline); }
.home-hero-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--u8); align-items: center; padding-top: var(--u8); padding-bottom: var(--u8); }
.home-eyebrow { font-family: var(--font-ui); font-weight: 600; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rubric); margin: 0 0 var(--u2); }
.home-hero-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.3rem, 5.2vw, 3.9rem); line-height: 1.05; letter-spacing: .01em; color: var(--ink); margin: 0 0 var(--u3); }
.home-hero-lede { font-size: 1.15rem; line-height: 1.55; color: var(--ink-soft); max-width: 52ch; margin: 0 0 var(--u4); }
.home-hero-search { display: flex; align-items: center; gap: var(--u2); width: 100%; max-width: 34rem; text-align: left; cursor: pointer; background: var(--paper); border: 1px solid var(--hairline); border-radius: 999px; padding: var(--u2) var(--u3); color: var(--muted); font: inherit; font-size: .95rem; transition: border-color .15s, box-shadow .15s; }
.home-hero-search:hover { border-color: var(--rubric); box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--rubric) 40%, transparent); }
.home-hero-search svg { color: var(--muted); flex: 0 0 auto; }
.home-hero-search:hover svg { color: var(--rubric); }
.home-hero-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-hero-search kbd { flex: 0 0 auto; font-size: .7rem; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 4px; padding: 2px 6px; }

.home-section { padding-top: var(--u8); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--u3); margin-bottom: var(--u4); border-bottom: 1px solid var(--hairline); padding-bottom: var(--u2); }
.section-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: .02em; margin: 0; color: var(--ink); }
.section-more { font-family: var(--font-ui); font-weight: 600; font-size: .9rem; color: var(--rubric); text-decoration: none; white-space: nowrap; }
.section-more:hover { text-decoration: underline; }

.course-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--u3); }
.course-card { display: flex; flex-direction: column; gap: var(--u); min-height: 150px; text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--hairline); border-top: 3px solid var(--faculty, var(--rubric)); border-radius: 8px; padding: var(--u3); transition: box-shadow .2s ease, transform .2s ease; }
.course-card:hover { box-shadow: 0 14px 30px -14px rgba(14, 27, 51, .3); transform: translateY(-2px); }
.course-card-call { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); letter-spacing: .04em; }
.course-card-title { font-family: var(--font-body); font-weight: 600; font-size: 1.14rem; line-height: 1.2; color: var(--ink); }
.course-card-school { font-size: .84rem; color: var(--muted); margin-top: auto; }
.course-card-go { font-family: var(--font-ui); font-weight: 700; font-size: .85rem; color: var(--faculty, var(--rubric)); }

.school-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--u2); }
.school-card { display: flex; flex-direction: column; gap: 5px; text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--hairline); border-left: 3px solid var(--faculty, var(--rubric)); border-radius: 6px; padding: var(--u2) var(--u3); transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.school-card:hover { background: var(--faculty-wash); transform: translateY(-1px); }
.school-card-name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: .01em; color: var(--ink); }
.school-card-plain { font-size: .82rem; color: var(--ink-soft); }
.school-card-meta { font-family: var(--font-ui); font-size: .76rem; color: var(--faculty, var(--muted)); margin-top: 2px; }

.home-close { padding-top: var(--u12); padding-bottom: var(--u8); text-align: center; }
.stat-band { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(var(--u4), 8vw, var(--u12)); padding: var(--u4) 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; color: var(--ink); font-variant-numeric: lining-nums; }
.stat span { font-family: var(--font-ui); font-size: .78rem; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.home-mission { max-width: 62ch; margin: var(--u6) auto 0; font-size: 1.05rem; line-height: 1.6; color: var(--ink-soft); }

@media (max-width: 860px) {
  .home-hero-inner { grid-template-columns: 1fr; gap: var(--u6); }
}

/* ============================================================
   SIDE DRAWER — browse everything (schools · departments · ready courses).
   ============================================================ */
.nav-menu { display: inline-flex; align-items: center; gap: 7px; height: 36px; margin: 0 8px 0 -2px; padding: 0 14px 0 12px; border: 1px solid var(--hairline); background: transparent; color: var(--ink-soft); border-radius: 999px; cursor: pointer; font-family: var(--font-ui); font-weight: 600; font-size: .84rem; letter-spacing: .01em; transition: background .15s, color .15s, border-color .15s; }
.nav-menu:hover, .nav-menu[aria-expanded="true"] { background: color-mix(in srgb, var(--rubric) 8%, transparent); color: var(--rubric); border-color: var(--rubric); }
.nav-menu-label { line-height: 1; }
@media (max-width: 700px) { .nav-menu { padding: 0; width: 36px; justify-content: center; gap: 0; border-color: transparent; } .nav-menu-label { display: none; } }

.sidenav-backdrop { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--ink) 42%, transparent); opacity: 0; transition: opacity .26s ease; }
.sidenav-backdrop.open { opacity: 1; }
.sidenav-backdrop[hidden] { display: none; }

.sidenav { position: fixed; top: 0; left: 0; bottom: 0; z-index: 91; width: min(360px, 90vw); display: flex; flex-direction: column; background: var(--paper); border-right: 1px solid var(--hairline); box-shadow: 0 0 60px -10px rgba(6, 18, 43, .4); transform: translateX(-100%); transition: transform .26s cubic-bezier(.4, 0, .2, 1); }
.sidenav.open { transform: none; }
.sidenav[hidden] { display: none; }

.sidenav-head { display: flex; align-items: center; justify-content: space-between; padding: var(--u2) var(--u3); border-bottom: 1px solid var(--hairline); flex: 0 0 auto; }
.sidenav-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: .02em; }
.sidenav-close { border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; width: 32px; height: 32px; border-radius: 8px; }
.sidenav-close:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }

.sidenav-search { position: relative; padding: var(--u2) var(--u3) var(--u); flex: 0 0 auto; }
.sidenav-search svg { position: absolute; left: calc(var(--u3) + 11px); top: calc(var(--u2) + 9px); color: var(--muted); }
.sidenav-search input { width: 100%; background: var(--stock); border: 1px solid var(--hairline); border-radius: 999px; padding: 9px 14px 9px 34px; color: var(--ink); font: inherit; font-size: .9rem; }
.sidenav-search input:focus-visible { outline: 2px solid var(--rubric); outline-offset: 1px; border-color: var(--rubric); }

.sidenav-body { flex: 1 1 auto; overflow-y: auto; padding: var(--u) var(--u2) var(--u4); }
.sidenav-loading { color: var(--muted); padding: var(--u3); font-size: .88rem; }
.sidenav-loading a { color: var(--rubric); }

.sn-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: var(--u) var(--u); margin-bottom: var(--u2); }
.sn-quick a { font-family: var(--font-ui); font-size: .82rem; font-weight: 600; color: var(--ink-soft); text-decoration: none; padding: 6px 12px; border: 1px solid var(--hairline); border-radius: 999px; }
.sn-quick a:hover { border-color: var(--rubric); color: var(--rubric); }

.sn-section { margin-bottom: var(--u3); }
.sn-section h3 { display: flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-weight: 700; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: var(--u) var(--u); }
.sn-badge { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 999px; padding: 1px 7px; letter-spacing: 0; }

.sn-courses { display: flex; flex-direction: column; }
.sn-course { display: flex; flex-direction: column; gap: 1px; text-decoration: none; color: var(--ink); padding: 8px var(--u); border-radius: 8px; }
.sn-course:hover { background: color-mix(in srgb, var(--rubric) 8%, transparent); }
.sn-course b { font-family: var(--font-body); font-weight: 600; font-size: .92rem; line-height: 1.25; }
.sn-course span { font-size: .74rem; color: var(--muted); }

.sn-school > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px var(--u); cursor: pointer; border-radius: 8px; }
.sn-school > summary::-webkit-details-marker { display: none; }
.sn-school > summary:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.sn-caret { color: var(--muted); font-size: .95rem; transition: transform .18s; flex: 0 0 auto; width: 12px; text-align: center; }
.sn-school[open] > summary .sn-caret { transform: rotate(90deg); }
.sn-school-link { flex: 1 1 auto; font-family: var(--font-display); font-weight: 600; font-size: .92rem; letter-spacing: .01em; color: var(--ink); text-decoration: none; }
.sn-school-link:hover { color: var(--rubric); }
.sn-count { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); flex: 0 0 auto; }
.sn-depts { display: flex; flex-direction: column; padding: 2px 0 6px 26px; }
.sn-dept { font-size: .84rem; color: var(--ink-soft); text-decoration: none; padding: 5px 8px; border-radius: 6px; border-left: 1px solid var(--hairline); }
.sn-dept:hover { color: var(--rubric); border-left-color: var(--rubric); background: color-mix(in srgb, var(--rubric) 6%, transparent); }
@media (prefers-reduced-motion: reduce) { .sidenav, .sidenav-backdrop { transition: none; } }
