/* ============================================================
   BASE / TYPOGRAPHY
   ============================================================ */
:root {
  --accent: #38bdf8;
  --accent-2: #0ea5e9;
  --surface-dark: #0a0f1e;
  --card-dark: #111827;
  --shadow-tint: 0 20px 60px rgba(56, 189, 248, 0.08);
}

* { scroll-behavior: smooth; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.7;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

.font-mono-tech {
  font-family: 'JetBrains Mono', monospace;
}

.copy { max-width: 65ch; }

/* ============================================================
   HERO — animaciones CSS puras (stagger por delay)
   Elimina dependencia de GSAP para el hero.
   ============================================================ */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-anim {
  opacity: 0;
  animation: heroFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Stagger: cada elemento aparece 150ms después del anterior */
.hero-anim-1 { animation-delay: 0.3s; }
.hero-anim-2 { animation-delay: 0.45s; }
.hero-anim-3 { animation-delay: 0.6s; }
.hero-anim-4 { animation-delay: 0.75s; }
.hero-anim-5 { animation-delay: 0.9s; }
.hero-anim-6 { animation-delay: 1.05s; }

/* ============================================================
   TYPEWRITER — cursor parpadeante nativo (sin Typed.js)
   ============================================================ */
.hero-role {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: clamp(1rem, 2.4vw, 1.6rem);
  color: var(--accent);
  letter-spacing: 0.02em;
  min-height: 1.4em;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typed-cursor {
  color: var(--accent);
  animation: cursorBlink 0.9s ease-in-out infinite;
  font-weight: 300;
  margin-left: 1px;
}

/* ============================================================
   SCROLL REVEAL — un solo sistema
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger para grupos de elementos hermanos con reveal */
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal:nth-child(5) { transition-delay: 0.4s; }

/* ============================================================
   LOADER
   ============================================================ */
.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

/* ============================================================
   FLOAT / GLOW
   ============================================================ */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(56, 189, 248, 0.3); }
  50% { box-shadow: 0 0 40px rgba(56, 189, 248, 0.6); }
}

.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse-glow { animation: pulseGlow 2.5s ease-in-out infinite; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar-scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   CARDS
   ============================================================ */
.card-soft {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.card-soft:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: var(--shadow-tint);
  transform: translateY(-4px);
}

/* ============================================================
   TECH / LABEL TAGS
   ============================================================ */
.tag-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
}

.mono-label {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.03em;
  line-height: 1.04;
}

/* ============================================================
   SPEC SHEET (About)
   ============================================================ */
.spec-sheet {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
}
.spec-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #eef2f7;
}
.spec-row:last-child { border-bottom: 0; }
.spec-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  padding-top: 0.15rem;
}
.spec-val {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ============================================================
   SKILLS
   ============================================================ */
.skill-group-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}
.tech-pill {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.tech-pill:hover {
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-2px);
  box-shadow: var(--shadow-tint);
}

.featured-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 4px;
  padding: 4px 10px;
  display: inline-block;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.project-featured-img {
  transition: transform 0.4s ease-out, filter 0.4s ease-out;
}
.project-featured:hover .project-featured-img {
  transform: scale(1.03);
  filter: brightness(1.1);
}

.project-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: var(--shadow-tint);
  transform: translateY(-6px);
}
.project-card img {
  transition: transform 0.5s ease;
}
.project-card:hover img {
  transform: scale(1.05);
}

/* Focus visible en project cards (accesibilidad) */
.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================================
   DARK SECTION (Experience)
   ============================================================ */
.section-dark {
  background: var(--surface-dark);
  color: #e2e8f0;
}
.timeline-dark {
  border-left: 1px solid rgba(56, 189, 248, 0.2);
}
.timeline-dot {
  background: var(--accent);
  border: 4px solid var(--surface-dark);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}
.exp-card-dark {
  background: var(--card-dark);
  border: 1px solid rgba(56, 189, 248, 0.1);
  border-radius: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.exp-card-dark:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: var(--shadow-tint);
}

/* ============================================================
   CV DROPDOWN
   ============================================================ */
.cv-dropdown-wrapper { position: relative; }
#cvDropdown { min-width: 180px; }

/* ============================================================
   MODAL
   ============================================================ */
#projectModal {
  transition: opacity 0.3s ease;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #38bdf8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #0ea5e9; }

/* ============================================================
   NETWORK CANVAS
   ============================================================ */
#networkCanvas {
  background: linear-gradient(135deg, #0a0f1e 0%, #0f172a 50%, #0f2744 100%);
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .hero-anim,
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .typed-cursor {
    animation: none !important;
  }
}