:root {
  color-scheme: light;
  --ink: #0d1b2a;
  --navy: #0d1b2a;
  --navy-2: #1b263b;
  --gold: #d4af37;
  --gold-dark: #b88416;
  --muted: #566478;
  --paper: #f8fafd;
  --paper-2: #f2f4f7;
  --panel: #ffffff;
  --line: #dce3ed;
  --green: #b88416;
  --green-dark: #0d1b2a;
  --blue: #1b263b;
  --rose: #dc2626;
  --focus: #d4af37;
  --shadow: 0 4px 32px rgba(13, 27, 42, 0.10);
  --accent: #d4af37;
  --accent-light: #fff4cf;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -44px;
  z-index: 20;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 12px;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(212, 175, 55, 0.26);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(13, 27, 42, 0.08);
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--ink);
}

.mark {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(13, 27, 42, 0.16);
  overflow: hidden;
}

.mark img {
  display: block;
  width: 100%;
  height: 100%;
}

/* Older generated pages wrap the letters in .mark-core and add a .mark-spark dot.
   Keep the letters; hide the decorative spark. */
.mark > .mark-core {
  display: inline;
  color: inherit;
  font: inherit;
}

.mark-spark {
  display: none;
}

.brand-name {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.brand-lockup {
  display: grid;
  gap: 3px;
}

.brand-tagline {
  color: var(--gold-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

nav {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #27364a;
  font-size: 14px;
  font-weight: 800;
}

nav a,
.nav-menu summary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: inherit;
}

nav a:hover,
.nav-menu summary:hover {
  color: var(--green-dark);
  text-decoration: none;
}

.nav-menu {
  position: relative;
}

.nav-menu summary {
  gap: 6px;
  list-style: none;
  cursor: pointer;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
}

.nav-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 12;
  width: min(760px, calc(100vw - 32px));
  max-height: min(70vh, 620px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 24px 60px rgba(13, 27, 42, 0.18);
  transform: translateX(-50%);
}

.nav-panel-section {
  display: grid;
  gap: 7px;
  align-content: start;
}

.nav-panel-section strong {
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-panel-section a {
  min-height: 0;
  padding: 3px 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 8px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}

main {
  overflow: hidden;
}

.hero-band {
  padding: 72px 0 42px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
  background:
    linear-gradient(145deg, rgba(13, 27, 42, 0.08) 0%, rgba(248, 250, 253, 0.94) 42%, #f8fafd 100%),
    radial-gradient(circle at 12% 8%, rgba(212, 175, 55, 0.16), transparent 32%);
}

.profile-hero {
  background:
    linear-gradient(145deg, rgba(13, 27, 42, 0.10) 0%, rgba(248, 250, 253, 0.94) 50%, #f8fafd 100%),
    radial-gradient(circle at 14% 10%, rgba(212, 175, 55, 0.18), transparent 34%);
}

.hero-stack {
  display: grid;
  gap: 22px;
}

.eyebrow {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p,
td,
th {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 920px;
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(42px, 6.2vw, 78px);
  line-height: 0.99;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
}

.lede {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
}

.hero-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 900;
  text-decoration: none;
}

.button.primary {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: white;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(13, 27, 42, 0.22);
}

.button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(31, 111, 80, 0.28);
  outline-offset: 2px;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 12px;
  background: var(--accent-light);
  color: #8a5a08;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9em;
  letter-spacing: -0.01em;
}

.nav-cta {
  min-height: 36px;
  font-size: 13px;
  padding: 0 14px;
  white-space: nowrap;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 920px;
}

.stat-strip div,
.panel,
.university-card,
.link-tile,
.source-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stat-strip div {
  min-height: 88px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 16px;
}

.stat-strip strong {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.stat-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.section {
  padding: 68px 0;
  border-top: 1px solid var(--line);
}

.section:first-child {
  border-top: 0;
}

.tinted {
  background: var(--paper-2);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(280px, 0.5fr);
  gap: 34px;
  align-items: end;
  margin-bottom: 28px;
}

.section-heading.compact h2 {
  margin-top: 8px;
}

.section-heading p,
.summary-copy,
.muted,
.empty-note,
.cta-grid p,
.disclaimer p {
  color: var(--muted);
  line-height: 1.55;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(320px, 0.72fr);
  gap: 36px;
  align-items: start;
}

.summary-copy {
  margin: 0;
  font-size: 19px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #fbf8f1;
  color: #43514c;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td strong {
  font-size: 21px;
}

.seed-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.weight-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.weight-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.weight-item span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.weight-item strong {
  font-size: 26px;
}

.meter {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7ebf0;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
}

.source-panel {
  margin-top: 24px;
  padding: 20px;
}

.source-grid,
.card-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.source-grid {
  margin-top: 14px;
}

.source-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.source-grid p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.45;
}

.source-grid span {
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 850;
}

.university-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  min-height: 100%;
}

.card-rank {
  width: 44px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green-dark);
  color: white;
  font-weight: 950;
}

.score-badge {
  display: inline-grid;
  justify-self: start;
  min-width: 98px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--green-dark);
}

.score-badge strong {
  font-size: 30px;
  line-height: 1;
}

.score-badge span {
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(212, 175, 55, 0.34);
  border-radius: 999px;
  background: #fff9e8;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 850;
}

.text-link {
  color: var(--green-dark);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.directory-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 36px rgba(13, 27, 42, 0.06);
}

.directory-panel h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
}

.directory-section {
  display: grid;
  gap: 9px;
}

.directory-section > strong {
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.directory-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.directory-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.directory-links a:hover {
  border-color: var(--gold);
  color: var(--navy);
  text-decoration: none;
}

.home-explore-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.home-explore-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 24px;
  min-height: 100%;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 36px rgba(13, 27, 42, 0.06);
}

.home-explore-card h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 30px;
}

.home-explore-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.home-explore-links {
  display: grid;
  gap: 8px;
}

.home-explore-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.home-explore-links a::after {
  content: ">";
  color: var(--gold-dark);
  font-weight: 900;
}

.home-explore-links a:hover {
  color: var(--gold-dark);
  text-decoration: none;
}

.home-explore-links a:last-child {
  border-bottom: 0;
}

.profile-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.strength-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.strength-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--surface, #fff);
}

.strength-score {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--green-dark, #1a7a4a);
  line-height: 1;
}

.strength-label {
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.strength-desc {
  color: var(--muted, #555);
  font-size: 0.875rem;
  margin-top: 6px;
  line-height: 1.45;
}

.panel {
  padding: 22px;
}

.panel h2 {
  margin-top: 8px;
  font-size: clamp(24px, 2.4vw, 34px);
}

.fact-list {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
}

.fact-list div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.fact-list div:last-child {
  border-bottom: 0;
}

dt {
  color: var(--muted);
  font-weight: 850;
}

dd {
  margin: 0;
  font-weight: 750;
}

.form-row {
  display: grid;
  gap: 7px;
  margin: 16px 0;
}

.form-row label {
  color: #3f4d48;
  font-size: 13px;
  font-weight: 850;
}

.form-row input,
.form-row select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--green);
  font-size: 14px;
  font-weight: 850;
}

.hidden {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.compact-cards .university-card {
  min-height: auto;
}

.breakdown-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.breakdown-list div {
  display: grid;
  gap: 8px;
}

.breakdown-list span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.breakdown-list strong {
  font-size: 22px;
}

.link-tile {
  display: grid;
  gap: 8px;
  padding: 18px;
  min-height: 112px;
}

.link-tile span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.link-tile strong {
  font-size: 19px;
  line-height: 1.25;
}

.cta-band {
  padding: 64px 0;
  background: var(--green-dark);
  color: white;
}

.cta-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(320px, 0.52fr);
  gap: 36px;
  align-items: start;
}

.cta-grid .eyebrow,
.cta-grid p {
  color: #c7e6d2;
}

.cta-grid h2 {
  max-width: 720px;
}

.cta-list {
  display: grid;
  gap: 10px;
}

.cta-band .button.secondary {
  color: white;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
}

.cta-band .button.primary {
  background: white;
  border-color: white;
  color: var(--green-dark);
}

.disclaimer {
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
  background: #ebe6dc;
}

.disclaimer p {
  margin: 0;
  font-size: 14px;
}

footer {
  border-top: 2px solid var(--line);
  background: var(--paper-2);
  font-size: 14px;
  color: var(--muted);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 56px;
  padding: 56px 0 48px;
  align-items: start;
}

.footer-tagline {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.footer-disclaimer {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  opacity: 0.7;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.footer-links strong {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 14px;
}

.footer-links a {
  display: block;
  padding: 3px 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 16px;
}

@media (max-width: 940px) {
  .nav-toggle {
    display: flex;
  }

  nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 9;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 16px;
    background: rgba(255, 255, 255, 0.99);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(13,27,42,0.08);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }

  nav a,
  .nav-menu summary {
    display: block;
    padding: 14px 4px;
    width: 100%;
    font-size: 16px;
    border-bottom: 1px solid var(--line);
  }

  .nav-menu summary {
    min-height: 0;
  }

  .nav-menu summary::after {
    float: right;
    margin: 5px 4px 0 0;
  }

  .nav-panel {
    position: static;
    width: 100%;
    max-height: none;
    overflow: visible;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 0 0 10px;
    padding: 14px;
    border-radius: 8px;
    box-shadow: none;
    transform: none;
  }

  .nav-panel-section a {
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 0;
  }

  nav > a:last-child {
    border-bottom: 0;
  }

  header.nav-open nav {
    display: flex;
  }

  .section-heading,
  .split,
  .profile-layout,
  .strength-grid,
  .directory-grid,
  .home-explore-grid,
  .footer-inner,
  .footer-links,
  .cta-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    gap: 32px;
    padding: 40px 0 32px;
  }

  .weight-grid,
  .source-grid,
  .card-grid,
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1160px);
  }

  .nav {
    min-height: 64px;
    gap: 12px;
  }

  nav {
    top: 64px;
    max-height: calc(100vh - 64px);
  }

  .brand-name {
    font-size: 17px;
  }

  .brand-tagline {
    display: none;
  }

  .mark {
    width: 38px;
    height: 38px;
  }

  .hero-band,
  .section {
    padding: 40px 0;
  }

  .hero-band {
    padding-top: 32px;
  }

  h1 {
    font-size: clamp(32px, 8vw, 44px);
    line-height: 1.05;
  }

  .lede {
    font-size: 17px;
  }

  .stat-strip,
  .weight-grid,
  .source-grid,
  .card-grid,
  .link-grid,
  .directory-grid,
  .home-explore-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions .button,
  .card-actions .button {
    width: 100%;
  }

  .nav-cta {
    display: none;
  }

  /* Ranking table: hide Location and Tuition columns on mobile, keep Rank + University + Score */
  .col-location,
  .col-tuition {
    display: none;
  }

  table {
    min-width: 0;
  }

  th,
  td {
    padding: 12px;
  }

  .table-wrap {
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .panel,
  .university-card {
    padding: 18px;
  }

  .fact-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .cta-band {
    padding: 48px 0;
  }
}
