/* ProfScope — "Campus" design: university-style structure, Apple-like clarity.
   The system font everywhere, a serif only for the home headline, one action colour,
   gold for ratings and the logo. */

/* The home headline font is served from this site (latin + latin-ext for Azerbaijani letters). */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/source-serif-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/source-serif-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/source-serif-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/source-serif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  /* Neutrals */
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f2f2f5;
  --surface-3: #e6e6eb;
  --line: rgba(0, 0, 0, 0.09);
  --line-strong: rgba(0, 0, 0, 0.16);
  --border-input: #8a8a8f;          /* 3:1 against white, for form controls */
  --text: #1d1d1f;
  --text-2: #636366;                /* 4.5:1 on white and on --bg-alt */
  --text-3: #6c6c70;                /* 4.5:1 on white, --bg-alt and --surface-2 */

  /* Brand and roles */
  --brand: #0a1f44;                 /* logo navy, the home headline */
  --gold: #d4a72c;                  /* logo bars, stars, distribution bars */
  --gold-ink: #a37c12;              /* gold text at large sizes */
  --gold-strong: #7a5c0c;           /* gold text at small sizes */
  --gold-soft: #fbf3dc;
  --kicker: #ae485e;                /* accent for small section labels */
  --accent: #0b63ce;                /* links and primary actions */
  --accent-hover: #0954b0;
  --accent-soft: #e8f1fd;
  --on-accent: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.8);

  /* Ratings: tinted badges, each pair 4.5:1 or better */
  --good: #1e7d3a;  --good-soft: #e5f4e9;
  --mid: #9a5b00;   --mid-soft: #fdf1dc;
  --low: #c0262d;   --low-soft: #fde8e8;
  --danger-text: #c0262d;
  --warn-text: #9a5b00;
  --success-bg: #e5f4e9;
  --success-text: #17602c;
  --error-bg: #fdecec;
  --error-border: #f5c2c2;
  --error-text: #9b1c22;

  --focus: #0b63ce;
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.22);
  --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.05);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 220ms;
  --dur-slow: 420ms;

  /* Film grain for large gradients (an inline SVG, nothing is fetched). */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.2 -0.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  --container: 1080px;
  --gutter: 24px;
  --header-h: 68px;
  color-scheme: light dark;
}

/* Dark theme: follows the system unless the visitor picked one (data-theme on <html>,
   set before first paint by js/theme-init.js). The two blocks must stay identical. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-alt: #131315;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --surface-3: #3a3a3c;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --border-input: #7c7c82;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #98989d;
  --brand: #f5f5f7;
  --gold: #f0c24b;
  --gold-ink: #e0b74a;
  --gold-strong: #e8c565;
  --gold-soft: rgba(224, 183, 74, 0.16);
  --kicker: #ef8a9f;
  --accent: #4c9dff;
  --accent-hover: #70b1ff;
  --accent-soft: rgba(76, 157, 255, 0.16);
  --on-accent: #00142e;
  --header-bg: rgba(22, 22, 23, 0.8);
  --good: #4cd17a;  --good-soft: rgba(76, 209, 122, 0.15);
  --mid: #ffb340;   --mid-soft: rgba(255, 179, 64, 0.15);
  --low: #ff6b6b;   --low-soft: rgba(255, 107, 107, 0.15);
  --danger-text: #ff7b7b;
  --warn-text: #ffb340;
  --success-bg: rgba(76, 209, 122, 0.15);
  --success-text: #7ee2a0;
  --error-bg: rgba(255, 107, 107, 0.14);
  --error-border: rgba(255, 107, 107, 0.4);
  --error-text: #ffa3a3;
  --focus: #4c9dff;
  --shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.8);
  --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-alt: #131315;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --surface-3: #3a3a3c;
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.22);
    --border-input: #7c7c82;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #98989d;
    --brand: #f5f5f7;
    --gold: #f0c24b;
    --gold-ink: #e0b74a;
    --gold-strong: #e8c565;
    --gold-soft: rgba(224, 183, 74, 0.16);
    --kicker: #ef8a9f;
    --accent: #4c9dff;
    --accent-hover: #70b1ff;
    --accent-soft: rgba(76, 157, 255, 0.16);
    --on-accent: #00142e;
    --header-bg: rgba(22, 22, 23, 0.8);
    --good: #4cd17a;  --good-soft: rgba(76, 209, 122, 0.15);
    --mid: #ffb340;   --mid-soft: rgba(255, 179, 64, 0.15);
    --low: #ff6b6b;   --low-soft: rgba(255, 107, 107, 0.15);
    --danger-text: #ff7b7b;
    --warn-text: #ffb340;
    --success-bg: rgba(76, 209, 122, 0.15);
    --success-text: #7ee2a0;
    --error-bg: rgba(255, 107, 107, 0.14);
    --error-border: rgba(255, 107, 107, 0.4);
    --error-text: #ffa3a3;
    --focus: #4c9dff;
    --shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.8);
    --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.028em;
  color: var(--text);
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  z-index: 100;
  padding: 10px 16px;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; text-decoration: none; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--dur-base) var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 10px 30px -20px rgba(0, 0, 0, 0.45); }
.site-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  flex-shrink: 0;
  color: var(--brand);
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex-shrink: 0; }
.brand-bars { fill: var(--gold); }
.brand-book { fill: var(--brand); }
.brand-fold { fill: none; stroke: var(--bg); stroke-width: 14; stroke-linejoin: round; stroke-linecap: round; }
.brand-bars path { transition: transform var(--dur-base) var(--ease); }
.brand-bars path:nth-child(2) { transition-delay: 40ms; }
.brand-bars path:nth-child(3) { transition-delay: 80ms; }
.brand:hover .brand-bars path { transform: translateY(-14px); }
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: -0.025em; white-space: nowrap; }
.brand-accent { color: var(--gold-ink); }

.header-nav { display: flex; align-items: center; gap: 4px; margin-left: 20px; }
/* On the home page (no header search) the links sit in the middle of the bar. */
.site-header-inner:not(:has(.search)) .header-nav { position: absolute; left: 50%; margin: 0; transform: translateX(-50%); }
.header-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--text);
  white-space: nowrap;
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.header-link:hover, .header-link[aria-expanded="true"] { text-decoration: none; background: var(--surface-2); }
.header-link[aria-current="page"] { font-weight: 600; background: var(--surface-2); }
.header-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-base) var(--ease); }
.header-link[aria-expanded="true"] svg { transform: rotate(180deg); }

.nav-menu { position: relative; }
.nav-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 60;
  width: 520px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  transform: translateX(-50%);
  animation: pop 0.18s var(--ease);
}
.nav-panel[hidden] { display: none; }
/* Keeps the panel open while the pointer crosses the gap below the button. */
.nav-panel::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.nav-panel-title { margin: 2px 8px 10px; font-size: 13px; font-weight: 600; color: var(--kicker); }
.nav-panel-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-panel-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 10px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
  border-radius: 12px;
  transition: background var(--dur-fast) var(--ease);
}
.nav-panel-list a:hover { text-decoration: none; background: var(--surface-2); }
.nav-code {
  flex-shrink: 0;
  min-width: 52px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
}

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.mobile-cta-link { margin: 4px 0 8px; }
@media (min-width: 961px) { .mobile-cta-link { display: none; } }
.site-header .search { margin-left: auto; }
.site-header .search + .header-actions { margin-left: 0; }

/* Light / dark slider: the knob position comes from CSS (data-theme or the system setting),
   so it is right before any script runs; JS only keeps aria-checked in sync. */
.theme-switch {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.theme-switch-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 56px;
  height: 30px;
  padding: 0 7px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: background var(--dur-base) var(--ease);
}
.theme-switch svg {
  position: relative;
  z-index: 1;
  width: 14px; height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: color var(--dur-base) var(--ease);
}
.theme-switch svg:first-child { color: var(--gold-strong); }
.theme-switch svg:nth-child(2) { color: var(--text-3); }
.theme-switch-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 24px; height: 24px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform var(--dur-slow) cubic-bezier(0.34, 1.4, 0.64, 1), background var(--dur-base) var(--ease);
}
.theme-switch:focus-visible { outline: none; }
.theme-switch:focus-visible .theme-switch-track { outline: 3px solid var(--focus); outline-offset: 2px; }
:root[data-theme="dark"] .theme-switch-knob { transform: translateX(26px); background: var(--text); }
:root[data-theme="dark"] .theme-switch svg:first-child { color: var(--text-3); }
:root[data-theme="dark"] .theme-switch svg:nth-child(2) { color: #000000; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-switch-knob { transform: translateX(26px); background: var(--text); }
  :root:not([data-theme="light"]) .theme-switch svg:first-child { color: var(--text-3); }
  :root:not([data-theme="light"]) .theme-switch svg:nth-child(2) { color: #000000; }
}

.menu-toggle {
  display: none;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.menu-toggle:hover { background: var(--surface-2); }
.menu-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.menu-line { transition: transform var(--dur-base) var(--ease), opacity var(--dur-fast) var(--ease); transform-origin: 12px 12px; }
.menu-toggle[aria-expanded="true"] .menu-line-1 { transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-line-2 { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-line-3 { transform: translateY(-5px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  left: 0; right: 0;
  top: var(--menu-top, var(--header-h));
  z-index: 49;
  max-height: calc(100dvh - var(--menu-top, var(--header-h)));
  overflow-y: auto;
  padding: 12px 0 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  animation: menu-in var(--dur-base) var(--ease);
}
.mobile-nav[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }
.mobile-nav-title { margin: 8px 12px; font-size: 13px; font-weight: 600; color: var(--kicker); }
.mobile-schools { display: grid; gap: 2px; margin: 0 0 12px; padding: 0; list-style: none; }
.mobile-schools a, .mobile-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 12px;
  font-size: 17px;
  color: var(--text);
  border-radius: var(--radius-sm);
}
.mobile-schools a:hover, .mobile-links a:hover { background: var(--surface-2); text-decoration: none; }
.mobile-code {
  min-width: 52px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: 999px;
}
.mobile-links { display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
@media (min-width: 961px) { .mobile-nav { display: none !important; } }

/* ---------- Search combobox ---------- */

.search { position: relative; flex: 1; max-width: 360px; }
.search-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  font-size: 15px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 999px;
  -webkit-appearance: none;
  appearance: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.search-input:hover { border-color: var(--line-strong); }
.search-input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
.search-input::placeholder { color: var(--text-3); }
.search-input::-webkit-search-cancel-button { cursor: pointer; }

/* z-index lifts the open results above the chips, stats and banner that animate in after it. */
.search--hero { max-width: 680px; margin: 0 auto; z-index: 20; }
.search--hero .search-input {
  height: 60px;
  padding: 0 124px 0 54px;
  font-size: 18px;
  background: var(--surface-2);
  border-radius: 16px;
}
.search--hero .search-input:focus { background: var(--surface); border-color: var(--accent); box-shadow: var(--shadow-pop), 0 0 0 4px var(--accent-soft); }
.search--hero .search-icon { left: 20px; }
.search-submit {
  position: absolute;
  right: 8px; top: 8px;
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.search-submit:hover { background: var(--accent-hover); }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  z-index: 60;
  max-height: 420px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
}
.search-results[hidden] { display: none; }
.search-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.search-option[aria-selected="true"], .search-option:hover { background: var(--surface-2); }
.search-option img {
  width: 40px; height: 40px;
  flex-shrink: 0;
  object-fit: cover;
  object-position: top;
  background: var(--surface-2);
  border-radius: 50%;
}
.search-option-text { flex: 1; min-width: 0; }
.search-option-name { font-size: 16px; font-weight: 600; }
.search-option-meta { font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-empty { padding: 14px; font-size: 15px; color: var(--text-2); }

/* ---------- Home hero (headline kept from the first design) ---------- */

/* A fixed, slowly drifting aurora sits behind the headline: soft radial lights in navy, blue,
   teal and gold, no images. clip-path keeps the fixed layer inside the hero (it also works on
   iOS, where background-attachment: fixed does not). */
.hero {
  --hero-wash: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.5) 60%, var(--bg) 100%);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(255, 255, 255, 0.9);
  --hero-lead: #3a3a3c;
  --aurora-base: #f3f6fb;
  --aurora-1: rgba(64, 132, 255, 0.42);
  --aurora-2: rgba(32, 178, 170, 0.30);
  --aurora-3: rgba(240, 194, 75, 0.42);
  --aurora-4: rgba(10, 31, 68, 0.22);
  --grain-opacity: 0.05;
  position: relative;
  isolation: isolate;
  clip-path: inset(0);
  padding: 96px 0 88px;
  text-align: center;
}
.hero-bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; background: var(--aurora-base); }
.aurora {
  position: absolute;
  width: 70vmax; height: 70vmax;
  border-radius: 50%;
  will-change: transform;
}
.aurora-1 { top: -34vmax; left: -18vmax; background: radial-gradient(closest-side, var(--aurora-1), transparent); animation: aurora-a 46s ease-in-out infinite alternate; }
.aurora-2 { top: -10vmax; right: -30vmax; background: radial-gradient(closest-side, var(--aurora-2), transparent); animation: aurora-b 54s ease-in-out infinite alternate; }
.aurora-3 { top: 14vmax; left: 8vmax; width: 56vmax; height: 56vmax; background: radial-gradient(closest-side, var(--aurora-3), transparent); animation: aurora-c 40s ease-in-out infinite alternate; }
.aurora-4 { bottom: -40vmax; right: -6vmax; background: radial-gradient(closest-side, var(--aurora-4), transparent); animation: aurora-a 60s ease-in-out -20s infinite alternate-reverse; }
/* Fine film grain keeps the large gradients from banding. */
.hero-bg::after { content: ''; position: absolute; inset: 0; background: var(--grain); opacity: var(--grain-opacity); }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--hero-wash); pointer-events: none; }
.hero .hero-lead { color: var(--hero-lead); }
.hero .eyebrow, .hero .chip, .search--hero .search-input {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-color: var(--glass-line);
}
.search--hero .search-input { box-shadow: 0 12px 40px -16px rgba(10, 31, 68, 0.35); }
.hero .hero-stats { color: var(--hero-lead); }
.hero .hero-stats li + li { border-color: rgba(0, 0, 0, 0.18); }
:root[data-theme="dark"] .hero {
  --hero-wash: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.45) 60%, var(--bg) 100%);
  --glass: rgba(28, 28, 30, 0.62);
  --glass-line: rgba(255, 255, 255, 0.14);
  --hero-lead: #d1d1d6;
  --aurora-base: #03060f;
  --aurora-1: rgba(38, 92, 214, 0.55);
  --aurora-2: rgba(14, 128, 130, 0.42);
  --aurora-3: rgba(196, 146, 40, 0.30);
  --aurora-4: rgba(72, 58, 170, 0.40);
  --grain-opacity: 0.07;
}
:root[data-theme="dark"] .hero .hero-stats li + li { border-color: rgba(255, 255, 255, 0.22); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero {
    --hero-wash: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.45) 60%, var(--bg) 100%);
    --glass: rgba(28, 28, 30, 0.62);
    --glass-line: rgba(255, 255, 255, 0.14);
    --hero-lead: #d1d1d6;
    --aurora-base: #03060f;
    --aurora-1: rgba(38, 92, 214, 0.55);
    --aurora-2: rgba(14, 128, 130, 0.42);
    --aurora-3: rgba(196, 146, 40, 0.30);
    --aurora-4: rgba(72, 58, 170, 0.40);
    --grain-opacity: 0.07;
  }
  :root:not([data-theme="light"]) .hero .hero-stats li + li { border-color: rgba(255, 255, 255, 0.22); }
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  padding: 5px 14px 5px 6px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.eyebrow-dot {
  padding: 1px 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-strong);
  background: var(--gold-soft);
  border-radius: 999px;
}
.hero h1 {
  max-width: 14ch;
  margin: 0 auto 20px;
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 6vw, 4.25rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--brand);
}
.hero h1 em { font-style: italic; color: var(--gold-ink); }
.hero-lead {
  max-width: 600px;
  margin: 0 auto 40px;
  font-size: 21px;
  line-height: 1.43;
  letter-spacing: -0.02em;
  color: var(--text-2);
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 18px auto 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--text-2);
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
a.chip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }

.hero-stats {
  display: flex;
  justify-content: center;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: var(--text-2);
}
.hero-stats li { padding: 0 22px; white-space: nowrap; }
.hero-stats li + li { border-left: 1px solid var(--line-strong); }
.hero-stats strong { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* The band under the hero: a navy panel with a few floating pieces of the site's own UI
   (a review card, the rating spread, two pills). Pure HTML and CSS, decorative only. */
.hero-visual {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: end;
  min-height: 440px;
  margin: 56px 0 0;
  overflow: hidden;
  text-align: left;
  color: #ffffff;
  background:
    radial-gradient(60% 80% at 88% 8%, rgba(74, 140, 255, 0.42), transparent 70%),
    radial-gradient(45% 60% at 72% 18%, rgba(240, 194, 75, 0.16), transparent 70%),
    radial-gradient(60% 80% at 0% 100%, rgba(30, 80, 190, 0.28), transparent 70%),
    linear-gradient(135deg, #061331 0%, #0a1f44 48%, #0e2d63 100%);
  border-radius: 28px;
  box-shadow: 0 30px 60px -30px rgba(10, 31, 68, 0.55);
}
/* A fine grid that fades out towards the caption, plus grain. */
.hero-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 36px 36px;
  -webkit-mask-image: radial-gradient(90% 90% at 78% 30%, #000 10%, transparent 70%);
  mask-image: radial-gradient(90% 90% at 78% 30%, #000 10%, transparent 70%);
}
.hero-visual::after { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--grain); opacity: 0.06; pointer-events: none; }
.hero-visual figcaption {
  grid-column: 1;
  grid-row: 1;
  max-width: 460px;
  padding: 0 0 40px 44px;
}
.hero-visual figcaption strong {
  display: block;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.hero-visual figcaption span { display: block; margin-top: 10px; font-size: 17px; line-height: 1.45; color: rgba(255, 255, 255, 0.78); }

.hv-art { grid-column: 2; grid-row: 1; align-self: stretch; position: relative; min-height: 440px; }
.hv-stage { position: absolute; top: 50%; left: 50%; width: 440px; height: 330px; margin: -165px 0 0 -220px; }
.hv-card {
  position: absolute;
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 20px;
}
/* The review card is the site's real card style, so it follows the theme. */
.hv-card--review {
  left: 0; bottom: 6px;
  width: 300px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  rotate: -3deg;
  animation: hv-float 9s ease-in-out infinite alternate;
}
.hv-card--spread {
  top: 0; right: 0;
  width: 270px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.6);
  rotate: 3deg;
  animation: hv-float 11s ease-in-out -4s infinite alternate-reverse;
}
.hv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hv-label { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.hv-scale { font-size: 12px; color: rgba(255, 255, 255, 0.6); font-variant-numeric: tabular-nums; }
.hv-bars { display: flex; align-items: flex-end; gap: 6px; height: 92px; }
.hv-bars i {
  flex: 1;
  height: var(--h, 10%);
  background: linear-gradient(180deg, #f3d27a, var(--gold) 70%, #b8860b);
  border-radius: 4px 4px 2px 2px;
  opacity: 0.95;
  transform-origin: bottom;
  animation: hv-bar 1.1s var(--ease) both;
}
.hv-bars i:nth-child(1) { --h: 6%; opacity: 0.45; }
.hv-bars i:nth-child(2) { --h: 4%; opacity: 0.45; }
.hv-bars i:nth-child(3) { --h: 8%; opacity: 0.5; }
.hv-bars i:nth-child(4) { --h: 10%; opacity: 0.55; }
.hv-bars i:nth-child(5) { --h: 18%; opacity: 0.65; }
.hv-bars i:nth-child(6) { --h: 26%; opacity: 0.75; }
.hv-bars i:nth-child(7) { --h: 44%; }
.hv-bars i:nth-child(8) { --h: 72%; }
.hv-bars i:nth-child(9) { --h: 100%; }
.hv-bars i:nth-child(10) { --h: 62%; }
.hv-bars i:nth-child(n) { animation-delay: calc(0.7s + var(--i, 0) * 40ms); }
.hv-line { display: block; height: 9px; background: var(--surface-2); border-radius: 99px; }
.hv-line--short { width: 62%; }
.hv-card .rating-badge { font-size: 17px; }
.hv-card .stars { font-size: 15px; }
.hv-tags { display: flex; gap: 6px; padding-top: 2px; }
.hv-tags span {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  white-space: nowrap;
}
.hv-pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.hv-pill strong { font-weight: 700; color: #f3d27a; }
.hv-pill svg { width: 15px; height: 15px; fill: none; stroke: #8fd3a8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hv-pill--anon { top: 26px; left: 6px; animation: hv-float 8s ease-in-out -2s infinite alternate; }
.hv-pill--again { z-index: 2; right: -4px; bottom: 58px; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6); background: rgba(16, 38, 82, 0.72); animation: hv-float 10s ease-in-out -6s infinite alternate-reverse; }

/* ---------- School art (home cards and the school page hero) ---------- */

/* Each school is a deep colour pair, a soft glow and a fine line pattern; schools.js sets
   --art-from, --art-to, --art-glow and data-pattern. White text stays readable on all of them. */
.school-art {
  --art-from: #071633;
  --art-to: #123a7a;
  --art-glow: #6fb0ff;
  --art-pattern:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px) 0 0 / 26px 26px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #ffffff;
  background: linear-gradient(135deg, var(--art-from) 15%, var(--art-to) 100%);
}
.school-art[data-pattern="rise"] {
  --art-pattern: repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 15px);
}
.school-art[data-pattern="rings"] {
  --art-pattern: repeating-radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.11) 0 1px, transparent 1.5px 20px);
}
.school-art[data-pattern="columns"] {
  --art-pattern:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px) 0 0 / 100% 64px,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 16px);
}
.school-art[data-pattern="contours"] {
  --art-pattern: repeating-radial-gradient(ellipse 160% 90% at 10% 130%, rgba(255, 255, 255, 0.1) 0 1px, transparent 1.5px 15px);
}
.school-art[data-pattern="iso"] {
  --art-pattern:
    repeating-linear-gradient(60deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-60deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 19px);
}
/* Pattern: strongest top right, fading away from the text. */
.school-art::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--art-pattern);
  -webkit-mask-image: radial-gradient(110% 110% at 90% 0%, #000 15%, transparent 75%);
  mask-image: radial-gradient(110% 110% at 90% 0%, #000 15%, transparent 75%);
  transition: transform var(--dur-slow) var(--ease);
}
/* Glow: a soft light in the school's colour. */
.school-art::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(55% 75% at 85% 15%, var(--art-glow), transparent 70%);
  opacity: 0.42;
  mix-blend-mode: screen;
  transition: transform var(--dur-slow) var(--ease), opacity var(--dur-slow) var(--ease);
}

.school-card-media.school-art { container-type: inline-size; display: flex; flex-direction: column; justify-content: space-between; padding: 18px 20px 16px; }
.school-art-icon {
  width: 42px; height: 42px;
  padding: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
}
.school-art-code {
  font-family: var(--font-display);
  font-size: 56px;
  font-size: clamp(28px, 19cqi, 66px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #ffffff 30%, rgba(255, 255, 255, 0.72));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.school-card:hover .school-art::before { transform: scale(1.04); }
.school-card:hover .school-art::after { opacity: 0.6; transform: translate(-3%, 4%) scale(1.06); }

/* ---------- Sections ---------- */

.section { padding: 88px 0; }
.section--tint { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-bottom: 32px;
}
.section-kicker { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: var(--kicker); }
.section-head h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
.section-head p { max-width: 560px; margin-top: 8px; font-size: 19px; color: var(--text-2); }
.section-head--center { justify-content: center; text-align: center; }
.section-head--center p { margin-inline: auto; }

/* ---------- School cards ---------- */

.school-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0; padding: 0;
  list-style: none;
}
.school-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border-radius: var(--radius-lg);
  transition: transform var(--dur-slow) var(--ease), box-shadow var(--dur-slow) var(--ease);
}
.school-card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow); }
.school-card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.school-card-body { display: flex; flex-direction: column; flex: 1; gap: 4px; padding: 18px 20px 20px; }
.school-card h3 { font-size: 19px; line-height: 1.25; letter-spacing: -0.02em; }
.school-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 10px;
  font-size: 14px;
  color: var(--text-2);
}
.school-arrow {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  flex-shrink: 0;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
  transition: transform var(--dur-base) var(--ease);
}
.school-arrow svg { width: 15px; height: 15px; }
.school-card:hover .school-arrow { transform: translateX(3px); }

/* ---------- Professor cards ---------- */

.prof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin: 0; padding: 0;
  list-style: none;
}
.prof-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 20px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.section--tint .prof-card { border-color: transparent; }
.prof-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); }
.prof-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.avatar {
  width: 56px; height: 56px;
  flex-shrink: 0;
  object-fit: cover;
  object-position: top;
  background: var(--surface-2);
  border-radius: 50%;
}
.prof-card .avatar { width: 64px; height: 64px; }
.prof-card h3 { font-size: 17px; line-height: 1.25; letter-spacing: -0.02em; }
.prof-title { margin-top: 2px; font-size: 14px; line-height: 1.35; color: var(--text-2); }
.prof-spec {
  font-size: 14px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prof-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; font-size: 13px; color: var(--text-2); }
.pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: 999px;
}

/* ---------- Rating badge and stars ---------- */

.rating-badge {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  min-width: 46px;
  padding: 4px 9px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  border-radius: 9px;
}
.rating-badge small { font-size: 0.72em; font-weight: 600; opacity: 0.75; }
.rating-badge.r-high { color: var(--good); background: var(--good-soft); }
.rating-badge.r-mid { color: var(--mid); background: var(--mid-soft); }
.rating-badge.r-low { color: var(--low); background: var(--low-soft); }
.rating-badge.r-none { font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface-2); }
.rating-badge.large {
  display: inline-flex;
  min-width: 0;
  padding: 0;
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.04em;
  background: none;
}
.rating-badge.large small { margin-left: 3px; font-size: 0.34em; font-weight: 500; color: var(--text-3); opacity: 1; letter-spacing: -0.01em; }
.rating-badge.large.r-none { font-size: 22px; letter-spacing: -0.02em; color: var(--text-2); }

.stars {
  --pct: 0%;
  position: relative;
  display: inline-block;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--surface-3);
}
.stars::before { content: '★★★★★'; }
.stars::after {
  content: '★★★★★';
  position: absolute;
  left: 0; top: 0;
  width: var(--pct);
  overflow: hidden;
  white-space: nowrap;
  color: var(--gold);
}

/* ---------- Recent reviews ---------- */

.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0; padding: 0;
  list-style: none;
}
.recent-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 22px;
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.recent-text {
  font-size: 17px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-empty { font-size: 15px; font-style: italic; color: var(--text-2); }
.recent-prof {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  border-top: 1px solid var(--line);
}
.recent-prof:hover { text-decoration: none; }
.recent-prof:hover span:first-child { color: var(--accent); }
.recent-school { font-size: 13px; font-weight: 600; color: var(--text-2); }

/* ---------- How it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin: 0; padding: 0;
  list-style: none;
  text-align: center;
}
.step-icon {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  margin: 0 auto 18px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 16px;
}
.step-icon svg { width: 26px; height: 26px; }
.step h3 { margin-bottom: 6px; font-size: 21px; letter-spacing: -0.02em; }
.step p { max-width: 300px; margin: 0 auto; color: var(--text-2); }

/* ---------- Call to action ---------- */

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 44px 48px;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
}
.cta-band h2 { margin-bottom: 6px; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.cta-band p { color: var(--text-2); }

/* ---------- Buttons and fields ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  font-size: 17px;
  font-weight: 500;
  text-align: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn svg { width: 18px; height: 18px; }
.btn-primary, .btn-gold { color: var(--on-accent); background: var(--accent); }
.btn-primary:hover, .btn-gold:hover { background: var(--accent-hover); }
.btn-ghost { color: var(--text); background: var(--surface-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-outline { color: var(--accent); background: transparent; box-shadow: inset 0 0 0 1px var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn[disabled], .btn[aria-busy="true"], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; }

.input, .select, .textarea {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: 12px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input, .select { height: 44px; padding: 0 14px; font-size: 16px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select {
  padding-right: 36px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a8a8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.field-inline { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.link-btn {
  min-height: 40px;
  margin-top: 2px;
  padding: 0;
  font-size: 14px;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.link-btn[hidden] { display: none; }

/* ---------- School page ---------- */

.page-hero { position: relative; overflow: hidden; color: #ffffff; background-color: #0b0b0d; }
/* The school's code, set huge and faint on the right; pure decoration. */
.page-hero-mark {
  position: absolute;
  right: max(var(--gutter), calc((100% - var(--container)) / 2));
  bottom: -0.16em;
  z-index: -1;
  font-family: var(--font-display);
  font-size: clamp(120px, 17vw, 240px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-hero .container { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 420px; padding-top: 20px; padding-bottom: 72px; }
.page-hero-kicker { display: flex; align-items: center; gap: 10px; margin-top: auto; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: rgba(255, 255, 255, 0.88); }
.page-hero-icon:empty { display: none; }
.page-hero-icon .school-art-icon { display: block; width: 36px; height: 36px; padding: 8px; border-radius: 10px; }
.page-hero h1 { margin-top: 6px; font-size: clamp(2.2rem, 5vw, 3.5rem); letter-spacing: -0.035em; color: #ffffff; }
.page-hero-stats { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 18px 0 0; padding: 0; list-style: none; }
.page-hero-stats li { display: flex; align-items: baseline; gap: 6px; font-size: 15px; color: rgba(255, 255, 255, 0.8); }
.page-hero-stats strong { font-size: 22px; font-weight: 600; color: #ffffff; font-variant-numeric: tabular-nums; }

.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.breadcrumbs li + li::before { content: '›'; margin-right: 6px; color: rgba(255, 255, 255, 0.6); }
.breadcrumbs a { color: rgba(255, 255, 255, 0.88); }
.breadcrumbs a:hover { color: #ffffff; }
.breadcrumbs [aria-current] { color: #ffffff; }
.breadcrumbs--light { padding-top: 22px; }
.breadcrumbs--light li + li::before { color: var(--text-3); }
.breadcrumbs--light a { color: var(--text-2); }
.breadcrumbs--light a:hover { color: var(--text); }
.breadcrumbs--light [aria-current] { color: var(--text); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.toolbar .input { flex: 1; min-width: 240px; background: var(--surface-2); border-color: transparent; }
.toolbar .input:focus { background: var(--surface); border-color: var(--accent); }
.result-count { margin-left: auto; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- Professor page ---------- */

.prof-layout { padding: 0 0 88px; }
.card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }

.prof-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 32px 0 36px;
}
.prof-header .avatar { width: 120px; height: 120px; }
.prof-header h1 { font-size: clamp(2rem, 4.4vw, 2.75rem); letter-spacing: -0.035em; }
.prof-header .prof-title { margin-top: 6px; font-size: 19px; }
.prof-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.prof-meta .pill { height: auto; min-height: 28px; padding: 4px 11px; white-space: normal; }
.prof-meta a.pill { color: var(--accent); }
.prof-meta a.pill:hover { text-decoration: none; background: var(--accent-soft); }
.prof-inactive { margin-top: 12px; padding: 8px 12px; font-size: 14px; color: var(--gold-strong); background: var(--gold-soft); border-radius: var(--radius-sm); }
.prof-actions { display: grid; gap: 10px; min-width: 220px; }

/* Full-bleed grey band without widening the page (no horizontal scroll from 100vw). */
.summary-band { padding: 36px 0; background: var(--bg-alt); box-shadow: 0 0 0 100vmax var(--bg-alt); clip-path: inset(0 -100vmax); }
.summary { display: flex; flex-wrap: wrap; gap: 16px; }
.stat { flex: 1 1 200px; padding: 22px 24px; background: var(--surface); border-radius: var(--radius-lg); }
.stat-overall { flex: 1.1 1 240px; }
.stat-dist { flex: 1.6 1 300px; }
.stat-tags { flex: 2 1 320px; }
.stat-label { margin: 0 0 6px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.stat-value { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-value small { margin-left: 2px; font-size: 19px; font-weight: 500; color: var(--text-3); letter-spacing: -0.01em; }
.stat-note { margin-top: 8px; font-size: 14px; color: var(--text-2); }
.stat-overall .stars { margin-top: 10px; }
.meter { height: 6px; margin-top: 14px; overflow: hidden; background: var(--surface-3); border-radius: 3px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.dist { display: grid; gap: 5px; margin: 4px 0 0; padding: 0; list-style: none; }
.dist li {
  display: grid;
  grid-template-columns: 20px 1fr 26px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.dist li > span:first-child { text-align: right; }
.dist-bar { height: 7px; overflow: hidden; background: var(--surface-3); border-radius: 999px; }
.dist-bar span { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.dist-count { text-align: right; color: var(--text); }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  border-radius: 999px;
}
.tag-count { font-weight: 600; color: var(--text-2); }

.prof-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 40px;
  align-items: start;
  padding-top: 48px;
}
.prof-columns > * { min-width: 0; }

.reviews-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.reviews-head h2 { font-size: 28px; letter-spacing: -0.03em; }
.reviews-head h2 .prof-title { display: inline; font-size: 19px; font-weight: 500; color: var(--text-3); }
.reviews-controls { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.review-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.review { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.review-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; color: var(--text-2); }
.review-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 14px; color: var(--text); }
.fact-label { color: var(--text-2); }
.review .tag-list { margin-bottom: 12px; }
.review p { font-size: 17px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.review.is-new { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.review p.review-empty { font-size: 15px; font-style: italic; color: var(--text-2); }
.review-report {
  margin-left: auto;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--text-3);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.review-report:hover { color: var(--danger-text); background: var(--surface-2); }
.review-reported { margin-left: auto; font-size: 13px; color: var(--text-3); }
.report-form { margin-top: 14px; padding: 14px; background: var(--bg-alt); border-radius: var(--radius-sm); }
.report-form .label { font-size: 14px; }
.report-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.report-row .select, .report-row .input { flex: 1; min-width: 200px; }
.report-row--spaced { margin-top: 16px; }
.review p.review-empty--note { margin-top: 10px; }
.removal { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
#removal-form { max-width: 600px; }
#removal-form .removal-intro { margin-bottom: 14px; }
#removal-message { min-height: 110px; }
#removal-count { margin-bottom: 10px; }
#removal-contact { width: 100%; }
#removal-done { max-width: 600px; }
.state--top { margin-top: 28px; }

/* ---------- Review form ---------- */

.review-form { position: sticky; top: calc(var(--header-h) + 20px); scroll-margin-top: calc(var(--header-h) + 20px); }
.review-form h2 { margin-bottom: 6px; font-size: 21px; letter-spacing: -0.02em; }
.form-hint { margin-bottom: 22px; font-size: 14px; color: var(--text-2); }
.fieldset { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.fieldset legend, .label { display: block; margin-bottom: 8px; padding: 0; font-size: 15px; font-weight: 600; }
.label-hint { font-weight: 400; color: var(--text-2); }
.rating-picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
/* Each radio sits exactly over its own number, so a click or tap can only pick that number. */
.rate-option { position: relative; display: grid; }
.rating-picker input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rating-picker label {
  display: grid;
  place-items: center;
  min-height: 44px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.rate-option:hover label { border-color: var(--accent); }
.rating-picker input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.rating-picker input:checked + label { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.rating-scale-hint { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--text-2); }
.rating-picker--choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-field { margin-bottom: 20px; }
.course-input { width: 100%; text-transform: uppercase; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .fieldset[aria-invalid="true"] .rating-picker label { border-color: var(--danger-text); }
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-option { position: relative; display: grid; }
.tag-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tag-option label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.tag-option:hover label { border-color: var(--accent); }
.tag-option input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.tag-option input:checked + label { font-weight: 600; color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.tag-option input:checked + label::before { content: '✓'; font-weight: 700; }
.textarea { width: 100%; min-height: 140px; padding: 12px 14px; font-size: 16px; line-height: 1.45; resize: vertical; }
.char-count { display: block; margin: 6px 0 16px; font-size: 13px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.char-count.warn { font-weight: 600; color: var(--warn-text); }
.field-error { margin-top: 6px; font-size: 14px; color: var(--danger-text); }
.field-error:empty { display: none; }
.review-form .btn-primary { width: 100%; }
.status { margin-top: 14px; padding: 12px 14px; font-size: 15px; font-weight: 500; border-radius: var(--radius-sm); }
.status:empty { display: none; }
.status.success { color: var(--success-text); background: var(--success-bg); }
.status.error { color: var(--error-text); background: var(--error-bg); }

/* ---------- Text pages ---------- */

.prose-wrap { padding-bottom: 88px; }
.prose { max-width: 700px; padding-top: 28px; }
.prose h1 { margin-bottom: 14px; font-size: clamp(2.2rem, 4.4vw, 3rem); letter-spacing: -0.035em; }
.prose h2 { margin: 40px 0 10px; font-size: 24px; letter-spacing: -0.025em; }
.prose p, .prose li { color: var(--text-2); }
.prose ul { display: grid; gap: 8px; margin: 0; padding-left: 1.2em; }
.prose-lead { font-size: 21px; line-height: 1.43; }
.prose strong { color: var(--text); }
.prose code { padding: 1px 6px; font-size: 0.9em; background: var(--surface-2); border-radius: 5px; }

/* ---------- Moderation ---------- */

.admin-title { margin: 32px 0 20px; font-size: 2.2rem; }
.admin-login { max-width: 560px; }
.admin-gap { margin-top: 40px; }
.admin-reasons { margin-top: 8px; font-size: 14px; color: var(--danger-text); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.admin-delete { color: var(--danger-text); }
.admin-badge {
  margin-left: auto;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: 999px;
}
.admin-badge--pending { color: var(--gold-strong); background: var(--gold-soft); }
.admin-badge--hidden { color: var(--error-text); background: var(--error-bg); }

/* ---------- States ---------- */

.state {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-2);
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
}
.state h3, .state-title { margin-bottom: 6px; font-size: 19px; letter-spacing: -0.02em; color: var(--text); }
.state .btn { margin-top: 16px; }
.state.error { color: var(--error-text); background: var(--error-bg); }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--bg-alt) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  border-color: transparent;
  border-radius: var(--radius-lg);
  animation: shimmer 1.4s infinite linear;
}
.skeleton-card { min-height: 180px; }
.school-grid .skeleton-card { min-height: 300px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Footer ---------- */

.site-footer {
  padding: 48px 0 32px;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--text-2);
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-bottom: 28px; }
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand .brand-mark { width: 26px; height: 26px; }
.footer-brand .brand-name { font-size: 16px; }
.footer-brand p { max-width: 340px; }
.site-footer h2 { margin-bottom: 12px; font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.footer-links { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.site-footer a:not(.brand) { color: var(--text-2); }
.site-footer a:not(.brand):hover { color: var(--text); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.site-footer .brand-fold { stroke: var(--bg-alt); }

/* ---------- Phone review bar ---------- */

.mobile-cta { display: none; }


/* ---------- Motion ---------- */

/* Aurora lights drift slowly and never in step. */
@keyframes aurora-a { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(14vmax, 6vmax, 0) scale(1.15); } }
@keyframes aurora-b { from { transform: translate3d(0, 0, 0) scale(1.1); } to { transform: translate3d(-16vmax, 8vmax, 0) scale(0.92); } }
@keyframes aurora-c { from { transform: translate3d(0, 0, 0) scale(0.95); } to { transform: translate3d(10vmax, -8vmax, 0) scale(1.12); } }
/* Pieces of the home panel float gently. */
@keyframes hv-float { from { translate: 0 0; } to { translate: 0 -10px; } }
@keyframes hv-bar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes rise-scroll { from { opacity: 0; transform: translateY(36px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes shine { 0%, 55% { background-position: 120% 0; } 100% { background-position: -40% 0; } }

/* Home: the headline block arrives in sequence. */
.hero .eyebrow, .hero h1, .hero-lead, .search--hero, .hero-chips, .hero-stats, .hero-visual {
  animation: rise 0.9s var(--ease) both;
}
.hero h1 { animation-delay: 0.08s; }
.hero-lead { animation-delay: 0.18s; }
.search--hero { animation-delay: 0.28s; }
.hero-chips { animation-delay: 0.36s; }
.hero-stats { animation-delay: 0.44s; }
.hero-visual { animation-delay: 0.52s; }

/* A slow gold sheen across "confidence". */
.hero h1 em {
  background: linear-gradient(100deg, var(--gold-ink) 40%, #f3d27a 50%, var(--gold-ink) 60%) 120% 0 / 250% 100% repeat-x;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* The gradient only paints inside the box; italic letters lean past it, so give them room
     (padding) without moving anything (matching negative margin). */
  padding: 0 0.12em 0.08em 0.04em;
  margin: 0 -0.12em -0.08em -0.04em;
  animation: shine 6s ease-in-out 1.2s infinite;
}


/* Search results and the phone menu open with a small drop. */
.search-results:not([hidden]) { animation: pop 0.18s var(--ease); }

/* Professor page: the summary cards and bars fill in once the data arrives. */
.prof-header { animation: rise 0.6s var(--ease) both; }
.summary .stat { animation: rise 0.6s var(--ease) both; }
.summary .stat:nth-child(3) { animation-delay: 0.06s; }
.summary .stat:nth-child(4) { animation-delay: 0.12s; }
.summary .stat:nth-child(5) { animation-delay: 0.18s; }
.summary .stat:nth-child(6) { animation-delay: 0.24s; }
.dist-bar span, .meter span { transform-origin: left center; animation: grow-x 0.9s var(--ease) 0.2s both; }
.dist li:nth-child(2) .dist-bar span { animation-delay: 0.24s; }
.dist li:nth-child(3) .dist-bar span { animation-delay: 0.28s; }
.dist li:nth-child(4) .dist-bar span { animation-delay: 0.32s; }
.dist li:nth-child(5) .dist-bar span { animation-delay: 0.36s; }
.dist li:nth-child(n+6) .dist-bar span { animation-delay: 0.4s; }
.review.is-new { animation: rise 0.6s var(--ease) both; }

/* Cards, sections and reviews rise into place as they scroll into view (no script needed;
   browsers without scroll-driven animations simply show everything). */
@supports (animation-timeline: view()) {
  .section-head, .school-grid > li, .prof-grid > li, .recent-grid > li, .steps > li, .cta-band,
  .review-list > li, .prose > * {
    animation: rise-scroll linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 45%;
  }
  .school-grid > li:nth-child(3n+2), .recent-grid > li:nth-child(3n+2), .steps > li:nth-child(2),
  .prof-grid > li:nth-child(4n+2) { animation-range: entry 6% entry 52%; }
  .school-grid > li:nth-child(3n), .recent-grid > li:nth-child(3n), .steps > li:nth-child(3),
  .prof-grid > li:nth-child(4n+3) { animation-range: entry 12% entry 58%; }
  .prof-grid > li:nth-child(4n) { animation-range: entry 18% entry 64%; }
  /* Sideways shelves on phones scroll horizontally; their cards should not wait for it. */
  @media (max-width: 720px) {
    .prof-grid--rail > li { animation: rise 0.6s var(--ease) both; }
  }
}


/* ---------- Rules screen (first visit) ---------- */

.rules-open { overflow: hidden; }
.rules-gate {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
}
.rules-gate[open] { animation: rules-in 0.45s var(--ease); }
.rules-gate::backdrop {
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  animation: fade-in 0.3s ease;
}
@keyframes rules-in { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
.rules-gate-form { display: grid; gap: 16px; padding: 32px; }
.rules-gate-badge {
  justify-self: start;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--gold-strong);
  background: var(--gold-soft);
  border-radius: 999px;
}
.rules-gate h2 { font-size: 28px; letter-spacing: -0.03em; }
.rules-gate-lead { color: var(--text-2); }
.rules-gate-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: rule; }
.rules-gate-list li {
  position: relative;
  padding: 12px 14px 12px 50px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-2);
  background: var(--bg-alt);
  border-radius: 14px;
}
.rules-gate-list li::before {
  counter-increment: rule;
  content: counter(rule);
  position: absolute;
  left: 14px; top: 12px;
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 50%;
}
.rules-gate-list strong { display: block; color: var(--text); font-weight: 600; }
.rules-gate-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.45;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  cursor: pointer;
}
.rules-gate-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rules-gate-faculty { justify-self: center; font-size: 14px; color: var(--text-2); }
.rules-gate-check input { flex-shrink: 0; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
@media (max-width: 720px) {
  .rules-gate { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .rules-gate-form { padding: 24px 18px calc(20px + env(safe-area-inset-bottom)); }
  .rules-gate h2 { font-size: 24px; }
  .rules-gate[open] { animation: sheet-in 0.4s var(--ease); }
  @keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .school-grid, .recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prof-columns { grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; }
}

/* Tablets and small laptops: the nav links move into the menu. */
@media (max-width: 960px) {
  :root { --gutter: 20px; }
  .header-nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .steps { grid-template-columns: 1fr; gap: 32px; }
  .prof-columns { grid-template-columns: 1fr; }
  .review-form { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  :root { --gutter: 18px; --header-h: 58px; }
  :root:has(.site-header .search) { --header-h: 110px; }
  .site-header-inner { flex-wrap: wrap; gap: 8px 10px; height: auto; min-height: var(--header-h); padding-block: 6px; }
  .site-header .search { order: 3; flex-basis: 100%; max-width: none; margin: 0 0 4px; }
  .header-actions, .site-header .search + .header-actions { margin-left: auto; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 19px; }

  .hero { padding: 48px 0 56px; }
  .hero h1 { font-size: 2.75rem; }
  .hero-lead { margin-bottom: 28px; font-size: 17px; }
  .eyebrow { margin-bottom: 20px; }
  .search--hero .search-input { height: 54px; padding-right: 16px; font-size: 17px; }
  .search-submit { display: none; }
  .hero-stats { margin-top: 32px; font-size: 14px; }
  .hero-stats li { padding: 0 12px; }
  .hero-visual { grid-template-columns: minmax(0, 1fr); min-height: 0; margin-top: 36px; border-radius: 22px; }
  .hv-art { grid-column: 1; grid-row: 1; min-height: 262px; }
  .hv-stage { top: 20px; margin: 0 0 0 -220px; scale: 0.72; transform-origin: 50% 0; }
  .hero-visual figcaption { grid-column: 1; grid-row: 2; padding: 0 22px 24px; }
  .hero-visual figcaption strong { font-size: 25px; }
  .hero-visual figcaption span { font-size: 15px; }

  .section { padding: 56px 0; }
  .section-head { margin-bottom: 22px; }
  .section-head h2 { font-size: 28px; }
  .section-head p { font-size: 17px; }
  .school-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .school-card-body { padding: 12px 14px 14px; }
  .school-card h3 { font-size: 16px; }
  .school-meta { font-size: 13px; }
  .school-arrow { display: none; }
  .recent-grid { grid-template-columns: 1fr; gap: 12px; }
  .prof-grid { grid-template-columns: 1fr; gap: 12px; }
  /* Top rated swipes sideways on phones, like an App Store shelf. */
  .prof-grid--rail {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 74%;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .prof-grid--rail::-webkit-scrollbar { display: none; }
  .prof-grid--rail > li { scroll-snap-align: start; }
  .cta-band { padding: 28px 22px; }
  .cta-band .btn { width: 100%; }

  .page-hero .container { min-height: 340px; padding-bottom: 56px; }
  .page-hero-mark { right: auto; left: calc(var(--gutter) - 0.04em); bottom: auto; top: 44px; font-size: 128px; }
  .school-card-media.school-art { padding: 12px 14px 10px; }
  .school-card-media .school-art-icon { width: 32px; height: 32px; padding: 7px; border-radius: 9px; }
  .toolbar .input { flex-basis: 100%; min-width: 0; }
  .field-inline { flex: 1; }
  .field-inline .select { flex: 1; }
  .result-count { width: 100%; margin-left: 0; }

  .prof-header { grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; padding: 20px 0 24px; }
  .prof-header .avatar { width: 84px; height: 84px; }
  .prof-header h1 { font-size: 28px; }
  .prof-header .prof-title { font-size: 16px; }
  .prof-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; min-width: 0; }
  .prof-actions .btn { min-height: 40px; font-size: 15px; }
  .prof-actions .btn-primary { display: none; }
  .summary-band { padding-block: 20px; }
  .summary { gap: 10px; }
  .stat { flex-basis: 140px; padding: 16px; }
  .stat-overall, .stat-dist, .stat-tags { flex-basis: 100%; }
  .stat-value { font-size: 30px; }
  .rating-badge.large { font-size: 48px; }
  .prof-columns { padding-top: 32px; }
  .reviews-head h2 { font-size: 24px; }
  .card { padding: 20px; }
  .review { padding: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .site-footer { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

  .mobile-cta {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line);
    transition: transform var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease), visibility var(--dur-base);
  }
  .mobile-cta.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; visibility: hidden; }
  html:has(.mobile-cta:not(.is-hidden)) { scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  body:has(.mobile-cta:not(.is-hidden)) .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

@media (max-width: 720px) and (max-height: 520px) {
  .site-header { position: static; }
}

@media (max-width: 380px) {
  .brand-name { font-size: 16px; }
  .hero h1 { font-size: 2.4rem; }
  .hero-stats li { padding: 0 8px; }
  .header-actions { gap: 2px; }
}

/* Touch screens: no hover lifts that stick after a tap, and 16px form text so iOS does not zoom. */
@media (hover: none) {
  .school-card:hover, .prof-card:hover { transform: none; box-shadow: none; }
  .school-card:hover .school-art::before, .school-card:hover .school-art::after { transform: none; }
  .school-card:active, .prof-card:active { transform: scale(0.99); }
}
@media (pointer: coarse) {
  input, select, textarea, .search-input, .input, .select, .textarea { font-size: 16px; }
  .chip { min-height: 40px; padding: 0 14px; }
  .review-report { min-height: 40px; }
  .header-link { min-height: 44px; }
}

@media (forced-colors: active) {
  .theme-switch-track { border-color: CanvasText; }
  .theme-switch-knob { background: CanvasText; forced-color-adjust: none; }
  .rating-picker input:checked + label, .tag-option input:checked + label { outline: 3px solid CanvasText; outline-offset: -3px; }
  .rating-badge, .chip, .pill, .tag { border: 1px solid CanvasText; }
}

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