/* ============================================================
   OFFENSIVE SKILLS — Design System global
   Paleta: grises oscuros + verde claro corporativo
   ============================================================ */

:root {
  /* Colores de marca */
  --bg-0: #1d1d1d;
  --bg-1: #232323;
  --bg-2: #2b2b2b;
  --bg-3: #333333;
  --surface: linear-gradient(160deg, #303030 0%, #262626 100%);

  --green-100: #ceefce;
  --green-200: #beefbe;
  --green-300: #98ff98;
  --green-500: #43bb43;
  --green-700: #078207;

  --text-1: #f2f8f2;
  --text-2: #ceefce;
  --text-3: #a9b5a9;

  --line: rgba(190, 239, 190, 0.14);
  --line-strong: rgba(190, 239, 190, 0.35);

  --glow-sm: 0 0 18px rgba(152, 255, 152, 0.12);
  --glow-md: 0 0 32px rgba(152, 255, 152, 0.18);
  --shadow-card: 0 18px 40px rgba(0, 0, 0, 0.45);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --font-sans: 'Exo', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier Prime', 'Courier New', monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}

/* Los saltos de ancla no quedan tapados por la navbar sticky */
[id] {
  scroll-margin-top: 95px;
}

body {
  background-color: var(--bg-2);
  color: var(--text-2);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* Selección de texto en verde marca */
::selection {
  background: var(--green-300);
  color: #1d1d1d;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-1);
}

::-webkit-scrollbar-thumb {
  background: #4a554a;
  border-radius: 6px;
  border: 2px solid var(--bg-1);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green-500);
}

/* Accesibilidad: foco visible */
:focus-visible {
  outline: 2px solid var(--green-300);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   Utilidades
   ============================================================ */

.mono {
  font-family: var(--font-mono);
}

/* Texto con gradiente verde animado */
.gradient-text {
  background: linear-gradient(100deg, #beefbe 0%, #98ff98 35%, #43bb43 70%, #beefbe 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradientShift 8s ease infinite;
}

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

/* Cabecera estándar de sección */
.section-head {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 3.5rem;
  padding: 0 1.5rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-300);
  background: rgba(152, 255, 152, 0.07);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  margin-bottom: 1.2rem;
}

.section-tag::before {
  content: ">";
  color: var(--green-500);
  font-weight: 700;
}

.section-title {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
  margin: 0 0 0.8rem;
}

.section-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-3);
  line-height: 1.65;
  margin: 0;
}

/* ============================================================
   Preloader (terminal boot)
   ============================================================ */

#preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader-logo {
  max-width: min(280px, 55vw);
  height: auto;
  opacity: 0.95;
  animation: preloaderBlink 1.4s steps(2) infinite;
}

.preloader-line {
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: var(--green-300);
  margin: 0;
}

.preloader-caret {
  animation: preloaderBlink 1s steps(2) infinite;
}

@keyframes preloaderBlink {
  50% { opacity: 0.35; }
}

body.loaded #preloader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Respeto a usuarios con movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
