/* ============================================================
   DR. EDGAR HERNÁNDEZ ZAVALA — Sitio Académico
   Rediseño visual: editorial moderno, profundidad y elegancia
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,800&family=Inter:wght@400;500;600;700&display=swap');

/* ─── Design Tokens ──────────────────────────────────────── */
:root {
  /* Color — paleta profunda */
  --navy-deep: #060d1c;
  --navy-rich: #0d1b3a;
  --navy: #1e3a5f;
  --navy-light: #2a4f7c;
  --slate: #475569;
  --slate-light: #94a3b8;
  --slate-mute: #cbd5e1;

  --gold: #c8a951;
  --gold-bright: #e5c466;
  --gold-soft: #f0d98a;
  --gold-glow: rgba(200, 169, 81, 0.35);

  --orcid: #a6ce39;
  --danger: #ef4444;

  --bg: #ffffff;
  --bg-alt: #f6f5f1;
  --bg-cream: #faf8f3;
  --border: #e7e5dd;
  --border-strong: #d4d2c8;

  /* Tipografía */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Sombras en capas */
  --shadow-sm: 0 1px 2px rgba(13, 27, 58, 0.06);
  --shadow-md: 0 4px 12px rgba(13, 27, 58, 0.08), 0 2px 4px rgba(13, 27, 58, 0.04);
  --shadow-lg: 0 24px 48px -12px rgba(13, 27, 58, 0.18), 0 8px 16px -8px rgba(13, 27, 58, 0.10);
  --shadow-glow: 0 0 0 1px rgba(200, 169, 81, 0.2), 0 20px 40px -16px rgba(200, 169, 81, 0.4);
  --shadow-photo: 0 50px 100px -20px rgba(0, 0, 0, 0.5), 0 30px 60px -30px rgba(0, 0, 0, 0.6);

  /* Radios */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Animación */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 0.2s;
  --duration-base: 0.4s;
  --duration-slow: 0.8s;

  /* Stagger delays para fade-in */
  --delay-1: 0.1s;
  --delay-2: 0.2s;
  --delay-3: 0.3s;
  --delay-4: 0.4s;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  color: var(--slate);
  line-height: 1.7;
  background-color: var(--bg);
  overflow-x: hidden;
}

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

a { color: inherit; }

/* ─── Tipografía editorial ───────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--navy-rich);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.75rem, 6vw + 1rem, 5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 144;
}

h2 {
  font-size: clamp(2rem, 3vw + 1rem, 3rem);
  font-weight: 600;
  margin-bottom: 4rem;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 96;
}

h3 {
  font-size: 1.375rem;
  font-weight: 600;
  font-variation-settings: "opsz" 36;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
  font-variation-settings: "opsz" 24;
}

p { font-family: var(--font-body); }

::selection {
  background: var(--gold);
  color: var(--navy-rich);
}

/* ─── Layout ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 140px 0;
  position: relative;
}

.bg-alt {
  background-color: var(--bg-cream);
  position: relative;
}

.bg-alt::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(200, 169, 81, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(30, 58, 95, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* Section heading con número y línea decorativa */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 4rem;
}

.section-head h2 {
  margin-bottom: 0;
}

.section-num {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  position: relative;
  padding-left: 48px;
  white-space: nowrap;
}

.section-num::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 36px;
  height: 1px;
  background: var(--gold);
}

/* ─── Scroll progress bar ────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 100%);
  z-index: 2000;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px var(--gold-glow);
}

/* ─── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 28px 0;
  z-index: 1000;
  transition: all var(--duration-base) var(--ease-out);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding: 16px 0;
  box-shadow: 0 1px 0 rgba(13, 27, 58, 0.08), 0 4px 24px rgba(13, 27, 58, 0.06);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  color: var(--bg);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color var(--duration-fast);
  font-variation-settings: "opsz" 36;
}

.nav-brand::before {
  content: '◆';
  display: inline-block;
  margin-right: 10px;
  color: var(--gold);
  font-size: 0.7em;
  transform: translateY(-2px);
}

.navbar.scrolled .nav-brand { color: var(--navy-rich); }

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

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  transition: color var(--duration-fast);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 0;
  background: var(--gold);
  transition: width var(--duration-base) var(--ease-out);
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.navbar.scrolled .nav-links a { color: var(--slate); }

.nav-links a:hover,
.nav-links a.active { color: var(--gold); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--bg);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

.navbar.scrolled .menu-toggle { color: var(--navy-rich); }

/* ─── Botones ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  border: 1.5px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '→';
  font-size: 1.1em;
  transition: transform var(--duration-base) var(--ease-out);
}

.btn:hover::after { transform: translateX(4px); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  color: var(--navy-deep);
  box-shadow: 0 8px 24px -8px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -10px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-outline {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--bg);
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.05);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 70% 30%, rgba(200, 169, 81, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 20% 80%, rgba(42, 79, 124, 0.4) 0%, transparent 60%),
    linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-rich) 50%, var(--navy) 100%);
  display: flex;
  align-items: center;
  padding-top: 120px;
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Patrón de cuadrícula sutil sobre el hero */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 30%, transparent 80%);
  pointer-events: none;
  z-index: -1;
}

/* Forma decorativa flotante */
.hero::after {
  content: '';
  position: absolute;
  top: 15%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
  opacity: 0.08;
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
  animation: floatOrb 12s ease-in-out infinite;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 30px) scale(1.1); }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 80px;
  align-items: center;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 28px;
  padding: 8px 16px;
  border: 1px solid rgba(200, 169, 81, 0.3);
  border-radius: var(--radius-full);
  background: rgba(200, 169, 81, 0.08);
  backdrop-filter: blur(8px);
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

.hero-content h1 {
  color: var(--bg);
  margin-bottom: 24px;
}

.hero-content h1 .accent {
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold) 50%, var(--gold-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
  font-weight: 500;
  /* Las itálicas + gradient text se cortan en la derecha; padding lo previene */
  display: inline-block;
  padding-right: 0.12em;
  margin-right: -0.08em;
}

.hero-subhead {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 48px;
  max-width: 540px;
  line-height: 1.7;
}

.hero-subhead .divider {
  display: inline-block;
  margin: 0 8px;
  color: var(--gold);
  opacity: 0.6;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.hero-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.orcid-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--orcid);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--duration-fast);
  box-shadow: 0 4px 12px rgba(166, 206, 57, 0.3);
}

.orcid-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(166, 206, 57, 0.4);
}

.orcid-badge img { width: 16px; height: 16px; }

.email-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  text-decoration: none;
  transition: all var(--duration-fast);
  backdrop-filter: blur(8px);
}

.email-icon:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-deep);
  transform: translateY(-2px);
}

/* Foto del hero con marco premium */
.hero-photo {
  position: relative;
  border-radius: var(--radius-xl);
  aspect-ratio: 4/5;
  isolation: isolate;
  --photo-rotate: 2deg;
  transform: rotate(var(--photo-rotate));
  transition: transform var(--duration-slow) var(--ease-out);
}

.hero-photo:hover { --photo-rotate: 0deg; }

.hero-photo::before {
  content: '';
  position: absolute;
  inset: -16px;
  border: 1px solid rgba(200, 169, 81, 0.4);
  border-radius: calc(var(--radius-xl) + 16px);
  transform: rotate(-3deg);
  z-index: -1;
  transition: transform var(--duration-slow) var(--ease-out);
}

.hero-photo:hover::before { transform: rotate(-5deg); }

.hero-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, transparent 50%, rgba(13, 27, 58, 0.4) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-photo);
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 6rem;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 700;
  box-shadow: var(--shadow-photo);
}

/* Indicador de scroll */
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: bobUp 2.4s ease-in-out infinite;
}

.scroll-hint::after {
  content: '';
  width: 1px;
  height: 32px;
  background: linear-gradient(180deg, var(--gold), transparent);
}

@keyframes bobUp {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -8px); }
}

/* ─── About ──────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 96px;
  align-items: start;
}

.bio p {
  margin-bottom: 24px;
  font-size: 1.0625rem;
  color: var(--slate);
  line-height: 1.85;
}

.bio p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  float: left;
  line-height: 0.85;
  margin-right: 12px;
  margin-top: 6px;
  color: var(--navy-rich);
  font-variation-settings: "opsz" 144;
}

.stats-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--navy-rich);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(200, 169, 81, 0.15) 0%, transparent 50%),
    linear-gradient(135deg, var(--navy-rich) 0%, var(--navy) 100%);
  padding: 4px;
  border-radius: var(--radius-lg);
  margin-top: 56px;
  overflow: hidden;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--navy-rich);
  border-radius: calc(var(--radius-lg) - 4px);
}

/* legacy stat span styles eliminados — usar .stat-num y .stat-label */

/* Timeline */
.education {
  background: var(--bg-cream);
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
}

.education::before {
  content: 'Formación';
  position: absolute;
  top: -12px;
  left: 32px;
  background: var(--bg);
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
  margin-top: 8px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 19px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--border) 100%);
}

.timeline-item {
  position: relative;
  padding-left: 60px;
  min-height: 40px;
}

.timeline-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  box-shadow: 0 0 0 4px var(--bg-cream), 0 6px 16px var(--gold-glow);
  transition: all var(--duration-base) var(--ease-out);
}

.timeline-icon .icon {
  width: 18px;
  height: 18px;
}

.timeline-item:hover .timeline-icon {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  color: var(--navy-deep);
  transform: scale(1.08);
}

.timeline-item h4 {
  font-size: 1.0625rem;
  margin-bottom: 6px;
  color: var(--navy-rich);
}

.timeline-item p {
  font-size: 0.875rem;
  color: var(--slate-light);
  line-height: 1.5;
}

/* ─── Áreas de investigación ─────────────────────────────── */
.areas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.area-card {
  --delay: 0s;
  background: var(--bg);
  padding: 48px 36px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  cursor: default;
}

.area-card.fade-in { transition-delay: var(--delay); }
.area-card:nth-child(1) { --delay: 0s; }
.area-card:nth-child(2) { --delay: 0.1s; }
.area-card:nth-child(3) { --delay: 0.2s; }

.area-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold-soft) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
  z-index: -1;
}

.area-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-base) var(--ease-out);
}

.area-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.area-card:hover::before { opacity: 0.18; }
.area-card:hover::after { transform: scaleX(1); }

.area-icon {
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-alt) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--navy-rich);
  transition: all var(--duration-base) var(--ease-out);
}

.area-card:hover .area-icon {
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold) 100%);
  border-color: var(--gold);
  color: var(--navy-deep);
  transform: rotate(-6deg) scale(1.05);
}

.area-card h3 {
  margin-bottom: 16px;
  font-size: 1.375rem;
}

.area-card p {
  font-size: 0.9375rem;
  color: var(--slate);
  line-height: 1.7;
}

/* ─── Publicaciones ──────────────────────────────────────── */
.pub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 56px;
  flex-wrap: wrap;
  gap: 24px;
}

.pub-counter {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--slate-light);
  font-weight: 600;
  background: var(--bg-cream);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pub-counter::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.pub-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pub-filter {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--slate);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.pub-filter:hover {
  border-color: var(--navy-rich);
  color: var(--navy-rich);
  transform: translateY(-1px);
}

.pub-filter.active {
  background: var(--navy-rich);
  color: var(--bg);
  border-color: var(--navy-rich);
  box-shadow: 0 4px 12px rgba(13, 27, 58, 0.2);
}

#publications-list {
  transition: opacity var(--duration-base) var(--ease-out);
}

.pub-year-group { margin-bottom: 64px; }

.pub-year-header {
  font-family: var(--font-display);
  color: var(--navy-rich);
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 96;
}

.pub-year-header .count {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}

.pub-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.pub-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.pub-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-bright) 100%);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--duration-base) var(--ease-out);
}

.pub-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.pub-card:hover::before { transform: scaleY(1); }

.pub-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.pub-card-header { margin-bottom: 16px; }

.pub-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pub-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  color: var(--navy-rich);
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.4;
  font-variation-settings: "opsz" 24;
}

.pub-meta {
  font-size: 0.8125rem;
  color: var(--slate-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.pub-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ─── Consultoría ────────────────────────────────────────── */
.consulting-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 900px;
}

.consulting-item {
  display: flex;
  gap: 32px;
  align-items: center;
  padding: 36px 40px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.consulting-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(200, 169, 81, 0.08), transparent);
  transition: width var(--duration-base) var(--ease-out);
}

.consulting-item:hover {
  transform: translateX(8px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

.consulting-item:hover::before { width: 100%; }

.consulting-icon {
  background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-alt) 100%);
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  color: var(--navy-rich);
  flex-shrink: 0;
  transition: all var(--duration-base) var(--ease-out);
}

.consulting-item:hover .consulting-icon {
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold) 100%);
  border-color: var(--gold);
  color: var(--navy-deep);
  transform: rotate(-6deg);
}

.consulting-content { flex: 1; }

.consulting-content h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.consulting-content p {
  color: var(--slate);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ─── Contact ────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: start;
}

.form-group { margin-bottom: 24px; }

.form-group label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy-rich);
  margin-bottom: 10px;
}

.form-control {
  width: 100%;
  padding: 16px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--navy-rich);
  background: var(--bg);
  transition: all var(--duration-fast) var(--ease-out);
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-glow);
}

.form-control.invalid { border-color: var(--danger); }

textarea.form-control {
  resize: vertical;
  min-height: 140px;
  font-family: var(--font-body);
}

.contact-info {
  background:
    radial-gradient(circle at 100% 0%, rgba(200, 169, 81, 0.18) 0%, transparent 60%),
    linear-gradient(135deg, var(--navy-rich) 0%, var(--navy-deep) 100%);
  color: var(--bg);
  padding: 56px 48px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.contact-info::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
  opacity: 0.15;
  filter: blur(40px);
  pointer-events: none;
}

.contact-info h3 {
  font-family: var(--font-display);
  color: var(--bg);
  margin-bottom: 36px;
  font-size: 1.625rem;
  position: relative;
}

.contact-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
}

.contact-info-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

/* legacy .contact-info-item i — reemplazado por .ci-icon (SVG) */

.info-block p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.info-block p:not(:first-child) {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.contact-info-item a {
  color: var(--bg);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color var(--duration-fast);
}

.contact-info-item a:hover { color: var(--gold); }

/* ─── Footer ─────────────────────────────────────────────── */
footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 48px 0;
  font-size: 0.8125rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ─── Back to top ────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  color: var(--navy-deep);
  border: none;
  box-shadow: 0 12px 24px -8px var(--gold-glow), 0 8px 16px rgba(13, 27, 58, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--duration-base) var(--ease-out);
  z-index: 99;
}

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

#back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 32px -8px var(--gold-glow), 0 12px 20px rgba(13, 27, 58, 0.25);
}

/* ─── Animaciones de entrada ─────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-d1 { transition-delay: var(--delay-1); }
.fade-in-d2 { transition-delay: var(--delay-2); }
.fade-in-d3 { transition-delay: var(--delay-3); }

.form-success {
  display: none;
  padding: 56px 32px;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-alt) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.form-success .check {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
  color: var(--gold);
}

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

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .areas-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 64px; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero-grid { gap: 56px; }
}

@media (max-width: 768px) {
  .container { padding: 0 24px; }
  .section { padding: 96px 0; }

  .hero { min-height: auto; padding-top: 140px; padding-bottom: 100px; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 64px; }
  .hero-content .hero-eyebrow { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-links { justify-content: center; }
  .hero-photo { max-width: 360px; margin: 0 auto; }
  .hero-subhead { margin-left: auto; margin-right: auto; }
  .scroll-hint { display: none; }

  .menu-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--navy-rich);
    flex-direction: column;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-base) var(--ease-out);
    gap: 0;
  }
  .navbar.scrolled .nav-links {
    background: var(--bg);
    box-shadow: 0 12px 24px rgba(13, 27, 58, 0.1);
  }
  .nav-links.active {
    max-height: 400px;
    padding: 16px 0;
  }
  .nav-links li {
    text-align: center;
    padding: 14px 0;
  }

  .areas-grid { grid-template-columns: 1fr; }
  .pub-header { flex-direction: column; align-items: flex-start; }
  .stats-bar { grid-template-columns: 1fr; }
  .consulting-item { flex-direction: column; align-items: flex-start; text-align: left; gap: 20px; padding: 28px; }

  .section-head { flex-direction: column; gap: 12px; align-items: flex-start; }
  .section-num { padding-left: 0; }
  .section-num::before { display: none; }

  .bio p:first-of-type::first-letter { font-size: 3.5rem; }
}

@media (max-width: 480px) {
  .btn { width: 100%; padding: 14px 24px; }
  .hero-actions { flex-direction: column; gap: 12px; }
  .contact-info { padding: 40px 28px; }
  .pub-card { padding: 24px; }
}

/* ============================================================
   FASE 2 — Refinamientos premium para sitios académicos
   ============================================================ */

/* ─── Skip link (a11y) ───────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--navy-rich);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 3000;
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: 8px;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ─── Hamburger animado ──────────────────────────────────── */
.menu-toggle {
  width: 44px;
  height: 44px;
  position: relative;
}

.menu-toggle .hamburger,
.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
  display: block;
  position: absolute;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all var(--duration-base) var(--ease-out);
}

.menu-toggle .hamburger {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
  content: '';
  left: 0;
}

.menu-toggle .hamburger::before { top: -7px; }
.menu-toggle .hamburger::after { top: 7px; }

.menu-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.menu-toggle[aria-expanded="true"] .hamburger::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .hamburger::after { top: 0; transform: rotate(-45deg); }

/* ─── Floating section dots (desktop) ────────────────────── */
.section-dots {
  position: fixed;
  top: 50%;
  right: 32px;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(13, 27, 58, 0.08);
  border-radius: var(--radius-full);
  box-shadow: 0 8px 24px rgba(13, 27, 58, 0.08);
  opacity: 0;
  transform: translateY(-50%) translateX(20px);
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}

.section-dots.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.section-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--slate-mute);
  position: relative;
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  display: block;
}

.section-dots .dot:hover { background: var(--slate); transform: scale(1.2); }

.section-dots .dot.active {
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-glow);
}

.section-dots .dot::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 16px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: var(--navy-rich);
  color: var(--bg);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.section-dots .dot:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ─── Hero meta (números animados) ───────────────────────── */
.hero-meta {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 40px;
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-meta-num {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.02em;
}

.hero-meta-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.hero-meta-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
}

/* ─── Hero icon links ────────────────────────────────────── */
.hero-icon-link {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
  backdrop-filter: blur(8px);
}

.hero-icon-link:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-deep);
  transform: translateY(-2px);
}

/* ─── News strip (marquee) ───────────────────────────────── */
.news-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(200, 169, 81, 0.2);
  z-index: 5;
  overflow: hidden;
}

.news-strip-label {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  color: var(--navy-deep);
  padding: 16px 24px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

.news-strip-label::after {
  content: '';
  position: absolute;
  right: -32px;
  top: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(90deg, var(--gold-bright), transparent);
  pointer-events: none;
  z-index: 1;
}

.news-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  padding-left: 24px;
}

/* Fade-out al final para que los items no aparezcan cortados */
.news-track::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 64px;
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.6), transparent);
  pointer-events: none;
  z-index: 1;
}

.news-marquee {
  display: flex;
  flex-shrink: 0;
  gap: 64px;
  white-space: nowrap;
  animation: marquee 80s linear infinite;
  padding-right: 64px; /* gap entre el último item y el primero del loop */
}

.news-marquee span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Anima -50% que es exactamente la mitad del contenido duplicado */
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.news-strip:hover .news-marquee { animation-play-state: paused; }

/* ─── Bio refinements ────────────────────────────────────── */
.bio-lead {
  font-size: 1.25rem !important;
  color: var(--navy-rich) !important;
  line-height: 1.7 !important;
  font-weight: 400;
}

.bio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 0;
}

.bio-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate);
  letter-spacing: 0.02em;
  transition: all var(--duration-fast) var(--ease-out);
}

.bio-tag:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-deep);
  transform: translateY(-2px);
}

/* ─── Stats refinements (con números grandes) ────────────── */
.stat-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  font-variation-settings: "opsz" 36;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.02em;
}

/* ─── Timeline con tags de año ───────────────────────────── */
.timeline-year {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
  padding: 3px 10px;
  background: rgba(200, 169, 81, 0.1);
  border-radius: var(--radius-full);
  border: 1px solid rgba(200, 169, 81, 0.25);
}

/* ─── Area cards refinement ──────────────────────────────── */
.area-card-num {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  font-variation-settings: "opsz" 72;
  transition: color var(--duration-base) var(--ease-out);
}

.area-card:hover .area-card-num { color: var(--gold); }

.area-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.area-keywords span {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--slate-light);
  padding: 4px 10px;
  background: var(--bg-cream);
  border-radius: var(--radius-full);
}

/* ─── Featured publications block ────────────────────────── */
.featured-block {
  margin-bottom: 80px;
}

.featured-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.375rem;
  margin-bottom: 32px;
  color: var(--navy-rich);
}

.featured-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
  color: var(--navy-deep);
  border-radius: 50%;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px var(--gold-glow);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.featured-card {
  background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: all var(--duration-base) var(--ease-out);
  cursor: default;
}

.featured-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 100%);
}

.featured-card::after {
  content: '★';
  position: absolute;
  top: 24px;
  right: 28px;
  font-size: 1.5rem;
  color: var(--gold);
  opacity: 0.4;
  transition: all var(--duration-base) var(--ease-out);
}

.featured-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}

.featured-card:hover::after {
  opacity: 1;
  transform: rotate(72deg) scale(1.1);
}

.featured-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.featured-year {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--slate-light);
}

.featured-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy-rich);
  line-height: 1.35;
  margin-bottom: 16px;
  font-variation-settings: "opsz" 36;
  padding-right: 32px;
}

.featured-abstract {
  font-size: 0.9375rem;
  color: var(--slate);
  line-height: 1.65;
  margin-bottom: 20px;
}

.featured-meta {
  font-size: 0.8125rem;
  color: var(--slate-light);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ─── Divider ornamental ─────────────────────────────────── */
.pub-divider {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 24px 0 56px;
}

.pub-divider::before,
.pub-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.pub-divider span {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate-light);
}

/* ─── Pub filters con conteo ─────────────────────────────── */
.pub-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pub-filter .filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--bg-cream);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--slate-light);
  transition: all var(--duration-fast);
}

.pub-filter.active .filter-count {
  background: var(--gold);
  color: var(--navy-deep);
}

/* ─── Pub card star (featured) ───────────────────────────── */
.pub-card.is-featured {
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-cream) 100%);
}

.pub-star {
  margin-left: auto;
  color: var(--gold);
  font-size: 0.875rem;
}

.pub-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pub-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--duration-fast);
}

.pub-link:hover { color: var(--navy-rich); }

.pub-error {
  padding: 48px;
  text-align: center;
  color: var(--slate-light);
  background: var(--bg-cream);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

/* ─── Consulting refinements ─────────────────────────────── */
.consulting-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 4px 10px;
  background: rgba(200, 169, 81, 0.1);
  border: 1px solid rgba(200, 169, 81, 0.25);
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.consulting-arrow {
  font-size: 1.5rem;
  color: var(--slate-mute);
  flex-shrink: 0;
  transition: all var(--duration-base) var(--ease-out);
}

.consulting-item:hover .consulting-arrow {
  color: var(--gold);
  transform: translateX(8px);
}

/* ─── Contact refinements ────────────────────────────────── */
.contact-intro {
  font-size: 1.0625rem;
  color: var(--slate);
  margin-bottom: 32px;
  line-height: 1.6;
  max-width: 480px;
}

.contact-availability {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
}

.availability-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 12px #4ade80;
  animation: pulse 2s ease-in-out infinite;
}

/* ─── Footer rediseñado ──────────────────────────────────── */
footer { padding: 64px 0 32px; }

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr;
  gap: 48px;
  align-items: start;
  padding-bottom: 32px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bg);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--duration-fast);
}

.footer-links a:hover { color: var(--gold); }

.footer-meta {
  text-align: right;
  font-size: 0.8125rem;
}

.footer-meta p {
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.footer-meta .footer-mini {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

/* ─── Responsive de los nuevos elementos ─────────────────── */
@media (max-width: 1100px) {
  .section-dots { display: none; }
}

@media (max-width: 768px) {
  .hero-meta { gap: 20px; flex-wrap: wrap; }
  .hero-meta-num { font-size: 1.75rem; }
  .news-strip-label { padding: 12px 16px; font-size: 0.6875rem; }
  .news-marquee span { font-size: 0.8125rem; }
  .featured-grid { grid-template-columns: 1fr; }
  .footer-content { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .footer-links { justify-content: center; }
  .footer-meta { text-align: center; }
  .consulting-arrow { display: none; }
}

/* ============================================================
   ÍCONOS SVG (sprite Lucide-style)
   ============================================================ */

.icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  color: currentColor;
  stroke: currentColor;
  fill: none;
}

.icon-sm {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

/* Stat icons (en stats-bar — fondo navy, ícono dorado) */
.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(200, 169, 81, 0.12);
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--gold);
}

.stat-icon .icon { width: 20px; height: 20px; }

/* Area icons (en cards claras) */
.area-icon { color: var(--navy-rich); }
.area-icon .icon { width: 28px; height: 28px; }
.area-card:hover .area-icon { color: var(--navy-deep); }

/* Consulting icons */
.consulting-icon { color: var(--navy-rich); }
.consulting-icon .icon { width: 28px; height: 28px; }
.consulting-item:hover .consulting-icon { color: var(--navy-deep); }

/* Consulting arrow */
.consulting-arrow .icon { width: 24px; height: 24px; }

/* Contact info icons (sobre fondo oscuro) */
.ci-icon {
  width: 40px;
  height: 40px;
  background: rgba(200, 169, 81, 0.12);
  border: 1px solid rgba(200, 169, 81, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}

.ci-icon .icon { width: 18px; height: 18px; }

/* Pub meta icons (inline con texto) */
.pub-meta .icon-sm,
.featured-meta .icon-sm {
  width: 13px;
  height: 13px;
  margin-right: 4px;
  vertical-align: -2px;
  opacity: 0.7;
}

/* Hero icon link */
.hero-icon-link svg { width: 16px; height: 16px; }

/* ============================================================
   FIXES — Overflow, wrapping, espaciado en breakpoints intermedios
   ============================================================ */

/* Defaults universales — evita que flex/grid items rompan layouts */
*, *::before, *::after { min-width: 0; }

html, body { overflow-x: clip; }

/* Tipografía: balance en titulares, pretty en párrafos largos */
h1, h2, h3, h4, h5 {
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: none;
}

p { text-wrap: pretty; overflow-wrap: break-word; }

/* ─── Hero ──────────────────────────────────────────────── */
.hero-content h1 { text-wrap: balance; }

.hero-meta {
  flex-wrap: wrap;
  row-gap: 16px;
}

.hero-subhead { text-wrap: pretty; }

/* ─── Stats bar — números y labels largos ───────────────── */
.stat-item { min-width: 0; }
.stat-item > div { min-width: 0; flex: 1; }
.stat-num, .stat-label { overflow-wrap: break-word; }

/* ─── Pub year header — contador puede empujar año ──────── */
.pub-year-header {
  flex-wrap: wrap;
  gap: 8px 24px;
}

/* ─── Pub cards — títulos largos académicos ─────────────── */
.pub-title,
.featured-title {
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.featured-abstract { text-wrap: pretty; }

.pub-meta { min-width: 0; }
.pub-meta span { overflow-wrap: anywhere; }

/* ─── Contact info — emails largos ──────────────────────── */
.contact-info-item { min-width: 0; }
.info-block { min-width: 0; flex: 1; }
.contact-info-item a,
.info-block p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ─── Footer ────────────────────────────────────────────── */
.footer-content > * { min-width: 0; }
.footer-name { overflow-wrap: break-word; }
.footer-brand p,
.footer-meta p { overflow-wrap: break-word; }

/* ─── Section heads — número decorativo no debe forzar overflow ── */
.section-head {
  flex-wrap: wrap;
  row-gap: 12px;
}

/* ─── Bio drop cap — proteger en pantallas medianas ─────── */
.bio-lead { overflow: hidden; }

/* ============================================================
   Tablet intermedio (769–1100px) — antes este rango quedaba apretado
   ============================================================ */
@media (max-width: 1100px) and (min-width: 769px) {
  .nav-links { gap: 22px; }
  .nav-links a { font-size: 0.8125rem; letter-spacing: 0; }
  .container { padding: 0 28px; }

  .hero-grid { gap: 48px; }
  .hero-photo { --photo-rotate: 0deg; }
  .hero-photo::before { display: none; }
  .hero-content h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
  .hero-meta { gap: 24px; }

  .areas-grid { gap: 20px; }
  .area-card { padding: 36px 28px; }
  .area-card-num { font-size: 2rem; top: 20px; right: 20px; }

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

  .stats-bar { grid-template-columns: 1fr; }
}

/* ============================================================
   Tablet (≤1024px) — section heads y áreas
   ============================================================ */
@media (max-width: 1024px) {
  .section { padding: 110px 0; }
  .section-num { font-size: 0.6875rem; padding-left: 32px; }
  .section-num::before { width: 22px; }

  .featured-card { padding: 28px; }
  .featured-title { font-size: 1.125rem; }
}

/* ============================================================
   Mobile (≤768px) — refuerzos
   ============================================================ */
@media (max-width: 768px) {
  .hero-content h1 br { display: none; }
  .hero-content h1 .accent::before { content: ' '; }

  .hero-meta {
    width: 100%;
    justify-content: space-around;
    padding: 20px 0;
  }
  .hero-meta-divider { display: none; }
  .hero-meta-item { align-items: center; text-align: center; flex: 1; min-width: 80px; }

  .pub-year-header { font-size: 1.75rem; }
  .pub-year-header .count { font-size: 0.625rem; }

  .news-strip {
    position: static;
    margin-top: 64px;
  }

  .footer-content { padding-bottom: 24px; }

  .bio-lead { font-size: 1.0625rem !important; }
  .bio p:first-of-type::first-letter { font-size: 3rem; }
}

/* ============================================================
   AUDITORÍA VISUAL — Pulidos finales
   ============================================================ */

/* Hero h1: line-height un pelo más amplio para acomodar acentos
   en español (Á, É, Ñ) y descenders italics sin recorte */
.hero-content h1 {
  line-height: 1.05;
  padding-bottom: 0.05em;
}

/* Hero subhead: el max-width estaba hardcoded, mejor que escale */
.hero-subhead {
  max-width: 56ch;
}

/* Stats numbers: que descenders no se corten */
.stat-num,
.hero-meta-num,
.featured-title,
.pub-title { padding-bottom: 0.05em; }

/* Pub year header: gap más generoso, alinear baseline */
.pub-year-header {
  align-items: baseline;
}

.pub-year-header .count {
  white-space: nowrap;
}

/* Featured cards: el ::after star no debe pisar el badge cuando es largo */
.featured-card-header { padding-right: 32px; }

/* Pub-meta SVG icons: color editorial */
.pub-meta .pub-venue,
.pub-meta .pub-authors,
.featured-meta span {
  color: var(--slate-light);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pub-meta .icon-sm,
.featured-meta .icon-sm {
  margin-right: 0;
  vertical-align: middle;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Bio drop cap: en ciertos navegadores el float crea overlap */
.bio p:first-of-type::first-letter {
  margin-bottom: -8px;
}

/* Pub-counter: que no se rompa en dos líneas en ancho intermedio */
.pub-counter { white-space: nowrap; }

/* Pub-filter: cuando hay muchos botones, mejor wrap suave */
.pub-filters {
  justify-content: flex-start;
}

/* Section dots: sólo visibles cuando hay espacio Y tras el hero */
@media (max-height: 600px) {
  .section-dots { display: none; }
}

/* Hero photo: en ancho intermedio, sin rotación para ahorrar espacio */
@media (max-width: 1180px) and (min-width: 769px) {
  .hero-photo { --photo-rotate: 0deg; }
  .hero-photo::before { transform: rotate(-2deg); }
}

/* Avatar fallback: usar Fraunces, no Inter */
.avatar-fallback {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

/* Form success: el estado oculto inicial es display none */
.form-success { box-shadow: var(--shadow-sm); }

/* Form control textarea: mantener ancho del padre */
textarea.form-control { max-width: 100%; }

/* Bio tags hover: sutil scale */
.bio-tag:hover { box-shadow: 0 4px 12px var(--gold-glow); }

/* Filter count: mejor contraste cuando filtro está active */
.pub-filter.active .filter-count {
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy-deep);
}

/* Hover del enlace ORCID: que no pierda la sombra característica */
.orcid-badge { white-space: nowrap; }

/* Iconos en hero links: que estén alineados al texto */
.hero-icon-link svg { display: block; }

/* ============================================================
   Mobile pequeño (≤420px) — última línea de defensa
   ============================================================ */
@media (max-width: 420px) {
  .container { padding: 0 20px; }
  .section { padding: 80px 0; }

  .hero-content h1 { font-size: clamp(2rem, 8vw, 2.75rem); }
  .hero-eyebrow { font-size: 0.625rem; padding: 6px 12px; }
  .hero-subhead { font-size: 1rem; }

  .hero-meta-num { font-size: 1.5rem; }
  .hero-meta-label { font-size: 0.625rem; }

  .pub-year-header { font-size: 1.5rem; }
  .pub-card { padding: 22px; }
  .pub-title { font-size: 1rem; }

  .featured-card { padding: 24px; }
  .featured-title { font-size: 1.0625rem; }

  .area-card { padding: 32px 24px; }
  .area-card-num { font-size: 1.75rem; top: 16px; right: 16px; }

  .contact-info { padding: 32px 24px; }

  .stats-bar .stat-item { padding: 20px; }
  .stats-bar .stat-item span:first-child { width: 36px; height: 36px; font-size: 1.25rem; }
}

/* ============================================================
   GUARDS UNIVERSALES contra overflow horizontal
   ============================================================ */

html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
}

/* Ningún descendiente puede expandirse más que su contenedor */
img, video, svg, iframe, table {
  max-width: 100%;
  height: auto;
}

/* Cualquier elemento de ancho completo respeta el viewport */
.container,
section,
header,
footer,
main,
nav {
  max-width: 100vw;
}

/* Long text protection global */
p, h1, h2, h3, h4, h5, li, a, span, div {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ============================================================
   RESPONSIVE OVERHAUL — Mobile-first refinement (final cascade)
   Coordinado por @ARIA · ejecutado por @VERA + @APEX
   Esta sección sobreescribe todo lo anterior para garantizar
   una experiencia mobile pulida desde 320px hasta 768px.
   ============================================================ */

/* ─── Tablet (≤960px) — transición ──────────────────────── */
@media (max-width: 960px) {
  .section { padding: 96px 0; }
  .container { padding: 0 24px; }
  h2 { margin-bottom: 3rem; }

  .hero-grid { grid-template-columns: 1fr; gap: 56px; text-align: center; }
  .hero-content { display: flex; flex-direction: column; align-items: center; }
  .hero-eyebrow { align-self: center; }
  .hero-actions, .hero-links { justify-content: center; }
  .hero-photo {
    max-width: 340px;
    margin: 0 auto;
    --photo-rotate: 0deg;
  }
  .hero-photo::before { display: none; }
  .hero-subhead { margin-left: auto; margin-right: auto; }

  .menu-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(13, 27, 58, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-base) var(--ease-out);
    gap: 0;
    border-bottom: 1px solid rgba(200, 169, 81, 0.2);
  }
  .navbar.scrolled .nav-links {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 32px rgba(13, 27, 58, 0.12);
  }
  .nav-links.active {
    max-height: 480px;
    padding: 12px 0 20px;
  }
  .nav-links li {
    text-align: center;
    padding: 14px 0;
  }
  .nav-links a { font-size: 0.9375rem; }

  .scroll-hint { display: none; }
  .section-dots { display: none; }
}

/* ─── Mobile estándar (≤768px) ──────────────────────────── */
@media (max-width: 768px) {
  .section { padding: 80px 0; }
  .container { padding: 0 22px; }

  /* Section headings */
  h2 { font-size: clamp(1.875rem, 6vw, 2.25rem); margin-bottom: 2.5rem; }
  .section-head { gap: 14px; row-gap: 10px; flex-direction: column; align-items: flex-start; }
  .section-num {
    padding-left: 0;
    font-size: 0.6875rem;
    align-self: flex-start;
  }
  .section-num::before { display: none; }

  /* ── HERO ── */
  .hero {
    min-height: auto;
    padding-top: 110px;
    padding-bottom: 70px;
  }
  .hero-content h1 {
    font-size: clamp(2.25rem, 9vw, 3rem);
    line-height: 1.08;
    text-align: center;
  }
  .hero-content h1 br { display: none; }
  .hero-content h1 .accent::before { content: ' '; }

  .hero-subhead {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 100%;
  }

  .hero-meta {
    width: 100%;
    gap: 16px;
    padding: 18px 0;
    margin-bottom: 32px;
    justify-content: space-around;
    flex-wrap: nowrap;
  }
  .hero-meta-divider { display: none; }
  .hero-meta-item {
    flex: 1;
    align-items: center;
    text-align: center;
    min-width: 0;
  }
  .hero-meta-num { font-size: 1.875rem; }
  .hero-meta-label { font-size: 0.625rem; }

  .hero-actions {
    width: 100%;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
  }
  .hero-actions .btn { width: 100%; max-width: 100%; }

  .hero-photo {
    max-width: min(380px, 78vw);
    width: 100%;
  }

  /* News strip pasa al flujo normal — full bleed limpio sin margin negativos */
  .news-strip {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    margin-top: 48px;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    border-top: 1px solid rgba(200, 169, 81, 0.2);
    border-bottom: 1px solid rgba(200, 169, 81, 0.2);
  }
  .news-strip-label { padding: 14px 18px; font-size: 0.625rem; letter-spacing: 0.12em; }
  .news-marquee span { font-size: 0.8125rem; }

  /* ── ABOUT ── */
  .about-grid { grid-template-columns: 1fr; gap: 48px; }

  .bio p { font-size: 1rem; line-height: 1.75; }
  .bio-lead { font-size: 1.0625rem !important; line-height: 1.6 !important; }
  .bio p:first-of-type::first-letter {
    font-size: 3rem;
    margin-right: 8px;
    margin-top: 4px;
  }

  .bio-tags { gap: 6px; margin-top: 24px; }
  .bio-tag { font-size: 0.6875rem; padding: 5px 12px; }

  .stats-bar {
    grid-template-columns: 1fr;
    margin-top: 40px;
  }
  .stats-bar .stat-item { padding: 22px; }
  .stat-icon { width: 40px; height: 40px; }
  .stat-icon .icon { width: 18px; height: 18px; }
  .stat-num { font-size: 1.25rem; }
  .stat-label { font-size: 0.75rem; }

  .education { padding: 32px 24px; }
  .timeline-item { padding-left: 56px; }
  .timeline::before { left: 19px; }
  .timeline-icon { width: 38px; height: 38px; }
  .timeline-icon .icon { width: 16px; height: 16px; }
  .timeline-item h4 { font-size: 1rem; }

  /* ── ÁREAS ── */
  .areas-grid { grid-template-columns: 1fr; gap: 20px; }
  .area-card {
    padding: 36px 28px;
    margin-top: 0;
  }
  .area-card-num {
    font-size: 2rem;
    top: 20px;
    right: 24px;
  }
  .area-icon { width: 56px; height: 56px; margin-bottom: 24px; }
  .area-icon .icon { width: 24px; height: 24px; }
  .area-card h3 { font-size: 1.25rem; }
  .area-card p { font-size: 0.9375rem; }

  /* ── PUBLICACIONES ── */
  .featured-block { margin-bottom: 56px; }
  .featured-heading { font-size: 1.125rem; }
  .featured-grid { grid-template-columns: 1fr; gap: 16px; }
  .featured-card { padding: 28px 24px; }
  .featured-title { font-size: 1.0625rem; padding-right: 24px; }

  .pub-divider { margin: 8px 0 40px; }
  .pub-divider span { font-size: 0.625rem; }

  .pub-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
  }
  .pub-counter { font-size: 0.6875rem; padding: 6px 14px; }

  .pub-filters {
    width: 100%;
    gap: 6px;
  }
  .pub-filter {
    padding: 8px 14px;
    font-size: 0.75rem;
  }
  .pub-filter .filter-count {
    min-width: 20px;
    height: 20px;
    font-size: 0.625rem;
  }

  .pub-year-group { margin-bottom: 48px; }
  .pub-year-header {
    font-size: 1.625rem;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 8px 16px;
  }
  .pub-year-header .count { font-size: 0.625rem; }

  .pub-cards-grid { grid-template-columns: 1fr; gap: 16px; }
  .pub-card { padding: 24px 22px; }
  .pub-title { font-size: 1rem; line-height: 1.45; }
  .pub-meta { font-size: 0.75rem; }

  /* ── CONSULTORÍA ── */
  .consulting-list { gap: 16px; }
  .consulting-item {
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    padding: 28px 24px;
  }
  .consulting-icon { width: 56px; height: 56px; }
  .consulting-icon .icon { width: 24px; height: 24px; }
  .consulting-content h3 { font-size: 1.125rem; }
  .consulting-content p { font-size: 0.9375rem; }
  .consulting-tag { font-size: 0.5625rem; }
  .consulting-arrow { display: none; }

  /* ── CONTACTO ── */
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .contact-intro { font-size: 0.9375rem; margin-bottom: 24px; }
  .form-control { padding: 14px 16px; font-size: 16px; /* 16px evita zoom iOS */ }
  textarea.form-control { min-height: 120px; }
  .form-group { margin-bottom: 20px; }

  .contact-info {
    padding: 40px 28px;
  }
  .contact-info h3 { font-size: 1.375rem; margin-bottom: 28px; }
  .contact-info-list { gap: 22px; }
  .contact-info-item { gap: 14px; }
  .ci-icon { width: 38px; height: 38px; }
  .ci-icon .icon { width: 16px; height: 16px; }
  .info-block p { font-size: 0.6875rem; }
  .info-block p:not(:first-child) { font-size: 0.875rem; }
  .contact-info-item a { font-size: 0.875rem; }

  /* ── FOOTER ── */
  footer { padding: 48px 0 28px; }
  .footer-content {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
    padding-bottom: 24px;
  }
  .footer-name { font-size: 1.125rem; }
  .footer-links {
    justify-content: center;
    gap: 16px 24px;
  }
  .footer-meta { text-align: center; }

  /* ── BACK TO TOP — táctil ── */
  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
  }

  /* ── BUTTONS — touch target ─ */
  .btn { min-height: 48px; }
}

/* ─── Mobile pequeño (≤480px) ───────────────────────────── */
@media (max-width: 480px) {
  .section { padding: 64px 0; }
  .container { padding: 0 18px; }

  h2 { font-size: clamp(1.625rem, 7vw, 2rem); margin-bottom: 2rem; }

  .navbar { padding: 18px 0; }
  .navbar.scrolled { padding: 14px 0; }
  .nav-brand { font-size: 1.0625rem; }
  .nav-brand::before { font-size: 0.6em; margin-right: 6px; }

  .hero {
    padding-top: 96px;
    padding-bottom: 56px;
  }
  .hero-content h1 {
    font-size: clamp(2rem, 9.5vw, 2.5rem);
    line-height: 1.1;
  }
  .hero-eyebrow {
    font-size: 0.5625rem;
    padding: 6px 12px;
    letter-spacing: 0.14em;
    margin-bottom: 20px;
  }
  .hero-subhead {
    font-size: 0.9375rem;
    margin-bottom: 28px;
  }

  .hero-meta {
    gap: 8px;
    padding: 16px 0;
    margin-bottom: 28px;
  }
  .hero-meta-num { font-size: 1.5rem; }
  .hero-meta-label { font-size: 0.5625rem; letter-spacing: 0.08em; }

  .hero-photo { max-width: min(340px, 80vw); width: 100%; }

  .news-strip {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    margin-top: 40px;
  }
  .news-strip-label {
    padding: 12px 14px;
    font-size: 0.5625rem;
  }
  .news-marquee { gap: 48px; padding-right: 48px; }
  .news-marquee span { font-size: 0.75rem; }

  /* About */
  .bio p { font-size: 0.9375rem; }
  .bio-lead { font-size: 1rem !important; }
  .bio p:first-of-type::first-letter { font-size: 2.5rem; }

  .stats-bar .stat-item { padding: 18px; gap: 12px; }
  .stat-num { font-size: 1.125rem; }

  .education { padding: 28px 20px; }
  .education::before { left: 24px; padding: 4px 10px; font-size: 0.625rem; }
  .timeline-item { padding-left: 50px; }
  .timeline::before { left: 17px; }
  .timeline-icon { width: 36px; height: 36px; }

  /* Áreas */
  .area-card {
    padding: 32px 24px;
  }
  .area-card-num { font-size: 1.75rem; top: 18px; right: 20px; }
  .area-icon { width: 52px; height: 52px; margin-bottom: 20px; }
  .area-card h3 { font-size: 1.125rem; }
  .area-card p { font-size: 0.875rem; }
  .area-keywords span { font-size: 0.625rem; padding: 3px 8px; }

  /* Publicaciones */
  .featured-card { padding: 24px 20px; }
  .featured-title { font-size: 1rem; }
  .featured-abstract { font-size: 0.875rem; }

  .pub-year-header {
    font-size: 1.5rem;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }
  .pub-card { padding: 22px 20px; }
  .pub-title { font-size: 0.9375rem; }
  .pub-meta { font-size: 0.6875rem; }

  /* Consultoría */
  .consulting-item {
    padding: 24px 20px;
    gap: 16px;
  }
  .consulting-icon { width: 48px; height: 48px; }
  .consulting-icon .icon { width: 22px; height: 22px; }
  .consulting-content h3 { font-size: 1.0625rem; }
  .consulting-content p { font-size: 0.875rem; }

  /* Contacto */
  .contact-info { padding: 32px 22px; }
  .contact-info h3 { font-size: 1.25rem; margin-bottom: 24px; }
  .contact-availability { font-size: 0.8125rem; gap: 8px; }

  /* Footer */
  .footer-content { gap: 24px; }
  .footer-links { font-size: 0.8125rem; gap: 14px 20px; }

  /* Back to top más pequeño */
  #back-to-top {
    width: 44px;
    height: 44px;
    bottom: 16px;
    right: 16px;
  }
}

/* ─── Mobile muy pequeño (≤360px) — iPhone SE ───────────── */
@media (max-width: 360px) {
  .container { padding: 0 16px; }

  .hero-content h1 { font-size: 1.875rem; }
  .hero-meta { padding: 14px 0; }
  .hero-meta-num { font-size: 1.375rem; }
  .hero-meta-label { font-size: 0.5rem; }

  .news-strip {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }

  .hero-photo { max-width: min(300px, 82vw); width: 100%; }

  .pub-year-header { font-size: 1.375rem; }
  .featured-card { padding: 22px 18px; }
  .pub-card { padding: 20px 18px; }
  .area-card { padding: 28px 22px; }
  .consulting-item { padding: 22px 18px; }
  .contact-info { padding: 28px 20px; }
  .stats-bar .stat-item { padding: 16px; }
  .education { padding: 24px 18px; }
}

/* ─── Landscape mobile (orientación apaisada) ───────────── */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .hero { min-height: auto; padding-top: 100px; padding-bottom: 60px; }
  .hero-grid { grid-template-columns: 1fr 1fr; text-align: left; gap: 32px; }
  .hero-photo { max-width: min(280px, 35vw); width: 100%; margin: 0; }
  .hero-content { align-items: flex-start; }
  .hero-actions { justify-content: flex-start; }
  .news-strip { display: none; }
}

/* ============================================================
   HARDENING — Última capa anti-overflow con !important
   Garantiza que el sitio no scrollee horizontalmente ni en
   los dispositivos más estrechos ni con contenido extremo.
   ============================================================ */

@media (max-width: 768px) {
  /* Contención dura del viewport */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    position: relative;
  }

  /* Hero NO puede ser flex row en mobile — sus children (container + news-strip)
     deben apilarse verticalmente, no quedar lado a lado */
  .hero {
    display: block !important;
  }
  .hero > .container {
    width: 100%;
    display: block;
  }

  /* Container nunca excede viewport */
  .container {
    max-width: 100% !important;
    width: 100%;
    box-sizing: border-box;
  }

  /* Toda imagen es fluida */
  img, picture, picture > * {
    max-width: 100%;
    height: auto;
  }

  /* Hero photo: contenedor con tamaño explícito y centrado */
  .hero-photo {
    width: min(380px, 78vw);
    max-width: min(380px, 78vw);
    aspect-ratio: 4 / 5;
    margin-left: auto;
    margin-right: auto;
  }
  .hero-photo img,
  .hero-photo picture {
    width: 100%;
    height: 100%;
  }

  /* H1 con balance dinámico para evitar líneas huérfanas */
  .hero-content h1 {
    text-wrap: balance;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  /* Accent ya no se sale */
  .hero-content h1 .accent {
    display: inline;
    padding-right: 0.05em;
    margin-right: 0;
    overflow-wrap: break-word;
  }

  /* Texto largo en cualquier card */
  .pub-title, .featured-title, .area-card h3, .consulting-content h3 {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  /* Stats labels */
  .stat-label, .hero-meta-label {
    word-break: normal;
    overflow-wrap: break-word;
  }

  /* Footer links wrap suave */
  .footer-links a { white-space: nowrap; }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Buttons ocupan ancho disponible sin exceder */
  .btn {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Input/textarea no exceden contenedor */
  input.form-control, textarea.form-control {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  /* Pub-counter, eyebrow y badges no fuerzan ancho */
  .pub-counter, .hero-eyebrow, .pub-badge, .timeline-year, .consulting-tag {
    max-width: 100%;
  }

  /* News strip: sin márgenes negativos, full bleed garantizado */
  .news-strip {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  .news-track {
    min-width: 0;
    flex: 1;
  }

  /* Stats bar: items no se rompen ni se desbordan */
  .stats-bar {
    width: 100%;
    max-width: 100%;
  }

  /* Section dots ocultos siempre en mobile */
  .section-dots { display: none !important; }

  /* Decorative orbs reducidos en mobile para no excederse */
  .hero::after {
    width: 280px;
    height: 280px;
    right: -20%;
  }
  .contact-info::before {
    width: 240px;
    height: 240px;
  }

  /* Avatar fallback centrado */
  .avatar-fallback {
    font-size: 4rem;
  }
}

/* iPhone SE / Galaxy Fold y similares (≤375px) */
@media (max-width: 375px) {
  .hero-photo {
    width: min(320px, 80vw);
    max-width: min(320px, 80vw);
  }
  .hero-content h1 {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
    letter-spacing: -0.025em;
  }
  .hero-meta {
    gap: 4px;
  }
  .hero-meta-num { font-size: 1.25rem; }
  .hero-meta-label { font-size: 0.5rem; }
  .container { padding: 0 14px; }
  .btn { padding: 14px 20px; font-size: 0.875rem; }
  .pub-filter { padding: 7px 12px; font-size: 0.6875rem; }
}

/* Galaxy Fold cerrado (≤320px) */
@media (max-width: 320px) {
  .container { padding: 0 12px; }
  .hero-content h1 { font-size: 1.625rem; }
  .hero-photo { width: 84vw; max-width: 84vw; }
  .hero-meta { flex-direction: column; gap: 12px; padding: 14px 0; }
  .hero-meta-divider { display: none; }
  .news-strip-label { padding: 10px 12px; }
}

