/* 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: #000000;
  --black-2: #141414;
  --white: #FFFFFF;
  --grey-1: #F2F2F2;
  --grey-3: #333333;
  --grey-5: #6B6B6B;
  --grey-placeholder: #B5B5B5;
  --line: rgba(0,0,0,.14);
  --line-strong: #000000;
  --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: 'Bodoni Moda', 'Gloock', serif;
  --font-text: 'Hanken Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --tracking-mono: .08em;
  --tracking-display: -.03em;

  --fs-hero: clamp(46px, 7.6vw, 124px);
  --fs-page-title: clamp(52px, 8vw, 128px);
  --fs-section: clamp(36px, 4.6vw, 68px);
  --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);
  --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%; }
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: 400; 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 pattern: mono label left, title right */
.sec-head { display: flex; flex-wrap: wrap; gap: 16px 40px; padding-top: 14px; border-top: 1px solid var(--line-strong); margin-bottom: clamp(32px, 4vw, 56px); }
.band-black .sec-head { border-top-color: var(--white); }
.sec-head > .label { flex: 1 1 200px; max-width: 320px; }
.sec-head > .sec-head__main { flex: 3 1 480px; min-width: 0; }
.sec-title { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-section); line-height: 1; letter-spacing: var(--tracking-display); }

/* 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 18px; 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 { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-mono); color: rgba(255,255,255,.55); }
.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: 36px; font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-mono); text-transform: uppercase; 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 { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-mono); color: rgba(255,255,255,.55); }
.mobile-menu a[aria-current="page"] .code { color: var(--white); }
.mobile-menu .big { font-family: var(--font-display); font-size: 36px; line-height: 1; letter-spacing: -.02em; }
.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; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--black); color: var(--white); padding: var(--section-bottom) var(--gutter) 28px; }
.site-footer__cols { display: flex; flex-wrap: wrap; gap: 48px clamp(32px, 4vw, 64px); padding-bottom: 48px; border-bottom: 1px solid var(--line-inverse); }
.site-footer__brand { flex: 1 1 220px; 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__stations { flex: 3 1 520px; min-width: 0; }
.site-footer__stations .head { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--text-inverse-muted); padding-bottom: 10px; border-bottom: 1px solid var(--white); }
.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); column-gap: 24px; }
.station { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-inverse); }
.station .city { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.station .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); flex: 0 0 6px; }
.station .dot.hq { background: var(--signal); }
.station .coord { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: var(--text-inverse-muted); white-space: nowrap; }
.site-footer__hq { flex: 1 1 240px; max-width: 320px; display: flex; flex-direction: column; gap: 20px; }
.site-footer__hq .gold-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--signal); margin-bottom: 8px; }
.site-footer__hq address { font-style: normal; font-size: 15px; }
.footer-links { display: flex; flex-direction: column; border-top: 1px solid var(--line-inverse); }
.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-family: var(--font-mono); font-size: 11px; letter-spacing: var(--tracking-mono); text-transform: uppercase; 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; }
