/* Tienda Yoselin Goncalves — hoja de estilos
   Concepto: una luz encendida en la niebla.
   Gris niebla / bosque de noche, tinta, y un único acento ámbar (la ventana encendida). */

:root {
  color-scheme: light;
  --paper: #dcdeda;
  --paper-2: #cfd2cd;
  --ink: #16191a;
  --graphite: #4f5451;
  --rule: #b6bab5;
  --lamp: #d4952f;
  --lamp-hover: #e3a645;
  --lamp-ink: #1b1406;
  --band-bg: #151917;
  --band-ink: #dde0db;
  --band-muted: #9ea49f;
  --focus: #1f5f8b;

  --display: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --text: "Instrument Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3rem);
  --step-4: clamp(2.4rem, 1.7rem + 3.6vw, 4.6rem);

  --measure: 64ch;
  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #121614;
    --paper-2: #1a1f1c;
    --ink: #dde0db;
    --graphite: #a0a6a1;
    --rule: #2d3430;
    --lamp: #e0a23f;
    --lamp-hover: #ecb459;
    --lamp-ink: #1b1406;
    --band-bg: #1c221f;
    --band-ink: #dde0db;
    --band-muted: #a0a6a1;
    --focus: #8cc4ef;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 0.5rem;
  background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 0.5rem; }

/* Encabezado */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-block: 1.1rem;
}
.wordmark {
  font-family: var(--display); font-size: var(--step-2); line-height: 1;
  text-decoration: none; letter-spacing: 0.01em;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: var(--step--1); }
.site-nav a { text-decoration: none; padding-block: 0.35rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.7rem 1.4rem;
  font: 600 var(--step-0)/1.2 var(--text);
  text-decoration: none; border-radius: 3px; border: 1px solid transparent;
  cursor: pointer; transition: background-color 0.15s ease;
}
.btn-lamp { background: var(--lamp); color: var(--lamp-ink); }
.btn-lamp:hover { background: var(--lamp-hover); }
.btn-quiet { border-color: currentColor; color: inherit; background: transparent; }
.btn-quiet:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* Portada de inicio */
.hero { padding-block: clamp(3.5rem, 10vw, 8rem) clamp(3rem, 8vw, 6rem); }
.hero-line {
  font-family: var(--display); font-weight: 400;
  font-size: var(--step-4); line-height: 1.08; letter-spacing: -0.005em;
  max-width: 17ch; margin: 0;
  animation: lamp 1.9s ease-out both;
}
.hero-source { margin: 1.25rem 0 0; color: var(--graphite); font-size: var(--step--1); }
.hero-pitch { margin: 2.5rem 0 0; max-width: 44ch; font-size: var(--step-1); line-height: 1.5; }

@keyframes lamp {
  0% { opacity: 0.08; }
  18% { opacity: 0.85; }
  26% { opacity: 0.25; }
  40% { opacity: 1; }
  48% { opacity: 0.6; }
  60%, 100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .hero-line { animation: none; } }

/* Secciones */
.section { padding-block: clamp(3rem, 8vw, 5.5rem); border-top: 1px solid var(--rule); }
.section-title { font-family: var(--display); font-weight: 400; font-size: var(--step-3); line-height: 1.1; margin: 0 0 2.5rem; }

/* Catálogo */
.books { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(3rem, 7vw, 4.5rem); }
.book {
  display: grid; grid-template-columns: minmax(7.5rem, 13rem) 1fr;
  gap: clamp(1.25rem, 4vw, 3rem); align-items: start;
}
.book-cover { box-shadow: 0 1px 2px rgb(0 0 0 / 0.25), 0 12px 28px -12px rgb(0 0 0 / 0.45); }
.book h3 { font-family: var(--display); font-weight: 400; font-size: var(--step-2); line-height: 1.15; margin: 0; }
.book h3 a { text-decoration: none; }
.book h3 a:hover { text-decoration: underline; }
.book-kind { margin: 0.4rem 0 0; color: var(--graphite); font-size: var(--step--1); }
.book-hook { margin: 1rem 0 0; font-family: var(--display); font-style: italic; font-size: var(--step-1); line-height: 1.35; max-width: 40ch; }
.book-text { margin: 1rem 0 0; max-width: var(--measure); }
.book .btn-row { margin-top: 1.25rem; }
@media (max-width: 34rem) {
  .book { grid-template-columns: 6.5rem 1fr; }
  .book-text { display: none; }
}

/* Banda de la colección */
.band { background: var(--band-bg); color: var(--band-ink); padding-block: clamp(3.5rem, 9vw, 6rem); }
.band-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 4rem); align-items: center; }
.band h2 { font-family: var(--display); font-weight: 400; font-size: var(--step-3); line-height: 1.1; margin: 0; }
.band p { max-width: 46ch; }
.band .muted { color: var(--band-muted); font-size: var(--step--1); }
.fan { display: flex; justify-content: center; padding: 1.5rem 0 1rem; }
.fan img {
  width: clamp(5.5rem, 15vw, 9.5rem); margin-inline: -1.6rem;
  box-shadow: 0 14px 30px -10px rgb(0 0 0 / 0.7); border: 1px solid rgb(255 255 255 / 0.08);
}
.fan img:nth-child(1) { transform: rotate(-9deg) translateY(10px); }
.fan img:nth-child(2) { transform: rotate(-3deg); z-index: 1; }
.fan img:nth-child(3) { transform: rotate(3deg); z-index: 2; }
.fan img:nth-child(4) { transform: rotate(9deg) translateY(10px); z-index: 3; }
@media (max-width: 46rem) { .band-grid { grid-template-columns: 1fr; } .fan { order: -1; } }

/* Relato gratis */
.freebie { display: grid; grid-template-columns: minmax(7rem, 12rem) 1fr; gap: clamp(1.25rem, 4vw, 3rem); align-items: center; }
.freebie h2 { margin-bottom: 1rem; }
.freebie p { max-width: 50ch; margin: 0; }

/* Autora */
.author { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(1.5rem, 5vw, 4rem); }
.author h2 { margin: 0; }
.author p { margin: 0 0 1rem; max-width: var(--measure); }
.honors { margin: 1.5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.honors li { padding: 0.75rem 0; border-bottom: 1px solid var(--rule); font-size: var(--step--1); }
@media (max-width: 46rem) { .author, .freebie { grid-template-columns: 1fr; } .freebie img { max-width: 10rem; } }

/* Página de libro */
.book-page { padding-block: clamp(2rem, 6vw, 4rem) clamp(3rem, 8vw, 5rem); }
.crumb { font-size: var(--step--1); color: var(--graphite); margin: 0 0 2rem; }
.book-layout { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: clamp(2rem, 6vw, 4.5rem); align-items: start; }
.book-aside { position: sticky; top: 1.5rem; }
.book-page h1 { font-family: var(--display); font-weight: 400; font-size: var(--step-4); line-height: 1.05; margin: 0; }
.book-page .book-kind { font-size: var(--step-0); }
.lede { font-family: var(--display); font-style: italic; font-size: var(--step-2); line-height: 1.3; margin: 1.5rem 0 0; max-width: 30ch; }
.buy { margin-top: 2rem; padding: 1.25rem 0; border-block: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.price { font-family: var(--display); font-size: var(--step-3); line-height: 1; }
.buy-note { flex-basis: 100%; margin: 0; font-size: var(--step--1); color: var(--graphite); }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.1rem; }
.book-page .prose { margin-top: 2.25rem; }
.quotes { margin: 2.5rem 0 0; display: grid; gap: 1.75rem; max-width: var(--measure); }
.quotes blockquote { margin: 0; padding-left: 1.25rem; border-left: 2px solid var(--lamp); }
.quotes p { margin: 0; font-family: var(--display); font-size: var(--step-1); line-height: 1.4; }
.quotes footer { margin-top: 0.5rem; font-size: var(--step--1); color: var(--graphite); }
.facts { margin: 2.5rem 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; font-size: var(--step--1); max-width: var(--measure); }
.facts dt { color: var(--graphite); }
.facts dd { margin: 0; }
.upsell { margin-top: 3rem; padding: 1.5rem; background: var(--paper-2); border-radius: 3px; max-width: var(--measure); }
.upsell h2 { font-family: var(--display); font-weight: 400; font-size: var(--step-2); margin: 0 0 0.5rem; }
.upsell p { margin: 0; }
@media (max-width: 46rem) {
  .book-layout { grid-template-columns: 1fr; }
  .book-aside { position: static; max-width: 14rem; }
}

/* Páginas legales */
.legal { padding-block: clamp(2.5rem, 7vw, 4.5rem); }
.legal h1 { font-family: var(--display); font-weight: 400; font-size: var(--step-3); line-height: 1.1; margin: 0 0 0.5rem; }
.legal h2 { font-size: var(--step-1); margin: 2.25rem 0 0.5rem; line-height: 1.3; }
.legal .updated { color: var(--graphite); font-size: var(--step--1); margin: 0 0 2rem; }
.legal ul, .legal ol { padding-left: 1.25rem; }
.legal li { margin-bottom: 0.5rem; }

/* Pie */
.site-foot { border-top: 1px solid var(--rule); padding-block: 2.5rem 6rem; font-size: var(--step--1); color: var(--graphite); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.site-foot p { margin: 0; }

/* Aviso de cookies */
.consent {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  background: var(--band-bg); color: var(--band-ink);
  padding: 1rem var(--gutter); padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1.25rem;
  font-size: var(--step--1); box-shadow: 0 -8px 24px -12px rgb(0 0 0 / 0.5);
}
.consent[hidden] { display: none; }
.consent p { margin: 0; max-width: 52ch; }
.consent .btn { min-height: 2.5rem; padding: 0.5rem 1rem; font-size: var(--step--1); }
.consent .btn-quiet { color: var(--band-ink); }

.notfound { padding-block: clamp(4rem, 12vw, 9rem); }
.notfound h1 { font-family: var(--display); font-weight: 400; font-size: var(--step-4); line-height: 1.05; margin: 0; max-width: 16ch; }
