/* ==========================================================================
   TEDxAbidjan — Édition « Dopamine » — Styles personnalisés
   Ce que Tailwind ne fait pas élégamment : keyframes, signature, focus, modales.
   Les couleurs/typos sont configurées dans index.html (tailwind.config).
   ========================================================================== */

:root { color-scheme: dark; }
html, body { background: #111111; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* Sélection de texte */
::selection { background: #E62B1E; color: #fff; }

/* Focus visible cohérent et net (accessibilité clavier) */
:focus-visible { outline: 2px solid #E62B1E; outline-offset: 3px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Lien d'évitement (skip link) */
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  background: #fff; color: #111; padding: 10px 16px; border-radius: 8px;
  font-weight: 600; transition: top .2s ease;
}
.skip-link:focus { top: 16px; }

/* Titre display : très grand, très serré */
.display { letter-spacing: -0.045em; line-height: 0.92; }

/* Filet séparateur */
.hairline { height: 1px; background: linear-gradient(90deg, transparent, #2a2a2a 12%, #2a2a2a 88%, transparent); }

/* Eyebrow / label mono */
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase; color: #A6A6A6;
}

/* ---- Signature : le « signal neuronal » du hero -------------------------- */
.signal path { stroke: #2b2b2b; fill: none; }
.signal .pulse {
  stroke: #E62B1E; stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(230,43,30,.55));
  stroke-dasharray: 90 1200; animation: fire 6.5s cubic-bezier(.6,0,.2,1) infinite; opacity: .9;
}
.signal .pulse.b { animation-delay: 2.1s; }
.signal .pulse.c { animation-delay: 4.2s; }
@keyframes fire {
  0%   { stroke-dashoffset: 1290; opacity: 0; }
  6%   { opacity: .95; }
  55%  { opacity: .95; }
  70%  { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.node { fill: #1e1e1e; }
.node.on { animation: glow 6.5s ease-in-out infinite; }
.node.on.b { animation-delay: 2.1s; } .node.on.c { animation-delay: 4.2s; }
@keyframes glow { 0%,100% { fill: #1e1e1e; } 8%,60% { fill: #E62B1E; } 72% { fill:#1e1e1e; } }

/* ---- Révélations au scroll ---------------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

/* ---- Cartes « Rejoindre l'aventure » ------------------------------------ */
.join-card { transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .35s ease, background .35s ease; }
.join-card:hover { transform: translateY(-6px); border-color: #3a3a3a; background: #191919; }
.join-card:hover .join-arrow { transform: translateX(4px); }
.join-arrow { transition: transform .35s ease; }

/* ---- Cartes talks ------------------------------------------------------- */
.talk-card:hover .talk-thumb img { transform: scale(1.05); }
.talk-thumb img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.talk-card:hover .play-btn { transform: scale(1.06); background:#E62B1E; border-color:#E62B1E; }
.play-btn { transition: transform .3s ease, background .3s ease, border-color .3s ease; }

/* ---- Mur de partenaires ------------------------------------------------- */
.partner-tile { filter: grayscale(1) opacity(.55); transition: filter .35s ease, transform .35s ease, border-color .35s ease; }
.partner-tile:hover { filter: grayscale(0) opacity(1); transform: translateY(-3px); border-color:#3a3a3a; }

/* ---- Modales ------------------------------------------------------------ */
.modal-backdrop { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); background: rgba(8,8,8,.66); opacity: 0; transition: opacity .35s ease; }
.modal-panel { transform: translateY(14px) scale(.985); opacity: 0; transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .35s ease; }
.modal.is-open .modal-panel { transform: none; opacity: 1; }
.modal.is-open .modal-backdrop { opacity: 1; }

/* Champs de formulaire */
.field { background: #141414; border: 1px solid #2b2b2b; color: #fff; transition: border-color .2s ease, background .2s ease; }
.field::placeholder { color: #6f6f6f; }
.field:hover { border-color: #3a3a3a; }
.field:focus { border-color: #E62B1E; background: #171717; outline: none; }
.field[aria-invalid="true"] { border-color: #E62B1E; background: rgba(230,43,30,.06); }
.field-error { color: #ff8a80; }

/* Chiffres mono tabulaires */
.count-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Barre de progression de scroll */
#scroll-progress { transform-origin: 0 50%; transform: scaleX(0); }

/* Verrou de scroll quand une modale est ouverte */
body.no-scroll { overflow: hidden; }

/* Lightbox vidéo (ratio 16:9) */
.video-frame { position: relative; width: 100%; padding-top: 56.25%; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 16px; }

/* ---- prefers-reduced-motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .signal .pulse, .node.on { animation: none !important; }
  .signal .pulse { opacity: 0; }
  * { scroll-behavior: auto !important; }
}

/* ==========================================================================
   AJOUTS — particules hero, carrousels, marquee partenaires, galeries
   ========================================================================== */

/* ---- Hero : lueur qui respire + particules flottantes ------------------- */
.hero-glow {
  position: absolute; left: 50%; top: 42%; width: 900px; height: 900px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(230,43,30,.12) 0%, rgba(230,43,30,.04) 30%, transparent 62%);
  filter: blur(20px); pointer-events: none;
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.12); }
}

.particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.particle {
  position: absolute; bottom: -10px; border-radius: 50%;
  background: rgba(255,255,255,.35);
  animation: floatUp var(--dur, 12s) linear infinite; animation-delay: var(--delay, 0s);
  opacity: 0;
}
.particle.is-red { background: rgba(230,43,30,.85); box-shadow: 0 0 8px rgba(230,43,30,.7); }
@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: .8; }
  90%  { opacity: .5; }
  100% { transform: translateY(-108vh) translateX(var(--drift, 0)); opacity: 0; }
}

/* deux impulsions supplémentaires pour un hero plus vivant */
.signal .pulse.d { animation-delay: 1.0s; }
.signal .pulse.e { animation-delay: 3.2s; }

/* ---- Carrousel générique (talks) --------------------------------------- */
.carousel-track {
  display: flex; gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
  padding-bottom: 4px; scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-card { scroll-snap-align: start; flex: 0 0 88%; }
@media (min-width: 640px) { .carousel-card { flex-basis: 46%; } }
@media (min-width: 1024px) { .carousel-card { flex-basis: 31.5%; } }
.carousel-btn {
  width: 44px; height: 44px; border-radius: 9999px; border: 1px solid #333;
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  transition: background .25s ease, border-color .25s ease; background: #161616;
}
.carousel-btn:hover { background: #1c1c1c; border-color: #555; }

/* ---- Marquee partenaires (défilement continu) -------------------------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 1.25rem; animation: scrollx 34s linear infinite; }
.marquee-group { display: flex; gap: 1.25rem; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scrollx { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* logos partenaires en blanc monochrome sur fond noir */
.partner-logo { filter: brightness(0) invert(1) opacity(.7); transition: filter .3s ease; }
.partner-tile:hover .partner-logo { filter: brightness(0) invert(1) opacity(1); }

/* ---- Cartes galerie (Flickr) ------------------------------------------- */
.gallery-card { background: #161616; }
.gallery-card .gallery-stack {
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, #232323 0%, #161616 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 12px, transparent 12px 24px);
}
.gallery-card::before, .gallery-card::after {
  content: ""; position: absolute; inset: 14px; border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px; transform: rotate(-3deg); pointer-events: none;
}
.gallery-card::after { transform: rotate(3deg); border-color: rgba(255,255,255,.04); }
.gallery-card:hover { border-color: #3a3a3a; }
.gallery-card img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.gallery-card:hover img { transform: scale(1.05); }

@media (prefers-reduced-motion: reduce) {
  .hero-glow, .particle, .marquee-track { animation: none !important; }
  .particle { display: none; }
}

/* ==========================================================================
   COUCHE D'EXPÉRIENCE — curseur, magnétique, tilt, étapes, manifeste, hero vidéo
   ========================================================================== */

/* Curseur personnalisé (activé par enhance.js sur pointeur fin) */
body.has-cursor { cursor: none; }
body.has-cursor a, body.has-cursor button, body.has-cursor label, body.has-cursor [data-tilt] { cursor: none; }
.cur-dot, .cur-ring { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; border-radius: 50%; }
.cur-dot { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; background: #E62B1E; }
.cur-ring { width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1px solid rgba(255,255,255,.5); transition: width .2s ease, height .2s ease, margin .2s ease, background .2s ease, border-color .2s ease; }
body.cur-hover .cur-ring { width: 54px; height: 54px; margin: -27px 0 0 -27px; border-color: #E62B1E; background: rgba(230,43,30,.08); }
body.cur-down .cur-ring { width: 26px; height: 26px; margin: -13px 0 0 -13px; }

/* Boutons magnétiques + tilt : transition douce du retour */
.btn-magnetic { transition: transform .25s cubic-bezier(.2,.7,.2,1), background .3s ease, color .3s ease; will-change: transform; }
[data-tilt] { transition: transform .25s cubic-bezier(.2,.7,.2,1); will-change: transform; }

/* Manifeste (storytelling) */
#manifeste .manifesto-line { letter-spacing: -0.04em; line-height: 1.05; }

/* Étapes de formulaire */
.form-step[hidden] { display: none; }
.step-in { animation: stepIn .5s cubic-bezier(.2,.7,.2,1); }
@keyframes stepIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
#form-progress-bar { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
#form-intro.intro-done { opacity: .35; transition: opacity .6s ease; }

/* Hero vidéo plein écran */
#hero-media video { filter: saturate(1.05); }

@media (prefers-reduced-motion: reduce) {
  .cur-dot, .cur-ring { display: none; }
  .btn-magnetic, [data-tilt] { transition: none; }
  .step-in { animation: none; }
}
