/* ==========================================
   1. VARIABLES Y CONFIGURACIÓN GENERAL (TEMA CLARO)
   ========================================== */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7fa;
  --ink: #15171c;
  --muted: #6b7280;
  --line: #e4e6ec;
  --accent: #4f46e5; /* Azul Índigo */
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Space Grotesk', sans-serif;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

section {
  padding: 88px 0;
  scroll-margin-top: 76px;
}

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

/* ==========================================
   2. NAVEGACIÓN (NAVBAR)
   ========================================== */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, box-shadow .3s ease;
}

nav.scrolled {
  border-color: var(--line);
  box-shadow: 0 2px 18px rgba(20, 20, 30, .04);
}

nav.scrolled .wrap {
  padding-top: 12px;
  padding-bottom: 12px;
}

nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
  transition: padding 0.3s ease;
}

.logo {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.navlinks {
  display: flex;
  gap: 30px;
  font-size: 14px;
  color: var(--muted);
}

.navlinks a {
  transition: color 0.2s ease;
}

.navlinks a:hover, .navlinks a.active {
  color: var(--ink);
}

.navcta {
  background: var(--accent);
  color: #fff;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.navcta:hover {
  background: #4338ca;
}

.navtoggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

/* ==========================================
   3. HERO & SIGNAL PATH
   ========================================== */
.hero {
  padding-top: 100px;
  padding-bottom: 70px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 100px;
  margin-bottom: 26px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(38px, 5.6vw, 64px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.04;
  max-width: 820px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero .lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 560px;
  margin-top: 22px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  margin-top: 34px;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  transition: background .2s;
  cursor: pointer;
  border: none;
}

.btn-primary:hover {
  background: var(--accent);
}

.btn-ghost {
  border: 1.5px solid var(--line);
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  transition: border-color .2s, background .2s;
  cursor: pointer;
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Conector SVG Signal Path */
.signal {
  margin-top: 64px;
  position: relative;
}

.signal svg {
  width: 100%;
  height: auto;
  display: block;
}

.signal-path {
  stroke-dasharray: 6 8;
  stroke: var(--line);
}

.signal-pulse {
  stroke-dasharray: 16 400;
  stroke: var(--accent);
  animation: pulse 3.2s linear infinite;
}

@keyframes pulse {
  to {
    stroke-dashoffset: -420;
  }
}

.node-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  fill: var(--muted);
}

.node-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 600;
  fill: var(--ink);
}

/* ==========================================
   4. ANIMACIONES REVEAL (SCROLL)
   ========================================== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s ease;
}

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

/* ==========================================
   5. CABECERAS DE SECCIÓN
   ========================================== */
.kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: .02em;
  margin-bottom: 12px;
}

.sec-title {
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 600px;
}

.sec-sub {
  color: var(--muted);
  margin-top: 12px;
  max-width: 520px;
  font-size: 15.5px;
}

/* ==========================================
   6. PERFILES DETALLADOS (TABS)
   ========================================== */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-alt);
  padding: 5px;
  border-radius: 11px;
  width: fit-content;
  margin-top: 34px;
}

.tab-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(20, 20, 30, .08);
}

.tab-panel {
  display: none;
  margin-top: 36px;
}

.tab-panel.active {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 36px;
  align-items: start;
  animation: fadeIn 0.4s ease forwards;
}

.avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 38px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--line);
}

.profile-name {
  font-size: 24px;
  font-weight: 600;
}

.profile-role {
  color: var(--accent);
  font-weight: 500;
  font-size: 14px;
  margin: 6px 0 14px;
}

.profile-bio {
  color: var(--muted);
  font-size: 15px;
  max-width: 520px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 6px 11px;
  border-radius: 100px;
  color: var(--ink);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   7. STACK & SERVICIOS (LADO A LADO)
   ========================================== */
.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  margin-top: 44px;
}

.stack-cat {
  margin-bottom: 26px;
}

.stack-cat h4 {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 14px;
  background: var(--bg);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.05);
}

.service-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.service-card p {
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================
   8. PROYECTOS (FILTRABLES)
   ========================================== */
.proj-filters {
  display: flex;
  gap: 10px;
  margin: 34px 0 30px;
  flex-wrap: wrap;
}

.pill {
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  background: #ffffff;
  transition: all 0.2s ease;
}

.pill.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

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

.proj-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  transition: opacity .25s ease, transform .25s ease, border-color .2s, box-shadow .2s;
  opacity: 1;
  transform: scale(1);
}

.proj-card.hidden {
  display: none;
}

.proj-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(20, 20, 30, 0.04);
}

.proj-thumb {
  height: 140px;
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-alt));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.proj-body {
  padding: 18px;
}

.proj-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

.proj-body h4 {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.proj-body p {
  font-size: 13.5px;
  color: var(--muted);
}

/* ==========================================
   9. CONTACTO Y FORMULARIO
   ========================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 38px;
}

.contact-item {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
  align-items: center;
}

.contact-item .ic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.contact-item h5 {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.contact-item p {
  font-size: 14.5px;
  font-weight: 500;
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

form div {
  width: 100%;
}

label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14.5px;
  background: #ffffff;
  transition: border-color .2s ease, outline-color .2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.btn-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 9px;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s ease, transform 0.1s ease;
  width: 100%;
}

.btn-submit:hover {
  background: #4338ca;
}

.btn-submit:active {
  transform: scale(0.99);
}

/* ==========================================
   10. FOOTER
   ========================================== */
footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================
   11. MEDIA QUERIES (DISEÑO MÓVIL)
   ========================================== */
@media (max-width: 820px) {
  .navlinks, .hero-cta .btn-ghost {
    display: none;
  }
  .navtoggle {
    display: block;
  }
  .split-2, .contact-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .proj-grid {
    grid-template-columns: 1fr;
  }
  .tab-panel.active {
    grid-template-columns: 1fr;
  }
  .avatar {
    width: 90px;
  }
  section {
    padding: 64px 0;
  }
}
