/* =====================================================================
   NCMTI - North Carolina Math Tutoring Initiative
   Global stylesheet / design system
   ===================================================================== */

/* ----- Design tokens ------------------------------------------------ */
:root {
  /* Brand colors */
  --navy: #0f2350;
  --navy-800: #16306b;
  --blue: #2456c6;
  --blue-600: #1e49ad;
  --blue-100: #e7eefc;
  --accent: #ffb02e;
  --accent-600: #e89600;

  /* Neutrals */
  --ink: #101828;
  --body: #3a475c;
  --muted: #66748e;
  --line: #e4e9f2;
  --surface: #ffffff;
  --bg: #f7f9fc;
  --bg-alt: #eef3fb;

  /* Effects */
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-md: 0 8px 24px rgba(15, 35, 80, .10);
  --shadow-lg: 0 24px 60px rgba(15, 35, 80, .18);

  /* Layout */
  --maxw: 1140px;
  --gutter: clamp(20px, 5vw, 40px);

  /* Type */
  --font-head: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--blue); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--blue-600); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1rem; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ----- Layout helpers ---------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--tight { padding: clamp(40px, 6vw, 72px) 0; }
.section--alt { background: var(--bg-alt); }
.section--navy {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-800) 100%);
  color: #cdd7ec;
}
.section--navy h2, .section--navy h3 { color: #fff; }

.center { text-align: center; }
.measure { max-width: 620px; }
.measure.center { margin-inline: auto; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .8rem;
}
.section--navy .eyebrow { color: var(--accent); }

.lead { font-size: 1.15rem; color: var(--muted); }
.section--navy .lead { color: #b9c5df; }

/* ----- Buttons ------------------------------------------------------ */
.btn {
  --btn-bg: var(--blue);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: .85em 1.5em;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:hover { color: var(--btn-fg); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn--accent { --btn-bg: var(--accent); --btn-fg: var(--navy); }
.btn--accent:hover { background: var(--accent-600); }

.btn--ghost {
  background: transparent;
  color: var(--blue);
  border-color: var(--line);
}
.btn--ghost:hover { color: var(--blue-600); border-color: var(--blue); box-shadow: none; }

.btn--light {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: rgba(255, 255, 255, .3);
}
.btn--light:hover { background: rgba(255, 255, 255, .2); }

.btn--lg { font-size: 1.05rem; padding: 1em 1.8em; }

/* ----- Site header -------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 249, 252, .85);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  letter-spacing: -.01em;
}
.brand:hover { color: var(--navy); }
.brand__mark { width: 38px; height: 38px; flex: none; }
.brand__sub { display: block; font-size: .62rem; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-top: 2px; }

.nav__links {
  display: flex;
  align-items: center;
  gap: .35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  display: inline-block;
  padding: .5rem .85rem;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 500;
  font-size: .98rem;
}
.nav__links a:hover { background: var(--blue-100); color: var(--blue-600); }
.nav__links a[aria-current="page"] { color: var(--blue); font-weight: 600; }

.nav__cta { margin-left: .5rem; }

.nav__toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: .4rem;
  color: var(--navy);
}
.nav__toggle svg { display: block; }

@media (max-width: 880px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 1rem var(--gutter) 1.4rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }
  .nav__links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { padding: .75rem .6rem; font-size: 1.05rem; }
  .nav__cta { margin: .5rem 0 0; }
  .nav__cta .btn { width: 100%; justify-content: center; }
}

/* ----- Hero --------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 500px at 78% -8%, rgba(36, 86, 198, .16), transparent 60%),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .5;
  mask-image: radial-gradient(760px 460px at 70% 20%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(760px 460px at 70% 20%, #000 0%, transparent 75%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(56px, 8vw, 96px) 0;
}
.hero__content { position: relative; z-index: 2; }
.hero h1 { margin-bottom: .4em; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--blue) 10%, var(--accent-600) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead { font-size: 1.2rem; color: var(--muted); max-width: 34ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero__note { margin-top: 1.4rem; font-size: .92rem; color: var(--muted); display: flex;
  align-items: center; gap: .5rem; }
.hero__note svg { color: var(--blue); flex: none; }

.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: .4rem .9rem .4rem .5rem;
  font-size: .85rem; font-weight: 600; color: var(--navy);
  box-shadow: var(--shadow-sm); margin-bottom: 1.4rem;
}
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 176, 46, .22); }

/* Hero visual card */
.hero__visual { position: relative; z-index: 2; }
.hero-card {
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-800) 100%);
  border-radius: var(--radius-lg);
  padding: 2rem;
  color: #dbe4f5;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: "π  √  ∑  ×  ÷  ∞";
  position: absolute; top: -10px; right: 14px;
  font-family: var(--font-head); font-size: 3.5rem; color: rgba(255,255,255,.05);
  letter-spacing: .1em; white-space: nowrap; pointer-events: none;
}
.hero-card h3 { color: #fff; font-size: 1.1rem; margin-bottom: 1.2rem; }
.level-track { display: grid; gap: .7rem; }
.level {
  display: flex; align-items: center; gap: .8rem;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px; padding: .7rem .9rem; font-size: .95rem;
}
.level__num {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  display: grid; place-items: center; font-family: var(--font-head);
  font-weight: 700; font-size: .9rem; background: rgba(255,255,255,.1); color: #fff;
}
.level--skip {
  background: linear-gradient(100deg, rgba(255,176,46,.22), rgba(255,176,46,.08));
  border-color: rgba(255,176,46,.4); color: #fff;
}
.level--skip .level__num { background: var(--accent); color: var(--navy); }
.level__tag { margin-left: auto; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); }
.level--done { opacity: .6; }

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { order: -1; max-width: 460px; }
}

/* ----- Generic section head ---------------------------------------- */
.section-head { max-width: 640px; margin-bottom: 2.6rem; }
.section-head.center { margin-inline: auto; }

/* ----- Feature / card grids ---------------------------------------- */
.grid { display: grid; gap: 1.4rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 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: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.7rem;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease;
}
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #d3ddf1; }
.card h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }

.icon-badge {
  width: 52px; height: 52px; border-radius: 13px;
  display: grid; place-items: center; margin-bottom: 1.1rem;
  background: var(--blue-100); color: var(--blue);
}
.icon-badge--accent { background: #fff2d9; color: var(--accent-600); }
.icon-badge svg { width: 26px; height: 26px; }

/* ----- Value / stat band ------------------------------------------- */
.valueband { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; }
.valueband > div { background: var(--surface); padding: 1.6rem 1.4rem; text-align: center; }
.valueband .v-num { font-family: var(--font-head); font-weight: 700; font-size: 2rem;
  color: var(--blue); line-height: 1; }
.valueband .v-label { font-size: .92rem; color: var(--muted); margin-top: .4rem; }
@media (max-width: 760px) { .valueband { grid-template-columns: repeat(2, 1fr); } }

/* ----- Split / how-it-works ---------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem,5vw,4rem);
  align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start; }
.step__n {
  width: 42px; height: 42px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700;
  background: var(--navy); color: #fff; font-size: 1.05rem;
}
.step h3 { margin-bottom: .2rem; font-size: 1.1rem; }
.step p { margin: 0; font-size: .98rem; }

/* ----- Subjects chips ---------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: .5rem 1rem; font-weight: 600; font-size: .92rem; color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.section--navy .chip { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14);
  color: #fff; box-shadow: none; }

/* ----- Team --------------------------------------------------------- */
.team-card { text-align: center; }
.avatar {
  width: 96px; height: 96px; margin: 0 auto 1.1rem; border-radius: 24px;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700;
  font-size: 2rem; color: #fff;
  background: linear-gradient(150deg, var(--blue), var(--navy));
}
.avatar--accent { background: linear-gradient(150deg, var(--accent), var(--accent-600)); color: var(--navy); }
.team-card .role { font-family: var(--font-head); font-weight: 600; font-size: .82rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }
.team-card h3 { margin: .2rem 0 .3rem; }
.team-card .meta { font-size: .92rem; color: var(--muted); margin-bottom: .7rem; }

.join-card {
  border: 2px dashed var(--line); background: transparent; box-shadow: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: .6rem; min-height: 100%;
}

/* ----- CTA band ----------------------------------------------------- */
.cta {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--blue) 0%, var(--navy) 100%);
  border-radius: var(--radius-lg); padding: clamp(2.4rem, 5vw, 3.6rem);
  color: #dce5f6; text-align: center; box-shadow: var(--shadow-lg);
}
.cta::before {
  content: "+  ×  ÷  √  π  ∑  ∞  =  ≠  ≥";
  position: absolute; inset: 0; font-family: var(--font-head); font-size: 2.2rem;
  color: rgba(255,255,255,.06); line-height: 2.4; letter-spacing: .4em;
  transform: rotate(-12deg) scale(1.4); pointer-events: none;
}
.cta h2 { color: #fff; position: relative; }
.cta p { position: relative; max-width: 52ch; margin-inline: auto; }
.cta__actions { position: relative; display: flex; gap: .8rem; justify-content: center;
  flex-wrap: wrap; margin-top: 1.6rem; }

/* ----- Prose (about / donate copy) --------------------------------- */
.prose p { max-width: 68ch; }
.prose h2 { margin-top: 2.2rem; }
.prose ul { max-width: 68ch; padding-left: 1.2rem; }
.prose li { margin-bottom: .5rem; }

.callout {
  border-left: 4px solid var(--accent);
  background: #fff8ec; border-radius: 0 12px 12px 0;
  padding: 1.1rem 1.3rem; margin: 1.6rem 0;
}
.callout p { margin: 0; color: var(--ink); }

/* ----- Forms -------------------------------------------------------- */
.form { display: grid; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; font-size: .92rem; color: var(--ink); font-family: var(--font-head); }
.field .req { color: var(--blue); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink);
  padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,86,198,.15);
}
.field textarea { resize: vertical; min-height: 120px; }
.form__hint { font-size: .88rem; color: var(--muted); }

/* ----- Info / contact list ----------------------------------------- */
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; }
.info-list li { display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: start; }
.info-list .ic { width: 42px; height: 42px; flex: none; border-radius: 11px; display: grid;
  place-items: center; background: var(--blue-100); color: var(--blue); }
.info-list strong { display: block; color: var(--ink); font-family: var(--font-head); }

/* ----- Notice / placeholder banner --------------------------------- */
.notice {
  display: flex; gap: .8rem; align-items: flex-start;
  background: #fff8ec; border: 1px solid #ffe4b3; border-radius: var(--radius);
  padding: 1.1rem 1.3rem; color: #7a5a12;
}
.notice svg { flex: none; color: var(--accent-600); margin-top: 2px; }
.notice p { margin: 0; }

/* ----- Footer ------------------------------------------------------- */
.site-footer { background: var(--navy); color: #9fb0d0; margin-top: 2rem; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem;
  padding: clamp(48px, 6vw, 72px) 0 2rem;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; } }
.site-footer .brand { color: #fff; }
.site-footer .brand__sub { color: #7f92b6; }
.footer-about { max-width: 34ch; font-size: .95rem; margin-top: 1rem; }
.footer-col h4 { color: #fff; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: 1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.footer-col a { color: #9fb0d0; font-size: .96rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding: 1.4rem 0;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .88rem; color: #7f92b6;
}

/* ----- Utilities ---------------------------------------------------- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }
.text-muted { color: var(--muted); }

/* ----- Skip link (a11y) -------------------------------------------- */
.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--navy); color: #fff; padding: .7rem 1.1rem;
  border-radius: 0 0 10px 10px; font-family: var(--font-head); font-weight: 600;
  box-shadow: var(--shadow-md); transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* ----- Scroll reveal (motion-safe; only active once JS opts in) ----- */
.reveal { opacity: 1; }
html.reveal-init .reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity .6s cubic-bezier(.2,.6,.2,1), transform .6s cubic-bezier(.2,.6,.2,1);
  will-change: opacity, transform;
}
html.reveal-init .reveal.is-visible { opacity: 1; transform: none; }

/* ----- Audience / "who we serve" cards ----------------------------- */
.serve .icon-badge { width: 46px; height: 46px; border-radius: 12px; margin-bottom: .9rem; }
.serve .icon-badge svg { width: 23px; height: 23px; }
.serve h3 { font-size: 1.1rem; }
.serve p { font-size: .96rem; margin: 0; }

/* ----- FAQ accordion ----------------------------------------------- */
.faq { max-width: 780px; margin-inline: auto; display: grid; gap: .9rem; }
.faq__item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.faq__item.is-open { border-color: #d3ddf1; box-shadow: var(--shadow-md); }
.faq__q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.15rem 1.35rem; font-family: var(--font-head); font-weight: 600;
  font-size: 1.05rem; color: var(--ink); line-height: 1.35;
}
.faq__q:hover { color: var(--blue); }
.faq__icon { flex: none; color: var(--blue); transition: transform .2s ease; }
.faq__q[aria-expanded="true"] .faq__icon { transform: rotate(45deg); }
.faq__a { max-height: 0; overflow: hidden; transition: max-height .28s ease; }
.faq__item.is-open .faq__a { max-height: 460px; }
.faq__a p { margin: 0; padding: 0 1.35rem 1.25rem; color: var(--body); font-size: 1rem; }

/* ----- Reduced motion ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
