/* Estilos personalizados del portafolio (cargados desde index.html junto al script CDN de Tailwind) */

/* ------------------------------------------------------------------
   Tokens
------------------------------------------------------------------ */
:root {
  --c-blue: #3b82f6;
  --c-violet: #8b5cf6;
  --c-cyan: #22d3ee;
  --lux: linear-gradient(110deg, #2563eb 0%, #7c3aed 48%, #06b6d4 100%);
  --lux-text: linear-gradient(100deg, #93c5fd 0%, #c4b5fd 50%, #67e8f9 100%);
  --line: rgba(148, 163, 184, 0.14);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Sora', ui-sans-serif, system-ui, sans-serif;
  background: #05070d;
  color: #e5e7eb;
  overflow-x: hidden;
}

::selection {
  background: rgba(124, 58, 237, 0.45);
  color: #fff;
}

/* Scrollbar */
* {
  scrollbar-color: #3b82f6 transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #05070d; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(#3b82f6, #7c3aed);
  border-radius: 999px;
  border: 2px solid #05070d;
}

/* Foco visible para teclado */
:focus-visible {
  outline: 2px solid #67e8f9;
  outline-offset: 3px;
  border-radius: 6px;
}

/* ------------------------------------------------------------------
   Componentes reutilizables
------------------------------------------------------------------ */
/* Texto con degradado */
.text-lux {
  background-image: var(--lux-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Rejilla técnica de fondo */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
}

/* Manchas de luz (aurora) */
.aurora {
  position: absolute;
  border-radius: 9999px;
  filter: blur(90px);
  opacity: 0.45;
  pointer-events: none;
  will-change: transform;
}

/* Cristal */
.glass {
  background: rgba(14, 18, 32, 0.62);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

/* Botón principal: degradado animado + brillo que barre + halo */
.btn-lux {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.75rem;
  border-radius: 9999px;
  font-weight: 600;
  color: #fff;
  background-image: linear-gradient(110deg, #2563eb, #7c3aed, #06b6d4, #2563eb);
  background-size: 300% 100%;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18) inset,
    0 10px 30px -8px rgba(99, 102, 241, 0.65),
    0 0 40px -10px rgba(34, 211, 238, 0.45);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s, background-position 0.9s;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  border: 0;
  text-decoration: none;
}
.btn-lux::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
  transform: translateX(-120%);
}
.btn-lux:hover {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.3) inset,
    0 18px 40px -10px rgba(99, 102, 241, 0.8),
    0 0 60px -10px rgba(34, 211, 238, 0.65);
}
.btn-lux:hover::after {
  transform: translateX(120%);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-lux:active { transform: translateY(0) scale(0.98); }
.btn-lux[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-lux-sm { padding: 0.55rem 1.1rem; font-size: 0.875rem; }

/* Botón secundario */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 9999px;
  font-weight: 600;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: all 0.3s;
  cursor: pointer;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(147, 197, 253, 0.6);
  color: #fff;
}

/* Tarjeta con foco de luz que sigue al cursor (lo mueve useSpotlight) */
.spotlight {
  position: relative;
  isolation: isolate;
}
.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(99, 130, 255, 0.16), transparent 45%);
}
.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(147, 160, 255, 0.95), rgba(34, 211, 238, 0.35) 45%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.spotlight:hover::before,
.spotlight:hover::after,
.spotlight:focus-within::before,
.spotlight:focus-within::after {
  opacity: 1;
}

/* Captura de un proyecto: al pasar el cursor (o enfocar con teclado) la página se desplaza sola */
.project-shot {
  will-change: transform;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.group:hover .project-shot,
.group:focus-within .project-shot {
  transform: translateY(min(0px, calc(-100% + 256px)));
  transition-duration: var(--scroll-ms, 6000ms);
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Línea de título de sección */
.section-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.7), rgba(34, 211, 238, 0.7), transparent);
}

/* ------------------------------------------------------------------
   Botones flotantes de index.html (volver arriba / WhatsApp)
------------------------------------------------------------------ */
.whatsapp-bubble {
  background: linear-gradient(135deg, #25d366, #128c7e) !important;
  box-shadow: 0 10px 30px -8px rgba(37, 211, 102, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.2) inset !important;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
}
.whatsapp-bubble:hover {
  opacity: 1 !important;
  transform: translateY(-3px) scale(1.06);
}
#botonArriba {
  background: rgba(14, 18, 32, 0.85) !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
  border-radius: 9999px !important;
  padding: 12px !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ------------------------------------------------------------------
   Accesibilidad: respeta "reducir movimiento"
------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
