/* ============================================================
   The Bevan Morris School — design tokens
   Palette: deep navy + medium blue (brand) with warm gold accent,
   grounded in the chalkboards seen throughout the school's own
   photography (see the "At a Glance" band below).
   Type: Fraunces (display) + Inter (body) + IBM Plex Mono (data/eyebrows)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --navy-900: #0E1830;
  --navy-800: #16264A;
  --navy-700: #1E3462;
  --blue-600: #2C5AA0;
  --blue-500: #3E71BE;
  --gold-500: #C9A24B;
  --gold-300: #E3C87E;
  --gold-100: #F4E9CD;
  --chalk-900: #24352C;
  --chalk-800: #2E4638;
  --paper: #F8F6F1;
  --paper-dim: #F1EDE3;
  --ink-900: #1B1D22;
  --ink-600: #4B4F58;
  --ink-400: #767B85;
  --rule: #DCD3C0;
  --white: #FFFFFF;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --max-width: 1180px;
  --radius: 3px;
  --shadow-card: 0 18px 40px -22px rgba(14, 24, 48, 0.35);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold-500);
  color: var(--navy-900);
  padding: 10px 16px;
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-500);
}
.eyebrow.on-light { color: var(--blue-600); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold {
  background: var(--gold-500);
  color: var(--navy-900);
}
.btn-gold:hover { background: var(--gold-300); box-shadow: var(--shadow-card); }
.btn-outline-light {
  border-color: rgba(255,255,255,0.55);
  color: var(--white);
}
.btn-outline-light:hover { background: rgba(255,255,255,0.12); }
.btn-navy {
  background: var(--navy-800);
  color: var(--white);
}
.btn-navy:hover { background: var(--navy-700); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 246, 241, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
  transition: box-shadow 0.2s ease;
}
.site-header.is-scrolled { box-shadow: 0 8px 24px -18px rgba(14,24,48,0.5); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark { width: 44px; height: 44px; flex-shrink: 0; }
.brand-logo-img {
  height: 62px;
  width: auto;
  display: block;
  border-radius: 8px;
  box-shadow: var(--shadow-card);
}
.brand-logo-wide { height: 68px; }
.brand-tagline {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-600);
  line-height: 1.6;
}
.brand-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  color: var(--navy-900);
  line-height: 1.15;
}
.brand-word small {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--blue-600);
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-primary { display: flex; align-items: center; gap: 34px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-600);
  position: relative;
  padding: 6px 0;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--navy-900); }
.nav-cta-mobile { display: none; }
.nav-links a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--gold-500);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy-900);
  position: relative;
  transition: transform 0.2s ease;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: flex-end;
  color: var(--white);
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
}
.hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14,24,48,0.35) 0%, rgba(14,24,48,0.35) 35%, rgba(14,24,48,0.92) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 64px 0 72px;
  width: 100%;
}
.hero-text-col {
  margin-left: auto;
  max-width: 560px;
  text-align: right;
}
/* .hero is a flex container, so .wrap must be told to fill it (flex items
   shrink-to-fit by default) before max-width/margin-left:auto can position
   hero-text-col against the true right edge instead of just centering. */
.hero .wrap { width: 100%; max-width: calc(50vw + 618px); }
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 4.1rem);
  line-height: 1.05;
  max-width: 15ch;
  font-weight: 600;
}
.hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--gold-300);
}
.hero-sub {
  margin-top: 22px;
  max-width: 46ch;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.86);
}
.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- Section scaffolding ---------- */
section { padding: 108px 0; }
.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}
.section-head h2 {
  margin-top: 14px;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  color: var(--navy-900);
}
.section-head p { margin-top: 18px; font-size: 1.05rem; color: var(--ink-600); }
.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ---------- About / mission ---------- */
.about { background: var(--paper); }
.about .grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 72px;
  align-items: center;
}
.about-copy p { font-size: 1.08rem; color: var(--ink-600); margin-top: 20px; }
.about-copy p + p { margin-top: 16px; }
.about-figure { position: relative; }
.about-figure img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.about-figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-400);
  margin-top: 14px;
  letter-spacing: 0.02em;
}
.pull-line {
  margin-top: 28px;
  padding-left: 20px;
  border-left: 3px solid var(--gold-500);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--navy-800);
}

/* ---------- Divisions / academics ---------- */
.divisions { background: var(--paper-dim); }
.division-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.division-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.division-figure { aspect-ratio: 4 / 3; overflow: hidden; }
.division-figure img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.division-card:hover .division-figure img { transform: scale(1.04); }
.division-body { padding: 30px 32px 34px; }
.division-body .eyebrow { display: block; margin-bottom: 10px; }
.division-body h3 { font-size: 1.5rem; color: var(--navy-900); }
.division-body p { margin-top: 12px; color: var(--ink-600); }
.division-subjects {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.division-subjects li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--gold-100);
  color: var(--navy-800);
  padding: 6px 11px;
  border-radius: 20px;
}

/* ---------- Chalkboard stat band (signature element) ---------- */
.chalkboard {
  background:
    radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1.4px) 0 0/14px 14px,
    linear-gradient(180deg, var(--chalk-800), var(--chalk-900));
  color: var(--gold-100);
  padding: 92px 0;
  position: relative;
}
.chalkboard::before {
  content: '';
  position: absolute;
  inset: 14px;
  border: 10px solid #6B4A2C;
  border-radius: 2px;
  opacity: 0.6;
  pointer-events: none;
}
.chalkboard .section-head { max-width: 620px; }
.chalkboard .section-head .eyebrow { color: var(--gold-300); }
.chalkboard .section-head h2 { color: var(--white); }
.chalkboard .section-head p { color: rgba(244,233,205,0.75); }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 32px;
}
.stat {
  font-family: var(--font-mono);
}
.stat-number {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.2rem, 4vw, 3rem);
  color: var(--white);
  text-shadow: 0 0 18px rgba(227, 200, 126, 0.18);
}
.stat-label {
  margin-top: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244,233,205,0.7);
}

/* ---------- Community gallery ---------- */
.community { background: var(--paper); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 130px;
  gap: 18px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  grid-column: span 2;
  grid-row: span 2;
}
.gallery-item.wide { grid-column: span 4; }
.gallery-item.tall { grid-row: span 3; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  background: linear-gradient(0deg, rgba(14,24,48,0.78), transparent);
}

/* ---------- Admissions CTA ---------- */
.admissions {
  background: linear-gradient(120deg, var(--navy-900), var(--navy-700));
  color: var(--white);
}
.admissions .grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 56px;
  align-items: center;
}
.admissions h2 { color: var(--white); font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin-top: 14px; }
.admissions p { margin-top: 18px; color: rgba(255,255,255,0.82); font-size: 1.05rem; max-width: 52ch; }
.admissions-actions { margin-top: 30px; display: flex; gap: 16px; flex-wrap: wrap; }
.admissions-steps {
  border-left: 1px solid rgba(255,255,255,0.22);
  padding-left: 36px;
}
.admissions-steps li {
  display: flex;
  gap: 16px;
  padding-bottom: 26px;
}
.admissions-steps li:last-child { padding-bottom: 0; }
.step-index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gold-300);
  padding-top: 2px;
}
.step-title { font-weight: 600; }
.step-desc { margin-top: 4px; font-size: 0.92rem; color: rgba(255,255,255,0.72); }

/* ---------- News ---------- */
.news { background: var(--paper-dim); }
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.news-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.news-figure { aspect-ratio: 16/10; overflow: hidden; }
.news-figure img { width: 100%; height: 100%; object-fit: cover; }
.news-body { padding: 24px 26px 28px; }
.news-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-600);
}
.news-body h3 { margin-top: 10px; font-size: 1.18rem; color: var(--navy-900); }
.news-body p { margin-top: 10px; color: var(--ink-600); font-size: 0.95rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: #12203F;
  color: rgba(255,255,255,0.72);
  padding: 76px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-brand .brand-mark { width: 40px; height: 40px; }
.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-brand .brand-logo-img { margin-top: -8px; }
.footer-brand .brand-word { color: var(--white); }
.footer-tag { font-size: 0.92rem; color: rgba(255,255,255,0.6); max-width: 30ch; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 18px;
  font-weight: 600;
}
.footer-col li { margin-bottom: 11px; font-size: 0.92rem; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}

/* ---------- Page banner (interior pages) ---------- */
.page-banner {
  background: linear-gradient(120deg, var(--navy-900), var(--navy-700));
  color: var(--white);
  padding: 96px 0 68px;
}
.page-banner h1 { font-size: clamp(2.1rem, 4vw, 3rem); }
.page-banner p { margin-top: 16px; max-width: 52ch; color: rgba(255,255,255,0.78); font-size: 1.05rem; }

/* ---------- Contact page ---------- */
.contact-section .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.contact-info-list { margin-top: 28px; display: flex; flex-direction: column; gap: 22px; }
.contact-info-item .eyebrow { display: block; margin-bottom: 6px; }
.contact-info-item p { color: var(--ink-600); font-size: 1rem; }
.contact-info-item a:hover { color: var(--blue-600); }

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 40px;
}
.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy-800);
  margin-bottom: 8px;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  background: var(--paper);
  color: var(--ink-900);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid var(--gold-500);
  outline-offset: 1px;
  border-color: var(--gold-500);
}
.form-row textarea { resize: vertical; min-height: 120px; }
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-note { margin-top: 16px; font-size: 0.82rem; color: var(--ink-400); }

.map-figure {
  border: 6px solid var(--white);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3.4;
}
.map-figure iframe { width: 100%; height: 100%; border: 0; filter: grayscale(0.15) contrast(1.05); }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-1.is-visible { transition-delay: 0.06s; }
.reveal-2.is-visible { transition-delay: 0.12s; }
.reveal-3.is-visible { transition-delay: 0.18s; }
.reveal-4.is-visible { transition-delay: 0.24s; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .about .grid, .admissions .grid, .contact-section .grid { grid-template-columns: 1fr; }
  .about-figure { order: -1; }
  .division-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admissions-steps { border-left: none; padding-left: 0; margin-top: 12px; }
  .form-two { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  section { padding: 76px 0; }
  .site-header .wrap { height: 68px; }
  .brand-word small { display: none; }
  .brand-logo-img { height: 44px; }
  .brand-logo-wide { height: 40px; }
  .brand-tagline { display: none; }
  .brand-word { font-size: 0.98rem; }
  .brand-mark { width: 36px; height: 36px; }
  .nav-primary .btn-gold { display: none; }
  .nav-links {
    display: none;
    position: absolute;
    top: 82px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    gap: 0;
    padding: 8px 28px 20px;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .nav-links li:last-child a { border-bottom: none; }
  .nav-cta-mobile { display: block; margin-top: 4px; }
  .nav-cta-mobile a { color: var(--gold-500); font-weight: 700; border-bottom: none !important; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .hero { min-height: 92vh; }
  .hero-text-col { margin-left: 0; max-width: none; text-align: left; }
  .hero-actions { justify-content: flex-start; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
  .gallery-item, .gallery-item.wide { grid-column: span 2; grid-row: span 2; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .form-card { padding: 26px; }
}
