/* ==========================================================================
   بوعشرية فيزياء — Sections de la page d'accueil
   À charger APRÈS assets/theme.css, qui fournit les jetons et le socle.
   ========================================================================== */

/* ---------- 1. Sections & titres ---------- */
.section{ padding-block:var(--gap-section); position:relative; }
.section-tinted{ background:var(--surface-2); background:color-mix(in srgb, var(--surface-2) 62%, transparent); }

/* Filet façon axe gradué, avec repère typographique */
.section-tinted::before,
.section-tinted::after{
  content:""; position:absolute; inset-inline:0; height:1px;
  background:var(--line);
}
.section-tinted::before{ inset-block-start:0; }
.section-tinted::after{ inset-block-end:0; }

.section-head{ max-width:640px; margin-inline:auto; text-align:center; margin-block-end:44px; }
.eyebrow{
  display:inline-block;
  font-family:var(--font-mono);
  font-size:.72rem; font-weight:500;
  letter-spacing:.14em; text-transform:uppercase;
  color:var(--brand);
  padding:5px 13px;
  border:1px solid color-mix(in srgb, var(--brand) 32%, transparent);
  border-radius:var(--r-pill);
  margin-block-end:16px;
  direction:ltr;
}
.section-head h2{ font-size:var(--fs-h2); margin-block-end:12px; }
.section-head p{ color:var(--ink-3); }

/* ---------- 2. Héros ---------- */
.hero{
  padding-block-start:calc(var(--nav-h) + clamp(36px, 5vw, 76px));
  padding-block-end:var(--gap-section);
}
.hero-grid{
  display:grid;
  grid-template-columns:1.05fr .95fr;
  align-items:center;
  gap:clamp(32px, 4vw, 64px);
}
.hero-copy h1{
  font-size:var(--fs-h1);
  line-height:1.22;
  margin-block-end:14px;
}
.hero-copy h1 .accent{
  color:var(--brand);
  white-space:nowrap;
  padding-inline:3px;
  /* Trait de surlignage, comme au marqueur sur un cahier */
  background:linear-gradient(to top, var(--brand-soft) 0 .24em, transparent .24em);
}
.hero-tagline{
  font-family:var(--font-mono);
  direction:ltr; text-align:start;
  font-size:clamp(.78rem,.72rem + .3vw,.95rem);
  font-weight:500; letter-spacing:.1em;
  color:var(--ink-3);
  margin-block-end:20px;
}
.hero-copy > p.hero-lead{
  color:var(--ink-2);
  max-width:52ch;
  margin-block-end:28px;
}
.hero-actions{ display:flex; flex-wrap:wrap; gap:12px; margin-block-end:26px; }

.hero-note{
  display:flex; align-items:flex-start; gap:12px;
  padding:14px 16px;
  background:var(--surface);
  border:1px solid var(--line);
  border-inline-start:3px solid var(--brand);
  border-radius:var(--r-m);
  box-shadow:var(--sh-s);
}
.hero-note svg{ width:20px; height:20px; color:var(--brand); flex-shrink:0; margin-block-start:3px; }
.hero-note strong{ display:block; font-family:var(--font-display); font-size:.95rem; margin-block-end:2px; }
.hero-note p{ font-size:var(--fs-sm); color:var(--ink-3); line-height:1.6; }

/* --- Signature : la courbe de progression --- */
.hero-plot{
  position:relative;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-l);
  box-shadow:var(--sh-m);
  padding:20px 20px 16px;
  direction:ltr;              /* un graphe se lit de gauche à droite */
}
.hero-plot-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-block-end:8px;
}
.hero-plot-head .label{
  font-family:var(--font-mono);
  font-size:.68rem; letter-spacing:.12em; text-transform:uppercase;
  color:var(--ink-3);
}
.hero-plot-logo{ height:34px; width:auto; }
.hero-plot svg{ width:100%; height:auto; display:block; overflow:visible; }

.plot-axis{ stroke:var(--line); stroke-width:1.5; }
.plot-tick{ stroke:var(--line); stroke-width:1; }
.plot-tick-label{
  font-family:var(--font-mono); font-size:11px; font-weight:500;
  fill:var(--ink-3);
}
.plot-area{ fill:url(#plotFade); }
.plot-stop-a{ stop-color:var(--brand); stop-opacity:.26; }
.plot-stop-b{ stop-color:var(--brand); stop-opacity:0; }
.plot-curve{
  fill:none; stroke:var(--brand); stroke-width:3;
  stroke-linecap:round; stroke-linejoin:round;
  stroke-dasharray:520; stroke-dashoffset:520;
  animation:draw 1.9s var(--ease) .25s forwards;
}
@keyframes draw{ to{ stroke-dashoffset:0; } }

.plot-point{ fill:var(--brand); }
.plot-halo{ fill:var(--brand); opacity:.22; transform-origin:center; animation:halo 2.6s ease-out infinite; }
@keyframes halo{
  0%{ transform:scale(1); opacity:.28; }
  70%,100%{ transform:scale(2.6); opacity:0; }
}
.plot-goal{
  font-family:var(--font-mono); font-size:11.5px; font-weight:600;
  fill:var(--brand);
}

/* Compte à rebours, sous le graphe */
.countdown{
  display:flex; align-items:center; justify-content:center; gap:10px;
  margin-block-start:14px; padding-block-start:14px;
  border-block-start:1px dashed var(--line);
  direction:rtl;
}
.countdown-value{
  font-family:var(--font-mono);
  font-size:clamp(1.5rem,1.2rem + 1vw,2rem);
  font-weight:600; line-height:1;
  color:var(--brand);
  font-variant-numeric:tabular-nums;
}
.countdown-label{ font-size:var(--fs-sm); color:var(--ink-3); line-height:1.35; }

/* ---------- 3. Présentation ---------- */
.intro-block{
  max-width:800px; margin-inline:auto; text-align:center;
  font-size:clamp(1rem,.95rem + .35vw,1.15rem);
  color:var(--ink-2); line-height:1.85;
  position:relative; padding-block:8px;
}
.intro-block::before{
  content:""; display:block;
  width:52px; height:3px; margin:0 auto 22px;
  background:var(--brand); border-radius:var(--r-pill);
}

/* ---------- 4. Cartes de fonctionnalités ---------- */
.cards-4{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
}
.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-l);
  padding:26px 22px;
  position:relative; overflow:hidden;
  transition:transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.card::before{
  content:""; position:absolute; inset-block-start:0; inset-inline:0;
  height:3px; background:var(--brand);
  transform:scaleX(0); transform-origin:right;
  transition:transform .3s var(--ease);
}
.card:hover{ transform:translateY(-5px); box-shadow:var(--sh-m); border-color:color-mix(in srgb, var(--brand) 40%, var(--line)); }
.card:hover::before{ transform:scaleX(1); }

.card-icon{
  width:46px; height:46px;
  display:flex; align-items:center; justify-content:center;
  border-radius:14px;
  background:var(--brand-soft); color:var(--brand);
  margin-block-end:16px;
}
.card-icon svg{ width:22px; height:22px; }
.card h3{ font-size:var(--fs-h3); margin-block-end:8px; }
.card p{ font-size:var(--fs-sm); color:var(--ink-3); line-height:1.7; }

/* ---------- 5. L'enseignant ---------- */
.teacher{
  display:grid;
  grid-template-columns:300px 1fr;
  gap:clamp(26px,3vw,48px);
  align-items:center;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-l);
  padding:clamp(24px,3vw,40px);
  box-shadow:var(--sh-s);
}
.teacher-media{ position:relative; }
.teacher-photo{
  width:100%; aspect-ratio:1; object-fit:contain;
  background:var(--brand-soft);
  border-radius:var(--r-l);
  padding:22px;
}
.teacher-badge{
  position:absolute; inset-block-end:-12px; inset-inline-start:50%;
  transform:translateX(50%);
  display:inline-flex; align-items:center; gap:7px;
  padding:8px 15px;
  background:var(--brand); color:var(--white);
  border-radius:var(--r-pill);
  font-family:var(--font-display); font-size:.8rem; font-weight:600;
  white-space:nowrap; box-shadow:var(--sh-brand);
}
[data-theme="dark"] .teacher-badge{ color:#04211F; }
.teacher-badge svg{ width:15px; height:15px; }

.teacher-body h2{ font-size:var(--fs-h2); margin-block-end:14px; }
.teacher-body > p{ color:var(--ink-2); margin-block-end:20px; }
.teacher-points{ list-style:none; margin:0 0 24px; padding:0; display:grid; gap:11px; }
.teacher-points li{
  display:flex; align-items:flex-start; gap:11px;
  font-size:var(--fs-sm); color:var(--ink-2);
}
.teacher-points svg{
  width:19px; height:19px; flex-shrink:0; margin-block-start:4px;
  color:var(--green);
}

/* ---------- 6. Étapes (séquence réelle → numérotation justifiée) ---------- */
.steps{
  display:grid; grid-template-columns:repeat(3,1fr);
  gap:20px; position:relative;
}
/* La trajectoire qui relie les trois jalons */
.steps::before{
  content:""; position:absolute;
  inset-block-start:27px; inset-inline:16%;
  height:2px;
  background:repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 16px);
}
.step{ text-align:center; position:relative; }
.step-num{
  width:54px; height:54px; margin:0 auto 18px;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%;
  background:var(--surface);
  border:2px solid var(--brand);
  color:var(--brand);
  font-family:var(--font-mono); font-size:1.05rem; font-weight:600;
  position:relative; z-index:1;
}
.step h3{ font-size:var(--fs-h3); margin-block-end:8px; }
.step p{ font-size:var(--fs-sm); color:var(--ink-3); max-width:34ch; margin-inline:auto; }

/* ---------- 7. Témoignages ---------- */
.testimonials{
  display:grid; grid-template-columns:repeat(3,1fr); gap:18px;
}
.testimonial{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-l);
  padding:26px 24px;
  display:flex; flex-direction:column; gap:16px;
  transition:transform .28s var(--ease), box-shadow .28s var(--ease);
}
.testimonial:hover{ transform:translateY(-4px); box-shadow:var(--sh-m); }
.stars{ display:flex; gap:3px; color:var(--amber); }
.stars svg{ width:16px; height:16px; }
.testimonial > p{ color:var(--ink-2); font-size:var(--fs-sm); line-height:1.8; flex:1; }
.testimonial-author{ display:flex; align-items:center; gap:12px; }
.avatar{
  width:42px; height:42px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%;
  background:var(--brand-soft); color:var(--brand);
  font-family:var(--font-display); font-weight:700; font-size:1.05rem;
}
.testimonial-author strong{ display:block; font-family:var(--font-display); font-size:.92rem; }
.testimonial-author span{ font-size:.8rem; color:var(--ink-3); }

.carousel-nav{ display:none; }

/* ---------- 8. FAQ ---------- */
.faq{ max-width:780px; margin-inline:auto; display:grid; gap:12px; }
.faq-item{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-m);
  overflow:hidden;
  transition:border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.faq-item[open]{ border-color:color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow:var(--sh-s); }
.faq-item summary{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:17px 20px;
  cursor:pointer; list-style:none;
  font-family:var(--font-display); font-weight:600; font-size:.98rem;
  transition:color .2s var(--ease);
}
.faq-item summary::-webkit-details-marker{ display:none; }
.faq-item summary:hover{ color:var(--brand); }
.faq-item summary .chev{
  width:19px; height:19px; flex-shrink:0; color:var(--brand);
  transition:transform .25s var(--ease);
}
.faq-item[open] summary .chev{ transform:rotate(180deg); }
.faq-answer{ padding:0 20px 18px; font-size:var(--fs-sm); color:var(--ink-3); line-height:1.8; }

/* ---------- 9. Appel à l'action final ---------- */
.cta{
  position:relative; overflow:hidden;
  background:var(--ink);
  border-radius:clamp(var(--r-l), 2vw, 32px);
  padding:clamp(38px,5vw,66px) clamp(22px,4vw,52px);
  text-align:center;
}
[data-theme="dark"] .cta{ background:var(--surface-2); border:1px solid var(--line); }
/* Le même papier millimétré, en négatif */
.cta::before{
  content:""; position:absolute; inset:0; pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size:40px 40px;
}
.cta > *{ position:relative; }
.cta h2{
  font-family:var(--font-mono);
  direction:ltr;
  font-size:clamp(1.15rem,.85rem + 1.6vw,2rem);
  font-weight:600; letter-spacing:.02em;
  color:var(--white);
  margin-block-end:12px;
}
.cta p{ color:rgba(255,255,255,.72); max-width:52ch; margin:0 auto 26px; }
.cta .btn-primary{ background:var(--brand-bright); color:#04211F; }
.cta .btn-primary:hover{ background:var(--white); color:var(--ink); }


/* ---------- 10. Responsive des sections d'accueil ---------- */
@media (max-width:1024px){
  .cards-4{ grid-template-columns:repeat(2,1fr); }
  .hero-grid{ grid-template-columns:1fr; gap:36px; }
  .hero-plot{ max-width:520px; margin-inline:auto; }
  .teacher{ grid-template-columns:220px 1fr; }
}

@media (max-width:860px){
  .teacher{ grid-template-columns:1fr; text-align:center; }
  .teacher-media{ max-width:250px; margin-inline:auto; }
  .teacher-points li{ justify-content:center; text-align:start; }

  .steps{ grid-template-columns:1fr; gap:8px; }
  .steps::before{
    top:34px; bottom:34px; left:50%; right:auto;
    transform:translateX(-50%);
    width:2px; height:auto;
    background:repeating-linear-gradient(180deg, var(--line) 0 8px, transparent 8px 16px);
  }
  .step{ padding-block-end:18px; }

  /* Témoignages : carrousel à défilement magnétique */
  .testimonials{
    display:flex; gap:14px;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    scroll-padding-inline:20px;
    padding-block-end:8px;
    margin-inline:-20px; padding-inline:20px;
    scrollbar-width:none;
  }
  .testimonials::-webkit-scrollbar{ display:none; }
  .testimonial{
    flex:0 0 min(84%, 340px);
    scroll-snap-align:center;
  }
  .carousel-nav{
    display:flex; justify-content:center; gap:10px;
    margin-block-start:18px;
  }
}

@media (max-width:640px){
  .cards-4{ grid-template-columns:1fr; }
  .hero-actions .btn{ flex:1 1 100%; }
  .hero-plot{ padding:16px 14px 12px; }
  .countdown{ flex-direction:column; gap:4px; text-align:center; }
  .section-head{ margin-block-end:32px; }
}

@media (prefers-reduced-motion: reduce){
  .plot-curve{ stroke-dashoffset:0; }
}

@media print{
  .card,.testimonial,.faq-item{ break-inside:avoid; }
}
