/* Santiago en mí — landing del libro y audiolibro
   Paleta tomada de la cubierta: verde de contraportada, oro del título, crema del papel y durazno del atardecer. */
:root {
  --noche: #131d18;
  --verde: #1b2822;
  --verde-2: #24342d;
  --verde-3: #31453c;
  --oro: #d9b25a;
  --oro-claro: #ecd08a;
  --oro-osc: #8a6a22;
  --crema: #f4ede0;
  --papel: #f8f3ea;
  --durazno: #f3c995;
  --tinta: #1d2420;
  --tinta-2: #4a524c;
  --linea-clara: rgba(244, 237, 224, .16);
  --linea-osc: rgba(29, 36, 32, .14);
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --texto: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;
  --ancho: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --radio: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--texto);
  font-size: clamp(1.08rem, 1rem + .3vw, 1.22rem);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .relleno { fill: currentColor; stroke: none; }
svg text { fill: currentColor; stroke: none; font: 700 7.2px/1 system-ui, sans-serif; }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; border-radius: 6px; }
.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saltar { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--oro); color: var(--noche); padding: .6em 1em; border-radius: 8px; font-weight: 600; }
.saltar:focus { top: 12px; }

.contenedor { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 var(--gutter); }

.etiqueta {
  font-family: var(--texto);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--oro-osc);
  margin: 0 0 1.2rem;
}
.etiqueta--oro { color: var(--oro); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .7em 1.35em;
  border-radius: 999px; border: 1.5px solid transparent;
  font-family: var(--texto); font-size: 1.05rem; font-weight: 600; letter-spacing: .02em;
  text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn--oro { background: var(--oro); color: var(--noche); }
.btn--oro:hover { background: var(--oro-claro); }
.btn--linea { border-color: currentColor; background: transparent; }
.btn--linea:hover { background: rgba(255,255,255,.08); }
.btn--tinta { background: var(--tinta); color: var(--crema); }
.btn--tinta:hover { background: var(--verde-3); }
.btn--chico { min-height: 42px; padding: .45em 1.05em; font-size: .98rem; }

/* Cabecera */
.cabecera {
  position: sticky; top: 0; z-index: 40;
  background: rgba(19, 29, 24, .88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea-clara);
  color: var(--crema);
}
.cabecera__in { max-width: var(--ancho); margin: 0 auto; padding: .55rem var(--gutter); display: flex; align-items: center; gap: 1.5rem; }
.marca { font-family: var(--display); font-weight: 700; font-size: 1.12rem; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; white-space: nowrap; margin-right: auto; }
.marca span { color: var(--oro); }
.nav { display: flex; gap: 1.6rem; }
.nav a { text-decoration: none; font-size: 1.02rem; opacity: .85; padding: .4em 0; border-bottom: 1px solid transparent; }
.nav a:hover { opacity: 1; border-bottom-color: var(--oro); }
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--linea-clara); border-radius: 10px; background: transparent; cursor: pointer; padding: 0; position: relative; }
.menu-btn span { position: absolute; left: 12px; right: 12px; height: 1.6px; background: var(--crema); transition: transform .25s, opacity .2s; }
.menu-btn span:nth-child(1) { top: 15px; } .menu-btn span:nth-child(2) { top: 21px; } .menu-btn span:nth-child(3) { top: 27px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Portada */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 620px at 88% -8%, rgba(243, 201, 149, .22), transparent 62%),
    radial-gradient(700px 500px at 0% 110%, rgba(217, 178, 90, .10), transparent 60%),
    linear-gradient(180deg, var(--noche), var(--verde) 70%);
  color: var(--crema);
}
.hero::after { /* letras fantasma como en la contraportada */
  content: "SANTIAGO"; position: absolute; left: -2vw; bottom: -0.18em;
  font-family: var(--display); font-weight: 700; font-size: clamp(5rem, 19vw, 17rem); letter-spacing: .04em;
  color: rgba(244, 237, 224, .035); pointer-events: none; white-space: nowrap; line-height: 1;
}
.hero__in { position: relative; z-index: 1; max-width: var(--ancho); margin: 0 auto; padding: clamp(2.5rem, 7vw, 6rem) var(--gutter) clamp(3.5rem, 8vw, 7rem); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.sobre { margin: 0 0 1.4rem; font-size: .9rem; letter-spacing: .2em; text-transform: uppercase; color: var(--durazno); }
.titulo { margin: 0; font-family: var(--display); font-weight: 700; line-height: .92; letter-spacing: .015em; text-transform: uppercase; }
.titulo__a { display: block; font-size: clamp(3.1rem, 9.4vw, 7.4rem); color: var(--crema); }
.titulo__b { display: block; font-size: clamp(2.7rem, 8vw, 6.3rem); color: var(--oro); margin-top: -.12em; padding-top: .2em; line-height: 1; background: linear-gradient(180deg, var(--oro-claro), var(--oro) 55%, #b98d34); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.subtitulo { margin: 1.3rem 0 0; font-style: italic; font-size: clamp(1.3rem, 1rem + 1.3vw, 1.85rem); line-height: 1.3; color: var(--crema); }
.filete { display: block; width: 84px; height: 2px; background: var(--oro); margin: 1.5rem 0 1.1rem; }
.autor-linea { margin: 0; font-size: clamp(1.2rem, 1rem + .8vw, 1.5rem); font-weight: 500; letter-spacing: .04em; }
.hero__lema { margin: .35rem 0 0; font-style: italic; color: rgba(244, 237, 224, .7); }
.hero__acciones { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }
.hero__dato { margin: 1.3rem 0 0; font-size: .98rem; color: rgba(244, 237, 224, .66); }
.hero__libro { margin: 0; justify-self: center; width: min(100%, 380px); position: relative; }
.hero__libro::before { /* lomo */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 14px; z-index: 2; border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, rgba(0,0,0,.42), rgba(255,255,255,.12) 45%, rgba(0,0,0,.12));
}
.hero__libro img { border-radius: 3px 6px 6px 3px; box-shadow: 0 2px 0 rgba(255,255,255,.06), 0 30px 60px -18px rgba(0,0,0,.75), 0 12px 24px -10px rgba(0,0,0,.55); }

/* La obra */
.obra { background: var(--papel); }
.obra__in { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 6rem); padding-top: clamp(4rem, 9vw, 7.5rem); padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.obra__cita blockquote { margin: 0; position: sticky; top: 110px; }
.obra__cita blockquote p { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(1.75rem, 1.2rem + 2vw, 2.7rem); line-height: 1.18; color: var(--verde); }
.obra__cita blockquote footer { margin-top: 1.2rem; font-style: italic; font-size: 1.25rem; color: var(--oro-osc); }
.obra__texto p { margin: 0 0 1.15em; max-width: 62ch; }
.capitular::first-letter { font-family: var(--display); font-weight: 700; float: left; font-size: 3.6em; line-height: .82; margin: .08em .1em 0 0; color: var(--oro-osc); }
.ficha { margin: 2.2rem 0 0; border-top: 1px solid var(--linea-osc); }
.ficha div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--linea-osc); }
.ficha dt { font-size: .82rem; letter-spacing: .18em; text-transform: uppercase; color: var(--tinta-2); padding-top: .2em; }
.ficha dd { margin: 0; }
.pregunta { background: var(--crema); border-top: 1px solid var(--linea-osc); border-bottom: 1px solid var(--linea-osc); text-align: center; padding: clamp(3rem, 7vw, 5rem) 0; }
.pregunta__q { margin: 0 auto; max-width: 24ch; font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 1.1rem + 2vw, 2.4rem); line-height: 1.2; color: var(--verde); }
.pregunta__r { margin: 1.1rem 0 0; font-style: italic; font-size: 1.25rem; color: var(--tinta-2); }
.pregunta__r em { color: var(--oro-osc); }

/* Audiolibro */
.audio { background: linear-gradient(180deg, var(--verde) 0%, var(--noche) 100%); color: var(--crema); padding: clamp(4rem, 9vw, 7rem) 0; scroll-margin-top: 60px; }
.audio__cab { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.audio__cab h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.3rem); line-height: 1.08; }
.audio__cab h2 em { font-style: normal; color: var(--oro); }
.audio__intro { margin: 1rem 0 0; color: rgba(244, 237, 224, .78); }
.audio__grid { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }

.reproductor {
  position: sticky; top: 84px;
  background: linear-gradient(160deg, var(--verde-3), var(--verde-2) 60%);
  border: 1px solid rgba(217, 178, 90, .3);
  border-radius: 20px;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  box-shadow: 0 24px 50px -24px rgba(0,0,0,.7);
}
.rep__cabeza { display: flex; gap: 1rem; align-items: center; }
.rep__miniatura { width: 74px; height: auto; border-radius: 3px; box-shadow: 0 8px 18px -6px rgba(0,0,0,.6); flex: none; }
.rep__info { min-width: 0; }
.rep__etiqueta { margin: 0; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--oro); }
.rep__titulo { margin: .2rem 0 0; font-size: 1.32rem; font-weight: 600; line-height: 1.22; overflow-wrap: anywhere; }
.rep__pos { margin: .3rem 0 0; font-size: .92rem; color: rgba(244, 237, 224, .62); }

.rep__barra { margin-top: 1.4rem; }
.progreso {
  --p: 0%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0; touch-action: pan-y;
}
.progreso::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--oro) var(--p), rgba(244,237,224,.2) var(--p)); }
.progreso::-moz-range-track { height: 6px; border-radius: 6px; background: rgba(244,237,224,.2); }
.progreso::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--oro); }
.progreso::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: var(--crema); border: 3px solid var(--oro); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.progreso::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--crema); border: 3px solid var(--oro); }
.progreso:focus-visible { outline: none; }
.progreso:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(217,178,90,.45); }
.progreso:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(217,178,90,.45); }
.rep__tiempos { display: flex; justify-content: space-between; font-size: .95rem; color: rgba(244, 237, 224, .75); font-variant-numeric: tabular-nums; margin-top: .1rem; }

.rep__controles { display: flex; align-items: center; justify-content: space-between; gap: .3rem; margin-top: 1rem; }
.ctl {
  width: 52px; height: 52px; border-radius: 50%; border: 0; background: transparent; color: var(--crema);
  display: inline-grid; place-items: center; cursor: pointer; transition: background .2s, color .2s; position: relative;
}
@media (hover: hover) { .ctl:hover { background: rgba(244, 237, 224, .1); } }
.ctl:disabled { opacity: .35; cursor: default; background: transparent; }
.ctl svg { width: 28px; height: 28px; grid-area: 1 / 1; }
.ctl--play { width: 74px; height: 74px; background: var(--oro); color: var(--noche); box-shadow: 0 10px 24px -8px rgba(217,178,90,.6); }
.ctl--play:hover { background: var(--oro-claro); }
.ctl--play svg { width: 32px; height: 32px; }
.i-pausa { display: none; }
.sonando .i-play { display: none; }
.sonando .i-pausa { display: block; }
.giro { grid-area: 1 / 1; width: 100%; height: 100%; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--noche); opacity: 0; }
.cargando .giro { opacity: .55; animation: girar .9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.rep__pie { display: flex; align-items: center; gap: .9rem; margin-top: 1rem; min-height: 40px; }
.vel { min-width: 58px; min-height: 40px; border-radius: 999px; border: 1px solid var(--linea-clara); background: transparent; cursor: pointer; font-variant-numeric: tabular-nums; font-weight: 600; }
.vel:hover { border-color: var(--oro); }
.rep__estado { margin: 0; font-size: .95rem; color: rgba(244, 237, 224, .7); font-style: italic; }
.rep__error { margin-top: 1rem; padding: .9rem 1rem; border-radius: 12px; background: rgba(176, 72, 52, .22); border: 1px solid rgba(240, 150, 120, .45); }
.rep__error p { margin: 0 0 .7rem; font-size: 1rem; }
.rep__error .btn { color: var(--crema); }

/* Lista */
.pistas__cab { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: .9rem; border-bottom: 1px solid rgba(217, 178, 90, .4); }
.pistas__cab h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: .04em; }
.pistas__cab p { margin: 0; color: rgba(244, 237, 224, .62); font-size: .98rem; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { border-bottom: 1px solid var(--linea-clara); }
.pista {
  width: 100%; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; align-items: center; gap: .8rem;
  padding: .85rem .6rem; border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: 10px;
  transition: background .2s;
}
.pista:hover { background: rgba(244, 237, 224, .06); }
.pista__n { font-variant-numeric: tabular-nums; color: rgba(244, 237, 224, .5); font-size: .95rem; display: grid; place-items: center; height: 2.2rem; }
.pista__txt { min-width: 0; }
.pista__etq { display: block; font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; color: rgba(244, 237, 224, .58); }
.pista__tit { display: block; font-size: 1.12rem; line-height: 1.3; overflow-wrap: anywhere; }
.pista__dur { font-variant-numeric: tabular-nums; color: rgba(244, 237, 224, .6); font-size: .95rem; }
.lista li.es-cuaderno .pista__tit { font-style: italic; }
.lista li.es-cuaderno .pista__etq { color: var(--durazno); }
.lista li.activa .pista { background: rgba(217, 178, 90, .14); }
.lista li.activa .pista__tit { color: var(--oro-claro); }
.lista li.activa .pista__n { color: var(--oro); }
.lista li.con-error .pista__dur { color: #f0a08a; }
.ondas { display: inline-flex; gap: 2px; align-items: flex-end; height: 16px; }
.ondas i { width: 3px; background: var(--oro); border-radius: 2px; height: 30%; }
.sonando-lista .ondas i { animation: onda 1s ease-in-out infinite; }
.sonando-lista .ondas i:nth-child(2) { animation-delay: -.3s; }
.sonando-lista .ondas i:nth-child(3) { animation-delay: -.6s; }
@keyframes onda { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.pistas__nota { margin: 1.2rem 0 0; font-size: .98rem; color: rgba(244, 237, 224, .66); }

/* Carta */
.carta { background: var(--crema); text-align: center; padding: clamp(4rem, 9vw, 7rem) 0; }
.carta__in { max-width: 860px; }
.carta blockquote { margin: 0 0 2.2rem; }
.carta blockquote p { margin: 0; font-style: italic; font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); line-height: 1.45; color: var(--tinta-2); }
.carta blockquote .carta__fuerte { margin-top: 1.2rem; font-style: normal; font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem, 1.1rem + 2.6vw, 3rem); line-height: 1.15; color: var(--verde); }

/* Autor */
.autor { background: var(--papel); padding: clamp(4rem, 9vw, 7rem) 0; border-top: 1px solid var(--linea-osc); }
.autor__in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 6rem); }
.autor__nombre h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); line-height: 1.08; color: var(--verde); }
.autor__lugar { margin: 1rem 0 0; font-style: italic; color: var(--oro-osc); font-size: 1.2rem; }
.autor__texto p { margin: 0 0 1.1em; max-width: 62ch; }
.autor__apodo { padding-left: 1.2rem; border-left: 2px solid var(--oro); font-style: italic; color: var(--tinta-2); }

/* Pie */
.pie { background: var(--noche); color: rgba(244, 237, 224, .78); padding: 3rem 0 calc(3rem + var(--mini-alto, 0px)); font-size: 1rem; }
.pie__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 3rem; }
.pie p { margin: 0 0 .3rem; }
.pie__marca { font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: .08em; text-transform: uppercase; color: var(--crema); }
.pie__marca span { color: var(--oro); }
.pie__nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-content: start; }
.pie__nav a { text-decoration: none; padding: .3em 0; }
.pie__nav a:hover { color: var(--oro); }
.pie__legal { grid-column: 1 / -1; border-top: 1px solid var(--linea-clara); padding-top: 1.3rem; font-size: .95rem; color: rgba(244, 237, 224, .6); }

/* Mini reproductor */
.mini {
  position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 50;
  transform: translateX(-50%); width: min(calc(100% - 24px), 560px);
  display: flex; align-items: center; gap: .6rem; padding: .5rem .5rem .5rem 1rem;
  background: rgba(27, 40, 34, .96); color: var(--crema);
  border: 1px solid rgba(217, 178, 90, .4); border-radius: 16px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.6);
  overflow: hidden;
}
.mini[hidden] { display: none; }
.mini__barra { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(244,237,224,.15); }
.mini__barra span { display: block; height: 100%; width: 0; background: var(--oro); }
.mini__info { flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; cursor: pointer; padding: .2rem 0; }
.mini__etq { display: block; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--oro); }
.mini__tit { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02rem; }
.ctl--mini { width: 48px; height: 48px; background: var(--oro); color: var(--noche); }
.ctl--mini:hover { background: var(--oro-claro); }
.ctl--mini svg { width: 24px; height: 24px; }

/* Responsive */
@media (max-width: 960px) {
  .audio__grid { grid-template-columns: minmax(0, 1fr); }
  .reproductor { position: relative; top: 0; }
}
@media (max-width: 860px) {
  .cabecera__in { gap: .6rem; }
  .menu-btn { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; padding: .4rem var(--gutter) 1rem;
    background: var(--noche); border-bottom: 1px solid var(--linea-clara);
    display: none;
  }
  .nav.abierta { display: flex; }
  .nav a { padding: .85rem 0; border-bottom: 1px solid var(--linea-clara); font-size: 1.12rem; }
  .nav a:last-child { border-bottom: 0; }
  .obra__in, .autor__in { grid-template-columns: minmax(0, 1fr); }
  .obra__cita blockquote { position: static; }
}
@media (max-width: 760px) {
  .hero__in { grid-template-columns: minmax(0, 1fr); text-align: left; }
  .hero__libro { order: -1; width: min(52vw, 230px); }
  .hero__in { padding-top: 2rem; }
  .hero__acciones .btn { flex: 1 1 100%; }
  .pie__in { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .marca { font-size: .98rem; letter-spacing: .05em; }
  .cabecera .btn--chico { padding: .45em .8em; }
  .ctl { width: 46px; height: 46px; }
  .ctl--play { width: 66px; height: 66px; }
  .rep__miniatura { width: 60px; }
  .pista { grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .6rem; padding: .8rem .3rem; }
  .ficha div { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
}
@media (max-width: 340px) {
  .cabecera .btn--chico { display: none; }
}
