/* ==========================================================
   Adjoint Institute of Mathematics — design system
   ========================================================== */

:root {
  /* Light academic theme — warm paper, navy ink, logo blue */
  --ink: #F7F5EF;          /* page background (paper) */
  --ink-rgb: 247, 245, 239;
  --ink-2: #EFECE3;        /* recessed surfaces, inputs */
  --panel: #FFFFFF;        /* cards */
  --panel-2: #FBFAF6;
  --line: rgba(13, 27, 62, .10);
  --line-2: rgba(13, 27, 62, .20);
  --grid: rgba(31, 79, 194, .07);
  --blue: #2F6BE8;         /* buttons, strokes */
  --blue-2: #1F4FC2;       /* accent text */
  --navy: #0D2B8C;
  --chalk: #0D1B3E;        /* primary text (navy ink) */
  --soft: #2A3658;         /* secondary text */
  --muted: #56617E;
  --amber: #A86412;
  --board: #0F1F1B;
  --shadow: 0 1px 2px rgba(13, 27, 62, .04), 0 14px 34px -20px rgba(13, 27, 62, .22);

  --f-display: 'Fraunces', Georgia, serif;
  --f-body: 'Manrope', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
  --f-hand: 'Caveat', cursive;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --sec: clamp(56px, 7vw, 104px);
  --r: 18px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--chalk);
  font: 400 17px/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}
body::before { /* faint graph-paper */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 1;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
em { font-style: italic; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 3px; border-radius: 6px; }

main, .footer { position: relative; z-index: 1; }
/* see the fonts-wait script in <head>: content fades in once the web fonts are ready */
main, .footer { transition: opacity .35s ease; }
.fonts-wait main, .fonts-wait .nav, .fonts-wait .footer { opacity: 0; transition: none; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--sec) 0; position: relative; }
.section + .section { padding-top: calc(var(--sec) * .5); } /* avoid doubled gaps between stacked sections */

/* ---------- type ---------- */
h2 {
  font-family: var(--f-display);
  font-size: clamp(38px, 5.6vw, 76px);
  line-height: 1.02;
  letter-spacing: -.02em;
  font-variation-settings: "opsz" 144;
}
h2 em { color: var(--blue-2); }
.label {
  font: 500 12px/1 var(--f-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue-2);
  margin-bottom: 22px;
  display: inline-block;
}
.sec-head { margin-bottom: clamp(48px, 7vw, 88px); max-width: 820px; }
.sec-head--row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.sec-lead { margin-top: 26px; font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); max-width: 600px; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--blue);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px;
  border-radius: 999px;
  background: var(--bg);
  color: #fff;
  font: 600 15px/1 var(--f-body);
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .4s var(--ease), background .3s, border-color .3s, box-shadow .4s;
  box-shadow: 0 10px 30px -14px rgba(47, 107, 232, .55);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -14px rgba(47, 107, 232, .7); }
.btn:active { transform: translateY(0) scale(.98); }
.btn span { transition: transform .4s var(--ease); }
.btn:hover span { transform: translateX(4px); }
.btn--ghost { background: transparent; color: var(--chalk); border-color: var(--line-2); box-shadow: none; }
.btn--ghost:hover { background: rgba(31, 79, 194, .06); border-color: var(--blue-2); box-shadow: none; }
.btn--small { padding: 11px 18px; font-size: 14px; }

/* ---------- preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--ink);
  display: grid; place-content: center; justify-items: center; gap: 22px;
}
.preloader__mark { width: min(220px, 50vw); overflow: visible; }
/* the draw runs in CSS so it starts on first paint, not after the CDN scripts load */
.preloader__mark path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: plDraw 1s cubic-bezier(.65, 0, .35, 1) forwards; }
.pl-a { stroke: var(--blue); stroke-width: 3; }
.pl-int { stroke: var(--blue); stroke-width: 20; animation-duration: .9s !important; animation-delay: .25s !important; }
.pl-m { stroke: var(--chalk); stroke-width: 3; animation-delay: .1s !important; }
.preloader__text { font: 400 italic 18px var(--f-display); color: var(--muted); opacity: 0; animation: plFade .5s ease .6s forwards; }
.preloader { clip-path: inset(0 0 0 0); animation: plFailsafe 0s 5s forwards; }
@keyframes plDraw { to { stroke-dashoffset: 0; } }
@keyframes plFade { to { opacity: 1; } }
@keyframes plFailsafe { to { visibility: hidden; opacity: 0; } }
.reduced .preloader { display: none; }
@media (prefers-reduced-motion: reduce) { .preloader { display: none; } }
/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 18px var(--gutter);
  transition: background .4s, padding .4s, border-color .4s, transform .5s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(var(--ink-rgb), .82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-color: var(--line);
  padding-top: 12px; padding-bottom: 12px;
}
.nav.is-hidden { transform: translateY(-100%); }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand__mark { width: 62px; height: auto; overflow: visible; }
.lg-a { fill: var(--blue); }
.lg-int { fill: none; stroke: var(--blue); stroke-width: 20; stroke-linecap: round; }
.lg-m { fill: var(--chalk); }
.brand__name { font: 600 12.5px/1.25 var(--f-body); letter-spacing: .01em; color: var(--chalk); }
.nav__links { display: flex; gap: 28px; }
.nav__links a { font-size: 14.5px; color: var(--muted); position: relative; transition: color .3s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--blue-2);
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease);
}
.nav__links a:hover { color: var(--chalk); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 50%; background: transparent; cursor: pointer; position: relative; }
.nav__toggle span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--chalk); transition: transform .4s var(--ease), top .4s var(--ease); }
.nav__toggle span:first-child { top: 17px; }
.nav__toggle span:last-child { top: 25px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 45;
  background: var(--ink);
  background-image: radial-gradient(120% 60% at 100% 0%, rgba(47, 107, 232, .08), transparent 60%);
  display: flex; flex-direction: column;
  padding: 96px var(--gutter) max(24px, env(safe-area-inset-bottom));
  overflow-y: auto; overscroll-behavior: contain;
  counter-reset: menu;
  clip-path: circle(0% at calc(100% - 40px) 40px);
  transition: clip-path .7s var(--ease), visibility 0s linear .7s;
  visibility: hidden;
}
.menu.is-open { clip-path: circle(150% at calc(100% - 40px) 40px); visibility: visible; transition: clip-path .7s var(--ease), visibility 0s; }
.menu > * { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease), color .3s, background-color .3s; }
.menu.is-open > * { opacity: 1; transform: none; }
.menu.is-open > :nth-child(1) { transition-delay: .14s; }
.menu.is-open > :nth-child(2) { transition-delay: .19s; }
.menu.is-open > :nth-child(3) { transition-delay: .24s; }
.menu.is-open > :nth-child(4) { transition-delay: .29s; }
.menu.is-open > :nth-child(5) { transition-delay: .36s; }
.menu.is-open > :nth-child(6) { transition-delay: .42s; }
.menu > a:not(:last-child) {
  counter-increment: menu;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font: 400 clamp(26px, 7vw, 36px)/1.1 var(--f-display); letter-spacing: -.01em; color: var(--chalk);
}
.menu > a:not(:last-child)::before {
  content: counter(menu, decimal-leading-zero);
  font: 500 10.5px/1 var(--f-mono); letter-spacing: .08em; color: var(--muted); min-width: 18px;
}
.menu > a:not(:last-child)::after { /* arrow chip */
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230D1B3E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  content: ""; flex: none; margin-left: auto; width: 40px; height: 40px; border-radius: 50%;
  background: var(--panel) var(--arrow) center / 18px no-repeat;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(13, 27, 62, .05), 0 6px 14px -8px rgba(13, 27, 62, .25);
  transition: transform .35s var(--ease), background-color .3s, border-color .3s, box-shadow .3s;
}
.menu > a:hover, .menu > a[aria-current="page"] { color: var(--blue-2); }
.menu > a[aria-current="page"]::before { color: var(--blue-2); }
.menu > a[aria-current="page"]:not(:last-child)::after,
.menu > a:not(:last-child):hover::after,
.menu > a:not(:last-child):active::after {
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  background-color: var(--blue); border-color: var(--blue);
  box-shadow: 0 8px 18px -8px rgba(47, 107, 232, .65);
}
.menu > a:not(:last-child):hover::after { transform: translateX(3px); }
.menu > a:not(:last-child):active::after { transform: scale(.94); }

/* last link (Admissions) becomes the primary CTA */
.menu > a:last-child {
  margin-top: auto;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 18px 24px; border-radius: 999px;
  background: var(--blue); color: #fff;
  font: 600 16px/1 var(--f-body); letter-spacing: .01em;
  box-shadow: 0 12px 28px -14px rgba(47, 107, 232, .7);
}
.menu > a:last-child::after { content: "\2192"; }
.menu > a:last-child:hover { background: var(--blue-2); color: #fff; }
html.menu-open, html.menu-open body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .menu > * { transform: none; transition: none; } }

@media (max-width: 1060px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .nav .btn--small { display: none; }
}

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; align-items: center;
  padding: 140px 0 120px;
  position: relative;
  overflow: hidden;
}
.hero__img {
  position: absolute; right: -6%; top: 50%; translate: 0 -50%;
  width: min(62vw, 900px); aspect-ratio: 1;
  background: url(../assets/img/hero-math.jpg) center/cover no-repeat;
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, rgba(0,0,0,.6) 38%, transparent 68%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, rgba(0,0,0,.6) 38%, transparent 68%);
  opacity: .5; z-index: 0;
  filter: invert(1) hue-rotate(180deg) saturate(1.2); /* dark glow art -> ink lines on paper */
  mix-blend-mode: multiply;
}
.hero::after { /* vignette */
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 20% 50%, rgba(var(--ink-rgb), .92) 0%, rgba(var(--ink-rgb), .45) 45%, transparent 70%),
              linear-gradient(to bottom, transparent 70%, var(--ink));
}
.hero__eqs { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.feq {
  position: absolute; color: rgba(31, 79, 194, .55);
  font-size: clamp(14px, 1.3vw, 20px);
  white-space: nowrap;
  will-change: transform;
}
@media (max-width: 900px) { .feq:nth-child(n+4) { display: none; } .feq { opacity: .4; } }
.hero__inner { position: relative; z-index: 2; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px;
  font: 500 12.5px/1 var(--f-mono); letter-spacing: .04em; color: var(--muted);
  background: rgba(255, 255, 255, .7); backdrop-filter: blur(6px);
}
/* live indicator: solid dot + two staggered expanding rings */
.dot {
  position: relative; display: inline-block; flex: none; vertical-align: middle;
  width: 8px; height: 8px; border-radius: 50%;
  background: #17A673; box-shadow: 0 0 0 2px rgba(23, 166, 115, .18);
}
.dot::before, .dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: rgba(23, 166, 115, .55);
  animation: livePing 2s cubic-bezier(0, 0, .2, 1) infinite;
}
.dot::after { animation-delay: 1s; }
@keyframes livePing { 0% { transform: scale(1); opacity: .9; } 80%, 100% { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dot::before, .dot::after { animation: none; opacity: 0; } }
.hero__title {
  margin: 32px 0 28px;
  font-family: var(--f-display);
  font-size: clamp(50px, 9.4vw, 148px);
  line-height: .94;
  letter-spacing: -.035em;
  font-weight: 350;
  font-variation-settings: "opsz" 144;
}
.hero__title .line { display: block; }
.hero__title em {
  font-weight: 300;
  background: linear-gradient(100deg, var(--navy) 0%, var(--blue) 50%, var(--blue-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .08em;
}
.hero__sub { font-size: clamp(17px, 1.6vw, 21px); color: var(--muted); max-width: 560px; }
.hero__ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 40px; }
.hero__facts { display: flex; gap: clamp(28px, 5vw, 64px); margin: 64px 0 0; flex-wrap: wrap; }
.hero__facts div { border-left: 1px solid var(--line-2); padding-left: 18px; }
.hero__facts dt { font: 400 clamp(30px, 3.4vw, 44px)/1 var(--f-display); }
.hero__facts dd { margin: 8px 0 0; font: 500 12px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hero__scroll { position: absolute; bottom: 34px; left: 50%; translate: -50% 0; z-index: 2; width: 26px; height: 42px; border: 1px solid var(--line-2); border-radius: 20px; }
.hero__scroll span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--chalk); animation: scrolly 2s var(--ease) infinite; }
@keyframes scrolly { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }

/* ---------- spectrum / axis ---------- */
.axis { position: relative; }
.axis__rule { height: 1.5px; background: linear-gradient(90deg, var(--blue-2), var(--blue)); transform-origin: left; position: relative; }
.axis__rule::after { content: ""; position: absolute; right: -1px; top: -5px; width: 10px; height: 10px; border-top: 1.5px solid var(--blue); border-right: 1.5px solid var(--blue); transform: rotate(45deg); }
.axis__ticks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 16px; }
.axis__ticks li { position: relative; padding-top: 30px; }
.axis__ticks li::before { content: ""; position: absolute; top: -5.5px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); border: 1.5px solid var(--blue-2); }
.axis__x { font: 400 italic 16px var(--f-display); color: var(--blue-2); display: block; margin-bottom: 10px; }
.axis__ticks strong { display: block; font: 500 19px/1.2 var(--f-display); margin-bottom: 6px; }
.axis__ticks small { font-size: 13.5px; color: var(--muted); line-height: 1.45; display: block; }
@media (max-width: 900px) {
  .axis__rule { display: none; }
  .axis__ticks { grid-template-columns: 1fr; gap: 0; border-left: 1.5px solid var(--blue-2); }
  .axis__ticks li { padding: 0 0 30px 28px; }
  .axis__ticks li::before { top: 4px; left: -6px; }
}

/* ---------- philosophy ---------- */
.philosophy__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 7vw, 110px); align-items: start; }
.philosophy__aside { position: sticky; top: 120px; }
.thm { font-weight: 600; font-style: normal; color: var(--chalk); }
.philosophy__img {
  margin-top: 48px; aspect-ratio: 4 / 3; border-radius: var(--r);
  background: url(../assets/img/notebook.jpg) center/cover, linear-gradient(135deg, var(--panel-2), var(--ink-2));
  border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.philosophy__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(13, 27, 62, .25), transparent 60%); }
.proof__head { font: 400 italic 28px var(--f-display); color: var(--blue-2); margin-bottom: 18px; }
.proof__steps { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 30px 0; border-top: 1px solid var(--line); }
.step__n { font: 400 italic 20px var(--f-display); color: var(--blue-2); padding-top: 3px; }
.step h3 { font: 500 clamp(22px, 2.2vw, 28px)/1.2 var(--f-display); margin-bottom: 8px; }
.step p { color: var(--muted); }
.proof__end { margin-top: 20px; padding-top: 30px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font: 400 italic 26px var(--f-display); }
.qed { display: inline-block; color: var(--amber); font-style: normal; }
@media (max-width: 900px) {
  .philosophy__grid { grid-template-columns: 1fr; }
  .philosophy__aside { position: static; }
}

/* ---------- programmes ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; max-width: 620px; }
.chip {
  padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); cursor: pointer;
  font: 500 13px/1 var(--f-body);
  transition: background .3s, color .3s, border-color .3s;
}
.chip:hover { color: var(--chalk); border-color: var(--blue-2); }
.chip.is-active { background: var(--chalk); color: var(--ink); border-color: var(--chalk); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-auto-flow: dense; gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column;
  min-height: 380px; padding: 26px;
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel) 0%, var(--ink-2) 100%);
  border: 1px solid var(--line);
  overflow: hidden; isolation: isolate;
  transition: border-color .4s, transform .6s var(--ease);
}
.card::before { /* cursor glow */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(47, 107, 232, .10), transparent 45%);
}
.card:hover { border-color: rgba(47, 107, 232, .45); }
.card:hover::before { opacity: 1; }
.card.is-hidden { display: none; }
.card--feature { grid-column: span 2; }
@media (max-width: 680px) { .card--feature { grid-column: auto; } }
.card__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card__cat { font: 500 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--blue-2); }
.card__level { font: 500 11px/1 var(--f-mono); color: var(--muted); }
.card__vis { flex: 1; display: grid; place-items: center; min-height: 150px; margin: 14px 0; }
.card__vis svg { width: 100%; max-width: 240px; height: 140px; overflow: visible; }
.card--feature .card__vis svg { max-width: 420px; }
.card__tex { color: var(--muted); font-size: 15px; margin-bottom: 14px; min-height: 28px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.card__name { font: 400 26px/1.1 var(--f-display); letter-spacing: -.01em; }
.card__blurb { color: var(--muted); font-size: 14.5px; margin-top: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__more { margin-top: 18px; display: inline-flex; gap: 8px; align-items: center; font: 600 13.5px var(--f-body); color: var(--blue-2); }
.card__more span { transition: transform .4s var(--ease); }
.card:hover .card__more span { transform: translateX(5px); }
.card__link { position: absolute; inset: 0; z-index: 3; border-radius: var(--r); }

/* visual primitives (drawn with stroke-dash) */
.v { fill: none; stroke: var(--blue-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.v--soft { stroke: var(--line-2); stroke-width: 1; }
.v--amber { stroke: var(--amber); }
.v--fill { fill: var(--blue); stroke: none; }
.v--dot { fill: var(--chalk); stroke: none; }
.v-text { fill: var(--muted); font: 400 12px var(--f-mono); }
.v-text--big { fill: var(--chalk); font: 400 italic 22px var(--f-display); }
.draw { stroke-dasharray: var(--len, 1000); stroke-dashoffset: var(--len, 1000); transition: stroke-dashoffset 1.6s var(--ease); }
.is-drawn .draw { stroke-dashoffset: 0; }
.is-drawn .draw:nth-child(2) { transition-delay: .15s; }
.is-drawn .draw:nth-child(3) { transition-delay: .3s; }
.is-drawn .draw:nth-child(4) { transition-delay: .45s; }
.is-drawn .draw:nth-child(n+5) { transition-delay: .6s; }
.pop { opacity: 0; transform: scale(.4); transform-box: fill-box; transform-origin: center; transition: opacity .5s, transform .6s var(--ease); }
.is-drawn .pop { opacity: 1; transform: scale(1); transition-delay: calc(var(--i, 0) * 40ms + .2s); }

/* ---------- pathway ---------- */
.pathway__grid { display: grid; grid-template-columns: 380px 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field > span { font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 15px 16px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--ink-2); color: var(--chalk);
  font: 500 16px var(--f-body);
  transition: border-color .3s, box-shadow .3s;
  appearance: none; -webkit-appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2398A6CB' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47, 107, 232, .15); }
.pathway__result { margin-top: 10px; padding-top: 22px; border-top: 1px solid var(--line); min-height: 140px; }
.route { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.route a {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); transition: border-color .3s, transform .4s var(--ease);
}
.route a:hover { border-color: var(--blue-2); transform: translateX(4px); }
.route__n { font: 400 italic 18px var(--f-display); color: var(--amber); width: 22px; }
.route__name { font-weight: 600; }
.route__lvl { margin-left: auto; font: 500 11px var(--f-mono); color: var(--muted); text-align: right; }
.plane { margin: 0; padding: 18px; border-radius: var(--r); background: linear-gradient(180deg, var(--panel), var(--ink-2)); border: 1px solid var(--line); }
.plane svg { width: 100%; height: auto; display: block; overflow: visible; color: var(--blue-2); }
.plane__grid line { stroke: var(--line); stroke-width: 1; }
.plane__axes path { stroke: var(--blue-2); stroke-width: 1.5; fill: none; }
.plane__axis-label, .plane__xticks text { fill: var(--muted); font: 400 11px var(--f-mono); }
.plane__route { fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 6 6; }
.pt { cursor: pointer; }
.pt circle { fill: var(--ink); stroke: var(--blue-2); stroke-width: 1.5; transition: r .4s var(--ease), fill .3s, stroke .3s, opacity .3s; }
.pt text { fill: var(--muted); font: 500 11px var(--f-body); transition: fill .3s, opacity .3s; }
.pt:hover circle { fill: var(--blue); }
.pt:hover text { fill: var(--chalk); }
.plane.has-route .pt { opacity: .35; }
.plane.has-route .pt.is-on { opacity: 1; }
.pt.is-on circle { fill: var(--amber); stroke: var(--amber); r: 8; }
.pt.is-on text { fill: var(--chalk); font-weight: 700; }
.plane.has-route .pt--you { opacity: 1; }
.pt--you circle { fill: var(--chalk); stroke: var(--chalk); r: 7; }
.pt--you text { fill: var(--chalk); font-weight: 700; }
@media (max-width: 960px) { .pathway__grid { grid-template-columns: 1fr; } .plane { padding: 8px; } }

/* ---------- online ---------- */
.online__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 100px); align-items: center; }
.online__img {
  aspect-ratio: 4 / 5; border-radius: var(--r); border: 1px solid var(--line);
  background: url(../assets/img/online-class.jpg) center/cover, radial-gradient(circle at 30% 30%, var(--panel-2), var(--ink-2));
  position: relative;
}
.online__img::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 60px rgba(13, 27, 62, .18); }
.features { list-style: none; margin: 44px 0 0; padding: 0; display: grid; gap: 4px; }
.features li { display: grid; grid-template-columns: 56px 1fr; gap: 18px; padding: 20px 0; border-top: 1px solid var(--line); }
.features__i { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--blue-2); font-size: 15px; }
.features h3 { font: 600 17px/1.3 var(--f-body); margin-bottom: 4px; }
.features p { color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .online__grid { grid-template-columns: 1fr; } .online__img { aspect-ratio: 16 / 11; } }

/* ---------- founder / blackboard ---------- */
.founder__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.board {
  border-radius: 14px; padding: 14px;
  background: linear-gradient(135deg, #5A3D25, #3C2716);
  box-shadow: 0 40px 70px -34px rgba(13, 27, 62, .55);
}
.board__surface {
  border-radius: 6px; padding: clamp(24px, 4vw, 44px);
  min-height: 420px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.06), transparent 60%),
    url(../assets/img/blackboard.jpg) center/cover,
    var(--board);
  color: #F1F3EE;
  font-size: clamp(16px, 1.8vw, 22px);
  display: grid; align-content: center; gap: 14px;
  overflow: hidden;
}
.board__note { font: 600 clamp(22px, 2.4vw, 28px)/1 var(--f-hand); color: #E9E4C9; opacity: .9; }
.board__note--end { margin-top: 12px; color: #F6D98A; }
.board__line { clip-path: inset(0 100% 0 0); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.board__line .katex { text-shadow: 0 0 1px rgba(255,255,255,.5); }
.board__line--ans { color: #F6D98A; font-size: 1.15em; }
.no-anim .board__line, .reduced .board__line { clip-path: none; }
.founder__id { display: flex; gap: 22px; align-items: center; margin-bottom: 30px; }
.monogram {
  flex: none; width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(from 200deg, var(--blue), var(--navy), var(--blue-2), var(--blue));
  padding: 2px;
}
.monogram span { width: 100%; height: 100%; border-radius: 50%; background: var(--ink-2); display: grid; place-items: center; font: 400 italic 34px var(--f-display); }
.founder__name { font-size: clamp(32px, 3.8vw, 52px); }
.founder__role { margin-top: 10px; color: var(--muted); font-size: 14.5px; }
.founder__bio { color: var(--soft); font-size: 17.5px; margin-bottom: 18px; max-width: 560px; }
.founder__bio strong { color: var(--chalk); font-weight: 600; }
.founder__stats { display: flex; gap: 0; margin: 36px 0 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.founder__stats div { flex: 1; padding: 18px; border-right: 1px solid var(--line); }
.founder__stats div:last-child { border: 0; }
.founder__stats dt { font: 400 28px/1 var(--f-display); }
.founder__stats dd { margin: 8px 0 0; font: 500 11px/1.3 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 900px) { .founder__grid { grid-template-columns: 1fr; } .board__surface { min-height: 320px; } }

/* ---------- problem ---------- */
.problem__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.problem__card {
  padding: clamp(26px, 4vw, 44px); border-radius: 22px;
  background: linear-gradient(160deg, var(--panel-2), var(--ink-2));
  border: 1px solid var(--line-2);
  position: relative; overflow: hidden;
}
.problem__card::before {
  content: "?"; position: absolute; right: -10px; top: -60px;
  font: 300 italic 260px/1 var(--f-display); color: rgba(47, 107, 232, .07); pointer-events: none;
}
.problem__tag { font: 500 11.5px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin-bottom: 18px; }
.problem__q { font: 400 clamp(22px, 2.7vw, 32px)/1.5 KaTeX_Main, "Times New Roman", serif; margin-bottom: 28px; overflow-wrap: break-word; }
.problem__q .katex { font-size: 1em; }
.problem__form { display: flex; gap: 10px; }
.problem__form input {
  flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--ink); color: var(--chalk); font: 500 16px var(--f-mono);
}
.problem__form input:focus { outline: none; border-color: var(--blue); }
.problem__feedback { min-height: 28px; margin-top: 12px; font-size: 15px; }
.problem__feedback.is-right { color: #12805A; }
.problem__feedback.is-wrong { color: var(--amber); }
.problem__hints { margin-top: 10px; border-top: 1px solid var(--line); }
.problem__hints details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.problem__hints summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.problem__hints summary::after { content: "+"; font: 400 20px/1 var(--f-display); color: var(--blue-2); transition: transform .3s; }
.problem__hints details[open] summary::after { transform: rotate(45deg); }
.problem__hints details > *:not(summary) { margin-top: 12px; color: var(--muted); }
@media (max-width: 900px) { .problem__grid { grid-template-columns: 1fr; } }

/* ---------- graph lab ---------- */
[data-grapher] [hidden] { display: none !important; }
.graphlab__grid { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: clamp(20px, 3vw, 36px); align-items: stretch; }
.gl-panel {
  display: flex; flex-direction: column; gap: 18px;
  padding: clamp(20px, 2.6vw, 28px); border-radius: 22px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.gl-mode { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--ink-2); border: 1px solid var(--line); }
.gl-mode__btn {
  padding: 10px 12px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: 600 13.5px/1 var(--f-body); color: var(--muted);
  transition: background .3s var(--ease), color .3s, box-shadow .3s;
}
.gl-mode__btn:hover { color: var(--chalk); }
.gl-mode__btn.is-active { background: var(--panel); color: var(--chalk); box-shadow: 0 1px 2px rgba(13, 27, 62, .08), 0 6px 16px -10px rgba(13, 27, 62, .35); }

.gl-eqs { display: flex; flex-direction: column; gap: 10px; }
.gl-eq { display: grid; grid-template-columns: 6px 1fr 34px; align-items: center; gap: 0 10px; }
.gl-eq__swatch { align-self: stretch; border-radius: 3px; background: var(--c); }
.gl-eq__input {
  width: 100%; min-width: 0; padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--ink); color: var(--chalk);
  font: 500 16px/1.2 var(--f-mono);
  transition: border-color .25s, box-shadow .25s;
}
.gl-eq__input:focus { outline: none; border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.gl-eq.has-err .gl-eq__input { border-color: var(--amber); }
.gl-eq__del {
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; cursor: pointer;
  font: 400 22px/1 var(--f-body); color: var(--muted); transition: background .25s, color .25s;
}
.gl-eq__del:hover { background: var(--ink-2); color: var(--chalk); }
.gl-eq__err { grid-column: 2 / 4; font-size: 13px; color: var(--amber); }
.gl-eq__err:empty { display: none; }
.gl-eq__err:not(:empty) { margin-top: 6px; }

.gl-add {
  align-self: flex-start; margin-top: -6px; padding: 6px 2px; border: 0; background: none; cursor: pointer;
  font: 600 14px var(--f-body); color: var(--blue-2);
}
.gl-add:hover { color: var(--chalk); }

.gl-keys { display: flex; flex-wrap: wrap; gap: 6px; }
.gl-keys button {
  min-width: 42px; padding: 8px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--soft);
  font: 500 14px/1 var(--f-mono); transition: border-color .25s, color .25s, transform .2s var(--ease);
}
.gl-keys button:hover { border-color: var(--blue-2); color: var(--blue-2); }
.gl-keys button:active { transform: scale(.95); }
.gl-keys sup { font-size: 10px; }

.gl-param { display: grid; grid-template-columns: auto 1fr 34px; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--ink-2); }
.gl-param label { font: 500 14px var(--f-mono); color: var(--soft); white-space: nowrap; }
.gl-param output { display: inline-block; min-width: 3.6ch; color: var(--chalk); }
.gl-param__name { font: italic 500 17px var(--f-display); color: var(--blue-2); }
.gl-param input { width: 100%; accent-color: var(--blue); }
.gl-param__play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; cursor: pointer; font-size: 11px; }

.gl-presets__title { font: 500 11.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.gl-presets__list { display: flex; flex-wrap: wrap; gap: 6px; }
.gl-presets .chip { padding: 8px 13px; }

.gl-game { padding: 18px; border-radius: 16px; border: 1px dashed rgba(168, 100, 18, .45); background: rgba(168, 100, 18, .05); }
.gl-game__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gl-game__lvl { font: 500 11.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.gl-game__dots { display: flex; gap: 5px; margin: 0; padding: 0; list-style: none; }
.gl-game__dots li { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: background .3s, transform .3s var(--ease); }
.gl-game__dots li.is-now { background: var(--amber); transform: scale(1.25); }
.gl-game__dots li.is-done { background: #12805A; }
.gl-game__name { margin-top: 10px; font: 400 26px/1.15 var(--f-display); }
.gl-game__brief { margin-top: 6px; font-size: 14.5px; }
.gl-game__hint { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--panel); font-size: 14.5px; color: var(--soft); }
.gl-game__status { min-height: 0; font-weight: 600; transform-origin: left center; }
.gl-game__status:not(:empty) { margin-top: 12px; }
.gl-game__status.is-right { color: #12805A; }
.gl-game__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gl-game__actions .btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

.gl-stage {
  position: relative; margin: 0; min-height: 440px; border-radius: 22px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.gl-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.gl-stage canvas.is-dragging { cursor: grabbing; }
.gl-stage__tools { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 6px; }
.gl-stage__tools button {
  width: 38px; height: 38px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .92); color: var(--chalk);
  font: 500 18px/1 var(--f-body); box-shadow: 0 4px 12px -8px rgba(13, 27, 62, .4);
  transition: border-color .25s, color .25s;
}
.gl-stage__tools button:hover { border-color: var(--blue-2); color: var(--blue-2); }
.gl-stage__hint {
  position: absolute; left: 14px; bottom: 14px; pointer-events: none;
  padding: 7px 11px; border-radius: 999px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line);
  font: 500 12px var(--f-mono); color: var(--muted); white-space: pre;
}
@media (max-width: 960px) {
  .graphlab__grid { grid-template-columns: 1fr; }
  .gl-stage { order: -1; min-height: 0; aspect-ratio: 4 / 3.4; }
}
@media (max-width: 480px) { .gl-stage__hint { font-size: 11px; } }

/* ---------- voices ---------- */
.sample-note { max-width: 360px; font-size: 14px; color: var(--muted); }
.sample-note span { display: inline-block; margin-right: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(168, 100, 18, .10); color: var(--amber); font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; }
.voices__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.voice { margin: 0; padding: 30px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(255, 255, 255, .6); position: relative; display: flex; flex-direction: column; gap: 22px; }
.voice__badge { position: absolute; top: 18px; right: 18px; font: 500 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--amber); }
.voice__result { margin: 0; align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: rgba(168, 100, 18, .10); color: var(--amber); font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; }
.voice blockquote { margin: 0; flex: 1; font: 400 italic 18px/1.5 var(--f-display); color: var(--soft); }
.voice figcaption strong { display: block; }
.voice figcaption span { font-size: 13px; color: var(--muted); }
.voices__rating { max-width: 380px; font-size: 14px; color: var(--muted); }
.voices__score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 8px; }
.voices__score strong { font: 400 40px/1 var(--f-display); color: var(--chalk); }
.voices__stars { color: var(--amber); letter-spacing: .1em; }
.voices__src { margin: 0 0 10px; }
@media (max-width: 1100px) { .voices__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .voices__grid { grid-template-columns: 1fr; } }

/* ---------- contact ---------- */
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 100px); align-items: start; }
.contact__list { list-style: none; margin: 44px 0 0; padding: 0; }
.contact__list li { display: grid; grid-template-columns: 120px 1fr; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line); font-size: 18px; }
.contact__list .label { margin: 0; }
.contact__list a { transition: color .3s; }
.contact__list a:hover { color: var(--blue-2); }
.contact__addr { font-style: normal; line-height: 1.5; }
.contact__addr .link { display: inline-block; margin-top: 6px; font-size: 15px; }
.contact__form { padding: clamp(24px, 4vw, 40px); border-radius: 22px; background: var(--panel); border: 1px solid var(--line); }
.contact__form .btn { width: 100%; justify-content: center; margin-top: 6px; }
.contact__form .small { text-align: center; margin-top: 12px; }
@media (max-width: 900px) { .contact__grid { grid-template-columns: 1fr; } .contact__list li { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 72px 0 0; background: #F3F1EA; overflow: hidden; }
.footer__deco { position: absolute; pointer-events: none; color: rgba(13, 43, 140, .28); font-family: var(--f-display); font-size: 15px; fill: currentColor; }
.footer__deco--l { left: -10px; top: 40px; width: 210px; }
.footer__deco--r { right: 0; top: 20px; width: 300px; color: rgba(31, 79, 194, .22); }
.footer__grid { position: relative; display: grid; grid-template-columns: 1.25fr .95fr 1.2fr 1.35fr; }
.footer__grid > * { padding: 6px clamp(20px, 3vw, 44px) 20px; }
.footer__grid > * + * { border-left: 1px solid var(--line); }
.footer__brand { padding-left: 0; }
.footer__logo { width: 180px; height: auto; }
.footer__tag { margin-top: 22px; font: 500 italic clamp(22px, 2vw, 28px)/1.2 var(--f-display); color: var(--chalk); }
.footer__head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; font: 700 12px var(--f-body); letter-spacing: .24em; text-transform: uppercase; color: var(--navy); }
.footer__head::after { content: ""; width: 32px; height: 1px; background: currentColor; opacity: .6; }
.footer__nav { display: grid; gap: 16px; }
.footer__nav a { display: inline-flex; align-items: center; gap: 12px; width: max-content; font-size: 17px; color: var(--chalk); transition: color .25s; }
.footer__chev { color: var(--soft); transition: transform .25s var(--ease); }
.footer__nav a:hover { color: var(--blue-2); }
.footer__nav a:hover .footer__chev { transform: translateX(3px); color: var(--blue-2); }
.footer__ico { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(13, 27, 62, .05); transition: transform .3s var(--ease), box-shadow .3s; }
.footer__contact { display: grid; gap: 26px; }
.footer__item { display: flex; align-items: center; gap: 18px; color: var(--chalk); font-size: 17px; line-height: 1.35; }
.footer__item small { display: block; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.footer__item:hover { color: var(--blue-2); }
.footer__note { padding-left: 66px; font-size: 14px; color: var(--muted); }
.footer__social { display: grid; gap: 12px; align-content: start; }
.footer__social .footer__ico { width: 44px; height: 44px; }
.footer__social a { display: flex; align-items: center; gap: 18px; white-space: nowrap; font-size: 17px; color: var(--chalk); transition: color .25s; }
.footer__social a:hover { color: var(--blue-2); }
.footer__item:hover .footer__ico, .footer__social a:hover .footer__ico { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(13, 27, 62, .35); }
.footer__base { display: flex; align-items: center; gap: 0; margin-top: 44px; padding-top: 0; padding-bottom: 0; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--muted); }
.footer__base > * { padding: 22px 0; }
.footer__meta { flex: 1; display: flex; flex-wrap: wrap; gap: 6px 28px; padding-left: 28px; }
.footer__credit a { color: var(--blue-2); font-weight: 600; border-bottom: 1px solid transparent; transition: border-color .25s; }
.footer__credit a:hover { border-color: currentColor; }
.footer__egg { padding: 14px clamp(24px, 3.5vw, 48px); border-inline: 1px solid var(--line-2); font: 400 italic 24px var(--f-display); color: var(--chalk); white-space: nowrap; cursor: help; transition: color .3s; }
.footer__egg sup { font: italic .58em Georgia, "Times New Roman", serif; margin-left: 1px; }
.footer__egg:hover { color: var(--amber); }
.footer__top { flex: none; display: grid; place-items: center; width: 56px; height: 56px; margin: 12px 0 12px clamp(24px, 3vw, 40px); padding: 0; border-radius: 50%; background: #DCE5FB; color: var(--navy); transition: background .25s, color .25s, transform .25s var(--ease); }
.footer__top:hover { background: var(--blue); color: #fff; transform: translateY(-3px); }
@media (max-width: 1100px) {
  .footer__grid { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .footer__grid > :nth-child(3) { border-left: 0; padding-left: 0; }
  .footer__deco--r { opacity: .5; }
}
@media (max-width: 760px) {
  .footer { padding-top: 56px; }
  .footer__deco--l { display: none; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__grid > * { border-left: 0 !important; padding-left: 0; padding-right: 0; }
  .footer__base { flex-wrap: wrap; }
  .footer__meta { flex-basis: 100%; padding-left: 0; padding-bottom: 6px; }
  .footer__egg { flex: 1; border-inline: 0; padding-left: 0; font-size: 19px; }
  .footer__top { margin-left: 16px; }
}

/* ---------- program page ---------- */
.p-hero { padding: 170px 0 90px; position: relative; overflow: hidden; }
.p-hero__back { display: flex; width: fit-content; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 40px; }
.p-hero__back:hover { color: var(--chalk); }
.p-hero h1 { font-family: var(--f-display); font-size: clamp(44px, 7.5vw, 112px); line-height: .98; letter-spacing: -.03em; font-weight: 350; max-width: 14ch; }
.p-hero__meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.tag { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); font: 500 12px var(--f-mono); color: var(--muted); }
.p-hero__tex { margin-top: 50px; font-size: clamp(22px, 3vw, 38px); color: var(--blue-2); overflow-x: auto; overflow-y: hidden; }
.p-hero__vis { position: absolute; right: var(--gutter); top: 170px; width: min(40vw, 480px); opacity: .9; }
.p-hero__vis svg { width: 100%; height: auto; overflow: visible; }
@media (max-width: 900px) { .p-hero__vis { position: static; width: 100%; max-width: 420px; margin-top: 40px; } }
.p-body { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(40px, 7vw, 100px); }
.p-body h2 { font-size: clamp(30px, 3.4vw, 44px); margin-bottom: 24px; }
.p-lead { font: 400 clamp(22px, 2.4vw, 30px)/1.35 var(--f-display); color: var(--soft); margin-bottom: 50px; }
.p-focus { list-style: none; margin: 0; padding: 0; counter-reset: f; }
.p-focus li { counter-increment: f; display: grid; grid-template-columns: 50px 1fr; padding: 18px 0; border-top: 1px solid var(--line); font-size: 18px; }
.p-focus li::before { content: "(" counter(f, lower-roman) ")"; font: 400 italic 18px var(--f-display); color: var(--blue-2); }
.p-side { display: grid; gap: 16px; align-content: start; }
.p-box { padding: 28px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.p-box h3 { font: 500 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--blue-2); margin-bottom: 16px; }
.p-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.p-topics span { padding: 8px 12px; border-radius: 10px; background: var(--ink-2); border: 1px solid var(--line); font-size: 14px; }
.p-box .btn { width: 100%; justify-content: center; margin-top: 18px; }
@media (max-width: 900px) { .p-body { grid-template-columns: 1fr; } }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.related a { padding: 22px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); transition: border-color .3s, transform .4s var(--ease); }
.related a:hover { border-color: var(--blue-2); transform: translateY(-3px); }
.related small { display: block; font: 500 11px var(--f-mono); color: var(--blue-2); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; }
.related strong { font: 400 22px/1.2 var(--f-display); }

/* ---------- reveal helpers (JS adds) ---------- */
.js .reveal { opacity: 0; }
.no-anim .reveal, .reduced .reveal { opacity: 1 !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================
   Multi-page components
   ========================================================== */
.nav__links a[aria-current="page"] { color: var(--chalk); }
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.link { color: var(--blue-2); border-bottom: 1px solid rgba(31, 79, 194, .35); transition: border-color .3s, color .3s; }
.link:hover { color: var(--chalk); border-color: var(--chalk); }

/* page hero */
.page-hero { padding: clamp(112px, 11vw, 150px) 0 clamp(40px, 5vw, 64px); position: relative; overflow: hidden; }
.page-hero::before {
  content: ""; position: absolute; right: -10%; top: -20%; width: 60vw; height: 60vw; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(47, 107, 232, .10), transparent 60%);
}
.page-hero__title {
  font-family: var(--f-display); font-weight: 350; font-variation-settings: "opsz" 144;
  font-size: clamp(48px, 8vw, 120px); line-height: .96; letter-spacing: -.03em;
}
.page-hero__title em { color: var(--blue-2); font-weight: 300; }
.page-hero + .section { padding-top: clamp(24px, 4vw, 48px); }
.filters--page { max-width: none; margin-bottom: 36px; }

/* CTA band */
.cta-band .wrap { max-width: 1480px; }
.cta-band__inner {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.1fr); align-items: center;
  border-radius: 28px; border: 1px solid var(--line-2);
  background: linear-gradient(160deg, var(--panel-2), #F3F1EA);
}
.cta-band__copy { padding: clamp(32px, 5vw, 72px) clamp(24px, 3vw, 44px) clamp(32px, 5vw, 72px) clamp(28px, 5vw, 76px); }
.cta-band .label { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; font: 600 13px/1 var(--f-body); letter-spacing: .22em; }
.cta-band .label::before { content: ""; width: 36px; height: 1px; background: currentColor; }
.cta-band h2 { font-size: clamp(30px, 3.2vw, 50px); line-height: 1.12; letter-spacing: -.01em; }
.cta-band h2 em { color: var(--blue); }
.cta-band__btns { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 40px; }
.cta-band .btn { padding: 19px 30px; font-size: 16px; }
.cta-band .btn:not(.btn--ghost) { box-shadow: 0 16px 34px -14px rgba(47, 107, 232, .75); }
.cta-band .btn--ghost { gap: 12px; background: rgba(255, 255, 255, .5); }
.cta-band__viz { align-self: stretch; width: 100%; height: 100%; min-height: 320px; border-left: 1px solid var(--line); font-family: var(--f-display); }
.cta-viz__grid path { stroke: rgba(31, 79, 194, .12); stroke-width: 1; fill: none; }
.cta-viz__faint path { stroke: rgba(47, 107, 232, .18); stroke-width: 1.2; fill: none; }
.cta-viz__paths path { stroke: rgba(47, 107, 232, .7); stroke-width: 1.6; fill: none; stroke-dasharray: 100; stroke-dashoffset: 100; animation: ctaDraw 1.8s var(--ease) .2s forwards; animation-play-state: paused; }
.cta-viz__paths path:nth-child(2) { animation-delay: .35s; }
.cta-viz__paths path:nth-child(3) { animation-delay: .5s; }
.cta-viz__paths path:nth-child(4) { animation-delay: .65s; }
.cta-viz__paths .cta-viz__trunk { stroke: var(--blue); stroke-width: 2.4; animation-delay: 1.3s; }
.cta-viz__dots circle { fill: rgba(47, 107, 232, .4); }
.cta-viz__starts circle, .cta-viz__core { fill: var(--blue); }
.cta-viz__labels text, .cta-viz__end text { font-style: italic; font-size: 19px; fill: var(--chalk); }
.cta-viz__ring { fill: none; stroke: rgba(47, 107, 232, .35); stroke-width: 1; }
.cta-viz__ring--pulse { transform-box: fill-box; transform-origin: center; animation: ctaPulse 2.8s ease-out infinite; animation-play-state: paused; }
.cta-viz__formula text { font-style: italic; font-size: 20px; fill: rgba(13, 27, 62, .45); }
.cta-viz__axes path { stroke: rgba(13, 27, 62, .25); stroke-width: 1; fill: none; }
.cta-viz__axes text { font-style: italic; fill: rgba(13, 27, 62, .4); }
.cta-viz__axdot { fill: rgba(13, 27, 62, .35); }
.cta-band__viz.is-drawn .cta-viz__paths path, .cta-band__viz.is-drawn .cta-viz__ring--pulse { animation-play-state: running; }
@keyframes ctaDraw { to { stroke-dashoffset: 0; } }
@keyframes ctaPulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cta-viz__paths path { animation: none; stroke-dashoffset: 0; }
  .cta-viz__ring--pulse { animation: none; }
}
@media (max-width: 980px) {
  .cta-band__inner { grid-template-columns: 1fr; }
  .cta-band__viz { min-height: 0; height: auto; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .cta-band__btns .btn { width: 100%; justify-content: center; }
}

/* founder page */
.founder-hero { display: grid; grid-template-columns: auto 1fr; gap: clamp(28px, 5vw, 70px); align-items: center; }
.monogram--xl { width: clamp(150px, 20vw, 260px); height: clamp(150px, 20vw, 260px); padding: 3px; }
.monogram--xl span { font-size: clamp(54px, 7vw, 96px); }
.monogram--photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: var(--ink-2); }
.founder-portrait { margin: 0; width: clamp(220px, 28vw, 380px); aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; padding: 3px;
  background: conic-gradient(from 200deg, var(--blue), var(--navy), var(--blue-2), var(--blue)); box-shadow: var(--shadow); }
/* a blurred inline preview (--lqip) shows instantly; the real photo fades in over it once loaded */
.founder-portrait { position: relative; }
.founder-portrait::before { content: ""; position: absolute; inset: 3px; border-radius: 19px; background: var(--lqip, none) 50% 20% / cover no-repeat var(--ink-2); filter: blur(10px); clip-path: inset(0 round 19px); }
.founder-portrait img { position: relative; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; border-radius: 19px; display: block; opacity: 0; transition: opacity .5s ease; }
.founder-portrait img.is-loaded { opacity: 1; }
@media (max-width: 760px) { .founder-hero { grid-template-columns: 1fr; } .founder-portrait { width: min(100%, 340px); } }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1.5px solid var(--blue-2); }
.timeline__item { position: relative; padding: 36px 28px 0 0; }
.timeline__item::before { content: ""; position: absolute; top: -6.5px; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--ink); border: 2px solid var(--blue-2); }
.timeline__x { display: block; color: var(--blue-2); font-size: 18px; margin-bottom: 14px; }
.timeline h3 { font: 500 22px/1.2 var(--f-display); margin-bottom: 10px; }
.timeline p { color: var(--muted); font-size: 15.5px; }
@media (max-width: 900px) {
  .timeline { grid-template-columns: 1fr; border-top: 0; border-left: 1.5px solid var(--blue-2); }
  .timeline__item { padding: 0 0 36px 30px; }
  .timeline__item::before { top: 4px; left: -6.5px; }
}

.about-philosophy__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 7vw, 100px); align-items: start; }
.beliefs { list-style: none; margin: 0; padding: 0; }
.beliefs li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 26px 0; border-top: 1px solid var(--line); }
.beliefs__n { font: 400 italic 20px var(--f-display); color: var(--blue-2); }
.beliefs h3 { font: 500 22px/1.25 var(--f-display); margin-bottom: 6px; }
.beliefs p { color: var(--muted); }
@media (max-width: 900px) { .about-philosophy__grid { grid-template-columns: 1fr; } }

.impact__grid { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.impact__grid > div { padding: clamp(24px, 3vw, 40px); border-right: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), transparent); }
.impact__grid > div:last-child { border-right: 0; }
.impact__grid dt { font: 350 clamp(48px, 6vw, 84px)/1 var(--f-display); letter-spacing: -.03em; }
.impact__grid dd { margin: 14px 0 0; color: var(--muted); font-size: 14.5px; }
@media (max-width: 900px) {
  .impact__grid { grid-template-columns: 1fr 1fr; }
  .impact__grid > div:nth-child(2) { border-right: 0; }
  .impact__grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

.edu-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: center; }
.edu-card { padding: clamp(28px, 4vw, 44px); border-radius: 22px; background: var(--panel); border: 1px solid var(--line-2); position: relative; overflow: hidden; }
.edu-card::after { content: "\222B"; position: absolute; right: 24px; bottom: -40px; font: 300 italic 180px/1 var(--f-display); color: rgba(47, 107, 232, .08); }
.edu-card__deg { font: 500 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); margin-bottom: 14px; }
.edu-card h3 { font: 400 clamp(26px, 3vw, 36px)/1.15 var(--f-display); margin-bottom: 10px; }
.edu-grid--photo { grid-template-columns: 1.15fr .85fr; gap: clamp(40px, 6vw, 90px); }
.edu-grid--photo .edu-card { margin-top: 36px; }
.edu-photo { position: relative; margin: 0; justify-self: end; width: 100%; max-width: 420px; }
.edu-photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 22px; border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.edu-photo::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 1px solid rgba(47, 107, 232, .3); border-radius: 22px; z-index: -1; }
@media (max-width: 900px) { .edu-grid { grid-template-columns: 1fr; } .edu-photo { justify-self: start; max-width: 360px; } }

.big-quote { margin: 0 auto; max-width: 980px; text-align: center; }
.big-quote p { font: 300 italic clamp(36px, 6vw, 84px)/1.08 var(--f-display); letter-spacing: -.02em; }
.big-quote cite { display: block; margin-top: 26px; font: 500 13px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--blue-2); font-style: normal; }

/* Euclid quote panel (founder page) */
.euclid {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); align-items: center;
  padding: clamp(28px, 4.5vw, 64px); border: 1px solid var(--line); border-radius: calc(var(--r) + 6px);
  background: var(--panel); box-shadow: var(--shadow);
}
.euclid__fig { margin: 0; padding: clamp(16px, 2.5vw, 28px); border-radius: var(--r); background: var(--ink-2);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; }
.euclid__fig svg { display: block; width: 100%; height: auto; }
.euclid__fig .v-text--big { font-size: 24px; opacity: 0; transition: opacity .6s var(--ease) 1.4s; }
.euclid__fig .v--dot, .euclid__fig .v--fill { opacity: 0; transition: opacity .5s var(--ease) 1.2s; }
.euclid__fig.is-drawn .v-text--big, .euclid__fig.is-drawn .v--dot, .euclid__fig.is-drawn .v--fill { opacity: 1; }
.euclid__fig .v--amber { stroke-width: 2.4; }
.euclid__fig.is-drawn .draw:nth-child(4) { transition-delay: .9s; }
.euclid__fig figcaption { margin-top: 12px; text-align: center; font: 500 11px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.euclid .big-quote { margin: 18px 0 0; text-align: left; max-width: none; }
.euclid .big-quote p { font-size: clamp(34px, 4.4vw, 62px); }
.euclid .big-quote cite { margin-top: 18px; }
.euclid__story { margin-top: 26px; color: var(--soft); font-size: 17px; max-width: 520px; }
.euclid__steps { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--line); }
.euclid__steps li { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.euclid__steps li > span:first-child { color: var(--blue-2); }
@media (max-width: 860px) {
  .euclid { grid-template-columns: 1fr; }
  .euclid__fig { max-width: 420px; width: 100%; margin: 0 auto; }
}
@media (max-width: 480px) { .euclid__steps li { grid-template-columns: 1fr; gap: 4px; } }
.connect__inner { text-align: center; display: grid; justify-items: center; }
.connect .sec-lead { margin-left: auto; margin-right: auto; }
.connect .cta-band__btns { justify-content: center; margin-top: 34px; }

/* resources */
.archive { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; align-items: start; }
.problem__card--sm { padding: clamp(24px, 3vw, 34px); }
.problem__card--sm::before { font-size: 180px; top: -40px; }
.problem__card--sm .problem__q { font-size: clamp(19px, 1.9vw, 24px); margin-bottom: 20px; }
@media (max-width: 900px) { .archive { grid-template-columns: 1fr; } }

.guide { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: g; }
.guide li { counter-increment: g; padding: 28px; border-radius: var(--r); border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), var(--ink-2)); }
.guide li::before { content: "(" counter(g, lower-roman) ")"; display: block; font: 400 italic 20px var(--f-display); color: var(--blue-2); margin-bottom: 16px; }
.guide h3 { font: 500 21px/1.3 var(--f-display); }
.guide p { margin-top: 8px; color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .guide { grid-template-columns: 1fr; } }

/* admissions */
.steps3 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps3 li { padding: 30px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); position: relative; }
.steps3__n { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 18px; margin-bottom: 22px; }
.steps3 h3 { font: 500 22px/1.25 var(--f-display); margin-bottom: 8px; }
.steps3 p { color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .steps3 { grid-template-columns: 1fr; } }

.faq__grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(40px, 6vw, 90px); align-items: start; }
.faq__list details { border-top: 1px solid var(--line); padding: 22px 0; }
.faq__list details:last-child { border-bottom: 1px solid var(--line); }
.faq__list summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 20px; font: 500 clamp(18px, 1.8vw, 22px)/1.3 var(--f-display); }
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::after { content: "+"; color: var(--blue-2); font-size: 26px; line-height: 1; transition: transform .35s var(--ease); }
.faq__list details[open] summary::after { transform: rotate(45deg); }
.faq__list p { margin-top: 12px; color: var(--muted); max-width: 640px; }
@media (max-width: 900px) { .faq__grid { grid-template-columns: 1fr; } }

/* programme page intro */
.p-intro__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.p-intro__text p { font-size: clamp(17px, 1.5vw, 20px); color: var(--soft); margin-bottom: 18px; }
.p-quote { margin: 0; padding: clamp(28px, 4vw, 44px); border-left: 2px solid var(--amber); background: linear-gradient(90deg, rgba(168, 100, 18, .07), transparent); border-radius: 0 18px 18px 0; }
.p-quote p { font: 300 italic clamp(22px, 2.4vw, 32px)/1.3 var(--f-display); }
.p-quote cite { display: block; margin-top: 18px; font: 500 12px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--amber); font-style: normal; }
.p-tips .guide li { padding: 24px; }
.p-tips .guide h3 { font-size: 19px; }
@media (max-width: 900px) { .p-intro__grid { grid-template-columns: 1fr; } }

.sec-more { margin-top: 34px; font-weight: 600; font-size: 15px; }

/* light theme: lift surfaces off the paper */
.card, .p-box, .problem__card, .contact__form, .guide li, .steps3 li, .edu-card, .plane, .route a, .related a, .impact__grid, .cta-band__inner, .founder__stats { box-shadow: var(--shadow); }
.card { background: var(--panel); }

/* ==========================================================
   Custom dropdown
   ========================================================== */
.dd { position: relative; }
.dd__native { position: absolute !important; inset: 0; opacity: 0; pointer-events: none; }
.dd__btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--chalk); font: 500 16px var(--f-body); text-align: left; cursor: pointer;
  box-shadow: 0 1px 2px rgba(13, 27, 62, .04);
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.dd__btn:hover { border-color: rgba(47, 107, 232, .45); }
.dd__btn:focus-visible, .dd.is-open .dd__btn { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47, 107, 232, .14); }
.dd__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd__value.is-placeholder { color: var(--muted); font-weight: 400; }
.dd__chev { flex: none; color: var(--muted); transition: transform .35s var(--ease), color .25s; }
.dd.is-open .dd__chev { transform: rotate(180deg); color: var(--blue); }
.dd__list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 8px);
  margin: 0; padding: 6px; list-style: none;
  max-height: min(330px, 50vh); overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 28px 60px -24px rgba(13, 27, 62, .38), 0 2px 8px rgba(13, 27, 62, .06);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-6px) scale(.98); transform-origin: top center;
  transition: opacity .18s ease, transform .28s var(--ease), visibility 0s linear .28s;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.dd__list:focus { outline: none; }
.dd.is-open .dd__list {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity .18s ease, transform .28s var(--ease), visibility 0s;
}
.dd__opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 12px; border-radius: 9px; cursor: pointer;
  font-size: 15px; color: var(--soft); line-height: 1.35;
  transition: background .15s, color .15s;
}
.dd__opt + .dd__opt { margin-top: 2px; }
.dd__opt.is-active { background: rgba(47, 107, 232, .08); color: var(--chalk); }
.dd__opt[aria-selected="true"] { color: var(--blue-2); font-weight: 600; }
.dd__check { flex: none; color: var(--blue); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .3s var(--ease); }
.dd__opt[aria-selected="true"] .dd__check { opacity: 1; transform: none; }

/* ==========================================================
   Hero (two-column, light)
   ========================================================== */
.hero { padding: 130px 0 110px; }
.hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(36px, 5vw, 80px); align-items: center; }
.hero__title { font-size: clamp(48px, 6.8vw, 112px); margin: 28px 0 24px; }
.hero__sub { max-width: 520px; }
.hero__facts { margin-top: 52px; }

.hero__visual { position: relative; aspect-ratio: 1 / 1.02; max-width: 600px; justify-self: end; width: 100%; }
.hero__frame {
  position: absolute; inset: 6% 0 6% 8%; border-radius: 28px; overflow: hidden;
  background:
    url(../assets/img/hero-teacher.jpg) center/cover no-repeat,
    radial-gradient(circle at 70% 30%, rgba(47, 107, 232, .10), transparent 60%),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -40px rgba(13, 27, 62, .35), 0 2px 6px rgba(13, 27, 62, .05);
}
.hero__frame::after { /* fine grid over the artwork */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px; mix-blend-mode: multiply;
}
.hero__plot { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hero__plot .v { stroke-width: 1.8; }

.hcard {
  position: absolute; z-index: 2;
  padding: 14px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: 0 22px 44px -22px rgba(13, 27, 62, .35);
  will-change: transform;
}
.hcard__k { font: 500 10.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hcard--live { top: 0; left: 0; display: flex; align-items: center; gap: 12px; }
.hcard--live .hcard__k { display: inline-flex; align-items: center; gap: 9px; color: #128A5F; }
.hcard--live strong { display: block; font: 600 15px/1.2 var(--f-body); margin-top: 6px; }
.hcard__ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--blue); color: #fff; flex: none; }
.hcard--eq { left: -2%; bottom: 0; min-width: 230px; }
.hcard--eq .hcard__tex { margin-top: 10px; font-size: 19px; color: var(--chalk); }
.hcard--eq .hcard__ans { margin-top: 8px; font-size: 12.5px; color: var(--blue-2); font-weight: 600; }
.hcard--prog { right: -2%; top: 38%; max-width: 210px; }
.hcard__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hcard__chips span { padding: 5px 9px; border-radius: 999px; background: var(--ink-2); border: 1px solid var(--line); font: 600 11.5px/1 var(--f-body); color: var(--soft); }
.hcard__chips span:first-child { background: var(--blue); border-color: var(--blue); color: #fff; }

@media (max-width: 960px) {
  .hero { padding: 120px 0 90px; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { justify-self: center; max-width: 520px; margin-top: 10px; }
}
@media (max-width: 520px) {
  .hcard { padding: 11px 12px; }
  .hcard--prog { display: none; }
  .hcard--eq { min-width: 0; left: 0; }
  .hcard--eq .hcard__tex { font-size: 16px; }
}

/* floating equations around the hero */
.hero__eqs { z-index: 0; }
.feq { color: rgba(31, 79, 194, .42); font-size: clamp(14px, 1.25vw, 19px); }
@media (max-width: 960px) {
  .feq { opacity: .55; }
  .feq:nth-child(n+5) { display: none; }
}

.social-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.social-row a, .contact__social a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--panel); font: 600 13.5px var(--f-body); color: var(--soft);
  transition: border-color .25s, color .25s, transform .35s var(--ease);
}
.social-row a:hover, .contact__social a:hover { border-color: var(--blue); color: var(--blue-2); transform: translateY(-2px); }
.social-row svg, .contact__social svg { color: var(--blue); }
.contact__social { display: flex; flex-wrap: wrap; gap: 8px; }
.blogs__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.blog-card {
  display: flex; flex-direction: column; gap: 12px; padding: clamp(26px, 3.4vw, 38px); border-radius: 22px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: border-color .3s, transform .5s var(--ease);
}
.blog-card:hover { border-color: rgba(47, 107, 232, .45); transform: translateY(-4px); }
.blog-card__k { font: 500 11px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.blog-card h3 { font: 400 clamp(26px, 2.6vw, 34px)/1.15 var(--f-display); }
.blog-card p { color: var(--muted); }
.blog-card__go { margin-top: auto; padding-top: 10px; font-weight: 600; color: var(--blue-2); }
@media (max-width: 760px) { .blogs__grid { grid-template-columns: 1fr; } }

.hero__facts { gap: clamp(18px, 2.6vw, 44px); flex-wrap: nowrap; }
.hero__facts div { min-width: 0; }
@media (max-width: 480px) { .hero__facts { flex-wrap: wrap; } }

.field input, .field textarea { background: var(--panel); box-shadow: 0 1px 2px rgba(13, 27, 62, .04); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .8; }

/* hero v3: photographic still life, no grid over the image */
.hero__frame::after { content: none; }
.hero__frame { inset: 4% 0 4% 6%; border-radius: 24px; }
.hcard--live { top: 0; left: 0; }
.hcard--eq { left: -3%; bottom: 2%; }

/* stats band (moved out of the hero) */
.stats-band { position: relative; z-index: 1; padding: 0 0 clamp(40px, 6vw, 72px); }
.stats-band__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); margin: 0;
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.stats-band__grid > div { padding: 26px 24px 26px 0; }
.stats-band__grid > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.stats-band dt { font: 400 clamp(34px, 3.6vw, 50px)/1 var(--f-display); letter-spacing: -.02em; color: var(--chalk); }
.stats-band dt small { font-size: .42em; margin-left: 4px; color: var(--muted); letter-spacing: 0; }
.stats-band dd { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; max-width: 22ch; }
@media (max-width: 760px) {
  .stats-band__grid { grid-template-columns: 1fr 1fr; }
  .stats-band__grid > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats-band__grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* card placement tuned to the still life: objects sit centre-right and low */
.hcard--live { top: auto; left: -3%; bottom: 3%; }
.hcard--eq { left: auto; bottom: auto; right: -4%; top: 10%; }
@media (max-width: 520px) { .hcard--eq { right: 0; } .hcard--live { left: 0; } }

.hero { min-height: auto; padding: 128px 0 72px; }
@media (max-width: 960px) { .hero { padding: 112px 0 56px; } }

/* teacher photo: hand + graph sit centre/right, keep cards on blurred corners */
.hcard--eq { right: auto; bottom: auto; left: -3%; top: 8%; }
.hcard--live { left: auto; top: auto; right: -4%; bottom: 4%; }
@media (max-width: 520px) { .hcard--eq { left: 0; } .hcard--live { right: 0; } }
.hcard--eq { top: 1%; left: -5%; }


/* ---------- legal pages ---------- */
.page-hero--legal { padding-bottom: clamp(32px, 4vw, 48px); }
.legal__updated { margin-top: 22px; font: 500 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.legal { padding-top: 0; }
.legal__grid { display: grid; grid-template-columns: 240px minmax(0, 760px); gap: clamp(40px, 7vw, 110px); align-items: start; }
.legal__toc { position: sticky; top: 110px; }
.legal__toc-head { margin-bottom: 14px; font: 700 12px var(--f-body); letter-spacing: .24em; text-transform: uppercase; color: var(--navy); }
.legal__toc ol { margin: 0; padding: 0 0 0 16px; list-style: none; border-left: 1px solid var(--line-2); display: grid; gap: 10px; counter-reset: toc; }
.legal__toc li { counter-increment: toc; font-size: 15px; }
.legal__toc a { display: block; color: var(--muted); transition: color .25s; }
.legal__toc a::before { content: counter(toc, decimal-leading-zero) "  "; font: 500 11px var(--f-mono); color: var(--blue-2); white-space: pre; }
.legal__toc a:hover { color: var(--chalk); }
.legal__body section { padding: 34px 0; border-top: 1px solid var(--line); scroll-margin-top: 100px; }
.legal__body section:first-child { border-top: 0; padding-top: 0; }
.legal__body h2 { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; font: 400 clamp(24px, 2.4vw, 30px)/1.2 var(--f-display); color: var(--chalk); }
.legal__n { font: 500 12px var(--f-mono); color: var(--blue-2); }
.legal__body p, .legal__body li { color: var(--soft); font-size: 16.5px; line-height: 1.75; }
.legal__body p + p, .legal__body ul + p, .legal__body p + ul { margin-top: 14px; }
.legal__body ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.legal__body li::marker { color: var(--blue); }
.legal__body strong { color: var(--chalk); font-weight: 600; }
.footer__legal { display: flex; gap: 22px; }
.footer__legal a { transition: color .25s; }
.footer__legal a:hover { color: var(--blue-2); }
@media (max-width: 860px) {
  .legal__grid { grid-template-columns: 1fr; gap: 28px; }
  .legal__toc { position: static; }
}
