/* ═══════════════════════════════════════════════════════════════
   MPS RESPONSIVE — Mobile-First Breakpoints
   ═══════════════════════════════════════════════════════════════ */

/* ──────────────────── TABLET (≤1024px) ──────────────────── */
@media (max-width: 1024px) {
  :root { --nav-h: 72px; }

  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 90vw);
    background: rgba(12, 20, 44, 0.98);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-left: 1px solid rgba(255,255,255,0.08);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: var(--space-16) var(--space-8);
    gap: var(--space-2);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--dur-slow) var(--ease-smooth);
    z-index: var(--z-modal);
    list-style: none;
    box-shadow: -24px 0 60px rgba(0,0,0,0.5);
  }

  .nav-menu.is-open {
    transform: translateX(0);
  }

  .nav-link {
    font-size: var(--text-xl);
    font-family: var(--font-display);
    font-weight: 500;
    padding: var(--space-3) 0;
    width: 100%;
  }

  .nav-link::after { display: none; }

  .nav-toggle { display: flex; z-index: calc(var(--z-modal) + 1); }

  /* Legacy header CTA (careers/privacy/terms) sits outside #navMenu and has
     no drawer treatment of its own; hide it on mobile so it doesn't push
     .nav-toggle off-screen. */
  .nav-actions { display: none; }

  .has-dropdown { width: 100%; }

  .nav-dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background: none;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: var(--space-2) 0 var(--space-2) var(--space-5);
    display: none;
    pointer-events: auto;
    min-width: unset;
    border-radius: 0;
  }

  /* Mobile dropdown: controlled via aria-expanded */
  .has-dropdown .dropdown-trigger[aria-expanded="true"] + .nav-dropdown { display: block; }

  .dropdown-trigger { width: 100%; justify-content: space-between; cursor: pointer; }

  .dropdown-item {
    font-size: var(--text-lg);
    font-family: var(--font-display);
    padding: var(--space-2) 0;
    background: none;
  }

  .nav-cta { margin-top: var(--space-4); }

  /* Overlay behind mobile nav */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-slow), visibility var(--dur-slow);
    backdrop-filter: blur(2px);
  }

  .nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
  }

  /* Two-column → single column */
  .two-col-layout {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .two-col-layout--rev { direction: ltr; }

  /* Why grid → 2 cols */
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Facilities */
  .fac-card { flex: 0 0 calc(50% - var(--space-3)); }

  /* Gallery.
     The template named four areas for five tiles, so the third small tile had
     nowhere to go and was auto-placed into an implicit row AFTER the wide one
     — at 1024px the Arts & Culture picture ended up orphaned below Annual Day,
     out of order and half width. Naming a row for it puts every tile where the
     markup says it should be. */
  .gallery-masonry {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "t sm1"
      "t sm2"
      "sm3 sm3"
      "ww ww";
  }
  /* Full width at this breakpoint, so it takes the wide tile's 16:9 frame
     rather than a 4:3 one, which here would be almost square. */
  .gal-item.gal-sm3 .gal-slot::before { padding-top: 56.25%; }

  /* Achievements */
  .ach-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

  /* Student life */
  .sl-mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "lg lg"
      "sm1 tall"
      "sm2 tall";
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
  }

  .footer-brand { grid-column: 1 / -1; }
}

/* ──────────────────── MOBILE (≤768px) ──────────────────── */
@media (max-width: 768px) {
  :root {
    --nav-h: 68px;
  }

  .container { padding: 0 var(--space-5); }

  /* Hero */
  .hero-h1 {
    font-size: clamp(var(--text-3xl), 8vw, var(--text-5xl));
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-stats {
    gap: var(--space-4);
  }

  .h-stat-div { height: 28px; }

  /* Why grid → 1 col */
  .why-grid { grid-template-columns: 1fr; }

  /* News */
  .news-grid { grid-template-columns: 1fr; }

  /* Events */
  .event-item { grid-template-columns: 72px 1fr; gap: var(--space-5); }
  .ev-date { width: 64px; height: 64px; }
  .ev-d { font-size: var(--text-2xl); }

  /* Testimonials */
  .tst-card { flex: 0 0 100%; padding: var(--space-6) var(--space-6); }
  .tst-text { font-size: var(--text-lg); }

  /* Gallery — same missing-fifth-area problem as the 1024 template above. */
  .gallery-masonry {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "t t"
      "sm1 sm2"
      "sm3 sm3"
      "ww ww";
  }
  /* The tall tile spans the full width here, where a 2:3 frame is over a
     thousand pixels of one photograph before anything else is on screen. */
  .gal-item.gal-tall .gal-slot::before { padding-top: 66.66%; }

  /* Achievements */
  .ach-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-4); }

  /* Student Life */
  .sl-mosaic {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "lg lg"
      "sm1 sm2"
      "tall clubs";
  }

  /* Facilities */
  .fac-card { flex: 0 0 calc(80vw); }

  /* Admissions CTA */
  .adm-card {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .adm-deco { display: none; }

  /* Principal */
  .float-badge {
    bottom: -1rem;
    right: -0.5rem;
    padding: var(--space-3) var(--space-4);
  }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom-inner { flex-direction: column; text-align: center; gap: var(--space-2); }

  /* Section header row */
  .section-hd-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ──────────────────── SMALL MOBILE (≤480px) ──────────────────── */
@media (max-width: 480px) {
  .hero-actions .btn { width: 100%; justify-content: center; }

  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  .h-stat-div { display: none; }

  .why-card { padding: var(--space-6); }

  .ach-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

  .gallery-masonry {
    grid-template-columns: 1fr;
    /* Five tiles, so name a row for each. The old template listed four
       ("t" "sm1" "sm2" "ww") and the fifth tile had to be auto-placed. */
    grid-template-areas:
      "t"
      "sm1"
      "sm2"
      "sm3"
      "ww";
  }
  /* Every tile is full width here, so the tall and wide frames would be a very
     long portrait and a very short letterbox one after another. Level them to
     the same 4:3 as their neighbours so the column reads evenly. */
  .gal-item.gal-tall .gal-slot::before,
  .gal-item.gal-wide .gal-slot::before,
  .gal-item.gal-sm3 .gal-slot::before { padding-top: 75%; }

  .sl-mosaic {
    grid-template-columns: 1fr;
    grid-template-areas:
      "lg"
      "sm1"
      "sm2"
      "tall"
      "clubs";
  }

  .tst-text { font-size: var(--text-base); }

  .adm-btns { flex-direction: column; }
  .adm-btns .btn { width: 100%; justify-content: center; }

  .tour-content { padding: var(--space-12) var(--space-5); }

  .btn-lg { padding: 0.95rem 1.75rem; }
}

/* ──────────────────── WIDE / 4K (≥1440px) ──────────────────── */
@media (min-width: 1440px) {
  :root {
    --container-max: 1360px;
  }

  .hero-h1 {
    font-size: min(7rem, 8vw);
  }

  .why-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ──────────────────── LANDSCAPE MOBILE ──────────────────── */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: 100svh;
  }

  .hero-h1 { font-size: var(--text-4xl); }

  .hero-content {
    padding-bottom: var(--space-8);
    padding-top: calc(var(--nav-h) + var(--space-6));
  }
}

/* ════════════════════════════════════════════════════════════
   SHARED LAYOUT HARDENING
   One place for cross-page spacing/overflow fixes, so the 13 public
   pages stay consistent instead of drifting with per-page patches.
   ════════════════════════════════════════════════════════════ */

/* 1. No page may ever scroll sideways. Grid/flex children default to
      min-width:auto, which is the usual cause of mobile overflow — long
      words, wide media and tables push the row wider than the viewport. */
html, body { max-width: 100%; overflow-x: hidden; }

.footer-grid > *,
.two-col-layout > *,
.why-grid > *,
.news-grid > *,
.events-list > *,
.section-hd-row > * { min-width: 0; }

/* Wide content scrolls inside its own box rather than widening the page. */
.table-scroll, .tst-carousel { max-width: 100%; overflow-x: auto; }

/* The facilities rail is driven smoothly by JS transform and touch/prev/next controls,
   so overflow is strictly clipped on .fac-scroller with zero native scrollbar leakage. */
.fac-scroller {
  max-width: 100%;
  overflow: hidden;
  position: relative;
}
.tst-carousel {
  scrollbar-width: none;            /* Firefox */
  -ms-overflow-style: none;         /* legacy Edge */
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}
.tst-carousel::-webkit-scrollbar { width: 0; height: 0; display: none; }

img, video, iframe, svg { max-width: 100%; }

/* 2. Long emails / URLs must wrap instead of forcing a wider column. */
.f-address, .f-links a, .f-link, .dept-card, .news-excerpt { overflow-wrap: anywhere; }

/* 3. Uniform footer rhythm on every page. contact.html and news.html ship a
      condensed footer; without this their spacing differs from the rest. */
.site-footer .footer-top    { padding-block: clamp(3rem, 6vw, 6rem); }
.site-footer .footer-bottom { padding-block: 1.25rem; }
.site-footer .f-heading     { margin-bottom: 1rem; }
.site-footer .f-links li + li { margin-top: .55rem; }
.site-footer .f-newsletter  { margin-top: 1.75rem; }

/* 4. Text must never sit flush against a separator rule. */
hr, .divider, .footer-bottom { margin-top: 0; }
.footer-bottom-inner { padding-block: .25rem; }

/* 5. Keep section rhythm even when a section opens with a heading row. */
.section > .container > .section-hd { margin-bottom: clamp(2rem, 4vw, 3.5rem); }

@media (max-width: 560px) {
  /* Stop the footer collapsing to a cramped single column with no air. */
  .footer-grid { gap: 2.5rem; }
  .site-footer .footer-top { padding-block: 3rem; }
}

/* ════════════════════════════════════════════════════════════
   SPACING & DESIGN SYSTEM RHYTHM (Pass 13)
   Comprehensive spacing tokens and low-specificity :where()
   rules so all 13 public pages share vertical rhythm, card
   padding, section breathing room, and equalized card heights.
   ════════════════════════════════════════════════════════════ */
:root {
  --sp-section:         clamp(4rem, 6.5vw, 6.5rem);
  --sp-section-compact: clamp(2.5rem, 4.5vw, 4.5rem);
  --sp-section-hero:    clamp(4.5rem, 8vw, 7.5rem);
  --sp-card:            clamp(1.5rem, 2.4vw, 2rem);
  --sp-card-gap:        clamp(1.25rem, 2vw, 2rem);
  --sp-heading:         0.75rem;
  --sp-para:            1rem;
  --sp-divider:         1.5rem;
}

/* 1. Uniform section padding across all themed sections */
:where(
  .section,
  .section-alt,
  .section-dark,
  .section-blue,
  .section-light,
  .why-section,
  .facilities-section,
  .student-life-section,
  .news-section,
  .events-section,
  .testimonials-section,
  .principal-section,
  .academics-section,
  .tour-cta-section,
  .adm-cta-section
) {
  padding-block: var(--sp-section);
}

:where(.section--compact) {
  padding-block: var(--sp-section-compact);
}

/* 2. Uniform card padding and internal rhythm */
:where(.glass-card, .glass-card-blue, .why-card, .fac-card, .leader-card, .value-card, .ach-stat, .dept-card) {
  padding: var(--sp-card);
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Internal card rhythm: heading, body, and never a trailing gap */
:where(.glass-card, .why-card, .fac-card, .leader-card, .value-card, .ach-stat, .dept-card) > :where(h2, h3, h4) {
  margin-bottom: var(--sp-heading);
  line-height: 1.3;
}

:where(.glass-card, .why-card, .fac-card, .leader-card, .value-card, .ach-stat, .dept-card) > :where(p) {
  margin-bottom: var(--sp-para);
  line-height: 1.65;
}

/* Body text expands so cards in the same row align buttons/actions to the bottom */
:where(.glass-card, .why-card, .fac-card, .leader-card, .value-card, .ach-stat, .dept-card) > p:last-of-type {
  flex-grow: 1;
}

:where(.glass-card, .why-card, .fac-card, .leader-card, .value-card, .ach-stat, .dept-card) > :last-child {
  margin-bottom: 0;
}

/* 3. Grid alignment & equal card heights */
:where(.grid-2, .grid-3, .grid-4) {
  gap: var(--sp-card-gap);
  align-items: stretch;
}

/* Equal-height cards. `.leader-row` is excluded: it is a hierarchy row that
   lays its own cards out in a grid, and forcing it to a flex column collapsed
   the leadership rows into a single stack. */
.grid-2 > *:not(.leader-row),
.grid-3 > *:not(.leader-row),
.grid-4 > *:not(.leader-row) {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 4. Section headings and eyebrow spacing */
.eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

:where(.section-header, .section-hd) {
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

:where(.section) > .container > :where(h2, h3):first-child {
  margin-top: 0;
}

/* 5. Mobile responsive spacing overrides */
@media (max-width: 768px) {
  :root {
    --sp-section:         clamp(2.75rem, 5.5vw, 4rem);
    --sp-section-compact: clamp(2rem, 4vw, 3rem);
    --sp-card:            clamp(1.2rem, 3.5vw, 1.5rem);
    --sp-card-gap:        1.25rem;
  }
}

/* ════════════════════════════════════════════════════════════
   ICON REFINEMENT
   No icons are replaced — this only corrects size, containment and
   optical alignment, which is what made them read as cheap.
   ════════════════════════════════════════════════════════════ */

/* 1. An inline SVG sitting on the text baseline looks misaligned. Centring it
      on the text box is the single biggest improvement. */
.board-item svg, .prog-item svg, .ev-meta svg, .f-address svg, .info-card svg {
  vertical-align: middle;
  flex-shrink: 0;
}

/* 2. Consistent circular containers for the card icons, instead of each
      section inventing its own box size. */
.why-icon, .board-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--color-gold) 10%, transparent);
  color: var(--color-gold);
  transition: transform var(--dur-fast, .2s) ease, background var(--dur-fast, .2s) ease;
}
.why-icon svg, .board-icon svg { width: 1.5rem; height: 1.5rem; }

/* 3. A restrained lift on hover — depth, not decoration. */
.why-card:hover .why-icon { transform: translateY(-2px); background: color-mix(in srgb, var(--color-gold) 16%, transparent); }

/* 4. Even breathing room between an icon and its text. */
.board-item, .prog-item { display: flex; gap: 1rem; align-items: flex-start; }
.ev-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.f-address p  { display: flex; align-items: flex-start; gap: .5rem; }
.f-address svg { margin-top: .18em; }

/* 5. Icons must never scale away on small screens. */
@media (max-width: 560px) {
  .why-icon, .board-icon { width: 2.75rem; height: 2.75rem; }
  .why-icon svg, .board-icon svg { width: 1.3rem; height: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .why-icon, .board-icon { transition: none; }
  .why-card:hover .why-icon { transform: none; }
}

/* ════════════════════════════════════════════════════════════
   LEGACY STORIES
   Featured video + supporting cards. Depth comes from elevation and
   a restrained lift on hover rather than heavy 3D.
   ════════════════════════════════════════════════════════════ */
.lg-filters { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.lg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.lg-filter {
  padding: .5rem 1.15rem; border-radius: 9999px; cursor: pointer;
  border: 1.5px solid var(--color-border, rgba(0,0,0,.12));
  background: transparent; color: var(--color-text-soft, #4b5563);
  font-family: var(--font-body); font-size: .78rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  transition: background .2s, color .2s, border-color .2s;
}
.lg-filter:hover { border-color: var(--color-royal); color: var(--color-royal); }
.lg-filter.is-active { background: var(--color-royal); border-color: var(--color-royal); color: #fff; }

.lg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(1.25rem, 2.5vw, 2rem); }
.lg-card--featured { grid-column: 1 / -1; }

.lg-card {
  display: flex; flex-direction: column; cursor: pointer; overflow: hidden;
  border-radius: var(--radius-2xl, 1.25rem);
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, rgba(0,0,0,.08));
  box-shadow: 0 2px 8px rgba(15,61,145,.04), 0 10px 28px rgba(15,61,145,.06);
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease;
}
.lg-card--static { cursor: default; }
.lg-card:hover, .lg-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(15,61,145,.08), 0 20px 48px rgba(15,61,145,.14);
  outline: none;
}
.lg-card:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 3px; }

.lg-media { position: relative; aspect-ratio: 16/9; background: var(--color-mist, #eef1f6); overflow: hidden; }
.lg-card--featured .lg-media { aspect-ratio: 21/9; }
.lg-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.lg-card:hover .lg-media img { transform: scale(1.04); }
.lg-noposter { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; color: var(--color-text-ghost, #9aa3b2); background: linear-gradient(135deg, rgba(15,61,145,0.06), rgba(201,162,39,0.08)); }

/* Play affordance */
.lg-play {
  position: absolute; left: 50%; top: 50%; width: 62px; height: 62px;
  transform: translate(-50%,-50%); border-radius: 50%;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0,0,0,.3);
  transition: transform .3s cubic-bezier(.2,.7,.3,1), background .2s ease;
}
.lg-play::after {
  content: ''; position: absolute; left: 54%; top: 50%; transform: translate(-50%,-50%);
  border-style: solid; border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent var(--color-navy, #0F3D91);
}
.lg-card:hover .lg-play { transform: translate(-50%,-50%) scale(1.1); background: #fff; }

.lg-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(201, 162, 39, 0.15);
  color: var(--color-gold);
  margin-bottom: 0.75rem;
}

.lg-body { padding: clamp(1.25rem, 2.5vw, 1.85rem); display: flex; flex-direction: column; flex-grow: 1; }
.lg-quote { font-family: var(--font-display, serif); font-size: clamp(1.05rem, 1.5vw, 1.35rem); line-height: 1.45; color: var(--color-navy); margin: 0 0 .85rem; }
.lg-card--featured .lg-quote { font-size: clamp(1.3rem, 2.2vw, 1.95rem); line-height: 1.38; }
/* Optional longer text under a story's pull-quote. `margin: auto 0 0` on
   .lg-name still pushes the attribution to the bottom of the card. */
.lg-desc { color: var(--color-text-soft); font-size: .9rem; line-height: 1.55; margin: 0 0 .85rem; }
.lg-desc > p { margin: 0 0 .6rem; }
.lg-desc > p:last-child { margin-bottom: 0; }
.lg-name { font-weight: 700; color: var(--color-navy); margin: auto 0 0; font-size: 1rem; }
.lg-role { color: var(--color-text-soft); font-size: .85rem; margin: .2rem 0 0; }

@media (min-width: 900px) {
  .lg-card--featured {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: stretch;
  }
  .lg-card--featured .lg-media {
    aspect-ratio: auto;
    height: 100%;
    min-height: 380px;
  }
  .lg-card--featured .lg-body {
    justify-content: center;
    padding: clamp(2rem, 3.5vw, 3rem);
  }
}

/* Lightbox */
.lg-lightbox { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 4vmin;
  background: rgba(8,12,20,.92); backdrop-filter: blur(10px); animation: lgIn .25s ease both; }
.lg-lightbox video { width: min(1100px, 100%); max-height: 86vh; border-radius: 1rem; box-shadow: 0 30px 80px rgba(0,0,0,.6); background: #000; }
.lg-close { position: absolute; top: 2vmin; right: 3vmin; width: 48px; height: 48px; border-radius: 50%;
  border: none; cursor: pointer; background: rgba(255,255,255,.16); color: #fff; font-size: 1.75rem; line-height: 1; display: grid; place-items: center; }
.lg-close:hover { background: rgba(255,255,255,.28); }
@keyframes lgIn { from { opacity: 0 } to { opacity: 1 } }

@media (max-width: 640px) {
  .lg-card--featured .lg-media { aspect-ratio: 16/9; }
  .lg-play { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-card, .lg-media img, .lg-play { transition: none; }
  .lg-card:hover { transform: none; }
  .lg-lightbox { animation: none; }
}

/* ════════════════════════════════════════════════════════════
   DAILY ROUTINE TIMELINE (boarding)
   Editorial timeline: one rail, a time chip per entry, cards that
   lift on hover. Depth via elevation and a very small rotation —
   deliberately restrained so it stays readable.
   ════════════════════════════════════════════════════════════ */
.mps-timeline { position: relative; padding-left: clamp(2.5rem, 5vw, 3.5rem); }

.tl-rail {
  position: absolute; left: clamp(.85rem, 1.6vw, 1.25rem); top: .5rem; bottom: .5rem; width: 2px;
  background: linear-gradient(to bottom,
    transparent, var(--color-gold) 12%, var(--color-gold) 88%, transparent);
  opacity: .45;
}

.tl-item { position: relative; margin-bottom: clamp(1rem, 2vw, 1.5rem); }
.tl-item:last-child { margin-bottom: 0; }

.tl-node {
  position: absolute; left: calc(clamp(2.5rem, 5vw, 3.5rem) * -1 + clamp(.5rem, 1.1vw, .85rem));
  top: 1.55rem; width: 13px; height: 13px; border-radius: 50%;
  background: var(--color-gold);
  box-shadow: 0 0 0 4px var(--color-white, #fff), 0 0 0 6px rgba(201,162,39,.22);
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease;
}

.tl-card {
  position: relative;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, rgba(16,24,40,.08));
  border-radius: var(--radius-xl, 1rem);
  padding: clamp(1.1rem, 2vw, 1.5rem) clamp(1.25rem, 2.2vw, 1.75rem);
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 18px rgba(16,24,40,.05);
  transition: transform .4s cubic-bezier(.2,.7,.3,1), box-shadow .4s ease, border-color .3s ease;
  transform-origin: left center;
}
.tl-item:hover .tl-card {
  transform: translateY(-3px) rotateX(1.2deg);
  box-shadow: 0 2px 6px rgba(16,24,40,.06), 0 18px 40px rgba(16,24,40,.13);
  border-color: rgba(201,162,39,.45);
}
.tl-item:hover .tl-node { transform: scale(1.25); box-shadow: 0 0 0 4px var(--color-white,#fff), 0 0 0 8px rgba(201,162,39,.3); }

.tl-time {
  display: inline-block; margin-bottom: .5rem;
  font-family: var(--font-body); font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--color-royal, #0F3D91);
  background: rgba(15,61,145,.07);
  padding: .3rem .7rem; border-radius: 9999px;
}
.tl-activity {
  font-family: var(--font-display, serif);
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  color: var(--color-navy); margin: 0 0 .35rem; line-height: 1.3;
}
.tl-desc { margin: 0; color: var(--color-text-soft, #4b5563); font-size: .9rem; line-height: 1.65; }

@media (max-width: 560px) {
  .mps-timeline { padding-left: 2rem; }
  .tl-node { left: -1.6rem; top: 1.35rem; width: 11px; height: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-card, .tl-node { transition: none; }
  .tl-item:hover .tl-card { transform: none; }
  .tl-item:hover .tl-node { transform: none; }
}

/* ──────────────────── PRINT ──────────────────── */
@media print {
  .site-header,
  .site-footer,
  .cursor,
  .page-loader,
  .hero-particles,
  .hero-canvas,
  .scroll-indicator,
  .btn,
  .fac-nav,
  .tst-controls,
  .nav-progress {
    display: none !important;
  }

  body { color: black; background: white; }
  .hero { min-height: auto; }
  .section-dark, .section-blue { background: white; color: black; }
  a { color: var(--color-royal); }
}

/* ──────────────────── HIGH CONTRAST ──────────────────── */
@media (prefers-contrast: high) {
  :root {
    --glass-bg: rgba(0,0,0,0.85);
    --glass-border: rgba(255,255,255,0.5);
  }

  .glass-card {
    background: var(--color-navy);
    border: 2px solid white;
  }

  .why-card {
    border: 2px solid var(--color-navy);
  }

  .nav-link { color: white; }
}

/* ──────────────────── HOVER MEDIA QUERY (touch safety) ──────────────────── */
@media (hover: hover) and (pointer: fine) {
  .tilt-card { transition: transform var(--dur-slow) var(--ease-smooth); }

  .fac-card:hover { transform: translateY(-4px); }
}

@media (hover: none) {
  .tilt-card { transform: none !important; }
  .magnetic { transform: none !important; }
}

/* ════════════════════════════════════════════════════════════
   PASS I: COMPREHENSIVE MOBILE & VIEWPORT HARDENING (320px–768px)
   ════════════════════════════════════════════════════════════ */

/* 1. Touch Target Standardization */
.nav-toggle,
.fac-nav-btn,
.tst-btn {
  min-width: 44px;
  min-height: 44px;
}

.filter-btn,
.lg-filter {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 2. Mobile Form Input Zoom Prevention (iOS 16px safety) */
@media (max-width: 768px) {
  input.form-input,
  select.form-select,
  textarea.form-textarea,
  .nl-input,
  input.fi,
  select.fi,
  textarea.fi {
    font-size: 16px !important;
  }
}

/* 3. Small Screen Viewport Tuning (≤480px and ≤360px) */
@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
  
  .page-hero {
    padding-top: calc(var(--nav-h) + var(--space-6));
    padding-bottom: var(--space-12);
  }
  
  .page-hero-title {
    font-size: clamp(2rem, 7.5vw, 2.75rem);
  }

  .lg-close {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }
}

@media (max-width: 360px) {
  .container { padding: 0 var(--space-3); }

  .hero-h1 {
    font-size: 1.85rem;
    line-height: 1.1;
  }

  .mps-timeline {
    padding-left: 1.5rem;
  }

  .tl-node {
    left: -1.25rem;
    width: 9px;
    height: 9px;
  }

  .tl-card {
    padding: 0.85rem 0.95rem;
  }

  .tl-activity {
    font-size: 1.05rem;
  }

  .btn {
    padding: 0.75rem 1.25rem;
    font-size: var(--text-xs);
  }

  .f-heading {
    font-size: var(--text-sm);
  }
}

/* 4. Touch-Safe Horizontal Scrolling for Tables & Carousels */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* 5. Mobile Long-Form Prose & Paragraph Rhythm */
@media (max-width: 768px) {
  .rich-text > p {
    font-size: 0.95rem;
    line-height: 1.72;
    margin-bottom: 1.1rem;
    word-break: break-word;
  }
  .rich-text.measure,
  .longform-body {
    max-width: 100%;
  }
  .rich-text.is-clamped {
    max-height: var(--longform-max, 340px);
  }

  /* Culture strip responsive grid */
  .culture-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem;
    padding: 2.5rem 1.5rem !important;
  }

  /* Legacy timeline mobile spacing */
  .legacy-timeline {
    padding-left: 0.5rem;
  }
}

@media (max-width: 480px) {
  .culture-strip {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
    text-align: center;
  }

  /* Ensure touch targets meet 44px min accessible height */
  .nav-link,
  .btn,
  .accordion-trigger,
  .filter-btn,
  .pagination-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Global overflow-x prevention safety */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* 6. Signature Primitives Responsive Breakpoints */
@media (max-width: 768px) {
  .continuum-stream {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .memory-spot-grid {
    grid-template-columns: 1fr;
  }
  .acad-stream-grid {
    grid-template-columns: 1fr;
  }
  .founder-journey-node {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .founder-node-year {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .continuum-card,
  .adm-step-card,
  .acad-stream-card,
  .office-hours-card {
    padding: var(--space-6);
  }
  .gal-filter-btn {
    min-height: 44px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}



