:root {
  --azul: #0a3d91;          /* azul riso del anuario */
  --azul-osc: #071f4f;
  --rosa: #ff3d9a;          /* rosa fluor */
  --rosa-suave: rgba(255, 61, 154, .28);
  --papel: #f6f3ec;
  --tinta: #0b0b12;
  --gris: #9aa6c4;
  --barra: 56px;
  --pie: 84px;
  --tit: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --txt: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(120% 90% at 50% 40%, #0f4bb0 0%, var(--azul) 45%, var(--azul-osc) 100%);
  color: #fff; font-family: var(--txt); overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

/* grano de risografia */
.grano {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- barra superior ---------- */
.barra {
  position: fixed; top: 0; left: 0; right: 0; height: var(--barra); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.22);
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em;
}
.marca { display: flex; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.marca-b { color: var(--rosa); }
.acciones { display: flex; gap: 4px; }
.acciones a { text-decoration: none; color: inherit; }
.acciones button, .acciones a {
  display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border-radius: 18px;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  transition: background .2s, color .2s;
}
.acciones button:hover, .acciones a:hover, .acciones button[aria-pressed="true"] { background: var(--rosa); color: var(--tinta); }
.acciones a:focus-visible, .acciones button:focus-visible, .flecha:focus-visible, .regla:focus-visible { outline: 2px solid var(--rosa); outline-offset: 2px; }

/* ---------- escena y libro ---------- */
.escena {
  position: fixed; top: var(--barra); bottom: var(--pie); left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
.libro-caja { position: relative; filter: drop-shadow(0 30px 40px rgba(0,0,20,.55)); }
#libro { margin: 0 auto; }
.pg { background: var(--papel); overflow: hidden; }
.pg img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.pg .hs { position: absolute; inset: 0; }
.pg .hs a, .pg .hs button {
  position: absolute; display: block; border-radius: 2px; cursor: pointer;
  background: transparent; box-shadow: inset 0 -2px 0 transparent; transition: background .15s, box-shadow .15s;
}
.pg .hs .m:hover, .pg .hs .m:focus-visible { background: var(--rosa-suave); box-shadow: inset 0 -2px 0 var(--rosa); outline: none; }
.pg .hs .s:hover { background: rgba(10, 61, 145, .10); box-shadow: inset 3px 0 0 var(--rosa); }
/* anuncios: toda la pagina lleva a la web del patrocinador, sin nada encima */
.pg .hs .ad, .pg .hs .ad:hover, .pg .hs .ad:focus { border-radius: 0; background: transparent !important; box-shadow: none !important; outline: none; }
body.ver-enlaces .pg .hs .m { background: rgba(255, 61, 154, .16); box-shadow: inset 0 -2px 0 var(--rosa); }
body.ver-enlaces .pg .hs .m:hover { background: rgba(255, 61, 154, .38); }
body.ver-enlaces .pg .hs .s { box-shadow: inset 3px 0 0 var(--rosa); }
@keyframes latido { 50% { background: rgba(255,61,154,.45); } }
.pg .hs .m.foco { animation: foco 1.2s ease-out 2; }
@keyframes foco { 0% { background: rgba(255,61,154,.75); } 100% { background: transparent; } }

.flecha {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); transition: background .2s, color .2s, opacity .2s;
}
.flecha svg { width: 22px; height: 22px; }
.flecha:hover { background: var(--rosa); color: var(--tinta); border-color: var(--rosa); }
.flecha.izq { left: 18px; } .flecha.der { right: 18px; }
.flecha[disabled] { opacity: .2; pointer-events: none; }

.aviso {
  position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--tinta); color: #fff; padding: 9px 14px; font: 12px var(--mono); letter-spacing: .05em; transition: .25s;
}
.aviso.ver { opacity: 1; transform: translate(-50%, 0); }

/* ---------- pie: regla de paginas ---------- */
.pie {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--pie); z-index: 20;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 2.2fr) auto; align-items: center; gap: 22px;
  padding: 0 22px; border-top: 1px solid rgba(255,255,255,.22);
}
.leyendo { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.leyendo .tipo { font: 600 10px var(--mono); letter-spacing: .1em; color: var(--rosa); text-transform: uppercase; }
.leyendo .tit { font: 800 15px/1.05 var(--tit); font-stretch: 62%; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.regla { position: relative; height: 34px; cursor: pointer; touch-action: none; }
.tramos { position: absolute; left: 0; right: 0; top: 14px; height: 6px; display: flex; gap: 2px; }
.tramos i { display: block; height: 100%; background: rgba(255,255,255,.28); position: relative; }
.tramos i.bloque { background: rgba(255,61,154,.55); }
.tramos i b { position: absolute; top: -14px; left: 0; font: 600 9px var(--mono); color: rgba(255,255,255,.7); font-style: normal; }
.cursor { position: absolute; top: 8px; height: 18px; width: 3px; background: var(--rosa); box-shadow: 0 0 0 3px rgba(255,61,154,.25); transition: left .3s; }
.globo {
  position: absolute; bottom: 40px; width: 86px; transform: translateX(-50%); opacity: 0; pointer-events: none;
  transition: opacity .15s; background: #fff; padding: 3px; box-shadow: 0 10px 24px rgba(0,0,0,.4);
}
.globo img { display: block; width: 100%; aspect-ratio: 210/297; object-fit: cover; background: var(--papel); }
.globo span { display: block; text-align: center; color: var(--tinta); font: 600 10px var(--mono); padding-top: 3px; }
.regla:hover .globo { opacity: 1; }
.contador { font: 600 12px var(--mono); letter-spacing: .08em; white-space: nowrap; }

/* ---------- paneles ---------- */
.panel {
  position: fixed; top: var(--barra); bottom: var(--pie); z-index: 30; width: min(430px, 100vw);
  background: var(--papel); color: var(--tinta); display: flex; flex-direction: column;
  box-shadow: 0 0 60px rgba(0,0,0,.45); animation: entra .28s cubic-bezier(.2,.8,.2,1);
}
.panel.lado { left: 0; } .panel.ficha { right: 0; animation-name: entra-d; }
@keyframes entra { from { transform: translateX(-30px); opacity: 0; } }
@keyframes entra-d { from { transform: translateX(30px); opacity: 0; } }
.panel-cab { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1.5px solid var(--tinta); }
.panel-cab h2 { margin: 0; font: 900 34px/1 var(--tit); font-stretch: 62%; text-transform: uppercase; color: var(--azul); }
.cerrar { font-size: 28px; line-height: 1; width: 36px; height: 36px; border-radius: 50%; }
.cerrar:hover { background: var(--rosa); }
.panel-cuerpo { overflow: auto; padding: 8px 20px 30px; }

/* indice */
.ind-bloque { margin-top: 18px; }
.ind-bloque > button:first-child { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; margin-bottom: 4px; }
.ind-bloque .n { font: 900 46px/.8 var(--tit); font-stretch: 62%; color: var(--azul); }
.ind-bloque .nb { font: 900 22px/1 var(--tit); font-stretch: 62%; text-transform: uppercase; }
.ind-bloque > button:first-child:hover .nb { color: var(--rosa); }
.ind-art { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; width: 100%; text-align: left; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.14); }
.ind-art:hover .t { color: var(--azul); }
.ind-art .tp { grid-column: 1 / -1; font: 600 9.5px var(--mono); letter-spacing: .1em; color: #b0126a; text-transform: uppercase; }
.ind-art .t { font: 600 14px/1.25 var(--txt); }
.ind-art .pp { font: 600 11px var(--mono); align-self: start; }
.ind-art .caras { grid-column: 1 / -1; display: flex; gap: 4px; }
.ind-art .caras img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.ind-art.activo { background: linear-gradient(90deg, rgba(255,61,154,.16), transparent); }

/* ficha */
.ficha-foto { position: relative; margin: 14px 0 10px; aspect-ratio: 1; max-width: 240px; }
.ficha-foto img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }
.ficha-foto::before { content: ""; position: absolute; inset: 0; transform: translate(10px, 10px); background: var(--rosa); }
.ficha-ini { width: 120px; height: 120px; margin: 14px 0 10px; display: grid; place-items: center; background: var(--azul); color: #fff; font: 900 48px var(--tit); font-stretch: 62%; box-shadow: 8px 8px 0 var(--rosa); }
.ficha h3 { margin: 14px 0 4px; font: 900 40px/.92 var(--tit); font-stretch: 62%; text-transform: uppercase; color: var(--azul); }
.ficha .cargo { font: 600 15px/1.35 var(--txt); margin: 6px 0 0; }
.ficha .org { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #b0126a; margin-top: 4px; }
.botones { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1.5px solid var(--tinta);
  font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--tinta); text-decoration: none;
  transition: background .15s, color .15s, transform .15s;
}
.btn:hover { background: var(--tinta); color: #fff; transform: translateY(-1px); }
.btn.li { background: #0a66c2; border-color: #0a66c2; color: #fff; }
.btn.is { background: var(--rosa); border-color: var(--rosa); }
.btn svg { width: 15px; height: 15px; }
.ficha h4 { margin: 24px 0 8px; font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; border-top: 1.5px solid var(--tinta); padding-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 10px; border: 1px solid rgba(0,0,0,.3); border-radius: 14px; font: 600 11px var(--mono); color: var(--tinta); text-decoration: none; }
.chip:hover { background: var(--azul); color: #fff; border-color: var(--azul); }
.noticia { display: block; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.12); color: var(--tinta); text-decoration: none; font: 600 14px/1.3 var(--txt); }
.noticia::after { content: " ↗"; color: #b0126a; }
.noticia:hover { color: var(--azul); }
.nota { font: 12px/1.4 var(--txt); color: #555; margin-top: 8px; }

/* capas a pantalla completa */
.capa {
  position: fixed; inset: var(--barra) 0 var(--pie) 0; z-index: 30; background: rgba(7, 20, 60, .96);
  backdrop-filter: blur(6px); display: flex; flex-direction: column; animation: aparece .25s ease-out;
}
@keyframes aparece { from { opacity: 0; } }
.capa-cab { display: flex; align-items: center; gap: 20px; padding: 18px 28px; border-bottom: 1px solid rgba(255,255,255,.2); }
.capa-cab h2 { margin: 0; font: 900 44px/1 var(--tit); font-stretch: 62%; text-transform: uppercase; color: var(--rosa); }
.capa-cab .cerrar { margin-left: auto; color: #fff; }
.capa-cab .cerrar:hover { color: var(--tinta); }
.filtros { display: flex; gap: 6px; flex-wrap: wrap; }
.filtros button { padding: 6px 11px; border: 1px solid rgba(255,255,255,.35); border-radius: 15px; font: 600 11px var(--mono); }
.filtros button.on, .filtros button:hover { background: var(--rosa); color: var(--tinta); border-color: var(--rosa); }
.rejilla { overflow: auto; padding: 26px 28px 40px; display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 26px 20px; }
.persona { display: block; text-align: left; align-self: start; }
.persona .f { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--azul); }
.persona .f img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15); mix-blend-mode: luminosity; transition: .35s; }
.persona .f::after { content: ""; position: absolute; inset: 0; background: var(--azul); mix-blend-mode: screen; opacity: .55; transition: .35s; }
.persona:hover .f img { filter: none; mix-blend-mode: normal; transform: scale(1.04); }
.persona:hover .f::after { opacity: 0; }
.persona .f .ini { position: absolute; inset: 0; display: grid; place-items: center; font: 900 56px var(--tit); font-stretch: 62%; color: var(--rosa); }
.persona .nm { display: block; margin-top: 10px; font: 900 21px/.95 var(--tit); font-stretch: 62%; text-transform: uppercase; }
.persona:hover .nm { color: var(--rosa); }
.persona .cg { display: block; margin-top: 5px; font: 12px/1.3 var(--txt); color: #c9d3ee; }
.persona .bq { display: inline-block; margin-top: 7px; font: 600 10px var(--mono); color: var(--rosa); letter-spacing: .08em; }

/* buscador */
#q { flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 2px solid var(--rosa); color: #fff; font: 900 34px var(--tit); font-stretch: 62%; text-transform: uppercase; padding: 6px 0; outline: none; }
#q::placeholder { color: rgba(255,255,255,.35); }
.resultados { overflow: auto; padding: 10px 28px 40px; }
.res { display: grid; grid-template-columns: 64px 1fr; gap: 16px; width: 100%; text-align: left; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.14); }
.res img { width: 64px; aspect-ratio: 210/297; object-fit: cover; background: var(--papel); }
.res .p { font: 600 11px var(--mono); color: var(--rosa); letter-spacing: .08em; }
.res .a { font: 800 16px/1.1 var(--tit); font-stretch: 70%; text-transform: uppercase; margin: 3px 0 6px; }
.res .x { font: 14px/1.45 var(--txt); color: #d7def2; }
.res mark { background: var(--rosa); color: var(--tinta); padding: 0 2px; }
.res:hover .a { color: var(--rosa); }
.res.ent { grid-template-columns: 64px 1fr; }
.res.ent img { aspect-ratio: 1; border-radius: 50%; }
.vacio { padding: 30px 0; font: 13px var(--mono); color: #c9d3ee; }

/* intro */
.intro {
  position: fixed; inset: 0; z-index: 50; background: var(--azul); display: flex; align-items: center; justify-content: center; gap: 6vw;
  transition: opacity .6s .2s, visibility .8s;
}
.intro.fuera { opacity: 0; visibility: hidden; }
.intro-num { display: flex; flex-direction: column; align-items: center; }
.intro-num b { font: 900 clamp(60px, 11vw, 150px)/.85 var(--tit); font-stretch: 62%; color: #fff; }
.intro-num:nth-child(2n) b { color: var(--rosa); }
.intro-num span { font: 600 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; margin-top: 10px; }

/* ---------- movil ---------- */
@media (max-width: 860px) {
  :root { --barra: 52px; --pie: 70px; }
  .marca-b, .acciones button span, .acciones a span { display: none; }
  .marca { font-size: 11px; }
  .acciones button, .acciones a { padding: 0 9px; }
  .pie { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 0 16px; }
  .leyendo { display: none; }
  .flecha { display: none; }
  .capa-cab h2 { font-size: 32px; }
  .capa-cab { flex-wrap: wrap; padding: 14px 16px; gap: 12px; }
  .rejilla { padding: 16px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; }
  .resultados { padding: 6px 16px 30px; }
  #q { font-size: 26px; }
  .intro { gap: 4vw; flex-wrap: wrap; align-content: center; }
}
@media (max-width: 520px) {
  .marca-a { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
