/* ==========================================================
   Espace TIM — feuille de style
   Plateforme de travail sobre : menu latéral, typographie IBM Plex,
   une couleur discrète par classe. Mode sombre automatique.
   ========================================================== */

/* Identité MBCODE : graphite + vert acide, titres Space Grotesk,
   effets 3D discrets. Thème sombre par défaut, clair si l'appareil le demande. */
:root {
  --fond: #111318;
  --surface: #171a21;
  --surface-2: #1f232c;
  --texte: #eceee8;
  --texte-doux: #9ca3af;
  --bord: #272c36;
  --bord-fort: #383e4b;
  --primaire: #c6f432;          /* vert acide MBCODE */
  --primaire-texte: #c6f432;    /* même couleur, utilisée pour du texte */
  --sur-primaire: #14161b;
  --primaire-clair: rgb(198 244 50 / .1);
  --lien: #c6f432;
  --c1: #38d39f;   /* 2nde SAPAT */
  --c2: #ff9a4d;   /* Terminale SAPAT */
  --c3: #82a7ff;   /* BTSA DATR */
  --exemple: #f5c451; --exemple-fond: rgb(245 196 81 / .1); --exemple-bord: rgb(245 196 81 / .35);
  --attention: #ff7a66; --attention-fond: rgb(255 122 102 / .1);
  --ombre-3d: 0 1px 0 rgb(255 255 255 / .04) inset, 0 18px 40px -18px rgb(0 0 0 / .7);
  --rayon: 10px;
  --menu-largeur: 260px;
  --entete-hauteur: 64px;
  --police: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --titre: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --accent: var(--primaire);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --fond: #f3f4ef;
    --surface: #ffffff;
    --surface-2: #eceee7;
    --texte: #14161b;
    --texte-doux: #5b616c;
    --bord: #dfe2da;
    --bord-fort: #c7cbc0;
    --primaire: #c6f432;
    --primaire-texte: #4a6400;
    --primaire-clair: rgb(198 244 50 / .28);
    --lien: #3f5a00;
    --c1: #0f8a63;
    --c2: #c25a14;
    --c3: #3157c9;
    --exemple: #8a5a00; --exemple-fond: #fdf4dc; --exemple-bord: #ecd59a;
    --attention: #b3341c; --attention-fond: #fcece8;
    --ombre-3d: 0 18px 36px -20px rgb(20 22 27 / .35);
    color-scheme: light;
  }
}
.classe--c1 { --accent: var(--c1); }
.classe--c2 { --accent: var(--c2); }
.classe--c3 { --accent: var(--c3); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--police); font-size: 1rem; line-height: 1.6; color: var(--texte); background: var(--fond); }
img, iframe { max-width: 100%; }
a { color: var(--lien); text-underline-offset: .18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--lien); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--titre); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.25rem); font-weight: 700; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
.icone-pixel { width: 16px; height: 16px; flex: none; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lien-evitement { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border: 1px solid var(--bord); }
.lien-evitement:focus { left: 8px; }
.puce { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); flex: none; }
.puce--grande { width: 12px; height: 12px; margin-right: 10px; vertical-align: .05em; }

/* ---------- En-tête ---------- */
.entete { position: sticky; top: 0; z-index: 40; height: var(--entete-hauteur); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--bord); }
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texte); min-width: 0; }
.marque__texte { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.marque__texte strong { font-family: var(--titre); font-size: 1.25rem; letter-spacing: -.02em; }
.marque__texte strong span { color: var(--texte-doux); font-weight: 500; }
.logo { flex: none; transition: transform .3s ease; }
.marque:hover .logo { transform: rotate(-8deg) scale(1.05); }
.marque__texte small b { color: var(--primaire-texte); font-weight: 600; }
.marque__texte small { font-size: .78rem; color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete .marque { margin-right: auto; }
.compte-lien { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--bord-fort); color: var(--texte); text-decoration: none; font-weight: 500; font-size: .9rem; white-space: nowrap; }
.compte-lien:hover { border-color: var(--primaire); color: var(--texte); }
@media (max-width: 480px) { .compte-lien span { display: none; } .marque__texte small { display: none; } }
.menu-bouton { display: inline-flex; align-items: center; gap: 8px; font: 500 .9rem var(--police); padding: 7px 12px; border: 1px solid var(--bord-fort); border-radius: 6px; background: var(--surface); color: var(--texte); cursor: pointer; }
.menu-bouton__icone, .menu-bouton__icone::before, .menu-bouton__icone::after { display: block; width: 16px; height: 2px; background: currentColor; position: relative; }
.menu-bouton__icone::before, .menu-bouton__icone::after { content: ""; position: absolute; left: 0; }
.menu-bouton__icone::before { top: -5px; }
.menu-bouton__icone::after { top: 5px; }

/* ---------- Cadre : menu latéral + contenu ---------- */
.cadre { display: block; }
.menu { background: var(--surface); border-bottom: 1px solid var(--bord); padding: 12px 12px 20px; }
.js .menu[data-ferme] { display: none; }
.menu__titre { margin: 18px 10px 6px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--texte-doux); }
.menu__liste { list-style: none; margin: 0; padding: 0; }
.menu__lien { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--texte); text-decoration: none; font-weight: 500; font-size: .95rem; }
.menu__lien .icone-pixel { color: var(--texte-doux); }
.menu__lien:hover { background: var(--surface-2); }
.menu__lien[aria-current="page"], .menu__lien[data-actif] { background: var(--primaire-clair); color: var(--texte); font-weight: 600; box-shadow: inset 3px 0 0 var(--primaire); }
.menu__lien[aria-current="page"] .icone-pixel, .menu__lien[data-actif] .icone-pixel { color: var(--primaire-texte); }
.menu__lien--classe[aria-current="page"], .menu__lien--classe[data-actif] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--texte); box-shadow: inset 3px 0 0 var(--accent); }

.principal { min-width: 0; padding: 0 16px; }
@media (min-width: 1000px) {
  .menu-bouton { display: none; }
  .cadre { display: grid; grid-template-columns: var(--menu-largeur) minmax(0, 1fr); background: linear-gradient(90deg, var(--surface) calc(var(--menu-largeur) - 1px), var(--bord) calc(var(--menu-largeur) - 1px), var(--bord) var(--menu-largeur), transparent var(--menu-largeur)); min-height: calc(100vh - var(--entete-hauteur)); }
  .menu, .js .menu[data-ferme] { display: block; position: sticky; top: var(--entete-hauteur); height: calc(100vh - var(--entete-hauteur)); overflow-y: auto; border-bottom: 0; border-right: 1px solid var(--bord); padding: 16px 14px; }
  .principal { padding: 0 48px; max-width: 1080px; }
  .entete { padding: 0 24px; }
}

/* ---------- Têtes de page ---------- */
.tete { padding: 32px 0 24px; border-bottom: 1px solid var(--bord); }
.tete--accueil { padding-top: 48px; padding-bottom: 32px; }
.tete__surtitre { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-family: var(--mono); font-size: .8rem; font-weight: 500; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.tete__texte { margin: 0; max-width: 62ch; font-size: 1.08rem; color: var(--texte-doux); }
.fil { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; color: var(--texte-doux); margin-bottom: 16px; }
.fil a { color: var(--texte-doux); }
.tete--article { border-bottom: 0; padding-bottom: 8px; }
.tete--article h1 { max-width: 28ch; }
.fiche { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 20px 0 0; padding: 14px 0; border-top: 1px solid var(--bord); border-bottom: 1px solid var(--bord); }
.fiche div { display: flex; flex-direction: column; }
.fiche dt { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-doux); }
.fiche dd { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 500; }

.onglets-page { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--bord); scrollbar-width: none; }
.onglets-page a { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 12px 12px; color: var(--texte-doux); text-decoration: none; font-weight: 500; font-size: .95rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.onglets-page a:hover { color: var(--texte); border-bottom-color: var(--bord-fort); }
.compteur { font-family: var(--mono); font-size: .75rem; padding: 0 6px; border-radius: 4px; background: var(--surface-2); color: var(--texte-doux); border: 1px solid var(--bord); }

/* ---------- Sections ---------- */
.section { padding: 32px 0 4px; scroll-margin-top: calc(var(--entete-hauteur) + 12px); }
.section__entete { margin-bottom: 14px; }
.section__entete h2 { margin: 0; display: flex; align-items: center; }
.section__entete p { margin: 2px 0 0; color: var(--texte-doux); font-size: .95rem; }
.vide { margin: 0; padding: 14px 16px; border: 1px dashed var(--bord-fort); border-radius: var(--rayon); color: var(--texte-doux); font-size: .95rem; }

/* ---------- Classes (accueil) ---------- */
.classes { list-style: none; margin: 0; padding: 0; perspective: 900px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.classe__lien {
  position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 22px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, var(--surface)) 0%, var(--surface) 55%);
  border: 1px solid var(--bord); border-radius: 14px; color: var(--texte); text-decoration: none;
  box-shadow: var(--ombre-3d); transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease, border-color .2s;
}
.classe__lien::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgb(255 255 255 / .09), transparent 55%); opacity: 0; transition: opacity .2s; }
.classe__lien::after { content: ""; position: absolute; left: 22px; top: 0; width: 44px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.classe__lien:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--bord)); color: var(--texte); }
.classe__lien:hover::before { opacity: 1; }
.classe__lien > * { transform: translateZ(24px); }
.classe__niveau { font-size: .8rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.classe__nom { font-family: var(--titre); font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.classe__texte { color: var(--texte-doux); font-size: .93rem; }
.classe__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--bord); font-size: .88rem; color: var(--texte-doux); }
.classe__stats strong { font-family: var(--mono); font-weight: 500; color: var(--texte); margin-right: 4px; }
.classe__ouvrir { margin-top: auto; padding-top: 6px; font-weight: 600; font-size: .92rem; color: var(--accent); }

/* ---------- Listes de contenus ---------- */
.liste { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre-3d); }
.ligne + .ligne { border-top: 1px solid var(--bord); }
.ligne__lien { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; padding: 14px 16px; color: var(--texte); text-decoration: none; }
.ligne__lien:hover { background: var(--surface-2); }
.ligne__lien:hover .ligne__icone { color: var(--accent); border-color: var(--accent); transform: translateY(-2px) rotate(-6deg); }
.ligne__icone { transition: transform .2s, color .2s, border-color .2s; }
.ligne__lien:hover .ligne__titre { color: var(--texte); text-decoration: underline; text-underline-offset: .18em; }
.ligne__icone { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: var(--surface-2); color: var(--texte-doux); border: 1px solid var(--bord); }
.ligne__corps { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ligne__titre { font-weight: 600; }
.ligne__texte { color: var(--texte-doux); font-size: .93rem; }
.ligne__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ligne__meta { grid-column: 2; display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--texte-doux); }
.ligne__duree { font-family: var(--mono); font-size: .8rem; }
@media (min-width: 700px) {
  .ligne__lien { grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; }
  .ligne__meta { grid-column: auto; }
}
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 500; padding: 1px 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--bord); color: var(--texte-doux); }
.tag--exemple { background: var(--exemple-fond); border-color: var(--exemple-bord); color: var(--exemple); }

/* ---------- Outils ---------- */
.outils { list-style: none; margin: 0 0 1.5em; padding: 0; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); }
.outil { display: grid; gap: 2px 20px; padding: 14px 16px; }
.outil + .outil { border-top: 1px solid var(--bord); }
.outil__nom { font-weight: 600; }
.outil__texte { color: var(--texte-doux); font-size: .95rem; }
.outil a { font-size: .9rem; white-space: nowrap; }
@media (min-width: 700px) { .outil { grid-template-columns: 11rem 1fr auto; align-items: baseline; } }

/* ---------- Article ---------- */
.article { max-width: 760px; }
.avertissement { margin: 20px 0 0; padding: 10px 14px; border-radius: var(--rayon); background: var(--exemple-fond); border: 1px solid var(--exemple-bord); font-size: .92rem; }
.avertissement strong { color: var(--exemple); }
.prose { padding: 12px 0; font-size: 1.05rem; line-height: 1.7; }
.prose--large > :not(.editeur):not(.outils) { max-width: 760px; }
.prose h2 { margin-top: 1.8em; font-size: 1.35rem; }
.prose h3 { margin-top: 1.4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose li { margin-bottom: .3em; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--bord); }
.prose pre { background: var(--surface-2); padding: 14px 16px; overflow-x: auto; border-radius: var(--rayon); border: 1px solid var(--bord); }
.prose pre code { border: 0; padding: 0; background: none; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; display: block; overflow-x: auto; font-size: .95rem; }
.prose th, .prose td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--bord); vertical-align: top; }
.prose th { font-weight: 600; background: var(--surface-2); border-bottom-color: var(--bord-fort); }
.prose blockquote { margin: 0 0 1em; padding: 4px 0 4px 16px; border-left: 3px solid var(--bord-fort); color: var(--texte-doux); }
.prose details { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px 14px; margin: 0 0 8px; }
.prose summary { cursor: pointer; font-weight: 600; }
.prose details[open] summary { margin-bottom: 8px; }
.note { color: var(--texte-doux); font-size: .93rem; font-style: italic; }

/* Encadrés : {: .objectifs } / {: .attention } / {: .astuce } sous un paragraphe */
.objectifs, .attention, .astuce { padding: 14px 16px; border-radius: var(--rayon); margin: 0 0 1.2em; border: 1px solid var(--bord); border-left-width: 4px; background: var(--surface); }
.objectifs { border-left-color: var(--primaire); }
.objectifs::before { color: var(--primaire-texte) !important; }
.objectifs::before { content: "Objectifs de la séance"; display: block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--primaire); margin-bottom: 4px; }
.attention { border-left-color: var(--attention); background: var(--attention-fond); border-color: transparent; border-left-color: var(--attention); }
.attention strong:first-child { color: var(--attention); }
.astuce { border-left-color: var(--c3); }
.objectifs > :last-child, .attention > :last-child, .astuce > :last-child { margin-bottom: 0; }
.retour { margin: 28px 0 0; font-size: .95rem; }

/* ---------- Boutons (effet touche en relief) ---------- */
.bouton { display: inline-flex; align-items: center; gap: 6px; font: 600 .95rem var(--titre); padding: 10px 16px; border-radius: 8px; border: 1px solid transparent; background: var(--primaire); color: var(--sur-primaire, #14161b); text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 #7f9e14; transform: translateY(0); transition: transform .08s, box-shadow .08s; }
.bouton:hover { color: #14161b; filter: brightness(1.05); }
.bouton:active { transform: translateY(3px); box-shadow: 0 1px 0 #7f9e14; }
.bouton--petit { padding: 6px 11px; font-size: .85rem; box-shadow: 0 3px 0 #7f9e14; }
.bouton--discret { background: var(--surface-2); color: var(--texte); border-color: var(--bord-fort); box-shadow: 0 4px 0 var(--bord-fort); }
.bouton--discret:hover { color: var(--texte); background: var(--surface); }
.bouton--discret:active { box-shadow: 0 1px 0 var(--bord-fort); }
.bouton--petit.bouton--discret { box-shadow: 0 3px 0 var(--bord-fort); }

/* ---------- Bac à sable ---------- */
.editeur { border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; background: var(--surface); margin: 0 0 1.5em; }
.editeur__barre { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--bord); background: var(--surface-2); }
.onglets { display: flex; gap: 2px; }
.onglets button { font: 500 .85rem var(--mono); padding: 6px 12px; border-radius: 5px; border: 1px solid transparent; background: transparent; color: var(--texte-doux); cursor: pointer; }
.onglets button[aria-selected="true"] { background: var(--surface); border-color: var(--bord); color: var(--texte); }
.editeur__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.editeur__corps { display: grid; grid-template-columns: 1fr; }
.editeur__code textarea { display: block; width: 100%; min-height: 280px; resize: vertical; border: 0; padding: 14px 16px; font-family: var(--mono); font-size: .88rem; line-height: 1.6; background: var(--surface); color: var(--texte); tab-size: 2; }
.editeur__code textarea[hidden] { display: none; }
.editeur__code textarea:focus-visible { outline-offset: -2px; border-radius: 0; }
.editeur__rendu { border-top: 1px solid var(--bord); background: #fff; }
.editeur__rendu iframe { display: block; width: 100%; height: 320px; border: 0; background: #fff; }
.editeur__auto { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: .85rem; color: var(--texte-doux); border-top: 1px solid var(--bord); }
@media (min-width: 1200px) {
  .editeur__corps { grid-template-columns: 1fr 1fr; }
  .editeur__rendu { border-top: 0; border-left: 1px solid var(--bord); }
  .editeur__code textarea { min-height: 400px; }
  .editeur__rendu iframe { height: 100%; min-height: 400px; }
}

/* ---------- Pied de page ---------- */
.pied { margin-top: 56px; padding: 20px 0 32px; border-top: 1px solid var(--bord); color: var(--texte-doux); font-size: .85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }
.pied p { margin: 0; }
.pied__marque { font-family: var(--titre); font-weight: 700; color: var(--texte); }
.pied__marque span { color: var(--texte-doux); font-weight: 500; }
.pied__code { font-family: var(--mono); font-size: .78rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Accueil : écran d'ouverture avec cube 3D ---------- */
.une { position: relative; display: grid; gap: 24px; align-items: center; padding: 40px 0 36px; border-bottom: 1px solid var(--bord); overflow: hidden; }
@media (min-width: 860px) { .une { grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); padding: 56px 0 48px; } }
.une__invite { font-family: var(--mono); font-size: .9rem; color: var(--primaire-texte); margin: 0 0 14px; }
.curseur { display: inline-block; width: .6em; height: 1.05em; margin-left: 3px; vertical-align: -.18em; background: var(--primaire); animation: clignote 1.1s steps(1) infinite; }
@keyframes clignote { 50% { opacity: 0; } }
.une__titre { font-size: clamp(1.6rem, 3.6vw, 2.4rem); line-height: 1.12; margin-bottom: 18px; max-width: 22ch; font-weight: 600; color: var(--texte-doux); }
.une__titre em { font-style: normal; font-weight: 700; color: var(--primaire-texte); }
.une__titre em:first-child, .une__titre > em { }
.sigle { display: block; font-size: clamp(4.5rem, 12vw, 8rem); line-height: .9; font-weight: 700; letter-spacing: -.04em; color: var(--texte); margin-bottom: 10px; }
.une__titre { --t-first: var(--primaire-texte); }
.une__texte { margin: 0 0 24px; max-width: 54ch; font-size: 1.1rem; color: var(--texte-doux); }
.une__actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; }

.une__scene { position: relative; height: 280px; }
@media (min-width: 860px) { .une__scene { height: 360px; } }
.une__toile { position: absolute; inset: 0; width: 100%; height: 100%; }
.une__legende { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; display: flex; justify-content: center; gap: 18px; font-family: var(--mono); font-size: .75rem; color: var(--texte-doux); }
.une__legende span::before { content: "● "; color: var(--primaire-texte); }
.une__sol {
  position: absolute; left: -10%; right: -10%; bottom: -20px; height: 160px;
  background-image: linear-gradient(var(--bord-fort) 1px, transparent 1px), linear-gradient(90deg, var(--bord-fort) 1px, transparent 1px);
  background-size: 32px 32px; transform: rotateX(72deg); transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 10%, transparent 85%); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  opacity: .7;
}
.cube {
  --t: 64px; position: relative; width: calc(var(--t) * 2); height: calc(var(--t) * 2); transform-style: preserve-3d; z-index: 1;
  transform: rotateX(calc(-24deg + var(--souris-y, 0deg))) rotateY(calc(-38deg + var(--souris-x, 0deg)));
  transition: transform .4s ease-out; animation: flotte 5s ease-in-out infinite;
}
@media (min-width: 860px) { .cube { --t: 78px; } }
@keyframes flotte { 50% { translate: 0 -10px; } }
.cube__face { position: absolute; inset: 0; display: grid; place-items: center; border: 1px solid rgb(0 0 0 / .25); font-family: var(--titre); font-weight: 700; font-size: calc(var(--t) * 1.1); line-height: 1; backface-visibility: hidden; }
.cube__face--avant  { transform: translateZ(var(--t)); background: #2a2e37; color: var(--primaire); }
.cube__face--droite { transform: rotateY(90deg) translateZ(var(--t)); background: #3a404c; color: #f2f4ef; }
.cube__face--haut   { transform: rotateX(90deg) translateZ(var(--t)); background: var(--primaire); color: #14161b; font-family: var(--mono); font-size: calc(var(--t) * .62); }
.cube__face--arriere { transform: rotateY(180deg) translateZ(var(--t)); background: #2a2e37; }
.cube__face--gauche { transform: rotateY(-90deg) translateZ(var(--t)); background: #3a404c; }
.cube__face--bas    { transform: rotateX(-90deg) translateZ(var(--t)); background: #1c1f26; }
@media (prefers-reduced-motion: reduce) { .cube, .curseur { animation: none; } .classe__lien { transform: none !important; } }

/* Trois cubes T · I · M */
.cubes { display: flex; gap: 18px; align-items: flex-end; transform-style: preserve-3d; z-index: 1; }
.cubes .cube { --t: 36px; }
.cubes .cube--2 { animation-delay: -1.6s; }
.cubes .cube--3 { animation-delay: -3.2s; }
@media (min-width: 860px) { .cubes .cube { --t: 44px; } .cubes { gap: 22px; } }
.cubes .cube__face--avant { font-size: calc(var(--t) * 1.25); }
.cubes .cube--2 .cube__face--avant { color: #f2f4ef; }

/* Domaines du TIM */
.domaines { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); perspective: 900px; }
.domaine {
  position: relative; margin: 0; padding: 18px 18px 16px; background: var(--surface); border: 1px solid var(--bord); border-radius: 12px; box-shadow: var(--ombre-3d);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease, border-color .2s;
}
.domaine:hover { border-color: color-mix(in srgb, var(--primaire) 50%, var(--bord)); }
.domaine__code { display: inline-block; font-family: var(--mono); font-size: .8rem; font-weight: 500; color: var(--primaire-texte); background: var(--primaire-clair); padding: 1px 8px; border-radius: 5px; margin-bottom: 10px; }
.domaine__code span { opacity: .6; }
.domaine__nom { font-size: 1.12rem; margin: 0 0 4px; }
.domaine__texte { margin: 0; color: var(--texte-doux); font-size: .93rem; line-height: 1.55; }

/* ---------- Connexion et espace élève ---------- */
.connexion { display: grid; place-items: center; padding: 48px 0; }
.connexion__carte { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; padding: 28px; box-shadow: var(--ombre-3d); }
.connexion__texte, .connexion__aide { color: var(--texte-doux); font-size: .95rem; }
.connexion__aide { margin: 18px 0 0; }
.formulaire { display: grid; gap: 6px; margin-top: 18px; }
.formulaire label { font-weight: 600; font-size: .9rem; margin-top: 8px; }
.formulaire input { font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--bord-fort); background: var(--fond); color: var(--texte); }
.formulaire input:focus-visible { outline: 2px solid var(--primaire); outline-offset: 1px; }
.formulaire input:disabled { opacity: .6; }
.formulaire .bouton { margin-top: 16px; justify-content: center; }
.formulaire .bouton:disabled { opacity: .6; cursor: not-allowed; }
.formulaire__message { margin: 8px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--attention-fond); color: var(--texte); font-size: .92rem; }
.espace__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 0; }
.notes { display: block; width: 100%; font: 16px/1.6 var(--police); padding: 14px 16px; border-radius: 10px; border: 1px solid var(--bord-fort); background: var(--surface); color: var(--texte); resize: vertical; }
.notes__etat { min-height: 1.4em; margin: 6px 0 0; color: var(--texte-doux); font-size: .85rem; }

.menu__deconnexion { width: 100%; margin-top: 18px; border: 0; background: none; font: inherit; font-weight: 500; font-size: .95rem; color: var(--texte-doux); cursor: pointer; text-align: left; }

/* ---------- Porte d'entrée : page de connexion ---------- */
.porte-page { min-height: 100vh; background: #0c0e12; color: #eceee8; }
@media (prefers-color-scheme: light) { .porte-page { background: #0c0e12; color: #eceee8; } }
.porte { display: grid; min-height: 100vh; grid-template-columns: 1fr; }
@media (min-width: 960px) { .porte { grid-template-columns: minmax(0, 1.35fr) minmax(400px, .9fr); } }
.porte__scene { position: relative; min-height: 300px; overflow: hidden; background:
  radial-gradient(ellipse at 40% 45%, rgb(198 244 50 / .10), transparent 60%),
  radial-gradient(ellipse at 75% 80%, rgb(130 167 255 / .10), transparent 55%), #0c0e12; }
@media (min-width: 960px) { .porte__scene { min-height: 100vh; } }
.porte__toile { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.porte__grille { position: absolute; left: -20%; right: -20%; bottom: -10%; height: 55%;
  background-image: linear-gradient(rgb(198 244 50 / .14) 1px, transparent 1px), linear-gradient(90deg, rgb(198 244 50 / .14) 1px, transparent 1px);
  background-size: 48px 48px; transform: perspective(500px) rotateX(62deg); transform-origin: bottom;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 90%); mask-image: linear-gradient(to top, #000 0%, transparent 90%);
  animation: defile 3s linear infinite; }
@keyframes defile { to { background-position: 0 48px; } }
.porte__panneau { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 26px; padding: 28px max(5vw, 20px) 32px; background: #12151b; border-left: 1px solid #262b34; }
@media (min-width: 960px) { .porte__panneau { justify-content: center; padding: 48px 56px; } }
.porte__marque { display: flex; align-items: center; gap: 12px; }
.porte__marque .logo { width: 44px; height: 50px; }
.porte__marque span { display: flex; flex-direction: column; line-height: 1.15; }
.porte__marque strong { font-family: var(--titre); font-size: 1.6rem; letter-spacing: -.02em; }
.porte__marque strong span { display: inline; color: #9ca3af; font-weight: 500; }
.porte__marque small { color: #9ca3af; font-size: .85rem; }
.porte__intro h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.15; margin: 0 0 10px; font-weight: 600; color: #d6dad2; }
.porte__intro h1 em { font-style: normal; font-weight: 700; color: #c6f432; }
.porte__intro p { margin: 0; color: #9ca3af; }
.porte__intro .une__invite { color: #c6f432; margin-bottom: 12px; }
.porte__intro .curseur { background: #c6f432; }
.porte__formulaire { margin: 0; padding: 22px; border-radius: 14px; background: #171a21; border: 1px solid #2c323d; box-shadow: 0 30px 60px -30px rgb(0 0 0 / .8), inset 0 1px 0 rgb(255 255 255 / .04); }
.porte__formulaire label { color: #eceee8; }
.champ { position: relative; display: flex; align-items: center; }
.champ > svg { position: absolute; left: 12px; width: 16px; height: 16px; color: #9ca3af; pointer-events: none; }
.champ input { width: 100%; padding-left: 38px !important; background: #0f1116 !important; border-color: #353c48 !important; color: #eceee8 !important; }
.champ input:focus-visible { outline: 2px solid #c6f432 !important; border-color: transparent !important; }
.champ__oeil { position: absolute; right: 6px; font: 500 .8rem var(--police); padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: #9ca3af; cursor: pointer; }
.champ__oeil:hover { color: #eceee8; background: #222731; }
.bouton--large { width: 100%; padding: 13px 16px; font-size: 1rem; }
.porte .formulaire__message { background: rgb(255 122 102 / .12); color: #ffd2c9; }
.porte__demo { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: rgb(245 196 81 / .1); border: 1px solid rgb(245 196 81 / .3); color: #e9dcb8; font-size: .88rem; }
.porte__demo strong { color: #f5c451; }
.porte__aide { margin: -8px 0 0; color: #9ca3af; font-size: .9rem; }
.porte__pied { margin: 0; color: #6b7280; font-size: .8rem; line-height: 1.7; }
.porte__pied span { font-family: var(--mono); }
.porte__pied strong { color: #9ca3af; }
@media (prefers-reduced-motion: reduce) { .porte__grille { animation: none; } }
