:root {
  --navy: #24304a;
  --blue: #4a7cf7;
  --blue-deep: #3b66d4;
  --purple: #8b6de9;
  --green: #55c68a;
  --yellow: #f6c85f;
  --coral: #ff7a72;
  --cream: #fffdf8;
  --paper: #ffffff;
  --muted: #5d6a84;
  --line: #eadfce;
  --blue-soft: #e8f0fe;
  --purple-soft: #f3eefc;
  --green-soft: #e7f7ee;
  --yellow-soft: #fdf6e3;
  --coral-soft: #ffecea;
  --navy-soft: #eef1f7;
  --shadow: 0 16px 40px -24px rgb(36 48 74 / 0.28);
  --radius: 28px;
}

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

html { background: var(--cream); color: var(--navy); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Nunito, ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(900px 420px at 8% -10%, rgb(74 124 247 / 0.08), transparent 55%),
    radial-gradient(720px 360px at 100% 8%, rgb(139 109 233 / 0.08), transparent 50%),
    var(--cream);
  color: var(--navy);
  display: flex;
  flex-direction: column;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  background: transparent;
}
body.answer-flash-correct::after {
  animation: page-correct-flash .9s ease-out;
  background: rgb(85 198 138 / .13);
}
body.answer-flash-incorrect::after {
  animation: page-incorrect-flash .48s ease-out;
  background: rgb(255 122 114 / .085);
}
body.modal-open { overflow: hidden; }

img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 3px; }
button, input, select { font: inherit; }

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

.wrap { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
#main { flex: 1; }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid rgb(74 124 247 / .72);
  outline-offset: 3px;
}

@keyframes page-correct-flash {
  0% { opacity: 0; }
  16% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes page-incorrect-flash {
  0% { opacity: 0; }
  22% { opacity: 1; }
  100% { opacity: 0; }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgb(255 253 248 / .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgb(234 223 206 / .7);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.brand { display: inline-flex; align-items: center; }
.brand-full { height: 34px; width: auto; }
.brand-mark { display: none; height: 36px; width: auto; }
.nav-main { display: flex; gap: .25rem; }
.nav-main a {
  text-decoration: none;
  color: rgb(36 48 74 / .75);
  font-weight: 800;
  padding: .5rem .9rem;
  border-radius: 999px;
}
.nav-main a[aria-current="page"],
.nav-main a:hover { background: var(--blue-soft); color: var(--blue); }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.menu-toggle { display: none; }
.nav-mobile {
  display: grid;
  gap: .25rem;
  padding: .75rem 1rem 1rem;
  background: white;
  border-top: 1px solid var(--line);
}
.nav-mobile[hidden] { display: none !important; }
.nav-mobile a {
  text-decoration: none;
  color: var(--navy);
  font-weight: 800;
  padding: .85rem 1rem;
  border-radius: 18px;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: rgb(255 255 255 / .7);
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr);
  gap: 1.5rem;
  padding: 2.4rem 0;
}
.footer-inner p { color: var(--muted); font-weight: 600; max-width: 22rem; }
.footer-nav { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 1.5rem; }
.footer-nav div { display: grid; align-content: start; gap: .55rem; }
.footer-nav h2 { font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.footer-nav a { color: var(--navy); text-decoration: none; font-weight: 800; }
.footer-nav a:hover { color: var(--blue); text-decoration: underline; }
.footer-bottom { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1rem; }
.footer-bottom p { margin: 0; font-size: .92rem; }

.hero { position: relative; overflow: hidden; padding: 3.4rem 0 2.5rem; }
.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.1fr .9fr; }
}
.eyebrow {
  display: inline-flex;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 800;
  border-radius: 999px;
  padding: .2rem .7rem;
  font-size: .9rem;
}
h1, h2, h3 { letter-spacing: -.03em; margin: 0; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.08; }
.lede { font-size: 1.15rem; font-weight: 700; color: var(--muted); max-width: 34rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }

.math-card {
  background: white;
  border-radius: 36px;
  padding: 1.3rem;
  box-shadow: var(--shadow);
  position: relative;
}
.math-card .eq {
  border-radius: 24px;
  padding: 1rem;
  text-align: center;
}
.eq-from { background: var(--blue-soft); }
.eq-to { background: var(--green-soft); }
.eq-arrow {
  width: 40px; height: 40px; margin: .6rem auto;
  border-radius: 999px; background: var(--yellow);
  display: grid; place-items: center;
  position: relative;
}
.eq-arrow::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 3px solid var(--navy);
  border-bottom: 3px solid var(--navy);
  transform: rotate(45deg) translate(-2px, -2px);
}

.section { padding: 2.6rem 0; }
.narrow-wrap { max-width: 820px; margin-inline: auto; }
.grid-3, .grid-2 { display: grid; gap: 1rem; }
@media (min-width: 760px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.path-preview { display: grid; gap: 1.2rem; }
.path-course {
  background: white;
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.path-nodes { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: .7rem; }
.node {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--navy-soft); border: 3px solid var(--blue);
}
.node.star {
  width: 26px; height: 26px; background: var(--yellow); border-color: var(--navy);
}
.node.done { background: var(--green); border-color: var(--green); }
.node.current { background: var(--blue); transform: scale(1.15); }
.path-line { height: 4px; width: 22px; background: var(--blue); border-radius: 99px; opacity: .35; }

.katex { font-size: 1.08em; }
.math-lg .katex { font-size: 1.45em; }

@media (max-width: 760px) {
  .brand-full { display: none; }
  .brand-mark { display: inline; }
  .nav-main { display: none; }
  .menu-toggle { display: inline-flex; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .footer-bottom { grid-column: 1; }
}

/* Public lesson hub and articles */
.lesson-hub-hero { padding-bottom: 1rem; }
.lesson-hub { padding-top: 1rem; }
.curriculum-section {
  scroll-margin-top: 90px;
  background: white;
  border-radius: var(--radius);
  padding: clamp(1.15rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}
.curriculum-section + .curriculum-section { margin-top: 1.25rem; }
.curriculum-heading { display: flex; gap: 1rem; align-items: flex-start; }
.curriculum-heading .path-num { margin: .2rem 0 0; color: var(--blue); font-weight: 900; }
.curriculum-heading p { color: var(--muted); font-weight: 700; }
.lesson-link-grid { display: grid; gap: .8rem; margin-top: 1.2rem; }
@media (min-width: 760px) {
  .lesson-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.lesson-link-card {
  display: grid;
  gap: .35rem;
  padding: 1rem;
  border: 2px solid transparent;
  border-radius: 20px;
  background: var(--navy-soft);
  color: var(--navy);
  text-decoration: none;
}
.lesson-link-card:hover { border-color: var(--blue); background: var(--blue-soft); }
.lesson-link-card span { font-weight: 900; font-size: 1.05rem; }
.lesson-link-card small { color: var(--muted); font-weight: 700; line-height: 1.45; }

.public-lesson { padding: 1.2rem 0 3rem; }
.lesson-wrap { max-width: 1040px; }
.breadcrumbs { margin-bottom: 2rem; font-size: .9rem; font-weight: 800; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: .35rem; color: rgb(36 48 74 / .42); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue); text-decoration: underline; }
.lesson-article-header { max-width: 780px; margin-bottom: 2rem; }
.lesson-article-header .lede { max-width: 48rem; line-height: 1.65; }
.lesson-content-grid { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 880px) {
  .lesson-content-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .lesson-side-card { position: sticky; top: 88px; }
}
.lesson-copy { display: grid; gap: 1rem; }
.lesson-copy section, .related-lessons, .practice-more {
  background: white;
  border-radius: var(--radius);
  padding: clamp(1.2rem, 3vw, 1.8rem);
  box-shadow: var(--shadow);
}
.lesson-copy h2, .related-lessons h2, .practice-more h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
.lesson-copy h3 { font-size: 1.15rem; }
.lesson-copy p, .lesson-copy li, .practice-more p {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.7;
}
.method-list, .mistake-list { padding-left: 1.35rem; }
.method-list li + li, .mistake-list li + li { margin-top: .55rem; }
.worked-example { margin-top: 1rem; border-radius: 22px; padding: 1.15rem; background: var(--blue-soft); }
.worked-example ol { margin-bottom: .75rem; }
.worked-example .example-result { margin-bottom: 0; color: var(--navy); font-weight: 900; }
.lesson-side-card { background: var(--yellow-soft); }
.lesson-side-card h2 { font-size: 1.5rem; margin-top: .7rem; }
.lesson-side-card p { color: var(--muted); font-weight: 700; line-height: 1.55; }
.lesson-side-card .btn { width: 100%; margin-top: .5rem; }
.lesson-side-card .account-note { font-size: .88rem; }
.related-lessons { margin-top: 1.5rem; }
.related-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.related-links a {
  padding: .7rem .9rem;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--navy);
  text-decoration: none;
  font-weight: 800;
}
.practice-more { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.practice-more .cta-row { flex: 0 0 auto; margin-top: 0; }
.lesson-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.lesson-pagination > div { min-width: 0; }
.lesson-pagination small { display: block; color: var(--muted); font-weight: 800; margin-bottom: .25rem; }
.lesson-pagination a { color: var(--navy); font-weight: 900; text-decoration: none; }
.lesson-pagination a:hover { color: var(--blue); text-decoration: underline; }
.lesson-next { text-align: right; }
@media (max-width: 680px) {
  .practice-more { align-items: flex-start; flex-direction: column; }
  .practice-more .cta-row { margin-top: .5rem; }
}

/* Founder profile */
.founder-hero { padding-block: clamp(3rem, 8vw, 6rem); }
.about-hero { padding-block: clamp(3rem, 8vw, 5rem); }
.founder-subtitle { font-size: clamp(1.2rem, 3vw, 1.55rem); font-weight: 900; margin: .8rem 0 0; }
.founder-hero .lede { max-width: 48rem; line-height: 1.65; }
.founder-content { max-width: 940px; padding-bottom: 4rem; }
.founder-content > section { padding-block: 2.2rem; }
.founder-content > section + section { border-top: 1px solid var(--line); }
.founder-content h2 { font-size: clamp(1.7rem, 4vw, 2.35rem); }
.founder-content p, .founder-content li { color: var(--muted); font-weight: 700; line-height: 1.72; }
.section-label, .project-type {
  margin: 0 0 .55rem;
  color: var(--blue) !important;
  font-size: .8rem;
  font-weight: 900 !important;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.founder-values { display: grid; gap: .65rem; margin-top: 1.2rem; padding: 0; list-style: none; }
.founder-values li { position: relative; padding: .8rem 1rem .8rem 2.8rem; border-radius: 18px; background: var(--blue-soft); color: var(--navy); }
.founder-values li::before { content: "✓"; position: absolute; left: 1rem; color: var(--blue); font-weight: 900; }
.project-grid { display: grid; gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 760px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-card:first-child { grid-column: span 2; }
}
.project-card { display: flex; flex-direction: column; align-items: flex-start; }
.project-card h3 { font-size: 1.4rem; }
.project-card .project-note { padding: .7rem .85rem; border-radius: 14px; background: var(--green-soft); color: var(--navy); }
.project-link { margin-top: auto; font-weight: 900; text-decoration: none; }
.about-principles { margin-top: 1.25rem; }
.about-principles .card { box-shadow: none; }
.about-content .join-card .cta-row { margin-top: 0; }
.join-card { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; background: var(--yellow-soft); border-top: 0 !important; padding: clamp(1.2rem, 3vw, 2rem) !important; }
.join-card .btn { flex: 0 0 auto; }
@media (max-width: 680px) {
  .join-card { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
