/* El micrositio del libro (inc/libro-sitio.php): los libros que se recorren, las partes, el autor y la compra. */

body.gr-libro-sitio { background: var(--vacio, #0a0a0a); color: var(--polvo, #e8e8e4); margin: 0; }
.gls { --gls-g: max(16px, 4vw); overflow-x: clip; }
.gls-mono { font-family: var(--fuente-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--polvo-2, #9d9d97); }
.gls h1, .gls h2 { font-family: var(--fuente-display); font-weight: 800; text-transform: uppercase; line-height: .86; margin: 0; letter-spacing: -.005em; }

/* ── los botones ── */
.gls-boton { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 1px solid currentColor; color: inherit; text-decoration: none; font-family: var(--fuente-display); font-weight: 700; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; transition: background .2s, color .2s, border-color .2s; }
.gls-boton:hover { background: var(--polvo); color: var(--vacio); }
.gls-boton--senal { background: var(--senal, #63cb01); border-color: var(--senal); color: var(--vacio); }
.gls-boton--senal:hover { background: var(--polvo); border-color: var(--polvo); }

/* ── la cabecera: logo, menú y comprar ── */
.gls-cab { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; gap: 24px; padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, 3vw) 14px; background: linear-gradient(rgba(10, 10, 10, .92), rgba(10, 10, 10, 0)); }
.gls-logo.gls-logo img { height: 34px; width: auto; display: block; }
.gls-menu { display: flex; gap: 22px; margin-inline: auto; }
.gls-menu a { color: var(--polvo); text-decoration: none; font-family: var(--fuente-display); font-weight: 700; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; transition: opacity .2s, color .2s; }
.gls-menu a:hover { opacity: 1; color: var(--senal); }
.gls-cab .gls-boton { min-height: 38px; font-size: 15px; }

/* ── la entrada quieta (sin puntos): el texto y los libros, grandes; al bajar se sigue derecho ── */
.gls-entrada { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); align-items: center; gap: clamp(16px, 3vw, 48px); min-height: calc(100svh - var(--alto-cabecera, 72px) - 120px); padding: clamp(28px, 4vw, 56px) var(--gls-g); background: radial-gradient(ellipse at 66% 50%, #17220f 0%, var(--vacio) 62%); overflow: hidden; }
.gls-entrada h1 { font-size: clamp(44px, min(5.6vw, 9.5vh), 104px); margin: 14px 0 16px; }
.gls-entrada__libros { display: flex; justify-content: center; }
.gls-entrada__libros.gls-entrada__libros img { width: min(100%, 860px); height: auto; display: block; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .55)); }

/* ── el recorrido: un escenario fijo mientras se baja ── */
.gls-recorrido { position: relative; height: calc((var(--pasos) + 1.6) * 100vh); }
.gls-escenario { position: sticky; top: 0; height: 100vh; overflow: hidden; display: grid; place-items: center; background: radial-gradient(ellipse at 62% 48%, #17220f 0%, var(--vacio) 64%); }
.gls-escenario::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5; opacity: .45; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); }

/* Todo cabe en la pantalla: el título se mide por el alto, no solo por el ancho. */
.gls-hero { position: absolute; left: max(16px, 5vw); top: calc(50% + 24px); transform: translateY(-50%); width: min(42vw, 640px); z-index: 3; will-change: opacity; }
.gls-hero h1 { font-size: clamp(44px, min(6.4vw, 10.5vh), 112px); margin: 14px 0 16px; }
.gls-bajada { font-size: clamp(17px, min(1.4vw, 2.6vh), 22px); line-height: 1.4; margin: 0 0 8px; color: var(--polvo); }
.gls-ficha { margin: 0 0 22px; }
.gls-acciones { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* Los libros: la imagen con su sombra; se inclinan con el cursor y se acercan al bajar. */
.gls-tapa-marco { position: relative; z-index: 2; width: min(70vw, 118vh); aspect-ratio: 4 / 3; perspective: 1400px; will-change: transform; }
.gls-tapa { position: absolute; inset: 0; transform-origin: 50% 50%; will-change: transform; }
.gls-tapa.gls-tapa img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }

/* Los puntos: pequeños, y no crecen con el zoom (libro-sitio.js los compensa con --contra). */
.gls-punto { position: absolute; z-index: 2; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; border: 1px solid rgba(10, 10, 10, .6); background: var(--polvo); color: var(--vacio); font-family: var(--fuente-mono); font-size: 9.5px; line-height: 1; letter-spacing: 0; cursor: pointer; padding: 0; transform: scale(var(--contra, 1)); transition: background .2s, color .2s, box-shadow .3s; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.gls-punto::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid rgba(232, 232, 228, .45); animation: gls-latido 2.4s ease-out infinite; }
@keyframes gls-latido { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.gls-punto:hover, .gls-punto.es-activo { background: var(--senal); box-shadow: 0 0 0 6px rgba(99, 203, 1, .22); }
.gls-punto:focus-visible { outline: 2px solid var(--senal); outline-offset: 3px; }

/* Las tarjetas: aparecen junto al punto en foco y llevan a su parte. */
.gls-tarjeta { position: absolute; z-index: 6; left: calc(50% + 60px); top: 50%; width: min(380px, 82vw); padding: 22px 24px 18px; background: var(--polvo); color: var(--vacio); text-decoration: none; display: flex; flex-direction: column; gap: 10px; transform: translateY(-50%) rotate(-1.2deg) translateX(14px); opacity: 0; pointer-events: none; transition: opacity .35s ease, transform .45s cubic-bezier(.2, .7, .1, 1), box-shadow .3s; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.gls-tarjeta::after { content: ""; position: absolute; right: 0; top: 0; border-width: 0 22px 22px 0; border-style: solid; border-color: transparent var(--vacio) #c9c9c3 transparent; }
.gls-tarjeta--izq { left: auto; right: calc(50% + 60px); transform: translateY(-50%) rotate(1.2deg) translateX(-14px); }
.gls-tarjeta.es-visible { opacity: 1; pointer-events: auto; transform: translateY(-50%) rotate(-1.2deg); }
.gls-tarjeta--izq.es-visible { transform: translateY(-50%) rotate(1.2deg); }
.gls-tarjeta.es-visible:hover { transform: translateY(calc(-50% - 4px)) rotate(0deg); box-shadow: 0 24px 50px rgba(0, 0, 0, .55); }
.gls-tarjeta .gls-mono { color: #55554f; }
.gls-tarjeta__titulo { font-family: var(--fuente-display); font-weight: 800; font-size: 38px; line-height: .9; text-transform: uppercase; }
.gls-tarjeta__cita { font-size: 19px; line-height: 1.4; }
.gls-tarjeta__pie { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 10px; border-top: 1px solid rgba(10, 10, 10, .15); }
.gls-tarjeta__ir { font-family: var(--fuente-display); font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; transition: color .2s, transform .2s; }
.gls-tarjeta:hover .gls-tarjeta__ir { color: #3f8f00; transform: translateX(4px); }
.gls-fuente { display: block; }

.gls-progreso { position: absolute; left: max(16px, 5vw); right: max(16px, 5vw); bottom: 18px; opacity: 0; transition: opacity .3s; height: 1px; background: rgba(232, 232, 228, .18); z-index: 6; }
.gls-progreso span { position: absolute; left: 0; top: -1px; height: 3px; width: 0; background: var(--senal); }

/* ── la cinta ── */
.gls-cinta { overflow: hidden; border-block: 1px solid rgba(232, 232, 228, .16); padding: 16px 0; white-space: nowrap; background: var(--vacio); }
.gls-cinta > div { display: inline-flex; gap: 28px; animation: gls-cinta 38s linear infinite; font-family: var(--fuente-display); font-weight: 800; font-size: clamp(22px, 2.6vw, 36px); text-transform: uppercase; }
.gls-cinta:hover > div { animation-play-state: paused; }
.gls-cinta i { color: var(--senal); font-style: normal; }
@keyframes gls-cinta { to { transform: translateX(-50%); } }

/* ── las secciones: la etiqueta a la izquierda, el título a lo ancho ── */
.gls-seccion { padding: clamp(56px, 7vw, 110px) var(--gls-g); max-width: 1480px; margin: 0 auto; box-sizing: border-box; }
.gls-cab-seccion { margin-bottom: clamp(28px, 4vw, 52px); max-width: 1100px; }
.gls-cab-seccion .gls-mono { display: block; margin-bottom: 12px; }
.gls-cab-seccion h2 { font-size: clamp(42px, 5.4vw, 88px); }
.gls-cab-seccion p { font-size: 16px; color: var(--polvo-2); margin: 14px 0 0; }

/* Las filas: el índice de una revista. Al pasar el cursor, la fila se enciende. */
.gls-filas { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(232, 232, 228, .18); }
.gls-fila { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.35fr) auto; gap: 24px; align-items: center; padding: 26px 18px 26px 0; border-bottom: 1px solid rgba(232, 232, 228, .18); transition: background .3s, padding .35s cubic-bezier(.2, .7, .1, 1); scroll-margin-top: 90px; }
.gls-fila::before { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 0; background: var(--senal); transition: width .5s cubic-bezier(.2, .7, .1, 1); }
.gls-fila:hover { background: rgba(99, 203, 1, .06); padding-left: 18px; }
.gls-fila:hover::before { width: 100%; }
.gls-fila__marca { font-family: var(--fuente-display); font-weight: 800; font-size: clamp(40px, 4.4vw, 68px); line-height: .85; color: var(--senal); text-transform: uppercase; }
.gls-fila__titulo { font-family: var(--fuente-display); font-weight: 800; font-size: clamp(24px, 2.4vw, 36px); text-transform: uppercase; line-height: .95; transition: color .25s; }
.gls-fila:hover .gls-fila__titulo { color: var(--senal); }
.gls-fila__desc { color: var(--polvo-2); font-size: 17px; line-height: 1.45; }
.gls-fila__dato { white-space: nowrap; transition: transform .3s, color .3s; }
.gls-fila:hover .gls-fila__dato { color: var(--polvo); transform: translateX(-4px); }
.gls-fila:target { background: rgba(99, 203, 1, .1); }

.gls-autor { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 100px); align-items: start; padding-top: clamp(32px, 4vw, 64px); }
.gls-autor__cita blockquote { margin: 16px 0 14px; font-family: var(--fuente-display); font-weight: 800; font-size: clamp(40px, 5vw, 80px); line-height: .9; text-transform: uppercase; }
.gls-autor__texto h2 { font-size: clamp(40px, 4.6vw, 72px); margin: 12px 0 18px; }
.gls-autor__texto p { font-size: 18px; line-height: 1.55; color: var(--polvo-2); max-width: 56ch; }

.gls-leer { text-align: center; }
.gls-leer .gls-cab-seccion { margin-inline: auto; margin-bottom: 8px; }
.gls-leer .gls-cab-seccion h2 { font-size: clamp(32px, 3.6vw, 54px); }
.gls-leer .grl { --grl-max: 340px; color: var(--polvo); }
.gls-leer .grl-btn:hover:not(:disabled) { background: var(--polvo); color: var(--vacio); }
.gls-leer .grl-sombra { opacity: .8; }

.gls-formatos { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: 20px; }
.gls-formato { display: flex; flex-direction: column; gap: 14px; padding: 28px; border: 1px solid rgba(232, 232, 228, .25); color: var(--polvo); text-decoration: none; transition: border-color .25s, transform .35s cubic-bezier(.2, .7, .1, 1); }
.gls-formato:hover { border-color: var(--senal); transform: translateY(-4px); }
.gls-formato b { font-family: var(--fuente-display); font-weight: 800; font-size: 64px; line-height: .9; }
.gls-formato small { font-size: 20px; color: var(--polvo-2); }
.gls-formato .gls-boton { align-self: flex-start; }

.gls-pie { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; padding: 40px var(--gls-g) 56px; border-top: 1px solid rgba(232, 232, 228, .16); }
.gls-pie__legal { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; font-size: 11px; }
.gls-pie__legal a { color: var(--polvo-2); text-decoration: none; }
.gls-pie__legal a:hover { color: var(--polvo); }

/* ── en el celular ── */
@media (max-width: 860px) {
	.gls-entrada { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 28px; gap: 8px; }
	.gls-entrada h1 { font-size: clamp(42px, 11.5vw, 64px); }
	.gls-entrada__libros { margin: 0 calc(-1 * var(--gls-g)); }
	.gls-entrada__libros.gls-entrada__libros img { width: 100%; }
	.gls-menu { display: none; }
	.gls-cab { justify-content: space-between; }
	.gls-hero { position: absolute; left: 16px; right: 16px; top: 88px; width: auto; transform: none; }
	.gls-hero h1 { font-size: clamp(44px, 12vw, 64px); margin: 10px 0 12px; }
	.gls-ficha { display: none; }
	.gls-tapa-marco { width: 112vw; }
	.gls-tarjeta, .gls-tarjeta--izq { left: 16px; right: 16px; top: auto; bottom: 56px; width: auto; transform: translateY(18px); }
	.gls-tarjeta.es-visible, .gls-tarjeta--izq.es-visible, .gls-tarjeta.es-visible:hover { transform: none; }
	.gls-tarjeta__titulo { font-size: 30px; }
	.gls-tarjeta__cita { font-size: 17px; }
	.gls-fila { grid-template-columns: 1fr auto; gap: 8px 14px; padding: 22px 0; }
	.gls-fila:hover { padding-left: 0; }
	.gls-fila__marca { grid-column: 1 / -1; font-size: 34px; }
	.gls-fila__titulo { grid-column: 1; }
	.gls-fila__dato { grid-column: 2; grid-row: 2; }
	.gls-fila__desc { grid-column: 1 / -1; }
	.gls-autor { grid-template-columns: 1fr; }
	.gls-formatos { grid-template-columns: 1fr; }
}

/* Sin movimiento: los libros quietos y las tarjetas en lista. */
@media (prefers-reduced-motion: reduce) {
	.gls-recorrido { height: auto; }
	.gls-escenario { position: relative; height: auto; min-height: 100vh; padding: 120px 16px 60px; display: flex; flex-direction: column; gap: 32px; }
	.gls-hero { position: static; transform: none; width: auto; }
	.gls-tarjeta { position: static; opacity: 1; transform: none; width: auto; pointer-events: auto; }
	.gls-cinta > div, .gls-punto::before { animation: none; }
}
