/* Base */
body {
  font-family: 'Inter', sans-serif;
  background-color: #050505;
  color: #e5e5e5;
}

/* Cinematic Grain Texture */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

::selection {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Animations */
.fade-in-up {
  animation: fadeInUp 0.4s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

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

.delay-100 { animation-delay: 0.05s; }
.delay-200 { animation-delay: 0.1s; }
.delay-300 { animation-delay: 0.15s; }

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #050505;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

/* Buttons */
.btn-premium {
  box-shadow: 0 0 40px -10px rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.btn-premium:hover {
  box-shadow: 0 0 50px -5px rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Scroll animations */
@keyframes fadeSlideIn {
  0% { opacity: 0; transform: translateY(30px); filter: blur(8px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0px); }
}

.animate-on-scroll { animation-play-state: paused !important; }
.animate-on-scroll.animate { animation-play-state: running !important; }

/* ========== FLUXORA CARD: FINAL POLISH (THIN BORDER + SAFARI) ========== */

.fluxora-card {
  position: relative;
  /* Tło samej karty */
  background: rgba(255, 255, 255, 0.02);
  
  /* Rozmycie pod spodem */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  
  border-radius: 24px;
  z-index: 1;
  
  /* Animacje */
  transition: transform 0.6s cubic-bezier(0.2, 0.65, 0.3, 0.9), box-shadow 0.6s ease;
  
  /* Fixy renderowania */
  isolation: isolate;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  cursor: pointer; 
  -webkit-tap-highlight-color: transparent;
}

/* 1. Statyczna ramka (Szara) - ZWYKŁY BORDER (To zawsze działa i jest cieniutkie) */
.fluxora-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  
  /* Fizyczny border 1px - idealna ostrość */
  border: 1px solid rgba(255, 255, 255, 0.1);
  
  pointer-events: none;
  transition: opacity 0.5s ease;
  opacity: 1;
}

/* 2. Animowana ramka (Gradientowa) - MASKA XOR (Wycinanie środka) */
.fluxora-card::before {
  content: "";
  position: absolute;
  /* Ramka wychodzi 1px na zewnątrz */
  inset: -1px; 
  border-radius: 24px;
  
  /* To definiuje grubość ramki gradientowej (1px + 1px) */
  padding: 1px; 
  
  background: linear-gradient(90deg, #7c3aed, #db2777, #4f46e5, #7c3aed, #db2777, #4f46e5);
  background-size: 200% 100%;
  
  /* MASKA: Klucz do cieniutkiej ramki */
  /* Definiujemy pełny prostokąt i mniejszy prostokąt w środku (content-box) */
  -webkit-mask: 
     linear-gradient(#fff 0 0) content-box, 
     linear-gradient(#fff 0 0);
  mask: 
     linear-gradient(#fff 0 0) content-box, 
     linear-gradient(#fff 0 0);
  
  /* XOR: To wycina środek. Safari wymaga tutaj prefiksu -webkit- */
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  
  opacity: 0;
  transition: opacity 0.5s ease;
  animation: shimmy 3s linear infinite;
  
  pointer-events: none;
}

/* --- LOGIKA TYTUŁU --- */
.card-title-transition {
  color: #ffffff;
  transition: color 0.4s ease;
  background-image: linear-gradient(90deg, #7c3aed, #db2777, #4f46e5, #7c3aed);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  display: inline-block;
  -webkit-text-fill-color: currentColor;
}

/* --- IKONA --- */
.icon-gradient {
  color: #7c3aed;
  display: inline-flex;
  transition: transform 0.4s ease;
  transform: translateZ(0);
}

/* --- INTERAKCJE (Hover & Mobile) --- */
.fluxora-card:hover,
.fluxora-card.mobile-active {
  transform: scale(1.03) translateY(-5px);
  box-shadow: 0 0 50px -10px rgba(124, 58, 237, 0.5);
}

.fluxora-card.mobile-active {
  transform: scale(1.02);
}

.fluxora-card:hover::before,
.fluxora-card.mobile-active::before {
  opacity: 1;
}

.fluxora-card:hover::after,
.fluxora-card.mobile-active::after {
  opacity: 0;
}

.group:hover .card-title-transition,
.fluxora-card.mobile-active .card-title-transition {
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shimmy 3s linear infinite;
}

.group:hover .icon-gradient,
.fluxora-card.mobile-active .icon-gradient {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.5));
}

@keyframes shimmy {
  0% { background-position: 0% 0; }
  100% { background-position: -200% 0; }
}

/* ========== LOGO TICKER (NAPRAWA) ========== */

.ticker-track {
  display: flex;
  gap: 4rem; /* Odpowiada gap-16 z Tailwind */
  width: max-content; /* Kluczowe: sprawia, że pasek jest szerszy niż ekran */
  animation: ticker-scroll 40s linear infinite; /* Czas trwania pętli */
}

/* Opcjonalnie: Zatrzymaj przewijanie po najechaniu myszką */
.ticker-track:hover {
  animation-play-state: paused;
}

/* Definicja ruchu */
@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    /* Przesuwamy o 50% w lewo, bo w HTML mamy dwa identyczne zestawy logotypów.
       Gdy dojedzie do połowy, przeskakuje płynnie na początek. */
    transform: translateX(-50%);
  }
}

