/* ============================================================
   ULYOP — Tomchei Tmimim Ocean Parkway
   Homepage stylesheet — v4 (corrective pass)

   Root-cause fixes carried here:
   A1  every line mask reserves descender space
   A2  the pinned section's height contract and sticky ancestry
   A3  one shaped scrim utility for all text-over-image
   A4  one photographic grade plus a single warm correction
   ============================================================ */

@layer reset, tokens, base, layout, components, sections, motion, responsive, a11y;

/* ============================================================
   RESET
   ============================================================ */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body, h1, h2, h3, h4, p, figure, blockquote, ul, ol, address { margin: 0; }
  ul, ol { padding: 0; list-style: none; }
  img, svg { display: block; max-width: 100%; height: auto; }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
  cite { font-style: normal; }
  [hidden] { display: none !important; }
}

/* ============================================================
   TOKENS
   ============================================================ */
@layer tokens {
  :root {
    --surface-1: oklch(97.5% 0.008 85);   /* ivory      */
    --surface-2: oklch(95.2% 0.016 78);   /* parchment  */
    --surface-3: oklch(93.5% 0.030 74);   /* warm sand — the preschool act */
    --ink-deep:  oklch(21%   0.035 255);  /* navy — used by BOTH dark sections */
    --ink:        oklch(24% 0.03 258);
    --ink-soft:   oklch(38% 0.028 258);
    --muted:      oklch(46% 0.022 258);   /* darkened for 4.5:1 on ivory */
    --on-dark:        oklch(96% 0.010 85);
    --on-dark-muted:  oklch(80% 0.018 82);/* lifted for 4.5:1 on navy */
    --accent:     oklch(62% 0.115 62);    /* brass, lifted for dark grounds */
    --accent-ink: oklch(52% 0.11 62);     /* brass for light grounds */
    --line:       oklch(86% 0.018 76);
    --line-dark:  oklch(100% 0 0 / 0.18);

    --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
    --font-text: 'Karla', 'Segoe UI', -apple-system, sans-serif;

    --fs-display: clamp(3.25rem, 8.5vw, 9.5rem);
    --fs-h1:      clamp(2.5rem,  5vw, 4.5rem);
    --fs-h2:      clamp(2rem,    3.6vw, 3.2rem);
    --fs-lead:    clamp(1.15rem, 1.5vw, 1.35rem);
    --fs-body:    1.0625rem;
    --fs-meta:    0.8125rem;

    --dur-fast: 240ms;
    --dur-base: 480ms;
    --dur-slow: 800ms;
    --dur-cinema: 1200ms;
    --dur-epic: 1800ms;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.30, 1);
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);

    --gutter: clamp(1.25rem, 4vw, 4.5rem);
    --maxw: 1440px;
    --nav-h: 88px;
  }
}

/* ============================================================
   BASE
   ============================================================ */
@layer base {
  /* A2 — position:sticky dies if an ancestor scroll-clips. `overflow-x:hidden`
     on <body> was the cause; `clip` on <body> alone contains stray width
     without creating a scroll container. Nothing on <html>, nothing on a
     section that wraps a sticky child. */
  html { scroll-behavior: smooth; }
  body { overflow-x: clip; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

  body {
    background: var(--surface-1);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: var(--fs-body);
    line-height: 1.65;
    scroll-padding-top: var(--nav-h);
  }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--ink);
    text-wrap: balance;
    overflow-wrap: break-word;
  }
  /* B2 — one body measure everywhere. */
  p { text-wrap: pretty; overflow-wrap: break-word; max-width: 60ch; }

  .skip-link {
    position: fixed; top: -100%; left: 1rem; z-index: 999;
    background: var(--ink); color: var(--surface-1);
    padding: 0.9em 1.4em; border-radius: 3px;
    transition: top var(--dur-fast) var(--ease-out-quint);
  }
  .skip-link:focus { top: 1rem; }

  /* B1 — eyebrows survive only in the pillars, the wall and admissions. */
  .eyebrow {
    font-family: var(--font-text);
    font-size: var(--fs-meta); font-weight: 600; letter-spacing: 0.06em;
    color: var(--muted); margin-bottom: 1.4em;
  }
  .eyebrow--light { color: var(--on-dark-muted); }

  /* A4 — one grade for the whole page. */
  .photo img { filter: saturate(0.94) contrast(1.05) brightness(1.02); }
  /* The only correction: outdoor/architectural frames run blue, so they get
     a touch of warmth to sit with the classroom photography. */
  .photo--cool img { filter: saturate(0.94) contrast(1.05) brightness(1.02) sepia(0.06); }

  /* A3 — shaped scrim, weighted bottom-left where the type sits.
     The stops are set from the worst case: assume a pure-white photograph
     behind the type and require the composite to still clear 3:1 for display
     and 4.5:1 for body. That puts ~0.44 combined alpha at the top of a
     three-line display headline and ~0.79 where the supporting line sits,
     while the upper-right of the frame stays open. */
  .media-scrim::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
      linear-gradient(to top,
        rgba(8,12,22,.90) 0%, rgba(8,12,22,.80) 25%, rgba(8,12,22,.62) 50%,
        rgba(8,12,22,.42) 72%, transparent 92%),
      linear-gradient(to right, rgba(8,12,22,.62) 0%, transparent 52%);
  }
  /* Where type also sits high in the frame (the pillars' section label) or is
     vertically centred (the closing line), the shaped gradient alone leaves
     the top open. A flat base layer lifts those cases over threshold. */
  .media-scrim--deep::before {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: rgba(8,12,22,.20);
  }
}

/* ============================================================
   LAYOUT — B3, one named-line grid used by every section
   ============================================================ */
@layer layout {
  section { position: relative; }

  /* Repeated line name `col`, so `grid-column: col 6 / span 5` places any
     block on the same edge in every section. Asymmetry comes from choosing
     different columns per section, never from items drifting. */
  .grid12 {
    display: grid;
    grid-template-columns: repeat(12, [col] minmax(0, 1fr));
    column-gap: clamp(1rem, 1.6vw, 1.5rem);
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--gutter);
    width: 100%;
  }
}

/* ============================================================
   COMPONENTS
   ============================================================ */
@layer components {
  .btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 1.05rem 2.4rem;
    font-size: 0.95rem; font-weight: 600;
    border-radius: 2px;
    transition: background var(--dur-fast) var(--ease-out-quint),
                color var(--dur-fast) var(--ease-out-quint);
  }
  .btn--fill { background: var(--ink); color: var(--surface-1); }
  .btn--fill:hover, .btn--fill:focus-visible { background: var(--accent-ink); }
  .btn--fill-light { background: var(--surface-1); color: var(--ink); }
  .btn--fill-light:hover, .btn--fill-light:focus-visible { background: var(--accent); color: var(--surface-1); }
  .btn--underline {
    padding: 1.05rem 0.25rem; color: inherit;
    border-bottom: 1px solid currentColor; border-radius: 0;
  }
  .btn--underline:hover, .btn--underline:focus-visible { color: var(--accent); }

  /* The rule matches the link's own width — inline-block, not block. */
  .link-underline {
    display: inline-block; width: fit-content;
    font-weight: 600; font-size: 0.95rem;
    color: var(--accent-ink);
    border-bottom: 1px solid color-mix(in oklch, var(--accent-ink) 45%, transparent);
    padding-bottom: 2px;
    transition: border-color var(--dur-fast);
  }
  .link-underline:hover { border-bottom-color: var(--accent-ink); }
  .link-underline--light {
    color: var(--accent);
    border-bottom-color: color-mix(in oklch, var(--accent) 55%, transparent);
  }

  /* C2/C11 — hang the opening quote mark so the first letter aligns to the
     grid rather than the punctuation. */
  .pullquote { hanging-punctuation: first; }
  @supports not (hanging-punctuation: first) {
    .pullquote { text-indent: -0.42em; }
  }

  /* ---- A1: masked line reveal, with descender reserve ----
     The mask height comes from line-height. Display serif at line-height
     below 1 puts g/y/p/j and the full stop outside the line box, so the
     mask clips them. The padding reserves that space; the equal negative
     margin removes the gap it would otherwise add between lines. */
  .split-line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.18em;
    margin-bottom: -0.18em;
  }
  .split-line__inner {
    display: block; transform: translateY(105%);
    transition: transform var(--dur-cinema) var(--ease-out-expo);
  }
  .is-revealed .split-line__inner { transform: translateY(0); }

  .split-word {
    display: inline-block; opacity: 0; transform: translateY(0.35em);
    transition: opacity var(--dur-slow) var(--ease-out-quint),
                transform var(--dur-slow) var(--ease-out-quint);
  }
  .is-revealed .split-word { opacity: 1; transform: translateY(0); }

  [data-reveal-image] { overflow: hidden; }
  .js [data-reveal-image] img {
    clip-path: inset(0 0 0 0); transform: scale(1);
    transition: clip-path var(--dur-epic) var(--ease-out-expo),
                transform var(--dur-epic) var(--ease-out-expo);
  }
  .js [data-reveal-image]:not(.is-revealed) img { clip-path: inset(0 0 100% 0); transform: scale(1.08); }

  .img-fallback img { display: none; }
  .img-fallback {
    display: grid; place-items: center; min-height: 320px;
    background:
      repeating-linear-gradient(135deg, transparent 0 22px, rgba(0,0,0,.06) 22px 23px),
      var(--surface-2);
  }
  .img-fallback::after {
    content: 'ULYOP'; font-family: var(--font-display); font-style: italic;
    font-size: var(--fs-h2); color: rgba(0,0,0,.35);
  }
}

/* ============================================================
   SECTIONS
   ============================================================ */
@layer sections {

  /* ---------- 00 NAV ---------- */
  .site-nav {
    position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 300;
    padding-block: 1.5rem;
    transition: padding var(--dur-base) var(--ease-out-quint),
                background var(--dur-base) var(--ease-out-quint),
                backdrop-filter var(--dur-base) var(--ease-out-quint),
                transform var(--dur-base) var(--ease-out-quint);
  }
  .site-nav[data-state="scrolled"] {
    padding-block: 0.8rem;
    background: color-mix(in oklch, var(--surface-1) 85%, transparent);
    backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 1px 0 var(--line);
  }
  .site-nav[data-state="hidden"] { transform: translateY(-100%); }

  /* Three tracks so the menu is centred on the header itself, not pushed
     around by the logo and action widths. */
  .nav-inner {
    max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter);
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.5rem;
  }
  .nav-logo { display: flex; align-items: center; justify-self: start; }
  .nav-logo__img {
    height: 52px; width: auto;
    transition: height var(--dur-base) var(--ease-out-quint);
  }
  .site-nav[data-state="scrolled"] .nav-logo__img { height: 42px; }
  .nav-links { display: none; justify-self: center; gap: 2rem; align-items: center; }
  .nav-links a {
    position: relative; font-size: 0.9375rem; letter-spacing: 0.01em;
    font-weight: 500; color: var(--surface-1); padding-block: 0.35em;
    text-shadow: 0 1px 12px rgba(8,12,22,.55);
  }
  .nav-links a::after {
    content: ''; position: absolute; left: 0; right: 100%; bottom: 0;
    height: 1.5px; background: var(--accent);
    transition: right var(--dur-base) var(--ease-out-quint);
  }
  .nav-links a:hover::after, .nav-links a.is-active::after { right: 0; }
  .site-nav[data-state="scrolled"] .nav-links a { color: var(--ink); text-shadow: none; }

  .nav-actions { display: flex; align-items: center; gap: 1.25rem; justify-self: end; }
  .nav-visit {
    display: none; font-size: 0.9375rem; font-weight: 500; color: var(--surface-1);
    text-shadow: 0 1px 12px rgba(8,12,22,.55);
  }
  .site-nav[data-state="scrolled"] .nav-visit { color: var(--ink); text-shadow: none; }
  .nav-apply {
    padding: 0.72rem 1.6rem; font-size: 0.9375rem; font-weight: 600;
    background: var(--surface-1); color: var(--ink); border-radius: 2px;
    transition: background var(--dur-fast), color var(--dur-fast);
  }
  .nav-apply:hover, .nav-apply:focus-visible { background: var(--accent-ink); color: var(--surface-1); }

  .nav-toggle { display: grid; gap: 5px; width: 28px; }
  .nav-toggle span {
    display: block; height: 2px; background: var(--surface-1);
    transition: transform var(--dur-fast) var(--ease-out-quint), opacity var(--dur-fast);
  }
  .site-nav[data-state="scrolled"] .nav-toggle span { background: var(--ink); }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
  #navProgressBar { display: block; height: 100%; width: 0; background: var(--accent); transform-origin: left; }

  .mobile-menu {
    position: fixed; inset: 0; z-index: 290;
    background: var(--ink-deep);
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 6rem var(--gutter) 3rem;
    transform: translateX(100%); visibility: hidden;
    transition: transform var(--dur-slow) var(--ease-in-out-quart), visibility 0s linear var(--dur-slow);
  }
  .mobile-menu.is-open {
    transform: translateX(0); visibility: visible;
    transition: transform var(--dur-slow) var(--ease-in-out-quart), visibility 0s;
  }
  .mobile-menu__nav { display: flex; flex-direction: column; }
  .mobile-menu__nav a {
    font-family: var(--font-display); font-size: clamp(2rem, 8vw, 3rem);
    color: var(--on-dark); padding-block: 0.28em;
  }
  .mobile-menu__footer { display: flex; flex-direction: column; gap: 0.4rem; color: var(--on-dark-muted); }
  .mobile-menu__footer a { font-weight: 600; }

  /* ---------- 01 HERO — C1 ---------- */
  .hero {
    position: relative; min-height: 100dvh;
    display: grid; align-items: end;
    overflow: hidden; isolation: isolate;
    color: var(--surface-1);
    padding-top: var(--nav-h);
  }
  .hero__media { position: absolute; inset: 0; z-index: 0; }
  .hero__img {
    width: 100%; height: 100%; object-fit: cover;
    object-position: 64% 34%;
  }
  .hero__content {
    position: relative; z-index: 2;
    padding-bottom: 10vh;
  }
  .hero__headline {
    grid-column: col 1 / span 12;
    font-size: var(--fs-display); line-height: 0.94; letter-spacing: -0.035em;
    color: var(--surface-1);
    margin-bottom: 0.34em;
  }
  .hero__sub {
    grid-column: col 1 / span 12;
    font-size: 1.25rem; line-height: 1.5; max-width: 46ch;
    color: color-mix(in oklch, var(--surface-1) 92%, transparent);
    margin-bottom: 2.2rem;
  }
  .hero__actions { grid-column: col 1 / span 12; display: flex; gap: 1.75rem; align-items: center; flex-wrap: wrap; }

  /* ---------- 02 THE REBBE'S WORDS ----------
     A ruled band rather than text floating in a field: hairlines close the
     block top and bottom, an oversized brass quotation mark hangs in the
     margin, and the attribution is set against the quote's own right edge. */
  .breath {
    display: grid; align-content: center; gap: clamp(2.5rem, 6vh, 5rem);
    padding-block: clamp(5rem, 12vh, 9rem);
    background: var(--surface-1);
  }
  .breath__rule {
    height: 1px; background: var(--line);
    max-width: var(--maxw); width: 100%; margin-inline: auto;
  }
  .breath__quote { position: relative; align-items: start; }
  .breath__mark {
    grid-column: col 1 / span 2; grid-row: 1;
    font-family: var(--font-display); font-style: italic; font-weight: 400;
    font-size: clamp(6rem, 13vw, 15rem); line-height: 0.7;
    color: var(--accent-ink); opacity: 0.42;
    justify-self: start;
    /* Sits slightly outside the text column so the quote's first letter,
       not the punctuation, aligns to the grid. */
    margin-top: -0.06em; margin-left: -0.06em;
    pointer-events: none;
  }
  .breath__text {
    grid-column: col 3 / span 9; grid-row: 1;
    font-family: var(--font-display); font-style: italic; font-weight: 400;
    font-size: clamp(2rem, 4.4vw, 4.2rem); line-height: 1.14; letter-spacing: -0.022em;
    color: var(--ink); max-width: none;
  }
  .breath__attr {
    grid-column: col 3 / span 9; grid-row: 2;
    justify-self: end; text-align: right;
    margin-top: 2rem; padding-top: 1rem;
    border-top: 2px solid var(--accent-ink);
    font-size: 1.05rem; font-weight: 700; color: var(--ink);
  }
  .breath__attr span {
    display: block; font-size: 0.8125rem; font-weight: 500;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 0.2em;
  }

  /* ---------- 03 PILLARS — A2 height contract ---------- */
  .pillars { height: 400vh; position: relative; background: var(--ink-deep); }
  .pillars__viewport {
    position: sticky; top: 0; height: 100vh;
    overflow: hidden; isolation: isolate;
  }
  .pillars__media { position: absolute; inset: 0; z-index: 0; }
  .pillar { position: absolute; inset: 0; opacity: 0; }
  .pillar.is-active { opacity: 1; }
  .js .pillar { transition: opacity var(--dur-cinema) var(--ease-out-quint); }
  .pillar__img {
    width: 100%; height: 100%; object-fit: cover;
    filter: saturate(0.94) contrast(1.05) brightness(1.02);
    transform: scale(1.08);
  }
  .js .pillar__img { transition: transform var(--dur-cinema) var(--ease-out-expo); }
  .pillar.is-active .pillar__img { transform: scale(1); }
  .pillar.is-leaving .pillar__img { transform: scale(1.04); }

  /* Reads as a live section marker, not stray small text: brass rule, brass
     label, on its own darkened plate so it holds over any frame. */
  .pillars__eyebrow {
    position: absolute; z-index: 3;
    top: calc(var(--nav-h) + 2vh); left: var(--gutter);
    display: flex; align-items: center; gap: 0.75rem;
    font-family: var(--font-text);
    font-size: var(--fs-meta); font-weight: 700; letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
  }
  .pillars__eyebrow::before {
    content: ''; width: 2.5rem; height: 2px; background: var(--accent);
  }

  /* Title and body together, bottom-left, clear of the bottom edge. */
  .pillars__copy {
    position: absolute; z-index: 3;
    left: var(--gutter); right: var(--gutter); bottom: 14vh;
    max-width: var(--maxw); margin-inline: auto;
  }
  /* No max-width here — a ch-based cap on the slot was squeezing the display
     title into a narrow column and breaking it mid-word. The body carries its
     own measure instead. */
  .pillars__slot { max-width: none; }
  .pillars__title {
    font-size: clamp(2.6rem, 5.6vw, 6rem); line-height: 0.98; letter-spacing: -0.035em;
    color: var(--surface-1); max-width: 15ch;
    margin-bottom: 1rem;
    /* Display type must never hyphenate or break inside a word. */
    overflow-wrap: normal; word-break: normal; hyphens: none;
    text-wrap: balance;
  }
  .pillars__body {
    font-size: var(--fs-body); line-height: 1.6; max-width: 44ch;
    color: var(--on-dark);
  }

  /* Continuous progress bar, moved inboard off the viewport edge. */
  .pillars__rail {
    position: absolute; z-index: 3; right: 4vw; top: 50%; translate: 0 -50%;
    display: flex; align-items: stretch; gap: 0.9rem; height: 12rem;
  }
  .pillars__bar { width: 2px; background: rgba(255,255,255,.28); position: relative; }
  #pillarsBarFill {
    display: block; position: absolute; inset: 0 0 auto 0;
    background: var(--accent); height: 0;
  }
  .js #pillarsBarFill { transition: height 120ms linear; }
  .pillars__nums { display: flex; flex-direction: column; justify-content: space-between; }
  .pillars__nums li {
    font-size: 0.875rem; font-weight: 600; color: rgba(255,255,255,.55);
    transition: color var(--dur-base);
  }
  .pillars__nums li.is-active { color: var(--surface-1); }

  /* ---------- 04 THE WHOLE CHILD — C4 ---------- */
  .child {
    background: var(--surface-2);
    padding-block: 14vh;
  }
  .child__inner { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
  .child__headline {
    font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.03em;
    margin-bottom: 4vh; max-width: 16ch;
  }

  .child__stage {
    position: relative;
    width: 100%; max-width: 1120px;
    height: min(72vh, 680px);
    margin-inline: auto;
  }
  .child__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .child__lines line {
    stroke: rgba(40,48,80,.32); stroke-width: 1.25;
    transition: stroke var(--dur-fast), stroke-width var(--dur-fast);
  }
  .child__lines line.is-lit { stroke: var(--accent-ink); stroke-width: 2.25; }
  .js .child__stage:not(.is-visible) .child__lines line { stroke-dashoffset: var(--len, 200); }
  .child__lines line {
    stroke-dasharray: var(--len, 200); stroke-dashoffset: 0;
    transition: stroke-dashoffset 900ms var(--ease-out-quint), stroke var(--dur-fast), stroke-width var(--dur-fast);
  }

  .child__photo {
    position: absolute; left: 50%; top: 50%; translate: -50% -50%;
    width: min(34%, 300px); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
    box-shadow: 0 0 0 1px var(--line);
  }
  .child__photo img { width: 100%; height: 100%; object-fit: cover; }

  .child__node {
    position: absolute; top: var(--y); translate: 0 -50%;
    font-family: var(--font-display); font-size: 1.75rem; font-weight: 500;
    line-height: 1.15; letter-spacing: -0.02em;
    color: var(--ink); opacity: 0.55;
    max-width: 28%;
    transition: opacity var(--dur-fast);
  }
  .child__node--l { left: 0; text-align: right; }
  .child__node--r { right: 0; text-align: left; }
  .child__node:hover, .child__node:focus-visible, .child__node.is-active { opacity: 1; }
  .child__stage.has-active .child__node:not(.is-active) { opacity: 0.22; }

  .child__slot {
    max-width: 60ch; margin: 4vh auto 0; text-align: center;
    font-size: var(--fs-lead); color: var(--ink-soft); min-height: 4.2em;
  }
  .child__sequence { display: none; }

  /* ---------- 05 WHY ULYOP — C5 ---------- */
  .why { background: var(--surface-1); padding-block: 14vh; }
  .why__headline {
    font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: 1.03; letter-spacing: -0.03em;
    margin-bottom: 6vh;
  }
  .why__headline > .split-line, .why__headline { grid-column: col 1 / span 9; }

  .why__entry { position: relative; padding-block: 6vh; row-gap: 2.5rem; }
  .why__rule {
    position: absolute; top: 0; left: var(--gutter); right: var(--gutter);
    height: 1px; background: var(--line); transform-origin: left;
  }
  .js .why__rule { background: var(--accent-ink); }
  .js .why__rule:not(.is-drawn) { transform: scaleX(0); }
  .js .why__rule { transition: transform var(--dur-slow) var(--ease-out-quint); }

  .why__photo { grid-column: col 1 / span 5; height: 40vh; min-height: 260px; }
  .why__photo img { width: 100%; height: 100%; object-fit: cover; }
  /* B3 — heading and body always begin on the same line. */
  .why__text { grid-column: col 6 / span 5; align-self: center; }
  .why__label {
    font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.05; letter-spacing: -0.025em;
    margin-bottom: 0.5em;
  }
  .why__body { font-size: var(--fs-body); color: var(--ink-soft); max-width: 54ch; }

  /* Alternate sides; the text edge stays constant within each variant. */
  .why__entry--flip .why__photo { grid-column: col 8 / span 5; grid-row: 1; }
  .why__entry--flip .why__text { grid-column: col 1 / span 6; grid-row: 1; }

  /* ---------- 06 ROOTED IN TORAH — C6 ---------- */
  .torah {
    position: relative; background: var(--ink-deep);
    min-height: 92vh;
    display: grid; grid-template-columns: 1fr; align-items: center;
    padding-block: 8vh;
  }
  /* The source frame is already tight, so it is shown whole rather than
     cropped further — navy above and below is the breathing room. */
  .torah__photo { grid-area: 1 / 1; align-self: center; }
  .torah__photo img { width: 100%; height: auto; }
  /* position + z-index are load-bearing: the panel overlaps the photograph,
     and without its own stacking position any transform on the image would
     paint the image above this text. */
  .torah__panel {
    grid-area: 1 / 1;
    position: relative; z-index: 2;
    background: var(--ink-deep); color: var(--on-dark);
    padding: clamp(2rem, 5vw, 4rem);
    align-self: end;
  }
  .torah__headline { color: var(--surface-1); font-size: var(--fs-h2); margin-bottom: 0.7em; }
  .torah__panel p { color: var(--on-dark-muted); max-width: 52ch; line-height: 1.7; margin-bottom: 1.1em; }

  /* ---------- 07 SKILLS WORD FIELD — C7 ---------- */
  .field { background: var(--surface-2); padding-block: 16vh; overflow: hidden; }
  .field__inner { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
  /* The headline frames the field from outside it. */
  .field__headline {
    font-family: var(--font-display); font-style: italic; font-weight: 400;
    font-size: clamp(1.75rem, 3vw, 2.75rem); line-height: 1.15; letter-spacing: -0.02em;
    color: var(--ink); max-width: 24ch;
    margin-bottom: 8vh;
  }
  .field__terms {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: clamp(1rem, 1.6vw, 1.5rem);
  }
  /* No rule per term — a grid of part-width hairlines read as broken lines.
     Structure comes from the size tiers and the staggered column starts; a
     single rule above the whole field separates it from the headline. */
  .field__terms { border-top: 1px solid var(--line); padding-top: clamp(2rem, 4vh, 3rem); }
  .field__item {
    grid-column: var(--s) / span var(--n);
    padding-block: 0.18em;
    font-family: var(--font-text); font-weight: 500;
    line-height: 1.1; letter-spacing: -0.02em;
    color: var(--ink); opacity: 0.5;
    transition: opacity var(--dur-fast) var(--ease-out-quint);
  }
  .field__item--lg { font-size: clamp(2rem, 3.6vw, 3.4rem); }
  .field__item--md { font-size: clamp(1.6rem, 2.6vw, 2.4rem); }
  .field__item--sm { font-size: clamp(1.25rem, 1.9vw, 1.7rem); }
  @media (hover: hover) and (pointer: fine) {
    .field__terms:hover .field__item { opacity: 0.2; }
    .field__terms .field__item:hover { opacity: 1; }
  }

  /* ---------- 08 PRESCHOOL — C8 ---------- */
  .care {
    position: relative; background: var(--surface-3);
    padding-block: 14vh;
    display: grid; grid-template-columns: 1fr; gap: 3rem;
  }
  .care__media { position: relative; }
  .care__photo { height: 60vh; min-height: 320px; }
  .care__photo img { width: 100%; height: 100%; object-fit: cover; }
  /* Both preschool frames show at every width — on a phone they simply
     stack full-width with a small step. */
  .care__inset { width: 82%; aspect-ratio: 16/10; margin: 0.75rem 0 0 auto; }
  .care__inset img { width: 100%; height: 100%; object-fit: cover; }
  .care__copy { padding-inline: var(--gutter); }
  .care__headline {
    font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.03em;
    margin-bottom: 1.1em;
  }
  .care__entry { padding-block: 1.6rem; border-top: 1px solid rgba(40,48,80,.16); }
  .care__entry h3 { font-size: 1.9rem; line-height: 1.15; margin-bottom: 0.35em; }
  .care__entry p { color: var(--ink-soft); max-width: 46ch; }
  .care__copy .link-underline { margin-top: 2rem; }

  /* ---------- 09 PHOTO WALL — C9 ---------- */
  .wall {
    background: var(--ink-deep); color: var(--on-dark);
    padding-block: 14vh; overflow: hidden;
  }
  .wall__head { max-width: var(--maxw); margin: 0 auto 5vh; padding-inline: var(--gutter); }
  .wall__headline { color: var(--surface-1); font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.03em; }

  .wall__grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding-left: var(--gutter);
    grid-auto-rows: 15vw;
    grid-auto-flow: dense;
  }
  .tile { position: relative; overflow: hidden; margin: 0; }
  .tile img {
    width: 100%; height: 100%; object-fit: cover;
    transform: translate(var(--mx, 0), var(--my, 0));
  }
  .js .tile img {
    clip-path: inset(0 0 0 0);
    transition: clip-path var(--dur-cinema) var(--ease-out-expo),
                transform var(--dur-slow) var(--ease-out-quint);
  }
  .js .wall__grid:not(.is-visible) .tile[data-wipe="up"] img { clip-path: inset(100% 0 0 0); }
  .js .wall__grid:not(.is-visible) .tile[data-wipe="down"] img { clip-path: inset(0 0 100% 0); }

  /* Wide tiles take two rows as well — at one row they were a 3:1 letterbox
     that cropped through faces. `dense` backfills the holes this leaves. */
  .tile--tall { grid-row: span 2; }
  .tile--wide { grid-column: span 2; grid-row: span 2; }
  /* The last tile bleeds off the right edge, cropped on architecture. */
  .tile:last-child { margin-right: calc(var(--gutter) * -1); }

  .tile figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 2.4em 1rem 0.9rem;
    font-size: var(--fs-meta); font-weight: 600; color: var(--surface-1);
    background: linear-gradient(0deg, rgba(8,12,22,.85), transparent);
    clip-path: inset(100% 0 0 0);
    transition: clip-path var(--dur-base) var(--ease-out-quint);
  }
  @media (hover: hover) and (pointer: fine) {
    .wall__grid:hover .tile { opacity: 0.5; transition: opacity var(--dur-fast); }
    .wall__grid .tile:hover { opacity: 1; }
    .tile:hover img { transform: scale(1.03); }
    .tile:hover figcaption { clip-path: inset(0 0 0 0); }
  }
  .tile:focus-within figcaption { clip-path: inset(0 0 0 0); }

  /* ---------- 10 TEACHERS — C10 ---------- */
  .teachers { background: var(--surface-1); padding-block: 14vh; }
  .teachers__head { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
  /* C10 — clear space; the track never overlaps the headline. */
  /* 7vh, because the last line mask carries a -0.18em margin of its own. */
  .teachers__headline {
    font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.03em;
    max-width: 18ch; margin-bottom: 7vh;
  }
  .teachers__track-wrap { position: relative; }
  .teachers__track {
    display: flex; gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    padding-inline: 6vw;
    scroll-padding-inline: 6vw;
  }
  .teachers__track::-webkit-scrollbar { display: none; }
  .teachers__track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
  .teachers__card { flex: 0 0 min(26vw, 380px); scroll-snap-align: start; }
  .teachers__portrait {
    aspect-ratio: 3 / 4; overflow: hidden; margin-bottom: 1rem;
    transition: transform var(--dur-base) var(--ease-out-quint);
  }
  /* C10 — one shared grade pulls the mismatched studio backdrops together. */
  .teachers__portrait img {
    width: 100%; height: 100%; object-fit: cover;
    object-position: 50% 38%;
    filter: grayscale(0.15) contrast(1.08) brightness(1.02);
    transition: filter var(--dur-base) var(--ease-out-quint);
  }
  .teachers__card:hover .teachers__portrait { transform: scale(1.02); }
  .teachers__card:hover .teachers__portrait img { filter: grayscale(0) contrast(1.08) brightness(1.04); }
  /* Names are always visible, never hover-revealed. */
  .teachers__card h3 { font-size: 1.35rem; line-height: 1.2; margin-bottom: 0.15em; }
  .teachers__card p { font-size: var(--fs-meta); font-weight: 600; color: var(--accent-ink); letter-spacing: 0.04em; }

  .teachers__arrow {
    position: absolute; top: 34%; z-index: 4;
    width: 48px; height: 48px; border-radius: 50%;
    display: grid; place-items: center; font-size: 1.4rem;
    background: color-mix(in oklch, var(--surface-1) 88%, transparent);
    border: 1px solid var(--line);
    backdrop-filter: blur(6px);
    transition: background var(--dur-fast), color var(--dur-fast);
  }
  .teachers__arrow:hover { background: var(--ink); color: var(--surface-1); }
  .teachers__arrow--prev { left: calc(var(--gutter) / 2); }
  .teachers__arrow--next { right: calc(var(--gutter) / 2); }
  .teachers__foot { max-width: var(--maxw); margin: 4vh auto 0; padding-inline: var(--gutter); }

  /* ---------- 11 TESTIMONIAL — C11 ---------- */
  .says {
    position: relative; overflow: hidden;
    background: var(--surface-2);
    min-height: 82vh; display: grid; align-content: center;
    padding-block: 10vh;
  }
  .says__head { margin-bottom: 4vh; }
  .says__headline {
    grid-column: col 1 / span 8;
    font-size: var(--fs-h2); line-height: 1.05; letter-spacing: -0.025em;
  }
  /* A photograph anchors the block and takes the space the quote was leaving
     empty on the right. */
  .says__photo {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: min(30vw, 420px); margin: 0; overflow: hidden;
  }
  .says__photo img { width: 100%; height: 100%; object-fit: cover; }
  .says__stage { position: relative; }
  .says__quote {
    grid-column: col 1 / span 8; grid-row: 1;
    opacity: 0; transform: translateY(20px); pointer-events: none;
    transition: opacity var(--dur-slow) var(--ease-out-quint), transform var(--dur-slow) var(--ease-out-quint);
  }
  .says__quote.is-active { opacity: 1; transform: translateY(0); pointer-events: auto; }
  /* Size set by character count in JS so a long quote never overflows. */
  .says__quote p {
    font-family: var(--font-display); font-weight: 400;
    line-height: 1.16; letter-spacing: -0.022em;
    color: var(--ink); max-width: none;
    font-size: clamp(1.75rem, 3vw, 2.75rem);
  }
  .says__quote--short p { font-size: clamp(2.25rem, 4.4vw, 4rem); }
  .says__quote--mid   p { font-size: clamp(1.75rem, 3vw, 2.75rem); }
  .says__quote--long  p { font-size: clamp(1.5rem, 2.4vw, 2.25rem); }
  /* Attribution reads as an attribution: a brass rule, a quiet lead-in, then
     the identifying detail in full ink. */
  .says__quote cite {
    display: block; margin-top: 2rem; padding-top: 1.1rem;
    border-top: 2px solid var(--accent-ink);
    width: fit-content;
    font-size: 1rem; font-weight: 700; color: var(--ink);
  }
  .says__quote cite span {
    display: block; font-weight: 500; font-size: 0.875rem;
    color: var(--muted); margin-bottom: 0.15em;
  }
  .says__controls {
    grid-column: col 1 / span 8; grid-row: 2;
    display: flex; align-items: center; gap: 1.4rem; margin-top: 4vh;
  }
  .says__controls > button {
    width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); font-size: 1.2rem;
    transition: background var(--dur-fast), color var(--dur-fast);
  }
  .says__controls > button:hover { background: var(--ink); color: var(--surface-1); }
  .says__dots { display: flex; gap: 0.5rem; }
  .says__dots button { width: 9px; height: 9px; border-radius: 50%; background: var(--line); transition: background var(--dur-fast), transform var(--dur-fast); }
  .says__dots button[aria-current="true"] { background: var(--accent-ink); transform: scale(1.35); }

  /* ---------- 12 FACILITY — C12 ---------- */
  .facility {
    position: relative; height: 92vh; min-height: 560px;
    display: grid; align-items: end;
    overflow: hidden; isolation: isolate; color: var(--surface-1);
  }
  .facility__media { position: absolute; inset: 0; z-index: 0; }
  .facility__media img { width: 100%; height: 100%; object-fit: cover; }
  /* C12 — the headline's own baseline lands ~18vh from the bottom; the body
     and link sit beneath it, so the block itself is anchored lower. */
  .facility__copy { position: relative; z-index: 2; padding-bottom: 6vh; }
  .facility__headline {
    grid-column: col 1 / span 8;
    font-size: var(--fs-display); line-height: 0.94; letter-spacing: -0.035em;
    color: var(--surface-1); margin-bottom: 1.2rem;
  }
  .facility__body {
    grid-column: col 1 / span 6;
    font-size: var(--fs-body); max-width: 48ch; margin-bottom: 1.2rem;
    color: color-mix(in oklch, var(--surface-1) 92%, transparent);
  }
  .facility__copy .link-underline { grid-column: col 1 / span 6; }

  /* ---------- 13 REGISTRATION ---------- */
  .apply { background: var(--surface-1); padding-block: 14vh; padding-inline: var(--gutter); }
  .apply__head { max-width: var(--maxw); margin-inline: auto; }
  .apply__headline { font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.03em; max-width: 20ch; }
  .apply__sub { font-size: var(--fs-lead); color: var(--ink-soft); max-width: 46ch; margin-top: 1rem; }
  .apply__paths {
    max-width: var(--maxw); margin: 5vh auto 0;
    display: grid; gap: 1.25rem;
  }
  .apply__path { display: block; transition: background var(--dur-fast), color var(--dur-fast); }
  .apply__path h3 { font-size: 1.9rem; line-height: 1.15; margin-bottom: 0.35em; }
  .apply__path p { color: var(--ink-soft); max-width: 40ch; }
  .apply__path--primary {
    background: var(--ink); color: var(--surface-1);
    padding: clamp(2rem, 5vw, 3.5rem);
    display: grid; align-content: center; min-height: 15rem;
  }
  .apply__path--primary h3 { color: var(--surface-1); font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.03em; }
  .apply__path--primary p { color: color-mix(in oklch, var(--surface-1) 84%, transparent); font-size: var(--fs-lead); }
  .apply__cue { display: inline-block; margin-top: 1.4rem; font-weight: 600; color: var(--accent); }
  .apply__path--primary:hover { background: var(--ink-deep); }
  .apply__minor { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
  .apply__minor .apply__path { background: var(--surface-1); padding: clamp(1.5rem, 3vw, 2.25rem); }
  .apply__minor .apply__path:hover { background: var(--surface-2); }
  .apply__minor .apply__path h3 { font-size: 1.6rem; }
  .apply__minor .apply__path p { font-size: var(--fs-body); max-width: 34ch; }

  /* ---------- 14 FINAL CTA — C13 ---------- */
  .close {
    position: relative; height: 78vh; min-height: 520px;
    display: grid; align-content: center;
    overflow: hidden; isolation: isolate;
    color: var(--on-dark);
  }
  .close__media { position: absolute; inset: 0; z-index: 0; }
  /* Lifted so the classroom reads as a photograph, not a grey field. */
  .close__media img {
    width: 100%; height: 100%; object-fit: cover;
    filter: saturate(0.94) contrast(1.06) brightness(1.12);
  }
  .close__content { position: relative; z-index: 2; }
  .close__line {
    grid-column: col 1 / span 10;
    font-family: var(--font-display); font-style: italic; font-weight: 400;
    font-size: clamp(2.75rem, 6.5vw, 7rem); line-height: 1.0; letter-spacing: -0.035em;
    color: var(--surface-1); max-width: 18ch;
  }
  .close__actions {
    grid-column: col 1 / span 10;
    margin-top: 5vh;
    display: flex; gap: 1.75rem; align-items: center; flex-wrap: wrap;
  }

  /* ---------- 15 FOOTER ---------- */
  .site-footer { background: var(--ink-deep); color: var(--surface-1); padding: 10vh var(--gutter) 2rem; }
  .site-footer__top {
    max-width: var(--maxw); margin-inline: auto;
    display: grid; gap: 3rem; padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--line-dark);
  }
  .site-footer__brand img { height: 32px; margin-bottom: 1rem; }
  .site-footer__brand p { font-family: var(--font-display); font-style: italic; color: var(--on-dark-muted); max-width: 26em; }
  .site-footer__nav { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; }
  .site-footer__nav h4, .site-footer__contact h4 { font-family: var(--font-text); font-size: var(--fs-meta); letter-spacing: 0.06em; color: var(--accent); margin-bottom: 0.9em; }
  .site-footer__nav a, .site-footer__contact a {
    display: block; padding-block: 0.32em; font-size: 0.9375rem;
    color: var(--on-dark-muted); transition: color var(--dur-fast);
  }
  .site-footer__nav a:hover, .site-footer__contact a:hover { color: var(--surface-1); }
  .site-footer__contact address { font-style: normal; color: var(--on-dark-muted); font-size: 0.9375rem; margin-bottom: 0.6em; }
  .site-footer__bottom { max-width: var(--maxw); margin-inline: auto; padding-top: 1.6rem; font-size: var(--fs-meta); color: rgba(255,255,255,.55); }
}

/* ============================================================
   MOTION
   ============================================================ */
@layer motion {
  /* content-visibility is never applied to the pinned section or anything
     above it — it would break the sticky measurement. */
  /* Not applied to .says: its height is what guarantees the quote fits the
     viewport, and an intrinsic-size placeholder muddies that measurement. */
  .apply, .site-footer { content-visibility: auto; contain-intrinsic-size: auto 800px; }

  @supports (animation-timeline: scroll()) {
    #navProgressBar {
      width: 100%; transform-origin: left;
      animation: nav-progress linear; animation-timeline: scroll(root);
    }
    @keyframes nav-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@layer responsive {

  @media (min-width: 720px) {
    .site-footer__nav { grid-template-columns: repeat(3, 1fr); }
    .apply__minor { grid-template-columns: repeat(3, 1fr); }
    .hero__headline { grid-column: col 2 / span 7; }
    .hero__sub { grid-column: col 2 / span 6; }
    .hero__actions { grid-column: col 2 / span 8; }
  }

  @media (min-width: 900px) {
    .nav-links { display: flex; }
    .nav-visit { display: inline; }
    .nav-toggle, .mobile-menu { display: none; }

    .torah { grid-template-columns: repeat(12, minmax(0,1fr)); column-gap: 1.5rem; padding-inline: var(--gutter); }
    .torah__photo { grid-area: 1 / 1 / 2 / 8; }
    /* Panel overlaps the photograph by one column. */
    .torah__panel {
      grid-area: 1 / 6 / 2 / 13;
      align-self: center;
      box-shadow: -40px 0 80px -40px rgba(0,0,0,.5);
    }
    .torah__headline { font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.03em; }

    .care {
      grid-template-columns: repeat(12, minmax(0,1fr));
      column-gap: clamp(1rem, 1.6vw, 1.5rem);
      align-items: center; gap: 0;
      padding-bottom: 0;
    }
    .care__media { grid-column: 1 / 7; margin-left: calc(var(--gutter) * -1); }
    .care__photo { height: 58vh; }
    /* Two clean frames stacked in the media column — no overlap, no drop
       shadow, nothing cut. The second photograph is inset from the left so
       the pair still steps rather than sitting as one block. */
    .care__inset {
      position: static;
      width: 62%; aspect-ratio: 16/10;
      margin: 1rem 0 0 auto;
    }
    .care__inset img { width: 100%; height: 100%; object-fit: cover; }
    /* The inset overhangs the media column by 12%; the copy's left padding
       clears that, so the small photograph sits in the channel between the
       columns instead of on top of the text. */
    .care__copy { grid-column: 7 / 12; padding-inline: 0 var(--gutter); padding-left: clamp(2rem, 4vw, 4rem); }
    .care__entry { max-width: 46ch; }

    .site-footer__top { grid-template-columns: 1.2fr 2fr 1fr; }
  }

  /* ---- tablet and below ---- */
  @media (max-width: 899px) {
    /* C3 — no sticky on mobile: four stacked full-height panels. */
    .pillars { height: auto; }
    .pillars__viewport { position: static; height: auto; }
    .pillars__media { position: static; display: block; }
    .pillar { position: relative; inset: auto; opacity: 1; height: 88vh; }
    .pillar__img { transform: none; }
    .pillar::after {
      content: ''; position: absolute; inset: 0; pointer-events: none;
      background: linear-gradient(0deg, rgba(8,12,22,.9) 0%, rgba(8,12,22,.62) 34%, rgba(8,12,22,.1) 64%, transparent 80%);
    }
    /* Each panel carries its own copy, injected by initPillars. */
    .pillars__copy, .pillars__rail, .pillars__eyebrow { display: none; }
    .pillar__panel {
      position: absolute; z-index: 2; left: var(--gutter); right: var(--gutter); bottom: 6vh;
    }
    .pillar__panel .pillars__title { font-size: clamp(2.4rem, 8vw, 3.6rem); max-width: 12ch; }
    .pillar__panel .pillars__body { font-size: var(--fs-body); max-width: 40ch; }
    .media-scrim.pillars__viewport::after { display: none; }

    .child__stage, .child__slot { display: none; }
    .child__sequence { display: block; margin-top: 4vh; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
    .child__sequence li { padding-block: 1.6rem; border-top: 1px solid rgba(40,48,80,.16); }
    .child__sequence h3 { font-size: 2rem; line-height: 1.15; margin-bottom: 0.25em; }
    .child__sequence p { color: var(--ink-soft); max-width: 46ch; }

    .why__photo, .why__text,
    .why__entry--flip .why__photo, .why__entry--flip .why__text { grid-column: col 1 / span 12; grid-row: auto; }
    .why__photo { height: 34vh; }

    .breath__text, .breath__attr { grid-column: col 1 / span 12; }
    .breath__mark { grid-column: col 1 / span 3; font-size: clamp(4rem, 18vw, 7rem); }
    .breath__attr { justify-self: start; text-align: left; }
    .says__quote, .says__controls, .says__headline { grid-column: col 1 / span 12; }
    .says__photo { position: relative; width: 100%; height: 34vh; margin-bottom: 4vh; inset: auto; }
    .facility__headline, .facility__body, .facility__copy .link-underline { grid-column: col 1 / span 12; }
    .facility__copy { padding-bottom: 10vh; }
    .close__line, .close__actions { grid-column: col 1 / span 12; }
    .hero__headline, .hero__sub, .hero__actions { grid-column: col 1 / span 12; }

    .wall__grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 32vw; }
  }

  /* ---- phone ---- */
  @media (max-width: 700px) {
    .wall__grid {
      display: flex; grid-template-columns: none; grid-auto-rows: auto;
      overflow-x: auto; scroll-snap-type: x mandatory;
      padding-right: var(--gutter); scroll-padding-inline: var(--gutter);
      scrollbar-width: none; overscroll-behavior-x: contain;
    }
    .wall__grid::-webkit-scrollbar { display: none; }
    .tile { flex: 0 0 78vw; aspect-ratio: 4/5; scroll-snap-align: center; margin-right: 0 !important; grid-row: auto; grid-column: auto; }
    .tile figcaption { clip-path: inset(0 0 0 0); }

    .teachers__card { flex: 0 0 72vw; }
    .teachers__arrow { display: none; }
    .teachers__track { padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }

    /* The logo is set large on desktop; on a phone it has to leave room for
       the Apply button and the menu toggle, which it otherwise pushes off
       the right edge. */
    .nav-inner { gap: 1rem; }
    .nav-logo__img { height: 34px; }
    .site-nav[data-state="scrolled"] .nav-logo__img { height: 30px; }
    .nav-actions { gap: 0.85rem; }
    .nav-apply { padding: 0.6rem 1.1rem; font-size: 0.875rem; }

    .btn { padding: 1rem 1.9rem; }
    .btn--underline { padding: 1rem 0.25rem; }
    .hero__actions, .close__actions { gap: 1.25rem; }
    .apply__path--primary { min-height: 12rem; }

    /* A portrait viewport needs a straight bottom-up scrim, not a wedge. */
    .media-scrim::after {
      background: linear-gradient(to top,
        rgba(8,12,22,.9) 0%, rgba(8,12,22,.72) 38%, rgba(8,12,22,.42) 66%, rgba(8,12,22,.26) 100%);
    }
  }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
@layer a11y {
  :focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 1px; }
  .wall :focus-visible, .facility :focus-visible, .close :focus-visible,
  .pillars :focus-visible, .site-footer :focus-visible, .mobile-menu :focus-visible {
    outline-color: var(--accent);
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
      scroll-behavior: auto !important;
    }
  }
  /* `transition: none`, not a 0ms duration: shortening a duration does not
     cancel a transition already in flight, so an entrance caught mid-way
     when the probe fires would stay frozen. */
  :where(.no-anim) *, :where(.no-anim) *::before, :where(.no-anim) *::after {
    transition: none !important;
    animation-duration: 0.001ms !important;
  }

  @media (prefers-reduced-motion: reduce) {
    .split-line__inner, .split-word, .tile img, .field__item,
    [data-reveal-image] img, .pillar__img {
      opacity: 1 !important; transform: none !important; clip-path: none !important;
    }
    .field__item { opacity: 0.42 !important; }
    .why__rule { transform: scaleX(1) !important; }
    .child__lines line { stroke-dashoffset: 0 !important; }
    .tile figcaption { clip-path: inset(0 0 0 0) !important; }
  }
  /* Only force a single visible frame where the canvas is actually pinned.
     In the stacked layouts (mobile, no-JS, no-IntersectionObserver) all four
     panels must stay visible. */
  @media (prefers-reduced-motion: reduce) and (min-width: 900px) {
    html:not(.no-io) .pillar:not(.is-active) { opacity: 0 !important; }
  }
  .no-anim .split-line__inner, .no-anim .split-word, .no-anim .tile img,
  .no-anim .field__item, .no-anim [data-reveal-image] img, .no-anim .pillar__img {
    opacity: 1 !important; transform: none !important; clip-path: none !important;
  }
  .no-anim .field__item { opacity: 0.42 !important; }
  .no-anim .why__rule { transform: scaleX(1) !important; }
  .no-anim .child__lines line { stroke-dashoffset: 0 !important; }
  .no-anim .tile figcaption { clip-path: inset(0 0 0 0) !important; }
  @media (min-width: 900px) {
    html.no-anim:not(.no-io) .pillar:not(.is-active) { opacity: 0 !important; }
  }

  /* Without JS the carousel cannot advance, so it stacks. */
  html:not(.js) .says__stage { display: block; }
  html:not(.js) .says__quote {
    position: relative; opacity: 1; transform: none; pointer-events: auto;
    margin-bottom: 4rem;
  }
  html:not(.js) .says__controls { display: none; }

  /* Without JS (or without the scroll maths) the pinned canvas stacks. */
  html:not(.js) .pillars, .no-io .pillars { height: auto; }
  html:not(.js) .pillars__viewport, .no-io .pillars__viewport { position: static; height: auto; }
  html:not(.js) .pillars__media, .no-io .pillars__media { position: static; display: block; }
  html:not(.js) .pillar, .no-io .pillar { position: relative; inset: auto; opacity: 1; height: 88vh; }
  html:not(.js) .pillar__img, .no-io .pillar__img { transform: none; }
  html:not(.js) .pillars__rail, .no-io .pillars__rail,
  html:not(.js) .pillars__eyebrow, .no-io .pillars__eyebrow { display: none; }
  html:not(.js) .media-scrim.pillars__viewport::after,
  .no-io .media-scrim.pillars__viewport::after { display: none; }
  html:not(.js) .pillar::after, .no-io .pillar::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(0deg, rgba(8,12,22,.9) 0%, rgba(8,12,22,.62) 34%, rgba(8,12,22,.1) 64%, transparent 80%);
  }
  /* With no JS the copy cannot be moved into each panel, so it is shown as a
     plain stacked list beneath the images rather than hidden. */
  html:not(.js) .pillars__copy {
    position: static; padding: 4vh var(--gutter);
    max-width: var(--maxw); margin-inline: auto;
  }
  html:not(.js) .pillars__slot { max-width: 60ch; margin-bottom: 3rem; }
  html:not(.js) .pillars__slot[hidden] { display: block !important; }
  html:not(.js) .pillars__title { font-size: var(--fs-h2); }

  @media (prefers-contrast: more) {
    :root { --ink: oklch(15% 0.02 258); --muted: oklch(32% 0.02 258); --line: oklch(56% 0.02 258); }
  }
}
