:root {
  --bg: #ffffff;
  --panel-bg: #f9fafb;
  --line: #e5e7eb;
  --shadow: 0 10px 30px rgba(0,0,0,.05);
  --radius: 18px;
  --text-main: #1f2933;
  --text-muted: #6b7280;
  --accent-1: #2d5f6e;
  --accent-2: #3a8a7a;
  --accent-3: #6ab4a0;
  --accent-4: #b08a6a;
  --accent-5: #eaf2f7;   /* azul claro #5c90b5 desaturado para fondos */
  --accent-blue: #5c90b5;
  --muted: var(--text-muted);
  --accent: var(--accent-1);
}

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

body {
  margin: 0;
  font-family: "Aptos", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--accent-1); }
.muted { color: var(--text-muted); }

.container { width: min(1100px, 92vw); margin: 0 auto; }

/* ── HEADER ── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 12px 0; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { height: 48px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 800; font-size: 15px; color: var(--accent-1); }
.brand-tag  { font-size: 11px; color: var(--muted); }

.menu { display: flex; align-items: center; gap: 20px; }
.menu a { color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.menu a:hover { color: var(--accent-1); }

.menu-toggle {
  display: none; background: transparent;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; cursor: pointer;
}
.menu-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--text-main); margin: 4px 0; border-radius: 2px;
}

.lang { display: flex; gap: 4px; align-items: center; }
.lang button {
  background: transparent; border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 8px;
  font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.lang button[aria-pressed="true"] {
  background: var(--accent-1); color: #fff; border-color: var(--accent-1);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 14px; border: 1px solid var(--line);
  font-weight: 700; font-size: 14px; cursor: pointer;
  text-decoration: none; transition: filter .15s, background .15s;
}
.btn:hover { text-decoration: none; }
.btn-small { padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text-main); }
.btn-ghost:hover { background: rgba(0,0,0,.03); }

/* ── HERO ── */
.hero { padding: 64px 0 48px; }
.kicker {
  color: var(--accent-blue); font-weight: 700; font-size: 13px;
  letter-spacing: .4px; text-transform: uppercase; margin: 0 0 10px;
}
h1 {
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1.1; margin: 0 0 16px;
}
.lead {
  color: var(--muted); font-size: 16px; line-height: 1.65;
  margin: 0 0 36px; max-width: 780px;
}

.lines-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.line-card {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}
.line-card h3 { margin: 0 0 6px; font-size: 14px; }
.line-card p  { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }

.hero-photos {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px; margin-top: 4px;
}
.hero-photos img {
  width: 100%; height: 110px;
  object-fit: cover; border-radius: 10px; display: block;
}

/* ── SECTIONS ── */
.section { padding: 56px 0; }
.section-alt {
  background: var(--accent-5);
  border-top: 1px solid #c9dde9;
  border-bottom: 1px solid #c9dde9;
}
.section-head { margin-bottom: 28px; }
.section-head h2 { margin: 0 0 8px; font-size: clamp(22px, 2.5vw, 32px); }
.section-head p  { color: var(--muted); margin: 0; font-size: 15px; max-width: 700px; }

/* ── EQUIPO ── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.team-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  box-shadow: var(--shadow);
}
.team-photo-link { display: block; flex-shrink: 0; }
.team-photo {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid var(--accent-5);
  display: block;
}
.team-info { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.team-info h4 { margin: 0; font-size: 15px; color: var(--accent-1); }
.team-info h4 a { color: var(--accent-1); }
.team-info h4 a:hover { color: var(--accent-blue); }
.team-role { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.4; }

.team-links {
  display: flex; gap: 10px; margin-top: 6px;
  justify-content: center;
}
.team-links a {
  color: var(--accent-blue);
  font-size: 16px;
  transition: color .15s, transform .15s;
}
.team-links a:hover { color: var(--accent-1); transform: translateY(-1px); text-decoration: none; }
.team-links a.placeholder-link { color: #bbc8d4; cursor: default; pointer-events: none; }

/* ── PROYECTOS ── */
.proj-subtitle { color: var(--accent-blue); margin: 0 0 18px; font-size: 16px; }
.proj-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; }

.proj-item {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 24px;
}
.proj-item h4 { margin: 0 0 8px; font-size: 16px; color: var(--accent-1); }
.proj-item h4 a { color: var(--accent-1); }
.proj-item h4 a:hover { color: var(--accent-blue); text-decoration: none; }
.proj-item p  { margin: 0 0 14px; font-size: 14px; color: var(--muted); line-height: 1.6; }

.proj-institutions {
  font-size: 12px;
  color: var(--muted);
  background: var(--accent-5);
  border: 1px solid #c9dde9;
  border-radius: 999px;
  padding: 4px 14px;
  display: inline-block;
  letter-spacing: .1px;
}

.past-projects-list { margin-top: 8px; }
.past-projects-list h3 { margin-bottom: 14px; }
.past-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.past-list li {
  background: var(--panel-bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 16px; font-size: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.past-list li span { color: var(--muted); font-size: 12px; }

/* ── PUBLICACIONES ── */
.pub-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px; border-bottom: 1px solid var(--line); padding-bottom: 12px;
}
.pub-tab {
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 16px;
  font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.pub-tab.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }
.pub-tab:hover:not(.active) { background: var(--accent-5); color: var(--accent-1); }

.pub-panel { display: none; }
.pub-panel.active { display: block; }

.pub-year-group { margin-bottom: 28px; }
.pub-year-group h3 {
  font-size: 17px; color: var(--accent-blue);
  margin: 0 0 10px; border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.pub-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pub-item {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; font-size: 14px; line-height: 1.55;
}
.pub-authors { color: var(--muted); font-size: 13px; }
.pub-title   { font-weight: 700; color: var(--text-main); display: block; margin: 3px 0 2px; }
.pub-journal { color: var(--accent-2); font-style: italic; }
.pub-doi a   { font-size: 12px; color: var(--accent-blue); margin-left: 6px; }

/* ── NETWORKING ── */
.network-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.network-card {
  background: var(--panel-bg); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  text-decoration: none; color: var(--text-main);
  transition: transform .2s, box-shadow .2s;
}
.network-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.08); text-decoration: none; }
.network-card img { height: 44px; width: auto; object-fit: contain; flex-shrink: 0; }
.network-card-text h4 { margin: 0 0 3px; font-size: 14px; color: var(--accent-1); }
.network-card-text p  { margin: 0; font-size: 12px; color: var(--muted); }

/* ── FOOTER ── */
.footer { background: var(--panel-bg); border-top: 1px solid var(--line); padding: 24px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-inner p { margin: 0; font-size: 13px; color: var(--muted); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-photos { grid-template-columns: repeat(3, 1fr); }
  .hero-photos img:nth-child(4),
  .hero-photos img:nth-child(5) { display: none; }
}
@media (max-width: 680px) {
  .menu {
    display: none; position: absolute; top: 70px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 20px; gap: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
  }
  .menu.open { display: flex; }
  .menu-toggle { display: block; }
  .lines-grid { grid-template-columns: 1fr; }
  .hero-photos { grid-template-columns: repeat(2, 1fr); }
  .hero-photos img:nth-child(5) { display: none; }
  .team-grid { grid-template-columns: 1fr; }
  .network-grid { grid-template-columns: 1fr; }
}
