/* =====================================================================
   Telmo Books · una web que se pone el tiempo que hace donde estás
   Los colores llegan desde js/theme.js como variables CSS en :root.
   ===================================================================== */

@property --bg { syntax: '<color>'; inherits: true; initial-value: #F4F1EA; }
@property --bg-2 { syntax: '<color>'; inherits: true; initial-value: #EAE5DA; }
@property --fg { syntax: '<color>'; inherits: true; initial-value: #121216; }
@property --muted { syntax: '<color>'; inherits: true; initial-value: #47454F; }
@property --card { syntax: '<color>'; inherits: true; initial-value: #FFFFFF; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #FFC21F; }

:root {
  --bg: #F4F1EA;
  --bg-2: #EAE5DA;
  --fg: #121216;
  --muted: #47454F;
  --card: #FFFFFF;
  --accent: #FFC21F;
  --on-accent: #121216;
  --danger: #B42D1A;
  --line: color-mix(in srgb, var(--fg) 16%, transparent);
  --grid: color-mix(in srgb, var(--fg) 7%, transparent);
  --cell: 34px;

  --sh-x: 0px; --sh-y: 12px; --sh-blur: 30px; --sh-alpha: .18;
  --hard-x: 0px; --hard-y: 6px;

  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --body: 'Archivo', 'Helvetica Neue', Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --ease-out: cubic-bezier(.2, .9, .2, 1);
  --ease-spring: cubic-bezier(.3, 1.45, .45, 1);

  color-scheme: light;
}
:root[data-phase="night"] { --danger: #FF9580; color-scheme: dark; }
:root:not(.vt) { transition: --bg .7s, --bg-2 .7s, --fg .7s, --muted .7s, --card .7s, --accent .7s; }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); color: var(--fg); scroll-behavior: smooth; scroll-padding-top: 88px; }
html.is-locked { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 17px/1.55 var(--body);
  font-stretch: 100%;
  color: var(--fg);
  background: transparent;
  overflow-x: hidden; overflow-x: clip; /* hidden: respaldo para Safari < 16 */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
/* Juego del tiempo aparcado: fuera todo lo que depende de él */
:root[data-weather="off"] [data-w] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
#main:focus { outline: none; }
::selection { background: var(--accent); color: var(--on-accent); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; text-decoration: none; }
.skip:focus { top: 12px; }
.mono { font-family: var(--mono); }
.kicker { margin: 0; font: 600 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------------- capas */
.sky { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }
.sky--back {
  z-index: 0;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% var(--cell),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / var(--cell) 100%,
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
.gate, .site { position: relative; z-index: 1; overflow-x: hidden; overflow-x: clip; }
.lamp { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 1s;
  background: radial-gradient(circle 540px at var(--mx, 50%) var(--my, 40%), rgba(255, 214, 150, .1) 0, rgba(255, 214, 150, .035) 170px, rgba(0, 0, 0, 0) 270px, rgba(0, 0, 0, .26) 100%); }
.sky--front { z-index: 3; }
.modal { z-index: 4; }
.skylab { z-index: 5; }
.flash { position: fixed; inset: 0; z-index: 6; pointer-events: none; opacity: 0; background: #FFFFFF; }
:root[data-phase="night"] .flash { background: #DCE4FF; }
.toast { z-index: 7; }
@media (pointer: fine) {
  :root.has-pointer[data-phase="night"]:not([data-calm="true"]) .site:not([hidden]) ~ .lamp { opacity: 1; }
}

/* View Transitions: revelado circular (la animación la lanza main.js) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* ---------------------------------------------------------------- logo (máscara: la placa toma el color del texto) */
.logo {
  display: inline-block;
  flex: none;
  aspect-ratio: 3633 / 1143;
  background: var(--fg);
  -webkit-mask: url("../assets/img/logo-knockout.svg") center / contain no-repeat;
  mask: url("../assets/img/logo-knockout.svg") center / contain no-repeat;
}
.logo--xs { width: 84px; }
.logo--sm { width: 132px; }
.logo--lg { width: clamp(180px, 20vw, 260px); }
.logo--xl { width: 100%; }

/* ---------------------------------------------------------------- botones y enlaces */
.btn {
  --pad: 15px 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: .7em;
  padding: var(--pad);
  font: 700 15px/1.1 var(--display); font-stretch: 112%; letter-spacing: .005em;
  color: var(--fg); background: transparent;
  border: 2px solid var(--fg); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease-spring), box-shadow .25s var(--ease-out), background-color .2s, color .2s;
}
.btn__arrow { display: inline-block; transition: transform .3s var(--ease-spring); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn--primary { background: var(--fg); color: var(--bg); box-shadow: var(--hard-x) var(--hard-y) 0 var(--accent); }
.btn--primary:hover { transform: translate(-2px, -2px); box-shadow: calc(var(--hard-x) + 3px) calc(var(--hard-y) + 3px) 0 var(--accent); }
.btn--primary:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--accent); }
.btn--ghost:hover { background: var(--fg); color: var(--bg); }
.btn--xl { --pad: 19px 28px; font-size: 17px; }
.btn--sm { --pad: 10px 16px; font-size: 13.5px; }
.btn:disabled { cursor: progress; }

.link {
  padding: 0; background: none; border: 0; cursor: pointer;
  font: 500 15px/1.3 var(--body); color: var(--fg);
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--fg) 40%, transparent);
  transition: text-decoration-color .2s;
}
.link:hover { text-decoration-color: var(--accent); }

/* Subrayado de rotulador con el color del cielo */
.mark, .gate__title em, .hero__phrase > span, .section__title em, .about__title em, .footer__big em {
  background: linear-gradient(transparent 74%, var(--accent) 74%, var(--accent) 92%, transparent 92%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
/* De noche el texto es claro: el rotulador pasa a ser una línea fina por debajo */
:root[data-phase="night"] :is(.mark, .gate__title em, .hero__phrase > span, .section__title em, .about__title em, .footer__big em, .modal__body strong) {
  background: linear-gradient(transparent 90%, var(--accent) 90%, var(--accent) 97%, transparent 97%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* =====================================================================
   1 · PUERTA: código postal
   ===================================================================== */
.gate {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  grid-template-rows: auto 1fr;
  gap: 0 4vw;
  padding: clamp(16px, 3vw, 36px) var(--gutter);
}
.gate__top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gate__clock { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.gate__body { align-self: center; padding: 5vh 0 4vh; max-width: 680px; }
.gate__title {
  margin: 16px 0 22px;
  font: 900 clamp(46px, 8vw, 128px)/.86 var(--display);
  font-stretch: 125%;
  letter-spacing: -.04em;
  text-transform: uppercase;
}
.gate__title em { font: italic 400 1.14em/.8 var(--serif); letter-spacing: -.01em; text-transform: none; padding: 0 .04em; }
.gate__lead { margin: 0 0 34px; max-width: 30em; font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); }
.gate__fine { margin: 26px 0 0; max-width: 34em; font-size: 13px; color: var(--muted); }

.gate__window { position: relative; align-self: center; justify-self: center; width: min(40vw, 520px); aspect-ratio: 1; display: grid; place-items: center; }
.gate__window .logo--xl { width: 78%; transition: transform .8s var(--ease-spring); }
.gate__ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 40s linear infinite; }
.gate__ring text { font: 600 9.2px var(--mono); letter-spacing: 2.6px; fill: var(--fg); }
.gate:has(.cp.is-loading) .gate__window .logo--xl { transform: scale(1.06); }
.gate:has(.cp.is-loading) .gate__ring { animation-duration: 5s; }

/* Entrada de la puerta */
.gate__top, .gate__body > *, .gate__window { animation: rise .9s var(--ease-out) both; }
.gate__body > :nth-child(1) { animation-delay: .05s; }
.gate__body > :nth-child(2) { animation-delay: .12s; }
.gate__body > :nth-child(3) { animation-delay: .2s; }
.gate__body > :nth-child(4) { animation-delay: .28s; }
.gate__body > :nth-child(5) { animation-delay: .36s; }
.gate__window { animation: pop 1.1s var(--ease-spring) .25s both; }

/* Casillas del código postal (como en los sobres) */
.cp__field { position: relative; width: max-content; max-width: 100%; }
.cp__boxes { display: flex; gap: clamp(6px, 1.1vw, 12px); }
.cp__box {
  --r: 0deg;
  position: relative;
  width: clamp(52px, 7.4vw, 84px);
  aspect-ratio: .8;
  display: grid; place-items: center;
  font: 800 clamp(32px, 5vw, 56px)/1 var(--display);
  font-stretch: 125%;
  color: var(--fg);
  background: color-mix(in srgb, var(--card) 60%, transparent);
  border: 2px solid var(--fg);
  border-radius: 14px;
  transition: transform .35s var(--ease-spring), background-color .2s, color .2s, box-shadow .2s;
}
.cp__box:nth-child(odd) { --r: -2.5deg; }
.cp__box:nth-child(even) { --r: 2deg; }
.cp__box.is-filled { background: var(--fg); color: var(--bg); transform: translateY(-5px) rotate(var(--r)); box-shadow: var(--hard-x) var(--hard-y) 0 var(--accent); }
.cp__box.is-active { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 75%, transparent); }
.cp__box.is-active:not(.is-filled)::after { content: ''; width: 3px; height: 44%; background: var(--fg); border-radius: 2px; animation: caret 1s steps(1) infinite; }
.cp__input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; margin: 0;
  font-size: 16px; color: transparent; caret-color: transparent; background: transparent; cursor: text;
}
.cp__hint { min-height: 1.4em; margin: 14px 0 0; font-size: 13.5px; color: var(--muted); letter-spacing: .02em; }
.cp__hint.is-error { color: var(--danger); font-weight: 600; }
.cp__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 24px; }
.cp.is-loading .cp__box { animation: wave 1s ease-in-out infinite; }
.cp.is-loading .cp__box:nth-child(2) { animation-delay: .08s; }
.cp.is-loading .cp__box:nth-child(3) { animation-delay: .16s; }
.cp.is-loading .cp__box:nth-child(4) { animation-delay: .24s; }
.cp.is-loading .cp__box:nth-child(5) { animation-delay: .32s; }
.cp.is-loading .btn__arrow { animation: nudge .8s ease-in-out infinite; }

/* =====================================================================
   2 · MODAL: la web se pone el tiempo
   ===================================================================== */
.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.modal__scrim { position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 46%, transparent); backdrop-filter: blur(2px); opacity: 0; transition: opacity .5s; }
.modal.is-open .modal__scrim { opacity: 1; }
.modal__card {
  position: relative;
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .9fr);
  color: var(--fg);
  background: var(--card);
  border: 2px solid var(--fg);
  border-radius: 30px;
  box-shadow: calc(var(--hard-x) * 2) calc(var(--hard-y) * 2) 0 var(--fg);
  opacity: 0;
  transform: translateY(40px) rotate(-1.2deg) scale(.96);
  transition: transform .7s var(--ease-spring), opacity .45s;
}
.modal.is-open .modal__card { opacity: 1; transform: none; }
.modal.is-closing .modal__card { opacity: 0; transform: translateY(-30px) scale(.97); transition-duration: .4s; }
.modal.is-closing .modal__scrim { opacity: 0; }
.modal__copy { padding: clamp(26px, 4vw, 52px); display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.modal__title { margin: 0; font: 900 clamp(30px, 3.8vw, 54px)/.95 var(--display); font-stretch: 116%; letter-spacing: -.035em; }
.modal__title em { display: block; margin-top: .12em; font: italic 400 1.08em/1 var(--serif); letter-spacing: -.01em; color: var(--muted); }
.modal__body p { margin: 0 0 .8em; max-width: 36em; font-size: 16.5px; color: color-mix(in srgb, var(--fg) 86%, var(--card)); }
.modal__body strong { font-weight: 700; background: linear-gradient(transparent 70%, var(--accent) 70%, var(--accent) 92%, transparent 92%); }
.modal__hint { margin: 0; font-size: 13px; color: var(--muted); }
.modal__hint::before { content: '→ '; color: var(--fg); }

.dict { margin: 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--accent); }
.dict dt { font: italic 400 30px/1 var(--serif); }
.dict dt span { font: 400 12px var(--mono); font-style: normal; color: var(--muted); letter-spacing: .02em; margin-left: 6px; }
.dict dd { margin: 6px 0 0; font-size: 15px; }
.dict dd b { font-weight: 700; color: var(--muted); }

/* Ficha de préstamo del cielo */
.ticket {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: clamp(24px, 3vw, 36px);
  color: var(--on-accent);
  background: var(--accent);
  border-left: 2px dashed currentColor;
  border-radius: 0 28px 28px 0;
}
.ticket::before, .ticket::after {
  content: ''; position: absolute; left: -15px; width: 28px; height: 28px;
  border-radius: 50%; background: var(--card); border: 2px solid var(--fg);
}
.ticket::before { top: -15px; clip-path: inset(50% 0 0 0); }
.ticket::after { bottom: -15px; clip-path: inset(0 0 50% 0); }
.ticket__head { display: flex; align-items: center; gap: 10px; font-size: 11px; line-height: 1.25; letter-spacing: .12em; text-transform: uppercase; }
.ticket__head .logo { background: currentColor; }
.ticket__now { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.ticket__icon .ico { width: 64px; height: 64px; stroke-width: 1.5; }
.ticket__temp { font: 900 clamp(64px, 7vw, 96px)/.8 var(--display); font-stretch: 125%; letter-spacing: -.05em; }
.ticket__label { margin: 0; font: italic 400 34px/1 var(--serif); }
.ticket__label::first-letter { text-transform: uppercase; }
.ticket__rows { margin: 8px 0 0; font-size: 12.5px; }
.ticket__rows div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1.5px dashed color-mix(in srgb, currentColor 45%, transparent); }
.ticket__rows dt { opacity: .75; text-transform: uppercase; letter-spacing: .08em; }
.ticket__rows dd { margin: 0; text-align: right; font-weight: 600; }
.ticket__source { margin: auto 0 0; padding-top: 8px; font-size: 11px; opacity: .7; }
.ticket__stamp {
  position: absolute; right: clamp(20px, 3vw, 36px); bottom: 54px;
  width: 112px; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  font: 800 13px/1.05 var(--display); font-stretch: 125%; text-transform: uppercase; letter-spacing: .04em;
  border: 3px double currentColor; opacity: 0; rotate: -14deg;
}
.modal.is-open .ticket__stamp { animation: stamp .55s cubic-bezier(.5, 1.8, .5, 1) .75s both; }

/* =====================================================================
   3 · HOME
   ===================================================================== */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: clamp(14px, 3vw, 36px);
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1.5px solid var(--line);
}
.nav__brand { display: inline-flex; border-radius: 6px; }
.nav__brand .logo { transition: transform .5s var(--ease-spring); }
.nav__brand:hover .logo { transform: rotate(-4deg) scale(1.05); }
.nav__links { display: flex; gap: clamp(14px, 2.4vw, 34px); margin-right: auto; }
.nav__links a {
  font: 700 13px/1 var(--display); font-stretch: 118%; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; padding: 8px 0; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 3px no-repeat;
  transition: background-size .3s var(--ease-out);
}
.nav__links a:hover, .nav__links a[aria-current] { background-size: 100% 3px; }

.chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 10px;
  background: var(--card); color: var(--fg);
  border: 2px solid var(--fg); border-radius: 999px; cursor: pointer;
  box-shadow: var(--hard-x) var(--hard-y) 0 var(--accent);
  transition: transform .25s var(--ease-spring);
}
.chip:hover { transform: translateY(-2px); }
.chip__icon .ico { width: 26px; height: 26px; display: block; }
.chip__text { font-size: 14px; white-space: nowrap; }
.chip__text b { font: 800 16px var(--display); font-stretch: 120%; }
.chip__label { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; padding-left: 10px; border-left: 1.5px solid var(--line); }

/* Hero */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  gap: 26px clamp(24px, 5vw, 80px);
  min-height: calc(100svh - 80px);
  align-content: center;
  padding: clamp(40px, 7vw, 100px) var(--gutter) clamp(56px, 7vw, 110px);
}
.hero__kicker { grid-column: 1 / -1; margin: 0; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hero__kicker::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); vertical-align: 1px; animation: pulse 2.4s ease-in-out infinite; }
.hero__title {
  grid-column: 1; margin: 0;
  font: 900 clamp(46px, 7.3vw, 132px)/.86 var(--display);
  font-stretch: 125%;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.hero__title > span, .hero__phrase { display: block; }
.hero__kicker, .hero__title > *, .hero__aside { animation: rise .8s var(--ease-out) both; }
.hero__title > :nth-child(1) { animation-delay: .05s; }
.hero__title > :nth-child(2) { animation-delay: .15s; }
.hero__title > :nth-child(3) { animation-delay: .25s; }
.hero__aside { animation-delay: .35s; }
.forecast__stage { position: relative; animation: settle 1s var(--ease-spring) .1s both; }
.hero__phrase { margin: .08em 0 .06em; font: italic 400 1.1em/.9 var(--serif); letter-spacing: -.015em; text-transform: none; text-wrap: balance; }
.hero__aside { grid-column: 1; max-width: 560px; }
.hero__lead { margin: 0 0 24px; font-size: clamp(17px, 1.4vw, 20px); color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.forecast { grid-column: 2; grid-row: 2 / span 2; align-self: center; justify-self: center; position: relative; width: min(100%, 380px); margin: 0; }
/* Sin el juego del tiempo no hay línea encima del titular: el libro empieza a la altura del título */
:root[data-weather="off"] .forecast { grid-row: 1 / span 3; }
.forecast__book { position: relative; z-index: 1; rotate: 3.5deg; animation: float 7s ease-in-out 1.2s infinite; }
/* Disco amarillo detrás del libro (el mismo que en la ficha), con su aro que gira despacio */
.forecast__disc {
  position: absolute; left: 50%; top: 50%; z-index: 0;
  width: 124%; aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--fg);
}
.forecast__disc::after { content: ''; position: absolute; inset: 6%; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--fg) 40%, transparent); animation: spin 70s linear infinite; }
.forecast__sticker {
  position: absolute; z-index: 3; top: -38px; left: -42px;
  width: 132px; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--on-accent); background: var(--accent); border: 2px solid var(--fg);
  rotate: -12deg;
}
.forecast__sticker svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 22s linear infinite; }
.forecast__sticker text { font: 700 12.5px var(--mono); letter-spacing: 2.3px; fill: currentColor; }
.forecast__sticker > span { font: 900 25px/1 var(--display); font-stretch: 125%; letter-spacing: -.04em; }
/* «Próximamente…» bajo el libro de la portada: tarjeta con el título y unos puntos que esperan */
.forecast__cap {
  position: relative; z-index: 2;
  display: grid; justify-items: start; gap: 6px;
  width: fit-content; margin: 30px 0 0 -14px; padding: 14px 22px 16px;
  background: var(--card); border: 2px solid var(--fg); border-radius: 16px;
  box-shadow: 6px 6px 0 var(--fg); rotate: -2.5deg;
}
.forecast__what { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.forecast__soon { font: italic 400 clamp(30px, 2.6vw, 40px)/1 var(--serif); letter-spacing: -.01em; }
.forecast__soon .dots i { font-style: normal; display: inline-block; animation: dot 1.4s ease-in-out infinite; }
.forecast__soon .dots i:nth-child(2) { animation-delay: .18s; }
.forecast__soon .dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dot { 0%, 60%, 100% { translate: 0 0; opacity: 1; } 30% { translate: 0 -.18em; opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .forecast__soon .dots i { animation: none; } }
#forecast-line { font: italic 400 22px/1.15 var(--serif); } /* solo en el juego del tiempo */

/* Libro (cubierta con lomo, sombra según el sol e inclinación 3D) */
.book {
  --tx: 0; --ty: 0;
  position: relative; display: block;
  border-radius: 3px 9px 9px 3px;
  transform: perspective(1000px) rotateY(calc(var(--tx) * 16deg)) rotateX(calc(var(--ty) * -12deg));
  transition: transform .4s var(--ease-out), box-shadow .5s;
  box-shadow:
    var(--sh-x) var(--sh-y) var(--sh-blur) rgb(0 0 0 / var(--sh-alpha)),
    calc(var(--sh-x) * .3) calc(var(--sh-y) * .3) 3px rgb(0 0 0 / calc(var(--sh-alpha) * .8));
}
.book img { display: block; width: 100%; height: auto; border-radius: inherit; }
.book::before {
  content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .26) 0, rgba(255, 255, 255, .32) 1.4%, rgba(0, 0, 0, .1) 3%, rgba(0, 0, 0, 0) 6.5%);
}
.book::after {
  content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; opacity: 0;
  background: linear-gradient(112deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0) 62%) 130% 0 / 280% 100% no-repeat;
  mix-blend-mode: soft-light;
}
/* Brillo especial con sol: la luz barre las cubiertas */
:root[data-sky="clear"]:not([data-phase="night"]) .book::after,
:root[data-sky="partly"]:not([data-phase="night"]) .book::after { opacity: 1; animation: sheen 6.5s ease-in-out infinite; }
:root[data-sky="clear"]:not([data-phase="night"]) .hero__phrase { text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 70%, transparent); }
/* De noche las cubiertas bajan un punto */
:root[data-phase="night"] .book img { filter: brightness(.86) saturate(.92); }

/* Cinta de teletipo */
.ticker {
  position: relative; z-index: 2;
  width: 106vw; margin: 0 0 0 -3vw;
  overflow: hidden; white-space: nowrap;
  color: var(--bg); background: var(--fg);
  rotate: -1.6deg;
}
.ticker__track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.ticker__track > div { display: flex; align-items: center; gap: 26px; padding: 15px 13px; font: 600 14px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.ticker i { font-style: normal; color: var(--accent); }

/* Secciones */
/* Vídeo del Vol. 2: bloque azul que rompe el ritmo de la web */
.promo { padding: clamp(40px, 6vw, 80px) var(--gutter) 0; }
.promo__box {
  --promo-bg: #2F2BFF;
  display: grid; gap: clamp(20px, 3vw, 32px);
  padding: clamp(20px, 3.5vw, 48px);
  background: var(--promo-bg); color: #fff;
  border-radius: clamp(20px, 2.4vw, 32px);
}
.promo__kicker { color: rgba(255,255,255,.8); }
.promo__title { margin: 6px 0 0; font: 900 clamp(36px, 5.6vw, 88px)/.9 var(--display); font-stretch: 125%; letter-spacing: -.045em; text-transform: uppercase; }
.promo__title em { font: italic 400 1.1em/.8 var(--serif); letter-spacing: -.015em; text-transform: none; color: #D8FF3C; }
.promo__frame { position: relative; overflow: hidden; border-radius: clamp(14px, 1.6vw, 22px); background: #121216; aspect-ratio: 16 / 9; width: min(100%, calc((100svh - 300px) * 16 / 9)); justify-self: center; }
.promo__frame.is-vertical { aspect-ratio: 9 / 16; width: min(100%, 440px, calc((100svh - 120px) * 9 / 16)); }
.promo__video { display: block; width: 100%; height: 100%; object-fit: cover; }
.promo__controls { position: absolute; right: clamp(10px, 1.6vw, 20px); bottom: clamp(10px, 1.6vw, 20px); display: flex; gap: 10px; }
.promo__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 46px; height: 46px; padding: 0 12px; border: 2px solid #121216; border-radius: 999px;
  font: 700 13px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: #121216; background: #fff; box-shadow: 0 4px 0 #121216; cursor: pointer;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.promo__btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.promo__btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #121216; }
.promo__btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #121216; }
.promo__btn:focus-visible { outline: 3px solid #D8FF3C; outline-offset: 3px; }
.promo__btn--sound { padding: 0 16px 0 12px; }
.promo__btn--sound[aria-pressed="true"] { background: #D8FF3C; }
.promo__btn--sound .i-on, .promo__btn--sound[aria-pressed="true"] .i-off { display: none; }
.promo__btn--sound[aria-pressed="true"] .i-on { display: inline; }
.promo__btn--play .i-play, .promo__btn--play.is-paused .i-pause { display: none; }
.promo__btn--play.is-paused .i-play { display: inline; }
@media (max-width: 560px) { .promo__sound-label { display: none; } .promo__btn--sound { padding: 0 12px; } }
/* En la ficha, el vídeo va dentro de .bk (que ya tiene margen lateral) y toma el color del libro */
.promo--book { padding-inline: 0; }
.promo--book .promo__box { --promo-bg: var(--book-accent); color: var(--on-accent); }
.promo--book .promo__kicker { color: inherit; opacity: .8; }
.promo--book .promo__title em { color: inherit; }
/* Home: vídeo del Workbook para Guardias Civiles, en el verde de su cubierta */
.promo--gc .promo__box { --promo-bg: #1C3326; }
.promo--gc .promo__title em { color: #E3B53A; }
.promo__more { margin: 14px 0 0; font: 700 14px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.promo__more a { color: inherit; text-underline-offset: 4px; }
.promo__more a:hover, .promo__more a:focus-visible { color: #E3B53A; }
/* En móvil, los botones arriba: abajo los tapa la barra de menú flotante */
@media (max-width: 720px) { .promo__controls { top: 12px; bottom: auto; } }

.section { padding: clamp(80px, 11vw, 160px) var(--gutter) 0; }
.section__head { display: grid; gap: 14px; margin-bottom: clamp(36px, 5vw, 64px); }
.section__title { margin: 0; font: 900 clamp(44px, 7vw, 116px)/.88 var(--display); font-stretch: 125%; letter-spacing: -.045em; text-transform: uppercase; }
.section__title em { font: italic 400 1.1em/.8 var(--serif); letter-spacing: -.015em; text-transform: none; }
.section__lead { margin: 0; font: italic 400 22px/1.2 var(--serif); color: var(--muted); }

/* Colecciones: filtros de la estantería */
.shelf-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.shelf-filters button {
  padding: 10px 16px; font: 700 12.5px/1 var(--display); font-stretch: 118%; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fg); background: transparent; border: 2px solid var(--fg); border-radius: 999px; cursor: pointer;
  transition: background-color .2s, color .2s, transform .25s var(--ease-spring);
}
.shelf-filters button:hover { transform: translateY(-2px); }
.shelf-filters button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.shelf-filters button b { font-weight: 500; opacity: .6; margin-left: 4px; }
.tome[hidden] { display: none; }
/* Estrenos: carrusel horizontal de libros que se giran para leer la contraportada */
.section__head--split { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px 40px; }
.section__headcopy { display: grid; gap: 14px; }
.carousel__nav { display: flex; align-items: center; gap: 10px; }
.estrenos.is-static :is(.carousel__nav, .carousel__progress) { visibility: hidden; } /* caben todos: no hay nada que pasar */
.carousel__count { margin: 0 12px 0 0; font-size: 14px; letter-spacing: .08em; color: var(--muted); }
.carousel__count b { font-weight: 700; color: var(--fg); }
.carousel__btn {
  width: 60px; height: 60px; display: grid; place-items: center; padding: 0;
  font: 500 24px/1 var(--display); color: var(--fg); background: transparent;
  border: 2px solid var(--fg); border-radius: 50%; cursor: pointer;
  transition: background-color .2s, color .2s, transform .25s var(--ease-spring), opacity .2s;
}
.carousel__btn:hover:not(:disabled) { background: var(--fg); color: var(--bg); transform: scale(1.06); }
.carousel__btn:disabled { opacity: .28; cursor: default; }
.carousel { margin-inline: calc(var(--gutter) * -1); }
.shelf {
  list-style: none; margin: 0;
  display: flex; gap: clamp(20px, 2.6vw, 40px);
  padding: 8px var(--gutter) 40px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  scrollbar-width: none; cursor: grab;
}
.shelf::-webkit-scrollbar { display: none; }
.shelf:focus-visible { outline-offset: -4px; }
.shelf.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.shelf.is-dragging .book { transition: none; }
.tome { flex: 0 0 clamp(240px, 23vw, 330px); scroll-snap-align: start; display: flex; flex-direction: column; gap: 22px; perspective: 1600px; }
.tome img { -webkit-user-drag: none; user-select: none; }
.carousel__progress { height: 3px; overflow: hidden; background: var(--line); border-radius: 3px; }
.carousel__progress span { display: block; height: 100%; background: var(--fg); transform-origin: 0 50%; transform: scaleX(.3); transition: transform .3s var(--ease-out); }
.tome__stage { position: relative; display: flex; align-items: flex-end; aspect-ratio: 612 / 792; }
.tome__stage .tome__flip { width: 100%; }
.tome__flip { position: relative; aspect-ratio: var(--ratio, 612 / 792); transform-style: preserve-3d; transition: transform .8s var(--ease-spring); }
.tome__stage[data-href] { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .tome__stage:hover .tome__flip { transform: rotateY(180deg); }
  .shelf.is-dragging .tome__flip { transform: none; }
}
.tome__face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.tome__back {
  transform: rotateY(180deg);
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  padding: clamp(14px, 1.4vw, 20px);
  overflow: hidden;
  color: var(--fg); background: var(--card);
  border: 2px solid var(--fg); border-top: 14px solid var(--book-accent);
  border-radius: 3px 9px 9px 3px;
  box-shadow: var(--sh-x) var(--sh-y) var(--sh-blur) rgb(0 0 0 / var(--sh-alpha));
}
.tome__backtitle { margin: 0; font: 800 18px/1.05 var(--display); font-stretch: 112%; letter-spacing: -.02em; }
.tome__summary { margin: 0; font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.tome__facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 auto; padding: 0; list-style: none; font-size: 11.5px; }
.tome__facts li { padding: 4px 9px; border: 1.5px solid var(--line); border-radius: 999px; }
.tome__back > .btn { margin-top: auto; } /* el botón siempre abajo, haya o no etiquetas */
.tome__meta { display: grid; gap: 8px; justify-items: start; }
.tome__badge { padding: 4px 10px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--on-accent); background: var(--accent); border-radius: 999px; }
.tome__title { margin: 0; font: 800 clamp(19px, 1.6vw, 23px)/1.08 var(--display); font-stretch: 112%; letter-spacing: -.02em; }
.tome__title a, .row__main h3 a { text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 3px no-repeat; transition: background-size .3s var(--ease-out); }
.tome__title a:hover, .row__main h3 a:hover { background-size: 100% 3px; }
.tome__tag { margin: 0; font: italic 400 19px/1.2 var(--serif); color: var(--muted); }
.tome__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 6px; }
.tome__actions .link { font-size: 14px; }
/* «Próximamente»: etiqueta de lanzamiento (con su agujero) para los libros que aún no se pueden comprar */
.soon {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 14px 8px 25px;
  font: 700 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
  color: var(--bg); background: var(--fg); border-radius: 0 6px 6px 0;
  clip-path: polygon(11px 0, 100% 0, 100% 100%, 11px 100%, 0 50%);
  -webkit-mask: radial-gradient(circle at 12px 50%, transparent 2.5px, #000 3px);
  mask: radial-gradient(circle at 12px 50%, transparent 2.5px, #000 3px);
}
.soon--lg { padding: 12px 20px 12px 32px; font-size: 14px; }
.soon::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); animation: pulse 2.4s ease-in-out infinite; }

/* ¿Quiénes somos? Corto, con la foto de Marcos, Telmo y Tobi */
.about__team-title { margin-bottom: 8px; font: italic 400 26px/1.1 var(--serif); }
.about__team { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 10px; }
.about__team li { padding-left: 18px; border-left: 3px solid var(--accent); }
.about__grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(40px, 7vw, 120px); align-items: center; }
.about__photos { position: relative; }
.about__disc { position: absolute; right: -9%; top: -8%; z-index: 0; width: 70%; aspect-ratio: 1; border-radius: 50%; background: var(--accent); border: 2px solid var(--fg); }
.about__disc::after { content: ''; position: absolute; inset: 7%; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--fg) 40%, transparent); animation: spin 70s linear infinite; }
.polaroid {
  position: relative; z-index: 1;
  margin: 0; padding: 14px 14px 0;
  background: #FFFFFF; border: 2px solid var(--fg); border-radius: 6px;
  box-shadow: var(--hard-x) var(--hard-y) 0 var(--accent);
  transition: rotate .5s var(--ease-spring), translate .5s var(--ease-spring);
}
.polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: #F4F1EA; border-radius: 2px; }
.polaroid figcaption { padding: 12px 4px 16px; font: italic 400 clamp(22px, 2vw, 28px)/1 var(--serif); text-align: center; color: #121216; }
.polaroid:not(:has(figcaption)) { padding-bottom: 14px; }
.about__photos .polaroid { rotate: -3deg; }
.about__photos:hover .polaroid { rotate: -5deg; translate: -6px 0; }
.about__copy { display: grid; justify-items: start; gap: 18px; }
.about__title { max-width: 14ch; margin: 0 0 6px; font: 900 clamp(38px, 5vw, 84px)/.92 var(--display); font-stretch: 118%; letter-spacing: -.045em; }
.about__title em { font: italic 400 1.1em/.8 var(--serif); letter-spacing: -.01em; }
.about__copy > p:not(.kicker) { max-width: 36em; margin: 0; font-size: clamp(17px, 1.3vw, 19px); }
.about__copy i { font-family: var(--serif); font-size: 1.12em; line-height: 1; }
.about__copy .btn { margin-top: 10px; }

/* Catálogo */
.catalog__list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--fg); }
.row {
  display: grid; grid-template-columns: 74px minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr) auto;
  align-items: center; gap: 24px;
  padding: 18px 0; border-bottom: 1.5px solid var(--line);
  transition: background-color .25s, padding .3s var(--ease-out);
}
.row:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); padding-inline: 14px; }
.row__thumb { width: 74px; }
.row:hover .row__thumb { --tx: .5; }
.row__main h3 { margin: 0; font: 800 20px/1.1 var(--display); font-stretch: 112%; letter-spacing: -.02em; }
.row__main p { margin: 4px 0 0; font: italic 400 18px/1.2 var(--serif); color: var(--muted); }
.row__aud, .row__facts { margin: 0; font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }

/* Pie */
/* Cinta del pie: inclinada, pero montada sobre el amarillo para que no asome el fondo por debajo */
.ticker--foot { margin: clamp(90px, 12vw, 180px) 0 -24px -3vw; rotate: .8deg; } /* el borde del amarillo queda en el centro de la cinta: con esta inclinación, ni el fondo asoma por debajo ni el amarillo por encima */
.ticker--foot .ticker__track { animation-direction: reverse; }
.footer {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 22px clamp(24px, 4vw, 56px);
  padding: calc(clamp(64px, 8vw, 110px) + 24px) var(--gutter) 28px;
  color: var(--on-accent); background: var(--accent);
  border-top: 2px solid var(--fg);
}
.footer .logo { background: var(--on-accent); }
.page-book .footer { --accent: #FFC21F; --on-accent: #121216; margin-top: clamp(110px, 14vw, 200px); padding-top: clamp(64px, 8vw, 110px); } /* la ficha pinta el acento del libro; el pie sigue en el amarillo de la marca */
.footer__big { margin: 0 0 10px; font: 900 clamp(30px, 4.4vw, 68px)/.95 var(--display); font-stretch: 120%; letter-spacing: -.04em; }
.footer__big em { font: italic 400 1.1em/.8 var(--serif); letter-spacing: -.01em; background: linear-gradient(transparent 74%, var(--card) 74%, var(--card) 92%, transparent 92%); }
.footer__copy > .mono { margin: 0; font-size: 13px; color: color-mix(in srgb, var(--on-accent) 72%, transparent); }
.footer__actions { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 16px; }
.footer__actions .link { color: inherit; }
.footer__legal { grid-column: 1 / -1; margin: 18px 0 0; font-size: 12px; color: color-mix(in srgb, var(--on-accent) 72%, transparent); }
.footer__legal a { color: inherit; text-underline-offset: 3px; }
.footer__legal a:hover { color: var(--on-accent); }

/* Información legal (legal.html) */
.legal { max-width: 880px; padding: 0 var(--gutter); }
.legal__head { display: grid; gap: 14px; padding: clamp(40px, 6vw, 80px) 0 clamp(20px, 3vw, 40px); }
.legal__toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.legal__toc a { padding: 9px 15px; font: 700 13px/1 var(--display); font-stretch: 112%; text-decoration: none; background: var(--card); border: 2px solid var(--fg); border-radius: 999px; transition: background-color .2s, color .2s; }
.legal__toc a:hover { background: var(--fg); color: var(--bg); }
.legal__section { margin-top: clamp(28px, 4vw, 48px); padding: clamp(22px, 3vw, 40px); background: var(--card); border: 2px solid var(--fg); border-radius: 24px; box-shadow: var(--hard-x) var(--hard-y) 0 var(--accent); scroll-margin-top: 96px; }
.legal__section h2 { margin: 0 0 14px; font: 900 clamp(28px, 3.4vw, 44px)/1 var(--display); font-stretch: 120%; letter-spacing: -.035em; }
.legal__section h3 { margin: 26px 0 6px; font: 800 18px/1.2 var(--display); font-stretch: 112%; }
.legal__section p, .legal__section li { max-width: 68ch; font-size: 16px; }
.legal__section p { margin: 0 0 10px; }
.legal__section ul { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 8px; }
.legal__data { display: grid; gap: 0; margin: 10px 0 0; border-top: 1.5px solid var(--line); }
.legal__data div { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 16px; padding: 10px 0; border-bottom: 1.5px solid var(--line); }
.legal__data dt { font: 600 12px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.legal__data dd { margin: 0; }
.legal__table { overflow-x: auto; margin: 6px 0 14px; }
.legal__table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; }
.legal__table th, .legal__table td { padding: 10px 12px 10px 0; text-align: left; vertical-align: top; border-bottom: 1.5px solid var(--line); }
.legal__table th { font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
/* Aviso de cookies (js/consent.js) */
.consent {
  position: fixed; left: var(--gutter); bottom: 22px; z-index: 30;
  width: min(460px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100svh - 44px); overflow: auto;
  display: grid; gap: 12px; padding: 22px;
  color: var(--fg); background: var(--card);
  border: 2px solid var(--fg); border-radius: 24px;
  box-shadow: var(--hard-x) var(--hard-y) 0 var(--accent);
  animation: rise .5s var(--ease-out) both;
}
.consent__title { margin: 0; font: 900 22px/1.05 var(--display); font-stretch: 118%; letter-spacing: -.02em; }
.consent__text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.consent__text a { color: var(--fg); }
.consent__cats { display: grid; gap: 10px; margin: 2px 0; padding: 0; list-style: none; }
.consent__cat { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px; font-size: 14px; line-height: 1.45; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; }
.consent__cat input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--fg); }
.consent__always { margin-left: 6px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.consent__actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.consent__btn { padding-inline: 8px; }
.consent__btn:hover { background: var(--fg); color: var(--bg); }
@media (max-width: 720px) { .consent { left: 50%; translate: -50% 0; bottom: 84px; max-height: calc(100svh - 110px); } }
@media (max-width: 380px) { .consent__actions { grid-template-columns: 1fr; } }
mark.fill { padding: 0 4px; color: var(--on-accent); background: var(--accent); border-radius: 4px; }
@media (max-width: 560px) { .legal__data div { grid-template-columns: 1fr; gap: 2px; } }
/* Aparición al hacer scroll (main.js pone has-reveal solo si hay IntersectionObserver y no están los efectos suaves) */
:root.has-reveal [data-reveal] { opacity: 0; translate: 0 30px; transition: opacity .75s var(--ease-out), translate .75s var(--ease-out); transition-delay: calc(var(--i, 0) * 110ms); }
:root.has-reveal [data-reveal].is-in { opacity: 1; translate: 0 0; }

/* Entrada de la home tras el modal */
.site.is-entering .hero__kicker,
.site.is-entering .hero__title > *,
.site.is-entering .hero__aside,
.site.is-entering .forecast { animation: rise 1s var(--ease-out) both; }
.site.is-entering .hero__title > :nth-child(1) { animation-delay: .05s; }
.site.is-entering .hero__title > :nth-child(2) { animation-delay: .15s; }
.site.is-entering .hero__title > :nth-child(3) { animation-delay: .25s; }
.site.is-entering .hero__aside { animation-delay: .35s; }
.site.is-entering .forecast { animation: drop 1.1s var(--ease-spring) .3s both; }

/* ---------------------------------------------------------------- laboratorio del cielo */
.skylab {
  position: fixed; top: 84px; right: var(--gutter);
  width: min(390px, calc(100vw - 32px));
  max-height: calc(100svh - 100px); overflow: auto;
  display: grid; gap: 12px;
  padding: 18px;
  color: var(--fg); background: var(--card);
  border: 2px solid var(--fg); border-radius: 24px;
  box-shadow: var(--hard-x) var(--hard-y) 0 var(--fg);
  animation: drop .45s var(--ease-spring) both;
}
.skylab__head { display: flex; align-items: center; justify-content: space-between; }
.skylab__close { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; font-size: 22px; line-height: 1; background: none; border: 2px solid var(--fg); border-radius: 50%; cursor: pointer; }
.skylab__close:hover { background: var(--fg); color: var(--bg); }
.skylab__place { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; }
.skylab__place .ico { width: 26px; height: 26px; flex: none; }
.skylab > .link { justify-self: start; font-size: 14px; }
.skylab__sub { margin-top: 8px; padding-top: 14px; border-top: 1.5px solid var(--line); }
.skylab__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.skylab__grid button {
  display: grid; justify-items: center; gap: 4px;
  padding: 10px 4px; font-size: 12.5px; font-weight: 600;
  background: transparent; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .2s var(--ease-spring);
}
.skylab__grid button:hover { border-color: var(--fg); transform: translateY(-2px); }
.skylab__grid .ico { width: 26px; height: 26px; }
.skylab__seg { display: flex; border: 1.5px solid var(--fg); border-radius: 999px; overflow: hidden; }
.skylab__seg button { flex: 1; padding: 9px 4px; font-size: 12.5px; font-weight: 600; background: none; border: 0; cursor: pointer; }
.skylab__seg button + button { border-left: 1.5px solid var(--line); }
.skylab [aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.skylab__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; }
.skylab__foot .link { font-size: 13.5px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--fg); }

/* ---------------------------------------------------------------- aviso */
.toast {
  position: fixed; left: 50%; bottom: 22px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 14px 20px;
  font-size: 15px; text-align: center;
  color: var(--bg); background: var(--fg);
  border-radius: 999px;
  box-shadow: var(--hard-x) var(--hard-y) 0 var(--accent);
  transform: translate(-50%, 160%); opacity: 0;
  transition: transform .6s var(--ease-spring), opacity .3s;
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------------------------------------------------------------- animaciones */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6) rotate(-30deg); } }
@keyframes drop { from { opacity: 0; transform: translateY(-24px) rotate(-3deg); } }
@keyframes wave { 50% { transform: translateY(-14px) rotate(var(--r)); } }
@keyframes nudge { 50% { transform: translateX(6px); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); } }
@keyframes sheen { 0%, 50% { background-position: 130% 0; } 85%, 100% { background-position: -30% 0; } }
@keyframes float { 50% { translate: 0 -10px; } }
@keyframes settle { from { transform: translateY(-26px) rotate(-3deg); } }
@keyframes stamp { 0% { opacity: 0; transform: scale(2.4); } 60% { opacity: .9; transform: scale(.94); } 100% { opacity: .85; transform: scale(1); } }

/* Efectos suaves (prefers-reduced-motion o interruptor del laboratorio) */
:root[data-calm="true"] *, :root[data-calm="true"] *::before, :root[data-calm="true"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
  transition-duration: .001ms !important; scroll-behavior: auto !important;
}
:root[data-calm="true"] .ticker__track { transform: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .row { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .row__aud, .row__facts { display: none; }
  .row__thumb { width: 64px; }
}

@media (max-width: 860px) {
  .gate { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .gate__window { grid-row: 2; width: min(46vw, 210px); margin-top: 18px; }
  .gate__body { padding-top: 2vh; }
  .modal { place-items: start center; padding-block: 24px; }
  .modal__card { grid-template-columns: 1fr; }
  .ticket { border-left: 0; border-top: 2px dashed currentColor; border-radius: 0 0 28px 28px; }
  .ticket::before { top: -15px; left: -15px; clip-path: inset(0 0 0 50%); }
  .ticket::after { top: -15px; bottom: auto; left: auto; right: -15px; clip-path: inset(0 50% 0 0); }
  .ticket__stamp { top: 22px; bottom: auto; right: 22px; width: 92px; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .forecast, :root[data-weather="off"] .forecast { grid-column: 1; grid-row: auto; width: min(72%, 320px); margin: 48px auto 0; }
  .forecast__disc { width: 118%; }
  .chip__label { display: none; }
  .about__grid { grid-template-columns: 1fr; }
  .about__photos { width: min(100%, 460px); }
}

@media (max-width: 720px) {
  /* sin backdrop-filter: si no, la barra fija de enlaces quedaría atrapada dentro del nav */
  /* En iOS la barra «sticky» temblaba al hacer scroll: en móvil va fija, opaca y con el logo en su propia capa */
  .site { padding-top: 56px; }
  .nav { position: fixed; top: 0; left: 0; right: 0; height: 56px; gap: 12px; padding-block: 0; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  .nav .logo--sm { width: 108px; transform: translateZ(0); }
  .nav__links { position: fixed; left: 50%; bottom: 14px; z-index: 11; translate: -50% 0; margin: 0;
    gap: 4px; padding: 6px; background: var(--card); border: 2px solid var(--fg); border-radius: 999px;
    box-shadow: var(--hard-x) var(--hard-y) 0 var(--accent); }
  .nav__links a { padding: 10px 12px; font-size: 11.5px; background: none; border-radius: 999px; white-space: nowrap; }
  .nav__links a:hover, .nav__links a[aria-current] { background: var(--fg); color: var(--bg); }
  .chip { margin-left: auto; }
  .section__head--split { grid-template-columns: 1fr; }
  .carousel__btn { width: 50px; height: 50px; font-size: 20px; }
  .tome { flex-basis: 74vw; }

  .footer { grid-template-columns: 1fr; padding-bottom: 96px; }
  .toast { bottom: 84px; border-radius: 22px; }
}

@media (max-width: 420px) {
  .cp__box { width: calc((100vw - 2 * var(--gutter) - 4 * 6px) / 5); }
  .btn--xl { --pad: 17px 22px; font-size: 16px; }
  .chip__text span { display: none; }
}

/* =====================================================================
   FICHA DE LIBRO (libro.html)
   ===================================================================== */
body.page-book {
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% var(--cell),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / var(--cell) 100%,
    linear-gradient(180deg, color-mix(in srgb, var(--book-accent, var(--accent)) 16%, var(--bg)) 0, var(--bg) 760px);
}
.bk { padding: 0 var(--gutter); }
.crumbs { display: flex; align-items: center; gap: 10px; padding-top: 28px; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.crumbs a { color: var(--fg); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.bk-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 6vw, 100px); align-items: center; padding: clamp(16px, 3vw, 40px) 0 clamp(20px, 4vw, 60px); }
.bk-hero__visual { position: relative; display: grid; place-items: center; padding: clamp(40px, 6vw, 80px) 0; }
.bk-disc { position: absolute; width: min(94%, 560px); aspect-ratio: 1; border-radius: 50%; background: var(--book-accent); border: 2px solid var(--fg); }
.bk-disc::after { content: ''; position: absolute; inset: 7%; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--fg) 35%, transparent); animation: spin 60s linear infinite; }
.bk-badge { position: absolute; top: 9%; right: 8%; z-index: 3; padding: 9px 15px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--bg); background: var(--fg); border-radius: 999px; rotate: 8deg; }

/* Libro en 3D: cubierta, cantos de las páginas y lomo */
.book3d { position: relative; z-index: 2; width: min(66%, 360px); aspect-ratio: var(--ratio, 612 / 792); perspective: 1800px; }
.book3d__body { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(-28deg) rotateX(6deg); transition: transform 1.1s var(--ease-spring); animation: book-in .9s var(--ease-spring) backwards; }
.book3d:hover .book3d__body { transform: rotateY(-10deg) rotateX(2deg); }
.book3d__front, .book3d__back { position: absolute; inset: 0; overflow: hidden; border-radius: 2px 6px 6px 2px; }
.book3d__front { transform: translateZ(calc(var(--d) / 2)); }
.book3d__front img { display: block; width: 100%; height: 100%; object-fit: cover; }
.book3d__front::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .28) 0, rgba(255, 255, 255, .35) 1.2%, rgba(0, 0, 0, .08) 2.6%, transparent 6%),
              linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .22) 50%, transparent 62%);
}
.book3d__back { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); background: var(--book-accent); }
.book3d__pages { position: absolute; top: 1%; bottom: 1%; right: calc(var(--d) / -2); width: var(--d); transform: rotateY(90deg); background: repeating-linear-gradient(90deg, #FBFAF6 0 1.5px, #D9D5CA 1.5px 2.5px); }
.book3d__spine { position: absolute; top: 0; bottom: 0; left: calc(var(--d) / -2); width: var(--d); transform: rotateY(-90deg); background: var(--book-accent); filter: brightness(.8); }
.book3d__shadow { position: absolute; z-index: -1; left: 6%; right: -10%; bottom: -6%; height: 9%; background: radial-gradient(closest-side, rgba(0, 0, 0, .4), transparent); filter: blur(6px); }
@keyframes book-in { from { transform: rotateY(-55deg) rotateX(10deg); } } /* sin fundido: la portada se ve desde el primer momento */

.bk-hero__info { display: grid; justify-items: start; }
.bk-title { margin: 14px 0 10px; font: 900 clamp(38px, 4.6vw, 78px)/.92 var(--display); font-stretch: 118%; letter-spacing: -.045em; text-wrap: balance; }
.bk-tagline { margin: 0 0 18px; font: italic 400 clamp(22px, 2vw, 30px)/1.15 var(--serif); }
.bk-summary { max-width: 34em; margin: 0 0 20px; font-size: 18px; color: var(--muted); }
.bk-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 12.5px; }
.bk-facts li { padding: 6px 12px; border: 1.5px solid var(--fg); border-radius: 999px; }
.bk-rating { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; font-size: 15px; text-decoration: none; }
.bk-rating:hover b { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.stars {
  --rating: 0;
  font-size: 18px; letter-spacing: 2px; line-height: 1;
  background: linear-gradient(90deg, currentColor calc(var(--rating) / 5 * 100%), color-mix(in srgb, currentColor 22%, transparent) 0);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bk-rating .stars, .bk-reviews .stars { color: var(--fg); }
.stars--lg { font-size: 36px; }

/* Caja de compra */
.buy { width: 100%; max-width: 620px; padding: clamp(20px, 2.4vw, 30px); background: var(--card); border: 2px solid var(--fg); border-radius: 24px; box-shadow: 8px 8px 0 var(--accent); }
.buy__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.buy__title { margin: 0; font: 800 20px var(--display); font-stretch: 116%; }
.buy__price { margin: 0; font: 900 34px/1 var(--display); font-stretch: 120%; letter-spacing: -.03em; }
.buy__options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.buy__note { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }
.buy__note svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
/* Ficha de un libro que aún no ha salido: «Próximamente» en lugar de la compra */
.buy--soon { display: grid; justify-items: start; gap: 12px; }
.buy--soon .buy__options { margin-top: 6px; }
.buy__text { max-width: 34em; margin: 0; font-size: 16px; color: var(--muted); }

.bk-section { padding-top: clamp(80px, 10vw, 140px); }

/* Hojeador: doble página con una hoja que gira sobre el lomo */
.flipbook { display: grid; justify-items: center; gap: 22px; outline-offset: 10px; border-radius: 12px; }
.flipbook__book { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 1060px); aspect-ratio: calc(var(--ratio, 612 / 792) * 2); perspective: 2600px; touch-action: pan-y; filter: drop-shadow(0 26px 30px rgba(0, 0, 0, .2)); transition: transform .95s cubic-bezier(.45, .05, .25, 1); }
/* Libro cerrado: solo se ve una página y se centra */
.flipbook.is-closed-front .flipbook__book { transform: translateX(-25%); }
.flipbook.is-closed-back .flipbook__book { transform: translateX(25%); }
.fb-page picture, .fb-leaf picture { display: contents; }
.fb-page { position: relative; overflow: hidden; background: #FFFFFF; cursor: zoom-in; }
.fb-page img, .fb-leaf img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.fb-page--left { border-radius: 8px 0 0 8px; }
.fb-page--right { border-radius: 0 8px 8px 0; }
.fb-page::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.fb-page--left::after { background: linear-gradient(270deg, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0) 9%); }
.fb-page--right::after { background: linear-gradient(90deg, rgba(0, 0, 0, .22), rgba(0, 0, 0, 0) 9%); }
.fb-page.is-none { background: transparent; cursor: default; }
.fb-page.is-none::after { display: none; }
/* Contracubierta interior: cierre del vistazo con el logo */
.is-end { background: #F7F5EF url("../assets/img/logo.svg") center 40% / 44% no-repeat !important; cursor: default; }
.is-end::before { content: 'El resto, en el libro.'; position: absolute; left: 0; right: 0; top: 56%; font: italic 400 clamp(18px, 2vw, 28px)/1.1 var(--serif); text-align: center; color: #121216; }
.is-none img, .is-end img { visibility: hidden; }
.fb-leaf { position: absolute; top: 0; bottom: 0; z-index: 3; width: 50%; transform-style: preserve-3d; pointer-events: none; }
.fb-leaf.is-next { left: 50%; transform-origin: left center; }
.fb-leaf.is-prev { left: 0; transform-origin: right center; }
.fb-leaf__face { position: absolute; inset: 0; overflow: hidden; background: #FFFFFF; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.fb-leaf__back { transform: rotateY(180deg); }
.is-next .fb-leaf__front, .is-prev .fb-leaf__back { border-radius: 0 8px 8px 0; }
.is-next .fb-leaf__back, .is-prev .fb-leaf__front { border-radius: 8px 0 0 8px; }
.flipbook.is-single .flipbook__book { grid-template-columns: 1fr; width: min(100%, 520px); aspect-ratio: var(--ratio, 612 / 792); transform: none; }
.flipbook.is-single .fb-page--right { display: none; }
.flipbook.is-single .fb-page--left { border-radius: 8px; }
.flipbook.is-single .fb-page--left::after { display: none; }
.flipbook__ctrl { display: flex; align-items: center; gap: 18px; }
.flipbook__count { min-width: 10ch; margin: 0; font-size: 14px; letter-spacing: .06em; text-align: center; }
.flipbook__cap { min-height: 1.2em; margin: 0; font: italic 400 22px/1.2 var(--serif); text-align: center; color: var(--muted); }

/* Qué vas a encontrar */
.bk-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); margin: 0; padding: 0; list-style: none; }
.bk-highlights li { display: grid; align-content: start; gap: 8px; padding: clamp(22px, 2.4vw, 32px); background: var(--card); border: 2px solid var(--fg); border-top: 14px solid var(--book-accent); border-radius: 24px; }
.bk-highlights b { font: 900 clamp(46px, 5vw, 78px)/.9 var(--display); font-stretch: 125%; letter-spacing: -.05em; }
.bk-highlights__label { font: italic 400 26px/1.1 var(--serif); }
.bk-highlights p { margin: 6px 0 0; color: var(--muted); }

/* Sobre el libro + ficha técnica */
.bk-about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); gap: clamp(32px, 6vw, 100px); align-items: start; }
.bk-about__title { margin: 14px 0 22px; font: 900 clamp(30px, 3.4vw, 54px)/.98 var(--display); font-stretch: 116%; letter-spacing: -.04em; }
.bk-about__text > p:not(.kicker) { max-width: 38em; margin: 0 0 1em; font-size: 18px; }
.bk-specs { position: sticky; top: 100px; padding: 24px 26px; background: var(--card); border: 2px solid var(--fg); border-radius: 22px; }
.bk-specs dl { margin: 12px 0 0; }
.bk-specs div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1.5px dashed var(--line); }
.bk-specs div:last-child { border-bottom: 0; }
.bk-specs dt { font: 600 11px/1.7 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bk-specs dd { margin: 0; font-weight: 500; }

/* Portada provisional (la cubierta real aún no existe) */
.bk-provisional { margin: 10px 0 0; font: 500 12.5px/1.4 var(--mono); letter-spacing: .04em; color: var(--muted); }

/* Valoraciones */
.bk-section.bk-reviews {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(28px, 6vw, 90px);
  margin-top: clamp(80px, 10vw, 140px); padding: clamp(28px, 4vw, 56px);
  color: var(--on-accent); background: var(--book-accent);
  border: 2px solid var(--fg); border-radius: 30px; box-shadow: 10px 10px 0 var(--fg);
}
.bk-reviews .kicker { color: inherit; opacity: .8; }
.bk-reviews__big { margin: 10px 0 8px; font: 900 clamp(84px, 10vw, 150px)/.85 var(--display); font-stretch: 125%; letter-spacing: -.06em; }
.bk-reviews__big span { font-size: .4em; letter-spacing: -.02em; }
.bk-reviews .stars { color: currentColor; }
.bk-reviews__text { display: grid; justify-items: start; gap: 22px; }
.bk-reviews__text p { margin: 0; font: italic 400 clamp(24px, 2.4vw, 36px)/1.15 var(--serif); }
.bk-reviews .btn { color: inherit; border-color: currentColor; }
.bk-reviews .btn:hover { color: var(--bg); background: var(--fg); border-color: var(--fg); }

/* Faldón de compra del color del libro, debajo de los KPI */
.bk-strip {
  display: flex; align-items: center; justify-content: space-between; gap: clamp(24px, 4vw, 60px);
  margin-top: clamp(28px, 3vw, 40px); padding: clamp(24px, 3vw, 40px) clamp(24px, 3.4vw, 48px);
  color: var(--on-accent); background: var(--book-accent);
  border: 2px solid var(--fg); border-radius: 30px; box-shadow: 10px 10px 0 var(--fg);
}
.bk-strip .kicker { color: inherit; opacity: .8; }
.bk-strip__title { margin: 8px 0 0; font: italic 400 clamp(26px, 2.6vw, 40px)/1.1 var(--serif); }
.bk-strip__note { margin: 12px 0 0; font-size: 12.5px; opacity: .8; }
.bk-strip__buy { display: flex; align-items: center; gap: clamp(18px, 2vw, 32px); flex: none; }
.bk-strip__price { margin: 0; font: 900 clamp(40px, 4vw, 60px)/1 var(--display); font-stretch: 120%; letter-spacing: -.04em; }
.bk-strip .btn--primary { background: var(--fg); color: var(--bg); box-shadow: 6px 6px 0 var(--on-accent); }
.bk-strip .btn--primary:hover { box-shadow: 9px 9px 0 var(--on-accent); }
@media (max-width: 860px) {
  .bk-strip { flex-direction: column; align-items: stretch; text-align: center; padding: 28px 22px; }
  .bk-strip__buy { justify-content: center; flex-wrap: wrap; }
  .bk-strip__price { font-size: 44px; }
}

/* Faldón de compra (solo móvil, encima de las valoraciones) */
.bk-band { display: none; }
@media (max-width: 860px) {
  .bk-band {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin-top: clamp(56px, 10vw, 80px); padding: 18px 18px 18px 22px;
    color: var(--bg); background: var(--fg); border-radius: 22px;
  }
  .bk-band__copy { display: grid; gap: 2px; margin: 0; min-width: 0; }
  .bk-band__title { font: 800 17px/1.15 var(--display); font-stretch: 112%; letter-spacing: -.02em; }
  .bk-band__price { font: 900 26px/1 var(--display); font-stretch: 120%; letter-spacing: -.03em; color: var(--accent); }
  .bk-band .btn--primary { flex: none; color: var(--on-accent); background: var(--accent); box-shadow: none; }
  .bk-band + .bk-reviews { margin-top: 28px; }
}

/* Más cuadernos */
.bk-more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 36px); margin: 0; padding: 0; list-style: none; }
.bk-more a { display: grid; gap: 8px; text-decoration: none; }
.bk-more .book { margin-bottom: 10px; transition: transform .4s var(--ease-spring), box-shadow .4s; }
.bk-more a:hover .book { transform: translateY(-8px) rotate(-1.5deg); }
.bk-more__aud { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bk-more__title { font: 800 19px/1.1 var(--display); font-stretch: 112%; letter-spacing: -.02em; }

.bk-404 { display: grid; align-content: center; justify-items: start; gap: 22px; min-height: 64vh; }

/* Visor a pantalla completa */
.lightbox {
  position: fixed; inset: 0; z-index: 30;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 20px; background: rgba(12, 12, 16, .9); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lightbox__fig picture { display: contents; }
.lightbox__fig { display: grid; place-items: center; align-content: center; gap: 12px; align-self: stretch; min-height: 0; margin: 0; }
.lightbox__img { width: auto; height: auto; max-width: 100%; max-height: calc(100svh - 110px); background: #FFFFFF; border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.lightbox__cap { font-size: 13px; letter-spacing: .04em; text-align: center; color: #F2EFE8; }
.lightbox button { display: grid; place-items: center; width: 52px; height: 52px; padding: 0; font-size: 22px; color: #F2EFE8; background: transparent; border: 2px solid #F2EFE8; border-radius: 50%; cursor: pointer; transition: background-color .2s, color .2s; }
.lightbox button:hover { color: #121216; background: #F2EFE8; }
.lightbox__close { position: absolute; top: 16px; right: 16px; font-size: 28px !important; }

@media (max-width: 860px) {
  .bk-hero, .bk-about { grid-template-columns: 1fr; }
  .bk-hero__visual { padding: 40px 0 30px; }
  .book3d { width: min(60%, 300px); }
  .bk-highlights { grid-template-columns: 1fr; }
  .bk-specs { position: static; }
  .bk-section.bk-reviews { grid-template-columns: 1fr; }
  .bk-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lightbox { grid-template-columns: 1fr; padding: 70px 12px 90px; }
  .lightbox__nav { position: absolute; bottom: 20px; }
  .lightbox__nav--prev { left: calc(50% - 64px); }
  .lightbox__nav--next { right: calc(50% - 64px); }
  .lightbox__img { max-height: calc(100svh - 190px); }
}
@media (max-width: 720px) {
  .buy__options .btn { width: 100%; }
}

/* Gracias (vuelta desde Stripe) */
.thanks { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); align-items: center; gap: clamp(32px, 6vw, 90px); min-height: calc(100svh - 80px); padding-block: 40px; }
.thanks__book { justify-self: center; width: min(100%, 320px); rotate: -4deg; }
.thanks__book:empty { display: none; }
.thanks .bk-title em { font: italic 400 1.1em/.8 var(--serif); letter-spacing: -.01em; }
.thanks:has(.thanks__book:empty) { grid-template-columns: 1fr; }
@media (max-width: 860px) { .thanks { grid-template-columns: 1fr; } .thanks__book { width: min(60%, 240px); } }
