/* ==========================================================================
   Cambridge Group of Homeschools — Design System
   Premium, warm, academic. Navy / ivory / teal / charcoal.
   ========================================================================== */

:root {
  /* Colour */
  --navy: #0F2A44;
  --navy-deep: #0A1D30;
  --navy-soft: #1E3E5E;
  --ivory: #FAF6EF;
  --ivory-deep: #F2EBDD;
  --white: #FFFFFF;
  --charcoal: #262521;
  --teal: #3F7A6E;
  --teal-deep: #2E5B52;
  --teal-tint: #E7F0EC;
  --neutral: #C9BEA9;
  --neutral-line: #E4DCCB;
  --gold: #B8925A;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Scale */
  --step-0: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.6rem, 1.4rem + 0.8vw, 2rem);
  --step-3: clamp(2.1rem, 1.7rem + 1.6vw, 3rem);
  --step-4: clamp(2.6rem, 2rem + 2.6vw, 4.2rem);
  --step-5: clamp(3.2rem, 2.3rem + 4vw, 5.6rem);

  --container: 1240px;
  --container-narrow: 820px;
  --gutter: clamp(1.25rem, 4vw, 4rem);

  --radius: 6px;
  --radius-lg: 14px;
  --shadow-soft: 0 20px 60px -25px rgba(15, 42, 68, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--ivory);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure { margin: 0; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 1rem 1.5rem;
  z-index: 200;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--teal-deep);
}
.eyebrow--light { color: var(--neutral); }

h1, .h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-5);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--navy);
}
h2, .h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-4);
  line-height: 1.1;
  color: var(--navy);
}
h3, .h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-2);
  line-height: 1.2;
  color: var(--navy);
}
h4, .h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--navy);
}
.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--charcoal);
  max-width: 46ch;
}
.body-muted { color: #5B584F; }
.on-navy { color: var(--ivory); }
.on-navy h1, .on-navy h2, .on-navy h3 { color: var(--white); }
.on-navy .body-muted { color: #C7D2DC; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: clamp(4rem, 8vw, 8rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section--navy { background: var(--navy); }
.section--ivory-deep { background: var(--ivory-deep); }
.section--teal { background: var(--teal); }
.section-head {
  max-width: 720px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head + .section-head { margin-top: 0; }
.section-head--center { margin-inline: auto; text-align: center; }

.grid { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--teal); color: var(--white); }
.btn-primary:hover { background: var(--teal-deep); }
.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-outline-dark { border-color: rgba(15,42,68,0.3); color: var(--navy); }
.btn-outline-dark:hover { background: rgba(15,42,68,0.06); }
.btn-ghost { color: var(--teal-deep); padding-left: 0; padding-right: 0; }
.btn-ghost::after { content: "→"; transition: transform .25s var(--ease); }
.btn-ghost:hover::after { transform: translateX(4px); }
.btn-ghost:hover { transform: none; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--neutral-line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--navy);
  line-height: 1.1;
  white-space: nowrap;
}
.nav-logo-mark { height: 60px; width: auto; display: block; flex-shrink: 0; }
.nav-logo-sub { display: block; font-family: var(--font-body); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-deep); font-weight: 600; margin-top: 0.15rem; white-space: normal; max-width: 9.5rem; line-height: 1.3; }
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 1.8vw, 2rem);
  flex-wrap: nowrap;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--charcoal);
  position: relative;
  padding-block: 0.25rem;
  white-space: nowrap;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a.btn-primary { color: var(--white); }
.nav-links a.btn-primary::after { display: none; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.4rem;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--navy); margin: 5px 0; transition: transform .25s var(--ease), opacity .25s var(--ease); }

@media (max-width: 920px) {
  .nav-links { position: fixed; inset: 0 0 0 30%; background: var(--ivory); flex-direction: column; justify-content: center; align-items: flex-start; padding: 3rem 2.5rem; gap: 1.75rem; transform: translateX(100%); transition: transform .35s var(--ease); box-shadow: var(--shadow-soft); }
  .nav-links[data-open="true"] { transform: translateX(0); }
  .nav-links a { font-size: 1.15rem; }
  .nav-toggle { display: block; z-index: 110; }
  body[data-nav-open="true"] { overflow: hidden; }
  .nav-actions .btn-primary { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--navy-deep), var(--navy) 60%, var(--navy-soft));
  color: var(--ivory);
  overflow: hidden;
}
.hero-inner {
  position: relative;
  z-index: 3;
  padding-block: clamp(5rem, 12vw, 9rem) clamp(4rem, 9vw, 7rem);
  display: grid;
  gap: 2.5rem;
}
.hero-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: linear-gradient(160deg, rgba(10,29,48,0.58), rgba(15,42,68,0.42) 55%, rgba(30,62,94,0.3));
}
.hero-texture {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 82% 18%, rgba(63,122,110,0.35), transparent 55%),
              radial-gradient(circle at 10% 90%, rgba(184,146,90,0.18), transparent 45%);
  z-index: 2;
}
.hero h1 { max-width: 16ch; color: var(--white); text-shadow: 0 2px 16px rgba(0,0,0,0.5); }
.hero-sub, .hero-copy { text-shadow: 0 1px 10px rgba(0,0,0,0.45); }
.page-hero h1, .page-hero .lede { text-shadow: 0 2px 14px rgba(0,0,0,0.45); }
.cta-band h2, .cta-band p { text-shadow: 0 1px 10px rgba(0,0,0,0.35); }
.hero-sub {
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--neutral);
  font-style: italic;
  font-weight: 400;
}
.hero-copy { max-width: 60ch; font-size: var(--step-0); color: #D8E0E6; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.5rem; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid rgba(255,255,255,0.18);
}
.hero-meta div strong { display: block; font-family: var(--font-display); font-size: 1.8rem; color: var(--white); }
.hero-meta div span { font-size: 0.85rem; color: var(--neutral); }

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  background: linear-gradient(160deg, var(--navy-deep), var(--navy));
  color: var(--white);
  padding-block: clamp(4.5rem, 9vw, 6.5rem) clamp(3rem, 6vw, 4.5rem);
}
.breadcrumb { font-size: 0.85rem; color: var(--neutral); margin-bottom: 1.25rem; }
.breadcrumb a { text-decoration: none; color: var(--neutral); }
.breadcrumb a:hover { color: var(--white); }

/* ---------- Video ---------- */
.video-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--neutral-line);
  aspect-ratio: 16 / 9;
  background: var(--navy-deep);
}
.video-frame video { width: 100%; height: 100%; display: block; object-fit: cover; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border: 1px solid var(--neutral-line);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.card .eyebrow { margin-bottom: 0.75rem; }
.card h3 { font-size: 1.4rem; margin-bottom: 0.6rem; }
.card p { color: #5B584F; }
.card-link { display: inline-block; margin-top: 1.25rem; font-weight: 600; color: var(--teal-deep); text-decoration: none; font-size: 0.92rem; }
.card-link:hover { text-decoration: underline; }

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--teal-tint);
  color: var(--teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}
.contact-icon svg { width: 22px; height: 22px; }
.card-icon {
  width: 52px;
  height: 52px;
  color: var(--gold);
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-icon svg { width: 46px; height: 46px; }
.card a.contact-value {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  display: block;
}
.card a.contact-value:hover { color: var(--teal-deep); text-decoration: underline; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.tag {
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--teal-tint);
  color: var(--teal-deep);
  font-weight: 600;
}

/* ---------- Editorial "why choose" blocks ---------- */
.editorial-block {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--neutral-line);
}
.editorial-block:last-child { border-bottom: none; }
.editorial-block:nth-child(even) { direction: rtl; }
.editorial-block:nth-child(even) > * { direction: ltr; }
.editorial-figure {
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, var(--teal-tint), var(--ivory-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-deep);
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-align: center;
  padding: 2rem;
  border: 1px solid var(--neutral-line);
  overflow: hidden;
}
.editorial-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 1px);
}

/* Photo-backed heroes — background-image is set inline per page (gradient + photo), these just fix sizing */
.hero[style*="background-image"],
.page-hero[style*="background-image"],
.cta-band[style*="background-image"] {
  background-size: cover;
  background-position: center;
}
.editorial-number { font-family: var(--font-display); font-size: 3.5rem; color: var(--teal); line-height: 1; margin-bottom: 1rem; }
@media (max-width: 800px) {
  .editorial-block, .editorial-block:nth-child(even) { grid-template-columns: 1fr; direction: ltr; }
}

/* ---------- Academic stage interactive tabs ---------- */
.stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--neutral-line);
  padding-bottom: 0;
}
.stage-tab {
  background: none;
  border: none;
  padding: 0.9rem 1.4rem;
  font-weight: 600;
  color: #7A7768;
  border-bottom: 3px solid transparent;
  font-size: 0.95rem;
}
.stage-tab[aria-selected="true"] { color: var(--navy); border-color: var(--teal); }
.stage-tab:hover { color: var(--navy); }
.stage-panel { display: none; }
.stage-panel[data-active="true"] { display: block; animation: fade-in .4s var(--ease); }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }

.stage-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  background: var(--white);
  border: 1px solid var(--neutral-line);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3rem);
}
@media (max-width: 800px) { .stage-detail { grid-template-columns: 1fr; } }
.stage-age {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--teal-deep);
  background: var(--teal-tint);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.stage-yeargrid { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.25rem 0; }
.stage-year { border: 1px solid var(--neutral-line); border-radius: 8px; padding: 0.5rem 0.9rem; font-size: 0.85rem; }
.stage-year strong { display: block; color: var(--navy); }
.check-list li { position: relative; padding-left: 1.6rem; margin-bottom: 0.6rem; color: #5B584F; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }

/* ---------- Process timeline ---------- */
.timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  counter-reset: step;
}
.timeline-step {
  flex: 1 1 140px;
  position: relative;
  padding: 1.75rem 1.25rem;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--neutral-line);
  margin: -1px 0 0 -1px;
}
.timeline-step .num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  margin: 0 auto 0.85rem;
}
.timeline-step h4 { font-size: 0.95rem; }
@media (max-width: 720px) { .timeline-step { flex: 1 1 45%; } }

/* ---------- Approach steps (Understand -> Progress) ---------- */
.approach-flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.approach-step {
  background: var(--navy);
  padding: clamp(1.75rem, 3vw, 2.5rem) 1.5rem;
  color: var(--ivory);
}
.approach-step .index { font-family: var(--font-display); font-size: 2.2rem; color: var(--gold); }
.approach-step h4 { color: var(--white); margin: 0.5rem 0 0.6rem; font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; }
.approach-step p { font-size: 0.9rem; color: #C7D2DC; }
@media (max-width: 900px) { .approach-flow { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .approach-flow { grid-template-columns: 1fr; } }

/* ---------- Impact stats ---------- */
.stats-row { display: flex; flex-wrap: wrap; gap: clamp(2rem, 6vw, 5rem); justify-content: center; text-align: center; }
.stat strong { display: block; font-family: var(--font-display); font-size: clamp(2.5rem, 5vw, 4rem); color: var(--navy); }
.stat span { color: #5B584F; font-size: 0.95rem; }

/* ---------- Audience grid ---------- */
.audience-card {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--neutral-line);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.audience-card h4 { font-size: 1.02rem; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--teal);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
  display: grid;
  gap: 1.5rem;
  justify-items: center;
}
.cta-band h2 { color: var(--white); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.field input, .field select, .field textarea {
  padding: 0.85rem 1rem;
  border: 1px solid var(--neutral-line);
  border-radius: 8px;
  background: var(--white);
  color: var(--charcoal);
}
.field textarea { resize: vertical; min-height: 110px; }
.form-note { font-size: 0.85rem; color: #7A7768; }
.form-success { display: none; background: var(--teal-tint); color: var(--teal-deep); padding: 1.25rem 1.5rem; border-radius: 10px; font-weight: 600; }
.form-success[data-visible="true"] { display: block; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #C7D2DC; padding-block: clamp(3.5rem, 7vw, 5rem) 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { font-family: var(--font-display); color: var(--white); font-size: 1.3rem; }
.footer-tag { color: var(--neutral); font-size: 0.9rem; margin-top: 0.5rem; }
.footer-col h4 { color: var(--white); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-col ul li { margin-bottom: 0.6rem; }
.footer-col a { text-decoration: none; color: #C7D2DC; font-size: 0.92rem; }
.footer-col a:hover { color: var(--white); }
.footer-bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.12); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: 0.82rem; color: #8FA0AC; }
.social-row { display: flex; gap: 1rem; }

/* ---------- Floating mobile CTA ---------- */
.mobile-cta {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 90;
}
.mobile-cta .btn { width: auto; box-shadow: var(--shadow-soft); }
@media (max-width: 720px) {
  .mobile-cta { display: block; }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-lg { margin-top: clamp(2rem, 4vw, 3rem); }
.flow > * + * { margin-top: 1rem; }
.badge-note {
  font-size: 0.82rem;
  color: #7A7768;
  border-left: 3px solid var(--neutral);
  padding-left: 0.9rem;
  margin-top: 1rem;
}
