/* =============================================
   STYLE EXTRAS — Animations, CV Button, Lightbox
   ============================================= */

/* ---- SCROLL REVEAL amélioré ---- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(.22,1,.36,1), transform 0.7s cubic-bezier(.22,1,.36,1);
}
.reveal.reveal-left { transform: translateX(-40px); }
.reveal.reveal-right { transform: translateX(40px); }
.reveal.vis {
  opacity: 1;
  transform: none;
}
.reveal.d1 { transition-delay: 0.12s; }
.reveal.d2 { transition-delay: 0.24s; }
.reveal.d3 { transition-delay: 0.36s; }
.reveal.d4 { transition-delay: 0.48s; }

/* ---- WORD ANIMATION AU SCROLL ---- */
.animate-words .word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.animate-words .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.22,1,.36,1);
  transition-delay: calc(var(--wi) * 0.06s);
}
.animate-words.words-visible .word {
  opacity: 1;
  transform: none;
}

/* ---- HOVER TILT CARDS ---- */
.tilt-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}
.tilt-card:hover {
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ---- CV DOWNLOAD BUTTON — CLIGNOTANT ---- */
.cv-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff !important;
  border: none;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(124,58,237,0.45);
  animation: cv-pulse 2s ease-in-out infinite;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cv-download-btn::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 54px;
  background: linear-gradient(135deg, #7c3aed, #ec4899, #7c3aed);
  background-size: 200% 200%;
  animation: border-spin 3s linear infinite;
  z-index: -1;
  opacity: 0.6;
}
.cv-download-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-radius: 50px;
  z-index: -1;
}
@keyframes cv-pulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(124,58,237,0.45), 0 0 0 0 rgba(124,58,237,0.4); }
  50% { box-shadow: 0 4px 30px rgba(124,58,237,0.7), 0 0 0 10px rgba(124,58,237,0); }
}
@keyframes border-spin {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.cv-download-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 40px rgba(124,58,237,0.65);
  animation: none;
}
.cv-download-btn svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

/* ---- CV DOWNLOAD FLOATING BUTTON (About page) ---- */
.cv-float-btn {
  position: fixed;
  bottom: 100px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cv-float-btn .cv-download-btn {
  width: 56px; height: 56px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  font-size: 0;
}
.cv-float-btn .cv-float-label {
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

/* ---- LIGHTBOX ---- */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
#lightbox.open { display: flex; }
.lb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
}
.lb-content {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 900px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lb-img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.7);
  object-fit: contain;
  animation: lb-in 0.3s cubic-bezier(.22,1,.36,1);
}
@keyframes lb-in {
  from { opacity:0; transform: scale(0.92); }
  to { opacity:1; transform: none; }
}
.lb-close {
  position: absolute;
  top: -44px; right: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lb-close:hover { background: rgba(255,255,255,0.25); }
.lb-prev, .lb-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.lb-prev { left: -56px; }
.lb-next { right: -56px; }
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.25); transform: translateY(-50%) scale(1.1); }
.lb-caption {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  text-align: center;
}
.lb-counter {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
}
@media (max-width: 600px) {
  .lb-prev { left: -10px; }
  .lb-next { right: -10px; }
  .lb-prev, .lb-next { width: 36px; height: 36px; font-size: 1.2rem; }
}

/* ---- GALLERY IMAGES — lisibles & cliquables ---- */
.gallery-img {
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
  border-radius: 8px;
  display: block;
  width: 100%;
  object-fit: cover;
}
.gallery-img:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  filter: brightness(1.05) contrast(1.02);
  z-index: 2;
  position: relative;
}

/* ---- CREATION GRID améliorée ---- */
.crea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.crea-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  aspect-ratio: 1;
  cursor: zoom-in;
}
.crea-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(.22,1,.36,1), filter 0.3s;
  display: block;
}
.crea-item:hover img {
  transform: scale(1.08);
  filter: brightness(0.7);
}
.crea-item .crea-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}
.crea-item:hover .crea-overlay { opacity: 1; }
.crea-item .crea-name {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---- SMOOTH SCROLL ---- */
html { scroll-behavior: smooth; }

/* ---- FOCUS VISIBLE ---- */
a:focus-visible, button:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- ABOUT PAGE — CV section ---- */
.cv-section {
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(168,85,247,0.08));
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 20px;
  padding: 40px;
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cv-section-text h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}
.cv-section-text p {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
}
@media (max-width: 600px) {
  .cv-section {
    padding: 24px;
    flex-direction: column;
    text-align: center;
  }
}
