/* CampusTrace — "night archive". Loaded last; re-tones the glass layer.
   Subject: an evidence archive about a campus. Palette from cyanotype prints
   and catalogue cards; type: Unbounded (display, sparingly), Onest (text),
   JetBrains Mono (source numbers, licences, coordinates).
   Contrast: paper #EDE8DF on ink #0E1116 = 15.6:1; muted #9AA3AE = 7.3:1. */

:root {
  --ink-0: #0e1116;
  --ink-1: #141922;
  --ink-2: #1b212c;
  --paper: #ede8df;
  --paper-dim: #9aa3ae;
  --cyan: #8ec5ff;
  --cyan-soft: rgba(142, 197, 255, .12);
  --amber: #e7b869;
  --rose: #e68a8a;
  --rule: rgba(237, 232, 223, .12);
  --rule-strong: rgba(237, 232, 223, .22);

  --canvas: var(--ink-0);
  --surface: var(--ink-1);
  --surface-2: var(--ink-2);
  --ink: var(--paper);
  --muted: var(--paper-dim);
  --line: var(--rule);
  --line-light: rgba(237, 232, 223, .07);
  --accent: var(--cyan);
  --accent-dark: #b7dbff;
  --accent-soft: var(--cyan-soft);
  --on-accent: #06121f;
  --warn-line: var(--amber);
  --warn-ink: #f2d6a2;

  --glass: rgba(20, 25, 34, .72);
  --glass-strong: rgba(27, 33, 44, .85);
  --glass-edge: var(--rule);
  --glass-shine: rgba(237, 232, 223, .06);
  --glass-blur: saturate(120%) blur(14px);
  --glass-shadow: 0 1px 0 var(--glass-shine) inset, 0 24px 48px -32px rgba(0, 0, 0, .9);
  --radius: 14px;

  --font-display: "Unbounded", "Onest", system-ui, sans-serif;
  --font-text: "Onest", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

body.has-profile { font-family: var(--font-text); background: var(--ink-0); }
/* The ambient orbs read as generic; a single cold light from the top stays. */
body.has-profile::before {
  animation: none; filter: none; inset: 0;
  background: radial-gradient(90vw 50vh at 50% -10vh, rgba(142, 197, 255, .08), transparent 70%);
}

/* Type */
#institution-name { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; font-size: clamp(28px, 4vw, 52px); line-height: 1.05; }
.hero-stats strong { font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.section-heading h3, .section-heading h2, .rail-head h3, .ask-card h3, .about-card h3 {
  font-family: var(--font-text); font-weight: 700; letter-spacing: -.01em; font-size: 20px;
}
.eyebrow, .sidebar-sticky h3, .viewer-info h4, .card-badge, .voice-kind, .source-num, .news-meta, .rail-count, .drawer-kicker {
  font-family: var(--font-mono); letter-spacing: .02em;
}
.eyebrow { text-transform: none; font-size: 12px; color: var(--cyan); }
.card-credit, .hero-stats span, figcaption { font-family: var(--font-text); }

/* Panels: quieter, hairline rules instead of shine. */
.card, .voice-card, .fact-card, .insight-column, .voice-themes article, .pros-cons > div { border-radius: 12px; }
.card:hover { transform: translateY(-2px); }
.filters button[aria-pressed="true"] { background: var(--cyan-soft); color: var(--accent-dark); box-shadow: inset 2px 0 0 var(--cyan); }
.card-badge.rel-high { color: var(--cyan); }
.card-badge.rel-medium { color: var(--amber); }
.card-badge.rel-low { color: var(--rose); }
.viewer-source, form button, #search-form button { background: var(--paper); color: var(--ink-0); border-color: var(--paper); }
.viewer-source:hover, form button:hover { background: #fff; color: var(--ink-0); }
.pros-cons .pros h4 { color: var(--cyan); }
.pros-cons .cons h4 { color: var(--amber); }

/* Signature: the source rail. A slow belt of the places this profile's facts
   came from; each mark is a button that opens what came from it. */
.source-rail { margin-top: 18px; padding: 18px 0 6px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.source-rail[hidden] { display: none; }
.rail-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; padding: 0 2px 12px; }
.rail-head h3 { margin: 0; }
.rail-head p { margin: 0; max-width: 62ch; color: var(--muted); font-size: 13.5px; }
.rail-viewport { position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.rail-track { display: flex; gap: 10px; width: max-content; padding: 6px 0 12px; animation: rail 48s linear infinite; }
.rail-viewport:hover .rail-track, .rail-viewport:focus-within .rail-track, .source-rail.is-open .rail-track { animation-play-state: paused; }
@keyframes rail { to { transform: translateX(-50%); } }
.rail-item {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 16px 6px 8px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--ink-1); color: var(--paper);
  font: 500 14px/1 var(--font-text); cursor: pointer; white-space: nowrap;
  transition: border-color .18s, background .18s;
}
.rail-item:hover { border-color: var(--rule-strong); background: var(--ink-2); }
.rail-item[aria-pressed="true"] { border-color: var(--cyan); background: var(--cyan-soft); }
.rail-count { color: var(--paper-dim); font-size: 12px; }
.brand-mark { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--paper); color: var(--ink-0); }
.brand-mark svg { width: 17px; height: 17px; fill: currentColor; }
.brand-mark.mono { font: 700 12px/1 var(--font-mono); }
.brand-mark.sm { width: 24px; height: 24px; }
.brand-mark.sm svg { width: 13px; height: 13px; }

.source-drawer { margin: 4px 0 12px; padding: 18px; border: 1px solid var(--rule); border-radius: 14px; background: var(--ink-1);
  animation: drawer-in .24s cubic-bezier(.22, 1, .36, 1); }
@keyframes drawer-in { from { opacity: 0; transform: translateY(-6px); } }
.source-drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.drawer-head h4 { margin: 0; font-size: 17px; }
.drawer-kicker { color: var(--paper-dim); font-size: 12px; }
.drawer-close { margin-left: auto; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--paper); cursor: pointer; }
.drawer-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0 14px; }
.drawer-photos a { display: block; border-radius: 8px; overflow: hidden; }
.drawer-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--ink-2); }
.drawer-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.drawer-list li { padding: 10px 12px; border: 1px solid var(--line-light); border-radius: 10px; font-size: 14px; }
.drawer-list small { display: block; margin-top: 3px; color: var(--paper-dim); font-family: var(--font-mono); font-size: 11.5px; }

/* About + ask */
.about-ask { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px; margin-top: 16px; }
.about-card, .ask-card { padding: 20px 22px; border: 1px solid var(--rule); border-radius: 14px; background: var(--ink-1); }
.about-card[hidden] { display: none; }
.about-card h3, .ask-card h3 { margin: 0 0 10px; }
.about-card p { margin: 0 0 10px; line-height: 1.65; color: #d9d4ca; }
.about-card .about-source { font: 12px/1.4 var(--font-mono); color: var(--paper-dim); }
.ask-note { margin: 0 0 12px; color: var(--paper-dim); font-size: 13px; line-height: 1.5; }
.ask-form { display: flex; gap: 8px; }
.ask-form input { flex: 1; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--rule-strong);
  background: var(--ink-0); color: var(--paper); font: 15px var(--font-text); }
.ask-form input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.ask-form button { min-height: 46px; padding: 0 18px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ask-chips button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--rule); background: transparent;
  color: var(--paper-dim); font: 13px var(--font-text); cursor: pointer; }
.ask-chips button:hover { color: var(--paper); border-color: var(--rule-strong); }
.ask-answer:not(:empty) { margin-top: 14px; padding: 14px 16px; border-left: 2px solid var(--cyan); background: var(--cyan-soft); border-radius: 0 10px 10px 0; }
.ask-answer.not-found:not(:empty) { border-left-color: var(--amber); background: rgba(231, 184, 105, .08); }
.ask-answer p { margin: 0 0 8px; line-height: 1.6; }
.ask-answer .ask-sources { display: flex; flex-wrap: wrap; gap: 6px; font: 12px var(--font-mono); }
.ask-answer .ask-sources a { color: var(--accent-dark); }

/* News */
.news-section { margin-top: 22px; padding: clamp(18px, 2.6vw, 30px); border: 1px solid var(--rule); border-radius: 14px; background: var(--ink-1); }
.news-section[hidden] { display: none; }
.news-list { margin: 8px 0 0; padding: 0; list-style: none; }
.news-list li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--line-light); }
.news-list a { color: var(--paper); text-decoration: none; font-weight: 600; line-height: 1.4; }
.news-list a:hover { color: var(--accent-dark); text-decoration: underline; }
.news-meta { color: var(--paper-dim); font-size: 12px; }

/* Voices with real marks */
.voice-card header .brand-mark { width: 26px; height: 26px; }
.voice-card header .brand-mark svg { width: 14px; height: 14px; }

@media (max-width: 900px) {
  .about-ask { grid-template-columns: 1fr; }
  .news-list li { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .rail-track { animation: none; flex-wrap: wrap; width: auto; }
  .rail-track [aria-hidden="true"] { display: none; }
  .rail-viewport { -webkit-mask-image: none; mask-image: none; }
  .source-drawer { animation: none; }
}

/* Hero: identity + numbers on the left, a sharp credited cover photo on the right. */
.profile-overview { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 18px 28px; align-items: start; }
.profile-overview::before { opacity: .35; }
.hero-photo { grid-column: 2; margin: 0; }
.hero-photo[hidden] { display: none; }
.hero-photo-btn { display: block; width: 100%; padding: 0; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--ink-2); cursor: zoom-in; }
.hero-photo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.hero-photo figcaption { margin-top: 6px; font: 11.5px/1.4 var(--font-mono); color: var(--paper-dim); }
.profile-overview .profile-status { grid-column: 2; margin: 0; padding: 10px 12px; font-size: 12px; }
.profile-overview .profile-status span:nth-of-type(n+2) { display: none; }
.profile-heading { grid-column: 1; grid-row: 1 / span 2; }
.hero-stats li { min-width: 0; flex: 1 1 120px; }
.atlas-section { margin-top: 18px; }
.atlas-more { margin-top: 12px; border: 1px solid var(--rule); border-radius: 12px; }
.atlas-more > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 16px; font-weight: 600; color: var(--paper); }
.atlas-more[open] > summary { border-bottom: 1px solid var(--rule); }
@media (max-width: 900px) {
  .profile-overview { grid-template-columns: 1fr; }
  .hero-photo, .profile-overview .profile-status, .profile-heading { grid-column: 1; grid-row: auto; }
}

/* Charts */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin: 6px 0 18px; }
.chart { margin: 0; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 12px; background: var(--ink-1); }
.chart figcaption { font-weight: 700; font-size: 15px; margin-bottom: 8px; color: var(--paper); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-label { fill: var(--paper); font: 13px var(--font-text); }
.chart-value { fill: var(--paper); font: 500 12px var(--font-mono); }
.chart-muted { fill: var(--paper-dim); font: 11px var(--font-mono); }
.chart-axis { stroke: var(--rule-strong); stroke-width: 1; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 12px; color: var(--paper-dim); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-note { margin: 8px 0 0; font-size: 12px; color: var(--paper-dim); }
.chart rect { transition: opacity .15s; }
.chart svg:hover rect { opacity: .55; }
.chart svg rect:hover { opacity: 1; }

/* Martian Mono runs wide: set it a touch smaller wherever it labels data. */
.eyebrow, .card-badge, .voice-kind, .source-num, .news-meta, .rail-count, .drawer-kicker, .chart-value, .chart-muted,
.about-card .about-source, .hero-photo figcaption { font-size: .92em; letter-spacing: -.01em; }
/* Phosphor duotone icons */
.ui-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; color: var(--cyan); }
.ui-icon svg { width: 100%; height: 100%; }
.filter-label { display: inline-flex; align-items: center; gap: 10px; }
.filters button[aria-pressed="true"] .ui-icon { color: var(--paper); }
.card-actions .ui-icon, .glass-button .ui-icon, .viewer-source .ui-icon, .pros-cons .ui-icon { width: 18px; height: 18px; color: currentColor; }
