/* Web personal · Fernando Cornet-Gómez · Física de partículas (UCO)
   Misma base que la web del grupo FQM-429 (ACP), con un aire de detector:
   fondo azul noche, trazas en ámbar y bosones en cian.
   Sin dependencias externas. Los colores están definidos una sola vez aquí arriba. */

:root {
  --fondo: #fbfaf7;
  --superficie: #ffffff;
  --texto: #1b2133;
  --tenue: #5b6275;
  --borde: #e3e1da;
  --enlace: #1f4fa8;
  --acento: #a85500;           /* ámbar oscuro (trazas, escalares) */
  --boson: #1d6fb8;            /* azul (fotones, Z) */
  --noche: #0b1a2e;            /* azul noche, como en ACP */
  --noche-2: #15305a;
  --sobre-noche: #eef0f7;
  --ambar: #f5a524;            /* ámbar sobre fondo oscuro */
  --cian: #4cc9f0;             /* cian sobre fondo oscuro */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ancho: 72rem;
  --radio: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0a1120;
    --superficie: #121a2c;
    --texto: #e6e8ef;
    --tenue: #a3a9ba;
    --borde: #263049;
    --enlace: #8fb3ff;
    --acento: #f5a524;
    --boson: #4cc9f0;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 1.0625rem/1.65 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--enlace); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); margin: 0 0 .5rem; }
h2 { font-size: 1.6rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.15rem; margin: 0 0 .25rem; }
.tenue { color: var(--tenue); }
.oculto { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

.contenedor { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 40rem) { .contenedor { padding: 0 1.5rem; } }
.seccion { padding-block: 1rem 3rem; }
.estrecho { max-width: 48rem; }

.saltar { position: absolute; left: -999px; }
.saltar:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--superficie); padding: .5rem 1rem; }

/* ---------- Diagramas de Feynman ---------- */
.fd { display: block; width: 100%; height: auto; overflow: visible;
  --fd-fermion: var(--texto); --fd-boson: var(--boson); --fd-escalar: var(--acento); }
.fd path, .fd rect, .fd circle { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fd-f { stroke: var(--fd-fermion); stroke-width: 1.8; }
.fd-b { stroke: var(--fd-boson); stroke-width: 1.8; }
.fd-s { stroke: var(--fd-escalar); stroke-width: 1.9; stroke-dasharray: 5 4; }
.fd .fd-v { fill: var(--fd-fermion); stroke: none; }
.fd .fd-fcnc { stroke: var(--fd-escalar); stroke-width: 1.2; fill: color-mix(in srgb, var(--acento) 18%, transparent); }
.fd-punta { fill: var(--texto); }
.fd-t { font: italic 13px var(--serif); fill: var(--fd-fermion); }
.fd-celda rect { stroke: var(--tenue); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.fd-celda circle, .fd-celda path { stroke: none !important; fill: var(--tenue); opacity: .55; }
.fd-celda--centro rect { stroke: var(--acento); stroke-width: 1.8; stroke-dasharray: none; opacity: 1; }
.fd-celda--centro circle, .fd-celda--centro path { fill: var(--fd-fermion); opacity: 1; }
.fd .fd-rayo { stroke: var(--fd-boson); stroke-width: 1.5; stroke-dasharray: 2 3; }
.fd .fd-flecha-borde { stroke: var(--acento); stroke-width: 1.4; }

/* ---------- Cabecera ---------- */
.cabecera { background: var(--noche); color: var(--sobre-noche); position: sticky; top: 0; z-index: 5;
  border-bottom: 1px solid rgba(255,255,255,.06); }
.cabecera__fila { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; }
.marca { flex: 1 1 0; min-width: 0; display: flex; gap: .8rem; align-items: center; color: inherit; text-decoration: none; padding-block: .5rem; }
.marca__icono { width: 38px; height: 38px; flex: none; }
.marca__onda { stroke: var(--cian); }
.marca__vertice { fill: var(--ambar); }
.marca strong { display: block; font-family: var(--serif); font-size: 1.05rem; line-height: 1.2; }
.marca small { display: block; font-size: .78rem; opacity: .75; }
.menu { display: flex; gap: 0; flex-wrap: wrap; flex: none; }
.menu a { color: inherit; text-decoration: none; padding: .45rem .6rem; border-radius: 6px; font-size: .93rem; }
.menu a:hover { background: rgba(255,255,255,.08); }
.menu a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--ambar); }
.menu-check, .menu-boton { display: none; }
/* Enlace para cambiar de idioma (español ⇄ inglés), separado del resto del menú */
.menu a.menu__idioma { margin-left: .5rem; border: 1px solid rgba(255,255,255,.35); }

@media (max-width: 60rem) {
  .marca small { font-size: .72rem; }
  .menu-boton { display: block; font-size: 1.6rem; cursor: pointer; padding: .25rem .5rem; }
  .menu { display: none; width: 100%; flex-direction: column; padding-bottom: .75rem; }
  .menu-check:checked ~ .menu { display: flex; }
  .menu a.menu__idioma { margin: .5rem 0 0; align-self: flex-start; }
}

/* ---------- Portada ---------- */
.portada {
  position: relative;
  overflow: hidden;
  color: var(--sobre-noche);
  padding: clamp(2.5rem, 7vw, 5rem) 0;
  background:
    radial-gradient(ellipse 55% 70% at 80% 45%, rgba(245,165,36,.13), transparent 70%),
    radial-gradient(ellipse 70% 90% at 5% 100%, rgba(76,201,240,.16), transparent 70%),
    linear-gradient(160deg, var(--noche) 0%, var(--noche-2) 100%);
}
/* Anillo del acelerador al fondo, con paquetes de partículas que giran */
.portada__anillo { position: absolute; width: 150vmax; max-width: none; height: auto; left: -40vmax; top: -30vmax; opacity: .5; pointer-events: none; }
.portada__anillo circle { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 1.2; }
.portada__anillo .portada__anillo-2 { stroke-dasharray: 2 10; stroke: rgba(76,201,240,.18); }
.portada__paquetes { fill: var(--cian); opacity: .55; transform-origin: 500px 500px; animation: girar 90s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.portada__fila { position: relative; display: grid; gap: 2rem; align-items: center; }
@media (min-width: 56rem) { .portada__fila { grid-template-columns: 1.15fr 1fr; } }
.portada__codigo { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--ambar); margin: 0 0 1rem; font-weight: 600; }
.portada__lema { font-size: clamp(1.1rem, 2.4vw, 1.35rem); max-width: 36rem; opacity: .9; margin: 0 0 2rem; }
.portada__botones { display: flex; gap: .75rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
.boton { display: inline-block; padding: .7rem 1.2rem; border-radius: 999px; background: var(--ambar); color: #1a1205; font-weight: 600; text-decoration: none; }
.boton--claro { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.4); }
.boton:hover { filter: brightness(1.08); }
.portada__evento { margin: 0; justify-self: center; width: min(100%, 27rem); }
.portada__evento figcaption { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.1rem; font-size: .85rem; opacity: .85; margin-top: .5rem; }
.leyenda::before { content: ""; display: inline-block; width: 1.1rem; height: 2px; vertical-align: middle; margin-right: .4rem; }
.leyenda--muon::before { background: var(--cian); }
.leyenda--hadron::before { background: var(--ambar); }

/* Colisión: detector, depósitos de energía y trazas que se dibujan al cargar */
.evento { display: block; width: 100%; height: auto; overflow: visible; }
.evento__detector circle, .evento__detector path { fill: none; stroke: rgba(238,240,247,.22); stroke-width: 1; }
.evento__detector .evento__capa { stroke-dasharray: 1.5 3; stroke: rgba(238,240,247,.18); }
.evento__detector .evento__cal { stroke: rgba(238,240,247,.14); }
.evento__detector .evento__camara { fill: rgba(76,201,240,.04); stroke: rgba(76,201,240,.25); }
.evento__vertice { fill: #fff; }
.dep { stroke: none; opacity: 0; animation: aparecer .6s ease-out 1.2s forwards; }
.dep--ecal { fill: #ffd27a; }
.dep--hcal { fill: rgba(245,165,36,.55); }
.dep--muon { fill: var(--cian); }
.traza { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: trazar 1.1s ease-out forwards; }
.traza--muon { stroke: var(--cian); stroke-width: 2.2; }
.traza--hadron { stroke: var(--ambar); }
.traza--blanda { stroke: rgba(245,165,36,.55); stroke-width: 1.1; }
@keyframes trazar { to { stroke-dashoffset: 0; } }
@keyframes aparecer { to { opacity: .95; } }

/* Diagramas sobre fondo oscuro */
.portada .fd, .titular .fd { --fd-fermion: #e6e8ef; --fd-boson: var(--cian); --fd-escalar: var(--ambar); }

/* Iconos de perfiles */
.redes { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; }
.redes--portada .red { color: var(--sobre-noche); background: rgba(255,255,255,.08); padding: .45rem; border-radius: 50%; }
.redes--portada .red:hover { background: rgba(255,255,255,.18); }
.redes--pie { margin-top: .75rem; }
.redes--pie .red { color: var(--sobre-noche); opacity: .8; }
.redes--pie .red:hover { opacity: 1; }
.red { display: inline-flex; padding: 2px; border-radius: 6px; color: var(--tenue); transition: transform .15s, background .15s; }
.red:hover { transform: translateY(-1px); }
.red__icono { width: 22px; height: 22px; display: block; }

/* ---------- Presentación ---------- */
.intro { display: grid; gap: 1.5rem 2.5rem; padding-top: 3rem; font-size: 1.1rem; }
@media (min-width: 46rem) { .intro { grid-template-columns: 10rem 1fr; } }
.intro__foto { width: 10rem; height: 10rem; border-radius: 50%; object-fit: cover; border: 3px solid var(--superficie); box-shadow: 0 0 0 2px var(--acento); }
.intro p { max-width: 50rem; margin-top: 0; }
.metricas { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 .25rem; }
.metricas div { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: .6rem 1.1rem; min-width: 8rem; }
.metricas dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tenue); }
.metricas dd { margin: 0; font: 600 1.7rem/1.2 var(--serif); color: var(--acento); }
.metricas__nota { font-size: .85rem; margin: 0; }
.metricas--banda { margin-top: 0; }

/* ---------- Titular de páginas interiores ---------- */
.titular { position: relative; overflow: hidden; color: var(--sobre-noche); padding: 2.5rem 0 2rem;
  background: linear-gradient(160deg, var(--noche), var(--noche-2)); }
/* Al fondo, un fotón y un escalar que cruzan el titular */
.titular::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120'%3E%3Cpath d='M180 120 L260 60 L400 60' fill='none' stroke='%23eef0f7' stroke-width='1.2'/%3E%3Cpath d='M260 60 Q265 50 270 60 T280 60 T290 60 T300 60 T310 60 T320 60' fill='none' stroke='%234cc9f0' stroke-width='1.2' transform='rotate(-35 260 60)'/%3E%3Cpath d='M260 60 L340 120' fill='none' stroke='%23f5a524' stroke-width='1.2' stroke-dasharray='5 4'/%3E%3Ccircle cx='260' cy='60' r='2.5' fill='%23eef0f7'/%3E%3C/svg%3E") right center / auto 100% no-repeat; }
.titular .contenedor { position: relative; z-index: 1; }
.titular p { margin: 0; opacity: .85; max-width: 46rem; }
.titular a { color: #ffd27a; }

/* ---------- Tarjetas de líneas ---------- */
.tarjetas { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.tarjeta { display: flex; flex-direction: column; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.25rem 1.5rem 1.5rem; color: inherit; text-decoration: none; transition: border-color .2s, transform .2s; }
.tarjeta:hover { border-color: var(--acento); transform: translateY(-2px); }
.tarjeta p { margin: .25rem 0 0; color: var(--tenue); font-size: .97rem; }
.tarjeta__diagrama { padding: .5rem .5rem 1rem; margin-bottom: .75rem; border-bottom: 1px dashed var(--borde); }
.tarjeta__diagrama .fd { max-height: 7.5rem; }

.linea { display: grid; gap: 1rem 2rem; padding: 2rem 0; border-bottom: 1px solid var(--borde); scroll-margin-top: 5rem; }
@media (min-width: 46rem) { .linea { grid-template-columns: 13rem 1fr; } }
.linea h2 { margin-top: 0; }
.linea__diagrama { margin: 0; padding: 1rem; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); align-self: start; max-width: 18rem; }
.linea__lista { padding-left: 1.2rem; }
.linea__lista li { margin: .35rem 0; }
.linea__lista li::marker { color: var(--acento); }

/* Página Investigación: líneas a la izquierda, colaboraciones a la derecha */
.investigacion { display: grid; gap: 2rem 3rem; }
@media (min-width: 60rem) {
  .investigacion { grid-template-columns: 1fr 15rem; align-items: start; }
  .colaboraciones { position: sticky; top: 5.5rem; }
}
.colaboraciones { padding-top: 2rem; }
.colaboraciones h2 { margin-top: 0; }
.colaboraciones ul { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 1rem; }
/* Fondo blanco fijo: los logos suelen estar pensados para fondo claro, también en modo oscuro */
.colaboracion { display: block; height: 7.5rem; padding: 1rem 1.25rem; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); transition: border-color .2s, transform .2s; }
.colaboracion:hover, .colaboracion:focus-visible { border-color: var(--acento); transform: translateY(-2px); }
.colaboracion img { display: block; width: 100%; height: 100%; object-fit: contain; }
.colaboracion--texto { height: auto; display: grid; place-items: center; text-align: center; color: var(--noche); font: 600 1.1rem/1.25 var(--serif); text-decoration: none; min-height: 5rem; }

.dos-columnas { display: grid; gap: 0 3rem; }
@media (min-width: 52rem) {
  .dos-columnas { grid-template-columns: 1fr 1fr; }
  .dos-columnas--ancha { grid-template-columns: 1.6fr 1fr; }
}

/* ---------- Noticias ---------- */
.noticia-breve { padding: .75rem 0; border-bottom: 1px solid var(--borde); }
.noticia-breve h3 { margin: .15rem 0 0; }
.noticia-breve a { color: inherit; text-decoration: none; }
.noticia-breve a:hover { color: var(--enlace); text-decoration: underline; }
time { color: var(--tenue); font-size: .88rem; }
.noticia { padding: 2rem 0; border-bottom: 1px solid var(--borde); scroll-margin-top: 5rem; }
.noticia h2 { margin-top: .25rem; }

/* ---------- Publicaciones ---------- */
.filtros { display: flex; flex-wrap: wrap; gap: .4rem; margin: 2rem 0 0; }
.filtro { font: inherit; font-size: .9rem; cursor: pointer; padding: .3rem .85rem; border-radius: 999px; border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); }
.filtro[aria-pressed="true"] { background: var(--noche); color: #fff; border-color: var(--noche); }
@media (prefers-color-scheme: dark) { .filtro[aria-pressed="true"] { background: var(--acento); color: #1a1205; border-color: var(--acento); } }
.anios { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 0; }
.anios a { padding: .2rem .75rem; border: 1px solid var(--borde); border-radius: 999px; text-decoration: none; font-size: .9rem; background: var(--superficie); }
.apartado { scroll-margin-top: 5rem; }
.apartado > h2 { border-bottom: 1px solid var(--borde); padding-bottom: .4rem; }
.anio { font-size: 1.05rem; color: var(--acento); font-family: var(--mono); font-weight: 600; margin: 1.5rem 0 0; }
.pubs { list-style: none; padding: 0; margin: 0; }
.pub { padding: .9rem 0; border-bottom: 1px solid var(--borde); display: grid; gap: .15rem; }
.pub__titulo { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; }
.pub__autores { color: var(--tenue); font-size: .92rem; }
.pub__autores strong { color: var(--texto); }
.pub__datos { font-size: .9rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; }
.etiqueta { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; background: var(--borde); padding: .05rem .5rem; border-radius: 4px; }
.citas { color: var(--acento); font-weight: 600; text-decoration: none; }
.citas::before { content: "↗ "; }

/* ---------- Trayectoria: una línea de fermión con un vértice por etapa ---------- */
.propagador { list-style: none; margin: 2.5rem 0 0; padding: 0 0 0 1.75rem; position: relative; }
.propagador::before { content: ""; position: absolute; left: .45rem; top: .6rem; bottom: .6rem; width: 2px; background: var(--texto); opacity: .75; }
.propagador__vertice { position: relative; padding: 0 0 1.75rem; display: grid; gap: .1rem 1.5rem; }
@media (min-width: 40rem) { .propagador__vertice { grid-template-columns: 8rem 1fr; } }
.propagador__vertice::before { content: ""; position: absolute; left: -1.75rem; top: .45rem; width: .75rem; height: .75rem; margin-left: .1rem; border-radius: 50%; background: var(--fondo); border: 2px solid var(--texto); }
.propagador__vertice--actual::before { background: var(--acento); border-color: var(--acento); box-shadow: 0 0 0 4px color-mix(in srgb, var(--acento) 25%, transparent); }
/* Flechas de fermión entre vértices */
.propagador__vertice:not(:last-child)::after { content: ""; position: absolute; left: calc(-1.75rem + .2rem); bottom: .55rem; border: .3rem solid transparent; border-top: .45rem solid var(--texto); opacity: .75; }
.propagador__periodo { font-family: var(--mono); font-size: .9rem; color: var(--acento); font-weight: 600; padding-top: .1rem; }
.propagador p { margin: 0; }
.propagador__detalle p { margin: .35rem 0 0; font-size: .95rem; }

/* ---------- Contacto ---------- */
.destacado { font-size: 1.3rem; }
address { font-style: normal; }
.perfiles { list-style: none; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.perfiles .red { gap: .6rem; align-items: center; color: var(--texto); text-decoration: none; padding: .45rem .7rem; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie); width: 100%; }
.perfiles .red:hover { border-color: var(--acento); }

/* ---------- Pie ---------- */
.pie { background: var(--noche); color: var(--sobre-noche); padding: 2.5rem 0 1rem; margin-top: 3rem; font-size: .93rem; }
.pie a { color: #ffd27a; }
.pie__fila { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.pie__logos { display: flex; gap: 1.5rem; align-items: center; }
.pie__logos img { display: block; height: 3.2rem; width: auto; }
.pie__logos a + a img { height: 4rem; }
.pie__nota { opacity: .6; font-size: .82rem; margin-top: 2rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .traza, .dep, .portada__paquetes { animation: none !important; stroke-dashoffset: 0; opacity: 1; }
}

/* Estancias: más pequeñas y sangradas, unidas a la línea principal por un trazo
   discontinuo, como un escalar emitido desde el propagador */
.estancias { list-style: none; margin: .9rem 0 0; padding: 0; grid-column: 1 / -1; }
.estancia { position: relative; display: grid; gap: .1rem 1.25rem; margin-left: 2.5rem; padding: .55rem .9rem; font-size: .9rem;
  border-left: 2px dashed var(--acento); background: color-mix(in srgb, var(--acento) 6%, transparent); border-radius: 0 var(--radio) var(--radio) 0; }
@media (min-width: 40rem) { .estancia { grid-template-columns: 5.5rem 1fr; margin-left: 4rem; } }
.estancia::before { content: ""; position: absolute; top: 1.05rem; right: 100%; width: calc(2.5rem + 1.75rem - .55rem); border-top: 2px dashed var(--acento); }
@media (min-width: 40rem) { .estancia::before { width: calc(4rem + 1.75rem - .55rem); } }
.estancia h3 { font-size: 1rem; }
.estancia .propagador__periodo { font-size: .82rem; }
