/* ===========================================================
   Julián Gutiérrez — Portafolio
   =========================================================== */

:root {
  --bg: #090e1a;
  --bg-alt: #0d1424;
  --panel: #121b30;
  --panel-2: #0f1728;
  --line: rgba(226, 233, 245, 0.09);

  --accent-primary: #4f8ef7;
  --accent-primary-bright: #7db4ff;
  --accent-secondary: #4fd1e0;
  --accent-alt: #8b7ef2;
  --accent-warn: #d6806e;

  --text: #e6ecf5;
  --text-muted: #8996b3;

  --gradient: linear-gradient(120deg, var(--accent-primary), var(--accent-secondary));

  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;

  --container-w: 1160px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
h1, h2, h3, h4 {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 24px;
  background: var(--panel);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  z-index: 200;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

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

/* ===========================================================
   Texto / utilidades
   =========================================================== */
.text-accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--accent-secondary);
  margin-bottom: 12px;
}

/* ===========================================================
   Botones
   =========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.btn-primary {
  background: var(--accent-primary);
  color: #06090f;
}
.btn-primary:hover {
  background: var(--accent-primary-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(79, 142, 247, 0.35);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--accent-secondary);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.03);
}

.btn-sm { padding: 9px 18px; font-size: 0.85rem; }

/* ===========================================================
   Nav
   =========================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(9, 14, 26, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}

.nav-links {
  display: flex;
  gap: 32px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  margin-inline: auto;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  position: relative;
  padding-top: 140px;
  padding-bottom: 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-secondary);
  box-shadow: 0 0 0 0 rgba(79, 209, 224, 0.6);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 209, 224, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(79, 209, 224, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 209, 224, 0); }
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.hero-role {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent-primary-bright);
  margin-bottom: 20px;
}

.hero-bio {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 50ch;
  margin-bottom: 36px;
}
.hero-bio strong { color: var(--text); }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual { display: flex; justify-content: center; }

/* ---------- Profile card (avatar + radar) ---------- */
.profile-card {
  width: 100%;
  max-width: 320px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
}

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.avatar {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  overflow: hidden;
  background: var(--gradient);
  color: #06090f;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card-name { font-weight: 700; font-size: 0.95rem; }
.profile-card-role {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.radar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.radar-wrap canvas {
  width: 100%;
  max-width: 240px;
  height: auto;
  aspect-ratio: 1 / 1;
}

.radar-legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.radar-legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.radar-legend b {
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 700;
}

/* ===========================================================
   Secciones genéricas
   =========================================================== */
.section {
  position: relative;
  padding-block: 100px;
}

.section-alt { background: var(--bg-alt); }

.section-header { margin-bottom: 48px; max-width: 60ch; }
.section-header h2 { font-size: clamp(1.7rem, 3.2vw, 2.2rem); margin-bottom: 12px; }
.section-header p { color: var(--text-muted); font-size: 1rem; }

#stack, #perfil, #habilidades, #proyecto, #formacion, #contacto {
  scroll-margin-top: 90px;
}

/* ===========================================================
   Stack tecnológico
   =========================================================== */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 16px;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 12px;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.tech-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent-secondary);
}

.tech-icon { font-size: 1.7rem; }
.tech-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===========================================================
   Perfil profesional
   =========================================================== */
.profile-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
}

.profile-text h2 { font-size: clamp(1.7rem, 3.2vw, 2.2rem); margin-bottom: 20px; }
.profile-text p { color: var(--text-muted); margin-bottom: 16px; max-width: 60ch; }

.traits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-content: start;
}

.trait-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent-primary);
  border-radius: 14px;
  padding: 22px;
}
.trait-card h4 { font-size: 0.95rem; margin-bottom: 8px; }
.trait-card p { color: var(--text-muted); font-size: 0.88rem; }

.trait-primary { border-top-color: var(--accent-primary); }
.trait-secondary { border-top-color: var(--accent-secondary); }
.trait-alt { border-top-color: var(--accent-alt); }
.trait-warn { border-top-color: var(--accent-warn); }

/* ===========================================================
   Habilidades (filtro)
   =========================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 9px 18px;
  border-radius: 999px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.filter-btn:hover { border-color: var(--accent-secondary); color: var(--text); }
.filter-btn.is-active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #06090f;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.skill-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-secondary);
}

.skill-icon { font-size: 1.5rem; }
.skill-card h4 { font-size: 0.95rem; }
.skill-cat {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hidden { display: none; }

/* ===========================================================
   Proyecto destacado
   =========================================================== */
.projects-list {
  display: grid;
  gap: 28px;
}

.feature-project {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 44px;
}

.feature-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.feature-project-head { margin-bottom: 20px; }

.project-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--accent-primary-bright);
  background: rgba(79, 142, 247, 0.1);
  border: 1px solid rgba(79, 142, 247, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.feature-project-head h3 { font-size: 1.6rem; margin-bottom: 8px; }

.project-subtitle {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.feature-project-desc {
  color: var(--text-muted);
  max-width: 70ch;
  margin-bottom: 28px;
}

.role-box {
  background: var(--panel-2);
  border-left: 3px solid var(--accent-secondary);
  border-radius: 0 12px 12px 0;
  padding: 20px 24px;
  margin-bottom: 32px;
}
.role-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-secondary);
  margin-bottom: 10px;
}
.role-box p { color: var(--text); font-size: 0.95rem; }

.feature-project-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 36px;
}
.feature-project-stack h4 {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-alt);
  margin-bottom: 14px;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 6px;
}

/* ===========================================================
   Formación / Enfoque
   =========================================================== */
.formacion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.formacion-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}

.formacion-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 18px;
}

.formacion-card h4 { font-size: 1rem; margin-bottom: 10px; }
.formacion-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }

.formacion-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--accent-primary-bright);
}

/* ===========================================================
   Footer / Contacto
   =========================================================== */
.footer {
  position: relative;
  background: var(--panel-2);
  border-top: 1px solid var(--line);
  padding-block: 100px 48px;
  text-align: center;
}

.footer-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 16px;
}

.footer-text {
  color: var(--text-muted);
  max-width: 50ch;
  margin-inline: auto;
  margin-bottom: 36px;
}

.footer-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.footer-copy { color: var(--text-muted); font-size: 0.85rem; }

/* ===========================================================
   Revelado al hacer scroll
   =========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 860px) {
  .hero { padding-top: 116px; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-content { order: 2; }
  .hero-visual { order: 1; }
  .hero-actions { justify-content: center; }
  .hero-bio { margin-inline: auto; }

  .profile-grid { grid-template-columns: 1fr; gap: 40px; }
  .feature-project { padding: 32px 24px; }

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(9, 14, 26, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease);
    transform: none;
  }
  .nav-links.is-open { max-height: 280px; }
  .nav-links a { display: block; padding: 16px 24px; border-top: 1px solid var(--line); }

  .nav-toggle { display: flex; }
  .nav-actions .btn-sm { display: none; }
}

@media (max-width: 640px) {
  .section { padding-block: 72px; }
  .feature-project-stack { grid-template-columns: 1fr; gap: 24px; }
  .footer-actions .btn { width: 100%; }
  .footer { padding-block: 72px 40px; }
}

/* ===========================================================
   Movimiento reducido
   =========================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .pill-dot { animation: none; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
