/* =====================
   MATHFLOW — CUSTOM THEME
   ===================== */

:root {
  --bg: #f7f5f0;
  --bg-alt: #eeeae2;
  --fg: #1c1a17;
  --fg-muted: #6b6560;
  --accent: #1a5c4a;
  --accent-mid: #2d8b6f;
  --accent-light: #e6f4f0;
  --amber: #e8923a;
  --amber-light: #fdf3e7;
  --card-bg: #ffffff;
  --border: #ddd9d1;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(247, 245, 240, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.nav-tagline {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  font-weight: 400;
}

/* HERO */
.hero {
  padding: 8rem 2rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 540px;
}

.hero-label {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 6vw, 4.25rem);
  font-weight: 800;
  line-height: 1.0;
  color: var(--fg);
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 1.0625rem;
  color: var(--fg-muted);
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 2.5rem;
}

/* LESSON CARD */
.hero-visual {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  z-index: 1;
}

@media (max-width: 900px) {
  .hero-visual { display: none; }
}

.lesson-card {
  background: var(--card-bg);
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
}

.lesson-card-header {
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  letter-spacing: 0.02em;
}

.lesson-card-body {
  padding: 1.25rem;
}

.lesson-step {
  margin-bottom: 1rem;
}

.lesson-step:last-child { margin-bottom: 0; }

.step-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.3rem;
}

.step-text {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  line-height: 1.5;
  display: block;
}

.lesson-card-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 0.25rem;
  background: var(--accent-light);
  color: var(--accent);
}

/* HERO STATS */
.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.stat-sep {
  width: 1px;
  height: 40px;
  background: var(--border);
  margin: 0 2.5rem;
}

/* SECTIONS */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.025em;
  line-height: 1.15;
  max-width: 640px;
  margin: 0 auto;
}

/* HOW IT WORKS */
.how-it-works {
  padding: 5rem 2rem;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.steps-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}

@media (max-width: 768px) {
  .steps-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

.step-card {
  position: relative;
  padding-top: 1rem;
}

.step-num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 0.75rem;
  letter-spacing: -0.04em;
}

.step-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.step-card p {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

/* FEATURES */
.features {
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
}

@media (max-width: 768px) {
  .features-grid { grid-template-columns: 1fr; }
}

.feature {
  padding: 2rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}

.feature:nth-child(3n) { border-right: none; }
.feature:nth-child(n+4) { border-bottom: none; }

@media (max-width: 768px) {
  .feature { border-right: none; }
  .feature:nth-child(n+4) { border-bottom: 1px solid var(--border); }
  .feature:last-child { border-bottom: none; }
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-light);
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 1rem;
}

.feature h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.feature p {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* TESTIMONIAL */
.testimonial {
  padding: 5rem 2rem;
  background: var(--accent);
}

.testimonial-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.quote {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 500;
  font-style: italic;
  color: #fff;
  line-height: 1.5;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

.attribution {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.attr-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-mid);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attr-name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
}

.attr-role {
  display: block;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.65);
  margin-top: 0.15rem;
}

/* CLOSING */
.closing {
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.closing h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.closing > p {
  font-size: 1.0625rem;
  color: var(--fg-muted);
  margin-bottom: 2.5rem;
}

.closing-vision {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem 2.5rem;
  max-width: 680px;
  margin: 0 auto;
}

.closing-vision p {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  line-height: 1.7;
}

/* FOOTER */
.footer {
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}

.footer-links {
  font-size: 0.8rem;
  color: var(--fg-muted);
}
