/* Couleur différente pour le côté scolaire */
:root {
  --school-bg: #1a1b22;
  --school-panel: #22252d;
  --school-text: #f0f0f0;
  --school-brand: #ff6b6b; /* Rouge/rose pour le côté scolaire */
  --school-brand-soft: #ff9f8a;
  --school-accent: #ffd166;
  --school-muted: #b0b3b8;
  --school-ring: 0 0 0 2px color-mix(in srgb, var(--school-brand) 35%, transparent);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Page entière */
body {
  margin: 0;
  min-height: 100vh;
  color: var(--school-text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial;
  line-height: 1.6;
  background:
    radial-gradient(1000px 700px at 92% -10%, rgba(255,107,107,.15), transparent 58%),
    radial-gradient(900px 620px at -10% 20%, rgba(255,209,102,.12), transparent 52%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.015) 0 2px, transparent 2px 16px),
    var(--school-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

/* Header */
header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(8px);
  background: color-mix(in srgb, var(--school-bg) 82%, transparent);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 10px 24px rgba(0,0,0,.24);
}
header .nav { display: flex; justify-content: space-between; align-items: center; padding: 14px 8px; }
header .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--school-text); }
header .brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--school-brand);
  box-shadow: 0 0 0 4px rgba(255,107,107,.15);
  animation: pulse 2s infinite alternate;
}
@keyframes pulse { from{transform:scale(1)} to{transform:scale(1.3)} }
header .menu { display: flex; gap: 18px; }
header .menu a {
  opacity: .88;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: 0.3s;
  color: var(--school-text);
  font-weight: 500;
}
header .menu a:hover {
  background: rgba(255,107,107,0.18);
  border-color: rgba(255,107,107,.4);
  color: #2a0f10;
  opacity: 1;
}

/* Sections épreuves */
.epreuve {
  padding: 60px 0;
  opacity: 1;
  transform: translateY(0);
  transition: all 1s ease;
}
.epreuve.visible { opacity: 1; transform: translateY(0); }

/* Section header */
.epreuve .section-header h2 { font-size: 2rem; margin-bottom: 8px; color: var(--school-brand); }
.epreuve .section-header p { color: var(--school-muted); font-size: 1rem; }

.epreuve .section-header {
  margin-bottom: 16px;
}

/* Grilles */
.epreuve .grid-2, .epreuve .grid-3 { display: grid; gap: 20px; }
.epreuve .grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); }
.epreuve .grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); }
@media (max-width: 920px) { .epreuve .grid-2, .epreuve .grid-3 { grid-template-columns: 1fr; } }

/* Cartes */
.epreuve .card {
  background:
    linear-gradient(160deg, rgba(255,255,255,.02), transparent 55%),
    var(--school-panel);
  padding: 24px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
  color: var(--school-text);
  position: relative;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
}
.epreuve .card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(130deg, rgba(255,107,107,.18), rgba(255,209,102,.07) 40%, transparent 70%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}

.epreuve .card.visible {
  opacity: 1;
  transform: translateY(0);
}

.js-animate .epreuve .card:not(.visible) {
  opacity: 0;
  transform: translateY(24px);
}

.epreuve .card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(255,107,107,.6);
  box-shadow: 0 20px 44px rgba(0,0,0,.3);
}

.epreuve .card:hover::before {
  opacity: 1;
}

/* Titres et textes cartes */
.epreuve .card h3, .epreuve .card h4 { color: var(--school-brand); margin-bottom: 10px; }
.epreuve .card p, .epreuve .card li { color: var(--school-text); font-size: 0.95rem; line-height: 1.5; }
.epreuve .card ul { padding-left: 18px; margin-top: 6px; }
.epreuve .card .project-links { margin-top: 14px; }
.epreuve .card .project-links a {
  color: #ffd9cf;
  font-weight: 600;
  text-decoration: none;
}
.epreuve .card .project-links a:hover {
  color: var(--school-brand-soft);
  text-decoration: underline;
}

.sommaire-links {
  gap: 12px !important;
}

.sommaire-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  border-radius: 12px !important;
  border: 1px solid rgba(255,209,102,.45) !important;
  background: linear-gradient(90deg, #ff6b6b, #ff8f6b) !important;
  color: #250d0d !important;
  font-weight: 800 !important;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.sommaire-link:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow: 0 12px 24px rgba(255,107,107,.28);
}

.epreuve details {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
  background: rgba(255,255,255,.02);
}

.epreuve summary {
  cursor: pointer;
  color: #ffe2d9;
  font-weight: 700;
}

/* Blocs stage (1, 2, 3) */
.stage-layout {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

.stage-hero {
  display: grid;
  grid-template-columns: minmax(260px, 330px) 1fr;
  gap: 18px;
  align-items: stretch;
}

.stage-media {
  background: linear-gradient(165deg, rgba(255,107,107,.17), rgba(255,209,102,.07));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 14px 30px rgba(0,0,0,.2);
}

.stage-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
}

.stage-media-caption {
  margin: 10px 0 2px;
  color: #ffe7de;
  font-size: .9rem;
  font-weight: 600;
}

.stage-panel,
.stage-info-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 16px 18px;
}

.stage-panel h4,
.stage-info-card h5 {
  margin: 0 0 8px;
  color: #ffd8cb;
}

.stage-info-card h5 {
  font-size: 1rem;
}

.stage-kicker {
  margin: 0 0 8px;
  color: var(--school-accent) !important;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
}

.stage-tools {
  margin-top: 10px;
  color: #ffd8cb !important;
  font-weight: 600;
}

.stage-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* Comparatif avant / apres */
.before-after-list {
  display: grid;
  gap: 20px;
  margin: 18px 0 8px;
}

.before-after-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.compare-shot {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.02);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}

.compare-shot img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  background: #12141b;
}

.compare-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.compare-badge.before {
  background: rgba(255, 107, 107, .92);
}

.compare-badge.after {
  background: rgba(67, 176, 92, .92);
}

.compare-caption {
  margin: 0;
  padding: 10px 12px;
  font-size: .9rem;
  color: var(--school-muted);
}

.epreuve summary::marker {
  color: var(--school-accent);
}

.epreuve details[open] {
  border-color: rgba(255,107,107,.45);
  background: rgba(255,107,107,.06);
}

.mission-note {
  margin: 6px 0 10px;
  color: var(--school-muted);
  font-size: 0.9rem;
}

.mission-validated {
  list-style: none;
  margin: 8px 0 2px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.mission-validated li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(24, 84, 45, 0.2);
  border: 1px solid rgba(84, 205, 126, 0.45);
}

.mission-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1d9b4b;
  color: #08210f;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Timeline / progression optionnelle */
.epreuve .timeline { position: relative; margin: 20px 0 0 6px; }
.epreuve .timeline:before {
  content: "";
  position: absolute; left: 10px; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(var(--school-brand), transparent);
}
.epreuve .tl-item { position: relative; padding-left: 34px; margin: 22px 0; opacity: 0; transform: translateX(-20px); transition: all .8s ease; }
.epreuve .tl-item.visible { opacity: 1; transform: translateX(0); }
.epreuve .tl-item:before {
  content: ""; position: absolute; left: 2px; top: .35rem;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--school-brand); box-shadow: 0 0 0 4px rgba(255,107,107,.15);
}

@media (max-width: 820px) {
  header .nav { flex-wrap: wrap; gap: 10px; }
  header .menu { width: 100%; justify-content: center; flex-wrap: wrap; gap: 10px; }
  .epreuve { padding: 42px 0; }
  .epreuve .card { padding: 18px; }
  .epreuve .section-header h2 { font-size: clamp(1.35rem, 4vw, 1.85rem); }

  .stage-hero,
  .stage-info-grid {
    grid-template-columns: 1fr;
  }

  .epreuve .card div[style*="display:flex"][style*="gap:20px"] {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .epreuve .card div[style*="min-width:280px"] {
    min-width: 0 !important;
    width: 100%;
  }

  .sommaire-link {
    width: 100%;
  }
}
@media (max-width: 768px) {
  .before-after-row {
    grid-template-columns: 1fr;
  }
}
