/* Tipografías (licencia SIL OFL, incluidas en assets/fonts) */
@font-face { font-family: "STIX Two Text"; src: url("../fonts/stix-two-text-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "STIX Two Text"; src: url("../fonts/stix-two-text-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "STIX Two Text"; src: url("../fonts/stix-two-text-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --navy: #0b1d2e;
  --navy-2: #12293f;
  --ink: #14212d;
  --muted: #536372;
  --page: #f6f8f9;
  --white: #ffffff;
  --rule: #d5dde3;
  --celeste: #7cc4f0;
  --sol: #f4b63f;
  --link: #0d5f86;
  --serif: "STIX Two Text", "STIX Two", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 70rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Idiomas: se muestra solo el que coincide con <html lang> */
html[lang="es"] [lang="en"],
html[lang="en"] [lang="es"] { display: none; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 0.06em; }
a:hover { text-decoration-thickness: 0.12em; }
:focus-visible { outline: 3px solid var(--sol); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip { position: absolute; left: -999rem; top: 0; background: var(--sol); color: var(--navy); padding: 0.6rem 1rem; z-index: 20; }
.skip:focus { left: 0; }

/* ---------- Barra superior ---------- */

.topbar { position: sticky; top: 0; z-index: 10; background: var(--navy); color: var(--white); border-bottom: 1px solid #ffffff1f; }
.topbar .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 3.5rem; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.125rem; color: var(--white); text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 1.25rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #d7e3ec; text-decoration: none; font-size: 0.9375rem; white-space: nowrap; padding-block: 1rem; }
.nav a:hover { color: var(--white); text-decoration: underline; }
.langs { display: flex; border: 1px solid #ffffff55; border-radius: 4px; overflow: hidden; flex: none; }
.langs button { font: 600 0.8125rem/1 var(--sans); letter-spacing: 0.04em; color: #d7e3ec; background: none; border: 0; padding: 0.45rem 0.6rem; cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--celeste); color: var(--navy); }

/* ---------- Portada ---------- */

.hero { background: var(--navy); color: var(--white); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: 2rem; }
.hero-text { padding-block: clamp(3rem, 9vw, 6.5rem); }
.hero h1 { font-size: clamp(2.25rem, 5.2vw, 3.75rem); letter-spacing: -0.01em; }
.hero-lead { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: #d7e3ec; max-width: 34em; margin: 1.5rem 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn { display: inline-block; font-weight: 600; font-size: 1rem; text-decoration: none; padding: 0.7rem 1.15rem; border-radius: 4px; border: 1px solid var(--celeste); color: var(--white); }
.btn:hover { background: #7cc4f022; }
.btn-main { background: var(--celeste); color: var(--navy); }
.btn-main:hover { background: #a5d8f6; }
.hero-figure { margin: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.hero-figure svg { width: 118%; max-width: none; height: auto; margin-block: -6%; }
.hero-figure figcaption { font-size: 0.8125rem; color: #9fb3c3; max-width: 30em; position: relative; padding-bottom: 1.5rem; }

.ev-track { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s ease-out forwards; }
.ev-pu { animation-delay: 0.05s; }
.ev-jet { animation-delay: 0.35s; }
.ev-tower, .ev-met { opacity: 0; animation: show 0.5s ease-out 1.1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes show { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ev-track { animation: none; stroke-dashoffset: 0; }
  .ev-tower, .ev-met { animation: none; opacity: 1; }
}

/* ---------- Secciones ---------- */

.section { padding-block: clamp(3rem, 7vw, 5.5rem); border-top: 1px solid var(--rule); }
.section-alt { background: var(--white); }
.section h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); margin-bottom: 1.5rem; }
.section h3 { font-size: 1.3125rem; }
.prose { max-width: 42em; }
.prose p { font-size: 1.0625rem; }
.lede { font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.4; max-width: 34em; margin-bottom: 1.5rem; }

/* El grupo */
.about { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.facts { border-top: 3px solid var(--navy); }
.facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding-block: 0.8rem; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--muted); font-size: 0.9375rem; }
.facts dd { font-weight: 600; font-size: 0.9375rem; }

/* Investigación */
.lines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 5vw, 4rem); }
.lines li { padding-block: 1.4rem; border-top: 1px solid var(--rule); }
.lines h3 { margin-bottom: 0.5rem; }
.lines p { margin: 0; color: #2c3b48; max-width: 36em; }

/* CERN y ATLAS */
.figs { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 1.5rem; margin-top: 2.5rem; align-items: end; }
.figs figure { margin: 0; }
.figs img { width: 100%; border: 1px solid var(--rule); background: var(--white); }
.figs figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 0.6rem; }

/* Integrantes */
.people-heading { margin: 2.5rem 0 1.1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.people-heading:first-child { margin-top: 0; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1.75rem 1.5rem; }
.person-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 3px; background: #e3e9ed; }
.person-initials { display: grid; place-items: center; font-family: var(--serif); font-size: 2.25rem; color: #7d8c99; }
.person-name { font-weight: 600; margin: 0.7rem 0 0; line-height: 1.3; }
.person-role { color: var(--muted); font-size: 0.9375rem; margin: 0.15rem 0 0; }
.person-detail { font-size: 0.9375rem; margin: 0.6rem 0 0; }
.people.people-lead { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.people-lead .person { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.people-lead .person-name { font-family: var(--serif); font-size: 1.3125rem; margin-top: 0; }

/* Formación */
.training { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; margin-top: 2.5rem; }
.roll-title { display: flex; align-items: baseline; gap: 0.6rem; padding-bottom: 0.6rem; border-bottom: 3px solid var(--navy); margin-bottom: 0.4rem; }
.roll-count { font-family: var(--serif); font-size: 2.25rem; font-weight: 600; line-height: 1; color: var(--link); }
.roll li { display: flex; justify-content: space-between; gap: 1rem; padding-block: 0.38rem; border-bottom: 1px solid var(--rule); font-size: 0.9375rem; break-inside: avoid; }
.roll-year { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.roll-2 { columns: 2; column-gap: 2rem; }
.roll-block + .roll-block { margin-top: 2.5rem; }

/* Financiamiento */
.fund { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1.5rem; padding-block: 1.1rem; border-top: 1px solid var(--rule); }
.fund-period { font-family: var(--serif); font-size: 1.125rem; color: var(--link); font-variant-numeric: tabular-nums; }
.fund-source { display: block; }
.fund-text { display: block; color: #2c3b48; max-width: 40em; }

/* Publicaciones y contacto */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4rem); }
.cols h2 { margin-bottom: 1rem; }
.linklist li { padding-block: 0.55rem; border-bottom: 1px solid var(--rule); }
.linklist li:first-child { border-top: 1px solid var(--rule); }
address { font-style: normal; margin-bottom: 1rem; }

/* Pie */
.foot { background: var(--navy); color: #b9c8d4; font-size: 0.9375rem; padding-block: 2rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; }
.foot p { margin: 0; }
.foot a { color: var(--celeste); }

.noscript { background: #fff6dc; border: 1px solid #e6cf85; padding: 0.8rem 1rem; border-radius: 3px; max-width: 42em; }

/* ---------- Pantallas chicas ---------- */

@media (max-width: 60rem) {
  .hero .wrap { grid-template-columns: 1fr; gap: 0; }
  .hero-text { padding-bottom: 1rem; }
  .hero-figure svg { width: 100%; margin-block: -4% -9%; }
  .about, .training, .cols, .figs { grid-template-columns: 1fr; }
  .people.people-lead { grid-template-columns: 1fr; }
}
@media (max-width: 44rem) {
  body { font-size: 1rem; }
  .topbar .wrap { gap: 0.9rem; }
  .brand { font-size: 1rem; }
  .lines { grid-template-columns: 1fr; }
  .roll-2 { columns: 1; }
  .fund { grid-template-columns: 1fr; gap: 0.2rem; }
  .people-lead .person { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .people { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
}

@media print {
  .topbar, .hero-actions, .hero-figure { display: none; }
  .hero, .foot { background: none; color: var(--ink); }
  .hero-lead { color: var(--ink); }
}
