/* ==========================================================
   ui-refresh-index.css  ·  Mejora visual de index.html (solo UI)
   Cargar DESPUÉS de style-index.css
   ========================================================== */

:root {
  --accent: #cf2e2e;
  --accent-hover: #e03a3a;
  --accent-deep: #9f1f1f;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html { scroll-behavior: smooth; }
::selection { background: var(--accent); color: #fff; }

/* Foco visible para teclado */
button:focus-visible,
a:focus-visible,
.card:focus-visible,
.cards-indicator li:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Título ---------- */
h1 { text-wrap: balance; text-shadow: 0 2px 30px rgba(207, 46, 46, 0.25); }

h5 {
  font-family: "Source Sans 3", sans-serif;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* ---------- Tarjetas de libros ---------- */
.card {
  transition: transform 0.4s var(--ease);
}

@media (hover: hover) {
  .card:hover { transform: translateY(-8px); }
}

.card-face {
  border-radius: 14px;
  box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Degradado inferior para que el título siempre se lea sobre la tapa */
.card-front {
  box-shadow:
    inset 0 -110px 70px -50px rgba(0, 0, 0, 0.65),
    0 24px 40px -18px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: background-image 0.4s ease;
}

.card-back {
  background: linear-gradient(160deg, #1b1b1b 0%, #0e0e0e 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-back .text p {
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Botón "Iniciar aventura" */
.btn-leer { cursor: pointer; }

.btn-leer .rojo {
  box-shadow: none;
  transition: background-color 0.2s ease;
}

.btn-leer:hover .rojo { background-color: var(--accent-hover); }
.btn-leer:active .rojo { background-color: var(--accent-deep); }

/* ---------- Indicador lateral ---------- */
.cards-indicator li {
  border-color: rgba(255, 255, 255, 0.6);
}
.cards-indicator li:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.2);
}
.cards-indicator li.active:hover { background: var(--accent); }

/* ---------- Sección "memoria" ---------- */
.two-col {
  border-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent) 1;
  border-left: 0;
  border-right: 0;
}

.img-footer { border-radius: 6px; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.8); }

.btn {
  border-radius: 9999px;
  letter-spacing: 0.08em;
  transition: background-color 0.2s ease;
}
.btn:hover { background: var(--accent-hover); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid rgba(255, 255, 255, 0.08); }
footer a { transition: color 0.2s ease; }
footer a:hover { color: var(--accent-hover); }

/* ---------- Scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(128, 128, 128, 0.5) transparent; }

/* ---------- Menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  body, .gosh, .glitch, .spy, .fire, .masked-text { animation: none; }
  .card { transition: none; }
}
