/* Grid Background - estático em mobile e reduced-motion */
.grid-background {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 50%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 50%, transparent 100%);
}

@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  .grid-background {
    animation: gridMove 30s linear infinite;
  }
}

@keyframes gridMove {
  0% { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

/* Efeitos de Brilho - sem animação em mobile/reduced-motion */
.futuristic-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%);
  opacity: 0.12;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.futuristic-glow:nth-child(1) {
  top: -200px;
  left: -200px;
}

.futuristic-glow:nth-child(2) {
  bottom: -200px;
  right: -200px;
  background: radial-gradient(circle, hsl(var(--secondary)) 0%, transparent 70%);
}

@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  .futuristic-glow {
    width: 500px;
    height: 500px;
    animation: glowFloat 18s ease-in-out infinite;
  }
  .futuristic-glow:nth-child(1) { top: -250px; left: -250px; }
  .futuristic-glow:nth-child(2) { bottom: -250px; right: -250px; animation-delay: 9s; }
}

@keyframes glowFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 50px) scale(1.1); }
}

/* Texto com Gradiente - sem animação em reduced-motion */
.gradient-text {
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--secondary)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (prefers-reduced-motion: no-preference) {
  .gradient-text { animation: gradientShift 3s ease infinite; }
}

@keyframes gradientShift {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(20deg); }
}

/* Efeito Glass - blur reduzido em mobile para performance */
.glass {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 769px) {
  .glass {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

/* Animação de Revelação */
.reveal-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--delay, 0s);
}

.reveal-fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Animação Float */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) translateX(0px);
  }
  33% {
    transform: translateY(-20px) translateX(10px);
  }
  66% {
    transform: translateY(10px) translateX(-10px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .animate-float {
    animation: float 6s ease-in-out infinite;
  }
}

/* Linhas de conexão animadas */
@keyframes pulse-line {
  0%, 100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Efeito de partículas melhorado */
.particle-card {
  position: relative;
  overflow: hidden;
}

.particle-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.particle-card:hover::before {
  opacity: 0.1;
  animation: particleGlow 2s ease-in-out infinite;
}

@keyframes particleGlow {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(180deg);
  }
}

/* Canvas de partículas */
#particles-canvas,
#global-particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  contain: strict;
}


/* Título Futurista */
.futuristic-title {
  position: relative;
  display: inline-block;
}

.title-gradient {
  background: linear-gradient(135deg,
    hsl(var(--primary)) 0%,
    hsl(var(--secondary)) 50%,
    hsl(var(--primary)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .title-gradient {
    animation: gradientShift 3s ease infinite;
  }
  .title-gradient::before {
    animation: gradientShift 3s ease infinite;
  }
}

.title-gradient::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg,
    hsl(var(--primary)) 0%,
    hsl(var(--secondary)) 50%,
    hsl(var(--primary)) 100%);
  filter: blur(20px);
  opacity: 0.6;
  z-index: -1;
  border-radius: 8px;
}

.title-underline {
  width: 120px;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    hsl(var(--primary)) 50%, 
    transparent 100%);
  margin-top: 8px;
  position: relative;
  animation: underlineGlow 2s ease-in-out infinite;
}

.title-underline::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    hsl(var(--primary)) 50%, 
    transparent 100%);
  filter: blur(8px);
  opacity: 0.7;
  animation: underlineGlow 2s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes underlineGlow {
  0%, 100% {
    opacity: 0.7;
    transform: scaleX(1);
  }
  50% {
    opacity: 1;
    transform: scaleX(1.2);
  }
}

/* Cursor glow apenas em desktop com hover (economia em mobile) */
#cursor-glow {
  transition: opacity 0.25s ease;
  z-index: 9999;
}

@media (pointer: coarse) {
  #cursor-glow {
    display: none !important;
  }
}

/* Header: menos blur em mobile (backdrop-filter é pesado) */
@media (max-width: 768px) {
  header[class*="backdrop-blur"] {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

/* Melhorias de performance */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, hsl(var(--primary)), hsl(var(--secondary)));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, hsl(var(--primary)), hsl(var(--secondary)));
  opacity: 0.8;
}

/* Detail dash separator */
.detail-dash {
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.1) 50%, hsl(var(--foreground) / 0) 0%);
  background-position: center bottom;
  background-size: 16px;
  background-repeat: repeat-x;
  width: 100%;
  height: 1px;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: hsl(var(--primary));
  border-radius: 0.25rem;
}

/* Dialog animations */
@keyframes fade-in {
  from { background-color: rgba(0, 0, 0, 0); }
  to { background-color: rgba(0, 0, 0, 0.8); }
}

@keyframes fade-out {
  from { background-color: rgba(0, 0, 0, 0.8); }
  to { background-color: rgba(0, 0, 0, 0); }
}

@keyframes dialog-in {
  from { opacity: 0; scale: 50%; }
  to { opacity: 1; scale: 100%; }
}

@keyframes dialog-out {
  from { opacity: 1; scale: 100%; }
  to { opacity: 0; scale: 50%; }
}

.dialog[data-state="open"] {
  animation: fade-in 0.4s forwards;
}

.dialog[data-state="closed"] {
  animation: fade-out 0.4s forwards;
}

.dialog[data-state="open"] > div {
  animation: dialog-in 0.2s forwards;
}

.dialog[data-state="closed"] > div {
  animation: dialog-out 0.2s forwards;
}

