/* Highost — apparence « Matière » (15/10), par-dessus machines.css et photos.css.
   Réponse à « il manque de la texture, ce n'est pas vivant ; une palette, pas un arc-en-ciel » :
   - une seule palette : nuit, bleu Highost, azur, glacier, et une pointe d'ambre (voyants, « coup de cœur ») ;
   - « Lumière et verre » (prototype 4 choisi par Arthur) : pas de motif, des halos bleus qui baignent les fonds clairs
     et sombres comme la lumière des voyants dans une salle éteinte, et des cartes en verre dépoli par-dessus
     (le grain photo et la tôle perforée ont été retirés) ;
   - du rythme : une section de nuit au milieu de l'accueil, un pied de page de nuit ;
   - de la vie : voyants qui clignotent, photo du haut qui « respire » (coupés si le visiteur réduit les animations). */

@property --led1 { syntax: "<color>"; inherits: false; initial-value: #3fd47f; }
@property --led2 { syntax: "<color>"; inherits: false; initial-value: #3fd47f; }
@property --led3 { syntax: "<color>"; inherits: false; initial-value: #1769ff; }

:root {
  --nuit: #0a1230;
  --nuit-2: #111b45;
  --azur: #8db6ff;
  --glacier: #eaf1ff;
  --ambre: #ffb020;
  --halo-clair: radial-gradient(40% 55% at 95% 5%, rgba(23, 105, 255, .16), transparent 70%),
                radial-gradient(35% 55% at 0% 100%, rgba(141, 182, 255, .3), transparent 70%);
  --halo-sombre: radial-gradient(45% 65% at 90% 0%, rgba(23, 105, 255, .6), transparent 70%),
                 radial-gradient(35% 60% at 5% 100%, rgba(141, 182, 255, .28), transparent 70%);
}

/* --------------------------------------------------------------------------- bandeaux photo : nuit et bleu */
.tete-photo, .une:not(.une-jeu) .une-photo {
  background:
    radial-gradient(55% 80% at 90% 10%, rgba(23, 105, 255, .9), transparent 70%),
    linear-gradient(115deg, var(--nuit) 20%, #12307a 70%, #1a4fd0 100%);
}
.tete-photo img, .une:not(.une-jeu) .une-photo img {
  filter: grayscale(1) contrast(1.2) brightness(1.08); mix-blend-mode: luminosity; opacity: .6;
}
.tete-photo-monde img, .tete-photo-perso img { filter: none; mix-blend-mode: normal; opacity: 1; }
/* visuels sur mesure (VPS, web) : voile un peu plus dense sous le texte, le sujet reste net entre le texte et l'encart */
.tete-page:has(.tete-photo-perso)::before {
  background: linear-gradient(90deg, rgba(10, 18, 48, .95) 0%, rgba(10, 18, 48, .88) 45%, rgba(10, 18, 48, .3) 68%, rgba(10, 18, 48, .08) 100%);
}
@media (max-width: 900px) {
  /* téléphone et tablette : voile plus léger et recadrage sur la partie éclairée du visuel (allée de baies, fenêtres de sites) */
  .tete-page:has(.tete-photo-perso)::before { background: linear-gradient(180deg, rgba(10, 18, 48, .8) 0%, rgba(10, 18, 48, .58) 50%, rgba(10, 18, 48, .38) 100%); }
  .tete-photo-vps img { object-position: 50% 50%; }
  .tete-photo-web img { object-position: 56% 50%; }
}
.une:not(.une-jeu)::before, .tete-page::before {
  background:
    linear-gradient(90deg, rgba(10, 18, 48, .94) 0%, rgba(10, 18, 48, .76) 38%, rgba(10, 18, 48, .18) 72%, rgba(10, 18, 48, 0) 100%);
}
.page-carte::before { background: rgba(10, 18, 48, .5); }
.une-jeu { background: var(--nuit); }
.une-jeu::before {
  background:
    linear-gradient(90deg, rgba(10, 18, 48, .93) 0%, rgba(10, 18, 48, .74) 36%, rgba(10, 18, 48, .2) 70%, rgba(10, 18, 48, 0) 100%),
    linear-gradient(0deg, rgba(10, 18, 48, .55) 0%, rgba(10, 18, 48, 0) 40%);
}
.une .surtitre, .tete-page .surtitre, .une-jeu .surtitre { color: var(--azur); }
/* halo bleu qui monte du bas des bandeaux photo */
.une:not(.une-jeu)::after, .tete-page::after {
  content: ""; position: absolute; inset: auto -10% -60% 30%; height: 120%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(23, 105, 255, .45), transparent);
}
.une h1 .accent { color: var(--azur); }

/* --------------------------------------------------------------------------- la vie : voyants qui clignotent, photo qui respire */
.fiche::before, .recap::before, .encart-cles::before {
  background:
    radial-gradient(circle at 19px 16px, var(--led1) 0 3px, #23a35c 3px 4px, transparent 4.6px),
    radial-gradient(circle at 34px 16px, var(--led2) 0 3px, #23a35c 3px 4px, transparent 4.6px),
    radial-gradient(circle at 49px 16px, var(--led3) 0 3px, #0d4fd0 3px 4px, transparent 4.6px),
    linear-gradient(180deg, #f7f8fa 0%, #e9edf1 100%);
  animation: activite 2.4s linear infinite;
}
.recap::before { animation-delay: -1.1s; }
.encart-cles::before { animation-delay: -2.3s; }
@keyframes activite {
  0%, 100% { --led2: #3fd47f; --led3: #1769ff; }
  6%  { --led2: #bfe9d0; }
  9%  { --led2: #3fd47f; }
  14% { --led2: #bfe9d0; }
  17% { --led2: #3fd47f; }
  40% { --led3: #1769ff; }
  44% { --led3: #a9c6ff; }
  48% { --led3: #1769ff; }
  64% { --led2: #bfe9d0; }
  68% { --led2: #3fd47f; }
  71% { --led2: #bfe9d0; }
  74% { --led2: #3fd47f; }
}

/* --------------------------------------------------------------------------- surtitres : retirés (demande d'Arthur, 16/10),
   sauf « Notre coup de cœur » dans la fiche du VPS */
.surtitre { display: none; }
.fiche .surtitre { display: flex; text-transform: none; letter-spacing: -.005em; font-size: 14.5px; font-weight: 650; color: var(--bleu-texte); }
.surtitre::before { width: 8px; height: 8px; margin-top: 7px; background: var(--bleu); box-shadow: 0 0 0 3px rgba(23, 105, 255, .16); }
.fiche .surtitre::before { display: none; }

/* --------------------------------------------------------------------------- fonds clairs : glacier et halos */
.section { position: relative; isolation: isolate; }
.section:not(.section-brume)::after, .section-brume::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--halo-clair);
}
.section-brume { background: var(--glacier); border-block-color: #d9e4fb; }
.section-brume:not(.section-nuit) .carte, .section-brume:not(.section-nuit) .offre:not(.offre-conseillee) {
  background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.carte, .offre, .domaine, .etape, .item { background: linear-gradient(180deg, #fff 60%, #f8faff 100%); border-color: #d6e0f2; }
.carte-icone { background: var(--bleu); color: #fff; border: 0; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .16), 0 6px 14px -6px rgba(23, 105, 255, .55); }
a.carte:hover, .offre:hover { border-color: #9dbcf5; }

/* --------------------------------------------------------------------------- une section de nuit (accueil : « Pourquoi Highost ») */
.section-nuit {
  background: radial-gradient(60% 90% at 100% 0%, rgba(23, 105, 255, .32), transparent 70%), var(--nuit);
  border-block-color: var(--nuit); color: #fff;
}
.section-nuit::before { background: var(--halo-sombre); }
.section-nuit h2, .section-nuit h3 { color: #fff; }
.section-nuit .chapeau, .section-nuit .carte p { color: rgba(255, 255, 255, .74); }
.section-nuit .surtitre { color: var(--azur); }
.section-nuit .carte {
  background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}

/* --------------------------------------------------------------------------- offres : le bleu pour la formule conseillée, l'ambre pour son étiquette */
.offre-conseillee { background: linear-gradient(160deg, #1769ff 0%, #0f4fd0 100%); border-color: #0f57e0; }
.offre-conseillee .pastille { background: var(--ambre); color: #3a2400; }
.offre-conseillee .bouton, .offre-conseillee .bouton:hover { color: var(--bleu-texte); }
.offre .pastille { background: #fff3d6; color: #7a4a00; }
.fiche .pastille { background: #fff; color: var(--encre); }

/* --------------------------------------------------------------------------- le bandeau des jeux de l'accueil : une mosaïque, de nuit */
.bandeau-jeux { background: var(--nuit); }
.bandeau-mosaique {
  position: absolute; z-index: -2; top: 0; bottom: 0; right: 14px; width: 50%;
  display: flex; gap: 10px; overflow: hidden;
}
.mosaique-colonne { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.mosaique-colonne:nth-child(2) { margin-top: -18%; }
.mosaique-colonne img { flex: none; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.bandeau-jeux::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(50% 80% at 0% 100%, rgba(23, 105, 255, .35), transparent 70%),
    linear-gradient(90deg, var(--nuit) 0%, var(--nuit) 46%, rgba(10, 18, 48, .25) 56%, rgba(10, 18, 48, 0) 70%);
}
.bandeau-jeux .surtitre { color: var(--azur); }
.bandeau-jeux .bandeau-contenu { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

/* --------------------------------------------------------------------------- encart de fin : une baie de nuit éclairée en bleu */
.bandeau.fin {
  background: var(--halo-sombre), radial-gradient(70% 140% at 100% 50%, rgba(23, 105, 255, .55), transparent 70%), var(--nuit);
  box-shadow: inset 0 0 0 1px rgba(141, 182, 255, .18);
}
.bandeau.fin::after { background: repeating-linear-gradient(90deg, rgba(141, 182, 255, .35) 0 3px, transparent 3px 7px); }
.bandeau.fin .surtitre { color: var(--azur); }
.bandeau.fin .bouton-principal, .bandeau.fin .bouton-principal:hover { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.bandeau.fin .bouton-principal:hover { background: var(--bleu-survol); }

/* --------------------------------------------------------------------------- pied de page de nuit */
.pied { background: var(--halo-sombre), radial-gradient(50% 120% at 0% 0%, rgba(23, 105, 255, .22), transparent 70%), var(--nuit); color: rgba(255, 255, 255, .72); border-top: 0; }
.pied h2 { color: #fff; }
.pied a { color: rgba(255, 255, 255, .78); }
.pied a:hover { color: #fff; }
.pied .marque, .pied .marque:hover { color: #fff; }
.pied-bas { border-top-color: rgba(255, 255, 255, .14); }
.pied :focus-visible { outline-color: #fff; }

/* --------------------------------------------------------------------------- téléphone, mouvement réduit */
@media (max-width: 900px) {
  /* la mosaïque reste visible sur tablette et téléphone : voile plus léger, pas de flou derrière le texte */
  .bandeau-mosaique { width: 100%; right: 0; left: 0; top: 0; bottom: 0; opacity: .8; padding-inline: 10px; }
  .bandeau-jeux::after { background: linear-gradient(180deg, rgba(10, 18, 48, .86) 0%, rgba(10, 18, 48, .7) 55%, rgba(10, 18, 48, .5) 100%); }
  .bandeau-jeux .bandeau-contenu { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .une:not(.une-jeu)::before, .tete-page::before { background: linear-gradient(180deg, rgba(10, 18, 48, .88) 0%, rgba(10, 18, 48, .7) 55%, rgba(10, 18, 48, .5) 100%); }
  .une-jeu::before { background: linear-gradient(180deg, rgba(10, 18, 48, .88), rgba(10, 18, 48, .76)); }
}
@media (max-width: 640px) {
  .une-jeu::before { background: linear-gradient(0deg, rgba(10, 18, 48, .95) 8%, rgba(10, 18, 48, .72) 50%, rgba(10, 18, 48, .25) 100%); }
}
/* =========================================================================== mouvement (16/10)
   Deux niveaux :
   - le mouvement « doux », pour tout le monde, y compris les visiteurs dont l'appareil demande moins d'animations
     (Windows : Accessibilité > Effets visuels ; téléphones : « réduire les animations ») : fondus en cascade, voyants qui
     s'allument puis clignotent, survols en couleur et en ombre, curseur des onglets, FAQ qui se déplie, fondu entre pages ;
   - le mouvement « ample », seulement sans cette demande : textes qui montent, façade qui arrive, halos qui dérivent,
     mosaïque qui défile, photo qui respire, cartes qui montent au survol, reflet sur les boutons. */
:root { interpolate-size: allow-keywords; --sortie: cubic-bezier(.2, .7, .2, 1); }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes monte { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes arrive { from { opacity: 0; transform: translateY(22px) scale(.98); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------ transitions entre les pages (navigateurs qui le permettent) */
@view-transition { navigation: auto; }
.entete { view-transition-name: entete; }
::view-transition-old(root) { animation: vt-sort .14s ease both; }
::view-transition-new(root) { animation: vt-entre .22s ease both; }
@keyframes vt-sort { to { opacity: 0; } }
@keyframes vt-entre { from { opacity: 0; } }

/* ------------------------------------------------ démarrage des bandeaux : apparition en cascade */
.une-grille > div:first-child > *, .une-jeu-contenu > *, .tete-page .conteneur > div:first-child > *, .page-carte .carte {
  animation: fondu .4s ease both;
}
.une-grille > div:first-child > :nth-child(2), .une-jeu-contenu > :nth-child(2), .tete-page .conteneur > div:first-child > :nth-child(2) { animation-delay: .04s; }
.une-grille > div:first-child > :nth-child(3), .une-jeu-contenu > :nth-child(3), .tete-page .conteneur > div:first-child > :nth-child(3) { animation-delay: .08s; }
.une-grille > div:first-child > :nth-child(4), .une-jeu-contenu > :nth-child(4), .tete-page .conteneur > div:first-child > :nth-child(4) { animation-delay: .12s; }
.une-grille > div:first-child > :nth-child(5), .une-jeu-contenu > :nth-child(5), .tete-page .conteneur > div:first-child > :nth-child(5) { animation-delay: .16s; }
.une-grille > div:first-child > :nth-child(n+6), .une-jeu-contenu > :nth-child(n+6), .tete-page .conteneur > div:first-child > :nth-child(n+6) { animation-delay: .2s; }
.fiche, .tete-page .encart-cles { animation: fondu .45s ease .12s both; }

/* la façade s'allume : un voyant après l'autre, puis l'activité normale */
.fiche::before, .encart-cles::before { animation: demarrage .7s linear .3s both, activite 2.4s linear 1s infinite; }
@keyframes demarrage {
  0%, 30% { --led1: #2b3d35; --led2: #2b3d35; --led3: #26345c; }
  32%, 60% { --led1: #3fd47f; --led2: #2b3d35; --led3: #26345c; }
  62%, 88% { --led1: #3fd47f; --led2: #3fd47f; --led3: #26345c; }
  90%, 100% { --led1: #3fd47f; --led2: #3fd47f; --led3: #1769ff; }
}

/* ------------------------------------------------ apparition au défilement (classes posées par animations.js) */
.a-reveler:not(.est-visible) { opacity: 0; }
.a-reveler.est-visible { animation: fondu .4s ease calc(var(--rang, 0) * 45ms) backwards; }

/* ------------------------------------------------ survols : la lumière et l'ombre répondent */
.carte, .offre, .carte-jeu, .domaine { transition: transform .2s var(--sortie), box-shadow .2s, border-color .2s; }
a.carte:hover, .offre:hover, .domaine:hover { box-shadow: 0 22px 44px -24px rgba(23, 105, 255, .5); }
.offre-conseillee:hover { box-shadow: 0 26px 50px -22px rgba(23, 105, 255, .75); }
.carte-jeu:hover { box-shadow: 0 22px 40px -18px rgba(10, 18, 48, .55), 0 0 0 1px rgba(141, 182, 255, .4); }
.bouton { transition: background-color .12s, border-color .12s, color .12s, transform .12s; }

/* ------------------------------------------------ en-tête qui se détache au défilement */
.entete { transition: box-shadow .2s, background-color .2s; }
.defile .entete { background: rgba(255, 255, 255, .84); box-shadow: 0 12px 30px -20px rgba(10, 18, 48, .45); }

/* ------------------------------------------------ onglets : curseur qui glisse, panneau qui apparaît */
.onglets-liste.avec-curseur [role="tab"][aria-selected="true"]::after { display: none; }
.onglet-curseur {
  position: absolute; left: 0; bottom: -1px; height: 3px; width: var(--l, 0); background: var(--bleu); border-radius: 2px;
  transform: translateX(var(--x, 0)); transition: transform .25s var(--sortie), width .25s var(--sortie);
}
.js .onglet-panneau:not([hidden]) { animation: fondu .25s ease both; }

/* ------------------------------------------------ FAQ : la réponse se déplie */
.faq details::details-content { height: 0; overflow: clip; transition: height .22s var(--sortie), content-visibility .22s allow-discrete; }
.faq details[open]::details-content { height: auto; }

/* ------------------------------------------------ configurateur : le prix s'illumine quand il change */
@keyframes prix-change { 0% { color: var(--bleu); } }
.prix-change { display: inline-block; animation: prix-change .35s ease; }

/* site.css coupe toutes les transitions quand l'appareil demande moins d'animations : on garde les douces */
@media (prefers-reduced-motion: reduce) {
  .carte, .offre, .carte-jeu, .domaine, .bouton, .entete, .onglet-curseur, .faq details::details-content { transition-duration: .2s !important; }
}

/* ------------------------------------------------ mouvement ample : seulement si l'appareil ne demande pas moins d'animations */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation-name: vt-sort-ample; }
  ::view-transition-new(root) { animation-name: vt-entre-ample; animation-timing-function: var(--sortie); }
  @keyframes vt-sort-ample { to { opacity: 0; transform: translateY(-6px); } }
  @keyframes vt-entre-ample { from { opacity: 0; transform: translateY(10px); } }

  .une-grille > div:first-child > *, .une-jeu-contenu > *, .tete-page .conteneur > div:first-child > *, .page-carte .carte,
  .a-reveler.est-visible, .js .onglet-panneau:not([hidden]) { animation-name: monte; animation-timing-function: var(--sortie); }
  .fiche, .tete-page .encart-cles { animation: arrive .55s var(--sortie) .12s both; }

  /* photo du haut qui respire */
  .une-photo img, .tete-photo img { animation: respiration 14s ease-in-out infinite alternate; }
  @keyframes respiration { from { scale: 1; } to { scale: 1.07; } }

  /* halos qui dérivent */
  @keyframes derive { from { transform: translate(0, 0) scale(1); } to { transform: translate(-6%, 5%) scale(1.08); } }
  .section { overflow: clip; }
  /* marges fixes en haut et en bas : la position du halo ne dépend plus de la hauteur de la section (pas de saut quand un onglet change) */
  .section-nuit::before { inset: -96px -15%; animation: derive 12s ease-in-out infinite alternate; }
  .section-brume:not(.section-nuit)::before, .section:not(.section-brume)::after { inset: -64px -10%; animation: derive 16s ease-in-out infinite alternate; }
  .une:not(.une-jeu)::after, .tete-page::after { animation: derive 9s ease-in-out infinite alternate; }

  /* mosaïque de jeux qui défile, colonnes à contre-sens */
  .mosaique-colonne { animation: defile-colonne 30s linear infinite; }
  .mosaique-colonne:nth-child(2) { animation-duration: 36s; animation-direction: reverse; }
  .mosaique-colonne:nth-child(3) { animation-duration: 26s; }
  @keyframes defile-colonne { to { transform: translateY(calc(-50% - 5px)); } }

  /* survols et clics qui bougent */
  a.carte:hover, .offre:hover, .domaine:hover, .carte-jeu:hover { transform: translateY(-4px); }
  .carte-icone { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
  a.carte:hover .carte-icone { transform: translateY(-2px) rotate(-8deg); }
  .bouton:active { transform: scale(.97); }
  .bouton-principal { position: relative; overflow: hidden; isolation: isolate; }
  .bouton-principal::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .32) 50%, transparent 70%);
    transform: translateX(-120%); transition: transform .45s var(--sortie);
  }
  .bouton-principal:hover::after { transform: translateX(120%); }

  @keyframes prix-change-ample { 0% { color: var(--bleu); transform: scale(1.07); } 100% { transform: none; } }
  .prix-change { animation: prix-change-ample .35s var(--sortie); }
}
