:root {

  --charte-vert: #00b558;
  --charte-rose: #ff82ba;
  --charte-bleu: #0079fc;
  --charte-orange: #ff6338;
  --charte-jaune: #ffd62c;
  --charte-bleu-fonce: #1c2939;

  --color-fond: var(--charte-bleu-fonce);
  --color-texte: #F8F6F0;
  --color-accent: var(--charte-orange);
  --color-second: var(--charte-jaune);
  --color-muted: #b3add6;
  --color-bordure: rgba(248, 246, 240, 0.15);
  --color-bleu-btn: #66b3ff;

  --font-display: "Caveat", cursive;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  color-scheme: dark;
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-texte);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-fond);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(255, 214, 44, 0.10), transparent) top -15% left -15% / 55% 55% no-repeat,
    radial-gradient(closest-side, rgba(255, 130, 186, 0.10), transparent) top -10% right -15% / 50% 50% no-repeat,
    radial-gradient(closest-side, rgba(0, 121, 252, 0.14), transparent) bottom -20% left 20% / 60% 60% no-repeat;
}

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 12vh 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.logo {
  width: 220px;
  height: auto;
  margin-bottom: 40px;
  animation: apparition 0.7s ease both;
  transition: transform 0.25s ease;
}

.logo:hover {
  transform: rotate(-2deg) scale(1.03);
}

.logo img {
  width: 100%;
  height: auto;
  display: block;
}

.logo .logo-fond-clair {
  display: none;
}

.logo .logo-fond-sombre {
  display: block;
}

.cartouche {
  max-width: 600px;
  width: 100%;
  padding: 0;
  animation: apparition 0.7s ease 0.12s both;
}

@keyframes apparition {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.cartouche p {
  font-size: 1.15rem;
  margin-bottom: 24px;
  color: var(--color-texte);
}

.tagline {
  display: block;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: 34px;
  line-height: 1.1;
}

.cta {
  position: relative;
  display: inline-block;
  background: var(--color-accent);
  color: #000;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  margin: 4px 0 24px;
  padding: 14px 28px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cta:hover,
.cta:focus {
  background: #fff;
  color: var(--charte-bleu-fonce);
  transform: translateY(-2px);
}

.cta:focus-visible {
  outline: 3px solid var(--color-texte);
  outline-offset: 3px;
}

.cta-secondaire {
  display: inline-block;
  margin-top: 32px;
  padding: 12px 26px;
  color: var(--color-bleu-btn);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid var(--color-bleu-btn);
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cta-secondaire:hover,
.cta-secondaire:focus,
.reel:hover .cta-secondaire,
.reel:focus-within .cta-secondaire {
  background: #fff;
  border-color: #fff;
  color: var(--charte-bleu-fonce);
  transform: translateY(-2px);
}

.cta-secondaire:focus-visible {
  outline: 3px solid var(--color-texte);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Videos */

.grille-videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  width: 100%;
  max-width: 960px;
  margin: 20px 0;
}

.video-card {
  text-align: left;
}

.video-card:nth-child(odd) .video-placeholder {
  transform: rotate(-0.6deg);
}

.video-card:nth-child(even) .video-placeholder {
  transform: rotate(0.6deg);
}

.video-card .video-placeholder {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.video-card:hover .video-placeholder {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 12px 28px rgba(42, 35, 70, 0.18);
}

.video-titre {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--color-texte);
}

.video-placeholder {
  position: relative;
  width: 100%;
  background: var(--color-fond);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-bordure);
}

.btn-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 84px;
  height: 84px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--charte-vert);
  color: var(--charte-bleu-fonce);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.btn-play:hover,
.btn-play:focus-visible {
  background: #fff;
  color: var(--charte-bleu-fonce);
  transform: scale(1.08);
}

.btn-play:focus-visible {
  outline: 3px solid var(--color-texte);
  outline-offset: 3px;
}

.btn-play svg {
  width: 42%;
  fill: currentColor;
}

.btn-play.cache {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.btn-fermer {
  display: none;
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  gap: 10px;
}

.video-placeholder.lecture .btn-fermer {
  display: inline-flex;
}

.btn-fermer .ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--charte-bleu-fonce);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-fermer:hover .ico,
.btn-fermer:focus-visible .ico {
  background: #fff;
  transform: scale(1.1);
}

.btn-fermer:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.btn-fermer svg {
  width: 55%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}

@media (max-height: 480px) {
  .btn-fermer {
    bottom: auto;
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 480px) {
  .btn-play {
    width: 64px;
    height: 64px;
  }
}

.video-placeholder video {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
}

.video-placeholder a {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Lecture agrandie (lightbox) */

.video-card .video-placeholder.lecture {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 1040px);
  z-index: 40;
  overflow: visible;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: zoom-video 0.25s ease;
}

.video-placeholder.lecture video {
  border-radius: 12px;
}

@keyframes zoom-video {
  from {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(0.85);
  }
}

.video-card:has(.video-placeholder.lecture)::after {
  content: "";
  display: block;
  aspect-ratio: 16 / 9;
}

.voile {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.voile.visible {
  opacity: 1;
  pointer-events: auto;
}

body.bloque {
  overflow: hidden;
}

/* Décorations */

.deco {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.deco svg {
  position: absolute;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
  animation: flotte 9s ease-in-out infinite;
}

.d1 { width: 52px; top: 13%; left: 9%; color: var(--charte-jaune); }
.d2 { width: 84px; top: 9%; right: 11%; color: var(--charte-bleu); animation-duration: 10s; animation-delay: 1s; }
.d3 { width: 34px; top: 44%; left: 6%; color: var(--charte-rose); animation-duration: 7s; animation-delay: 0.5s; --rot: 10deg; }
.d4 { width: 58px; top: 52%; right: 6%; color: var(--charte-vert); animation-duration: 11s; animation-delay: 1.5s; }
.d5 { width: 44px; bottom: 13%; left: 15%; color: var(--charte-orange); animation-duration: 8.5s; animation-delay: 0.8s; --rot: -8deg; }
.d6 { width: 40px; bottom: 11%; right: 14%; color: var(--charte-rose); animation-duration: 9.5s; animation-delay: 2s; }

@keyframes flotte {
  0%, 100% {
    transform: translateY(0) rotate(var(--rot, 0deg));
  }
  50% {
    transform: translateY(-14px) rotate(calc(var(--rot, 0deg) + 5deg));
  }
}

/* Soulignements façon doodle */

.hl {
  text-decoration: underline wavy;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.hl-vert { text-decoration-color: var(--charte-vert); }
.hl-rose { text-decoration-color: var(--charte-rose); }
.hl-bleu { text-decoration-color: var(--charte-bleu); }
.hl-orange { text-decoration-color: var(--charte-orange); }

.marque {
  background: linear-gradient(to top, rgba(255, 130, 186, 0.25) 50%, transparent 50%);
  padding: 0 0.15em;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Reel d'accueil */

.reel {
  display: block;
  position: relative;
  max-width: 420px;
  margin: 8px auto;
  transform: rotate(-0.6deg);
  transition: transform 0.25s ease;
}

.reel:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
  border-radius: 12px;
}



.reel video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 1px solid var(--color-bordure);
}

.reel-cta {
  position: absolute;
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%);
  margin-top: 0;
  background: var(--charte-bleu);
  border-color: transparent;
  color: #000;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.reel-cta:hover,
.reel-cta:focus,
.reel:hover .reel-cta,
.reel:focus-within .reel-cta {
  transform: translateX(-50%) translateY(-2px);
}

/* Boutons + note manuscrite */

.actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 44px;
}

.actions .cta,
.actions .cta-secondaire {
  margin: 0;
}

.note-cta {
  position: absolute;
  top: calc(100% + 4px);
  left: -30px;
  display: flex;
  align-items: flex-end;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--charte-rose);
  white-space: nowrap;
  pointer-events: none;
}

.note-cta span {
  margin-bottom: -5px;
  transform: rotate(-4deg);
  transform-origin: 100% 100%;
}

.note-cta svg {
  width: 44px;
  margin-top: -6px;
  margin-left: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 640px) {
  .note-cta {
    display: none;
  }
}

@media (max-width: 720px) {
  .deco .d3,
  .deco .d5 {
    display: none;
  }

  .deco .d1 { width: 38px; top: 8%; left: 6%; }
  .deco .d2 { width: 60px; top: 6%; right: 8%; }
  .deco .d4 { width: 42px; top: auto; bottom: 18%; right: 6%; }
  .deco .d6 { width: 30px; bottom: 8%; right: 16%; }
}

@media (prefers-reduced-motion: reduce) {
  .deco svg,
  .logo,
  .cartouche,
  .video-placeholder.lecture {
    animation: none;
  }

  .logo,
  .video-card .video-placeholder {
    transition: none;
  }
}

@media (max-width: 480px) {
  .page {
    padding: 32px 18px;
  }

  .logo {
    width: 180px;
  }

  .tagline {
    font-size: 2rem;
  }

  .cartouche p {
    font-size: 1.05rem;
  }
}
