:root {
  --navy:      #080d1a;
  --navy-2:    #0e1524;
  --navy-3:    #141d2e;
  --navy-4:    #1e2b42;
  --blue-mid:  #2563eb;
  --blue-sat:  #3b82f6;
  --blue-pale: #93c5fd;
  --text:      #e2e8f0;
  --text-muted:#94a3b8;
  --text-faint:#475569;
  --border:    rgba(255,255,255,0.06);
  --border-2:  rgba(255,255,255,0.11);
  --mono:      'JetBrains Mono', monospace;
  --display:   'Syne', sans-serif;
  --body:      'Lato', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--navy);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Noise texture overlay sutil */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.018;
  pointer-events: none;
  z-index: 9999;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 72px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* CARD BASE */
.card {
  background: var(--navy-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

/* CARD HERO */
.card-hero {
  overflow: visible;
  border-radius: 24px;
}

/* NAV */
nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  background: var(--navy-2);
  position: relative;
  z-index: 10;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--blue-pale);
  margin-right: auto;
  letter-spacing: 0.02em;
}

.nav-links { display: flex; list-style: none; gap: 2px; }

.nav-links a {
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover, .nav-links a.active {
  background: var(--navy-4);
  color: var(--text);
}

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

.nav-icons a {
  position: relative;
  color: var(--text-faint);
  font-size: 16px;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-icons a:hover { color: var(--blue-sat); }

.badge {
  position: absolute;
  top: -5px; right: -7px;
  background: var(--blue-mid);
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
  width: 14px; height: 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.nav-toggle { display: none; }

/* ==========================================
   HERO
   ========================================== */
section.hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  position: relative;
  min-height: 360px;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
  background: var(--navy-2);
}

/* Radial glow ambient en el lado derecho */
section.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 85% 50%, rgba(37,99,235,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.hero-left {
  padding: 56px 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue-pale);
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
  width: fit-content;
}

/* Dot verde pulsante — indica disponibilidad */
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #22c55e; }
  50% { opacity: 0.4; box-shadow: none; }
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(46px, 6.5vw, 70px);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 20px;
}

.hero-title span { color: var(--blue-sat); }

.hero-sub {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-muted);
  max-width: 380px;
  margin-bottom: 32px;
  line-height: 1.75;
}

.hero-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-block;
  background: var(--blue-mid);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 8px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn:hover {
  background: var(--blue-sat);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.35);
}

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover { border-color: var(--blue-sat); color: var(--blue-pale); }

/* HERO RIGHT */
.hero-right {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

/* Grid pattern con fade radial */
.hero-grid-bg {
  position: absolute;
  inset: -20px;
  background-image:
    linear-gradient(rgba(59,130,246,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 90% 100% at 60% 50%, black 10%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 100% at 60% 50%, black 10%, transparent 100%);
  z-index: 0;
  pointer-events: none;
}

/* Glow azul sutil detrás del runner */
.hero-right::before {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(59,130,246,0.16) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* Contenedor de imagen */
.img-placeholder {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* ✨ CLAVE: mix-blend-mode screen hace el negro transparente
   La imagen tiene fondo negro puro → queda invisible
   El trazo blanco del runner flota sobre el dark background */
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  mix-blend-mode: screen;
  filter: brightness(1.05) contrast(1.05);
  position: relative;
  z-index: 2;
}

/* Botón scroll-up circular */
.scroll-up {
  position: absolute;
  bottom: 20px; right: 16px;
  width: 34px; height: 34px;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
  z-index: 3;
}

.scroll-up:hover { color: var(--blue-pale); border-color: var(--blue-sat); }

/* ==========================================
   SKILLS
   ========================================== */
.skills-row { display: grid; grid-template-columns: repeat(3, 1fr); }

.skill-item {
  padding: 28px;
  border-right: 1px solid var(--border);
}

.skill-item:last-child { border-right: none; }

.skill-icon {
  font-size: 26px;
  color: var(--blue-sat);
  margin-bottom: 12px;
}

.skill-name {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.skill-desc {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.6;
}

/* TECH STRIP */
.tech-strip {
  border-top: 1px solid var(--border);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.tech-strip-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.tech-icons { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

.tech-icons i {
  font-size: 22px;
  color: var(--text-faint);
  transition: color 0.2s, transform 0.2s;
}

.tech-icons i:hover { color: var(--blue-pale); transform: translateY(-2px); }

/* SECTION LABEL */
.section-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 28px;
}

/* ==========================================
   EXPERIENCE
   ========================================== */
.exp-wrap {
  padding: 36px 36px 28px;
  border-bottom: 1px solid var(--border);
}

.exp-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.exp-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.exp-period {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  padding-top: 3px;
  white-space: nowrap;
}

.exp-role {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.exp-company {
  font-size: 13px;
  font-weight: 300;
  color: var(--blue-pale);
  margin-bottom: 10px;
}

.exp-desc {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 12px;
}

.exp-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--navy-4);
  color: var(--text-muted);
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid var(--border-2);
}

/* ==========================================
   PROJECTS
   ========================================== */
.projects-wrap {
  padding: 36px 36px 28px;
  border-bottom: 1px solid var(--border);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.proj-card {
  background: var(--navy-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.proj-card:hover {
  border-color: rgba(59,130,246,0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.proj-card-icon { font-size: 24px; color: var(--blue-sat); }

.proj-card-title {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.proj-card-desc {
  font-size: 12px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.proj-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.proj-card-tag {
  font-family: var(--mono);
  font-size: 9px;
  background: var(--navy-4);
  color: var(--text-faint);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.ai-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--blue-pale);
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.25);
  padding: 2px 7px;
  border-radius: 4px;
}

.proj-card-link {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--blue-sat);
  text-decoration: none;
  margin-top: 4px;
  transition: color 0.15s;
}

.proj-card-link:hover { color: var(--blue-pale); }

/* ==========================================
   CONTACT
   ========================================== */
.contact-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px;
  gap: 24px;
  background: var(--navy-3);
  border-bottom: 1px solid var(--border);
}

.contact-strip h3 {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.contact-strip p {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-muted);
}

.contact-actions { display: flex; gap: 10px; flex-shrink: 0; }

.btn-dark {
  display: inline-block;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  transition: border-color 0.15s, color 0.15s;
}

.btn-dark:hover { border-color: var(--blue-sat); color: var(--blue-pale); }

footer {
  display: flex;
  justify-content: space-between;
  padding: 18px 36px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}

/* ==========================================
   MOBILE
   ========================================== */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .nav-links { display: none; width: 100%; flex-direction: column; padding: 12px 0; border-top: 1px solid var(--border); margin-top: 8px; }
  .nav-links.open { display: flex; }
  section.hero { grid-template-columns: 1fr; }
  .hero-right { display: none; }
  .hero-left { padding: 36px 24px 32px; }
  .skills-row { grid-template-columns: 1fr; }
  .skill-item { border-right: none; border-bottom: 1px solid var(--border); }
  .skill-item:last-child { border-bottom: none; }
  .exp-item { grid-template-columns: 1fr; gap: 4px; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-strip { flex-direction: column; align-items: flex-start; padding: 28px 24px; }
  .exp-wrap, .projects-wrap { padding: 28px 20px; }
  footer { padding: 16px 20px; flex-direction: column; gap: 4px; text-align: center; }
}