/* The Math Meridian — site styles */

:root {
  --ink: #1c2233;
  --muted: #4f586b;
  --navy: #1b2a4a;
  --navy-2: #26385f;
  --navy-deep: #131e37;
  --accent: #e39b3a;
  --accent-hover: #d4892a;
  --bg: #fbfaf6;
  --surface: #ffffff;
  --soft: #f2efe6;
  --line: #e4e0d5;
  --on-dark: #dfe5f2;
  --radius: 14px;
  --maxw: 1080px;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.2rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.15rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }
a { color: var(--navy-2); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px; top: 12px;
  background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip:focus { left: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 70px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 1.25rem;
  color: var(--navy); text-decoration: none; white-space: nowrap;
}
.brand svg { width: 32px; height: 32px; flex: none; }

.site-nav { display: flex; align-items: center; gap: 12px; }
.site-nav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 8px 11px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.site-nav a:hover { background: var(--soft); }
.site-nav a[aria-current="page"] { color: var(--navy); background: var(--soft); font-weight: 600; }
.site-nav .header-phone {
  border: 1.5px solid var(--navy); border-radius: 999px;
  color: var(--navy); font-weight: 600; white-space: nowrap; padding: 7px 14px;
}
.site-nav .header-phone:hover { background: var(--navy); color: #fff; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer;
}

@media (max-width: 940px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 12px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 12px 20px 20px;
    box-shadow: 0 12px 24px rgba(19, 30, 55, 0.08);
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 12px; font-size: 1rem; }
  .site-nav .header-phone { text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent); color: var(--ink);
  font-weight: 700; font-size: 1.05rem; text-decoration: none;
  padding: 15px 28px; border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ---------- Heroes ---------- */
.hero, .page-hero {
  background-color: var(--navy);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  color: #fff;
}
.hero { padding: 88px 0 80px; }
.page-hero { padding: 64px 0 56px; }
.hero h1, .page-hero h1 { color: #fff; max-width: 18ch; }
.eyebrow {
  color: var(--accent); font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px;
}
.subhead { font-size: 1.25rem; font-weight: 600; color: #fff; max-width: 40ch; }
.lead { font-size: 1.15rem; color: var(--on-dark); max-width: 58ch; }
.hero .btn { margin-top: 12px; }
.hero-note { margin-top: 14px; font-size: 0.95rem; color: var(--on-dark); }

/* ---------- Sections ---------- */
.section { padding: 76px 0; }
.section--alt { background: var(--soft); }
.section-intro { max-width: 62ch; color: var(--muted); font-size: 1.1rem; }

.grid {
  display: grid; gap: 20px; margin-top: 32px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
}
.card p:last-child { margin-bottom: 0; }
.card .label {
  display: inline-block; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--navy); background: var(--soft);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}
.section--alt .card .label { background: var(--bg); }

/* Stats row */
.stats {
  display: grid; gap: 16px; margin-top: 32px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  border-top: 4px solid var(--accent);
}
.stat strong {
  display: block; font-family: var(--font-head);
  font-size: 2rem; color: var(--navy); line-height: 1.1; margin-bottom: 6px;
}
.stat span { color: var(--muted); }

/* Numbered steps */
.steps {
  list-style: none; counter-reset: step; padding: 0; margin: 32px 0 0;
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.steps li {
  counter-increment: step;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
}
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--navy); color: #fff;
  font-family: var(--font-head); font-weight: 600; font-size: 1.15rem;
  margin-bottom: 16px;
}
.steps h3 { margin-bottom: 0.35em; }
.steps p:last-child, .steps ul:last-child { margin-bottom: 0; }
.steps ul { padding-left: 1.2em; margin: 0 0 1em; }

/* Prose */
.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.5em; }

/* ---------- Programs ---------- */
.jump {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px;
  list-style: none; padding: 0;
}
.jump a {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); color: #fff;
  text-decoration: none; font-weight: 500; font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.jump a:hover { background: rgba(255, 255, 255, 0.2); }

.program {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: var(--radius); padding: 32px; margin-top: 24px;
  scroll-margin-top: 90px;
}
.program:first-child { margin-top: 0; }
.program h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }
.program .grade { color: var(--muted); font-weight: 600; font-size: 0.9rem;
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.program p:last-child { margin-bottom: 0; }
.program strong { color: var(--navy); }

/* ---------- About ---------- */
.about-intro {
  display: grid; grid-template-columns: 280px 1fr; gap: 48px; align-items: start;
}
.headshot {
  aspect-ratio: 4 / 5; border-radius: var(--radius);
  background: var(--navy); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-head); font-size: 4rem; font-weight: 600;
}
.headshot img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.creds { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.creds li {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 18px;
}
.creds strong { display: block; color: var(--navy); }
.creds span { color: var(--muted); font-size: 0.95rem; }

@media (max-width: 760px) {
  .about-intro { grid-template-columns: 1fr; gap: 28px; }
  .headshot { max-width: 240px; }
}

/* ---------- FAQ ---------- */
.faq-group + .faq-group { margin-top: 48px; }
.faq-group h2 { margin-bottom: 18px; }
details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 12px;
}
summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 22px; cursor: pointer; list-style: none;
  font-weight: 600; color: var(--navy); font-size: 1.05rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; flex: none; font-size: 1.5rem; line-height: 1;
  color: var(--accent); font-weight: 400;
}
details[open] summary::after { content: "\2212"; }
details .answer { padding: 0 22px 20px; color: var(--muted); }
details .answer p:last-child { margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start;
}
.contact-main { padding: 36px; }
.contact-main .btn { margin: 8px 0 16px; }
.contact-side { display: grid; gap: 20px; }
.contact-side h3 { margin-bottom: 0.4em; }
@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-main { padding: 28px; }
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--navy); color: #fff; text-align: center; padding: 72px 0;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--on-dark); max-width: 52ch; margin: 0 auto 26px; font-size: 1.1rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep); color: #c3cbdd;
  padding: 56px 0 28px; font-size: 0.95rem;
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 36px; }
.site-footer .brand { color: #fff; margin-bottom: 12px; }
.site-footer h3 {
  color: #fff; font-family: var(--font-body); font-size: 0.85rem;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 40px; padding-top: 20px; font-size: 0.85rem;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 56px 0; }
  .hero { padding: 64px 0 60px; }
  .page-hero { padding: 48px 0 44px; }
}

/* ---------- Testimonials ---------- */
.testimonials { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quote {
  margin: 0; position: relative;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 44px 28px 26px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
}
.quote::before {
  content: "\201C"; position: absolute; top: 6px; left: 22px;
  font-family: var(--font-head); font-size: 4rem; line-height: 1; color: var(--accent);
}
.quote blockquote { margin: 0; font-size: 1.05rem; color: var(--ink); }
.quote blockquote p:last-child { margin-bottom: 0; }
.quote figcaption { font-weight: 600; color: var(--navy); font-size: 0.95rem; }

/* ---------- Vision and mission ---------- */
.vision-mission { margin-top: 56px; }
.vision-mission .card { border-top: 4px solid var(--accent); }
.vision-mission p { font-family: var(--font-head); font-size: 1.2rem; line-height: 1.5; color: var(--navy); }
.testimonials .grid:has(> .quote:only-child) { max-width: 760px; }
.testimonials .quote:only-child blockquote { font-size: 1.15rem; }

/* ---------- Logo mark ---------- */
.brand .mark-m { stroke: #ffffff; }
.site-footer .brand .mark-m { stroke: var(--navy); }
