/* ============================================================
   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; }

/* Evita el scroll horizontal por sangrados sub-píxel (letter-spacing, sombras,
   puntos absolutos del timeline). No oculta contenido: todo cabe en el viewport. */
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;
}

/* Body copy measure */
.copy { max-width: 65ch; }

/* ============================================================
   HERO TYPOGRAPHY
   ============================================================ */
.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(2.25rem, 8vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
  text-wrap: balance;
  overflow-wrap: break-word;
}

/* SplitType: las palabras no se parten entre letras al hacer wrap */
.hero-title .word {
  display: inline-block;
  white-space: nowrap;
}

.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;
}

/* Typed.js cursor */
.typed-cursor {
  color: var(--accent);
  font-weight: 400;
}

/* ============================================================
   INITIAL ANIMATION STATES (revealed by GSAP / fallback JS)
   ============================================================ */
.hero-title,
.hero-anim {
  opacity: 0;
}

.gsap-reveal {
  opacity: 0;
}

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

/* ============================================================
   FLOAT / GLOW (decorative, transform/opacity only)
   ============================================================ */
@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; }

/* ============================================================
   SCROLL REVEAL (IntersectionObserver fallback system)
   ============================================================ */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.scroll-reveal.active {
  opacity: 1;
  transform: translateY(0);
}

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

/* ============================================================
   CARDS — light surface with tinted hover border
   ============================================================ */
.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 — monospace, bordered, no gradient
   ============================================================ */
.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 labels (company names, dates, badges) */
.mono-label {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================================
   SECTION HEADERS — kicker + title (editorial, left-aligned)
   ============================================================ */
.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 — datos clave estilo README (Sobre mí)
   ============================================================ */
.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 — grupos + pills técnicas
   ============================================================ */
.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 — editorial layout
   ============================================================ */
.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);
}

/* Swiper (mobile projects) */
.projects-swiper {
  width: 100%;
  max-width: 340px;
  padding-bottom: 10px;
}
.projects-swiper .swiper-slide {
  width: 100%;
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

/* ============================================================
   DARK SECTION (Experience) — full-bleed break
   ============================================================ */
.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%);
}

/* Focus visibility for 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-title,
  .hero-anim,
  .gsap-reveal,
  .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
