@font-face {
  font-family: Amarante;
  src: url("/fonts/amarante.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: Esteban;
  src: url("/fonts/esteban.woff2") format("woff2");
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #1F2927;
  --paper: #FFF5D4;
  --gold: #EBD281;
  --muted: #c4bfab;
  --rule: #52605a;
  --display: Amarante, Georgia, serif;
  font-family: Esteban, Georgia, serif;
  color: var(--paper);
  background: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ol { margin: 0; }
body { min-width: 16rem; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
::selection { background: var(--gold); color: var(--ink); }
.skip { position: fixed; top: 1rem; left: 1rem; padding: .65rem 1rem; z-index: 5; background: var(--ink); transform: translateY(-180%); }
.skip:focus { transform: none; }
.gate, .cover { min-height: 100vh; min-height: 100svh; position: relative; }
.gate {
  display: grid;
  text-align: center;
}
.gate-inner {
  padding: clamp(2.5rem, 7svh, 5rem) clamp(1.75rem, 3.5vw, 3rem);
  background: var(--ink);
  box-shadow: 0 1.2rem 4rem rgb(10 17 15 / 33%);
}
.ornament { display: flex; align-items: center; justify-content: center; gap: .8rem; color: var(--gold); }
.ornament::before, .ornament::after { content: ""; height: 1px; width: 3.6rem; background: var(--rule); }
.ornament span { font: 1.55rem Georgia, serif; }
.gate-title, .cover h1 { font: 400 clamp(4.5rem, 11vw, 11rem)/1 var(--display); text-transform: uppercase; color: var(--gold); letter-spacing: -.055em; }
.gate-title { margin: .85rem 0 .5rem; font-size: clamp(3.5rem, 6.5vw, 5.25rem); }
.byline { font-size: clamp(.87rem, 1.65vw, 1.5rem); letter-spacing: .045em; text-transform: uppercase; line-height: 1.45; }
.gate .byline { font-size: clamp(.85rem, 1.2vw, 1.05rem); }
.login { max-width: 24rem; margin: 2rem auto 0; text-align: left; }
.login label { display: block; margin-bottom: .5rem; }
.login input, .login button { width: 100%; min-height: 3.15rem; border: 0; border-radius: .65rem; }
.login input { padding: .55rem .85rem; background: #65746c; color: var(--paper); font-size: 1.1rem; }
.login button { margin-top: .85rem; background: var(--gold); color: var(--ink); }
.login button:hover { background: var(--paper); }
#error { margin-top: .7rem; }
.cover { isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; overflow: hidden; background: var(--ink); text-align: center; }
.cover-art, .cover::after { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.cover-art { object-fit: cover; object-position: 50% 23%; }
.cover::after { content: ""; background: linear-gradient(180deg, transparent 33%, rgba(10,19,19,.04) 45%, rgba(12,20,19,.4) 65%, rgba(8,15,15,.84) 100%); }
.cover-type { padding: 2rem 1rem 0; margin-bottom: clamp(5.7rem, 12svh, 9rem); }
.cover h1 { font-size: clamp(4.8rem, min(17.2vw, 22svh), 15.5rem); text-shadow: 0 .02em .12em #171c1766; white-space: nowrap; }
.cover .byline { margin-top: .5em; text-shadow: 0 1px 8px #151b18; }
.read-link { position: absolute; bottom: max(1.25rem, 3svh); font-size: .93rem; padding: .6rem .25rem; text-decoration: underline; text-underline-offset: .35em; text-decoration-color: #cfc4a2; }
.read-link:hover, .book-bar a:hover, .exit:hover { color: var(--gold); }
.book { max-width: 89rem; margin: 0 auto; padding: 0 clamp(1.25rem, 5.5vw, 6rem) 6rem; outline: none; }
.book-bar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--rule); min-height: 4.25rem; }
.book-bar a, .exit { display: inline-block; padding: .7rem 0; font-size: .95rem; }
.exit { background: none; border: none; color: var(--muted); }
.spread { display: grid; grid-template-columns: minmax(13rem, 16.5rem) minmax(0, 42rem); gap: clamp(2.5rem, 7vw, 7.5rem); padding-top: clamp(2.2rem, 5.5vw, 5rem); }
.contents { position: sticky; top: 1.5rem; align-self: start; }
.contents summary { list-style: none; font: 1.4rem/1.25 var(--display); color: var(--gold); padding: 0 0 1rem; }
.contents summary::-webkit-details-marker { display: none; }
.contents nav { max-height: calc(100vh - 7rem); max-height: calc(100dvh - 7rem); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; overscroll-behavior: contain; }
.contents ol { list-style: none; padding: 0 .55rem 0 0; }
.contents li { border-top: 1px solid #404d47; }
.contents li a { display: grid; grid-template-columns: 2ch 1fr; align-items: baseline; gap: .85rem; padding: .77rem .25rem; line-height: 1.35; }
.contents li a:hover, .contents [aria-current="page"] { color: var(--gold); }
.contents [aria-current="page"] { background: #2a3732; }
.contents li a:focus-visible { outline-offset: -2px; }
.num, .chapter-number, .turn-page small { font-variant-numeric: tabular-nums; color: var(--gold); }
.num { font-size: .89rem; }
.chapter { min-width: 0; }
.chapter-number, .turn-page small { font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; }
.chapter h2 { font: 400 clamp(2.7rem, 5vw, 4.8rem)/1.06 var(--display); letter-spacing: -.04em; margin: .55rem 0 2.25rem; text-wrap: balance; overflow-wrap: break-word; }
.epigraph { color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.6; margin-bottom: 2.5rem; padding: .1rem 0 .1rem 1.1rem; border-left: 1px solid var(--gold); }
.prose { font-size: clamp(1.2rem, 1.5vw, 1.4rem); line-height: 1.72; overflow-wrap: break-word; }
.prose p + p { margin-top: .8em; }
.prose h3 { font: 400 1.55em/1.2 var(--display); margin: 1.4em 0 .65em; }
.end-mark { margin: 3.6rem 0 2rem; }
.turn-page { display: flex; justify-content: space-between; gap: 1.2rem; border-top: 1px solid var(--rule); padding-top: 1.2rem; }
.turn-page a { max-width: 48%; font-size: 1.08rem; line-height: 1.4; }
.turn-page a:hover { text-decoration: underline; text-underline-offset: .2em; }
.turn-page [rel="next"], .to-cover { margin-left: auto; text-align: right; }
.turn-page small { display: block; margin: .2rem 0 .45rem; }
@media (min-width: 761px) {
  .gate { grid-template-columns: 45% 1fr; overflow: clip; }
  .gate::before {
    content: "";
    grid-area: 1 / 2;
    background: url("/?portada=1600") center / cover no-repeat;
  }
  .gate-inner {
    grid-area: 1 / 1;
    position: relative;
    display: grid;
    align-content: center;
    padding-bottom: clamp(3rem, 15svh, 12rem);
  }
  .gate .login { width: 100%; }
  .contents summary { cursor: default; }
}
@media (max-width: 760px) {
  .gate {
    min-height: 100dvh;
    align-items: end;
    background: linear-gradient(0deg, rgb(15 23 21 / 42%), transparent 60%),
                url("/?portada=800") center / cover no-repeat var(--ink);
  }
  .gate-inner {
    --gutter: clamp(1.25rem, 6vw, 2.5rem);
    padding: 1.5rem max(var(--gutter), env(safe-area-inset-right))
             calc(1.5rem + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: 0 -.4rem 2rem rgb(10 17 15 / 22%);
  }
  .gate .ornament span { font-size: 1.2rem; }
  .gate-title { margin-top: .5rem; }
  .login { margin-top: 1.45rem; }
  .cover-art { object-position: center 40%; }
  .cover h1 { font-size: clamp(3.8rem, min(26.5vw, 24svh), 10rem); }
  .cover-type { margin-bottom: max(5.85rem, 12svh); }
  .book { padding: 0 clamp(1.2rem, 5vw, 2rem) 3.5rem; }
  .book-bar { min-height: 3.5rem; }
  .spread { display: block; padding-top: 0; }
  .contents { top: 0; z-index: 2; margin-inline: calc(-1 * clamp(1.2rem, 5vw, 2rem)); background: var(--ink); border-bottom: 1px solid var(--rule); }
  .contents summary { display: flex; align-items: center; gap: .8rem; padding: .95rem clamp(1.2rem, 5vw, 2rem); font: 1.05rem Esteban, Georgia, serif; }
  .menu-icon { position: relative; width: 1.15rem; height: .72rem; border-block: 1.5px solid currentColor; }
  .menu-icon::after { content: ""; position: absolute; inset: 50% 0 auto; border-top: 1.5px solid currentColor; transform: translateY(-50%); }
  .contents nav { position: absolute; left: 0; right: 0; max-height: 60vh; max-height: 60dvh; padding-inline: clamp(1.2rem, 5vw, 2rem); background: var(--ink); border-bottom: 1px solid var(--rule); box-shadow: 0 .8rem 1.4rem #10151366; }
  .contents li a { padding-block: .95rem; }
  .chapter { margin: 2rem auto 0; max-width: 38rem; }
  .chapter h2 { margin-bottom: 1.5rem; }
  .prose { font-size: 1.2rem; line-height: 1.65; }
}
