/* Westford Education Group — shared base
   Tokens come from the design handoff (tokens.css). Page-specific styles live in css/pages/. */

:root {
  /* Colour: black & white first (≥90% of any screen) */
  --black: #0A0A0A;          /* off-black; the logo files stay true black */
  --black-2: #161616;
  --white: #FAFAFA;
  --surface: #FFFFFF;        /* logo tiles only, so cut-out logos sit on a clean field */
  --grey-1: #F2F2F2;
  --grey-3: #3A3A3A;
  --grey-5: #6B6B6B;
  --grey-placeholder: #B5B5B5;
  --line: rgba(10,10,10,.12);
  --line-strong: #0A0A0A;
  --line-inverse: rgba(255,255,255,.18);
  --text-inverse-muted: rgba(255,255,255,.6);
  --text-inverse-soft: rgba(255,255,255,.7);
  --text-inverse-body: rgba(255,255,255,.8);
  /* Accents: together <8% of a screen; gold alone <3% */
  --accent: #996736;
  --signal: #FFBF00;
  --accent-soft: #FFE7CF;
  --error: #B3261E;

  --font-display: 'Geist', 'Helvetica Neue', Arial, sans-serif;
  --font-text: 'Geist', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --tracking-mono: .04em;
  --tracking-display: -.045em;
  --weight-display: 500;

  --fs-hero: clamp(40px, 5.4vw, 84px);
  --fs-page-title: clamp(44px, 6.4vw, 104px);
  --fs-section: clamp(32px, 4vw, 60px);
  --fs-subsection: clamp(32px, 3.6vw, 52px);
  --fs-ledger: clamp(76px, 19vw, 280px);
  --fs-pull: clamp(28px, 3.4vw, 52px);
  --fs-lead: clamp(18px, 1.5vw, 20px);
  --fs-body: 17px; --lh-body: 1.55; --measure: 66ch;
  --fs-small: 15px; --fs-caption: 14px;
  --fs-label: 12px; --fs-micro: 11px; --fs-nano: 10px;

  --s-1: 8px; --s-2: 16px; --s-3: 24px; --s-4: 32px; --s-5: 40px;
  --s-6: 48px; --s-7: 56px; --s-8: 64px; --s-9: 72px; --s-12: 96px; --s-14: 112px;
  --gutter: clamp(20px, 3vw, 40px);
  --section-top: clamp(56px, 8vw, 112px);
  --section-bottom: clamp(56px, 7vw, 96px);

  --edge-selected: inset 0 0 0 2px var(--accent);
  --mark-active: inset 0 -3px 0 var(--accent);

  --ease: cubic-bezier(.2,.7,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur-fast: 160ms; --dur-base: 200ms; --dur-slow: 240ms; --dur-layout: 320ms;
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; --dur-layout: 0ms; }
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-synthesis: none; } /* Geist has no italic: never let the browser fake one */
html, body { margin: 0; background: var(--white); color: var(--black); -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-text); font-size: var(--fs-body); line-height: var(--lh-body); overflow-x: hidden; }
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 3px; }
*:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
::selection { background: var(--black); color: var(--white); }

/* Utilities */
.wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding: var(--section-top) var(--gutter) var(--section-bottom); }
.band-black { background: var(--black); color: var(--white); }
.band-grey { background: var(--grey-1); }
.mono { font-family: var(--font-mono); letter-spacing: var(--tracking-mono); text-transform: uppercase; }
.label { font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--grey-5); }
.band-black .label { color: var(--text-inverse-muted); }
.display { font-family: var(--font-display); font-weight: var(--weight-display); letter-spacing: var(--tracking-display); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.placeholder { color: var(--grey-5); }
.gold { color: var(--signal); }
.no-ul { text-decoration: none; }

/* Section header: one focused message, stacked (headline, then optional body). No label column. */
.sec-head { display: flex; flex-direction: column; gap: 16px; max-width: 72ch; margin-bottom: clamp(32px, 4vw, 56px); }
.sec-head > .label { display: none; }               /* legacy section labels are retired */
.sec-head > .sec-head__main { min-width: 0; }
.sec-head p { color: var(--grey-3); max-width: 62ch; }
.band-black .sec-head p { color: var(--text-inverse-body); }
.sec-title { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--fs-section); line-height: 1.02; letter-spacing: var(--tracking-display); text-wrap: balance; }

/* Emphasis inside display type: same family, lighter tone (Geist has no true italic; never fake it). */
:where(h1, h2, h3, .display, .sec-title) :where(em, i, .it) { font-style: normal; color: color-mix(in srgb, currentColor 48%, transparent); }

/* Scroll reveal: added by core.js only when motion is allowed. Communicates sequence as content enters. */
.js-motion [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.js-motion [data-reveal].is-in { opacity: 1; transform: none; }

/* Tactile press feedback */
:where(button, .chip, .line-link, .btn, a.cta):active { transform: translateY(1px) scale(.985); }
:where(button, .chip, .line-link, .btn, a.cta) { transition-property: background, color, box-shadow, transform; transition-duration: var(--dur-fast); transition-timing-function: var(--ease); }

/* Filter chips */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid rgba(0,0,0,.2); background: var(--white); color: var(--black); font-size: 14px; font-weight: 500; border-radius: 0; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.chip .n { font-family: var(--font-mono); font-size: 10px; opacity: .7; }
.chip[aria-pressed="true"] { background: var(--black); color: var(--white); border-color: var(--black); box-shadow: var(--mark-active); }

/* Photo treatment */
.photo-bw { filter: grayscale(1) contrast(1.18); transition: filter var(--dur-slow) var(--ease); }
.photo-bw:hover, .photo-bw:focus, .photo-bw:focus-within, :focus-visible > .photo-bw { filter: grayscale(0) contrast(1); }

/* Skip link */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--signal); color: var(--black); padding: 10px 16px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 30; background: var(--black); color: var(--white); border-bottom: 1px solid var(--line-inverse); }
.site-header--overlay { position: absolute; top: 0; left: 0; right: 0; background: transparent; }
.site-header__main { padding: 0 var(--gutter); display: flex; align-items: stretch; justify-content: space-between; gap: 24px; min-height: 72px; }
.site-header__logo { display: flex; align-items: center; text-decoration: none; }
.site-header__logo img { width: 150px; height: auto; }
.site-nav { display: none; align-items: stretch; }
.site-nav a { display: flex; align-items: center; gap: 8px; padding: 0 20px; border-left: 1px solid var(--line-inverse); text-decoration: none; color: var(--white); font-size: 15px; font-weight: 500; transition: background var(--dur-fast) var(--ease); }
.site-nav a:hover { background: var(--black-2); }
.site-header--overlay .site-nav a:hover { background: rgba(20,20,20,.7); }
.site-nav a[aria-current="page"] { box-shadow: var(--mark-active); }
.site-nav .code { display: none; }
.site-nav a[aria-current="page"] .code { color: var(--white); }
.site-nav .cta { padding: 0 0 0 20px; gap: 10px; font-weight: 600; }
.site-nav .cta:hover { background: transparent; }
.arrow-gold { color: var(--signal); }
.menu-btn { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px; font-family: var(--font-mono); font-size: 12px; letter-spacing: var(--tracking-mono); text-transform: uppercase; }
.menu-btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.menu-btn .bars { display: flex; flex-direction: column; gap: 4px; }
.menu-btn .bars span { width: 20px; height: 1px; background: var(--white); display: block; }
.site-header__sub { padding: 0 var(--gutter); border-top: 1px solid var(--line-inverse); display: flex; gap: 10px; align-items: center; min-height: 40px; font-size: 13px; color: var(--text-inverse-muted); overflow-x: auto; white-space: nowrap; }
.site-header__sub a { color: var(--text-inverse-muted); text-decoration: none; }
.site-header__sub .current { color: var(--white); }
.site-header__sub .spacer { flex: 1; }
.site-header__sub .sib { min-height: 36px; display: flex; align-items: center; padding: 0 4px; }
.site-header__sub .sib[aria-current="page"] { color: var(--white); box-shadow: inset 0 -2px 0 var(--accent); }
/* Sibling sub-pages are in the mobile menu; on phones the row would overflow. */
@media (max-width: 599px) { .site-header__sub .sib, .site-header__sub .spacer { display: none; } }
.mobile-menu { position: fixed; inset: 72px 0 0 0; z-index: 40; background: var(--black); color: var(--white); display: flex; flex-direction: column; padding: 8px 20px 32px; overflow: auto; border-top: 1px solid var(--line-inverse); }
.mobile-menu[hidden] { display: none; }
.mobile-menu a { display: flex; align-items: baseline; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line-inverse); text-decoration: none; color: var(--white); }
.mobile-menu .code { display: none; }
.mobile-menu a[aria-current="page"] .code { color: var(--white); }
.mobile-menu .big { font-family: var(--font-display); font-weight: var(--weight-display); font-size: 34px; line-height: 1.05; letter-spacing: -.035em; }
.mobile-menu .cta { margin-top: 24px; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--white); font-weight: 600; }
.mobile-menu .sub { padding: 12px 0 12px 44px; font-size: 16px; color: var(--text-inverse-soft); border-bottom: 1px solid var(--line-inverse); }
@media (min-width: 960px) {
  .site-nav { display: flex; }
  .menu-btn { display: none; }
  .mobile-menu { display: none !important; }
}

/* ---------- Partner logos: optical balancing ----------
   Every logo gets the same visual area (--a, in px²) whatever its shape: width = √(area × ratio).
   Wide logos come out shorter, compact ones taller; --max-h and the container width cap both. */
.logo-bal { --a: 4400; --max-h: 52px; display: block; flex: none; max-width: 100%; max-height: none; height: auto;
  width: min(var(--max-w, 100%), calc(var(--max-h) * var(--r)), calc(sqrt(var(--a) * var(--r)) * 1px)); }

/* ---------- Footer ---------- */
.site-footer { background: var(--black); color: var(--white); padding: var(--section-bottom) var(--gutter) 28px; }
.site-footer__cols { display: grid; grid-template-columns: 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid var(--line-inverse); }
@media (min-width: 640px) { .site-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 40px; } }
@media (min-width: 1100px) { .site-footer__cols { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 48px clamp(32px, 4vw, 64px); } }
.site-footer__brand { max-width: 280px; display: flex; flex-direction: column; gap: 28px; }
.site-footer__brand img { width: 150px; }
.site-footer__brand p { font-size: 15px; color: rgba(255,255,255,.75); }
.line-link { display: flex; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid currentColor; text-decoration: none; font-weight: 600; }
.site-footer__label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-inverse-muted); padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line-inverse); }
.site-footer__city { font-family: var(--font-display); font-weight: 500; font-size: clamp(34px, 3.2vw, 48px); line-height: 1; letter-spacing: -.03em; margin-bottom: 16px; }
.site-footer__hq address { font-style: normal; font-size: 15px; line-height: 1.6; color: var(--text-inverse-body); }
.site-footer__mail { font-size: 17px; font-weight: 500; text-decoration: none; overflow-wrap: anywhere; border-bottom: 1px solid var(--line-inverse); padding-bottom: 4px; transition: border-color var(--dur-fast) var(--ease); }
.site-footer__mail:hover, .site-footer__mail:focus-visible { border-bottom-color: var(--signal); }
.footer-links { display: flex; flex-direction: column; margin-top: -18px; }
.footer-links a { display: flex; justify-content: space-between; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line-inverse); text-decoration: none; }
.site-footer__legal { padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13px; color: var(--text-inverse-muted); line-height: 1.6; }

/* Overlays */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60; }
.backdrop[hidden] { display: none; }
body.no-scroll { overflow: hidden; }

/* ---------- Network dropdown ---------- */
.nav-dd { position: relative; display: flex; align-items: stretch; }
.nav-dd__btn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 0 20px; border-left: 1px solid var(--line-inverse); color: var(--white); font-size: 15px; font-weight: 500; transition: background var(--dur-fast) var(--ease); }
.nav-dd__btn:hover, .nav-dd.is-open .nav-dd__btn { background: var(--black-2); }
.site-header--overlay .nav-dd__btn:hover, .site-header--overlay .nav-dd.is-open .nav-dd__btn { background: rgba(20,20,20,.7); }
.nav-dd__btn:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }
.nav-dd__btn[data-current="true"] { box-shadow: var(--mark-active); }
.nav-dd__caret { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-base) var(--ease); }
.nav-dd.is-open .nav-dd__caret { transform: translateY(2px) rotate(-135deg); }
.nav-dd__menu { position: absolute; top: 100%; left: 0; min-width: 240px; margin: 0; padding: 8px 0; list-style: none; background: var(--black); border: 1px solid var(--line-inverse); border-top: 0; z-index: 35; }
.nav-dd__menu a { display: flex; align-items: center; min-height: 44px; padding: 0 20px; border: 0; color: var(--white); text-decoration: none; font-size: 15px; }
.nav-dd__menu a:hover { background: var(--black-2); }
.nav-dd__menu a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .nav-dd.is-open .nav-dd__menu { animation: dd-in 180ms var(--ease); }
  @keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
@media (min-width: 960px) and (max-width: 1199px) { .site-nav a, .nav-dd__btn { padding: 0 13px; font-size: 14px; } .site-nav .cta { padding-left: 14px; } }
