:root {
  --primary: #2563eb;
  --dark: #0f172a;
  --p-blue: #edf2f7;
  --p-green: #eef6f1;
  --p-purple: #f2f0f7;
  --p-yellow: #f7f3ec;
  --accent-blue: #3b82f6;
  --accent-green: #16a34a;
  --accent-purple: #8b5cf6;
  --accent-yellow: #d97706;
  --white: #ffffff;
}

body { font-family: 'Inter', sans-serif; color: var(--dark); margin: 0; line-height: 1.6; }
.container { padding: 40px 12%; }
.bg-light { background: #f8fafc; }

/* Navegación */
nav {
  display: flex; justify-content: space-between; padding: 20px 12%;
  position: sticky; top: 0; background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px); z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
nav ul { display: flex; list-style: none; gap: 20px; margin: 0; }
nav a { text-decoration: none; color: var(--dark); font-weight: 500; }

/* Hero Section */
.hero {
  position: relative;
  padding: 72px 0;
  text-align: center;
  color: #f8fafc;
  isolation: isolate;

  /* Fondo moderno sin depender de imagen externa */
  background:
    radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.28), transparent 42%),
    radial-gradient(circle at 85% 25%, rgba(129, 140, 248, 0.26), transparent 45%),
    radial-gradient(circle at 45% 95%, rgba(52, 211, 153, 0.18), transparent 42%),
    linear-gradient(130deg, #0b1120 0%, #111f3d 45%, #1e293b 100%);
}
.profile-img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 15%;
  border: 4px solid white;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  margin-bottom: 5px; /* Reducido de 20px a 5px */
}
/* Botón de descarga mejorado */
.btn-download {
  background: #10b981; /* Verde esmeralda para resaltar */
  color: white !important;
  padding: 12px 28px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-download:hover {
  background: #059669;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.btn-download i {
  font-size: 1.1rem;
}

.hero {
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.3) 0%, rgba(15, 23, 42, 0.74) 100%),
    linear-gradient(120deg, rgba(37, 99, 235, 0.16), rgba(14, 165, 233, 0.08));
  z-index: 1;
}

.hero-container {
  position: relative;
  z-index: 2;
}
/* Opcional: Efecto de zoom al pasar el mouse */
.profile-img:hover {
  transform: scale(1.05);
}

.hero-btns {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 1px;    /* Reducido de 30px a 5px */
}

.btn-primary { background: var(--primary); color: white; padding: 12px 24px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.btn-secondary { border: 2px solid var(--primary); color: var(--primary); padding: 10px 24px; border-radius: 10px; text-decoration: none; font-weight: 600; }

/* Tech Stack */
.tech-grid-large { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-top: 30px; }
.tech-item { padding: 30px; border-radius: 20px; text-align: center; transition: 0.3s; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.tech-item i { font-size: 2.5rem; margin-bottom: 10px; display: block; }
.item-blue { background: var(--p-blue); color: #0369a1; }
.item-green { background: var(--p-green); color: #15803d; }
.item-purple { background: var(--p-purple); color: #7e22ce; }
.item-yellow { background: var(--p-yellow); color: #a16207; }

/* Educación en formato timeline (igual a Professional Experience) */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 26px;
}

.edu-row {
  margin-bottom: 0;
}

.edu-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid #dbeafe;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.edu-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.12);
}

.edu-pdf-cover {
  flex: 0 0 190px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #dbeafe;
  background: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.edu-pdf-cover .pdf-frame,
.edu-pdf-cover embed {
  display: block;
  width: 100%;
  height: 250px;
  border: 0;
  background: #ffffff;
}

.edu-info {
  flex: 1;
}

.edu-info .year {
  display: inline-block;
  font-weight: 400;
  color: #0f172a;
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: 6px;
}

.edu-info h4 {
  margin: 10px 0 8px;
  color: #0f172a;
  font-size: 1.55rem;
}

.edu-theme-phd,
.edu-theme-msc,
.edu-theme-bsc {
  background: linear-gradient(165deg, #fdfbff 0%, #f7f2ff 100%);
  border-left: none;
}

.thesis-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.edu-info .pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  transition: all 0.2s ease;
}

.edu-info .pdf-link:hover {
  color: #1e3a8a;
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .edu-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
  }

  .edu-pdf-cover {
    flex: 0 0 160px;
    max-width: 160px;
  }

  .edu-info {
    text-align: left;
  }

  .edu-pdf-cover .pdf-frame,
  .edu-pdf-cover embed {
    height: 220px;
  }
}

/* Experiencia Vertical */
.vertical-timeline {
  position: relative;
  border-left: 4px solid #bfdbfe;
  margin-left: 28px;
  padding-left: 56px;
}

.timeline-item {
  position: relative;
  margin-bottom: 38px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -48px;
  top: 56px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #93c5fd;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.25);
}

.timeline-marker {
  position: absolute;
  left: -72px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 5px solid #ffffff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35), 0 0 0 6px rgba(59, 130, 246, 0.14);
  font-size: 1.25rem;
  color: #ffffff;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
}

.timeline-marker::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px dashed rgba(59, 130, 246, 0.35);
}

.timeline-content {
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  border: 1px solid #e2e8f0;
  border-left: 6px solid #60a5fa;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-item:hover .timeline-content {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.12);
}

.timeline-content .date {
  display: inline-block;
  font-weight: 700;
  color: #1e40af;
  background: #dbeafe;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.timeline-content h3 {
  margin: 8px 0 12px;
  color: #0f172a;
  font-size: 2.15rem;
  line-height: 1;
  margin-bottom: 6px;
}

.timeline-content ul {
  margin: 0;
  padding-left: 18px;
}

.role-postdoc .timeline-marker {
  background: linear-gradient(145deg, #0ea5e9, #0369a1);
}

.role-tts .timeline-marker {
  background: linear-gradient(145deg, #2563eb, #1e3a8a);
}

.role-deep-learning .timeline-marker {
  background: linear-gradient(145deg, #7c3aed, #5b21b6);
}

.role-instructor .timeline-marker {
  background: linear-gradient(145deg, #0f766e, #115e59);
}

.role-nlp .timeline-marker {
  background: linear-gradient(145deg, #f97316, #c2410c);
}

.role-cv .timeline-marker {
  background: linear-gradient(145deg, #dc2626, #991b1b);
}

@media (max-width: 780px) {
  .vertical-timeline {
    margin-left: 14px;
    padding-left: 30px;
  }

  .timeline-marker {
    left: -52px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-width: 4px;
  }

  .timeline-content {
    padding: 18px;
  }
}



/* Proyectos Pastel */
.project-grid-pastel { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
  gap: 15px; /* Espacio reducido entre tarjetas */
  margin-top: 20px;
}.proj-card { padding: 35px; border-radius: 25px; transition: 0.3s; }
.p-blue {
  background: linear-gradient(135deg, var(--p-blue), #ffffff);
}

.p-blue::before {
  background: var(--accent-blue);
}

.p-green {
  background: linear-gradient(135deg, var(--p-green), #ffffff);
}

.p-green::before {
  background: var(--accent-green);
}

.p-purple {
  background: linear-gradient(135deg, var(--p-purple), #ffffff);
}

.p-purple::before {
  background: var(--accent-purple);
}

/* Publicaciones */
.pub-row { display: flex; align-items: center; gap: 30px; padding: 30px; border-radius: 25px; margin-bottom: 25px; }
.pub-img img { width: 220px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.pub-links a { margin-right: 15px; text-decoration: none; color: var(--primary); font-weight: 600; }

/* Footer Centralizado */
.centered-footer { text-align: center; padding: 50px; border-top: 1px solid #e2e8f0; color: #64748b; font-weight: 500; }

/* Formulario */
.friendly-form-pastel .btn-primary {
  width: 100%; /* Para que se vea como en tu imagen */
  padding: 15px;
  font-size: 1.1rem;
  cursor: pointer;
  border: none;
  transition: background 0.3s ease;
}

/* Awards & Recognition */
#awards .awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

#awards .award-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

#awards .award-item i {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

#awards .award-item p {
  margin: 0;
  color: #0f172a;
  line-height: 1.5;
}

#awards .award-item p strong {
  color: #1e3a8a;
}

@media (max-width: 640px) {
  #awards .awards-grid {
    grid-template-columns: 1fr;
  }

  #awards .award-item {
    grid-template-columns: 46px 1fr;
    gap: 12px;
    padding: 14px;
  }

  #awards .award-item i {
    width: 46px;
    height: 46px;
    font-size: 1.05rem;
  }
}

input, textarea { padding: 15px; border: 2px solid #f1f5f9; border-radius: 12px; outline: none; transition: 0.3s; }
input:focus { border-color: var(--primary); }


/* Contenedor de iconos */
.social-contact-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

/* Estilo circular para cada icono */
.social-icon {
  width: 55px;
  height: 55px;
  background-color: #4477ff; /* Azul similar a tu captura */
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(68, 119, 255, 0.2);
}

.social-icon:hover {
  transform: translateY(-5px);
  background-color: #2563eb;
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4);
}

/* Ajuste para que el formulario sea más compacto (2 campos por fila) */
.form-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.form-row input {
  flex: 1;
}

/* En móviles, los campos del formulario se ponen uno sobre otro */
@media (max-width: 600px) {
  .form-row {
      flex-direction: column;
  }
}

/* --- Sección de Publicaciones Científicas --- */
#publications {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 60px 12%;
}

#publications h2 {
  text-align: left;
  margin-bottom: 32px;
  font-size: 2rem;
  color: var(--dark);
  display: inline-block;
  padding-bottom: 8px;
  border-bottom: 4px solid #60a5fa;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pub-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 26px;
  background: #ffffff;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}

.pub-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
}

.pub-row:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  border-color: #bfdbfe;
}

.pub-img {
  flex: 0 0 220px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.pub-img img {
  width: 100%;
  height: 100%;
  min-height: 145px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.pub-row:hover .pub-img img {
  transform: scale(1.04);
}

.pub-info {
  flex: 1;
}

.pub-info h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.34rem;
  line-height: 1.32;
}

.pub-info h3 a {
  color: #0f172a;
  text-decoration: none;
}

.pub-info h3 a:hover {
  color: #1d4ed8;
}

.pub-info .journal {
  display: inline-block;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 999px;
  padding: 5px 12px;
  margin: 0 0 10px;
}

.pub-info .authors {
  font-size: 1rem;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 0;
}

.pub-info strong {
  color: #0f172a;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
}

.pub-links {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.pub-links a {
  text-decoration: none;
  color: #1e40af;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  transition: 0.2s;
}

.pub-links a:hover {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
}

@media (max-width: 850px) {
  .pub-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
  }

  .pub-img {
    flex: 0 0 auto;
    width: 100%;
    max-width: 320px;
  }

  .pub-info .journal {
    font-size: 0.88rem;
  }

  .pub-links {
    justify-content: center;
  }
}
