/* =============================================
   STYLE PREMIUM — Animations & Fonctionnalités Avancées
   Adam's Diomandé — 2026
============================================= */

/* ========== CANVAS PARTICLES ========== */
#particles-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* ========== MAGNETIC BUTTONS ========== */
.mag-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(.22,.68,0,1.2) !important;
  will-change: transform;
}
.mag-btn::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: inherit;
}

/* ========== HERO — GLITCH TEXT ========== */
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
}
.glitch:hover::before {
  animation: glitch-1 0.3s steps(1) forwards;
  color: #a855f7;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  transform: translateX(-3px);
  opacity: 0.7;
}
.glitch:hover::after {
  animation: glitch-2 0.3s steps(1) forwards;
  color: #d4af6a;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  transform: translateX(3px);
  opacity: 0.7;
}
@keyframes glitch-1 {
  0%  { transform: translateX(-3px) skewX(-2deg); }
  25% { transform: translateX(3px)  skewX(2deg); }
  50% { transform: translateX(-1px) skewX(-1deg); }
  75% { transform: translateX(2px)  skewX(1deg); }
  100%{ transform: translateX(0); }
}
@keyframes glitch-2 {
  0%  { transform: translateX(3px)  skewX(2deg); }
  25% { transform: translateX(-3px) skewX(-2deg); }
  50% { transform: translateX(1px)  skewX(1deg); }
  75% { transform: translateX(-2px) skewX(-1deg); }
  100%{ transform: translateX(0); }
}

/* ========== CURSOR TRAIL ========== */
.cursor-trail {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(168,85,247,0.7);
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%, -50%);
  transition: opacity 0.6s ease;
}

/* ========== SCROLL PROGRESS BAR ========== */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, #7C3AED, #A855F7, #D4AF6A);
  z-index: 10001;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(168,85,247,0.6);
}

/* ========== SECTION TRANSITIONS CINÉMATIQUES ========== */
.reveal-cinema {
  opacity: 0;
  transform: translateY(60px) scale(0.97);
  filter: blur(4px);
  transition:
    opacity 0.9s cubic-bezier(.22,1,.36,1),
    transform 0.9s cubic-bezier(.22,1,.36,1),
    filter 0.9s cubic-bezier(.22,1,.36,1);
}
.reveal-cinema.vis {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
.reveal-cinema.d1 { transition-delay: 0.1s; }
.reveal-cinema.d2 { transition-delay: 0.2s; }
.reveal-cinema.d3 { transition-delay: 0.3s; }

/* ========== HERO BADGE — PREMIUM SHIMMER ========== */
.hero-badge {
  animation: badgeFloat 4s ease-in-out infinite !important;
}
@keyframes badgeFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%       { transform: translateY(-10px) rotate(1deg); }
}
.hero-badge::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 30%, rgba(212,175,106,0.15) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 2.5s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ========== STATS — GLOW ON HOVER ========== */
.stat-item {
  position: relative;
  overflow: hidden;
}
.stat-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(168,85,247,0.15), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.stat-item:hover::after { opacity: 1; }

/* ========== FLOATING LABELS — CONTACT FORM ========== */
.form-grp {
  position: relative;
}
.form-grp .form-inp:not(.form-sel):focus ~ .form-lbl,
.form-grp .form-inp:not(.form-sel):not(:placeholder-shown) ~ .form-lbl {
  transform: translateY(-130%) scale(0.82);
  color: #a855f7;
  letter-spacing: 0.15em;
}
.form-grp .form-lbl {
  transition: transform 0.3s cubic-bezier(.22,1,.36,1), color 0.3s ease, letter-spacing 0.3s ease;
  transform-origin: left center;
}

/* ========== FORM INPUT FOCUS GLOW ========== */
.form-inp:focus {
  box-shadow: 0 0 0 2px rgba(168,85,247,0.3), 0 0 20px rgba(168,85,247,0.1) !important;
  outline: none !important;
  border-color: rgba(168,85,247,0.5) !important;
}

/* ========== SEND BUTTON PREMIUM ========== */
#submitBtn {
  overflow: hidden;
}
#submitBtn .btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* ========== NAV INDICATOR — underline slide ========== */
.nav-links a {
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: linear-gradient(90deg, #7C3AED, #D4AF6A);
  transition: width 0.35s cubic-bezier(.22,1,.36,1);
}
.nav-links a:hover::after { width: 100%; }

/* ========== TICKER — amélioré ========== */
.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.ticker-track {
  display: inline-flex;
  animation: ticker 28s linear infinite;
  will-change: transform;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 16px 32px;
  font-family: var(--body2, 'DM Sans', sans-serif);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  transition: color 0.3s;
}
.ticker-item:hover { color: rgba(255,255,255,0.7); }
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========== TOAST NOTIFICATIONS ========== */
#toast-container {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 14px 28px;
  background: rgba(14,1,24,0.95);
  border: 1px solid rgba(168,85,247,0.35);
  border-radius: 50px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 20px rgba(124,58,237,0.2);
  animation: toastIn 0.5s cubic-bezier(.22,1,.36,1) forwards,
             toastOut 0.4s ease 2.8s forwards;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.toast .toast-icon {
  width: 18px; height: 18px;
  background: var(--vg, linear-gradient(135deg,#7c3aed,#a855f7));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
}
@keyframes toastIn {
  from { opacity:0; transform: translateY(20px) scale(0.9); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity:1; transform: translateY(0) scale(1); }
  to   { opacity:0; transform: translateY(-20px) scale(0.9); }
}

/* ========== SECTION NUMBERS — decoration ========== */
.section-number {
  position: absolute;
  top: -20px; right: 0;
  font-family: var(--display, 'Bebas Neue', sans-serif);
  font-size: clamp(6rem, 14vw, 13rem);
  font-weight: 400;
  color: transparent;
  -webkit-text-stroke: 1px rgba(168,85,247,0.08);
  letter-spacing: 0.05em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1s ease;
}
.section-number.vis { opacity: 1; }

/* ========== AVAILABILITY BADGE ========== */
.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(22,163,74,0.12);
  border: 1px solid rgba(22,163,74,0.28);
  border-radius: 50px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(134,239,172,0.85);
  margin-bottom: 24px;
}
.availability-dot {
  width: 7px; height: 7px;
  background: #4ade80;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(74,222,128,0.7);
  animation: availPulse 1.8s ease infinite;
}
@keyframes availPulse {
  0%   { box-shadow: 0 0 0 0 rgba(74,222,128,0.7); }
  70%  { box-shadow: 0 0 0 7px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

/* ========== LOGO HOVER ANIMATE ========== */
.nav-logo {
  position: relative;
  transition: filter 0.3s ease;
}
.nav-logo:hover {
  filter: drop-shadow(0 0 12px rgba(168,85,247,0.5));
}

/* ========== PAGE TRANSITION OVERLAY ========== */
#page-transition {
  position: fixed;
  inset: 0;
  background: #05000a;
  z-index: 99998;
  pointer-events: none;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(.87,0,.13,1);
}
#page-transition.slide-in  { transform: translateY(0); pointer-events: all; }
#page-transition.slide-out { transform: translateY(-100%); }

/* ========== ABOUT/SERVICES PAGES — section label pulse ========== */
.section-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-label::before {
  content: '';
  width: 20px; height: 1px;
  background: linear-gradient(90deg, var(--gold, #D4AF6A), transparent);
  display: block;
  animation: labelPulse 2s ease-in-out infinite;
}
@keyframes labelPulse {
  0%, 100% { width: 20px; opacity: 1; }
  50% { width: 36px; opacity: 0.6; }
}

/* ========== CONTACT OPTIONS — hover lift ========== */
.contact-opt {
  transition: transform 0.3s cubic-bezier(.22,1,.36,1), box-shadow 0.3s ease, border-color 0.3s ease !important;
}
.contact-opt:hover {
  transform: translateX(8px) !important;
  box-shadow: -4px 0 30px rgba(168,85,247,0.12);
}

/* ========== MOBILE MENU — stagger animation ========== */
.mob-lnk {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(.22,1,.36,1), color 0.2s;
}
.mobile-menu.open .mob-lnk:nth-child(1) { opacity:1; transform:none; transition-delay: 0.05s; }
.mobile-menu.open .mob-lnk:nth-child(2) { opacity:1; transform:none; transition-delay: 0.12s; }
.mobile-menu.open .mob-lnk:nth-child(3) { opacity:1; transform:none; transition-delay: 0.19s; }
.mobile-menu.open .mob-lnk:nth-child(4) { opacity:1; transform:none; transition-delay: 0.26s; }

/* ========== PORTFOLIO ITEMS — stagger filter animation ========== */
.pf-item {
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.22,1,.36,1) !important;
}
.pf-item.filtering-out {
  opacity: 0 !important;
  transform: scale(0.92) !important;
}
.pf-item.filtering-in {
  animation: pfIn 0.5s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes pfIn {
  from { opacity:0; transform: scale(0.92) translateY(20px); }
  to   { opacity:1; transform: none; }
}

/* ========== CUSTOM SCROLLBAR ========== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #7C3AED, #A855F7);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: #a855f7; }

/* ========== SELECTION ========== */
::selection {
  background: rgba(124,58,237,0.35);
  color: #fff;
}

/* ========== ANIMATED GRADIENT BG — sections ========== */
.gradient-animated {
  background: linear-gradient(135deg, #08010F, #0E0118, #08010F, #100020);
  background-size: 400% 400%;
  animation: gradShift 12s ease infinite;
}
@keyframes gradShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ========== LAZY IMAGE FADE ========== */
img { opacity: 0; transition: opacity 0.6s ease; }
img.loaded { opacity: 1; }
img[src=""], img:not([src]) { opacity: 0 !important; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .section-number { display: none; }
  #particles-canvas { opacity: 0.3; }
}
