/* ============================================================================
   ESTILOS DEL PORTAFOLIO
   ----------------------------------------------------------------------------
   Los colores se controlan con las variables de :root (tema oscuro) y
   [data-theme="light"] (tema claro). Para cambiar la paleta completa basta
   con editar estas variables.
   ========================================================================== */

:root {
  --bg:          #0b1120;   /* fondo principal */
  --bg-alt:      #0f172a;   /* fondo de secciones alternas */
  --card:        #16203a;   /* tarjetas */
  --borde:       #243250;
  --texto:       #dbe4f3;
  --texto-suave: #8da2c0;
  --acento:      #34d399;   /* verde-menta: enlaces, botones, detalles */
  --acento-2:    #60a5fa;   /* azul secundario */
  --sombra:      0 10px 30px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg:          #f6f4ef;
  --bg-alt:      #eceae2;
  --card:        #ffffff;
  --borde:       #d8d2c4;
  --texto:       #16202e;
  --texto-suave: #5b6b80;
  --acento:      #0e8a64;
  --acento-2:    #2563eb;
  --sombra:      0 10px 25px rgba(60, 50, 30, 0.12);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--texto);
  line-height: 1.7;
  transition: background 0.3s ease, color 0.3s ease;
}

.mono { font-family: "IBM Plex Mono", monospace; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

a { color: var(--acento); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.navbar.scrolled { border-bottom-color: var(--borde); }

.navbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--acento); color: var(--bg);
  font-weight: 800; font-size: 18px;
}
.logo-text { color: var(--texto-suave); font-size: 14px; }

.nav-links { display: flex; gap: 26px; list-style: none; }
.nav-links a {
  color: var(--texto-suave); font-size: 14px; font-weight: 500;
  text-decoration: none !important;
}
.nav-links a:hover, .nav-links a.activo { color: var(--acento); }

.nav-actions { display: flex; gap: 8px; }
.icon-btn {
  background: none; border: 1px solid var(--borde); color: var(--texto);
  border-radius: 8px; width: 38px; height: 38px; cursor: pointer; font-size: 16px;
  transition: border-color 0.2s ease;
}
.icon-btn:hover { border-color: var(--acento); }
.menu-btn { display: none; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh; display: flex; align-items: center; position: relative;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background-image:
    linear-gradient(var(--borde) 1px, transparent 1px),
    linear-gradient(90deg, var(--borde) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 75%);
}
.hero-inner { position: relative; }

.hero-hello { color: var(--acento); font-size: 15px; margin-bottom: 12px; }
.hero-nombre { font-size: clamp(40px, 7vw, 72px); font-weight: 800; line-height: 1.1; }
.hero-typed {
  font-size: clamp(20px, 3.4vw, 32px); font-weight: 600;
  color: var(--texto-suave); margin: 10px 0 22px; min-height: 1.4em;
}
.cursor { color: var(--acento); animation: parpadeo 1s step-end infinite; }
@keyframes parpadeo { 50% { opacity: 0; } }

.hero-resumen { max-width: 640px; color: var(--texto-suave); margin-bottom: 30px; }

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }

.btn {
  display: inline-block; padding: 12px 26px; border-radius: 10px;
  font-weight: 600; font-size: 15px; text-decoration: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primario { background: var(--acento); color: var(--bg); box-shadow: var(--sombra); }
.btn-secundario { border: 1.5px solid var(--acento); color: var(--acento); }
.btn-grande { padding: 15px 38px; font-size: 16px; }

.hero-redes { display: flex; gap: 14px; }
.hero-redes a {
  width: 42px; height: 42px; border: 1px solid var(--borde); border-radius: 10px;
  display: grid; place-items: center; color: var(--texto-suave);
  font-size: 13px; font-weight: 600; text-decoration: none !important;
  font-family: "IBM Plex Mono", monospace;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.hero-redes a:hover { border-color: var(--acento); color: var(--acento); transform: translateY(-2px); }

.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  color: var(--texto-suave); font-size: 22px; text-decoration: none !important;
  animation: flotar 2s ease-in-out infinite;
}
@keyframes flotar { 50% { transform: translateX(-50%) translateY(8px); } }

/* ── Secciones ───────────────────────────────────────────────────────────── */
.seccion { padding: 96px 0; }
.seccion-alt { background: var(--bg-alt); }

.seccion-titulo {
  font-size: clamp(26px, 4vw, 34px); font-weight: 800; margin-bottom: 42px;
  display: flex; align-items: baseline; gap: 12px;
}
.seccion-titulo .num { color: var(--acento); font-size: 0.7em; font-weight: 500; }
.seccion-titulo.centrado { justify-content: center; }

.sub-titulo { color: var(--acento); font-size: 16px; margin-bottom: 22px; }

/* ── Perfil ──────────────────────────────────────────────────────────────── */
.perfil-grid {
  display: grid; grid-template-columns: 1fr 240px; gap: 48px; align-items: start;
}
.perfil-texto p { margin-bottom: 16px; color: var(--texto-suave); }
.perfil-texto p strong { color: var(--texto); }

.perfil-aside { text-align: center; }
.avatar {
  width: 200px; height: 200px; margin: 0 auto 16px; border-radius: 20px;
  display: grid; place-items: center;
  font-size: 84px; font-weight: 800; color: var(--bg);
  background: linear-gradient(135deg, var(--acento), var(--acento-2));
  box-shadow: var(--sombra);
}
.ubicacion { color: var(--texto-suave); font-size: 13px; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px; margin-top: 52px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--borde); border-radius: 14px;
  padding: 22px; text-align: center;
}
.stat-num { font-size: 30px; font-weight: 800; color: var(--acento); font-family: "IBM Plex Mono", monospace; }
.stat-texto { font-size: 13px; color: var(--texto-suave); margin-top: 4px; }

/* ── Habilidades ─────────────────────────────────────────────────────────── */
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px;
}
.skill-card {
  background: var(--card); border: 1px solid var(--borde); border-radius: 14px;
  padding: 24px; transition: transform 0.2s ease, border-color 0.2s ease;
}
.skill-card:hover { transform: translateY(-4px); border-color: var(--acento); }
.skill-card h3 {
  font-size: 15px; margin-bottom: 14px; color: var(--acento);
  font-family: "IBM Plex Mono", monospace; font-weight: 600;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13px; padding: 5px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--acento) 12%, transparent);
  color: var(--texto); border: 1px solid color-mix(in srgb, var(--acento) 30%, transparent);
}

/* ── Proyectos ───────────────────────────────────────────────────────────── */
.filtros { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.filtro-btn {
  background: none; border: 1px solid var(--borde); color: var(--texto-suave);
  padding: 7px 18px; border-radius: 999px; cursor: pointer; font-size: 13px;
  font-family: "IBM Plex Mono", monospace;
  transition: all 0.2s ease;
}
.filtro-btn:hover { border-color: var(--acento); color: var(--acento); }
.filtro-btn.activo { background: var(--acento); border-color: var(--acento); color: var(--bg); }

.proyectos-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px;
}
.proyecto-card {
  background: var(--card); border: 1px solid var(--borde); border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.proyecto-card:hover { transform: translateY(-6px); border-color: var(--acento); box-shadow: var(--sombra); }
.proyecto-card.oculto { display: none; }

.proyecto-img { height: 180px; overflow: hidden; background: var(--bg-alt); }
.proyecto-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.3s ease; }
.proyecto-card:hover .proyecto-img img { transform: scale(1.04); }

.proyecto-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.proyecto-titulo { font-size: 18px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.badge-destacado {
  font-size: 10px; padding: 3px 9px; border-radius: 999px; letter-spacing: 0.06em;
  background: var(--acento); color: var(--bg); font-family: "IBM Plex Mono", monospace;
}
.proyecto-desc { font-size: 14px; color: var(--texto-suave); flex: 1; }
.proyecto-tecs { display: flex; flex-wrap: wrap; gap: 7px; }
.proyecto-tecs span {
  font-size: 11.5px; color: var(--acento); font-family: "IBM Plex Mono", monospace;
}
.proyecto-links { display: flex; gap: 16px; padding-top: 6px; border-top: 1px solid var(--borde); }
.proyecto-links a { font-size: 13.5px; font-weight: 600; }

/* ── Trayectoria (timeline) ──────────────────────────────────────────────── */
.trayectoria-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--borde);
}
.timeline-item { position: relative; margin-bottom: 30px; }
.timeline-item::before {
  content: ""; position: absolute; left: -26px; top: 7px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--acento);
}
.timeline-periodo { font-size: 12.5px; color: var(--acento); font-family: "IBM Plex Mono", monospace; }
.timeline-cargo { font-weight: 700; margin: 3px 0 1px; }
.timeline-lugar { font-size: 13.5px; color: var(--texto-suave); font-style: italic; }
.timeline-desc { font-size: 14px; color: var(--texto-suave); margin-top: 6px; }

/* ── Contacto / footer ───────────────────────────────────────────────────── */
.contacto-inner { text-align: center; max-width: 620px; }
.contacto-texto { color: var(--texto-suave); margin-bottom: 30px; }
.contacto-inner .hero-redes { justify-content: center; margin-top: 30px; }

.footer {
  border-top: 1px solid var(--borde); padding: 30px 24px; text-align: center;
  color: var(--texto-suave); font-size: 13px;
}
.footer-anio { margin-top: 6px; font-size: 12px; }

.volver-arriba {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--borde);
  background: var(--card); color: var(--acento); font-size: 18px; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.volver-arriba.visible { opacity: 1; pointer-events: auto; }

/* ── Animación de aparición al hacer scroll ──────────────────────────────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .perfil-grid { grid-template-columns: 1fr; }
  .perfil-aside { order: -1; }
  .trayectoria-grid { grid-template-columns: 1fr; gap: 40px; }

  .menu-btn { display: block; }
  .nav-links {
    position: fixed; top: 64px; right: 0; left: 0;
    background: var(--bg); border-bottom: 1px solid var(--borde);
    flex-direction: column; gap: 0; padding: 8px 0;
    transform: translateY(-130%); transition: transform 0.25s ease;
  }
  .nav-links.abierto { transform: none; }
  .nav-links li { text-align: center; }
  .nav-links a { display: block; padding: 13px; font-size: 15px; }
}
