/* ============================================================================
   intro.css – l'écran de bienvenue de mmbt.fr, version « cinématique » (MMBT, 2026)
   ----------------------------------------------------------------------------
   Montré UNE fois par visite (voir site.js), il dure environ 8 secondes (Maabadi aime qu'il s'affiche doucement) : lueurs qui respirent,
   « Karibu » qui se lève lettre par lettre en or, les deux phrases, les deux drapeaux, une fine
   barre de progression, puis il s'ouvre en fondu sur l'accueil. Un toucher le saute.
   Couleurs = variables du site, donc valable avec les trois palettes.
   ============================================================================ */
.accueil { z-index: 200; isolation: isolate; overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 50% 42%, var(--bg-top, #1f1b0c) 0%, var(--bg, #000) 72%);
  /* Filet de sécurité SANS JavaScript : si intro.js ne se chargeait pas, l'écran se retire seul après 10 s. */
  animation: part 1.3s ease 10s forwards; transition: opacity 1.3s ease, transform 1.3s cubic-bezier(.6,0,.2,1), filter 1.3s ease; }
.accueil::before, .accueil::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(80px); opacity: .85; pointer-events: none; }
.accueil::before { width: min(78vw, 640px); height: min(78vw, 640px); left: 6%; top: 8%; background: radial-gradient(circle, var(--glow1, rgba(194,173,74,.5)), transparent 68%); animation: cine-derive 9s ease-in-out infinite alternate; }
.accueil::after { width: min(70vw, 560px); height: min(70vw, 560px); right: 4%; bottom: 6%; background: radial-gradient(circle, var(--glow2, rgba(31,107,74,.6)), transparent 68%); animation: cine-derive 11s ease-in-out infinite alternate-reverse; }

/* « Karibu » lettre par lettre (intro.js découpe le mot ; sans JS, le mot s'affiche d'un bloc) */
.accueil .grand { font-family: "Fraunces", Georgia, serif; font-style: italic; font-weight: 500; font-size: clamp(4.6rem, 20vw, 10.5rem); line-height: 1; letter-spacing: -.03em; color: var(--text, #fff); animation: apparait 1s ease; padding: 0 .1em; }
.accueil .grand .l { display: inline-block; padding: 0 .02em .06em; opacity: 0; transform: translate3d(0, .55em, 0) rotate(5deg) scale(.9); filter: blur(10px);
  background: var(--karibu, linear-gradient(100deg, #8d7a26, #e6d98a 40%, #fff6c9 50%, #e6d98a 60%, #8d7a26)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: intro-leve 1.7s cubic-bezier(.2,.9,.2,1) forwards, intro-brille 3.4s linear infinite; animation-delay: calc(.4s + var(--i) * .2s), calc(2s + var(--i) * .16s); }
@keyframes intro-leve { to { opacity: 1; transform: none; filter: none; } }
@keyframes intro-brille { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.accueil .petit { font-size: clamp(1.1rem, 3.2vw, 1.6rem); letter-spacing: .02em; color: var(--or); margin-top: 6px; animation: apparait 1.5s ease 2.4s both; }
.accueil .sous { font-size: clamp(.95rem, 2.4vw, 1.15rem); max-width: 34ch; line-height: 1.5; color: var(--muted); margin-top: 14px; animation: apparait 1.5s ease 3.3s both; }

/* Les deux drapeaux se tracent l'un sous l'autre (même présentation que sur l'accueil) */
.intro-drapeaux { display: grid; gap: 8px; width: 150px; margin-top: 34px; }
.intro-drapeaux i { display: block; height: 5px; border-radius: 3px; transform: scaleX(0); transform-origin: var(--origine, left); animation: intro-trace 1.7s cubic-bezier(.2,.8,.2,1) forwards; }
.intro-drapeaux i:nth-child(1) { background: linear-gradient(90deg, #3a75c4 0 25%, #d6453d 25% 50%, #fff 50% 75%, #e8cc62 75% 100%); animation-delay: 4.5s; }
.intro-drapeaux i:nth-child(2) { background: linear-gradient(90deg, #0055a4 0 33.33%, #fff 33.33% 66.66%, #ef4135 66.66% 100%); animation-delay: 5.4s; }
[dir="rtl"] .intro-drapeaux i { --origine: right; }
@keyframes intro-trace { to { transform: none; } }

/* Barre de progression fine en bas + invitation à entrer */
.intro-barre { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--or) 14%, transparent); }
.intro-barre b { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--or-fonce, #94812b), var(--or, #c2ad4a)); transform: scaleX(0); transform-origin: left; animation: intro-trace 8.4s linear forwards; }
[dir="rtl"] .intro-barre b { transform-origin: right; }
.intro-aide { position: absolute; left: 0; right: 0; bottom: 26px; font: 500 .74rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); animation: apparait 1.2s ease 6s both; }

/* Sortie : l'écran s'ouvre vers l'avant en s'effaçant, l'accueil prend la place */
.accueil.sort { opacity: 0; transform: scale(1.07); filter: blur(10px); pointer-events: none; animation: none; }

/* Pendant l'intro : la page derrière ne défile pas, et l'écran d'ouverture de l'accueil attend son tour */
html.avec-intro { overflow: hidden; }
/* Pendant l'intro, la barre de défilement (sur ordinateur) est cachée. Sans précaution, elle revient à la fin et tout ce qui est
   collé au bord droit (bouton des couleurs, menu, barre du haut) fait un petit saut vers la gauche. intro.js mesure sa largeur
   (--sb) et on garde cette place vide le temps de l'intro : rien ne bouge quand elle revient. Sur téléphone, --sb vaut 0. */
html.avec-intro { padding-right: var(--sb, 0px); }
html.avec-intro .barre { right: var(--sb, 0px); }
html.avec-intro .theme-bouton, html.avec-intro .theme-menu { right: calc(16px + var(--sb, 0px)); }
html.avec-intro .bulle-nouvelles { left: calc(50% - var(--sb, 0px) / 2); }
html.avec-intro header#haut > * { animation-play-state: paused; opacity: 0 !important; }   /* caché derrière l'intro (sinon son « Karibu » transparaît pendant l'ouverture) */
header#haut .karibu { transition: opacity .8s ease; }                                       /* …et il apparaît en fondu quand l'intro s'ouvre */

@media (prefers-reduced-motion: reduce) {
  .accueil::before, .accueil::after, .accueil .grand .l { animation: none; }
  .accueil .grand .l { opacity: 1; transform: none; filter: none; }
  .intro-drapeaux i { animation: none; transform: none; } .intro-barre b { animation: none; transform: none; } .intro-aide { animation: none; }
  .accueil { transition: opacity .3s ease; } .accueil.sort { transform: none; filter: none; }
}
@media (max-width: 760px) { .intro-aide { bottom: 22px; letter-spacing: .22em; } }
/* Sur fond clair (palette B), un fin contour garde visible le blanc des drapeaux */
html[data-theme="B"] .intro-drapeaux i, html[data-theme="B"] .cine-drapeau { box-shadow: 0 0 0 1px rgba(16,34,26,.22); }
