/* batocera.org : styles communs, site réalisé par Genetik57
   Couleurs de Batocera 44 (malachite et turquoise). Safari avant iOS 16.2 ignore color-mix() :
   ces lignes suivent toujours une valeur simple. */

:root {
  --bg: #051012;
  --bg-2: #08171a;
  --surface: #0c1f22;
  --surface-2: #12292c;
  --border: #1b3a3d;
  --border-strong: #2a5458;
  --text: #eefafa;
  --muted: #a6c3c4;
  --faint: #86a6a8; /* le gris le plus clair qui reste lisible partout */
  --orange: #fbb03b;
  --coral: #f2604a;
  --pink: #e8146f; /* le logo et les boutons principaux */
  --teal: #2dd4bf; /* accents (malachite de Batocera 44) */
  --cyan: #4fd8ff;
  --green: #4ade80;
  --red: #ff5a6e;
  --link: #ffc46b;
  --grad: linear-gradient(135deg, #c4f27a 0%, #4be08a 50%, #2dd4bf 100%);
  --btn-grad: linear-gradient(135deg, #f3683f 0%, #e8146f 100%);
  --btn-grad-hover: linear-gradient(135deg, #f67a50 0%, #ef2d7f 100%);
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 22px -12px rgba(232, 20, 111, .9);
  --btn-shadow-hover: inset 0 1px 0 rgba(255, 255, 255, .3), 0 12px 28px -12px rgba(232, 20, 111, 1);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --glow: 0 0 0 1px rgba(251, 176, 59, .35), 0 8px 30px -8px rgba(45, 212, 191, .55);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; scrollbar-color: var(--border-strong) var(--bg); }
::selection { background: rgba(45, 212, 191, .55); color: #fff; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3f7a7c; }
body {
  margin: 0;
  /* étoiles discrètes et lueur en haut, derrière tout */
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, .35), transparent 60%),
    radial-gradient(1px 1px at 72% 9%, rgba(255, 255, 255, .3), transparent 60%),
    radial-gradient(1.5px 1.5px at 38% 62%, rgba(251, 176, 59, .3), transparent 60%),
    radial-gradient(1px 1px at 88% 44%, rgba(255, 255, 255, .25), transparent 60%),
    radial-gradient(1px 1px at 22% 82%, rgba(45, 212, 191, .35), transparent 60%),
    radial-gradient(120% 60% at 50% -10%, rgba(38, 198, 218, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.6 var(--font);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
/* Safari iOS gère mal les fonds fixes */
@supports (-webkit-touch-callout: none) { body { background-attachment: scroll; } }
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-decoration: none; }
a, button, summary, label { -webkit-tap-highlight-color: transparent; } /* pas de flash gris au toucher (iPhone) */
a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .6em; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.8vw, 3.4rem); font-weight: 850; }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
/* les mots longs passent à la ligne au lieu d'élargir la page */
p, li, dd, td, code, .note { overflow-wrap: anywhere; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--orange); color: #000; padding: .5rem 1rem; border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kicker {
  display: inline-flex; align-items: center; gap: .5em;
  font: 700 .75rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--orange); margin-bottom: 1rem;
}
.kicker::before { content: ""; width: 8px; height: 8px; background: var(--grad); box-shadow: 0 0 10px var(--coral); }

/* ---------------------------------------------------------------- en-tête */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 16, 18, .55); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent; transition: background .25s, border-color .25s, box-shadow .25s;
}
.site-header.scrolled { background: rgba(4, 12, 14, .9); border-bottom-color: var(--border); box-shadow: 0 12px 30px -18px rgba(0, 0, 0, .9); }
.hdr { display: flex; align-items: center; gap: 1.25rem; height: 72px; }
/* plus large que le contenu */
.site-header .hdr { max-width: 1400px; }

.brand { display: flex; align-items: center; gap: .6rem; flex: none; color: var(--text); }
.brand:hover { color: #fff; text-decoration: none; }
.brand img { width: 40px; height: auto; filter: drop-shadow(0 0 10px rgba(232, 20, 111, .45)); transition: transform .3s; }
.brand:hover img { transform: rotate(-6deg) scale(1.05); }
/* un petit papillon sur le coin du logo */
.brand-logo { position: relative; display: flex; flex: none; }
.brand .brand-fly { position: absolute; top: -5px; right: -9px; width: 22px; filter: drop-shadow(0 0 4px rgba(63, 209, 168, .6)); transform: rotate(18deg); }
.brand:hover .brand-fly { transform: rotate(8deg) translateY(-2px); }
.brand-name { font: 800 1.15rem/1 var(--font); letter-spacing: -.02em; }
.brand-name span { color: var(--faint); font-weight: 600; }
.brand-txt { display: flex; flex-direction: column; gap: .2rem; }
.brand-tag {
  align-self: flex-start; font: 600 .75rem/1.1 var(--font); white-space: nowrap;
  background: linear-gradient(90deg, #fbb03b, #ff4f93); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-width: 0; }
.nav-links {
  display: flex; align-items: center; gap: 2px; margin: 0 auto; padding: 4px;
  border-radius: 12px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .06);
}
/* --c : couleur de l'icône, --t : version plus claire pour le texte */
.nv-download { --c: #f2604a; --t: #ff9a7a; }
.nv-list { --c: #a855f7; --t: #c99bfa; }
.nv-cpu { --c: #2dd4bf; --t: #2dd4bf; }
.nv-book { --c: #fbb03b; --t: #fbb03b; }
.nv-users { --c: #60a5fa; --t: #60a5fa; }
.nv-heart { --c: #ff5a6e; --t: #ff8a97; }
.nav-links > a, .nav-links summary {
  display: flex; align-items: center; gap: .35rem; padding: .48rem .55rem; border-radius: 9px;
  color: var(--muted); font: 500 .93rem/1.2 var(--font); white-space: nowrap; cursor: pointer; list-style: none;
  transition: color .15s, background .15s;
}
.nav-links > a > .icon, .nav-links summary > .icon:not(.chev) { flex: none; width: 1.05em; height: 1.05em; color: var(--c); }
.nav-links summary::-webkit-details-marker { display: none; }
.nav-links > a:hover, .nav-links summary:hover, .menu[open] summary { color: var(--t); background: rgba(255, 255, 255, .06); text-decoration: none; }
.nav-links > a[aria-current="page"] { color: var(--t); background: rgba(255, 255, 255, .09); font-weight: 600; }
.menu { position: relative; }
.menu summary .chev { width: .85em; height: .85em; opacity: .7; transition: transform .2s; }
.menu[open] summary .chev { transform: rotate(180deg); }

.dropdown {
  position: absolute; z-index: 5; left: 50%; top: calc(100% + 14px); width: 300px; padding: .5rem;
  transform: translateX(-50%); background: #0a1d20; border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9); animation: drop .16s ease-out;
}
/* les deux colonnes partagent les lignes (subgrid) */
.dropdown.mega { width: 620px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(6, auto) auto; gap: .25rem 0; padding: .75rem; }
.menu-col { display: grid; grid-row: span 6; grid-template-rows: subgrid; align-content: start; min-width: 0; }
.menu-col + .menu-col { margin-left: .5rem; padding-left: .5rem; border-left: 1px solid var(--border); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -6px); } }
.menu-title { margin: .25rem .6rem .4rem; font: 600 .7rem/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.dropdown a { display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: 10px; color: var(--text); }
.dropdown a:hover { background: rgba(255, 255, 255, .05); text-decoration: none; color: #fff; }
.dropdown a strong { display: block; font-weight: 600; font-size: .92rem; }
.dropdown a small { display: block; color: var(--faint); font-size: .8rem; line-height: 1.35; margin-top: .1rem; }
.mi { --c: var(--orange); flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(255, 255, 255, .06); background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.mi .icon { width: 17px; height: 17px; }
.mi-discord { --c: #5865f2; }
.mi-reddit { --c: #ff4500; }
.mi-video { --c: #e8146f; }
.mi-palette { --c: #a855f7; }
.mi-map, .mi-mail { --c: #60a5fa; }
.mi-heart { --c: #ff5a6e; }
.mi-github { --c: #c9d1d9; }
.mi-file { --c: #a855f7; }
.mi-star { --c: #fbb03b; }
.mi-globe { --c: #2dd4bf; }
/* liens secondaires du menu Back us, sur une ligne */
.menu-foot { display: flex; justify-content: space-between; margin-top: .35rem; padding: .35rem .6rem 0; border-top: 1px solid var(--border); } /* aligné sur les icônes du dessus */
.dropdown .menu-foot a { gap: .35rem; padding: .4rem 0; color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.dropdown .menu-foot a:hover { color: #fff; background: none; }
.menu-foot .icon { width: 15px; height: 15px; color: var(--c, var(--orange)); }
.menu-social { grid-column: 1 / -1; display: flex; align-items: center; gap: .3rem; margin-top: .4rem; padding: .5rem .6rem 0; border-top: 1px solid var(--border); color: var(--faint); font-size: .8rem; }
.menu-social > span:first-child { margin-right: auto; }
.dropdown .menu-social a { flex: none; padding: .45rem; color: var(--c); }
.mi-youtube { --c: #ff5a5a; }
.mi-facebook { --c: #5b9bf8; }
.mi-x { --c: #d2e6e6; }
.menu-social .icon { width: 18px; height: 18px; }

/* même capsule que .nav-links */
.nav-actions {
  display: flex; align-items: center; gap: 2px; flex: none; padding: 4px;
  border-radius: 12px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .06);
}
.hdr-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; transition: filter .15s, background .15s; }
.hi-github { color: #c9d1d9; }
.hi-discord { color: #7d89f7; }
.hdr-icon:hover { filter: brightness(1.25); background: rgba(255, 255, 255, .06); }
.hdr-icon .icon { width: 19px; height: 19px; }
.hdr-sep { width: 1px; height: 22px; margin: 0 5px; background: var(--border-strong); }

/* bouton "Get Batocera" de l'en-tête */
a.get-btn {
  display: inline-flex; align-items: center; gap: .5rem; height: 33px; padding: 0 .3rem 0 .75rem;
  border-radius: 9px; color: #fff; background: var(--btn-grad); font: 700 .92rem/1 var(--font); white-space: nowrap;
  text-shadow: 0 1px 1px rgba(90, 0, 40, .35); transition: box-shadow .2s, transform .15s;
  --glow: 0 4px 16px -4px rgba(232, 20, 111, .7); /* halo néon sous le bouton */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), var(--glow);
}
a.get-btn:hover, a.get-btn:focus-visible { --glow: 0 5px 20px -3px rgba(232, 20, 111, .9); color: #fff; text-decoration: none; background: var(--btn-grad-hover); transform: translateY(-1px); }
a.get-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.get-ico { display: contents; }
.get-ico .icon { width: 17px; height: 17px; }
.get-ver { padding: .26rem .42rem; border-radius: 6px; background: rgba(0, 0, 0, .24); font-size: .8rem; font-weight: 600; text-shadow: none; }
a.get-btn[aria-current="page"] { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45), var(--glow); }

.nav-toggle { display: none; margin-left: auto; width: 42px; height: 42px; place-items: center; background: rgba(255, 255, 255, .04); border: 1px solid var(--border); color: var(--text); border-radius: 10px; cursor: pointer; }
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle .i-close, .nav-toggle[aria-expanded="true"] .i-open { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }

/* points de rupture mesurés sur le contenu de l'en-tête :
   icônes GitHub/Discord dès 1290px, icônes du menu dès 1200px, menu complet dès 1041px */
@media (max-width: 1289px) { .hdr-icon, .hdr-sep { display: none; } }
@media (min-width: 1040.02px) and (max-width: 1199px) { /* .02 : pas de trou avec la règle mobile en cas de zoom */
  .nav-links > a > .icon, .nav-links summary > .icon:not(.chev) { display: none; }
}

/* mobile : panneau pleine hauteur */
@media (max-width: 1040px) {
  .hdr { height: 64px; }
  .nav-toggle { display: grid; }
  .nav {
    /* hauteur explicite : le backdrop-filter de l'en-tête contient ce panneau */
    display: none; position: fixed; top: 64px; left: 0; right: 0; height: calc(100vh - 64px); height: calc(100dvh - 64px);
    z-index: 49; flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 1rem; padding: 1rem 20px 1.5rem; overflow-y: auto; background: #040d0f;
  }
  .nav.open { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; margin: 0; padding: 0; background: none; border: 0; gap: 0; }
  .nav-links > a, .nav-links summary { padding: .9rem .4rem; font-size: 1.1rem; font-weight: 600; border-radius: 0; border-bottom: 1px solid var(--border); }
  .menu summary .chev { margin-left: auto; }
  .nav-links > a[aria-current="page"] { background: none; box-shadow: inset 3px 0 0 var(--c); padding-left: .9rem; }
  .menu[open] summary { background: none; }
  .dropdown, .dropdown.mega { position: static; width: auto; transform: none; display: block; padding: .3rem 0 .6rem; background: none; border: 0; box-shadow: none; animation: none; }
  .menu-col + .menu-col { margin: .4rem 0 0; padding-left: 0; border-left: 0; }
  .menu-social { padding-left: .6rem; }
  .nav-actions { flex-direction: row-reverse; justify-content: space-between; gap: .35rem; margin-top: auto; padding: 1rem 0 0; background: none; border: 0; border-radius: 0; }
  .hdr-icon { display: grid; width: 38px; height: 38px; }
  a.get-btn { flex: 1; justify-content: center; height: 50px; margin: 0 0 0 .5rem; padding: 0 .85rem; font-size: 1rem; }
  html.nav-open { overflow: hidden; }
  /* sans JavaScript : le menu s'ouvre sous l'en-tête */
  .no-js .site-header { position: static; }
  .no-js .hdr { flex-wrap: wrap; height: auto; padding-block: .75rem; }
  .no-js .nav-toggle { display: none; }
  .no-js .nav { display: flex; position: static; flex-basis: 100%; height: auto; overflow: visible; padding: .5rem 0 1rem; background: none; }
}

/* ---------------------------------------------------------------- boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.15rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: 700 .95rem/1.1 var(--font);
  cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { color: #fff; text-decoration: none; border-color: var(--orange); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
/* action principale : corail vers magenta, plus clair au survol */
.btn-primary { background: var(--btn-grad); border: 0; color: #fff; text-shadow: 0 1px 1px rgba(90, 0, 40, .35); box-shadow: var(--btn-shadow); position: relative; overflow: hidden; }
.btn-primary:hover, .btn-primary:focus-visible { color: #fff; background: var(--btn-grad-hover); box-shadow: var(--btn-shadow-hover); }
.btn-sm { padding: .45rem .8rem; font-size: .85rem; }
.btn-ghost { background: transparent; }

/* ---------------------------------------------------------------- annonce */
.announce { border-bottom: 1px solid var(--border); background: linear-gradient(90deg, rgba(251, 176, 59, .14), rgba(45, 212, 191, .14)); }
.announce .wrap { display: flex; gap: .75rem; align-items: center; padding-top: .7rem; padding-bottom: .7rem; font-weight: 600; }
.announce.warning { background: rgba(255, 90, 110, .15); }
.announce .icon { color: var(--orange); }

/* ---------------------------------------------------------------- vidéo */
.lite-yt {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; cursor: pointer;
  border-radius: calc(var(--radius) - 6px); overflow: hidden; background: #000 center / cover no-repeat;
}
.lite-yt::before { /* lignes d'écran cathodique */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .18) 0 2px, transparent 2px 4px);
}
.lite-yt .play {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  display: grid; place-items: center; background: var(--grad); color: #1a0612; box-shadow: var(--glow); transition: transform .2s;
}
.lite-yt .play .icon { width: 30px; height: 30px; margin-left: 4px; }
.lite-yt:hover .play { transform: scale(1.08); }
.lite-yt .yt-title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.5rem .9rem .7rem; text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, .85)); color: #fff; font: 600 .85rem/1.3 var(--font);
}
.lite-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lite-yt.is-playing { cursor: auto; background: #000; }
.lite-yt.is-playing::before, .lite-yt.is-playing::after { display: none; }

/* ---------------------------------------------------------------- sections */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 2.5rem; }
.section-head.center { text-align: center; margin-inline: auto; }
.section-head.center h2::after { /* barre néon sous les titres centrés */
  content: ""; display: block; width: 56px; height: 3px; margin: .75rem auto 0; border-radius: 3px;
  background: var(--grad); box-shadow: 0 0 14px rgba(45, 212, 191, .8);
}
.section-alt { position: relative; }
.section-alt::before { /* liseré clair en haut des sections alternées */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, .7), rgba(251, 176, 59, .7), transparent);
}
/* ---------------------------------------------------------------- ciel (sky() dans helpers.php) */
/* comme l'écran de démarrage de Batocera 44 : étoiles, horizon et grille qui avance */
.sky {
  --horizon: 24%; position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  /* la lueur au-dessus de l'horizon */
  background: linear-gradient(0deg, transparent var(--horizon), rgba(45, 212, 191, .06) var(--horizon), transparent calc(var(--horizon) + 40px));
}
.sky .stars {
  position: absolute; top: 0; left: 0; width: 2px; height: 2px; border-radius: 50%; background: transparent; opacity: .6;
  box-shadow:
    4vw 8vh rgba(255,255,255,.6), 18vw 5vh rgba(255,255,255,.5), 26vw 31vh rgba(126,232,218,.5), 33vw 12vh rgba(255,255,255,.55),
    47vw 6vh rgba(255,255,255,.5), 55vw 19vh rgba(126,232,218,.6), 62vw 9vh rgba(255,255,255,.55), 76vw 14vh rgba(255,255,255,.5),
    83vw 4vh rgba(255,255,255,.55), 90vw 24vh rgba(126,232,218,.45), 8vw 38vh rgba(255,255,255,.25), 37vw 41vh rgba(255,255,255,.2),
    58vw 44vh rgba(255,255,255,.2), 86vw 40vh rgba(255,255,255,.25);
}
/* le sol (grille dessinée par sky()), éclairé au milieu */
.sky .floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--horizon); overflow: hidden;
  background: radial-gradient(60% 140% at 50% 100%, rgba(45, 212, 191, .05), transparent);
}
.sky .grid {
  display: block; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(rgba(0, 0, 0, .35), #000 35%); mask-image: linear-gradient(rgba(0, 0, 0, .35), #000 35%);
}
.sky .grid line { stroke: rgba(45, 212, 191, .1); stroke-width: 1; vector-effect: non-scaling-stroke; }
/* une ligne va de l'horizon au bas en 50 s, de plus en plus vite */
.sky .grid .run { animation: floor-run 50s cubic-bezier(.333, 0, .667, .333) infinite; }
@keyframes floor-run { from { transform: translateY(0); } to { transform: translateY(216px); } }
.sky .floor::before { /* la ligne d'horizon */
  content: ""; position: absolute; z-index: 1; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, .22) 20%, rgba(45, 212, 191, .4) 50%, rgba(45, 212, 191, .22) 80%, transparent);
  box-shadow: 0 0 4px 1px rgba(45, 212, 191, .14);
}
@media (prefers-reduced-motion: reduce) { .sky .grid .run { animation: none; } }

/* petite version des en-têtes de page, identique partout */
.sky-mini { --horizon: 56px; }
.sky-mini .stars { opacity: .4; }
@media (max-width: 700px) { .sky-mini { --horizon: 40px; } }

.page-head {
  /* même hauteur sur toutes les pages */
  position: relative; min-height: 304px; padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(3rem, 6vw, 4.5rem); border-bottom: 1px solid var(--border); isolation: isolate; overflow: hidden;
  background: radial-gradient(60% 120% at 90% 100%, rgba(45, 212, 191, .2), transparent 60%), linear-gradient(180deg, #040d0f, transparent);
}
.page-head h1 { margin-bottom: .3em; text-shadow: 0 0 30px rgba(45, 212, 191, .35); }
.page-head p { color: var(--muted); max-width: 70ch; margin: 0; }
.page-body { padding: 2.5rem 0 4rem; }

.board, .video-card, .card { position: relative; }
.board::before, .video-card::before { /* liseré néon au survol */
  content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px; border-radius: 2px; z-index: 2;
  background: var(--grad); opacity: 0; transition: opacity .2s; box-shadow: 0 0 12px rgba(45, 212, 191, .7);
}
.board:hover::before, .video-card:hover::before { opacity: 1; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; counter-reset: step; }
.step { position: relative; padding: 1.5rem 1.5rem 1.5rem 4.2rem; border-radius: var(--radius); border: 1px dashed var(--border-strong); }
.step::before {
  counter-increment: step; content: counter(step); position: absolute; left: 1.2rem; top: 1.35rem;
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 6px;
  font: 800 1rem/1 var(--mono); background: var(--grad); color: #1a0612;
}
.step h3 { margin-bottom: .3rem; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------------------------------------------------------------- recherche */
.dl-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search .icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input[type=search] { padding-left: 2.6rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }


.badge { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .55rem; border-radius: 7px; font: 600 .75rem/1.2 var(--font); white-space: nowrap; background: rgba(251, 176, 59, .15); color: var(--orange); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 7px var(--orange); }

/* ---------------------------------------------------------------- vidéos */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1.25rem; margin-bottom: 3rem; }
.video-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.video-card .lite-yt { border-radius: 0; }
.video-card .meta { padding: .75rem 1rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; font-weight: 600; }
.lang { font: 700 .7rem/1 var(--mono); text-transform: uppercase; padding: .25rem .45rem; border-radius: 4px; border: 1px solid var(--border-strong); color: var(--muted); }

/* ---------------------------------------------------------------- formulaires */
label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .93rem; }
input[type=text], input[type=email], input[type=search], input[type=password], input[type=url], input[type=date], select, textarea {
  width: 100%; padding: .7rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-2); color: var(--text); font: inherit;
}
/* même rendu partout : Safari dessine sinon ses propres champs */
input[type=search], select { -webkit-appearance: none; appearance: none; }
input[type=search]::-webkit-search-decoration { display: none; }
select {
  padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a6c3c4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center; background-size: 12px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(251, 176, 59, .25); }
/* l'iPhone zoome sur les champs dont le texte fait moins de 16px */
@supports (-webkit-touch-callout: none) { input, select, textarea { font-size: 16px !important; } }
textarea { resize: vertical; min-height: 9rem; }
.field { margin-bottom: 1.1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.notice { display: flex; gap: .8rem; padding: 1rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); margin-bottom: 1.5rem; }
.notice .icon { margin-top: .15rem; color: var(--cyan); }
.notice.ok { border-color: rgba(74, 222, 128, .5); background: rgba(74, 222, 128, .08); }
.notice.ok .icon { color: var(--green); }
.notice.err { border-color: rgba(255, 90, 110, .5); background: rgba(255, 90, 110, .08); }
.notice.err .icon { color: var(--red); }
.notice ul { margin: .3rem 0 0; padding-left: 1.2rem; }

/* états des formulaires */
.field [aria-invalid="true"] { border-color: var(--red); }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(255, 90, 110, .25); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; }

/* ---------------------------------------------------------------- pied de page */
.site-footer { position: relative; isolation: isolate; overflow: hidden; background: #030a0b; border-top: 1px solid var(--border); padding: 3.5rem 0 2rem; margin-top: auto; font-size: .93rem; }
.site-footer::after { /* grille néon au plafond : le reflet de l'horizon */
  content: ""; position: absolute; z-index: -1; left: -50%; right: -50%; top: 0; height: 170px; opacity: .45;
  background-image: linear-gradient(rgba(45, 212, 191, .8) 1px, transparent 1px), linear-gradient(90deg, rgba(45, 212, 191, .8) 1px, transparent 1px);
  background-size: 70px 34px; transform: perspective(360px) rotateX(-58deg); transform-origin: top;
  -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent);
}
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--teal) 30%, var(--orange) 70%, transparent); opacity: .6; }
.footer-about { margin-top: 1rem; max-width: 34ch; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.site-footer h2 { font: 700 .75rem/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--faint); margin-bottom: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .45rem 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: #fff; }
.socials { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.socials a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); color: var(--muted); }
.socials a:hover { color: #fff; border-color: var(--orange); background: var(--surface); }
.socials .icon { width: 20px; height: 20px; }
.copyright { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--faint); font-size: .85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

.to-top { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s; cursor: pointer; z-index: 40; }
.to-top.show { opacity: 1; pointer-events: auto; }

.err-page { text-align: center; padding: 6rem 0; }
.err-page .code { font: 800 clamp(4rem, 15vw, 8rem)/1 var(--mono); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
