/* ============================================
   NEURONA CREATIVA — Design Tokens & Core Styles
   ============================================ */

:root {
  --nc-black: #0a0a0f;
  --nc-dark: #111118;
  --nc-surface: #1a1a24;
  --nc-border: rgba(255, 255, 255, 0.06);

  --nc-synapse: #6C5CE7;
  --nc-impulse: #A855F7;
  --nc-spark: #EC4899;
  --nc-glow: #06B6D4;
  --nc-energy: #F59E0B;

  --nc-text: rgba(255, 255, 255, 0.87);
  --nc-text-muted: rgba(255, 255, 255, 0.50);
  --nc-text-dim: rgba(255, 255, 255, 0.25);

  --nc-gradient: linear-gradient(135deg, #6C5CE7, #A855F7, #EC4899);
  --nc-gradient-cyan: linear-gradient(135deg, #06B6D4, #6C5CE7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--nc-black);
  color: var(--nc-text);
  font-family: 'Inter Tight', system-ui, sans-serif;
}

/* Hide default cursor on desktop when custom cursor is active */
body.custom-cursor-active,
body.custom-cursor-active a,
body.custom-cursor-active button,
body.custom-cursor-active input,
body.custom-cursor-active textarea {
  cursor: none !important;
}

::selection {
  background: rgba(108, 92, 231, 0.3);
  color: #fff;
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--nc-black); }
::-webkit-scrollbar-thumb { background: rgba(108, 92, 231, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(108, 92, 231, 0.5); }

/* ---- Grain Texture Overlay ---- */
.grain::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.03;
  mix-blend-mode: overlay;
}

/* ---- Preloader ---- */
#nc-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--nc-black);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#nc-loader.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#nc-loader svg .neuron-path {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: drawNeuron 2s ease forwards;
}

#nc-loader svg .neuron-branch {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawNeuron 1.5s ease forwards;
}

#nc-loader svg .synapse-dot {
  opacity: 0;
  animation: synapsePulse 0.6s ease forwards;
}

@keyframes drawNeuron {
  to { stroke-dashoffset: 0; }
}

@keyframes synapsePulse {
  0% { opacity: 0; r: 1; }
  50% { opacity: 1; r: 3; }
  100% { opacity: 0.6; r: 2; }
}

#loader-text {
  color: var(--nc-text-dim);
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 6px;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeInText 0.8s ease 1.5s forwards;
}

@keyframes fadeInText {
  to { opacity: 1; color: var(--nc-text-muted); }
}

/* ---- Marquee ---- */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-track {
  animation: marquee 30s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

/* ---- Gradient Line Animation ---- */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-gradient-border {
  background: linear-gradient(90deg, transparent, var(--nc-synapse), var(--nc-spark), transparent);
  background-size: 200% 100%;
  animation: gradientShift 3s ease-in-out infinite;
}

/* ---- Clip Path Reveals ---- */
.clip-reveal-left { clip-path: inset(0 100% 0 0); transition: clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1); }
.clip-reveal-left.revealed { clip-path: inset(0 0 0 0); }
.clip-reveal-right { clip-path: inset(0 0 0 100%); transition: clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1); }
.clip-reveal-right.revealed { clip-path: inset(0 0 0 0); }
.clip-reveal-bottom { clip-path: inset(100% 0 0 0); transition: clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1); }
.clip-reveal-bottom.revealed { clip-path: inset(0 0 0 0); }

/* ---- Magnetic Button ---- */
.magnetic-btn {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.magnetic-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--nc-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.magnetic-btn:hover::before {
  opacity: 0.1;
}

/* ---- Input Focus Animation ---- */
.input-animated {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: 1px solid var(--nc-border);
}

.input-animated:focus {
  border-color: var(--nc-synapse);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15), inset 0 0 20px rgba(108, 92, 231, 0.03);
  transform: translateY(-2px);
  outline: none;
}

/* ---- 3D Tilt Card ---- */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
}

/* ---- Service Row Hover ---- */
.service-row {
  transition: background 0.4s ease;
}

.service-row:hover {
  background: var(--nc-surface);
}

.service-row:hover .service-number {
  background: var(--nc-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 1;
}

/* ---- Impulse Dot on Divider ---- */
@keyframes impulseTravel {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.service-divider {
  position: relative;
  height: 1px;
  background: var(--nc-border);
  overflow: hidden;
}

.service-divider::after {
  content: '';
  position: absolute;
  top: -1px;
  width: 60px;
  height: 3px;
  background: var(--nc-gradient);
  border-radius: 2px;
  animation: impulseTravel 4s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(108, 92, 231, 0.6);
}

/* ---- Tech Stack Glow ---- */
.tech-icon {
  transition: all 0.3s ease;
  opacity: 0.5;
}

.tech-icon:hover {
  opacity: 1;
  filter: drop-shadow(0 0 8px var(--nc-synapse));
  transform: translateY(-4px);
}

/* ---- Knowledge Card ---- */
.knowledge-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-top: 2px solid transparent;
  background-clip: padding-box;
}

.knowledge-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(108, 92, 231, 0.1);
  border-top-color: var(--nc-synapse);
}

/* ---- Mobile Nav Overlay ---- */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(10, 10, 15, 0.97);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.nav-overlay a {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.nav-overlay.active a {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .marquee-track { animation: none; }
  .service-divider::after { animation: none; }
}

/* ---- Filter Buttons (Laboratorio) ---- */
.filter-btn {
  transition: all 0.3s ease;
}

.filter-btn.active {
  background: var(--nc-synapse);
  color: #fff;
  box-shadow: 0 0 16px rgba(108, 92, 231, 0.3);
}
