@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=IBM+Plex+Serif:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --graphite: #1F2937;
  --cream: #F8FAFC;
  --ivory: #FDF6E3;
  --blue: #2563EB;
  --burgundy: #9F1239;
  --text: #1F2937;
  --muted: #64748B;
  --border: #CBD5E1;
  --max: 1140px;
  --radius: 4px;
  --shadow: 0 4px 20px rgba(31,41,55,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--cream);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--burgundy); }
h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  line-height: 1.25;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: 1.35rem; margin-bottom: .75rem; }
p { margin-bottom: 1rem; }
ul, ol { margin: 0 0 1rem 1.5rem; }
.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.section { padding: 4rem 0; }
.section-alt { background: var(--ivory); }
.section-dark { background: var(--graphite); color: var(--cream); }
.section-dark a { color: #93C5FD; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--ivory);
  border-bottom: 1px solid var(--graphite);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 0; gap: 1rem;
}
.logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem; font-weight: 700;
  color: var(--graphite); text-decoration: none;
}
.logo span { color: var(--burgundy); }
.nav-toggle {
  display: none; background: none; border: 2px solid var(--graphite);
  padding: .4rem .65rem; cursor: pointer; font-size: 1.1rem;
}
.main-nav ul { display: flex; list-style: none; margin: 0; gap: .25rem; flex-wrap: wrap; }
.main-nav a {
  display: block; padding: .5rem .85rem;
  color: var(--graphite); font-size: .95rem;
  border-radius: var(--radius);
}
.main-nav a:hover, .main-nav a.active { background: var(--graphite); color: var(--cream); }
.btn {
  display: inline-block; padding: .75rem 1.5rem;
  background: var(--graphite); color: var(--cream);
  border: none; border-radius: var(--radius);
  font-family: 'IBM Plex Serif', serif; font-size: 1rem;
  cursor: pointer; text-align: center; transition: background .2s;
}
.btn:hover { background: var(--burgundy); color: var(--cream); }
.btn-outline {
  background: transparent; border: 2px solid var(--graphite); color: var(--graphite);
}
.btn-outline:hover { background: var(--graphite); color: var(--cream); }

/* Hero */
.hero {
  padding: 4rem 0 3rem;
  background: linear-gradient(135deg, var(--ivory) 60%, var(--cream));
}
.hero-grid {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 2.5rem; align-items: start;
}
.hero-badge {
  display: inline-block; background: var(--graphite); color: var(--cream);
  padding: .35rem .85rem; font-size: .85rem; margin-bottom: 1rem;
  font-family: 'IBM Plex Serif', serif;
}
.hero-sub { font-size: 1.15rem; color: var(--muted); margin-bottom: 1.5rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.toc-box {
  background: var(--cream); border: 1px solid var(--graphite);
  padding: 1.5rem; border-radius: var(--radius);
}
.toc-box h3 { font-size: 1.1rem; border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.toc-box ol { margin: 1rem 0 0 1.2rem; font-size: .95rem; }
.toc-box li { margin-bottom: .35rem; }

/* Chalk underline animation */
.js .chalk-title { position: relative; display: inline-block; }
.js .chalk-title::after {
  content: ''; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 3px; background: var(--graphite);
  transition: width .6s ease;
}
.js .chalk-title.visible::after { width: 100%; }

/* Stats */
.stats-band {
  background: var(--graphite); color: var(--cream);
  padding: 2.5rem 0;
}
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; text-align: center;
}
.stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem; font-weight: 700; color: var(--burgundy);
}
.stat-label { font-size: .9rem; opacity: .85; }

/* Cards */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.card {
  background: var(--ivory); border: 1px solid var(--graphite);
  padding: 1.75rem; border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s;
}
.card:hover { border-color: var(--burgundy); box-shadow: var(--shadow); }
.card-tag {
  display: inline-block; background: var(--graphite); color: var(--cream);
  font-size: .75rem; padding: .2rem .5rem; margin-bottom: .75rem;
}
.card img { border-radius: var(--radius); margin-bottom: 1rem; aspect-ratio: 16/10; object-fit: cover; width: 100%; }

/* Math boxes */
.math-box {
  border-left: 4px solid var(--burgundy);
  background: var(--ivory); padding: 1.25rem 1.5rem; margin: 1.5rem 0;
}
.math-box .label {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--burgundy); font-weight: 600; margin-bottom: .5rem;
}

/* Steps */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li {
  counter-increment: step; position: relative;
  padding: 1.25rem 1.25rem 1.25rem 4rem; margin-bottom: 1rem;
  background: var(--cream); border: 1px solid var(--border); border-radius: var(--radius);
}
.steps li::before {
  content: counter(step); position: absolute; left: 1rem; top: 1.25rem;
  width: 2rem; height: 2rem; background: var(--graphite); color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif; font-weight: 700;
}

/* Trust bar */
.trust-bar {
  background: var(--blue); color: #fff; text-align: center;
  padding: .75rem 1rem; font-size: .9rem;
}

/* Disclaimer */
.disclaimer {
  background: #FEF2F2; border: 1px solid #FECACA;
  padding: 1.25rem 1.5rem; border-radius: var(--radius);
  font-size: .9rem; color: #7F1D1D; margin: 2rem 0;
}
.disclaimer strong { display: block; margin-bottom: .5rem; }

/* Testimonials */
.testimonial {
  background: var(--cream); border: 1px solid var(--border);
  padding: 1.25rem; border-radius: var(--radius); font-style: italic;
}
.testimonial cite { display: block; margin-top: .75rem; font-style: normal; font-size: .85rem; color: var(--muted); }

/* FAQ accordion */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none;
  padding: 1.15rem 2rem 1.15rem 0; font-family: inherit; font-size: 1.05rem;
  font-weight: 600; cursor: pointer; position: relative; color: var(--text);
}
.faq-q::after {
  content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; color: var(--burgundy);
}
.faq-item.open .faq-q::after { content: '−'; }
.faq-a { display: none; padding: 0 0 1.15rem; color: var(--muted); }
.faq-item.open .faq-a { display: block; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: .35rem; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .75rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-family: inherit; font-size: 1rem;
  background: #fff;
}
.form-group textarea { min-height: 140px; resize: vertical; }
.form-check { display: flex; gap: .75rem; align-items: flex-start; }
.form-check input { width: auto; margin-top: .35rem; }
.form-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.alert { padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.5rem; }
.alert-ok { background: #DCFCE7; border: 1px solid #86EFAC; color: #166534; }
.alert-err { background: #FEE2E2; border: 1px solid #FCA5A5; color: #991B1B; }

/* Footer */
.site-footer {
  background: var(--graphite); color: #CBD5E1;
  padding: 3rem 0 1.5rem; font-size: .9rem;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem; margin-bottom: 2rem;
}
.footer-grid h4 { color: var(--cream); margin-bottom: .75rem; font-size: 1rem; }
.footer-grid ul { list-style: none; margin: 0; }
.footer-grid li { margin-bottom: .4rem; }
.footer-grid a { color: #94A3B8; }
.footer-grid a:hover { color: var(--cream); }
.footer-bottom {
  border-top: 1px solid #374151; padding-top: 1.5rem;
  text-align: center; font-size: .82rem; color: #9CA3AF;
}

/* Cookie banner */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--graphite); color: var(--cream);
  padding: 1.25rem; box-shadow: 0 -4px 20px rgba(0,0,0,.2);
  transform: translateY(100%); transition: transform .3s;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-inner { max-width: var(--max); margin: 0 auto; }
.cookie-text { font-size: .9rem; margin-bottom: 1rem; line-height: 1.6; }
.cookie-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.cookie-actions .btn { font-size: .85rem; padding: .55rem 1rem; }
.btn-accept { background: var(--burgundy); }
.btn-refuse { background: transparent; border: 1px solid var(--cream); }
.btn-customize { background: #374151; }

.cookie-modal {
  display: none; position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.5); align-items: center; justify-content: center; padding: 1rem;
}
.cookie-modal.show { display: flex; }
.cookie-modal-box {
  background: var(--cream); color: var(--text); max-width: 480px;
  padding: 2rem; border-radius: var(--radius); width: 100%;
}
.cookie-modal-box h3 { margin-bottom: 1rem; }
.cookie-option { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.cookie-option label { display: flex; gap: .75rem; align-items: flex-start; cursor: pointer; }

/* Page header */
.page-header {
  background: var(--ivory); border-bottom: 1px solid var(--graphite);
  padding: 2.5rem 0 2rem;
}
.page-header p { color: var(--muted); max-width: 680px; }

/* Legal pages */
.legal-content h2 { margin-top: 2rem; }
.legal-content h3 { margin-top: 1.5rem; font-size: 1.15rem; }

/* 404 */
.error-page { text-align: center; padding: 5rem 1rem; }
.error-page h1 { margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--ivory); border-bottom: 1px solid var(--graphite); padding: 1rem;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .header-cta { display: none; }
}
