/* ============================================================
   Geografía UDeC — base + 3 direcciones visuales
   Cambia la dirección con [data-theme="a|b|c"] en <html>
   ============================================================ */

:root {
  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 4px;
  --radius-lg: 10px;
  --topbar-h: 44px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- Dirección A — Institucional Sobrio ---------- */
[data-theme="a"] {
  --bg: #ffffff;
  --surface: #f4f6f9;
  --surface-2: #e9eef4;
  --ink: #0e2742;
  --ink-soft: #4a5b70;
  --line: #dfe5ec;
  --brand: #103a66;
  --brand-deep: #0b2944;
  --brand-2: #1f6fb0;
  --accent: #e0801b;
  --accent-2: #f2b223;
  --on-brand: #ffffff;
  --font-display: "Libre Franklin", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --display-weight: 800;
  --display-tracking: -0.02em;
  --display-leading: 1.02;
  --hero-case: none;
}

/* ---------- Dirección B — Cartográfico Editorial ---------- */
[data-theme="b"] {
  --bg: #faf6ee;
  --surface: #f1ebdd;
  --surface-2: #e8dfcc;
  --ink: #1b2a39;
  --ink-soft: #5a5346;
  --line: #ddd2bd;
  --brand: #143a5c;
  --brand-deep: #0f2c47;
  --brand-2: #2d6c93;
  --accent: #c2611a;
  --accent-2: #cf971a;
  --on-brand: #faf6ee;
  --font-display: "Spectral", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --display-weight: 600;
  --display-tracking: 0;
  --display-leading: 1.05;
  --hero-case: none;
}

/* ---------- Dirección C — Geo Contemporáneo ---------- */
[data-theme="c"] {
  --bg: #fbfbf8;
  --surface: #eef0ec;
  --surface-2: #e3e7e0;
  --ink: #14171c;
  --ink-soft: #535a64;
  --line: #dcdfd9;
  --brand: #0b2e6b;
  --brand-deep: #08234f;
  --brand-2: #2563d6;
  --accent: #f0a017;
  --accent-2: #f7c948;
  --on-brand: #ffffff;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, sans-serif;
  --display-weight: 700;
  --display-tracking: -0.03em;
  --display-leading: 0.98;
  --hero-case: none;
}

/* ============================================================
   Reset / base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: var(--display-leading);
  margin: 0;
  color: var(--ink);
}
.container { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .9rem;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--accent);
}

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  background: var(--brand-deep);
  color: var(--on-brand);
  font-size: .82rem;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.topbar__name { letter-spacing: .02em; opacity: .92; font-weight: 500; }
.topbar__right { display: flex; align-items: center; gap: 18px; }
.socials { display: flex; align-items: center; gap: 12px; }
.socials a { opacity: .8; transition: opacity .2s, transform .2s; display: grid; place-items: center; }
.socials a:hover { opacity: 1; transform: translateY(-1px); }
.socials svg { width: 17px; height: 17px; fill: currentColor; }

.langtoggle { display: inline-flex; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; overflow: hidden; }
.langtoggle button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--on-brand); font: inherit; font-size: .76rem; font-weight: 600;
  padding: 3px 11px; opacity: .6; transition: background .2s, opacity .2s;
}
.langtoggle button[aria-pressed="true"] { background: var(--accent); opacity: 1; color: #fff; }

/* ============================================================
   Header / nav
   ============================================================ */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead .container { display: flex; align-items: center; gap: 28px; height: 78px; }
.brand { display: flex; align-items: center; gap: 13px; margin-right: auto; }
.brand img { width: 42px; height: 42px; }
.brand__txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand__txt b { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.06rem; letter-spacing: -.01em; color: var(--ink); }
.brand__txt span { font-size: .72rem; letter-spacing: .04em; color: var(--ink-soft); text-transform: uppercase; }

.mainnav { display: flex; align-items: center; gap: 4px; }
.navitem { position: relative; }
.navitem > a, .navitem > button {
  appearance: none; background: none; border: 0; cursor: pointer;
  font-family: var(--font-body); font-size: .97rem; font-weight: 600; color: var(--ink);
  padding: 10px 14px; border-radius: var(--radius); display: inline-flex; align-items: center; gap: 5px;
  transition: color .18s, background .18s;
}
.navitem > a:hover, .navitem > button:hover, .navitem.active > a { color: var(--brand-2); }
.navitem.active > a { background: var(--surface); }
.navitem .caret { width: 9px; height: 9px; fill: none; stroke: currentColor; stroke-width: 2; opacity: .65; transition: transform .2s; }
.navitem:hover .caret { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 18px 44px -18px rgba(12,30,52,.32);
  padding: 7px; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.navitem:hover .dropdown, .navitem:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: block; padding: 9px 13px; border-radius: var(--radius); font-size: .92rem; font-weight: 500; color: var(--ink-soft); transition: background .15s, color .15s; }
.dropdown a:hover { background: var(--surface); color: var(--brand-2); }

.navtoggle { display: none; }

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; overflow: hidden; background: var(--brand-deep); }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero__slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.4s var(--ease);
}
.hero__slide.active { opacity: .55; }
@media (prefers-reduced-motion: no-preference) {
  .hero__slide.active { animation: heroZoom 7.5s ease-out forwards; }
}
@keyframes heroZoom { from { transform: scale(1.09); } to { transform: scale(1); } }
.hero__slide--empty {
  opacity: 0;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px),
    linear-gradient(120deg, var(--brand-deep), var(--brand));
}
.hero__slide--empty.active { opacity: 1; }
.hero__slide--empty:nth-child(2) { background: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px), linear-gradient(120deg, #0b2a48, var(--brand-2)); }
.hero__slide--empty:nth-child(3) { background: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px), linear-gradient(120deg, #11324f, #245b86); }
.hero__slide--empty:nth-child(4) { background: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px), linear-gradient(120deg, var(--brand), #0b2a48); }
.hero__slide--empty:nth-child(5) { background: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px), linear-gradient(120deg, #163a5c, var(--brand-deep)); }
.hero__slide--empty::after {
  content: "imagen " attr(data-empty);
  position: absolute; right: 16px; bottom: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .68rem; letter-spacing: .04em;
  color: rgba(255,255,255,.55); background: rgba(0,0,0,.25); padding: 3px 9px; border-radius: 999px;
}
.hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, var(--brand-deep) 8%, color-mix(in srgb, var(--brand-deep) 55%, transparent) 55%, color-mix(in srgb, var(--brand) 30%, transparent)); }
.hero__inner { position: relative; min-height: 520px; display: flex; flex-direction: column; justify-content: center; padding-block: 96px; color: #fff; }
.hero h1 { color: #fff; font-size: clamp(2.6rem, 6.2vw, 4.9rem); max-width: 16ch; }
.hero__sub { font-size: clamp(1.1rem, 2.2vw, 1.5rem); color: rgba(255,255,255,.86); margin-top: 1.1rem; max-width: 40ch; font-weight: 400; }
.hero__cta { display: flex; gap: 14px; margin-top: 2.2rem; flex-wrap: wrap; }
.hero__dots { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; gap: 10px; z-index: 3; }
.hero__dots button {
  width: 9px; height: 9px; border-radius: 999px; border: 0; cursor: pointer; padding: 0;
  background: rgba(255,255,255,.4); transition: background .2s, width .25s var(--ease);
}
.hero__dots button:hover { background: rgba(255,255,255,.7); }
.hero__dots button.active { background: var(--accent); width: 26px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: 13px 24px; border-radius: var(--radius); border: 1.5px solid transparent;
  transition: transform .15s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn--ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.12); }
.btn--solid { background: var(--brand); color: var(--on-brand); }
.btn--solid:hover { background: var(--brand-deep); }
.btn--line { border-color: var(--line); color: var(--ink); background: var(--bg); }
.btn--line:hover { border-color: var(--brand-2); color: var(--brand-2); }

/* ============================================================
   Sections
   ============================================================ */
section { padding-block: clamp(56px, 7vw, 104px); }
.section-head { max-width: 62ch; margin-bottom: clamp(32px, 4vw, 56px); }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); }
.section-head p { color: var(--ink-soft); font-size: 1.12rem; margin-top: .8rem; }
.bg-surface { background: var(--surface); }

/* Disciplines */
.disciplines { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.5vw, 30px); }
.disc {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.disc:hover { transform: translateY(-4px); box-shadow: 0 22px 48px -28px rgba(12,30,52,.4); border-color: color-mix(in srgb, var(--brand-2) 40%, var(--line)); }
.disc__media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--surface-2); }
.disc__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.disc:hover .disc__media img { transform: scale(1.05); }
.disc__badge {
  position: absolute; left: 18px; bottom: -26px; width: 52px; height: 52px;
  display: grid; place-items: center; padding: 9px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--line); box-shadow: 0 10px 24px -14px rgba(12,30,52,.5);
}
.disc__badge svg { width: 100%; height: 100%; }
.disc__txt { padding: 38px 28px 32px; }
.disc__icon { width: 64px; height: 64px; margin: 36px 30px 0; }
.disc:not(:has(.disc__media)) .disc__txt { padding-top: 22px; }
.disc h3 { font-size: 1.32rem; margin-bottom: .5rem; }
.disc p { color: var(--ink-soft); font-size: 1rem; margin: 0; }
.disc__more { margin-top: 18px; font-weight: 600; font-size: .92rem; color: var(--brand-2); display: inline-flex; align-items: center; gap: 6px; }

/* Postgraduate programs */
.programs { display: grid; gap: clamp(16px, 2vw, 22px); }
.program {
  display: grid; grid-template-columns: 200px 1fr; align-items: stretch;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.program:hover { transform: translateY(-3px); box-shadow: 0 22px 48px -28px rgba(12,30,52,.4); border-color: color-mix(in srgb, var(--brand-2) 40%, var(--line)); }
.program__media { position: relative; overflow: hidden; background: var(--surface-2); }
.program__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.program:hover .program__media img { transform: scale(1.05); }
.program__body { padding: 26px 30px; display: flex; flex-direction: column; gap: .55rem; }
.program__tag {
  align-self: flex-start; font-family: var(--font-body); font-weight: 700; font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--brand-2);
  background: color-mix(in srgb, var(--brand-2) 12%, var(--bg)); border: 1px solid color-mix(in srgb, var(--brand-2) 25%, var(--line));
  padding: 4px 11px; border-radius: 999px;
}
.program h3 { font-size: 1.28rem; line-height: 1.18; }
.program p { color: var(--ink-soft); font-size: 1rem; margin: 0; }
@media (max-width: 680px) {
  .program { grid-template-columns: 1fr; }
  .program__media { aspect-ratio: 16/9; }
}

/* Academics */
.people { --people-gap: clamp(18px,2.4vw,28px); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--people-gap); }
.person { flex: 0 1 calc((100% - 3 * var(--people-gap)) / 4); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; text-align: center; }
.person:hover { transform: translateY(-3px); box-shadow: 0 20px 42px -26px rgba(12,30,52,.38); }
.person__photo {
  width: 132px; height: 132px; border-radius: 50%; overflow: hidden;
  margin: 28px auto 0; border: 3px solid var(--surface); box-shadow: 0 8px 22px -12px rgba(12,30,52,.45);
}
.person__body { padding: 16px 20px 24px; }
.person__body h3 { font-size: 1.14rem; }
.person__role { color: var(--brand-2); font-weight: 600; font-size: .92rem; margin-top: 3px; }
.person__area { color: var(--ink-soft); font-size: .9rem; margin-top: 8px; }
.person__mail { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.person__links { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.person__links a {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px;
  border: 1px solid var(--line); color: var(--ink-soft);
  transition: color .18s, border-color .18s, background .18s, transform .18s var(--ease);
}
.person__links a:hover { color: var(--brand-2); border-color: var(--brand-2); background: var(--surface); transform: translateY(-2px); }
.person__links svg { width: 17px; height: 17px; }
.person__links svg circle[fill="#A6CE39"] { fill: #A6CE39; }

/* Academics — grouping by role/cargo */
.people-group + .people-group { margin-top: clamp(44px, 6vw, 76px); }
.people-group__head { text-align: center; max-width: 62ch; margin: 0 auto clamp(22px, 3vw, 36px); }
.people-group__head .eyebrow { justify-content: center; }
.people-group__head h2 { font-size: clamp(1.5rem, 2.8vw, 2.05rem); }

/* Generic doc page */
.docpage { padding-block: clamp(40px, 5vw, 72px); }
.pagehead { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: clamp(40px,5vw,68px); }
.pagehead h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); }
.pagehead p { color: var(--ink-soft); font-size: 1.15rem; margin-top: .7rem; max-width: 58ch; }
.breadcrumb { font-size: .82rem; color: var(--ink-soft); margin-bottom: 1rem; display: flex; gap: 8px; align-items: center; }
.breadcrumb a:hover { color: var(--brand-2); }

.prose { max-width: 72ch; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font-size: 1.7rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.28rem; margin-top: 1.8em; }
.prose p { color: var(--ink); }
.prose a { color: var(--brand-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--brand-2) 40%, transparent); }
.prose a:hover { text-decoration-color: var(--brand-2); }
.prose ul, .prose ol { padding-left: 1.3em; color: var(--ink); }
.prose li + li { margin-top: .4em; }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 20px; margin: 1.4em 0; color: var(--ink-soft); font-style: italic; }
.prose img { border-radius: var(--radius-lg); margin-block: 1.4em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: .9em; }

/* Research lines */
.lines { display: grid; gap: 14px; }
.line {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 22px; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px 28px; transition: border-color .2s, transform .2s var(--ease);
}
.line:hover { border-color: var(--brand-2); transform: translateX(4px); }
.line__num { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.5rem; color: var(--accent); }
.line h3 { font-size: 1.24rem; }
.line p { color: var(--ink-soft); font-size: .98rem; margin: 4px 0 0; }

/* Research laboratories */
.labs { --lab-gap: clamp(18px, 2.4vw, 28px); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--lab-gap); }
.lab {
  flex: 0 1 calc((100% - 2 * var(--lab-gap)) / 3);
  display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.lab:hover { transform: translateY(-4px); box-shadow: 0 22px 48px -28px rgba(12,30,52,.4); border-color: color-mix(in srgb, var(--brand-2) 40%, var(--line)); }
.lab__logo {
  height: 150px; display: flex; align-items: center; justify-content: center; padding: 22px 28px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.lab__logo img { max-height: 96px; max-width: 76%; width: auto; height: auto; object-fit: contain; display: block; }
.lab__logo .ph { border-radius: 8px; }
.lab__body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.lab__body h3 { font-size: 1.18rem; }
.lab__body p { color: var(--ink-soft); font-size: .96rem; margin: 0; }
.lab__link { margin-top: auto; padding-top: 12px; display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: .9rem; color: var(--brand-2); }
.lab__link svg { width: 16px; height: 16px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(28px, 4vw, 56px); align-items: stretch; }
.contact-stack { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 44px); max-width: 880px; margin: 0 auto; }
.contact-info dl { margin: 0; display: grid; gap: 22px; }
.contact-items { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 26px 36px !important; }
.contact-info dt { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 4px; display: inline-flex; align-items: center; gap: 7px; }
.contact-info dt svg { width: 15px; height: 15px; }
.contact-info dd { margin: 0; font-size: 1.04rem; line-height: 1.5; }
.map-embed { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); min-height: 360px; background: var(--surface-2); }
.map-embed iframe { width: 100%; height: 100%; min-height: 360px; border: 0; display: block; }
.map-embed--sm { min-height: 0; height: clamp(260px, 38vw, 340px); }
.map-embed--sm iframe { min-height: 0; height: clamp(260px, 38vw, 340px); }

/* Publications grouped by year */
.pub-year + .pub-year { margin-top: clamp(32px, 4vw, 52px); }
.pub-year__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--ink);
  padding-bottom: 12px; border-bottom: 2px solid var(--line); margin-bottom: 22px;
}
.pub-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; max-width: 80ch; }
.pub-list li { position: relative; padding-left: 22px; color: var(--ink); line-height: 1.55; }
.pub-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pub-list a { color: var(--brand-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* CTA band */
.ctaband { background: var(--brand); color: var(--on-brand); }
.ctaband .container { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.ctaband h2 { color: var(--on-brand); font-size: clamp(1.6rem, 3vw, 2.4rem); max-width: 22ch; }
.ctaband p { color: color-mix(in srgb, var(--on-brand) 80%, transparent); margin-top: .5rem; }

/* ============================================================
   Image placeholder (until user uploads photos)
   ============================================================ */
.ph {
  position: relative; width: 100%; height: 100%;
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, transparent) 0 2px, transparent 2px 11px),
    var(--surface-2);
  display: grid; place-items: center;
}
.ph::after {
  content: attr(data-label);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .72rem; letter-spacing: .04em; color: var(--ink-soft);
  background: var(--bg); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
}

/* ============================================================
   Footer
   ============================================================ */
.footer { background: var(--brand-deep); color: rgba(255,255,255,.78); padding-block: 60px 30px; font-size: .94rem; }
.footer__logos { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; flex-wrap: wrap; }
.footer__udec { height: 52px; width: auto; display: block; opacity: .95; }
.footer__cna { height: 40px; width: auto; display: block; opacity: .9; }
.footer a:hover { color: #fff; }
.footer__top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.14); }
.footer__brand b { font-family: var(--font-display); color: #fff; font-size: 1.2rem; display: block; margin-bottom: 10px; }
.footer h5 { color: #fff; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 16px; font-weight: 700; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer__bottom { padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .84rem; opacity: .7; }

/* ============================================================
   Reveal on scroll
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 940px) {
  .person { flex-basis: calc((100% - 2 * var(--people-gap)) / 3); }
  .lab { flex-basis: calc((100% - var(--lab-gap)) / 2); }
  .disciplines { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  /* the three-lines button unfolds this as a full-width list under the header */
  .masthead .container { position: relative; }
  .mainnav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-top: 1px solid var(--line);
    box-shadow: 0 26px 40px -18px rgba(8,20,36,.30);
    padding: 4px 16px 16px;
    max-height: calc(100vh - var(--topbar-h) - 78px);
    max-height: calc(100dvh - var(--topbar-h) - 78px);
    overflow-y: auto; overscroll-behavior: contain;
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity .24s var(--ease), transform .26s var(--ease), visibility .26s;
  }
  .mainnav.open { opacity: 1; visibility: visible; transform: none; }
  .mainnav .navitem:last-child > a, .mainnav .navitem:last-child > button { border-bottom: 0; }
  .navitem > a, .navitem > button { width: 100%; justify-content: space-between; padding: 15px 12px; border-bottom: 1px solid var(--line); font-size: 1.02rem; }
  /* sub-list collapsed by default; unfolds only when its parent is tapped */
  .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; padding: 0 0 0 12px;
    max-height: 0; overflow: hidden; transition: max-height .28s var(--ease);
  }
  .navitem.open > .dropdown { max-height: 60vh; padding-bottom: 8px; }
  .navitem.open > button .caret { transform: rotate(180deg); }
  .dropdown a { padding: 13px 13px; font-size: .98rem; }
  .navtoggle { display: inline-flex; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
  .navtoggle span { width: 24px; height: 2px; background: var(--ink); transition: .25s; }
  .navtoggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .navtoggle.open span:nth-child(2) { opacity: 0; }
  .navtoggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
@media (max-width: 620px) {
  .lab { flex-basis: 100%; }
  .footer__top { grid-template-columns: 1fr; }
  .topbar__name { display: none; }
  body { font-size: 17px; }
}

/* Equipos (académicos/administrativos): angostar las columnas en pantallas
   chicas. Estas reglas van DESPUÉS del bloque de 940px (que fija 3 columnas)
   para que la cascada de max-width gane correctamente: 2 columnas y luego 1.
   Si se ubican antes, el bloque de 940px las sobrescribe y las tarjetas
   mantienen 3 columnas en el móvil, desbordando las fotos (se ven superpuestas). */
@media (max-width: 680px) {
  .person { flex-basis: calc((100% - var(--people-gap)) / 2); }
}
@media (max-width: 480px) {
  .person { flex-basis: 100%; }
}
