/* ============================================================
   ILLITH Landing Page — Custom Styles
   Complément à Tailwind CSS
   ============================================================ */

/* ——————————————————————————————————————
   CSS CUSTOM PROPERTIES
—————————————————————————————————————— */
:root {
  --color-primary: #E6007E;
  --color-primary-dark: #C2006B;
  --color-dark: #0F0F13;
  --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* ——————————————————————————————————————
   BASE
—————————————————————————————————————— */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ——————————————————————————————————————
   SKIP LINK (ACCESSIBILITÉ)
—————————————————————————————————————— */
.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14px;
  z-index: 9999;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ——————————————————————————————————————
   GRADIENT TEXT
—————————————————————————————————————— */
.gradient-text {
  background: linear-gradient(135deg, #E6007E 0%, #FF6B35 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ——————————————————————————————————————
   BOUTONS
—————————————————————————————————————— */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary);
  color: white;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--duration-fast) ease-in-out,
    box-shadow var(--duration-fast) ease-in-out,
    transform var(--duration-fast) ease-in-out;
  outline: none;
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  box-shadow: 0 8px 24px rgba(230, 0, 126, 0.3);
}

.btn-primary:active {
  transform: scale(0.97);
  background-color: #9C0056;
}

.btn-primary:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--color-primary);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 8px;
  border: 1.5px solid var(--color-primary);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--duration-fast) ease-in-out,
    border-color var(--duration-fast) ease-in-out;
  outline: none;
}

.btn-secondary:hover {
  background-color: #FFF0F8;
  border-color: var(--color-primary-dark);
}

.btn-secondary:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

/* ——————————————————————————————————————
   NAVIGATION STICKY — Hero blanc → toujours light-mode
—————————————————————————————————————— */
#navbar {
  background-color: transparent;
  transition: background-color var(--duration-normal) ease-out,
    box-shadow var(--duration-normal) ease-out;
}

/* Nav-links sombres par défaut (hero blanc) */
.nav-link {
  color: #6B6B7E;
}

.nav-link:hover {
  color: #0F0F13;
}

#navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* light-mode conservé pour compatibilité — comportement identique */
#navbar.light-mode {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

#navbar.light-mode .nav-link {
  color: #6B6B7E;
}

#navbar.light-mode .nav-link:hover {
  color: #0F0F13;
}

#navbar.light-mode #menu-toggle,
#menu-toggle {
  color: #0F0F13;
}

/* ——————————————————————————————————————
   HERO 3D — LOGOS FLOTTANTS
—————————————————————————————————————— */
.hero-3d-stage {
  position: relative;
  width: 100%;
  height: 520px;
  user-select: none;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Glowing center */
.hero-3d-stage::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(230, 0, 126, 0.12) 0%, rgba(230, 0, 126, 0) 70%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  animation: pulseCore 4s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes pulseCore {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.7;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 1;
  }
}

/* =========================================
   STARS & SHOOTING STARS (WHITE THEME)
========================================= */
.sky-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(100, 116, 139, 0.3) 1px, transparent 0),
    radial-gradient(2px 2px at 30% 50%, rgba(230, 0, 126, 0.2) 1px, transparent 0),
    radial-gradient(1px 1px at 50% 70%, rgba(148, 163, 184, 0.3) 1px, transparent 0),
    radial-gradient(2.5px 2.5px at 70% 90%, rgba(100, 116, 139, 0.25) 1px, transparent 0),
    radial-gradient(1.5px 1.5px at 90% 30%, rgba(230, 0, 126, 0.15) 1px, transparent 0),
    radial-gradient(2px 2px at 15% 85%, rgba(148, 163, 184, 0.35) 1px, transparent 0),
    radial-gradient(1px 1px at 95% 60%, rgba(100, 116, 139, 0.4) 1px, transparent 0),
    radial-gradient(2px 2px at 45% 25%, rgba(230, 0, 126, 0.25) 1px, transparent 0);
  background-size: 150px 150px;
  animation: slowPan 120s linear infinite;
}

.star-layer-2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background-image:
    radial-gradient(1.5px 1.5px at 25% 15%, rgba(148, 163, 184, 0.3) 1px, transparent 0),
    radial-gradient(2.5px 2.5px at 40% 85%, rgba(230, 0, 126, 0.2) 1px, transparent 0),
    radial-gradient(1px 1px at 60% 45%, rgba(100, 116, 139, 0.4) 1px, transparent 0),
    radial-gradient(2px 2px at 80% 35%, rgba(148, 163, 184, 0.35) 1px, transparent 0),
    radial-gradient(1.5px 1.5px at 95% 90%, rgba(230, 0, 126, 0.25) 1px, transparent 0),
    radial-gradient(1.5px 1.5px at 10% 65%, rgba(100, 116, 139, 0.3) 1px, transparent 0),
    radial-gradient(2px 2px at 75% 20%, rgba(230, 0, 126, 0.15) 1px, transparent 0),
    radial-gradient(1px 1px at 85% 10%, rgba(148, 163, 184, 0.4) 1px, transparent 0);
  background-size: 200px 200px;
  animation: slowPan 180s linear infinite reverse;
}

@keyframes slowPan {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(-200px, -200px);
  }
}

.shooting-star {
  position: absolute;
  width: 150px;
  height: 2px;
  background: linear-gradient(90deg, rgba(230, 0, 126, 0.8), transparent);
  border-radius: 50%;
  opacity: 0;
  filter: drop-shadow(0 0 6px rgba(230, 0, 126, 0.5));
  animation: shoot 5s ease-in-out infinite;
}

.shooting-star:nth-child(3) {
  top: -5%;
  left: 30%;
  animation-delay: 1.5s;
  animation-duration: 7s;
}

.shooting-star:nth-child(4) {
  top: 20%;
  left: -10%;
  animation-delay: 4.2s;
  animation-duration: 6s;
}

.shooting-star:nth-child(5) {
  top: 60%;
  left: -5%;
  animation-delay: 7s;
  animation-duration: 9.5s;
}

@keyframes shoot {
  0% {
    transform: translateX(0) translateY(0) rotate(25deg);
    opacity: 0;
  }

  5% {
    opacity: 1;
  }

  20% {
    transform: translateX(80vw) translateY(40vw) rotate(25deg);
    opacity: 0;
  }

  100% {
    transform: translateX(80vw) translateY(40vw) rotate(25deg);
    opacity: 0;
  }
}

/* Decorative Rings */
.hero-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px dashed rgba(230, 0, 126, 0.15);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-ring-1 {
  width: 280px;
  height: 280px;
  border: 1px solid rgba(230, 0, 126, 0.08);
  /* inner solid ring */
  animation: spinRing 50s linear infinite;
}

.hero-ring-2 {
  width: 440px;
  height: 440px;
  animation: spinRingReverse 70s linear infinite;
}

.hero-ring-3 {
  width: 600px;
  height: 600px;
  animation: spinRing 90s linear infinite;
}

@keyframes spinRing {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes spinRingReverse {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}

/* Floating Wrappers */
.logo-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  /* The wrapper handles the position mapping on the ring */
  transform: translate(-50%, -50%) rotate(var(--deg)) translateX(var(--r));
  z-index: var(--z, 2);
  pointer-events: auto;
}

/* Pause the orbit on hover via the ring */
.hero-ring:hover {
  animation-play-state: paused;
}

.hero-ring:has(.logo-wrapper:hover) {
  animation-play-state: paused;
}

/* Orbs */
.logo-orb {
  width: var(--size, 70px);
  height: var(--size, 70px);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transition: all var(--duration-normal) var(--ease-spring);
  position: relative;
  /* Add depth */
  filter: var(--blur, blur(0px));
  opacity: var(--op, 1);
  /* Independent transform properties to prevent animation overrides */
  rotate: calc(-1 * var(--deg));
  translate: 0px 0px;
  scale: 1;
}

/* Counter-rotate the inner orbs so they don't spin with the ring animation */
.hero-ring-1 .logo-orb {
  animation: floatNode var(--dur, 6s) ease-in-out infinite, counterSpin1 50s linear infinite;
}

.hero-ring-2 .logo-orb {
  animation: floatNode var(--dur, 6s) ease-in-out infinite, counterSpinReverse2 70s linear infinite;
}

.hero-ring-3 .logo-orb {
  animation: floatNode var(--dur, 6s) ease-in-out infinite, counterSpin3 90s linear infinite;
}

@keyframes counterSpin1 {
  from {
    rotate: calc(-1 * var(--deg) + 0deg);
  }

  to {
    rotate: calc(-1 * var(--deg) - 360deg);
  }
}

@keyframes counterSpinReverse2 {
  from {
    rotate: calc(-1 * var(--deg) + 0deg);
  }

  to {
    rotate: calc(-1 * var(--deg) + 360deg);
  }
}

@keyframes counterSpin3 {
  from {
    rotate: calc(-1 * var(--deg) + 0deg);
  }

  to {
    rotate: calc(-1 * var(--deg) - 360deg);
  }
}

.logo-orb::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(230, 0, 126, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
}

.logo-orb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
  transition: transform var(--duration-normal) var(--ease-spring);
}

/* Hover effects */
.logo-wrapper:hover {
  z-index: 20 !important;
  animation-play-state: paused;
}

.logo-wrapper:hover .logo-orb {
  scale: 1.15;
  translate: 0px -5px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow:
    0 20px 48px rgba(230, 0, 126, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 1);
  border-color: rgba(230, 0, 126, 0.3);
  filter: blur(0px) !important;
  opacity: 1 !important;
  animation-play-state: paused;
}

.logo-wrapper:hover .logo-orb img {
  transform: scale(1.1);
}

/* Center Piece Settings */
.pos-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  --z: 10;
}

.center-orb {
  /* Using exact exact sizing and shadow from old Bubble */
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 16px 40px rgba(230, 0, 126, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 1);
  --size: 110px;
  animation: floatCenter 6s ease-in-out infinite;
}

@keyframes floatCenter {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0);
  }
}

/* Positions & Sizes using polar coordinates (--r = radius, --deg = angle) */
/* Ring 1: width 280 (radius 140px) */
.pos-1 {
  --r: 140px;
  --deg: 320deg;
  --size: 74px;
  --dur: 6.8s;
  --delay: 0s;
  --z: 3;
}

.pos-2 {
  --r: 140px;
  --deg: 160deg;
  --size: 74px;
  --dur: 7.5s;
  --delay: -1.4s;
  --z: 1;
  --op: 0.9;
}

.pos-9 {
  --r: 140px;
  --deg: 80deg;
  --size: 74px;
  --dur: 6.5s;
  --delay: -2.1s;
  --z: 2;
}

/* Canva */

/* Ring 2: width 440 (radius 220px) */
.pos-3 {
  --r: 220px;
  --deg: 45deg;
  --size: 74px;
  --dur: 6.2s;
  --delay: -2.8s;
  --z: 4;
}

.pos-4 {
  --r: 220px;
  --deg: 240deg;
  --size: 74px;
  --dur: 8.1s;
  --delay: -0.7s;
  --z: 2;
}

.pos-5 {
  --r: 220px;
  --deg: 120deg;
  --size: 74px;
  --dur: 5.9s;
  --delay: -3.5s;
  --z: 5;
}

/* Bubble orb */
.pos-10 {
  --r: 220px;
  --deg: 310deg;
  --size: 74px;
  --dur: 7.0s;
  --delay: -1.2s;
  --z: 3;
}

/* ChatGPT */

/* Ring 3: width 600 (radius 300px) */
.pos-6 {
  --r: 300px;
  --deg: 10deg;
  --size: 74px;
  --dur: 7.2s;
  --delay: -1.9s;
  --z: 2;
}

.pos-7 {
  --r: 300px;
  --deg: 190deg;
  --size: 74px;
  --dur: 6.5s;
  --delay: -4.2s;
  --z: 4;
}

.pos-8 {
  --r: 300px;
  --deg: 290deg;
  --size: 74px;
  --dur: 7.8s;
  --delay: -2.3s;
  --z: 1;
  --op: 0.85;
}

.pos-11 {
  --r: 300px;
  --deg: 110deg;
  --size: 74px;
  --dur: 6.1s;
  --delay: -3.0s;
  --z: 4;
}

/* Claude */

@keyframes floatNode {
  0% {
    translate: 0px 0px;
  }

  33% {
    translate: 5px -8px;
  }

  66% {
    translate: -4px 4px;
  }

  100% {
    translate: 0px 0px;
  }
}

/* Reduced motion — logos visibles mais statiques */
@media (prefers-reduced-motion: reduce) {

  .logo-wrapper,
  .hero-ring,
  .logo-orb {
    animation: none !important;
    transform: none !important;
  }
}

/* ——————————————————————————————————————
   MOBILE MENU
—————————————————————————————————————— */
.mobile-menu {
  transition: opacity var(--duration-normal) ease-out;
}

.mobile-menu.is-open {
  opacity: 1;
}

.mobile-menu-drawer {
  transition: transform var(--duration-normal) var(--ease-out);
  transform: translateX(100%);
}

.mobile-menu.is-open .mobile-menu-drawer {
  transform: translateX(0);
}

.mobile-menu-overlay {
  opacity: 0;
  transition: opacity var(--duration-normal) ease-out;
}

.mobile-menu.is-open .mobile-menu-overlay {
  opacity: 1;
}

/* ——————————————————————————————————————
   HERO ANIMATIONS (chargement initial)
—————————————————————————————————————— */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.hero-animate {
  opacity: 0;
  animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
}

/* ——————————————————————————————————————
   SCROLL REVEAL ANIMATIONS
—————————————————————————————————————— */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 80ms;
}

.reveal-delay-2 {
  transition-delay: 160ms;
}

.reveal-delay-3 {
  transition-delay: 240ms;
}

/* ——————————————————————————————————————
   ACCORDION (FAQ + Programme)
—————————————————————————————————————— */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 220ms var(--ease-out),
    opacity 220ms var(--ease-out);
  opacity: 0;
}

.accordion-content.is-open {
  opacity: 1;
  /* max-height est défini dynamiquement via JS (scrollHeight) */
}

/* ——————————————————————————————————————
   COOKIE BANNER
—————————————————————————————————————— */
#cookie-banner {
  transition: transform var(--duration-normal) var(--ease-out);
  transform: translateY(100%);
}

#cookie-banner.is-visible {
  transform: translateY(0);
}

/* ——————————————————————————————————————
   MOBILE STICKY CTA BAR
—————————————————————————————————————— */
#mobile-cta-bar {
  transition: transform var(--duration-normal) var(--ease-out);
}

#mobile-cta-bar.is-visible {
  transform: translateY(0);
}

/* ——————————————————————————————————————
   BACK TO TOP BUTTON
—————————————————————————————————————— */
#back-to-top {
  transition: opacity var(--duration-normal) ease-out,
    transform var(--duration-fast) ease-out;
}

#back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

#back-to-top:hover {
  transform: translateY(-2px);
}

/* ——————————————————————————————————————
   FOCUS VISIBLE (ACCESSIBILITÉ GLOBALE)
—————————————————————————————————————— */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ——————————————————————————————————————
   REDUCED MOTION (ACCESSIBILITÉ)
—————————————————————————————————————— */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-animate {
    opacity: 1;
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ——————————————————————————————————————
   POPUP LEAD MAGNET
—————————————————————————————————————— */
@keyframes popupIn {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(24px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#lead-magnet-popup:not(.hidden) {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ——————————————————————————————————————
   GIFT WIDGET FLOTTANT
—————————————————————————————————————— */
@keyframes giftFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

@keyframes giftWiggle {
  0%, 100% { transform: rotate(-12deg) scale(1); }
  25%       { transform: rotate(12deg) scale(1.1); }
  50%       { transform: rotate(-8deg) scale(1); }
  75%       { transform: rotate(8deg) scale(1.05); }
}

@keyframes giftPulseRing {
  0%   { transform: scale(1);    opacity: 0.6; }
  100% { transform: scale(1.6);  opacity: 0; }
}

#gift-widget {
  animation: giftFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(230, 0, 126, 0.35));
}

#gift-widget .gift-emoji {
  display: inline-block;
  animation: giftWiggle 2.5s ease-in-out infinite;
}

#gift-widget .gift-ring {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 2px solid rgba(230, 0, 126, 0.4);
  animation: giftPulseRing 2s ease-out infinite;
  pointer-events: none;
}

/* ——————————————————————————————————————
   PETITS ÉCRANS (< 320px)
—————————————————————————————————————— */
@media (max-width: 320px) {

  .btn-primary,
  .btn-secondary {
    padding: 12px 16px;
    font-size: 14px;
  }
}