/* ============================================================
   SDM School — Home
   Figma: SDM School Website Final / HOME DESIGN (1440 × 6849)
   ============================================================ */

/* ── Fonts ──────────────────────────────────────────────── */
@font-face {
  font-family: 'michael';
  src: url('../assets/fonts/michael.otf') format('opentype'),
       url('../assets/fonts/michael.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* Header palette (unchanged) */
  --indigo:        #364da1;
  --sky:           #d0e0f3;
  --sky-deep:      #b8cfeb;
  --orange:        #e24c38;
  --ink:           #000000;
  --paper:         #ffffff;

  /* Home design palette */
  --navy:          #374c9f;
  --blue:          #484fa1;
  --pink:          #e1567f;
  --pink-deep:     #c9406a;
  --red:           #e44c39;
  --tangerine:     #ec6f2d;
  --mist:          #d9e6f5;
  --mist-line:     #d2e1fb;
  --grey:          #767676;
  --grey-dark:     #606060;

  --font-body:     'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-michael:  'michael', 'Georgia', serif;

  /* Type scale - every page sizes its text from these. Each clamp runs
     from its phone size up to the Figma size at the 1440 frame.
     Headings in michael (.display) use the --fs-title steps; Montserrat
     headings use h2-h5. One-off decorative numerals and words (date
     tiles, stat numbers, Play/Peak/Pivot) keep their own sizes. */
  --fs-title-xl:   clamp(40px, 5.56vw, 80px);   /* programme names, "Why SDM." */
  --fs-title:      clamp(30px, 3.34vw, 48px);   /* page and section titles */
  --fs-h2:         clamp(28px, 2.78vw, 40px);   /* CTA and form headings */
  --fs-h3:         clamp(20px, 2.22vw, 32px);   /* card and item headings */
  --fs-h4:         clamp(18px, 2.08vw, 30px);   /* smaller item headings */
  --fs-h5:         clamp(17px, 1.67vw, 24px);   /* list group headings, captions */
  --fs-lede:       clamp(16px, 1.53vw, 22px);   /* intros and main body copy */
  --fs-body:       clamp(16px, 1.39vw, 20px);   /* secondary copy, large buttons */
  --fs-body-sm:    clamp(15px, 1.25vw, 18px);   /* names, mid buttons */
  --fs-caption:    clamp(14px, 1.11vw, 16px);   /* short descriptions */
  --fs-small:      14px;                        /* footer, notes, quotes */
  --fs-ui:         13px;                        /* menu, pills, form fields */
  --fs-micro:      12px;                        /* copyright */

  /* Space reserved above each page's hero for the fixed header bar, so
     a hero picture starts right beneath it. --hero-gap-phone is used
     where the hero's headline comes first (phones), leaving a little
     room above the text. */
  --hero-gap:       clamp(76px, 5.6vw, 80px);
  --hero-gap-phone: 84px;

  --shell:         1280px;
  --frame:         1440px;
  --gutter:        clamp(20px, 5vw, 64px);

  --ease:          cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --dur:           0.5s;
  --dur-slow:      0.9s;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;          /* in-page jumps land below the fixed header */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1, h2, h3, p, figure, ul, blockquote, address {
  margin: 0;
  padding: 0;
}

address { font-style: normal; }

ul { list-style: none; }

a { color: inherit; }

button { font: inherit; }

/* Every page heading is set in michael, which ships a single weight. */
.display {
  font-family: var(--font-michael);
  font-weight: 400;
  letter-spacing: -0.005em;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* The design's 1440 artboard. Sections lay out inside it. */
.wrap {
  position: relative;
  width: 100%;
  max-width: var(--frame);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--indigo);
  color: #fff;
  padding: 12px 20px;
  font-weight: 600;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

/* ── Scroll reveal ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* main.js staggers reveals that arrive together (a row of cards) with a
   short inline transition-delay, cleared once they have arrived. */

/* ── Interaction feedback, site-wide ────────────────────── */
/* Pressed: every button-like control dips slightly while held, so taps
   on touch screens (which never show hover) get an immediate response,
   like a native button. `scale` composes with any transform an element
   already uses, such as the carousel arrows' centring.

   The shared transition below is what makes the dip ease in and out.
   Every one of these controls already animated colour, shadow and
   movement at --dur/--ease; this keeps exactly that and adds `scale`.
   `html` lifts it above each component's own `transition` rule. The
   back-to-top button keeps its own (it also fades in and out). */
html :is(.pill, .nav-cta, .nav-toggle, .arrow, .dot, .a-explore, .a-day,
         .ad-todo-pill, .ad-check-submit, .ad-todo-box, .help-btn, .form-submit) {
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    scale 0.15s var(--ease-out);
}
.pill:active, .nav-cta:active, .nav-toggle:active, .to-top:active, .arrow:active,
.a-explore:active, .a-day:active, .ad-todo-pill:active, .ad-check-submit:active,
.help-btn:active, .form-submit:active { scale: 0.96; }
.dot:active, .ad-todo-box:active { scale: 0.85; }

/* These controls show their own pressed dip, so the phone's grey tap
   flash is turned off on them only; every other link keeps it. */
.pill, .nav-cta, .nav-toggle, .to-top, .arrow, .dot, .a-explore, .a-day,
.ad-todo-pill, .ad-check-submit, .ad-todo-box, .help-btn, .form-submit {
  -webkit-tap-highlight-color: transparent;
}

/* Photos that load while the page is being read fade in rather than
   popping (main.js adds .img-in when a lazy image finishes loading). */
.img-in { animation: imgIn 0.6s var(--ease) both; }
@keyframes imgIn { from { opacity: 0; } }

/* Page fades in once fonts and the first image are ready. */
body { animation: pageIn 0.7s var(--ease) backwards; }
@keyframes pageIn { from { opacity: 0; } }

/* ── Page-to-page transitions ───────────────────────────── */
/* Browsers with cross-document View Transitions (Chrome/Edge 126+,
   Safari 18.2+) cross-fade between pages natively: the old page drifts
   up and fades, the new one rises in, and the header holds still. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: pageOut 0.32s var(--ease) both; }
::view-transition-new(root) { animation: pageRise 0.6s var(--ease-out) 0.08s both; }
::view-transition-group(site-header) { animation-duration: 0.45s; }
@keyframes pageOut { to { opacity: 0; transform: translateY(-14px); } }
@keyframes pageRise { from { opacity: 0; transform: translateY(22px); } }
/* The transition already brings the page in; don't replay the load
   fade-ins on top of it (the head script sets .vt-in). */
html.vt-in body,
html.vt-in .site-header { animation: none; }

/* Elsewhere main.js adds .is-leaving just before following a link.
   The fixed header is left alone (a transform on body would unpin it). */
html.is-leaving body > :not(.site-header) {
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding-block: 22px;
  transition:
    background-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    padding var(--dur) var(--ease),
    transform 0.6s var(--ease-out);
  /* backwards, not both: a held end state would pin transform and
     stop .is-hidden from sliding the header away. */
  animation: fadeDown 0.9s var(--ease-out) 0.2s backwards;
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
}

/* Pinned while scrolling: see-through white with a frosted blur. */
.site-header.is-stuck {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.08);
  padding-block: 10px;
}
/* Older browsers without blur get a more opaque white so text stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header.is-stuck { background: rgba(255, 255, 255, 0.95); }
}

/* Figma: logo at x63, menu running to x1377 on the 1440 frame. */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--frame);
  padding-inline: clamp(20px, 4.4vw, 63px);
}

.brand picture { display: contents; }   /* CMS logo: per-device <source>s, sized by the img rules */
.brand img {
  width: clamp(96px, 9vw, 130px);
  height: auto;
  transition: width var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.brand:hover img { transform: scale(1.04); }

/* The logo eases down a size once the header is pinned. */
.site-header.is-stuck .brand img { width: clamp(80px, 7vw, 100px); }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 32px);
  font-size: var(--fs-ui);
  font-weight: 500;
  color: var(--nav-ink, #000);
}

.site-nav a {
  position: relative;
  text-decoration: none;
  padding-block: 4px;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.site-nav a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.site-nav a:not(.nav-cta):hover { color: var(--pink); }
.site-nav a:not(.nav-cta):hover::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--pink); }

/* Apply Now — 116 × 44 pink pill */
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  min-height: 40px;
  margin-left: calc(16px - clamp(16px, 2.2vw, 32px));
  padding: 0 18px !important;
  border-radius: 59px;
  background: var(--pink);
  color: #fff;
  font-weight: 600;
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.nav-cta:hover {
  background: var(--pink-deep);
  transform: translateY(-2px);
}

/* Header-bar copy of Apply Now, beside the hamburger (≤1200px only). */
.header-cta { display: none; }

/* Hamburger (shown below 1200px) */
.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--mist);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}
/* Mouse only: on touch screens a hover colour would stick after a tap. */
@media (hover: hover) {
  .nav-toggle:hover { background: var(--mist-line); }
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  position: absolute;
  left: 50%;
  width: 20px;
  height: 2px;
  margin-left: -10px;
  border-radius: 2px;
  background: var(--navy);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle span { top: 21px; }
.nav-toggle span::before,
.nav-toggle span::after { content: ''; left: 0; margin-left: 0; }
.nav-toggle span::before { transform: translateY(-6px); }
.nav-toggle span::after  { transform: translateY(6px); }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: rotate(45deg); background: var(--navy); }
.nav-open .nav-toggle span::after  { transform: rotate(-45deg); background: var(--navy); }

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

  /* Apply Now moves out of the menu into the bar, before the hamburger. */
  .header-inner { gap: 12px; }
  .header-inner .header-cta {      /* outranks the in-menu .nav-cta rules */
    display: inline-flex;
    position: relative;
    z-index: 2;                    /* stays above the open menu sheet */
    margin: 0 0 0 auto;            /* drop the in-menu 16px top margin */
    font-size: var(--fs-ui);
    text-decoration: none;
  }
  .site-nav .nav-cta { display: none; }

  /* The menu opens as a full-screen sheet beneath the header bar; the
     logo, Apply Now and the toggle stay on top of it. */
  .brand,
  .nav-toggle { position: relative; z-index: 2; }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 96px 32px calc(40px + env(safe-area-inset-bottom));
    overflow-y: auto;
    background: #fff;
    font-size: clamp(20px, 2.4vw, 26px);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
  }
  .nav-open .site-nav {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s var(--ease), visibility 0s;
  }
  .site-nav a {
    width: min(100%, 460px);       /* a centred column, even on tablets */
    padding-block: clamp(14px, 1.6vw, 18px);
    border-bottom: 1px solid var(--mist);
    text-align: center;
  }
  .site-nav a:not(.nav-cta)::after { display: none; }   /* matches the desktop underline rule's weight */
  .site-nav a:nth-last-child(2) { border-bottom: 0; }   /* Contact, the last visible link */

  /* backdrop-filter would trap the fixed full-screen sheet inside the
     header bar, so it is switched off while the menu is open. */
  .nav-open.site-header {
    background: #fff;
    box-shadow: 0 1px 24px rgba(0, 0, 0, 0.08);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .nav-open .site-nav a:not(.nav-cta) {
    animation: menuIn 0.45s var(--ease-out) backwards;
  }
  .nav-open .site-nav a:nth-child(2) { animation-delay: 0.03s; }
  .nav-open .site-nav a:nth-child(3) { animation-delay: 0.06s; }
  .nav-open .site-nav a:nth-child(4) { animation-delay: 0.09s; }
  .nav-open .site-nav a:nth-child(5) { animation-delay: 0.12s; }
  .nav-open .site-nav a:nth-child(6) { animation-delay: 0.15s; }
  .nav-open .site-nav a:nth-child(7) { animation-delay: 0.18s; }
}
@keyframes menuIn { from { opacity: 0; transform: translateY(10px); } }

/* ── Back to top (added by main.js) ─────────────────────── */
.to-top {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 90;                         /* under the header and its menu */
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(55, 76, 159, 0.6);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.9);
  transition:
    opacity 0.35s var(--ease),
    transform 0.35s var(--ease-out),
    background-color var(--dur) var(--ease),
    visibility 0s linear 0.35s;
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.35s var(--ease),
    transform 0.35s var(--ease-out),
    background-color var(--dur) var(--ease),
    visibility 0s;
}
.to-top:hover { background: var(--navy); transform: translateY(-3px); }
.to-top:hover svg { animation: nudgeUp 0.6s var(--ease-out); }
@keyframes nudgeUp { 40% { transform: translateY(-3px); } }

/* Out of the way while the full-screen menu is open. */
html.nav-locked .to-top { display: none; }

@media (max-width: 640px) {
  .to-top { width: 44px; height: 44px; }
}

/* Page behind the open menu must not scroll. */
html.nav-locked,
html.nav-locked body { overflow: hidden; }

/* ============================================================
   Shared pieces
   ============================================================ */
.section-title {
  font-size: var(--fs-title);
  line-height: 1.15;
  text-align: center;
}
.section-title--pink { color: var(--pink); }
.section-title--blue { color: var(--blue); }
.section-title--red  { color: var(--red); }

.section-sub {
  margin-top: 6px;
  font-size: var(--fs-lede);
  color: var(--grey);
  text-align: center;
}

/* Pill buttons */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 59px;
  padding: 9px 22px;
  font-family: var(--font-body);
  font-size: var(--fs-ui);
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(55, 76, 159, 0.6);
}
.pill--pink { background: var(--pink); }
.pill--pink:hover { background: var(--pink-deep); }
.pill--navy { background: var(--navy); }
.pill--navy:hover { background: var(--blue); }

.pill--sm { min-width: 86px; padding: 8px 16px; }
.pill--lg { min-width: min(361px, 100%); min-height: 47px; font-size: var(--fs-body-sm); padding: 10px 28px; }
.pill--xl { min-width: min(277px, 100%); min-height: 53px; padding: 12px 25px; }

/* ============================================================
   Hero — four photos cross-fade beneath the headline
   ============================================================ */
.hero {
  position: relative;
  z-index: 2;
  /* Just clears the header bar (≈94px tall at desktop). */
  padding-top: clamp(76px, 7vw, 100px);
}

/* The artwork runs 42px past the left edge of the 1440 frame. */
.hero-stage {
  position: relative;
  width: 102.78%;
  margin-left: -2.92%;
  aspect-ratio: 1480 / 1065;
}

.hero-slides,
.hero-slide {
  position: absolute;
  inset: 0;
}
.hero-slide {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.hero-slide.is-active { opacity: 1; }

/* A soft white glow in the top-left corner, beneath the headline, so
   the navy text reads on every photo (several have dark wood or floor
   tiles there, not sky). */
.hero-slides::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 50% 38% at 18% 14%,
    rgba(255, 255, 255, 0.62) 0%,
    rgba(255, 255, 255, 0.45) 40%,
    rgba(255, 255, 255, 0.16) 70%,
    rgba(255, 255, 255, 0) 100%
  );
}

.nowrap { white-space: nowrap; }   /* keeps e.g. "next-gen" on one line */

.hero-copy {
  position: absolute;
  left: 6.8%;
  top: 7.7%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(10px, 1.4vw, 20px);
}

.hero-title {
  color: var(--navy);
  font-size: clamp(18px, 2.78vw, 40px);
  line-height: 1.18;
  text-shadow:
    0 0 2px rgba(255, 255, 255, 0.9),
    0 0 18px rgba(255, 255, 255, 0.85);
}

.hero-pill { box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.35); }

.hero-pill {
  font-size: clamp(13px, 1.05vw, 15px);    /* never below 13px on tablets */
  font-weight: 700;
  padding: clamp(7px, 0.85vw, 12px) clamp(16px, 2.1vw, 30px);
}

/* ============================================================
   A culture of curiosity — sits on the pale blue wave that
   the hero photograph overlaps
   ============================================================ */
.curiosity {
  position: relative;
  z-index: 1;
  margin-top: -13.5vw;
  padding: calc(13.5vw + 150px) 0 170px;
}
.curiosity::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(100% + 110px);
  background: url('../assets/wave1.png') center top / 100% 100% no-repeat;
  z-index: -1;
}

.curiosity-character {
  position: absolute;
  left: 17px;
  top: -47px;
  width: clamp(200px, 24vw, 346px);
  height: auto;
  z-index: 2;               /* walks in front of the text */
  /* main.js toggles .is-across once the section is well in view; the
     character then walks the whole way in one go, never resting over
     the text. --walk-x is the distance, set from the frame width. */
  transition: transform 2.6s cubic-bezier(0.45, 0, 0.25, 1);
}
.curiosity-character.is-across {
  transform: translate3d(var(--walk-x, 0px), -40px, 0);
}

.curiosity-copy {
  max-width: 810px;
  margin-inline: auto;
  padding-inline: 20px;              /* keeps the copy off the screen edges on tablets */
  box-sizing: content-box;
  text-align: center;
}

.curiosity-lede {
  margin-top: 22px;
  font-size: var(--fs-lede);
  line-height: 1.24;
  color: var(--blue);
}

/* ============================================================
   Stages — Pre K to Grade 10
   ============================================================ */
.stages {
  position: relative;
  isolation: isolate;
  padding-top: 31px;
}

.stages-line {
  position: absolute;
  left: 0;
  top: 14px;
  width: 100%;
  height: auto;
  z-index: -1;
  pointer-events: none;
}

.stages-confetti {
  position: absolute;
  inset: 0;
  max-width: var(--frame);
  margin-inline: auto;
  pointer-events: none;
}
.stages-confetti img {
  position: absolute;
  height: auto;
}

.stages-head { padding-inline: 20px; }

.stage-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 414px));
  justify-content: center;
  column-gap: 48px;
  margin-top: 61px;
  text-align: center;
}

.stage-img {
  width: min(278px, 100%);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  margin-inline: auto;
  border-radius: 18px;
  transition: transform 0.6s var(--ease-out);
}
.stage:hover .stage-img { transform: translateY(-6px) rotate(-1.5deg); }

.stage-name {
  margin-top: 33px;
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 30px;
  color: var(--tangerine);
}
.stage-tag {
  font-size: var(--fs-lede);
  line-height: 30px;
  color: var(--navy);
}

/* Explore: a pale-blue pill under each stage (same look as Academics). */
.stage-explore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  min-height: 30px;
  margin-top: 20px;
  padding: 4px 22px;
  border-radius: 15px;
  background: var(--mist-line);
  font-size: var(--fs-body-sm);
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    scale 0.15s var(--ease-out);
}
.stage-explore:hover { background: var(--navy); color: #fff; transform: translateY(-2px); }
.stage-explore:active { scale: 0.96; }
@media (max-width: 760px) {
  .stage-explore { min-height: 40px; border-radius: 20px; }   /* a comfortable tap height */
}

/* The three cards step down the page like the design. */
.stage--prek { margin-top: 88px; }
.stage--prek .stage-name { margin-top: 63px; }
.stage--senior .stage-name { margin-top: 49px; }

/* ============================================================
   There's more to every subject
   ============================================================ */
.subjects-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -31px;
  padding-inline: 20px;
  /* The -31px pull-up lays this full-width box over the foot of the
     stages above; let clicks pass through it to the Pre K Explore
     button there. Its own contents stay clickable. */
  pointer-events: none;
}
.subjects-inner > * { pointer-events: auto; }

.subjects-character {
  width: 228px;
  height: auto;
  transform: scaleX(-1);
}

.subjects-inner > .section-title { margin-top: -7px; }

.subject-list {
  display: grid;
  grid-template-columns: repeat(4, 208px);
  column-gap: 93px;
  margin-top: 64px;
  text-align: center;
}

.subject-icon {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 150px;
}
.subject-icon img {
  width: auto;
  max-height: 150px;
  transition: transform 0.6s var(--ease-out);
}
.subject:hover .subject-icon img { transform: translateY(-6px) scale(1.04); }

.subject-name {
  margin-top: 20px;
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.2;
  color: var(--blue);
}
.subject-name--bold { font-weight: 700; }

.subjects-inner > .pill { margin-top: 62px; }

/* ============================================================
   More than what they learn — four-slide carousel on a pink wave
   ============================================================ */
.learn {
  position: relative;
  margin-top: 77px;
}

.learn-pin { position: relative; }   /* the wave is placed against this */

.learn-stage { height: 613px; }

/* Pinned mode (desktop, set by main.js): the section is stretched by one
   scroll step per slide and .learn-pin sticks to the screen, the stage
   sitting just below the header. Scroll position picks the slide. */
.learn.is-pinned .learn-pin {
  --pin-pad: max(72px, calc((100vh - 613px) / 2 + 24px));
  position: sticky;
  top: 0;
  height: 100vh;
  padding-top: var(--pin-pad);
  overflow: hidden;
}
.learn.is-pinned .learn-wave { top: calc(var(--pin-pad) + 164px); }

.learn-title {
  position: absolute;
  left: 57.6%;
  top: 147px;
  z-index: 3;
  font-size: var(--fs-title);
  line-height: 52px;
  color: var(--blue);
}

.learn-wave {
  position: absolute;
  left: 0;
  top: 164px;
  width: 100%;
  height: 405px;
  object-fit: cover;        /* crop, never squash, when the frame narrows */
  transform: scaleX(-1);
}

/* Slide changes are direction-aware. main.js sets data-dir on .learn:
   going forward the new photo glides in from the left while the old one
   drifts out to the right (and the reverse going back); the copy rises
   in line by line after the photo. --in / --out hold the offsets. */
.learn { --in: -70px; --out: 50px; }
.learn[data-dir="prev"] { --in: 70px; --out: -50px; }

.learn-slide {
  position: absolute;
  inset: 0;
  visibility: hidden;
  transition: visibility 0s linear 0.9s;
}
.learn-slide.is-active {
  visibility: visible;
  transition: visibility 0s;
}

.learn-img {
  position: absolute;
  left: 0;
  bottom: 43px;
  width: 59%;
  max-height: 590px;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  transform: translateX(var(--out)) scale(0.97);
  transition:
    opacity 0.6s var(--ease),
    transform 0.9s var(--ease-out);
}
.learn-img--first { left: 4.5%; width: 57.8%; }
.learn-slide.is-active .learn-img {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.8s var(--ease) 0.12s,
    transform 1.1s var(--ease-out) 0.12s;
}
/* Entry starts from the incoming side: snap there with no transition
   just before .is-active lands (main.js adds .is-entering for a frame). */
.learn-slide.is-entering .learn-img {
  transform: translateX(var(--in)) scale(0.97);
  transition: none;
}

.learn-copy > * {
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 0.35s var(--ease),
    transform 0.45s var(--ease);
}
.learn-slide.is-active .learn-copy > * {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.7s var(--ease),
    transform 0.9s var(--ease-out);
}
.learn-slide.is-active .learn-copy h3 { transition-delay: 0.35s; }
.learn-slide.is-active .learn-copy p  { transition-delay: 0.5s; }
.learn-slide.is-entering .learn-copy > * {
  transform: translateY(26px);
  transition: none;
}

/* Anchored to the wave's foot (not its top) so a heading that wraps
   onto two lines grows the copy upward and it stays inside the pink. */
.learn-copy {
  position: absolute;
  left: 64.14%;
  right: 4%;
  bottom: 86px;
  color: #fff;
}
.learn-copy h3 {
  font-size: var(--fs-h3);
  font-weight: 900;
  line-height: 1.2;
}
.learn-copy p {
  margin-top: 20px;
  font-size: var(--fs-lede);
  line-height: 1.22;
}

.dots {
  display: flex;
  gap: 33px;
  justify-content: center;
}
.dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--mist-line);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
/* The dot stays 11px but its tap area is 44px, so it's easy to hit on a phone. */
.dot { position: relative; }
.dot::after { content: ''; position: absolute; inset: -16px; }
.dot:hover { transform: scale(1.25); }
.dot.is-active { background: var(--navy); }

.learn-dots {
  position: absolute;
  left: 0;
  right: 0;
  top: 592px;
}

/* ============================================================
   Why SDM is the right fit
   ============================================================ */
.fit { padding-top: 94px; }

.fit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1365px;
  margin: 80px auto 0;
  row-gap: 26px;
  text-align: center;
}

.fit-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.fit-item img {
  width: 120px;             /* 25% smaller than the original 160px */
  height: 120px;
  transition: transform 0.6s var(--ease-out);
}
.fit-item:hover img { transform: translateY(-6px); }
.fit-item span {
  margin-top: 6px;
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.4;
  color: var(--grey);
}

/* ============================================================
   Student life
   ============================================================ */
.life {
  position: relative;
  margin-top: 40px;
}
.life::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 131px;
  bottom: 0;
  background: url('../assets/wave2.png') center top / 100% 100% no-repeat;
  z-index: -1;
}

.life-inner { min-height: 653px; }

.life-copy {
  max-width: calc(739px + 15.2%);
  padding: 249px 20px 60px 15.2%;
}
.life-copy .section-title { text-align: left; }

.life-lede,
.life-text {
  font-size: var(--fs-body);
  line-height: 1.4;
  color: var(--grey-dark);
}
.life-lede { margin-top: 0; }
.life-lede strong { font-weight: 600; }
.life-text { margin-top: 28px; }

.life-copy .pill { margin-top: 51px; min-width: 174px; }

.life-character {
  position: absolute;
  left: 69.6%;
  top: 0;
  width: 356px;
}
.life-stack { width: 100%; height: auto; position: relative; }
.life-shadow {
  position: absolute;
  left: 120px;
  top: 575px;
  width: 201px;
}

/* ============================================================
   Student life gallery — three cards per view
   ============================================================ */
.gallery { margin-top: 149px; }

.gallery-inner {
  display: flex;
  align-items: center;
  gap: 30px;
  max-width: 1442px;
  padding-inline: 20px;
}

.gallery-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.gallery-track {
  --per: 3;
  --gap: 29px;
  display: flex;
  gap: var(--gap);
  transition: transform 0.7s var(--ease-out);
}

.gallery-card {
  flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per));
  text-align: center;
}
.gallery-card img {
  width: 100%;
  aspect-ratio: 395 / 251;
  object-fit: cover;
  border-radius: 36px 0;
  background: #c4c4c4;
}
.gallery-card span {
  display: block;
  margin-top: 23px;
  font-size: var(--fs-lede);
  color: var(--grey-dark);
}

.arrow {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
}
.arrow img { width: 44px; height: 44px; }
.arrow--prev img { transform: scaleX(-1); }
.arrow:hover { transform: scale(1.08); }
.arrow:disabled { opacity: 0.4; cursor: default; transform: none; }

/* ============================================================
   SDM Expressions — testimonials
   ============================================================ */
.voices { padding-top: 48px; }

.voices-inner {
  padding: 106px 20px 0;
  text-align: center;
}

.voices-character {
  position: absolute;
  left: 98px;
  top: 0;
  z-index: 2;
  width: 223px;
  height: auto;
}

.voices-title {
  font-size: var(--fs-title);
  line-height: 56px;
  color: var(--navy);
}

.voices-filter {
  display: flex;
  justify-content: center;
  gap: 45px;
  margin-top: 28px;
}
.voices-filter .pill[aria-pressed="true"] { background: var(--navy); }

.voice-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 402px));
  justify-content: center;
  gap: 48px;
  margin-top: 50px;
  text-align: left;
}

.voice {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 173px;
  padding: 23px 20px 22px 26px;
  border-radius: 36px;
  color: #fff;
  transition:
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    filter var(--dur) var(--ease);
}
.voice--red  { background: #e24c38; }
.voice--blue { background: var(--blue); }
.voice--pink { background: var(--pink); }
.voice.is-muted {
  opacity: 0.32;
  transform: scale(0.97);
  filter: saturate(0.4);
}

.voice blockquote {
  margin: 0;
  font-size: var(--fs-small);
  line-height: 1.22;
}

.voice-by {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-ui);
}
.voice-by img {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background: #ebebeb;
}

/* ============================================================
   Call to action
   ============================================================ */
.join {
  position: relative;
  isolation: isolate;
  margin-top: 102px;
  padding: 171px 20px 107px;
  overflow: hidden;
  text-align: center;
}
.join::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: -46px;
  left: -19.7%;
  width: 156.2%;
  /* The wave art is a fixed 552px tall; a solid fill of the same blue
     sits beneath its crest so a taller section never shows a gap
     above the footer. */
  background-image:
    var(--join-wave, url('../assets/figma/cta-wave.svg')),
    linear-gradient(#d0dff6, #d0dff6);
  background-size: 100% 552px, 100% calc(100% - 280px);
  background-position: left top, left 280px;
  background-repeat: no-repeat;
  z-index: -1;
}

.join-title {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.25;
  color: var(--blue);
}
.join-sub {
  margin-top: 18px;
  font-size: var(--fs-lede);
  color: var(--navy);
}
.join .pill { margin-top: 30px; }

.join-copyright {
  position: absolute;
  right: max(36px, calc((100vw - var(--frame)) / 2 + 36px));
  top: 99px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: var(--fs-micro);
  color: var(--grey);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--navy);
  color: #fff;
  font-size: var(--fs-small);
}

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

.footer-cols {
  display: grid;
  grid-template-columns: minmax(0, 761px) minmax(0, 1fr);
  padding-inline: 92px 72px;
  line-height: 19px;
}

.footer-col { font-weight: 600; }
.footer-col p { line-height: 17px; }
.footer-col p + p { margin-top: 2px; line-height: 22px; }

.footer-label,
.footer-key {
  font-weight: 500;
  color: var(--mist-line);
}
.footer-label { display: block; }

.site-footer a {
  text-decoration: none;
  white-space: nowrap;               /* a phone number or address never splits across lines */
  transition: color var(--dur) var(--ease);
}
.footer-col a:hover { color: var(--mist-line); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 25px 91px 0 81px;
  padding: 25px 37px 0 35px;
  border-top: 1px solid rgba(210, 225, 251, 0.5);
  font-weight: 700;
  color: var(--mist-line);
}
.footer-links a:hover { color: #fff; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1380px) {
  .stages-confetti { display: none; }
  .subject-list { column-gap: clamp(24px, 4vw, 93px); grid-template-columns: repeat(4, minmax(0, 208px)); }
  .learn-title { left: 55%; font-size: var(--fs-title); }
  .learn-copy h3 { font-size: var(--fs-h3); }
  .learn-copy p { font-size: var(--fs-lede); }
  .life-character { left: auto; right: 4%; width: clamp(240px, 25vw, 356px); }
  .life-shadow { display: none; }

  .footer-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; padding-inline: 48px; }
  .footer-links { margin-inline: 48px; padding-inline: 0; }
}

@media (max-width: 1200px) {
  /* Narrower screens make these sections much taller than the wave art,
     so stretching it to fill (100% 100%) skews the curve. Keep each wave
     at its true aspect ratio and fill the rest with its own colour.
     wave1 is 1440 × 812 at 80% opacity, so its fill must meet it
     edge-to-edge rather than overlap. It never drops below 780px wide
     (cropped at the sides) so phones see a gentle curve, not a squeezed
     one; 440px is that width at the art's 0.564 ratio. */
  .curiosity::before {
    background:
      url('../assets/wave1.png') center bottom / max(100%, 780px) max(56.4vw, 440px) no-repeat,
      linear-gradient(rgba(207, 224, 242, 0.8), rgba(207, 224, 242, 0.8))
        center top / 100% calc(100% - max(56.4vw, 440px)) no-repeat;
  }
  .life::before {
    background:
      url('../assets/wave2.png') center top / max(100%, 780px) auto no-repeat,
      linear-gradient(#f8d2cd, #f8d2cd) center bottom / 100% calc(100% - max(20vw, 160px)) no-repeat;
  }

  /* Character drops above the copy rather than crowding it. */
  .curiosity { padding-top: calc(13.5vw + 24px); }
  .curiosity-character {
    position: static;
    margin: 0 auto 8px;
    width: clamp(160px, 22vw, 240px);
  }

  .voices-character {
    position: static;
    width: 160px;
    margin: -40px auto 12px;
  }
  .voices-inner { padding-top: 40px; }
  .voice-list { gap: 24px; }
}

@media (max-width: 1000px) {
  /* Once the heading wraps, the section line runs through the text.
     Re-anchor it to the photo row so it passes behind the images; the
     stroke sits ~72% down the art, so that point lands on --line-y. */
  .stages { overflow-x: clip; }
  .stages-line { display: none; }
  .stage-list { position: relative; --line-y: 150px; --line-w: 140vw; }
  .stage-list::before {
    content: '';
    position: absolute;
    left: 50%;
    top: var(--line-y);
    width: var(--line-w);
    aspect-ratio: 1440 / 496;
    background: url('../assets/line1.png') center / 100% 100% no-repeat;
    transform: translate(-50%, -72%);
    z-index: -1;
    pointer-events: none;
  }

  .stage-list { column-gap: 24px; padding-inline: 20px; }
  .stage--prek { margin-top: 48px; }
  .stage-name,
  .stage--prek .stage-name,
  .stage--senior .stage-name { margin-top: 24px; }

  .subjects-inner { margin-top: 40px; }
  .subject-list { grid-template-columns: repeat(2, minmax(0, 208px)); row-gap: 40px; }

  /* Carousel stacks: title, photo, then a pink card for the copy. */
  .learn-stage { height: auto; padding: 0 20px; }
  .learn-title { position: static; text-align: center; }
  .learn-wave { display: none; }
  .learn-slides { display: grid; margin-top: 24px; }
  /* All slides share one grid cell and cross-fade. Give every photo the
     same box and stretch every card to the cell, so the outgoing card
     lines up exactly with the incoming one instead of overlapping its
     photo mid-transition. */
  .learn-slide {
    position: relative;
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
  }
  .learn-img,
  .learn-img--first {
    position: relative;
    left: auto;
    bottom: auto;
    flex: none;
    width: min(100%, 640px);
    height: min(420px, 72vw);
    max-height: none;
    object-fit: contain;
    object-position: center bottom;
    margin-inline: auto;
  }
  .learn-copy { flex: 1; }
  .learn-copy {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    margin-top: -12px;
    padding: 28px 28px 32px;
    /* Square top: rounded corners let the photo's table edge peek out. */
    border-radius: 0 0 36px 36px;
    background: var(--pink);
  }
  .learn-dots { position: static; margin-top: 20px; }

  .fit-grid { grid-template-columns: repeat(2, 1fr); padding-inline: 20px; margin-top: 48px; }

  .life::before { top: 160px; }
  .life-inner { min-height: 0; display: flex; flex-direction: column-reverse; }
  .life-character {
    position: relative;
    right: auto;
    width: 200px;
    margin: 0 auto;
  }
  .life-copy { padding: 0 24px 60px; max-width: 760px; margin-inline: auto; }

  .gallery { margin-top: 72px; }
  .gallery-track { --per: 2; --gap: 20px; }
  .gallery-inner { gap: 12px; }

  .voice-list { grid-template-columns: minmax(0, 480px); }

  .footer-cols { grid-template-columns: 1fr; row-gap: 20px; padding-inline: 24px; }
  .footer-links { margin-inline: 24px; padding-inline: 0; justify-content: flex-start; row-gap: 0; padding-top: 12px; }
  .footer-links a { padding-block: 12px; }   /* 44px tap height on touch screens */

  /* The CTA wave SVGs use preserveAspectRatio="none"; a fixed 552px
     height on a narrow box squashes them. Scale the wave with the width
     instead, never narrower than 1100px (the sides are cropped) so phones
     get a gentle curve rather than a squeezed one. The art is ~0.22–0.25
     as tall as wide; the solid fill starts ~60% down it, beneath the
     crest. "section" outranks the per-page overrides. */
  section.join { --join-fill: max(22.4vw, 154px); }
  section.join::before {
    left: -30vw;
    width: max(160vw, 1100px);
    background-size: 100% auto, 100% calc(100% - var(--join-fill));
    background-position: left top, left var(--join-fill);
  }

  .join-copyright {
    position: static;
    writing-mode: horizontal-tb;
    transform: none;
    margin-top: 40px;
  }
}

@media (max-width: 640px) {
  /* Hero: headline sits above the photo instead of crowding its corner. */
  .hero { padding-top: var(--hero-gap-phone); }
  .hero-stage {
    width: 100%;
    margin-left: 0;
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
  }
  .hero-stage { overflow-x: clip; }
  /* The photos carry a 22px (1.5%) transparent strip down their left
     edge and a soft right edge; nudge them past both sides of the
     screen, as the desktop layout does. */
  .hero-slides {
    position: relative;
    order: 2;
    width: 102.6%;
    margin-left: -1.6%;
    aspect-ratio: 1480 / 1065;
  }
  .hero-slides::after { display: none; }
  .hero-copy {
    position: static;
    order: 1;
    padding: 4px 20px 18px;
    gap: 14px;
  }
  .hero-title { font-size: 28px; text-shadow: none; }
  .hero-pill { font-size: 13px; padding: 9px 20px; }

  /* Forced desktop line breaks leave stray short lines on phones. */
  .join-title br,
  .hero-title br { display: none; }

  .stage-list { grid-template-columns: 1fr; row-gap: 40px; --line-y: 120px; --line-w: 220vw; }
  .stage--prek { margin-top: 0; }
  .stage-img { width: min(240px, 100%); }

  .subject-icon { height: 90px; }        /* 25% smaller than the 120px it was */
  .subject-icon img { max-height: 90px; }
  .subject-name { font-size: var(--fs-body); }

  .fit-item img { width: 90px; height: 90px; }
  .fit-item span { font-size: var(--fs-body); }

  .life-lede, .life-text { font-size: var(--fs-body); }

  .gallery-track { --per: 1; }
  .gallery-inner { gap: 8px; padding-inline: 12px; }
  .arrow, .arrow img { width: 36px; height: 36px; }

  .voices-filter { gap: 12px; }
  /* Title starts on the solid fill, just below the wave. */
  section.join { padding-top: calc(var(--join-fill) + 24px); }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
