/* ============================================================
   ApasMath — styles.css
   Design tokens: Playfair Display (display) + Inter (body) + JetBrains Mono (labels/code)
   Accent: #2563eb — matches existing Stripe Checkout branding
   ============================================================ */

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

:root {
  --ink:       #0d1117;
  --ink2:      #24292f;
  --dim:       #57606a;
  --dim2:      #8c959f;
  --rule:      #e3e8ee;
  --rule-dark: #d0d7de;
  --surface:   #f7f9fc;
  --surface2:  #eef2f7;
  --white:     #ffffff;

  --blue:       #2563eb;
  --blue-dark:  #1d4ed8;
  --blue-dim:   #eff6ff;
  --blue-ring:  rgba(37,99,235,0.14);

  --amber:      #d97706;
  --amber-dim:  #fffbeb;
  --green:      #16a34a;
  --green-dim:  #f0fdf4;
  --violet:     #7c3aed;
  --violet-dim: #f5f3ff;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(13,17,23,0.04);
  --shadow:    0 4px 16px rgba(13,17,23,0.06);
  --shadow-lg: 0 12px 32px rgba(13,17,23,0.10);

  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'Inter', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--sans);
  background: var(--white);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--blue-ring); }

img, svg { display: block; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 2rem; }

/* ── Eyebrow label, used throughout ── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dim2);
}
.eyebrow.pill {
  color: var(--blue); background: var(--blue-dim);
  padding: 0.3rem 0.9rem; border-radius: 20px;
}

/* ── Nav ── */
nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px); z-index: 100;
}
.nav-brand {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 700;
  color: var(--ink); letter-spacing: -0.02em; display: flex; align-items: center; gap: 0.4rem;
}
.nav-brand span { color: var(--blue); }
.nav-links { display: flex; align-items: center; gap: 2.1rem; }
.nav-links a { font-size: 0.875rem; color: var(--dim); font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-cta {
  background: var(--blue); color: var(--white) !important;
  padding: 0.5rem 1.2rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600; transition: background 0.15s, transform 0.15s;
}
.nav-cta:hover { background: var(--blue-dark); text-decoration: none !important; transform: translateY(-1px); }

/* ── Hero ── */
.hero { max-width: 900px; margin: 0 auto; padding: 5.5rem 2rem 4rem; text-align: center; }
.hero-eyebrow { margin-bottom: 1.75rem; }
.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2.3rem, 5.2vw, 3.6rem); line-height: 1.15;
  letter-spacing: -0.03em; color: var(--ink); margin-bottom: 1.4rem;
}
.hero h1 em { font-style: italic; color: var(--blue); }
.hero-sub {
  font-size: 1.1rem; color: var(--dim); max-width: 580px;
  margin: 0 auto 2.5rem; line-height: 1.7;
}

.hero-math {
  background: linear-gradient(180deg, var(--surface), var(--white));
  border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: 1.75rem 2rem; margin: 0 auto 2.75rem; max-width: 540px;
  box-shadow: var(--shadow);
}
.hero-math-label {
  font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--dim2); margin-bottom: 0.85rem;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.hero-math-label .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}

.waitlist { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.waitlist input {
  font-family: var(--sans); font-size: 0.95rem;
  padding: 0.75rem 1.1rem; border: 1px solid var(--rule-dark);
  border-radius: var(--radius-sm); outline: none; width: 290px; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.waitlist input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-ring); }
.waitlist button {
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600;
  padding: 0.75rem 1.5rem; background: var(--blue); color: var(--white);
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.waitlist button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.waitlist-note { font-size: 0.78rem; color: var(--dim2); }
#waitlist-msg { font-size: 0.88rem; color: var(--green); margin-top: 0.5rem; display: none; font-weight: 500; }

/* ── Stat strip (proof, not decoration) ── */
.stat-strip {
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 2rem; background: var(--surface);
}
.stat-strip-inner {
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  text-align: center;
}
.stat-num { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; color: var(--ink); }
.stat-label { font-family: var(--mono); font-size: 0.68rem; color: var(--dim2); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.3rem; }

/* ── Free tools ── */
.tools-strip { padding: 4.5rem 2rem 4rem; }
.tools-strip-inner { max-width: 980px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 2.75rem; }
.section-head .eyebrow { justify-content: center; margin-bottom: 0.9rem; }
.section-head h2 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.1rem); color: var(--ink); letter-spacing: -0.02em;
}
.section-head p { color: var(--dim); font-size: 0.98rem; max-width: 480px; margin: 0.6rem auto 0; }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.tool-card {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem;
  text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.tool-card:hover { border-color: var(--blue); text-decoration: none; box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-card-icon {
  width: 34px; height: 34px; border-radius: 8px; background: var(--blue-dim);
  display: flex; align-items: center; justify-content: center; margin-bottom: 0.3rem;
  color: var(--blue);
}
.tool-card-badge {
  font-family: var(--mono); font-size: 0.62rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--green); display: flex; align-items: center; gap: 0.35rem;
}
.tool-card-badge.soon { color: var(--amber); }
.tool-card-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tool-card-name { font-size: 1rem; font-weight: 600; color: var(--ink); }
.tool-card-desc { font-size: 0.83rem; color: var(--dim); line-height: 1.5; }
.tool-card.disabled { opacity: 0.65; cursor: default; }
.tool-card.disabled:hover { transform: none; box-shadow: none; border-color: var(--rule); }

/* ── Features ── */
.features { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 4.5rem 2rem; }
.features-inner { max-width: 980px; margin: 0 auto; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2.25rem; }
.feature { display: flex; flex-direction: column; gap: 0.6rem; }
.feature-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--white); border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center; color: var(--blue);
  box-shadow: var(--shadow-sm);
}
.feature-name { font-size: 1rem; font-weight: 600; color: var(--ink); }
.feature-desc { font-size: 0.86rem; color: var(--dim); line-height: 1.6; }

/* ── Courses ── */
.products { padding: 4.5rem 2rem; }
.products-inner { max-width: 1000px; margin: 0 auto; }
.product-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.1rem; }
.product-item {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem;
  transition: box-shadow 0.15s, transform 0.15s;
}
.product-item:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-item-tag {
  font-family: var(--mono); font-size: 0.63rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--amber);
}
.product-item-tag.ds { color: var(--violet); }
.product-item-name { font-size: 1.02rem; font-weight: 600; color: var(--ink); }
.product-item-desc { font-size: 0.84rem; color: var(--dim); line-height: 1.55; flex: 1; }
.product-item-audience {
  font-size: 0.75rem; color: var(--dim2); font-family: var(--mono);
  padding-top: 0.6rem; margin-top: 0.2rem; border-top: 1px solid var(--rule);
}

/* ── Founder note ── */
.founder { background: var(--surface); border-top: 1px solid var(--rule); padding: 4.5rem 2rem; }
.founder-inner {
  max-width: 720px; margin: 0 auto; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1.1rem;
}
.founder-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--blue-dim); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.3rem;
}
.founder blockquote {
  font-family: var(--serif); font-size: 1.25rem; font-style: italic;
  color: var(--ink2); line-height: 1.55; max-width: 600px;
}
.founder-name { font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.founder-title { font-size: 0.8rem; color: var(--dim); }

/* ── Final CTA ── */
.final-cta { padding: 5rem 2rem; text-align: center; }
.final-cta h2 { font-family: var(--serif); font-size: clamp(1.7rem,3.4vw,2.3rem); font-weight: 700; margin-bottom: 0.9rem; }
.final-cta p { color: var(--dim); margin-bottom: 2rem; }

/* ── Footer ── */
footer { border-top: 1px solid var(--rule); padding: 2.75rem 2rem; }
.footer-inner { max-width: 1080px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: flex-start; }
.footer-brand { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.footer-brand span { color: var(--blue); }
.footer-address { font-size: 0.79rem; color: var(--dim2); margin-top: 0.4rem; line-height: 1.65; }
.footer-links { display: flex; gap: 1.6rem; flex-wrap: wrap; align-items: center; }
.footer-links a { font-size: 0.83rem; color: var(--dim); }
.footer-links a:hover { color: var(--ink); }
.footer-copy { font-size: 0.76rem; color: var(--dim2); width: 100%; margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }

/* ── Responsive ── */
@media (max-width: 760px) {
  .stat-strip-inner { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}
@media (max-width: 600px) {
  nav { padding: 0.875rem 1.25rem; }
  .nav-links { gap: 1rem; }
  .nav-links a:not(.nav-cta) { display: none; }
  .hero { padding: 3.5rem 1.25rem 2.75rem; }
  .hero-math { padding: 1.25rem; }
  .waitlist input { width: 100%; }
  .waitlist { flex-direction: column; align-items: stretch; }
  .tools-strip, .features, .products, .founder, .final-cta { padding-left: 1.25rem; padding-right: 1.25rem; }
  footer { padding: 2rem 1.25rem; }
  .footer-inner { flex-direction: column; }
}

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

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }