:root {
  --encre: #0D0A25;
  --indigo: #241B4F;
  --rose: #E0297B;
  --bleu-ciel: #2E74C2;
  --blanc: #FFFFFF;
  --lavande: #ADA7CC;
  --radius: 20px;
  --shadow: 0 12px 32px rgba(13, 10, 37, 0.35);
  --page-bg: radial-gradient(ellipse 1400px 1000px at 50% 30%, #2b2264 0%, #1a1442 45%, #0D0A25 100%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Quicksand", sans-serif;
  color: var(--blanc);
  background: var(--encre);
  line-height: 1.5;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

h1, h2, h3 {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--blanc);
}

.eyebrow {
  font-family: "Quicksand", sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lavande);
  text-align: center;
  margin-bottom: 10px;
}
.eyebrow-dark { color: var(--bleu-ciel); }

.section-subtitle {
  color: var(--lavande);
  font-size: 1.1rem;
  max-width: 620px;
  margin: 0 auto 40px;
  text-align: center;
}

section h2 { text-align: center; font-size: 2.1rem; }

/* Wordmark */
.wordmark {
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}
.wm-logi { color: var(--blanc); }
.wm-maths { color: var(--rose); }
.wordmark-sm { font-size: 1.4rem; }
.wordmark-lg { font-size: 3rem; margin-bottom: 14px; }

/* Logo ring */
.logo-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 6px solid var(--rose);
  box-sizing: border-box;
  flex-shrink: 0;
  overflow: hidden;
}
.logo-ring img { width: 86%; height: 86%; object-fit: contain; }
.logo-ring-sm { width: 44px; height: 44px; border-width: 3px; }
.logo-ring-lg { width: 150px; height: 150px; margin-bottom: 18px; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--rose);
  color: var(--blanc);
  box-shadow: 0 8px 20px rgba(224, 41, 123, 0.4);
}
.btn-secondary {
  background: transparent;
  color: var(--blanc);
  border: 2px solid var(--lavande);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(13, 10, 37, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.main-nav { display: flex; gap: 28px; }
.main-nav a {
  color: var(--lavande);
  text-decoration: none;
  font-weight: 600;
}
.main-nav a:hover { color: var(--blanc); }

.btn-nav { padding: 10px 22px; font-size: 0.95rem; }

/* Decorative blobs */
.blob {
  position: absolute;
  border-radius: 999px;
  background: var(--bleu-ciel);
  filter: blur(4px);
  z-index: 0;
  pointer-events: none;
}
.blob-hero {
  width: 480px;
  height: 480px;
  opacity: 0.35;
  bottom: -240px;
  left: 50%;
  transform: translateX(-50%);
}
/* Hero side decorations (Pythagore / Thalès) */
.hero-deco {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 220px;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}
.hero-deco-left { left: -20px; }
.hero-deco-right { right: -20px; }
.deco-svg { width: 100%; height: auto; overflow: visible; }

/* Pythagore */
.pyth-triangle {
  fill: none;
  stroke: var(--lavande);
  stroke-width: 3;
  opacity: 0;
  animation: pythFade 9s ease-in-out infinite;
}
.pyth-square {
  fill-opacity: 0.12;
  stroke-width: 3;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
}
.sq-a { stroke: var(--blanc); fill: var(--blanc); animation: pythDrawA 9s ease-in-out infinite; }
.sq-b { stroke: var(--bleu-ciel); fill: var(--bleu-ciel); animation: pythDrawB 9s ease-in-out infinite; }
.sq-c {
  stroke: var(--rose);
  fill: var(--rose);
  animation: pythDrawC 9s ease-in-out infinite, pythGlow 9s ease-in-out infinite;
}

@keyframes pythFade {
  0%, 100% { opacity: 0; }
  6%, 92% { opacity: 1; }
}
@keyframes pythDrawA {
  0%, 100% { opacity: 0; stroke-dashoffset: 100; }
  10% { opacity: 1; }
  25%, 92% { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes pythDrawB {
  0%, 22%, 100% { opacity: 0; stroke-dashoffset: 100; }
  28% { opacity: 1; }
  42%, 92% { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes pythDrawC {
  0%, 38%, 100% { opacity: 0; stroke-dashoffset: 100; }
  44% { opacity: 1; }
  58%, 92% { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes pythGlow {
  0%, 60%, 100% { filter: drop-shadow(0 0 0 rgba(224, 41, 123, 0)); }
  78% { filter: drop-shadow(0 0 8px rgba(224, 41, 123, 0.9)); }
  92% { filter: drop-shadow(0 0 0 rgba(224, 41, 123, 0)); }
}

/* Thales */
.thales-ray {
  stroke: var(--lavande);
  stroke-width: 2.5;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
  animation: thalesDrawRay 9s ease-in-out infinite;
}
.thales-parallel {
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
}
.thales-p1 { stroke: var(--bleu-ciel); animation: thalesDrawP1 9s ease-in-out infinite; }
.thales-p2 { stroke: var(--rose); animation: thalesDrawP2 9s ease-in-out infinite, thalesGlow 9s ease-in-out infinite; }
.thales-dot {
  fill: var(--blanc);
  opacity: 0;
  animation: thalesDots 9s ease-in-out infinite;
}

@keyframes thalesDrawRay {
  0%, 100% { opacity: 0; stroke-dashoffset: 100; }
  6% { opacity: 1; }
  20%, 92% { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes thalesDrawP1 {
  0%, 24%, 100% { opacity: 0; stroke-dashoffset: 100; }
  30% { opacity: 1; }
  40%, 92% { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes thalesDrawP2 {
  0%, 40%, 100% { opacity: 0; stroke-dashoffset: 100; }
  46% { opacity: 1; }
  56%, 92% { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes thalesGlow {
  0%, 60%, 100% { filter: drop-shadow(0 0 0 rgba(46, 116, 194, 0)); }
  78% { filter: drop-shadow(0 0 7px rgba(224, 41, 123, 0.85)); }
  92% { filter: drop-shadow(0 0 0 rgba(46, 116, 194, 0)); }
}
@keyframes thalesDots {
  0%, 100% { opacity: 0; }
  10%, 92% { opacity: 1; }
}

/* Thalès configuration papillon */
.papillon-line {
  fill: none;
  stroke: var(--lavande);
  stroke-width: 2.5;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
  animation: papillonLine 9s ease-in-out infinite;
}
.papillon-seg {
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
}
.papillon-top { stroke: var(--bleu-ciel); animation: papillonTop 9s ease-in-out infinite; }
.papillon-bottom { stroke: var(--rose); animation: papillonBottom 9s ease-in-out infinite, papillonGlow 9s ease-in-out infinite; }
.papillon-dot { fill: var(--blanc); opacity: 0; animation: papillonDots 9s ease-in-out infinite; }

@keyframes papillonLine {
  0%, 100% { opacity: 0; stroke-dashoffset: 100; }
  6% { opacity: 1; }
  20%, 92% { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes papillonTop {
  0%, 24%, 100% { opacity: 0; stroke-dashoffset: 100; }
  30% { opacity: 1; }
  40%, 92% { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes papillonBottom {
  0%, 40%, 100% { opacity: 0; stroke-dashoffset: 100; }
  46% { opacity: 1; }
  56%, 92% { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes papillonGlow {
  0%, 60%, 100% { filter: drop-shadow(0 0 0 rgba(224, 41, 123, 0)); }
  78% { filter: drop-shadow(0 0 7px rgba(224, 41, 123, 0.85)); }
  92% { filter: drop-shadow(0 0 0 rgba(224, 41, 123, 0)); }
}
@keyframes papillonDots {
  0%, 100% { opacity: 0; }
  10%, 92% { opacity: 1; }
}

/* Trigonométrie SOH CAH TOA */
.trigo-triangle {
  fill: none;
  stroke: var(--lavande);
  stroke-width: 3;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
  animation: trigoTriangle 9s ease-in-out infinite;
}
.trigo-arc {
  fill: none;
  stroke: var(--rose);
  stroke-width: 2.5;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
  animation: trigoArc 9s ease-in-out infinite;
}
.trigo-theta {
  font-family: 'Baloo 2', sans-serif;
  font-size: 20px;
  fill: var(--rose);
  opacity: 0;
  animation: trigoArc 9s ease-in-out infinite;
}
.trigo-hl {
  stroke-width: 4.5;
  stroke-linecap: round;
  opacity: 0;
}
.trigo-soh { stroke: var(--bleu-ciel); animation: trigoSoh 9s ease-in-out infinite; }
.trigo-cah { stroke: var(--rose); animation: trigoCah 9s ease-in-out infinite; }
.trigo-toa { stroke: var(--blanc); animation: trigoToa 9s ease-in-out infinite; }
.trigo-label {
  font-family: 'Baloo 2', sans-serif;
  font-size: 26px;
  font-weight: 800;
  text-anchor: middle;
  opacity: 0;
}
.trigo-label-soh { fill: var(--bleu-ciel); animation: trigoSoh 9s ease-in-out infinite; }
.trigo-label-cah { fill: var(--rose); animation: trigoCah 9s ease-in-out infinite; }
.trigo-label-toa { fill: var(--blanc); animation: trigoToa 9s ease-in-out infinite; }

@keyframes trigoTriangle {
  0%, 100% { opacity: 0; stroke-dashoffset: 100; }
  6% { opacity: 1; }
  16%, 92% { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes trigoArc {
  0%, 16%, 100% { opacity: 0; stroke-dashoffset: 100; }
  22% { opacity: 1; }
  28%, 92% { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes trigoSoh {
  0%, 26%, 68%, 100% { opacity: 0; }
  32%, 62% { opacity: 1; }
}
@keyframes trigoCah {
  0%, 42%, 100% { opacity: 0; }
  48%, 78% { opacity: 1; }
  82% { opacity: 0; }
}
@keyframes trigoToa {
  0%, 58%, 100% { opacity: 0; }
  64%, 88% { opacity: 1; }
  92% { opacity: 0; }
}

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

.blob-how {
  width: 360px;
  height: 360px;
  opacity: 0.18;
  top: -120px;
  right: -120px;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--page-bg);
  padding: 96px 0 88px;
  text-align: center;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero h1 {
  font-size: 2.75rem;
  max-width: 700px;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--lavande);
  max-width: 520px;
  margin: 0 auto 32px;
}
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* Levels */
.levels { padding: 96px 0; position: relative; overflow: hidden; }
.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.level-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.level-card:hover { transform: translateY(-6px); }
.level-icon { font-size: 2.5rem; margin-bottom: 12px; }
.level-card h3 { font-size: 1.3rem; }
.level-card p { color: var(--lavande); margin: 0; }

/* How it works */
.how-it-works {
  position: relative;
  overflow: hidden;
  background: var(--indigo);
  padding: 96px 0;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.step-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 32px 26px;
}
.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--rose);
  color: var(--blanc);
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.step-card h3 { font-size: 1.2rem; }
.step-card p { color: var(--lavande); margin: 0; }

/* CTA */
.cta-section {
  padding: 96px 0;
  background: var(--encre);
}
.cta-inner { text-align: center; }
.signup-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.signup-form input[type="email"] {
  flex: 1;
  min-width: 240px;
  padding: 14px 18px;
  border-radius: 999px;
  border: none;
  font-family: "Quicksand", sans-serif;
  font-size: 1rem;
}

/* Footer */
.site-footer {
  background: var(--encre);
  padding: 32px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-copy { margin: 0; font-size: 0.9rem; color: var(--lavande); }

.social-links { display: flex; gap: 14px; }
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--lavande);
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.social-link:hover {
  color: var(--rose);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .levels-grid, .steps-grid { grid-template-columns: 1fr; }
}
