/* Accueil : ouverture « le tunnel des 840 » (19/11/2026) — direction artistique : private/design-accueil.md
   6 s jouées seules à l'arrivée (js/home-tunnel.js), puis un mur d'effets cliquable.
   Mode jour / sombre : variables CSS seulement (body.theme-light), la bascule s'applique en direct.
   Sans JS ou avec « réduire les animations » : planche fixe en fond (sans JS) ou mur directement (réduit). */

/* Geist auto-hébergée (licence OFL), comme Inter dans css/fonts.css : zéro requête tierce (RGPD).
   Police variable : un fichier par sous-ensemble porte les graisses 400 à 600. */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/assets/fonts/geist-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/assets/fonts/geist-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Couleurs (nuit par défaut, jour avec body.theme-light) ---------- */
.tun {
  --ui-bg: #07070b;
  --ui-text: #f4f4f5;
  --ui-muted: #a1a1aa;
  --ui-veil: rgba(7, 7, 11, .88);
  --ui-ghost-bg: rgba(255, 255, 255, .04);
  --ui-ghost-line: rgba(255, 255, 255, .24);
  --ui-ghost-line-hover: rgba(255, 255, 255, .45);
  --tun-tile-ring: rgba(255, 255, 255, .07);
  --tun-tile-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  --tun-feat-ring: #818cf8;
  --tun-feat-glow: rgba(99, 102, 241, .45);
  --tun-label-bg: rgba(16, 16, 22, .94);
  --tun-label-line: rgba(255, 255, 255, .1);
  --ui-cta: #6366f1;
  --ui-ease: cubic-bezier(.2, .7, .2, 1);
}
.theme-light .tun {
  --ui-bg: #f3f4f7;
  --ui-text: #0b0b12;
  --ui-muted: #4b5262;
  --ui-veil: rgba(243, 244, 247, .9);
  --ui-ghost-bg: rgba(255, 255, 255, .7);
  --ui-ghost-line: rgba(15, 23, 42, .2);
  --ui-ghost-line-hover: rgba(15, 23, 42, .4);
  --tun-tile-ring: rgba(15, 23, 42, .08);
  --tun-tile-shadow: 0 14px 30px rgba(15, 23, 42, .2);
  --tun-feat-ring: #6366f1;
  --tun-feat-glow: rgba(99, 102, 241, .3);
  --tun-label-bg: rgba(255, 255, 255, .97);
  --tun-label-line: rgba(15, 23, 42, .1);
}

/* ---------- Scène ---------- */
.tun { position: relative; background: var(--ui-bg); color: var(--ui-text); font-family: 'Geist', 'Inter', -apple-system, sans-serif; }
.tun-stage {
  position: relative;
  height: 100vh; height: 100svh; min-height: 560px;
  overflow: hidden;
  perspective: 900px;
  perspective-origin: 50% 50%;
}
/* Sans JS : la planche des vignettes en fond, voilée */
.tun:not(.is-js) .tun-stage {
  background: linear-gradient(var(--ui-veil), var(--ui-veil)), var(--tun-static) center / cover no-repeat;
}
.tun-world {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0;
  transform-style: preserve-3d;
  /* visibility et non opacity : une opacité < 1 aplatirait la 3D (Safari) */
  visibility: hidden;
}
.tun.is-flying .tun-world, .tun.is-forming .tun-world, .tun.is-done .tun-world { visibility: visible; }
.tun-tile {
  position: absolute;
  left: calc(var(--tun-tw) / -2); top: calc(var(--tun-th) / -2);
  width: var(--tun-tw); height: var(--tun-th);
  background-image: var(--tun-atlas);
  background-size: var(--tun-atlas-w) auto;
  background-repeat: no-repeat;
  background-color: #0b0b10;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--tun-tile-ring), var(--tun-tile-shadow);
  transition: box-shadow .4s var(--ui-ease);
}
/* Effet mis en avant : il s'avance devant les autres (js/home-tunnel.js), halo couleur de la marque */
.tun-tile.is-featured {
  border-radius: 12px;
  box-shadow: 0 0 0 2px var(--tun-feat-ring), 0 18px 50px var(--tun-feat-glow), 0 30px 80px rgba(0, 0, 0, .45);
}
/* Étiquette « nom · à quoi il sert », à côté de l'effet au premier plan */
.tun-label {
  position: absolute; z-index: 4; left: 0; top: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--tun-label-bg);
  border: 1px solid var(--tun-label-line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
  color: var(--ui-text);
  font-family: 'Geist', 'Inter', -apple-system, sans-serif;
  pointer-events: none;
  opacity: 0;
  transform: translateY(calc(var(--ty, 0%) + 6px));
  transition: opacity .35s var(--ui-ease), transform .35s var(--ui-ease);
}
.tun-label.is-above { --ty: -100%; }
/* téléphone : bandeau en bas de l'écran */
.tun-label.is-bar { left: 12px; right: 12px; top: auto; bottom: 14px; --ty: 0%; padding: 9px 12px; }
.tun-label.is-bar p { font-size: .8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tun-label.is-on { opacity: 1; transform: translateY(var(--ty, 0%)); }
.tun-label b { display: block; font-size: .95rem; font-weight: 600; letter-spacing: -0.01em; }
.tun-label span { display: block; margin-top: 6px; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tun-feat-ring); }
.tun-label p { margin: 3px 0 0; font-size: .85rem; line-height: 1.4; color: var(--ui-muted); }
/* Brume au point de fuite (les vignettes lointaines s'y fondent) + bords */
.tun-fog {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    /* bande du menu (transparent en haut de page) : le logo et les liens restent sur fond uni */
    linear-gradient(to bottom, var(--ui-bg) 0, var(--ui-bg) 58px, transparent 150px),
    radial-gradient(circle at 50% 50%, var(--ui-bg) 0, var(--ui-veil) 9%, transparent 30%),
    radial-gradient(ellipse 75% 75% at 50% 50%, transparent 62%, var(--ui-bg) 100%);
}
/* Voile derrière le titre et les boutons (pendant le vol puis sur le mur) */
.tun-veil {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse 42% 36% at 50% 50%, var(--ui-veil) 0, var(--ui-veil) 50%, transparent 100%);
  opacity: 0; transition: opacity 1s var(--ui-ease);
}
.tun.is-flying .tun-veil { opacity: .9; } /* le texte reste lisible pendant le vol */
.tun:not(.is-js) .tun-veil, .tun.is-forming .tun-veil, .tun.is-done .tun-veil { opacity: 1; }

/* ---------- Texte et boutons ---------- */
.tun-copy {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 84px 20px 40px;
  pointer-events: none;
}
.tun-copy > * { pointer-events: auto; }
/* .tun devant : passe avant les règles de la page (mode jour, titres) */
.tun .tun-copy h1 {
  font-family: 'Geist', 'Inter', -apple-system, sans-serif;
  font-weight: 600;
  font-size: clamp(2.7rem, min(7.4vw, 11.5vh), 7rem);
  line-height: .98;
  letter-spacing: -0.045em;
  color: var(--ui-text);
  margin: 0;
  background: none; -webkit-text-fill-color: currentColor; text-shadow: none;
}
.tun .tun-copy p {
  margin: 1.3rem auto 0;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.3vw, 1.25rem);
  line-height: 1.5;
  color: var(--ui-muted);
}
.tun .tun-copy p strong { color: var(--ui-text); font-weight: 600; }
.tun-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 2rem; }
.tun-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .9rem 1.4rem;
  border-radius: 10px;
  font: 600 1rem/1 'Geist', 'Inter', sans-serif;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .2s, border-color .2s;
}
.tun-btn--primary { background: var(--ui-cta); color: #fff; }
.tun-btn--primary:hover { background: #5458e8; }
.tun-btn--ghost { background: var(--ui-ghost-bg); color: var(--ui-text); border-color: var(--ui-ghost-line); }
.tun-btn--ghost:hover { border-color: var(--ui-ghost-line-hover); }
.tun-btn:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 3px; }

/* ---------- Téléphone ---------- */
@media (max-width: 760px) {
  .tun .tun-copy h1 { font-size: clamp(2.5rem, 12vw, 3.4rem); }
  .tun-veil { background: radial-gradient(ellipse 66% 30% at 50% 50%, var(--ui-veil) 0, var(--ui-veil) 50%, transparent 100%); }
  .tun.is-flying .tun-veil { opacity: .7; }
}
