/* ==========================================================================
   PORTAFOLIO CIENTÍFICO-TECNOLÓGICO INTERDISCIPLINARIO — ALEJANDRO DÍAZ
   Ingeniería Química Sustentable · Maestría en Ciencias Aplicadas (UG)
   CIENCIA → TECNOLOGÍA → INGENIERÍA → IMPACTO
   Optimizado para Desktop, Laptops, Tablets (iPad/Android) y Smartphones
   ========================================================================== */

/* --- Variables de Diseño: Estética de Laboratorio, Ingeniería y Cómputo --- */
:root {
  /* Fondos y Superficies */
  --bg-dark: #070b12;
  --bg-darker: #04060a;
  --bg-surface: #0e1626;
  --bg-card: rgba(15, 23, 42, 0.78);
  --bg-card-hover: rgba(24, 35, 58, 0.9);
  --bg-glass: rgba(13, 20, 36, 0.75);

  /* Bordes y Separadores */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(56, 189, 248, 0.42);
  --border-glow: 0 0 22px rgba(56, 189, 248, 0.16);

  /* Acentos Científico-Tecnológicos */
  --accent-cyan: #38bdf8;        /* Ciencia / Instrumentación / NeoPixel */
  --accent-blue: #6366f1;        /* IA / Computación */
  --accent-emerald: #10b981;     /* Ingeniería / Sustentabilidad / Demostrado */
  --accent-amber: #f59e0b;       /* En Desarrollo / Potencial / Innovación */
  --accent-coral: #f43f5e;       /* Error / Alerta experimental */

  /* Tipografía */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* Sombras */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 26px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 42px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 28px rgba(56, 189, 248, 0.2);

  /* Transiciones */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container-width: 1220px;
  --header-height: 72px;
}

/* --- Reseteo y Control Estricto de Desbordamiento (Mobile-Safe) --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Evitar que elementos hijos de CSS Grid o Flexbox desborden en pantallas pequeñas */
.hero-grid > *,
.about-grid > *,
.axes-grid > *,
.experience-grid > *,
.exp-wide-columns > *,
.research-projects-grid > *,
.ai-grid > *,
.tech-dual-grid > *,
.philosophy-grid > *,
.innovation-grid > *,
.collab-model-grid > *,
.arc-showcase-grid > *,
.lab-subgrid > *,
.contact-wrapper > *,
.stats-grid > * {
  min-width: 0;
  max-width: 100%;
}

::selection {
  background: rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* --- Fondo Canvas --- */
.background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.85;
}

/* --- Contenedor --- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* --- Utilidades --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  word-break: break-word;
}

.font-mono { font-family: var(--font-mono); }
.text-white { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.885rem; }
.text-xs { font-size: 0.785rem; }
.leading-relaxed { line-height: 1.75; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.65rem; }
.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.flex-gap-sm { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }

.gradient-text {
  background: linear-gradient(135deg, #ffffff 10%, var(--accent-cyan) 55%, var(--accent-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.card-glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-accent { color: var(--accent-cyan); }

/* ==================== 26. SISTEMA DE ESTADOS (CLASIFICACIÓN DE RIGOR) ==================== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.24rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  line-height: 1.3;
  max-width: 100%;
}

.status-green {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-yellow {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-blue {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.status-dark {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-green {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-legend-bar {
  margin-top: 1.5rem;
  padding: 0.95rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.legend-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}


/* ==================== HEADER & NAVEGACIÓN ==================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(7, 11, 18, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.header.scrolled {
  background: rgba(7, 11, 18, 0.96);
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.55);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}

.brand-symbol {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-cyan);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(16, 185, 129, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 10px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.brand-logo:hover .brand-symbol {
  transform: scale(1.05);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.brand-info { display: flex; flex-direction: column; }
.brand-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.brand-sub { font-size: 0.68rem; font-weight: 600; color: var(--accent-cyan); letter-spacing: 0.04em; text-transform: uppercase; }

.nav-desktop { display: block; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  list-style: none;
}

.nav-link {
  position: relative;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.35rem 0;
  display: inline-block;
  transition: color var(--transition-normal);
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  border-radius: 2px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover { color: var(--text-primary); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--accent-cyan); font-weight: 600; }
.nav-link.active::after { width: 100%; background: var(--accent-cyan); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: 9px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  padding: 9px;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.menu-toggle:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.open .bar-top { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open .bar-mid { opacity: 0; }
.menu-toggle.open .bar-bot { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  max-height: calc(100dvh - var(--header-height));
  overflow-y: auto;
  background: rgba(8, 13, 23, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-card);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.7);
  padding: 1.15rem 1.25rem 1.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
  z-index: 999;
}

.nav-mobile.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-nav-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.mobile-nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover, .mobile-nav-link:active {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}


/* ==================== BOTONES (CON SOPORTE MULTILÍNEA EN MÓVIL) ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.75rem 1.35rem;
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
  text-align: center;
  line-height: 1.35;
  white-space: normal;
  max-width: 100%;
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.42rem 0.85rem;
  min-height: 36px;
  border-radius: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-emerald));
  color: #041019;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.45);
  color: #02080d;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: var(--border-card);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px dashed var(--border-card);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.btn-outline-glow {
  background: rgba(56, 189, 248, 0.08);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.35);
}

.btn-outline-glow:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
}


/* ==================== SECCIÓN HERO ==================== */
.section {
  padding: 5.25rem 0;
  position: relative;
}

.hero-section {
  padding-top: calc(var(--header-height) + 2rem);
  padding-bottom: 3.75rem;
}

/* Cadena de Valor: CIENCIA → TECNOLOGÍA → INGENIERÍA → IMPACTO */
.value-chain-bar {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
  padding: 0.5rem 1.05rem;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  max-width: 100%;
}

.chain-step {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  color: var(--text-primary);
}

.chain-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-cyan { background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); }
.dot-blue { background: var(--accent-blue); box-shadow: 0 0 8px var(--accent-blue); }
.dot-emerald { background: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }
.dot-amber { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }

.chain-arrow { color: var(--text-muted); font-weight: 400; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 2.5rem;
  align-items: start;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #34d399;
  margin-bottom: 1rem;
  line-height: 1.35;
  max-width: 100%;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: clamp(2.15rem, 4.2vw, 3.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.65rem;
}

.hero-degree {
  display: block;
  font-size: clamp(1.05rem, 1.85vw, 1.4rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0.35rem;
  line-height: 1.35;
}

.hero-specialization {
  font-size: 0.86rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 1.2rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent-cyan);
  line-height: 1.5;
}

.hero-description {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.hero-social-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.social-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.social-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  min-height: 38px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  word-break: break-all;
}

.social-pill-link:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

/* Columna Derecha Hero: Marco de Fotografía + Terminal Easter Egg */
.hero-visual-column {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* 24. Marco de Fotografía Profesional */
.profile-showcase {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1.15rem 1.35rem;
}

.profile-avatar-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(16, 185, 129, 0.18));
  border: 2px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.25);
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 2;
}

.profile-avatar-wrapper.has-image .profile-avatar-fallback {
  display: none;
}

.profile-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-initials {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.profile-showcase-name {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-showcase-role {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 500;
  margin-top: 0.1rem;
}

.profile-showcase-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.mini-tag {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
}

/* Terminal Easter Egg */
.terminal-window {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: #080d16;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  max-width: 100%;
}

.terminal-header {
  background: #0f172a;
  padding: 0.65rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dots { display: flex; gap: 6px; flex-shrink: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-action-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.28rem 0.65rem;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.terminal-action-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-cyan);
}

.terminal-body {
  padding: 1rem 1.1rem;
  font-size: 0.8rem;
  line-height: 1.58;
  min-height: 165px;
  overflow-x: auto;
}

.code-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.code-comment { color: #64748b; font-style: italic; }
.code-keyword { color: #38bdf8; font-weight: 700; }
.code-var { color: #e2e8f0; }
.code-func { color: #a855f7; font-weight: 600; }
.code-num { color: #fb923c; }
.code-error { color: #fb7185; font-weight: 600; }
.output-line { margin-top: 0.45rem; padding-top: 0.45rem; border-top: 1px dashed rgba(255, 255, 255, 0.08); }
.code-success { color: #34d399; font-weight: 600; }
.code-val { color: #e2e8f0; }

.terminal-footer-note {
  padding: 0.55rem 0.95rem;
  background: rgba(15, 23, 42, 0.65);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Métricas Defendibles */
.hero-stats-container { margin-top: 2.5rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1.4rem;
}

.stat-card {
  text-align: center;
  position: relative;
  padding: 0.35rem 0.5rem;
}

.stat-card:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -0.6rem;
  top: 15%;
  height: 70%;
  width: 1px;
  background: var(--border-subtle);
}

.stat-number {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 2.5vw, 2.05rem);
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.stat-label {
  display: block;
  font-size: 0.84rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

.stat-note {
  display: block;
  font-size: 0.71rem;
  color: var(--text-muted);
  margin-top: 0.22rem;
  line-height: 1.35;
}


/* ==================== ENCABEZADOS DE SECCIÓN ==================== */
.section-header { margin-bottom: 2.75rem; }

.section-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.45rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-divider {
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  border-radius: 3px;
  margin: 0.85rem auto;
}

.section-subtitle {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.subsection-heading {
  font-size: 1.28rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.35rem;
  color: var(--text-primary);
}

.heading-accent-bar {
  width: 6px;
  height: 24px;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-emerald));
  border-radius: 3px;
  flex-shrink: 0;
}


/* ==================== 5. SECCIÓN SOBRE MÍ & 4 EJES ==================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.75rem;
}

.card-heading {
  font-size: 1.16rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  color: var(--text-primary);
  line-height: 1.35;
}

.about-bio-card { padding: 1.85rem; }

.subheading-small {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.tag-pill {
  font-size: 0.79rem;
  padding: 0.34rem 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.tag-pill:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
}

.axes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.axis-card {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
}

.axis-icon {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 800;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
}

.axis-cyan { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); border: 1px solid rgba(56, 189, 248, 0.3); }
.axis-blue { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.axis-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.axis-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

.axis-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}


/* ==================== 6. FORMACIÓN, CONEXIONES, DIVULGACIÓN Y CERTIFICACIONES ==================== */
.timeline-card, .connections-card, .outreach-card, .certs-card {
  padding: 1.75rem;
}

.card-header-with-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

/* 25. Slots para Logos de Instituciones y Empresas */
.org-logo-slot {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.org-logo-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.org-logo-slot.has-logo .org-logo-fallback {
  display: none;
}

.org-logo-fallback {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.timeline {
  position: relative;
  padding-left: 1.35rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(56, 189, 248, 0.25);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.55rem;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -1.35rem;
  top: 5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.timeline-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.timeline-title {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.2rem;
}

.timeline-institution {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.course-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.course-pill {
  font-size: 0.73rem;
  padding: 0.2rem 0.52rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 5px;
  color: var(--text-secondary);
}

/* Conexiones Académicas */
.connections-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.connection-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.connection-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.connection-name { font-size: 0.95rem; font-weight: 700; }
.connection-role { font-size: 0.81rem; color: var(--text-secondary); margin-top: 0.1rem; line-height: 1.4; }
.connection-affil { font-size: 0.73rem; color: var(--text-muted); display: block; margin-top: 0.12rem; }

/* Divulgación */
.outreach-item {
  padding: 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.outreach-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.outreach-title { font-size: 0.96rem; font-weight: 700; }

/* Certificaciones */
.certs-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.cert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  margin-top: 0.42rem;
  flex-shrink: 0;
}

.cert-name { display: block; font-size: 0.89rem; color: var(--text-primary); }
.cert-org { display: block; font-size: 0.77rem; color: var(--text-muted); }


/* ==================== 7. EXPERIENCIA PROFESIONAL E INDUSTRIAL ==================== */
.experience-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem;
}

.exp-card {
  padding: 1.75rem;
}

.exp-card-wide {
  grid-column: span 2;
}

.exp-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.exp-title-group {
  flex: 1;
  min-width: 0;
}

.exp-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.exp-modality-badge, .exp-role-badge {
  font-size: 0.71rem;
  font-weight: 600;
  padding: 0.2rem 0.58rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  line-height: 1.3;
}

.exp-company { font-size: 1.24rem; font-weight: 800; color: var(--text-primary); }
.exp-period { font-size: 0.79rem; color: var(--accent-cyan); display: block; margin-top: 0.15rem; }

.exp-list {
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.89rem;
  color: var(--text-secondary);
}

.exp-list-horizontal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.65rem 1.4rem;
}

.exp-wide-columns {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
}

.nom-badges, .field-locations {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nom-badge {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 600;
  padding: 0.24rem 0.55rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 5px;
  color: var(--accent-cyan);
}

.location-chip {
  font-size: 0.75rem;
  padding: 0.22rem 0.58rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
  color: #34d399;
}


/* ==================== 8 & 17. INVESTIGACIÓN Y SPONSORSHIP ==================== */
.research-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.65rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.potential-badge, .commercial-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.22rem 0.62rem;
  border-radius: 9999px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.38);
  color: #c084fc;
}

.project-kicker {
  display: block;
  font-size: 0.73rem;
  color: var(--accent-cyan);
  margin-bottom: 0.35rem;
}

.project-card-body { flex-grow: 1; }

.project-title {
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: var(--text-primary);
}

.project-abstract {
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 1.15rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  padding: 0.2rem 0.52rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
}

.project-card-footer {
  margin-top: 1.15rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-subtle);
}

/* Sponsorship Banner */
.sponsorship-banner {
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  border-color: rgba(56, 189, 248, 0.32);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(8, 47, 73, 0.38));
}

.sponsorship-title {
  font-size: clamp(1.2rem, 2.2vw, 1.4rem);
  font-weight: 800;
}

.sponsorship-cta { flex-shrink: 0; }


/* ==================== 9, 10, 11. AI, PROGRAMACIÓN E INSTRUMENTACIÓN ==================== */
.ai-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.35rem;
}

.ai-card {
  padding: 1.55rem;
}

.ai-card-span2 {
  grid-column: span 2;
}

.ai-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.ai-icon {
  font-size: 1.45rem;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.tech-dual-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.65rem;
}

.tech-stack-card {
  padding: 1.75rem;
}

.stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.stack-pill {
  font-size: 0.8rem;
  padding: 0.38rem 0.72rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
}

.stack-pill strong { color: var(--accent-cyan); }

.hardware-items-grid {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.hw-item {
  padding: 0.75rem 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.hw-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}


/* ==================== 12. SCIENTIFIC PHILOSOPHY ==================== */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.15rem;
}

.pillar-card {
  padding: 1.5rem 1.25rem;
  border-radius: 14px;
}

.pillar-number {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.6rem;
  display: inline-block;
  padding: 0.18rem 0.52rem;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 6px;
}

.pillar-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pillar-text {
  font-size: 0.85rem;
  line-height: 1.6;
}


/* ==================== 18 & 19. STUDENT INNOVATION & COLABORACIÓN ==================== */
.innovation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.45rem;
}

.collab-model-card {
  padding: 1.85rem;
}

.collab-model-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 1.75rem;
  align-items: center;
}

.collab-profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.profile-chip {
  font-size: 0.79rem;
  padding: 0.34rem 0.72rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  color: var(--text-primary);
}

.collab-cta-box {
  padding: 1.4rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  text-align: center;
}

.collab-cta-tag {
  font-size: 0.72rem;
  color: var(--accent-emerald);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.4rem;
}


/* ==================== 20. PERSONAL LAB & DUAL ARC REACTORS ==================== */
.arc-reactors-dual-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
  align-items: stretch;
}

.arc-reactor-card {
  display: flex;
  flex-direction: column;
  padding: 1.85rem;
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(10, 16, 28, 0.78);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.arc-reactor-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 28px rgba(56, 189, 248, 0.22);
}

.arc-card-header {
  margin-bottom: 0.25rem;
}

.arc-card-title {
  font-size: clamp(1.18rem, 1.8vw, 1.35rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.arc-card-subtitle {
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  margin-top: 0.35rem;
}

.arc-card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.arc-visual-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.6rem 1rem 1.25rem;
  margin: 1.25rem 0;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.12) 0%, rgba(6, 11, 22, 0.92) 75%);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  overflow: hidden;
}

.arc-visual-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  opacity: 0.6;
}

/* --- REACTOR CIRCULAR (MARK I / II) --- */
.neopixel-ring-visual {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.22), inset 0 0 25px rgba(56, 189, 248, 0.18);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
}

.neopixel-ring-visual:hover {
  transform: scale(1.03);
  box-shadow: 0 0 45px rgba(56, 189, 248, 0.45), inset 0 0 30px rgba(56, 189, 248, 0.35);
}

/* Capa de 10 bobinas de cobre del Mark I */
.arc-coils-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.arc-coil {
  position: absolute;
  width: 10px;
  height: 20px;
  background: linear-gradient(90deg, #b45309 0%, #d97706 40%, #fef3c7 50%, #d97706 60%, #92400e 100%);
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(217, 119, 6, 0.4);
  transform-origin: center 100px;
  left: 95px;
  top: 2px;
}

.neopixel-led {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8, 0 0 16px #38bdf8;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.circular-core {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 30, 54, 0.95) 0%, rgba(6, 11, 20, 0.98) 80%);
  border: 2px solid rgba(56, 189, 248, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35), inset 0 0 15px rgba(56, 189, 248, 0.25);
  z-index: 2;
}

.core-tag {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--accent-amber);
  margin-bottom: 2px;
}

.core-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1.1;
}

.core-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* --- REACTOR TRIANGULAR (MARK IV / VI - IRON MAN 2 PROP) --- */
.triangular-reactor-visual {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 0 35px rgba(2, 132, 199, 0.35), inset 0 0 25px rgba(2, 132, 199, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
  background: #020617;
  overflow: hidden;
}

.triangular-reactor-visual:hover {
  transform: scale(1.03);
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.55), inset 0 0 35px rgba(56, 189, 248, 0.4);
}

.triangular-reactor-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Transiciones suaves en las cámaras ópticas y LEDs */
#tri-outer-windows-glow,
#tri-channel-glow,
#tri-core-glow,
.tri-led-pt {
  transition: opacity 0.25s ease, filter 0.25s ease, transform 0.25s ease;
}

/* Modos de iluminación */
.tri-layer-off {
  opacity: 0.08 !important;
  filter: none !important;
}

.tri-layer-on {
  opacity: 1 !important;
}

.tri-layer-dim {
  opacity: 0.28 !important;
}

/* Display de modo activo e indicador */
.arc-mode-display {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem;
  margin-top: 1.1rem;
  font-size: 0.73rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  color: var(--text-secondary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.arc-mode-display .indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.arc-visual-caption {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.45;
  max-width: 92%;
  z-index: 2;
}

.proto-pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.proto-step {
  padding: 0.24rem 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
}

.proto-step-active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-weight: 700;
}

.proto-sep { color: var(--accent-cyan); }

.arc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: auto;
  padding-top: 1rem;
}

.arc-actions .btn {
  flex-grow: 1;
}

.lab-subgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}


/* ==================== 23. SECCIÓN CV ==================== */
.cv-highlight-section {
  padding: 2.25rem 0;
}

.cv-banner {
  padding: 1.85rem 2.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
}

.cv-banner-title { font-size: clamp(1.22rem, 2.2vw, 1.45rem); font-weight: 800; }
.cv-banner-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; flex-shrink: 0; }


/* ==================== 22. CONTACTO ==================== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 1.75rem;
}

.contact-info-card, .contact-form-card { padding: 1.85rem; }

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.contact-method-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.method-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 8px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.method-icon svg { width: 19px; height: 19px; }
.method-details { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.method-label { font-size: 0.71rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.method-val { font-size: 0.9rem; color: var(--text-primary); font-weight: 500; word-break: break-word; }
.method-val:hover { color: var(--accent-cyan); }

.btn-copy-email {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-copy-email:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-label { font-size: 0.84rem; font-weight: 600; color: var(--text-secondary); }

.form-input, .form-textarea {
  width: 100%;
  background: rgba(8, 11, 18, 0.68);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 0.72rem 0.95rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem; /* 16px evita auto-zoom molesto en iOS Safari al enfocar inputs */
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.form-feedback {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
}

.form-feedback.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}


/* ==================== 32. FOOTER ==================== */
.main-footer {
  background: var(--bg-darker);
  border-top: 1px solid var(--border-subtle);
  padding: 2.75rem 0 2.25rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.footer-role { color: var(--accent-cyan); font-weight: 500; font-size: 0.84rem; }

.footer-center {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-mail-link {
  font-size: 0.84rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.footer-mail-link:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.footer-social-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.footer-social-btn svg { width: 17px; height: 17px; }
.footer-social-btn:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); }

.webdev-invite-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border: 1px dashed var(--border-card);
  border-radius: 8px;
  display: inline-block;
  transition: all var(--transition-fast);
}

.webdev-invite-link strong { color: var(--accent-cyan); }
.webdev-invite-link:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}


/* ==================== BOTÓN VOLVER ARRIBA & TOAST ==================== */
.btn-back-to-top {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.btn-back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.btn-back-to-top:hover {
  background: var(--accent-cyan);
  color: #04060a;
}

.btn-back-to-top svg { width: 20px; height: 20px; }

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: calc(100% - 2rem);
  max-width: 420px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--accent-cyan);
  color: var(--text-primary);
  padding: 0.75rem 1.15rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1100;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}


/* ==================== ANIMACIONES AL SCROLL ==================== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 { transition-delay: 80ms; }
.delay-200 { transition-delay: 160ms; }
.delay-300 { transition-delay: 240ms; }
.delay-400 { transition-delay: 320ms; }


/* ==========================================================================
   29. RESPONSIVE DESIGN — TABLETS (iPad / Android) & SMARTPHONES
   ========================================================================== */

/* --- 1. TABLETS LANDSCAPE & LAPTOPS COMPACTAS (<= 1140px) ---
   Activamos el menú desplegable táctil para evitar que los 9 enlaces choquen en tablets */
@media (max-width: 1140px) {
  .nav-desktop { display: none; }
  .menu-toggle { display: flex; }

  .philosophy-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Los últimos 2 pilares de Filosofía se distribuyen simétricamente */
  .philosophy-grid .pillar-card:nth-child(4),
  .philosophy-grid .pillar-card:nth-child(5) {
    grid-column: span 1;
  }

  .lab-subgrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- 2. TABLETS PORTRAIT (iPad Mini / Air / Pro Portrait: <= 960px) --- */
@media (max-width: 960px) {
  .section {
    padding: 4.25rem 0;
  }

  .hero-grid,
  .about-grid,
  .exp-wide-columns,
  .tech-dual-grid,
  .collab-model-grid,
  .arc-showcase-grid,
  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* En tablet, las tarjetas de experiencia e investigación se ven mejor a 2 columnas o 1 amplia */
  .experience-grid,
  .research-projects-grid {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  .exp-card-wide {
    grid-column: span 1;
  }

  /* Grids de 3 pasan a 2 columnas en tablet, y el 3er elemento ocupa el ancho completo para no quedar huérfano */
  .ai-grid,
  .innovation-grid,
  .philosophy-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.15rem;
  }

  .ai-card-span2,
  .innovation-grid > article:last-child,
  .philosophy-grid > .pillar-card:last-child {
    grid-column: 1 / -1;
  }

  .sponsorship-banner,
  .cv-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    gap: 1.25rem;
  }

  .sponsorship-cta .btn,
  .cv-banner-actions .btn {
    width: 100%;
  }

  /* Métricas en cuadrícula 2x2 limpia en tablets */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.25rem;
  }

  .stat-card::after {
    display: none !important;
  }

  .stat-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0.85rem 0.65rem;
  }

  .status-legend-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- 3. SMARTPHONES (iPhone, Samsung Galaxy, Xiaomi, Pixel: <= 640px) --- */
@media (max-width: 640px) {
  :root {
    --header-height: 62px;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .section {
    padding: 3.25rem 0;
  }

  .hero-section {
    padding-top: calc(var(--header-height) + 1.15rem);
    padding-bottom: 2.75rem;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  /* Menú móvil a 1 columna amplia para pulgar */
  .mobile-nav-list {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  /* Barra CIENCIA -> TECNOLOGÍA -> INGENIERÍA -> IMPACTO compacta y centrada */
  .value-chain-bar {
    width: 100%;
    justify-content: center;
    padding: 0.55rem 0.75rem;
    font-size: 0.68rem;
    gap: 0.35rem 0.45rem;
    margin-bottom: 1.15rem;
  }

  .badge-tag {
    font-size: 0.74rem;
    padding: 0.35rem 0.75rem;
    width: 100%;
    justify-content: flex-start;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-degree {
    font-size: 1.02rem;
  }

  .hero-specialization {
    font-size: 0.78rem;
    padding-left: 0.6rem;
  }

  .hero-description {
    font-size: 0.94rem;
    margin-bottom: 1.35rem;
  }

  /* Botones CTA en móvil a ancho completo */
  .hero-cta-group {
    flex-direction: column;
    gap: 0.65rem;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  .hero-social-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .social-pill-link {
    justify-content: center;
    width: 100%;
  }

  /* Tarjeta de Perfil compacta en móvil */
  .profile-showcase {
    flex-direction: column;
    text-align: center;
    padding: 1.15rem 1rem;
    gap: 0.85rem;
  }

  .profile-showcase-badges {
    justify-content: center;
  }

  /* Ventana de código optimizada para pantalla de teléfono */
  .terminal-header {
    padding: 0.55rem 0.75rem;
  }

  .terminal-title {
    font-size: 0.7rem;
  }

  .terminal-action-btn {
    font-size: 0.66rem;
    padding: 0.22rem 0.5rem;
  }

  .terminal-body {
    padding: 0.85rem;
    font-size: 0.74rem;
    min-height: 150px;
  }

  /* Métricas en cuadrícula 2x2 en el teléfono (compacta, visual y sin hacer eterno el scroll) */
  .hero-stats-container {
    margin-top: 1.75rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    padding: 0.85rem;
  }

  .stat-card {
    padding: 0.7rem 0.45rem;
  }

  .stat-number {
    font-size: 1.45rem;
  }

  .stat-label {
    font-size: 0.76rem;
  }

  .stat-note {
    font-size: 0.65rem;
  }

  /* Leyenda de estados compacta */
  .status-legend-bar {
    padding: 0.85rem 1rem;
    gap: 0.6rem;
  }

  .legend-items {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 0.4rem;
  }

  .legend-items .status-pill {
    width: 100%;
    justify-content: flex-start;
  }

  /* Reducción de paddings internos de todas las tarjetas para ganar espacio de lectura en móvil */
  .about-bio-card,
  .timeline-card,
  .connections-card,
  .outreach-card,
  .certs-card,
  .exp-card,
  .project-card,
  .sponsorship-banner,
  .ai-card,
  .tech-stack-card,
  .pillar-card,
  .collab-model-card,
  .arc-reactor-card,
  .cv-banner,
  .contact-info-card,
  .contact-form-card {
    padding: 1.25rem 1.1rem;
  }

  /* Grids internos a 1 columna en smartphone */
  .arc-reactors-dual-grid,
  .axes-grid,
  .ai-grid,
  .philosophy-grid,
  .innovation-grid,
  .lab-subgrid,
  .exp-list-horizontal {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Encabezados de experiencia con logo alineado sin comprimir los badges */
  .exp-card-top {
    flex-direction: row;
    align-items: flex-start;
  }

  .org-logo-slot {
    width: 38px;
    height: 38px;
  }

  .exp-company {
    font-size: 1.12rem;
  }

  /* ARC Reactor en móvil */
  .arc-visual-box {
    padding: 1.1rem 0.75rem;
  }

  .neopixel-ring-visual,
  .triangular-reactor-visual {
    transform: scale(0.9);
  }

  .proto-pipeline {
    justify-content: center;
  }

  .arc-actions {
    flex-direction: column;
  }

  .arc-actions .btn {
    width: 100%;
  }

  .cv-banner-actions {
    flex-direction: column;
    width: 100%;
  }

  .cv-banner-actions .btn {
    width: 100%;
  }

  /* Contacto en móvil */
  .contact-method-item {
    padding: 0.85rem;
    gap: 0.7rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-brand {
    justify-content: center;
  }

  .footer-center {
    justify-content: center;
  }

  .webdev-invite-link {
    width: 100%;
    text-align: center;
  }
}

/* --- 4. PANTALLAS MUY PEQUEÑAS (<= 360px) --- */
@media (max-width: 360px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .brand-sub {
    display: none;
  }

  .neopixel-ring-visual,
  .triangular-reactor-visual {
    transform: scale(0.82);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   MODO SPA: NAVEGACIÓN POR SECCIONES INDIVIDUALES (VIEW SWITCHER)
   Muestra únicamente Inicio al entrar y cambia de vista al hacer clic en el menú
   ========================================================================== */
body.spa-mode {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.spa-mode #main-content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

body.spa-mode #main-content > .section {
  display: none !important;
}

body.spa-mode #main-content > .section.spa-active {
  display: block !important;
  padding-top: calc(var(--header-height) + 2.75rem);
  padding-bottom: 3.5rem;
  animation: spaSectionEnter 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.spa-mode #main-content > .hero-section.spa-active {
  display: flex !important;
  padding-top: calc(var(--header-height) + 2rem);
}

/* Cuando Filosofía Científica acompaña a Sobre mí, reducimos su padding superior */
body.spa-mode #main-content > #about.spa-active + #philosophy.spa-active,
body.spa-mode #main-content > #philosophy.spa-active.spa-subview {
  padding-top: 1.5rem;
}

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

/* Barra inferior de cambio rápido entre secciones (Opcional / Complemento UX) */
.spa-pager-container {
  margin-top: auto;
  padding: 0 0 3rem;
}

.spa-pager-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
}

.spa-pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.spa-pager-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  transform: translateY(-2px);
}

.spa-pager-btn.spa-pager-next {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
}

.spa-pager-indicator {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.mobile-nav-link.active {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.45);
  font-weight: 600;
}

@media (max-width: 640px) {
  body.spa-mode #main-content > .section.spa-active {
    padding-top: calc(var(--header-height) + 1.35rem);
    padding-bottom: 2.25rem;
  }

  .spa-pager-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.9rem;
    gap: 0.65rem;
  }

  .spa-pager-btn {
    width: 100%;
    justify-content: center;
  }
}

