/* Socle commun au CV et au cours : variables, base typographique, boutons, barre, rail et bouton Meet. */
:root {
  color-scheme: dark;
  --nuit: #0f1120;
  --nuit-2: #151829;
  --surface: #1a1e33;
  --carte: rgba(26, 30, 51, 0.72);
  --trait: rgba(160, 170, 230, 0.14);
  --trait-fort: rgba(130, 214, 232, 0.42);
  --texte: #dfe3f5;
  --doux: #9298bc;
  --bleu: #5fb8d0;
  --bleu-vif: #82d6e8; /* cyan : liens et références */
  --action: #f0c674; /* ambre : ce qu'on exécute, boutons principaux */
  --structure: #b9a3f5; /* violet : numéros et position */
  --encre: #1c1505;
  --rayon-s: 8px;
  --rayon-m: 12px;
  --rayon: 18px;
  --large: 76rem;
  --mesure: 68ch;
  --gouttiere: clamp(1.25rem, 4vw, 2rem);
  --hauteur-barre: 4rem;
}

/* L'échelle du site se règle ici : toutes les tailles en rem en dépendent. */
html { font-size: 87.5%; }
@media (max-width: 40rem) { html { font-size: 93.75%; } }

body {
  margin: 0;
  background:
    radial-gradient(60rem 40rem at 85% 10%, rgba(90, 70, 190, 0.18), transparent 60%),
    radial-gradient(50rem 40rem at 0% 60%, rgba(30, 90, 130, 0.14), transparent 60%),
    var(--nuit);
  background-attachment: fixed;
  color: var(--texte);
  font: 400 1.0625rem/1.7 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { font-family: "Bricolage", "Inter", sans-serif; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
strong { color: #fff; font-weight: 600; }
:focus-visible { outline: 2px solid var(--bleu-vif); outline-offset: 2px; border-radius: 4px; }

/* Boutons : un seul principal, un seul secondaire, sur tout le site. */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.55rem 1.1rem;
  border: 1px solid var(--trait-fort); border-radius: var(--rayon-m); background: rgba(130, 214, 232, 0.1);
  color: #fff; font: 600 0.9375rem/1.2 "Inter", system-ui, sans-serif; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s ease-out, border-color 0.15s ease-out, transform 0.15s ease-out;
}
.bouton:hover { color: #fff; background: rgba(130, 214, 232, 0.22); }
.bouton:active { transform: scale(0.97); }
.bouton.plein, .bouton.plein:hover { color: var(--encre); border-color: var(--action); }
.bouton.plein { background: var(--action); }
.bouton.plein:hover { background: #f6d78e; }
.bouton.grand { min-height: 3.25rem; padding-inline: 1.5rem; font-size: 1.0625rem; }

/* Barre : elle dit dans quel espace on se trouve, rien d'autre. */
.barre {
  grid-column: 1 / -1; /* Sur les modules, body est la grille : la barre prend toute la largeur. */
  position: sticky; top: 0; z-index: 50; height: var(--hauteur-barre);
  display: flex; align-items: center; gap: 1.25rem;
  padding-inline: max(var(--gouttiere), calc((100% - var(--large)) / 2));
  background: rgba(15, 17, 32, 0.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--trait);
}
.identite { flex: none; display: flex; align-items: center; gap: 0.6rem; color: var(--texte); text-decoration: none; }
.identite:hover { color: #fff; }
.identite img { display: block; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; outline: 1px solid rgba(255, 255, 255, 0.14); outline-offset: -1px; }
.identite span { font: 700 1.0625rem/1 "Bricolage", "Inter", sans-serif; letter-spacing: -0.02em; white-space: nowrap; }
.espaces { display: flex; gap: 0.25rem; }
.espaces a {
  display: flex; align-items: center; min-height: 2.5rem; padding-inline: 0.85rem; border-radius: var(--rayon-s);
  color: var(--doux); font-size: 0.9375rem; font-weight: 500; line-height: 1; text-decoration: none;
  transition: color 0.15s ease-out, background-color 0.15s ease-out;
}
.espaces a:hover { color: #fff; }
.espaces a[aria-current] { color: #fff; background: rgba(130, 214, 232, 0.14); }
.barre-droite { flex: none; display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.cta-barre .court { display: none; }
.choix-langue { display: flex; font-size: 0.875rem; line-height: 1; }
.choix-langue a, .choix-langue span { display: flex; align-items: center; min-height: 2.5rem; padding-inline: 0.5rem; text-decoration: none; }
.choix-langue a { color: var(--doux); }
.choix-langue a:hover { color: #fff; }
.choix-langue span { color: #fff; font-weight: 600; }

/* Moyens de contact, présents hors de l'éditeur d'exercices. */
.rail { position: fixed; left: 1.25rem; bottom: 2rem; z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.rail a { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; color: var(--doux); transition: color 0.15s ease-out; }
.rail a:hover { color: var(--bleu-vif); }
.rail svg { display: block; width: 18px; height: 18px; }

.bouton-meet {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 40; display: grid; place-items: center;
  width: 3.25rem; height: 3.25rem; border-radius: 50%; color: var(--bleu-vif);
  background: var(--surface); border: 1px solid var(--trait-fort); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: background-color 0.15s ease-out, transform 0.15s ease-out;
}
.bouton-meet svg { width: 22px; height: 22px; }
.bouton-meet:hover { background: #232846; }
.bouton-meet:active { transform: scale(0.96); }
.bouton-meet .bulle {
  position: absolute; right: calc(100% + 0.75rem); white-space: nowrap; padding: 0.4rem 0.75rem; border-radius: var(--rayon-s);
  font-size: 0.875rem; background: var(--surface); border: 1px solid var(--trait); color: var(--texte);
  opacity: 0; transform: translateX(6px); transition: opacity 0.15s ease-out, transform 0.15s ease-out; pointer-events: none;
}
.bouton-meet:hover .bulle, .bouton-meet:focus-visible .bulle { opacity: 1; transform: none; }

@media (max-width: 62rem) {
  .rail { display: none; }
}
@media (max-width: 48rem) {
  .identite span { display: none; }
  .barre { gap: 0.5rem; }
}
@media (max-width: 40rem) {
  .cta-barre .long { display: none; }
  .cta-barre .court { display: inline; }
  .barre-droite { gap: 0.25rem; }
  .espaces a { padding-inline: 0.6rem; }
  .bouton-meet { right: 1rem; bottom: 1rem; }
}
@media (max-width: 23rem) {
  .identite { display: none; }
  .choix-langue + .cta-barre { display: none; } /* Trop étroit : l'accueil du cours porte déjà ce bouton sous le titre. */
}
@media (prefers-reduced-motion: reduce) {
  .bouton, .bouton-meet, .bouton-meet .bulle { transition: none; }
  .bouton:active, .bouton-meet:active { transform: none; }
}
