/* -------------------------------- */
/* Base */
/* -------------------------------- */

:root {
  --bg-main: #020617;
  --bg-soft: rgba(255, 255, 255, 0.03);
  --border-soft: rgba(255, 255, 255, 0.08);
  --text-main: #e5e7eb;
  --text-soft: #94a3b8;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.06), transparent 24%),
    linear-gradient(180deg, #020617 0%, #020617 100%);
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
}

/* -------------------------------- */
/* Selección */
/* -------------------------------- */

::selection {
  background: rgba(59, 130, 246, 0.25);
  color: #ffffff;
}

/* -------------------------------- */
/* Scrollbar */
/* -------------------------------- */

html {
  scrollbar-color: rgba(148, 163, 184, 0.25) #020617;
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #020617;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

/* -------------------------------- */
/* Glow técnico */
/* -------------------------------- */

.tech-glow {
  position: relative;
}

.tech-glow::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(
    120deg,
    rgba(59, 130, 246, 0.4),
    rgba(139, 92, 246, 0.4),
    rgba(34, 211, 238, 0.35)
  );
  filter: blur(20px);
  opacity: 0.25;
  z-index: -1;
  pointer-events: none;
}

/* -------------------------------- */
/* Header dinámico */
/* -------------------------------- */

header {
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s ease;
}

.header-scrolled {
  background-color: rgba(2, 6, 23, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* -------------------------------- */
/* Hover links nav */
/* -------------------------------- */

nav a {
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active-link::after {
  width: 100%;
}

nav a.active-link {
  color: #ffffff;
}

/* -------------------------------- */
/* Fondo hero */
/* -------------------------------- */

.network-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 25%, rgba(59, 130, 246, 0.24), transparent 34%),
    radial-gradient(circle at 82% 30%, rgba(139, 92, 246, 0.18), transparent 30%),
    radial-gradient(circle at 50% 85%, rgba(34, 211, 238, 0.12), transparent 28%);
  filter: blur(70px);
  z-index: -2;
  transition: transform 0.12s linear;
  pointer-events: none;
}

/* -------------------------------- */
/* Reveal */
/* -------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(42px);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------------------- */
/* Cards */
/* -------------------------------- */

.card-hover {
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    background-color 0.35s ease;
  will-change: transform;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

/* -------------------------------- */
/* Badges hero */
/* -------------------------------- */

#inicio a.rounded-full,
#inicio span.rounded-full {
  transition:
    border-color 0.3s ease,
    background-color 0.3s ease,
    color 0.3s ease,
    transform 0.3s ease;
}

#inicio a.rounded-full:hover,
#inicio span.rounded-full:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.28);
  background-color: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

/* -------------------------------- */
/* CTA final */
/* -------------------------------- */

#contacto {
  position: relative;
  overflow: hidden;
}

#contacto::before {
  content: "";
  position: absolute;
  inset: auto 0 -120px 0;
  margin: auto;
  width: 65%;
  height: 220px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}

/* -------------------------------- */
/* Canvas hero */
/* -------------------------------- */

#networkCanvas {
  z-index: -1;
  display: block;
}

/* -------------------------------- */
/* Focus accesible */
/* -------------------------------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.9);
  outline-offset: 3px;
  border-radius: 10px;
}

/* -------------------------------- */
/* Responsive */
/* -------------------------------- */

@media (max-width: 768px) {
  .reveal {
    transform: translateY(24px);
  }

  nav a::after {
    bottom: -4px;
  }

  #contacto::before {
    width: 90%;
  }
}