/* ============================================================
   animations.css — Preloader, Cursor, Classes d'animation GSAP
   Impact Communication
   v1.3 — SANS FALLBACKS (les fallbacks créaient une 2e animation)
   ============================================================ */

/* ============================================================
   ★ FIX PRÉLOADER ★
   Tant que body.loaded n'est pas posé, le contenu est caché.
============================================================ */

body:not(.loaded) {
  overflow: hidden !important;
}

body:not(.loaded) #main-content {
  opacity: 0;
  visibility: hidden;
}

body.loaded #main-content {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease;
}

/* ===== CURSOR PERSONNALISÉ ===== */

#cursor-wrap {
  pointer-events: none;
  position: fixed;
  z-index: 99990;
  top: 0;
  left: 0;
}

#cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 6px; height: 6px;
  background: var(--color-black);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
  transition: width 0.3s, height 0.3s, background 0.3s, border-radius 0.3s;
  z-index: 99991;
}

#cursor-follower {
  position: fixed;
  top: 0; left: 0;
  width: 36px; height: 36px;
  border: 1.5px solid var(--color-black);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
  transition: width 0.35s cubic-bezier(.25,.46,.45,.94),
              height 0.35s cubic-bezier(.25,.46,.45,.94),
              border-color 0.3s, background 0.3s;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.cursor-link #cursor-dot {
  width: 4px; height: 4px;
  background: var(--color-red);
}
body.cursor-link #cursor-follower {
  width: 54px; height: 54px;
  border-color: var(--color-red);
  background: rgba(192, 57, 43, 0.07);
}

body.cursor-view #cursor-dot {
  width: 0; height: 0; opacity: 0;
}
body.cursor-view #cursor-follower {
  width: 80px; height: 80px;
  background: var(--color-red);
  border-color: var(--color-red);
}
body.cursor-view #cursor-follower::after {
  content: 'View';
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: 0.68rem; font-weight: 700;
  color: white; letter-spacing: 0.08em;
  text-transform: uppercase; white-space: nowrap;
}

body.cursor-text #cursor-dot {
  width: 2px; height: 22px;
  border-radius: 1px;
}
body.cursor-text #cursor-follower { opacity: 0; }

@media (pointer: coarse) {
  #cursor-wrap { display: none; }
}

/* ===== PRELOADER ===== */

#preloader {
  position: fixed;
  inset: 0;
  background: var(--color-white);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
#preloader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pl-logo {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
}
.pl-logo span {
  color: var(--color-red);
}

.pl-tagline {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.35);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  font-weight: var(--fw-bold);
  color: var(--color-black);
}

.pl-bar {
  width: 150px;
  height: 3px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 2px;
  overflow: hidden;
}
.pl-fill {
  height: 100%;
  background: var(--color-red);
  width: 0;
  animation: plFill 1.8s cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes plFill {
  0%   { width: 0; }
  60%  { width: 65%; }
  100% { width: 100%; }
}

.pl-pct {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: rgba(0, 0, 0, 0.35);
  margin-top: 0.8rem;
  font-weight: var(--fw-bold);
  color: var(--color-black);
}

/* ============================================================
   ★ ÉTATS INITIAUX DES ÉLÉMENTS ANIMÉS (AVANT GSAP) ★
   Tous cachés par défaut → GSAP les révèle ensuite.
   ⚠️ PAS DE FALLBACK CSS : GSAP est la SEULE source d'animation.
   (Les fallbacks créaient une 2e animation à t=2s après body.loaded)
============================================================ */

/* 1. TEXT REVEAL — titres découpés en lignes */
[data-reveal] .reveal-wrap {
  display: block;
  overflow: hidden;
  line-height: 1;
  padding-bottom: 0.12em;
}

[data-reveal] .reveal-wrap .line {
  display: block;
  transform: translateY(105%);
  will-change: transform;
}

/* 2. FADE-IN UP */
[data-fade] {
  opacity: 0;
  will-change: opacity, transform;
}

/* 3. CLIP-PATH IMAGE REVEAL */
[data-img-reveal] {
  clip-path: inset(100% 0% 0% 0%);
  will-change: clip-path, transform;
}

/* 4. PARALLAX */
[data-parallax] {
  will-change: transform;
}

/* 5. SECTION BADGES */
.section-badge {
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
}

/* ===== DOT GRID (Hero Home) ===== */
.dot-grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 520px;
  padding: 2rem 0;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-dot-gray);
  will-change: transform, opacity;
  transition: background 0.3s ease;
}

.dot.dot--red {
  background: var(--color-dot-red);
}

/* ===== EXPERTISE CIRCLE (Home) ===== */
.expertise-circle {
  width: 160px;
  height: 160px;
  background: var(--color-red);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  flex-shrink: 0;
}

.expertise-circle-label {
  font-family: var(--font-heading);
  font-style: normal;
  font-size: 0.9rem;
  font-weight: var(--fw-bold);
  line-height: 1.3;
  color: white;
  text-align: center;
  letter-spacing: 0.01em;
}

.expertise-circle-label em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--fw-regular);
  font-size: 1.15rem;
  display: block;
  line-height: 1.1;
}

/* ===== TIMELINE (About — ancien sélecteur conservé pour compatibilité) ===== */
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 0.5px solid var(--color-gray-200);
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-dot-gray);
  flex-shrink: 0;
  margin-top: 0.45rem;
  transition: background 0.3s ease;
}

.timeline-item.active .timeline-dot {
  background: var(--color-red);
}

.timeline-period {
  font-size: 0.7rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  color: var(--color-gray-400);
  text-transform: uppercase;
  min-width: 80px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.timeline-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--color-black);
  line-height: 1.3;
  transition: opacity 0.3s;
}

.timeline-item:not(.active) .timeline-title {
  opacity: 0.4;
}

/* ===== EXPERTISE GRID (About — ancien sélecteur conservé) ===== */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 0.5px solid var(--color-gray-200);
  border-left: 0.5px solid var(--color-gray-200);
}

.exp-item {
  border-right: 0.5px solid var(--color-gray-200);
  border-bottom: 0.5px solid var(--color-gray-200);
  padding: 2rem 1.2rem;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 0.3s ease;
  position: relative;
  overflow: hidden;
}

.exp-item:hover {
  background: var(--color-gray-50);
}

.exp-item-number {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: var(--fw-bold);
  color: var(--color-gray-300);
  letter-spacing: 0.06em;
}

.exp-item-title {
  font-size: 0.8rem;
  font-weight: var(--fw-bold);
  color: var(--color-black);
  line-height: 1.3;
  margin-top: 1rem;
}

.exp-item-desc {
  font-size: 0.72rem;
  font-weight: var(--fw-light);
  color: var(--color-gray-500);
  line-height: 1.5;
  margin-top: 0.75rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.exp-item:hover .exp-item-desc {
  opacity: 1;
  transform: translateY(0);
}

.exp-item-circle {
  width: 36px;
  height: 36px;
  background: var(--color-red);
  border-radius: 50%;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

/* ===== HOVER REVEAL LINE ===== */
.hover-line {
  position: relative;
  display: inline-block;
}
.hover-line::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-black);
  transition: width 0.35s ease;
}
.hover-line:hover::after { width: 100%; }

/* ===== ANIMCLASS POUR SPLITTING.JS ===== */
.splitting .char {
  display: inline-block;
  overflow: hidden;
}

/* ===== LARGE QUOTE MARK ===== */
.quote-big-mark {
  font-family: var(--font-display);
  font-size: 6rem;
  line-height: 0.6;
  color: var(--color-gray-200);
  margin-bottom: 1rem;
  user-select: none;
  font-style: italic;
}