/* Base / reset / typography */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-2);
  color: var(--navy);
}
h1 { font-size: var(--h1-size); }
h2 { font-size: var(--h2-size); }
h3 { font-size: var(--h3-size); font-weight: 700; }
p { margin: 0 0 var(--space-2); color: var(--muted); line-height: 1.65; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; }
button { font-family: inherit; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

/* Grid items default to min-width:auto, which lets a long unbreakable word
   push its column wider than its fair 1fr share and overflow the viewport
   on narrow screens. min-width:0 lets every grid item shrink to fit. */
.stats-strip > *, .card-grid > *, .icon-grid > *, .testimonial-grid > *,
.footer-grid > *, .faculty-grid > *, .affiliations-row > *, .gallery-grid > * {
  min-width: 0;
}

section {
  padding-top: var(--section-pad-mobile);
  padding-bottom: var(--section-pad-mobile);
}
@media (min-width: 768px) {
  section {
    padding-top: var(--section-pad-desktop);
    padding-bottom: var(--section-pad-desktop);
  }
}

.section-soft {
  background-color: var(--bg-soft);
  background-image: radial-gradient(rgba(29,26,85,0.07) 1px, transparent 1px);
  background-size: 22px 22px;
}
.section-navy {
  background-color: #1D1A55;
  background-image: var(--noise-overlay), var(--gradient-navy);
  background-blend-mode: overlay;
  color: var(--white);
}
.section-navy h1, .section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy p { color: rgba(255,255,255,0.78); }

.eyebrow {
  display: inline-block;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: rgba(248, 155, 47, 0.14);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-2);
}

.section-head {
  max-width: 680px;
  margin: 0 0 var(--space-5);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

/* Focus states */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

/* Scroll-reveal (applied via main.js to cards/sections); reduced-motion users
   see content immediately because the global transition-duration override above
   collapses these transitions to ~0. transition-delay is set per-element by
   main.js for a staggered effect across sibling cards. */
.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  filter: blur(6px);
  transition: opacity 0.7s cubic-bezier(0.2,0.8,0.2,1), transform 0.7s cubic-bezier(0.2,0.8,0.2,1), filter 0.7s ease;
}
.reveal.in-view { opacity: 1; transform: none; filter: blur(0); }

/* Split-word heading reveal (hero h1) — each word slides up out of a mask on load. */
.split-heading .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split-heading .word-in {
  display: inline-block;
  animation: word-up 0.8s cubic-bezier(0.2,0.8,0.2,1) both;
  animation-delay: calc(var(--i, 0) * 70ms + 200ms);
}
@keyframes word-up {
  from { opacity: 0; transform: translateY(100%) rotate(4deg); }
  to { opacity: 1; transform: none; }
}

/* Hero entrance — badge/sub-copy/actions/media fade up in sequence on load. */
.hero-enter { opacity: 0; transform: translateY(20px); animation: hero-up 0.8s cubic-bezier(0.2,0.8,0.2,1) forwards; animation-delay: var(--d, 0ms); }
@keyframes hero-up { to { opacity: 1; transform: none; } }

/* Infinite marquee strip */
.marquee {
  overflow: hidden;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, var(--black, #000) 6%, var(--black, #000) 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track { display: flex; width: max-content; gap: 36px; animation: marquee 26s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track.marquee-slow { animation-duration: 110s; }
.marquee-track span { white-space: nowrap; font-weight: 700; color: var(--navy); font-size: 0.95rem; letter-spacing: -0.01em; }
.marquee-track .marquee-dot { color: var(--accent); font-weight: 700; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Slow-drifting gradient mesh for dark sections — the noise layer (first
   background-position value) stays put, only the gradient layer (second
   value) pans, so the grain doesn't shimmer. */
.mesh-animated { background-size: 180px 180px, 220% 220%; animation: mesh-drift 22s ease-in-out infinite; }
@keyframes mesh-drift {
  0% { background-position: 0 0, 0% 0%; }
  50% { background-position: 0 0, 100% 60%; }
  100% { background-position: 0 0, 0% 0%; }
}
@media (prefers-reduced-motion: reduce) { .mesh-animated { animation: none; } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

.dev-flag {
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}
body.hide-dev-flags .dev-flag { display: none; }
