/* ===========================================================
   Million Data Baby — feuille de style commune
   Palette : violet #2f0c5b, corail #ea5050, blanc #ffffff, lilas clair #edeaf4
   Accents cartes : turquoise #6af2d1, magenta #d990f9, cyan #40ebfc
   Polices : DejaVu Sans (titres), DejaVu Sans Mono (texte)
   =========================================================== */

/* ---------- Polices hébergées (DejaVu, libre) ---------- */
@font-face {
  font-family: "DejaVu Sans";
  src: url("fonts/DejaVuSans.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DejaVu Sans";
  src: url("fonts/DejaVuSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DejaVu Sans Mono";
  src: url("fonts/DejaVuSansMono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DejaVu Sans Mono";
  src: url("fonts/DejaVuSansMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --violet: #2f0c5b;
  --corail: #ea5050;
  --blanc: #ffffff;
  --lilas: #edeaf4;
  --turquoise: #6af2d1;
  --magenta: #d990f9;
  --cyan: #40ebfc;
  --gris: #7c7390;
  --max: 1100px;
  --titre: "DejaVu Sans", "Helvetica Neue", Arial, sans-serif;
  --texte: "DejaVu Sans Mono", "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--texte);
  color: var(--violet);
  background: var(--blanc);
  line-height: 1.6;
}

a { color: inherit; }

img, svg { max-width: 100%; height: auto; }

.wrap { width: 100%; }
.wrap-sticky-footer { min-height: 100vh; display: flex; flex-direction: column; }
.wrap-sticky-footer footer.site { margin-top: auto; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- En-tête / navigation ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--violet);
  border-bottom: 2px solid var(--violet);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
}
.nav .logo { display: flex; align-items: center; }
.nav .logo svg, .nav .logo img { width: 200px; height: auto; }
.nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav a {
  text-decoration: none;
  color: var(--blanc);
  font-weight: 700;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a.active { border-bottom-color: var(--corail); }

.burger { display: none; background: none; border: 0; cursor: pointer; font-size: 26px; color: var(--blanc); }

/* ---------- Sections ---------- */
section { padding: 72px 0; }

.hero {
  background: var(--violet);
  color: var(--blanc);
  border-bottom: none;
}
.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 18px;
}
.hero p.lead { font-size: 1.5rem; margin-bottom: 10px; }
.hero blockquote {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: .875rem;
  margin: 20px 0;
}
.hero small { color: var(--blanc); opacity: .7; font-size: .75rem; }

h1, h2, h3, h4 { font-family: var(--titre); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 700; margin-bottom: 22px; }
h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 14px; }
section p { margin-bottom: 16px; max-width: 70ch; }

/* sections de contenu : fond blanc, titres violets */
.bg-blanc { background: var(--blanc); color: var(--violet); }
.bg-creme { background: #f7f5f0; color: var(--violet); }
.bg-violet { background: var(--violet); color: var(--blanc); }
.bg-violet h2, .bg-violet h3 { color: var(--blanc); }
/* bandeau violet centré façon "Prêt·e pour le grand saut ?" */
.bandeau {
  background: var(--violet);
  color: var(--blanc);
  text-align: center;
}
.bandeau h2 { margin-bottom: 0; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--violet);
  text-decoration: none;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: 6px;
  border: 2px solid var(--violet);
  transition: transform .08s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
/* bouton sur fond violet : contour blanc */
.hero .btn, .bg-violet .btn, .bandeau .btn {
  color: var(--blanc);
  border-color: var(--blanc);
}
.hero .btn:hover, .bg-violet .btn:hover { background: var(--blanc); color: var(--violet); }
/* bouton plein corail / brique (accent) */
.btn.corail, .btn.brique { background: var(--corail); border-color: var(--corail); color: var(--blanc); }
.btn.corail:hover, .btn.brique:hover { background: #d63d3d; border-color: #d63d3d; color: var(--blanc); }
/* bouton plein violet sur fond clair */
.btn.plein { background: var(--violet); color: var(--blanc); }
.btn.plein:hover { background: #25094a; color: var(--blanc); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Vidéo responsive ---------- */
.video {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--violet);
  border-radius: 10px;
  overflow: hidden;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Page cartes ---------- */
.cards-intro { text-align: center; }
.cards-intro p { margin-left: auto; margin-right: auto; }

.search-bar {
  display: flex;
  justify-content: center;
  margin: 32px auto 8px;
}
.search-bar input {
  width: 100%;
  max-width: 420px;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid var(--violet);
  border-radius: 8px;
  font-family: inherit;
}
.cards-count { text-align: center; color: var(--gris); margin-bottom: 16px; }

/* Filtres chapitre */
.chapter-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 24px;
}
.chapter-filters button {
  background: transparent;
  border: 2px solid var(--violet);
  color: var(--violet);
  font-family: var(--texte);
  font-size: .82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.chapter-filters button:hover { background: var(--lilas); }
.chapter-filters button.active { background: var(--violet); color: var(--blanc); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}
.card {
  background: #fff;
  border: 2px solid var(--violet);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card .thumb {
  position: relative;
  background: var(--lilas);
  aspect-ratio: 63 / 88;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid var(--violet);
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .placeholder { color: var(--gris); font-size: .9rem; padding: 20px; text-align: center; }
.card .body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .name { font-weight: 700; font-size: 1.05rem; }
.card .desc { color: var(--gris); font-size: .9rem; flex: 1; }
.card .actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.card .actions .btn { padding: 9px 14px; font-size: .85rem; }
.card .pdf-weight { font-weight: 400; opacity: .85; font-size: .78rem; }
.chip-chapitre {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--violet);
  color: var(--blanc);
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: .03em;
  pointer-events: none;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--gris);
  padding: 60px 20px;
}

/* Grille 2 colonnes réutilisable */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.grid-2col-center { align-items: center; }

/* Lien Accueil caché sur desktop, visible sur mobile */
.nav-accueil { display: none; }

/* ---------- Pied de page ---------- */
footer.site {
  background: var(--violet);
  color: var(--blanc);
  padding: 32px 0;
}
footer.site .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
footer.site img { width: 160px; height: auto; }
footer.site a { text-decoration: none; opacity: .85; }
footer.site a:hover { opacity: 1; text-decoration: underline; }
footer.site .copyright { font-size: .85rem; opacity: .75; }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  section { padding: 40px 0; }

  .hero .container { grid-template-columns: 1fr; }
  .hero p.lead { font-size: 1.1rem; }

  .grid-2col { grid-template-columns: 1fr; }

  .nav { position: relative; }
  .nav .logo img { width: 140px; }
  .nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    flex-direction: column;
    background: var(--violet);
    border-bottom: 2px solid rgba(255,255,255,.2);
    padding: 16px 24px;
    gap: 16px;
  }
  .nav ul.open { display: flex; }
  .burger { display: block; }
  .nav-accueil { display: block; }

  .bg-violet .video { border-color: rgba(255,255,255,.3); }

  footer.site .container { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ---------- Page Histoire : timeline ---------- */
.timeline {
  position: relative;
  padding-left: 36px;
  margin-top: 40px;
  border-left: 3px solid var(--corail);
}
.step {
  position: relative;
  padding-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.step:last-child { padding-bottom: 0; }
.step::before {
  content: '';
  position: absolute;
  left: calc(-36px - 7px);
  top: 5px;
  width: 14px; height: 14px;
  background: var(--blanc);
  border: 3px solid var(--corail);
  border-radius: 50%;
  z-index: 1;
}
.step-year {
  font-family: var(--titre);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--violet);
  line-height: 1;
}
.step .chip {
  display: inline-flex;
  align-self: flex-start;
  background: var(--violet);
  color: var(--blanc);
  font-size: .68rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.step-body {
  font-size: .9rem;
  color: var(--gris);
  line-height: 1.5;
}

/* ---------- Page Histoire : créateurs ---------- */
footer.site .links { display: flex; gap: 24px; flex-wrap: wrap; }
footer.site .made { display: flex; align-items: center; gap: 8px; font-size: .9rem; opacity: .85; }
footer.site .made img { width: 90px; height: auto; }

.creators {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 32px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.creator { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.creator-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--lilas);
  border: 2px solid var(--violet);
  border-radius: 12px;
  overflow: hidden;
}
.creator-photo img { width: 100%; height: 100%; object-fit: cover; }
.creator-name { font-family: var(--titre); font-weight: 700; font-size: 1.2rem; }

@media (max-width: 800px) {
  .creators { grid-template-columns: 1fr; }
}

/* ---------- Modale ---------- */
.modal { display: none; position: fixed; inset: 0; z-index: 200; }
.modal.open { display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.modal-box {
  position: relative;
  z-index: 1;
  background: var(--blanc);
  border-radius: 12px;
  padding: 36px 40px;
  max-width: 620px;
  width: calc(100% - 48px);
  max-height: 85vh;
  overflow-y: auto;
}
.modal-box h3 { font-family: var(--titre); font-size: 1.3rem; margin-bottom: 20px; color: var(--violet); }
.modal-content p { margin-bottom: 14px; font-size: .95rem; line-height: 1.7; color: var(--violet); max-width: none; }
.modal-content a { color: var(--corail); }
.modal-content ul { margin: 0 0 14px 20px; }
.modal-content ul li { font-size: .95rem; line-height: 1.7; color: var(--violet); }
.modal-content h4 { font-family: var(--titre); font-size: 1rem; font-weight: 700; margin: 18px 0 8px; color: var(--violet); }
.modal-close {
  position: absolute;
  top: 16px; right: 18px;
  background: none; border: none;
  font-size: 1.2rem; cursor: pointer;
  color: var(--violet); opacity: .5;
  line-height: 1;
}
.modal-close:hover { opacity: 1; }
.modal-source {
  font-size: .8rem;
  color: var(--gris);
  border-top: 1px solid var(--lilas);
  padding-top: 14px;
  margin-top: 8px;
}
.modal-source a { color: var(--corail); }
.modal-trigger {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-bottom: 1px dashed currentColor;
  text-decoration: none;
}
.modal-trigger:hover { border-bottom-style: solid; }

@media (max-width: 800px) {
  .modal-box { padding: 28px 20px; }
}

/* ---------- Utilitaire accessibilité ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
