/* ==========================================================================
   Gradometer — design system
   Bright, friendly, student-facing. Colour is used to carry meaning, not
   just decoration: each country and each tool has a stable hue so the site
   feels navigable rather than noisy.
   ========================================================================== */

:root {
  /* brand */
  --indigo:   #4f46e5;
  --indigo-d: #4338ca;
  --violet:   #7c3aed;
  --pink:     #ec4899;
  --orange:   #f97316;
  --amber:    #f59e0b;
  --lime:     #84cc16;
  --emerald:  #10b981;
  --teal:     #14b8a6;
  --cyan:     #06b6d4;
  --sky:      #0ea5e9;
  --rose:     #f43f5e;

  /* neutrals
     The base is a warm tinted lavender-grey rather than #fff. A pure white
     page under a reading load feels clinical and glares; a few points of
     colour in the background lets the white cards read as raised surfaces
     instead of blending into the page. */
  --ink:      #14142b;
  --ink-2:    #3c3c5a;
  --muted:    #64648a;
  /* body copy that sits on a tinted card rather than on white */
  --ink-3:    #5a5a7d;
  --line:     #e4e2f4;
  --bg:       #f2f1fb;
  --card:     #ffffff;
  --soft:     #f0eefb;

  /* tinted section surfaces, used to band the page vertically */
  --band-violet: linear-gradient(180deg, #efe9ff 0%, #e2d9fc 100%);
  --band-cyan:   linear-gradient(180deg, #e2f6ff 0%, #cdedfa 100%);
  --band-warm:   linear-gradient(180deg, #ffefdf 0%, #ffdfc9 100%);
  --band-mint:   linear-gradient(180deg, #dbf9ea 0%, #c3f2dc 100%);
  --band-rose:   linear-gradient(180deg, #ffe4ee 0%, #ffd0e0 100%);

  --radius:   16px;
  --radius-s: 10px;
  --shadow:   0 1px 2px rgba(20,20,43,.04), 0 8px 24px rgba(20,20,43,.06);
  --shadow-l: 0 2px 4px rgba(20,20,43,.05), 0 16px 48px rgba(20,20,43,.10);
  --font: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Ambient colour field.
   Fixed to the viewport so it stays behind the content on scroll rather
   than running out after the first screen. Three low-opacity radials in
   the brand hues, plus a soft warm one at the foot so long article pages
   do not end on grey. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1000px 460px at 6% -6%,   rgba(124,58,237,.28), transparent 62%),
    radial-gradient(860px 420px at 96% -10%,  rgba(6,182,212,.27),  transparent 62%),
    radial-gradient(700px 360px at 46% -12%,  rgba(236,72,153,.19), transparent 62%),
    radial-gradient(900px 500px at 88% 108%,  rgba(249,115,22,.19), transparent 64%),
    radial-gradient(760px 440px at 4% 96%,    rgba(16,185,129,.19), transparent 64%);
  pointer-events: none;
  z-index: 0;
}

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  /* Dark navy bar. The pale wash it replaced left the blue wordmark and the
     nav sitting on almost the same lightness, so the header never read as a
     distinct band. Navy also gives the gauge mark something to sit against. */
  background: linear-gradient(100deg, #0f172a, #172554 45%, #0c2340);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: none;
}
.site-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: linear-gradient(90deg, #22d3ee, #38bdf8 40%, #818cf8 75%, #c084fc);
}
.header-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 20px;
  height: 66px; display: flex; align-items: center; gap: 22px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.16rem; letter-spacing: -.02em;
  text-decoration: none; flex-shrink: 0;
  /* background-clip:text on the anchor would clip the inline SVG mark too, so
     the gradient moved to .logo-word and the anchor just lays things out. */
  background: none; -webkit-text-fill-color: currentColor;
}
/* Blue gradient wordmark. Ends at sky-700 #0369a1, which measures 5.7:1 on the
   near-white header, well past the 3.0 floor that applies to large text. */
.logo-word {
  /* Light stops now, because the header is dark. #e0f2fe reads 14.8:1 and
     #7dd3fc 8.9:1 on the navy bar. */
  background: linear-gradient(100deg, #e0f2fe, #7dd3fc 55%, #38bdf8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #e0f2fe;
}
.logo-mark {
  width: 36px; height: 36px; border-radius: 11px;
  /* Ends at orange-700. The white 'G' on #f97316 measures 2.80:1; the
     darker stop holds the same warm sweep at 4.66:1. */
  background: linear-gradient(135deg, var(--violet), var(--pink) 55%, #c2410c);
  display: grid; place-items: center;
  color: #fff; -webkit-text-fill-color: #fff; font-size: 1.02rem; font-weight: 800;
  box-shadow: 0 4px 14px rgba(124,58,237,.4), inset 0 1px 0 rgba(255,255,255,.4);
}
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a {
  /* #cbd5e1 on the navy bar measures 11.4:1. */
  color: #cbd5e1; text-decoration: none; font-size: .93rem; font-weight: 600;
  padding: 8px 13px; border-radius: 9px; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a.active {
  /* On the navy bar a light fill carries the state better than a dark one.
     #0f172a text on #67e8f9 measures 13.1:1. */
  background: linear-gradient(100deg, #22d3ee, #67e8f9);
  color: #0f172a;
}

.menu-toggle {
  display: none; margin-left: auto;
  background: rgba(255,255,255,.14);
  border: 1.5px solid rgba(255,255,255,.28); border-radius: 9px;
  width: 40px; height: 38px; cursor: pointer; font-size: 1.1rem; color: #e0f2fe;
  box-shadow: none;
}

/* ---------- hero ---------- */

.hero { padding: 62px 0 40px; text-align: center; }
/* Second hero paragraph: smaller and quieter, so the first one stays the
   headline claim and this one reads as supporting detail. */
.hero p.lede.lede-sub {
  font-size: .99rem; color: var(--ink-3); margin-top: -14px; margin-bottom: 26px;
}
.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.15rem); line-height: 1.1;
  margin: 0 0 16px; letter-spacing: -.033em; font-weight: 800;
}
.grad {
  /* The word "real" in the hero. Ends at orange-700 rather than #f97316,
     which measures 2.52:1 on the hero wash against a 3.0 floor. */
  background: linear-gradient(100deg, var(--violet), var(--pink) 45%, #c2410c);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--violet);
}
.hero p.lede {
  font-size: 1.11rem; color: var(--ink-2); max-width: 660px;
  margin: 0 auto 28px;
}

/* ---------- search ---------- */

.search-shell { max-width: 620px; margin: 0 auto; position: relative; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 2px solid var(--line);
  border-radius: 14px; padding: 4px 6px 4px 16px;
  box-shadow: var(--shadow); transition: border-color .18s, box-shadow .18s;
}
.search-box:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(124,58,237,.13), var(--shadow-l);
}
.search-box input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 1rem; padding: 13px 0; font-family: var(--font); color: var(--ink); min-width: 0;
}
.search-icon { color: var(--muted); flex-shrink: 0; display: grid; place-items: center; }

.results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-l); overflow: hidden; text-align: left;
  max-height: 380px; overflow-y: auto; z-index: 60; display: none;
}
.results.open { display: block; }
.result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--soft);
  text-decoration: none; color: inherit;
}
.result-item:last-child { border-bottom: 0; }
.result-item:hover, .result-item.sel { background: rgba(124,58,237,.07); }
.result-flag { font-size: 1.35rem; flex-shrink: 0; }
.result-title { font-weight: 700; font-size: .95rem; }
.result-sub { font-size: .81rem; color: var(--muted); }
.result-tag {
  margin-left: auto; font-size: .69rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; padding: 4px 9px; border-radius: 999px;
  background: var(--soft); color: var(--ink-2); flex-shrink: 0;
}
.result-empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: .92rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 11px; font-weight: 700; font-size: .94rem;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  font-family: var(--font); transition: transform .13s, box-shadow .13s, background .13s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--indigo));
  color: #fff; box-shadow: 0 4px 14px rgba(124,58,237,.32);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(124,58,237,.42); }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); }
.btn-sm { padding: 7px 13px; font-size: .85rem; border-radius: 9px; }
.btn-block { width: 100%; }

/* ---------- cards & grids ---------- */

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
/* A card carrying an accent is washed in its own hue, evenly.
   An earlier version faded the tint to #fff by 58% of the card height, which
   meant the colour lived only behind the icon and the card still read as
   white everywhere the eye actually rests. A flat fill keeps the hue under
   the text too. 18% is the ceiling: past that, --muted body copy drops below
   the 4.5:1 contrast floor on the violet and rose accents. */
.tool-card {
  background: color-mix(in srgb, var(--accent, var(--violet)) 18%, #fff);
  border-color: color-mix(in srgb, var(--accent, var(--violet)) 34%, transparent);
}
.card-link {
  display: block; text-decoration: none; color: inherit;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.card-link:hover {
  transform: translateY(-4px);
  box-shadow:
    0 2px 4px rgba(20,20,43,.05),
    0 18px 40px color-mix(in srgb, var(--accent, var(--violet)) 26%, transparent);
  border-color: color-mix(in srgb, var(--accent, var(--violet)) 46%, transparent);
}

.tool-card { position: relative; overflow: hidden; }
.tool-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg,
    var(--accent, var(--violet)),
    color-mix(in srgb, var(--accent, var(--violet)) 55%, #fff));
}
/* Icon tile.
   A saturated gradient chip carrying a white line icon. The previous
   version was a 14%-tint square holding a platform emoji, which meant
   the artwork changed per operating system and the colour was too weak
   to register as part of the card. */
.tool-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; margin-bottom: 14px;
  color: #fff;
  background:
    linear-gradient(140deg,
      var(--accent, var(--violet)) 0%,
      color-mix(in srgb, var(--accent, var(--violet)) 62%, #fff) 100%);
  box-shadow:
    0 6px 16px color-mix(in srgb, var(--accent, var(--violet)) 34%, transparent),
    inset 0 1px 0 rgba(255,255,255,.42);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s;
}
.tool-icon svg { display: block; }
.card-link:hover .tool-icon {
  transform: translateY(-2px) scale(1.06) rotate(-3deg);
  box-shadow:
    0 10px 22px color-mix(in srgb, var(--accent, var(--violet)) 44%, transparent),
    inset 0 1px 0 rgba(255,255,255,.5);
}
.tool-card h3 { margin: 0 0 6px; font-size: 1.03rem; font-weight: 750; letter-spacing: -.01em; }
/* --ink-3 rather than --muted: the card sits on an 18% tint, not on white,
   so the lighter grey would fall under 4.5:1 against the violet accent. */
.tool-card p { margin: 0; font-size: .885rem; color: var(--ink-3); line-height: 1.55; }

/* University cards are tinted by country, not per institution, so a run of
   51 Pakistani entries reads as one block instead of 51 competing colours.
   12% is the ceiling here rather than the 18% used on tool cards: these
   cards carry a .meta line, and past ~14% that grey falls under 4.5:1 on
   the violet accent. */
.uni-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: color-mix(in srgb, var(--accent, var(--violet)) 12%, #fff);
  border-color: color-mix(in srgb, var(--accent, var(--violet)) 30%, transparent);
}
.uni-badge {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: .78rem;
  color: #fff;
  /* Both stops are darkened toward black so the white initials clear 4.5:1
     on every country accent, including the lighter amber and lime hues. */
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent, var(--violet)) 82%, #000),
    color-mix(in srgb, var(--accent, var(--violet)) 50%, #000));
  text-align: center; line-height: 1.1; padding: 3px;
}
.uni-card h3 { margin: 0 0 3px; font-size: .99rem; font-weight: 750; }
.uni-card .meta { font-size: .83rem; color: var(--ink-3); }

/* Pills use translucent fills tuned for a white card. On a tinted card the
   colour underneath bleeds through and the label loses contrast, worst case
   3.78:1. Inside tinted cards they get an opaque white fill and darker text,
   which is stable whatever hue sits behind them. */
.uni-card .pill,
.tool-card .pill,
.guide-card .pill {
  background: #fff;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}
.uni-card .pill-violet  { color: #5b21b6; }
.uni-card .pill-sky     { color: #075985; }
.uni-card .pill-emerald { color: #065f46; }
.uni-card .pill-amber   { color: #92400e; }
.uni-card .pill-rose    { color: #9f1239; }

.country-card { text-align: center; padding: 20px 14px; }
.country-flag { font-size: 2.2rem; display: block; margin-bottom: 8px; line-height: 1; }
.country-card h3 { margin: 0 0 3px; font-size: .97rem; font-weight: 750; }
.country-card .meta { font-size: .8rem; color: var(--muted); }

/* ---------- section headings ---------- */

.section { padding: 40px 0; }
.section-head { margin-bottom: 22px; }
.section-head h2 {
  font-size: 1.62rem; margin: 0 0 6px; letter-spacing: -.024em; font-weight: 780;
}
.section-head p { margin: 0; color: var(--muted); font-size: .97rem; }

.eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .09em; color: #5b21b6; margin-bottom: 8px;
}

/* ---------- calculator ---------- */

.calc-shell { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 22px; align-items: start; }
/* Grid children default to min-width:auto, which makes them size to min-content.
   A nested .grid-2 (minmax(280px,1fr)) then cannot collapse to one column and
   forces ~578px, overflowing small viewports. Allow children to shrink. */
.calc-shell > * { min-width: 0; }

.tabs {
  display: flex; gap: 5px; margin-bottom: 20px;
  border-bottom: 2px solid var(--line); overflow-x: auto; padding-bottom: 0;
}
.tab {
  padding: 10px 15px; font-weight: 700; font-size: .9rem; cursor: pointer;
  border: 0; background: transparent; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  font-family: var(--font); white-space: nowrap; transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--violet); border-bottom-color: var(--violet); }

.course-table { width: 100%; border-collapse: collapse; }
.course-table th {
  text-align: left; font-size: .71rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); padding: 0 9px 9px; white-space: nowrap;
}
.course-table td { padding: 4px 4px; vertical-align: middle; }
.course-table tr.row-anim { animation: slideIn .22s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

input[type="text"], input[type="number"], input[type="email"], input[type="url"],
input[type="search"], input[type="tel"], textarea, select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: var(--radius-s); font-size: .92rem; font-family: var(--font);
  background: var(--card); color: var(--ink); outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
select { cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7280' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px;
}
label.field-label {
  display: block; font-size: .74rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin-bottom: 6px;
}
.field { margin-bottom: 15px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid var(--line);
  background: var(--card); cursor: pointer; display: grid; place-items: center;
  color: var(--muted); font-size: 1rem; transition: all .15s; flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--rose); color: var(--rose); background: #fff5f6; }

/* result panel */
.result-panel {
  position: sticky; top: 86px;
  background: linear-gradient(160deg, #2a1f5e, #1b1740 58%, #14142b);
  border-radius: var(--radius); padding: 24px; color: #fff;
  box-shadow: 0 12px 40px rgba(26,20,64,.3); overflow: hidden;
}
.result-panel::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(236,72,153,.36), transparent 68%);
  pointer-events: none;
}
.result-label {
  font-size: .71rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.62); margin-bottom: 4px;
}
.result-value {
  font-size: 3.15rem; font-weight: 800; line-height: 1; letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, #fff, #c7d2fe 55%, #a5f3fc);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  color: #fff;
}
.result-scale { font-size: .93rem; color: rgba(255,255,255,.55); margin-top: 4px; }
.result-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px;
  padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14);
}
.result-stat .k {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
  color: rgba(255,255,255,.55); font-weight: 700;
}
.result-stat .v { font-size: 1.14rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.standing-pill {
  display: inline-block; margin-top: 14px; padding: 5px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 750;
}
.tone-great { background: rgba(16,185,129,.2);  color: #6ee7b7; }
.tone-good  { background: rgba(14,165,233,.2);  color: #7dd3fc; }
.tone-ok    { background: rgba(245,158,11,.2);  color: #fcd34d; }
.tone-warn  { background: rgba(249,115,22,.22); color: #fdba74; }
.tone-bad   { background: rgba(244,63,94,.22);  color: #fda4af; }

/* ---------- alerts ---------- */

.alert {
  padding: 14px 16px; border-radius: var(--radius-s); font-size: .9rem;
  border-left: 4px solid; margin: 16px 0; line-height: 1.55;
}
.alert-info    { background: #eff6ff; border-color: var(--sky);     color: #0c4a6e; }
.alert-success { background: #ecfdf5; border-color: var(--emerald); color: #065f46; }
.alert-warn    { background: #fffbeb; border-color: var(--amber);   color: #78350f; }
.alert-danger  { background: #fff1f2; border-color: var(--rose);    color: #881337; }
.alert strong { font-weight: 800; }

/* ---------- verification badge ---------- */

.verify {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46;
  padding: 7px 13px; border-radius: 999px; font-size: .8rem; font-weight: 650;
}
.verify.medium { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.verify.low    { background: #fff1f2; border-color: #fecdd3; color: #881337; }
.verify a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- data table ---------- */

.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table thead th {
  background: var(--soft); text-align: left; padding: 11px 14px;
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-2); border-bottom: 2px solid var(--line);
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--soft); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(124,58,237,.035); }

/* Grade-band row tinting — top grades read warm green, mid grades blue,
   low grades rose, at a glance instead of row after row of plain white. */
.data-table tr.grade-row-a { background: rgba(16,185,129,.08); }
.data-table tr.grade-row-b { background: rgba(14,165,233,.07); }
.data-table tr.grade-row-c { background: rgba(245,158,11,.08); }
.data-table tr.grade-row-f { background: rgba(244,63,94,.07); }
.data-table tr.grade-row-a:hover { background: rgba(16,185,129,.14); }
.data-table tr.grade-row-b:hover { background: rgba(14,165,233,.13); }
.data-table tr.grade-row-c:hover { background: rgba(245,158,11,.14); }
.data-table tr.grade-row-f:hover { background: rgba(244,63,94,.13); }
.grade-chip {
  display: inline-block; min-width: 42px; text-align: center;
  padding: 3px 10px; border-radius: 7px; font-weight: 800; font-size: .85rem;
  background: var(--soft); color: var(--ink);
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- breadcrumb ---------- */

/* --ink-3, not --muted: the ambient page wash is stronger than it was, and
   over the deepest part of it --muted measures about 4.0:1. */
.crumb { font-size: .84rem; color: var(--ink-3); padding: 18px 0 0; }
.crumb a { color: var(--ink-3); text-decoration: none; }
.crumb a:hover { color: var(--violet); text-decoration: underline; }
.crumb span { margin: 0 7px; opacity: .5; }

/* ---------- prose (articles) ---------- */

.prose { font-size: 1.015rem; line-height: 1.78; color: var(--ink-2); }
.prose h2 {
  font-size: 1.48rem; margin: 40px 0 14px; color: var(--ink);
  letter-spacing: -.022em; font-weight: 780; scroll-margin-top: 86px;
}
.prose h3 {
  font-size: 1.14rem; margin: 30px 0 10px; color: var(--ink); font-weight: 750;
  scroll-margin-top: 86px;
}
.prose p { margin: 0 0 17px; }
.prose ul, .prose ol { margin: 0 0 17px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose code {
  background: var(--soft); padding: 2px 6px; border-radius: 5px;
  font-family: var(--mono); font-size: .87em; color: var(--indigo-d);
}
.prose blockquote {
  margin: 22px 0; padding: 14px 20px; border-left: 4px solid var(--violet);
  background: var(--soft); border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-style: italic; color: var(--ink-2);
}
/* build.py wraps every .prose table in .table-scroll so wide comparison tables
   scroll horizontally on phones instead of widening the page. */
.table-scroll { overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch; }
.table-scroll table { margin: 0 !important; }
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .93rem; }
.prose th, .prose td { white-space: nowrap; }
.prose td:first-child, .prose th:first-child { white-space: normal; min-width: 130px; }
.prose th { background: var(--soft); text-align: left; padding: 10px 13px; font-weight: 750; border-bottom: 2px solid var(--line); }
.prose td { padding: 10px 13px; border-bottom: 1px solid var(--soft); }
.prose a { color: var(--indigo); text-decoration: underline; text-underline-offset: 2px; }

.toc {
  background: var(--soft); border-radius: var(--radius); padding: 20px 24px; margin: 26px 0;
  border: 1px solid var(--line);
}
.toc h4 {
  margin: 0 0 10px; font-size: .74rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); font-weight: 800;
}
.toc ol { margin: 0; padding-left: 19px; font-size: .93rem; }
.toc li { margin-bottom: 5px; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--violet); text-decoration: underline; }

/* ---------- pills / tags ---------- */

.pill {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; background: var(--soft); color: var(--ink-2);
}
.pill-violet  { background: rgba(124,58,237,.12); color: #6d28d9; }
.pill-emerald { background: rgba(16,185,129,.14); color: #047857; }
.pill-amber   { background: rgba(245,158,11,.16); color: #92400e; }
.pill-rose    { background: rgba(244,63,94,.13);  color: #be123c; }
.pill-sky     { background: rgba(14,165,233,.14); color: #075985; }
.pill-slate   { background: #eef1f6; color: #475569; }

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

/* ---------- scholarship ---------- */

.sch-card { border-left: 4px solid var(--accent, var(--violet)); }
.sch-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.sch-card h3 { margin: 0 0 4px; font-size: 1.09rem; font-weight: 760; }
.sch-provider { font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.sch-benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; margin: 14px 0; }
.sch-benefit { background: var(--soft); border-radius: var(--radius-s); padding: 9px 12px; }
.sch-benefit .k { font-size: .67rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
.sch-benefit .v { font-size: .84rem; font-weight: 650; color: var(--ink); }

.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.filter-bar .field { margin-bottom: 0; min-width: 150px; flex: 1; }

/* ---------- footer ---------- */

.site-footer {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #2a1f5e 0%, #1b1740 55%, #14142b 100%);
  margin-top: 60px; padding: 48px 0 28px;
  color: rgba(255,255,255,.82);
}
/* Soft glows echoing the ambient page background, so the footer reads as
   the same brand rather than a plain dark box bolted on the end. */
.site-footer::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(560px 320px at 8% 0%,   rgba(124,58,237,.38), transparent 65%),
    radial-gradient(520px 300px at 92% 15%, rgba(6,182,212,.30),  transparent 65%),
    radial-gradient(480px 280px at 50% 105%, rgba(236,72,153,.22), transparent 65%);
}
/* Gradient rule at the seam where the light page meets the dark footer. */
.site-footer::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--violet), var(--pink) 35%, var(--orange) 65%, var(--cyan));
}
.site-footer > .wrap { position: relative; z-index: 1; }
.site-footer .logo, .site-footer .logo-word { color: #fff; -webkit-text-fill-color: #fff; background: none; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 28px; margin-bottom: 28px; }
.footer-grid h4 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .07em;
  color: rgba(255,255,255,.5); margin: 0 0 12px; font-weight: 800;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 7px; }
.footer-grid a { color: rgba(255,255,255,.78); text-decoration: none; font-size: .89rem; transition: color .15s; }
.footer-grid a:hover { color: #a5f3fc; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.14); padding-top: 20px;
  font-size: .84rem; color: rgba(255,255,255,.55); text-align: center;
}
.footer-about { font-size: .89rem; color: rgba(255,255,255,.68); line-height: 1.65; }

/* ---------- misc ---------- */

.stat-row { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.stat { text-align: center; }
.stat .n {
  font-size: 1.72rem; font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  color: var(--violet);
}
.stat .l { font-size: .77rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

.divider { height: 1px; background: var(--line); margin: 30px 0; border: 0; }
/* The ambient page wash is deeper than it was, so the muted utility is
   nudged darker to stay clear of 4.5:1 over its strongest areas. */
.text-muted { color: var(--ink-3); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .8rem; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; } .mt-3 { margin-top: 30px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 10px; } .mb-2 { margin-bottom: 20px; } .mb-3 { margin-bottom: 30px; }
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; } .gap-1 { gap: 10px; } .gap-2 { gap: 20px; }
.hidden { display: none !important; }

/* ---------- responsive ---------- */

@media (max-width: 940px) {
  .calc-shell { grid-template-columns: 1fr; }
  /* Must stay positioned: the ::before glow is absolutely placed at right:-60px
     and is only clipped by this element's overflow:hidden while it remains the
     containing block. position:static would escape it to .wrap and overflow. */
  .result-panel { position: relative; top: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    /* Continues the dark header rather than reverting to a pale panel, which
       would leave the light nav links unreadable. */
    background: linear-gradient(160deg, #0f172a, #172554);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #22d3ee, #38bdf8 40%, #818cf8 75%, #c084fc) 1;
    flex-direction: column; align-items: stretch; padding: 10px; gap: 2px;
    box-shadow: var(--shadow-l);
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 14px; }
  .hero { padding: 40px 0 30px; }
  .result-value { font-size: 2.6rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .course-table thead { display: none; }
  .course-table, .course-table tbody, .course-table tr, .course-table td { display: block; width: 100%; }
  .course-table tr {
    margin-bottom: 12px; padding: 12px; border: 1px solid var(--line);
    border-radius: var(--radius-s); background: var(--soft);
  }
  .course-table td { padding: 5px 0; }
  .course-table td[data-label]::before {
    content: attr(data-label); display: block; font-size: .68rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px;
  }
  .course-table td.act { text-align: right; }
  .stat-row { gap: 18px; }
}

@media print {
  .site-header, .site-footer, .btn, .icon-btn, .tabs { display: none !important; }
  body::before { display: none; }
  .result-panel { background: #fff !important; color: #000 !important; border: 2px solid #000; }
  .result-value { -webkit-text-fill-color: #000; color: #000; }
}

/* University monogram + verification note */
.uni-source-media{margin-top:18px;display:flex;gap:16px;align-items:center;flex-wrap:wrap;}
.uni-monogram{display:inline-flex;align-items:center;justify-content:center;
  width:72px;height:72px;border-radius:18px;overflow:hidden;flex:0 0 auto;
  box-shadow:0 2px 10px rgba(15,23,42,.12);}
.uni-monogram svg{display:block;border-radius:18px;}
.verify-note{display:block;flex-basis:100%;margin-top:6px;font-size:.82rem;opacity:.85;}


/* ==========================================================================
   Section banding
   The page was one continuous white field, which made a long scroll feel
   flat and made it hard to tell one section from the next. These bands
   give each major block its own tinted surface. They sit full-bleed and
   carry a soft inner edge so the boundary reads as a change of surface
   rather than a hard line.
   ========================================================================== */

.band {
  position: relative;
  padding: 52px 0;
  margin: 0;
}
.band::before {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  background: var(--band-bg, transparent);
  border-top: 1px solid rgba(255,255,255,.75);
  border-bottom: 1px solid rgba(20,20,43,.045);
}
.band-violet { --band-bg: var(--band-violet); }
.band-cyan   { --band-bg: var(--band-cyan); }
.band-warm   { --band-bg: var(--band-warm); }
.band-mint   { --band-bg: var(--band-mint); }
.band-rose   { --band-bg: var(--band-rose); }

/* A band sitting directly on the page needs its content above the wash. */
.band > .wrap, .band > .wrap-narrow { position: relative; z-index: 1; }

/* Section heading with a coloured rule underneath the label. */
/* Inside a tinted band the surface darkens toward the gradient's base
   (#e2d9fc on band-violet), where --muted measures 4.38:1 against a 4.5 floor.
   --ink-3 holds the same quiet tone and clears it at 5.44:1. */
.band .section-head p { color: var(--ink-3); }

.band h2, .section-head h2 {
  position: relative;
  display: inline-block;
  margin-bottom: 6px;
}
.band h2::after, .section-head h2::after {
  content: '';
  position: absolute; left: 0; bottom: -7px;
  width: 46px; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
}
.band-warm h2::after { background: linear-gradient(90deg, var(--orange), var(--amber)); }
.band-mint h2::after { background: linear-gradient(90deg, var(--emerald), var(--lime)); }
.band-rose h2::after { background: linear-gradient(90deg, var(--pink), var(--rose)); }
.band-cyan h2::after { background: linear-gradient(90deg, var(--cyan), var(--sky)); }

.band .section-sub, .section-head .section-sub {
  margin-top: 18px; color: var(--ink-2);
}

/* ---------- stat strip ---------- */
/* The four counters on the home page were plain text on white. */
.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px; margin: 34px auto 0; max-width: 780px;
}
.stat-cell {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 14px; padding: 16px 12px; text-align: center;
  box-shadow: 0 4px 16px rgba(20,20,43,.06);
}
.stat-cell .n {
  font-size: 1.72rem; font-weight: 800; letter-spacing: -.03em; line-height: 1;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-cell .l {
  display: block; margin-top: 7px; font-size: .72rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}

/* ---------- guide cards ---------- */
.guide-card { position: relative; overflow: hidden; }
.guide-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg,
    var(--accent, var(--violet)),
    color-mix(in srgb, var(--accent, var(--violet)) 50%, #fff));
}
.guide-card {
  background: color-mix(in srgb, var(--accent, var(--violet)) 18%, #fff);
  border-color: color-mix(in srgb, var(--accent, var(--violet)) 34%, transparent);
}
.guide-icon {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center; margin-bottom: 13px; color: #fff;
  background: linear-gradient(140deg,
    var(--accent, var(--violet)) 0%,
    color-mix(in srgb, var(--accent, var(--violet)) 60%, #fff) 100%);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--accent, var(--violet)) 32%, transparent),
              inset 0 1px 0 rgba(255,255,255,.42);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.guide-icon svg { display: block; }
.card-link:hover .guide-icon { transform: translateY(-2px) scale(1.06) rotate(-3deg); }

/* Guide and tool card copy sits on an 18% accent tint. The .text-muted
   utility is tuned for white and loses contrast there, so override it
   inside tinted cards only. */
.guide-card .text-muted,
.tool-card .text-muted { color: var(--ink-3); }

.read-pill {
  display: inline-block; margin-top: 12px;
  font-size: .74rem; font-weight: 700; letter-spacing: .03em;
  padding: 5px 11px; border-radius: 999px;
  /* The pill now sits on a tinted card rather than on white. At 82% accent
     the label measured 2.75:1 against its own background, so the text is
     darkened to 55% accent and the fill lifted to solid white. */
  color: color-mix(in srgb, var(--accent, var(--violet)) 55%, #000);
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--accent, var(--violet)) 30%, transparent);
}

/* ---------- article reading surface ---------- */
/* Long guide bodies get a raised white sheet against the tinted page, which
   is what makes a wall of text feel like a page rather than a screen. */
.article-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 38px;
  box-shadow: 0 2px 6px rgba(20,20,43,.04), 0 20px 50px rgba(20,20,43,.07);
}
@media (max-width: 640px) {
  .article-sheet { padding: 24px 20px; border-radius: 16px; }
  .band { padding: 38px 0; }
}

/* Article header sits on a soft accent wash so the title block is visually
   attached to the guide's colour before the white reading sheet begins. */
.article-head { position: relative; }
.article-head::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent, var(--violet)) 13%, transparent) 0%,
    transparent 100%);
}
.article-sheet .toc {
  background: color-mix(in srgb, var(--violet) 5%, #fff);
  border: 1px solid var(--line);
}

/* Status dots on the scholarship filter cards. These replace coloured-circle
   emoji, which rendered at a different size and hue on every platform. */
.sdot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 8px; vertical-align: baseline;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot, var(--muted)) 20%, transparent);
  background: var(--dot, var(--muted));
}
.sdot-open     { --dot: #10b981; }
.sdot-upcoming { --dot: #f59e0b; }
.sdot-expected { --dot: #0ea5e9; }
.sdot-closed   { --dot: #9ca3af; }

/* A card that carries its own tint. Used for the scholarship browse blocks so
   the filter panels are distinguishable from the result grid below them. */
.card.tinted { border-color: rgba(255,255,255,.85); position: relative; overflow: hidden; }
/* Cards use a bolder, more saturated wash than page-wide bands — a whole
   section can stay pastel, but a compact card needs real colour to read as
   colour instead of off-white. A 5px top rule in the same hue reinforces it. */
.card.tinted.band-mint   { background: linear-gradient(160deg, #d6f7e6 0%, #eefcf4 55%, #fff 100%); }
.card.tinted.band-rose   { background: linear-gradient(160deg, #fdd9e6 0%, #fff0f5 55%, #fff 100%); }
.card.tinted.band-cyan   { background: linear-gradient(160deg, #cdf1fc 0%, #edfaff 55%, #fff 100%); }
.card.tinted.band-warm   { background: linear-gradient(160deg, #ffe2c7 0%, #fff5eb 55%, #fff 100%); }
.card.tinted.band-violet { background: linear-gradient(160deg, #e5daff 0%, #f5f1ff 55%, #fff 100%); }
.card.tinted::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 5px;
}
.card.tinted.band-mint::before   { background: linear-gradient(90deg, var(--emerald), var(--lime)); }
.card.tinted.band-rose::before   { background: linear-gradient(90deg, var(--pink), var(--rose)); }
.card.tinted.band-cyan::before   { background: linear-gradient(90deg, var(--cyan), var(--sky)); }
.card.tinted.band-warm::before   { background: linear-gradient(90deg, var(--orange), var(--amber)); }
.card.tinted.band-violet::before { background: linear-gradient(90deg, var(--violet), var(--indigo)); }
/* Inner cards need to lift off the tint. */
.card.tinted .card { background: rgba(255,255,255,.88); backdrop-filter: blur(6px); }
.card.tinted h2::after { display: none; }

/* Sticky sidebar CTA card — tinted to the page's accent (usually the
   country hue) with a coloured top rule, so the "tools for this page"
   panel reads as the highlight of the page, not another white box. */
.card-cta {
  background: color-mix(in srgb, var(--accent, var(--violet)) 9%, #fff);
  border-color: color-mix(in srgb, var(--accent, var(--violet)) 28%, transparent);
  position: relative; overflow: hidden;
}
.card-cta::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--accent, var(--violet)),
    color-mix(in srgb, var(--accent, var(--violet)) 40%, #fff));
}
.card-cta h3 { color: color-mix(in srgb, var(--accent, var(--violet)) 70%, var(--ink)); }

/* Lightweight accent tint for a plain content card — form panels, article
   wrappers — that shouldn't take on the link-card hover/glow treatment. */
.card-accent {
  background: color-mix(in srgb, var(--accent, var(--violet)) 7%, #fff);
  border-color: color-mix(in srgb, var(--accent, var(--violet)) 24%, transparent);
}

/* Filter cards put a <strong> label immediately before a <span> description
   with no separator, so the two ran together as "OpenApply now." Making the
   label a block gives the description its own line. */
.card-link > strong { display: block; margin-bottom: 4px; }
.card-link > strong + .text-sm { display: block; }

/* ---------- Gradometer gauge mark ---------- */

.gm-mark { display: block; flex-shrink: 0; }

/* view-box keeps transform-origin in SVG user units. Without it the origin is
   taken from the needle's own bounding box and the needle swings off the dial. */
.gm-mark .gm-needle {
  transform-box: view-box;
  transform-origin: 32.0px 40.0px;
  transform: rotate(63deg);   /* resting reading: 3.4 of 4.0 */
}

/* Sweep the dial once on load, then damp down onto the reading, the way a real
   moving-coil instrument settles. */
@keyframes gm-sweep {
  0%   { transform: rotate(-90deg); }
  34%  { transform: rotate(90deg); }
  55%  { transform: rotate(27deg); }
  72%  { transform: rotate(79deg); }
  86%  { transform: rotate(54deg); }
  100% { transform: rotate(63deg); }
}

.gm-mark .gm-anim {
  animation: gm-sweep 2.4s cubic-bezier(.33,.75,.36,1) .12s 1 both;
}

/* A small live nudge on hover, so the mark reacts without looping forever. */
.logo:hover .gm-mark .gm-needle {
  transform: rotate(86deg);
  transition: transform .55s cubic-bezier(.34,1.35,.5,1);
}

@media (prefers-reduced-motion: reduce) {
  .gm-mark .gm-anim { animation: none; transform: rotate(63deg); }
  .logo:hover .gm-mark .gm-needle { transition: none; transform: rotate(63deg); }
}

/* The shared control rule above assumes a one-line input; a textarea needs
   room to grow and a readable line height. */
textarea {
  min-height: 130px; resize: vertical; line-height: 1.6;
  font-family: inherit;
}

/* ---------- category browse chips ---------- */

.chip-row { display: flex; flex-wrap: wrap; gap: 9px; }
.browse-chip {
  display: inline-block; padding: 9px 15px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line);
  color: var(--ink-3); font-size: .88rem; font-weight: 650;
  text-decoration: none; transition: border-color .15s, color .15s, transform .15s;
}
.browse-chip:hover {
  border-color: #0284c7; color: #0369a1; transform: translateY(-1px);
}
