/* ==========================================================================
   Every Kid Learns — shared styles for site pages
   Tokens and components match index.html so all pages feel like one site.
   ========================================================================== */

:root {
  /* Neutrals */
  --cream:        #FBF6EE;
  --cream-deep:   #F3EADC;
  --card:         #FFFFFF;
  --line:         #E4D9C8;
  --line-soft:    #EEE4D3;

  /* Text — all AA or AAA on cream */
  --ink:          #1F1A2E;
  --ink-soft:     #2E2744;
  --muted:        #5C5566;
  --on-dark:      #FFFFFF;
  --on-dark-soft: #E4DFF5;

  /* Brand */
  --navy:           #3B2F7C;
  --navy-deep:      #2A1F5C;
  --navy-soft:      #EDE9F8;
  --brand-green:    #5F9321;
  --brand-green-bg: #EAF1D4;

  /* Warm emphasis (featured / callouts) */
  --featured-bg-1:   #FFF4E2;
  --featured-bg-2:   #FBE5C6;
  --featured-border: #D9A664;
  --featured-text:   #7A4A12;

  /* Terracotta (form errors, gentle warnings) */
  --terracotta:      #C66318;
  --terracotta-deep: #8A4510;
  --terracotta-soft: #FFF2E2;

  --shadow-soft:  0 1px 2px rgba(31, 26, 46, 0.04), 0 8px 24px rgba(31, 26, 46, 0.06);
  --shadow-lift:  0 2px 4px rgba(31, 26, 46, 0.05), 0 20px 44px rgba(31, 26, 46, 0.09);
  --shadow-navy:  0 8px 20px rgba(59, 47, 124, 0.22);
  --shadow-navy-lg: 0 14px 32px rgba(59, 47, 124, 0.30);

  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 28px;
  --r-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}
.container-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Navigation ---------- */
nav.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 246, 238, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
nav.topnav.scrolled { border-bottom-color: var(--line-soft); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  max-width: 1160px;
  margin: 0 auto;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-mark { width: 42px; height: 42px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--navy);
  letter-spacing: -0.005em;
  line-height: 1.15;
}
.logo-title .leaf { color: var(--brand-green); }
.logo-tag {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  position: relative;
  transition: color .25s ease;
  padding: 4px 0;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a.active { color: var(--navy); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 16px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
}
.mobile-cta { display: none; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  transition: .25s;
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease, background .25s ease, color .25s ease;
  white-space: nowrap;
}
.btn-primary,
.btn-primary:link,
.btn-primary:visited {
  background: var(--navy);
  color: #FFFFFF !important;
  box-shadow: var(--shadow-navy);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: var(--navy-deep);
  color: #FFFFFF !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-navy-lg);
}
.btn-primary *,
.btn-primary .arrow { color: #FFFFFF !important; }
.btn-secondary,
.btn-secondary:link,
.btn-secondary:visited {
  background: #FFFFFF;
  color: var(--navy);
  border: 1.5px solid var(--line);
}
.btn-secondary:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.btn-sm { padding: 11px 20px; font-size: 0.9rem; }
.btn-lg { padding: 18px 40px; font-size: 1rem; gap: 14px; }
.btn .arrow { transition: transform .3s cubic-bezier(.2,.8,.2,1); display: inline-block; }
.btn:hover .arrow { transform: translateX(3px); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }

/* ---------- Page hero (interior pages) ---------- */
.page-hero { padding: 72px 0 48px; text-align: center; }
.page-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 28px;
}
.page-hero .eyebrow-dot {
  width: 6px; height: 6px;
  background: var(--brand-green);
  border-radius: 50%;
  flex-shrink: 0;
}
.page-hero h1 {
  font-weight: 800;
  font-size: clamp(2rem, 4.6vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.022em;
  color: var(--navy);
  margin-bottom: 18px;
}
.page-hero .lead {
  font-weight: 500;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 640px;
  margin: 0 auto 10px;
}
.page-hero .hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 30px;
}

/* Coming-soon badge */
.soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: var(--featured-bg-1);
  border: 1px solid var(--featured-border);
  border-radius: var(--r-pill);
  color: var(--featured-text);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 24px;
}

/* ---------- Sections & cards ---------- */
.section { padding: 56px 0; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 {
  font-weight: 800;
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  letter-spacing: -0.018em;
  color: var(--navy);
  margin-bottom: 12px;
}
.section-head p {
  color: var(--ink-soft);
  font-weight: 500;
  max-width: 620px;
  margin: 0 auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card-grid.two { grid-template-columns: repeat(2, 1fr); }

.info-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow-soft);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease;
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.info-card h3 {
  font-weight: 800;
  font-size: 1.08rem;
  color: var(--navy);
  margin-bottom: 10px;
}
.info-card p { color: var(--ink-soft); font-size: 0.95rem; font-weight: 500; }
.info-card .card-illo {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--navy-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

/* Soft list with check bullets */
.check-list { list-style: none; }
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  color: var(--ink-soft);
  font-weight: 500;
}
.check-list .bullet {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand-green-bg);
  color: var(--brand-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
}

/* Callout (gentle, warm) */
.callout {
  background: var(--featured-bg-1);
  border: 1px solid var(--featured-border);
  border-radius: var(--r-lg);
  padding: 22px 26px;
  color: var(--featured-text);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  padding: 38px 36px;
  box-shadow: var(--shadow-lift);
}
.form-card h2 {
  font-weight: 800;
  color: var(--navy);
  font-size: 1.35rem;
  margin-bottom: 6px;
}
.form-card .form-sub {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 26px;
}
.form-section-label {
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 28px 0 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.field .optional {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="url"],
.field input[type="number"],
.field input[type="file"],
.field select,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: #FFFDF9;
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--ink);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px var(--navy-soft);
}
.field input::placeholder,
.field textarea::placeholder { color: #A39CAE; }
.field .hint {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 6px;
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--terracotta);
  background: var(--terracotta-soft);
}
.field .error-text {
  display: none;
  color: var(--terracotta-deep);
  font-size: 0.86rem;
  font-weight: 600;
  margin-top: 6px;
}
.field.has-error .error-text { display: block; }

/* Checkbox / radio groups */
.choice-group { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: #FFFDF9;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.choice:hover { border-color: var(--navy); }
.choice input {
  margin-top: 3px;
  width: 17px; height: 17px;
  accent-color: var(--navy);
  flex-shrink: 0;
}
.choice .choice-note {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
}
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 22px 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 500;
}
.consent-row input {
  margin-top: 3px;
  width: 17px; height: 17px;
  accent-color: var(--navy);
  flex-shrink: 0;
}

.form-disclaimer {
  background: var(--cream-deep);
  border-radius: var(--r-md);
  padding: 16px 18px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  font-weight: 500;
  margin: 22px 0;
  line-height: 1.55;
}

/* ---------- Blog ---------- */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0 auto 10px;
  max-width: 760px;
}
.chip {
  padding: 8px 16px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.post-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease;
}
a.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.post-card .post-cat {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-green);
  background: var(--brand-green-bg);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  margin-bottom: 14px;
}
.post-card h3 {
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 10px;
}
.post-card p { color: var(--ink-soft); font-size: 0.93rem; font-weight: 500; }
.post-card .post-soon {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.post-card .post-read {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--navy);
}

/* Article (blog post body) */
.article {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  padding: 48px;
  box-shadow: var(--shadow-soft);
}
.article h2 {
  font-weight: 800;
  color: var(--navy);
  font-size: 1.3rem;
  margin: 34px 0 12px;
}
.article h2:first-child { margin-top: 0; }
.article p { margin-bottom: 16px; color: var(--ink); font-weight: 500; }
.article ul { margin: 0 0 16px 22px; }
.article li { margin-bottom: 8px; color: var(--ink); font-weight: 500; }
.article .script-block {
  background: var(--navy-soft);
  border-left: 4px solid var(--navy);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 20px 24px;
  margin: 18px 0;
  color: var(--ink-soft);
  font-weight: 500;
  font-style: italic;
}

/* ---------- Final CTA band ---------- */
.final-cta {
  background: var(--navy);
  border-radius: var(--r-xl);
  padding: 56px 40px;
  text-align: center;
  margin: 24px auto 80px;
}
.final-cta h2 {
  color: var(--on-dark);
  font-weight: 800;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  margin-bottom: 12px;
}
.final-cta p {
  color: var(--on-dark-soft);
  font-weight: 500;
  max-width: 560px;
  margin: 0 auto 28px;
}
.final-cta .btn-primary,
.final-cta .btn-primary:link,
.final-cta .btn-primary:visited {
  background: #FFFFFF;
  color: var(--navy) !important;
  box-shadow: none;
}
.final-cta .btn-primary:hover,
.final-cta .btn-primary:focus {
  background: var(--cream);
  color: var(--navy-deep) !important;
}
.final-cta .btn-primary *,
.final-cta .btn-primary .arrow { color: var(--navy) !important; }

/* ---------- Footer ---------- */
footer {
  background: var(--cream);
  padding: 48px 0 36px;
  border-top: 1px solid var(--line-soft);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--navy);
  font-size: 0.98rem;
}
.footer-brand .leaf { color: var(--brand-green); }
.footer-links {
  display: flex;
  gap: 28px;
  list-style: none;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 600;
  transition: color .25s ease;
}
.footer-links a:hover { color: var(--navy); }
.copyright {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .nav-links { gap: 24px; }
}

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    background: var(--cream);
    padding: 24px 32px 28px;
    gap: 20px;
    align-items: flex-start;
    border-bottom: 1px solid var(--line-soft);
    box-shadow: 0 10px 24px rgba(31, 26, 46, 0.08);
  }
  .nav-links a { font-size: 1.05rem; }
  .nav-links.open .mobile-cta {
    display: block;
    margin-top: 14px;
    width: 100%;
  }
  .nav-links.open .mobile-cta .btn {
    display: flex;
    width: 100%;
    justify-content: center;
    padding: 18px 32px;
    font-size: 1rem;
    min-height: 56px;
    gap: 12px;
  }

  .container, .container-narrow { padding: 0 24px; }
  .nav-inner { padding: 16px 24px; }
  .card-grid, .card-grid.two, .post-grid { grid-template-columns: 1fr; gap: 18px; }
  .page-hero { padding: 56px 0 40px; }
  .section { padding: 44px 0; }
  .article { padding: 32px 26px; }
  .form-card { padding: 30px 24px; }
}

@media (max-width: 560px) {
  .page-hero h1 { font-size: 1.7rem; }
  .hero-buttons .btn { width: 100%; }
  .final-cta { padding: 44px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
