:root {
  color-scheme: dark;
  --night: #140d0f;
  --ink: #2d1919;
  --muted: #694943;
  --cream: #f6e9d4;
  --paper: #eddbc0;
  --gold: #d4a47c;
  --ember: #e88d77;
  --ruby: #84232c;
  --line: #b16f5e;
  --display: Georgia, "Times New Roman", serif;
  --body: system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font: 1rem/1.65 var(--body);
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 5px; }
[hidden] { display: none !important; }
.shell { width: min(1160px, calc(100% - 56px)); margin-inline: auto; }
.skip {
  position: absolute;
  top: .5rem;
  left: 1rem;
  z-index: 3;
  background: var(--cream);
  color: var(--ink);
  padding: .5rem 1rem;
  transform: translateY(-150%);
}
.skip:focus { transform: none; }

.masthead { border-bottom: 1px solid #68333a; background: #170e11; }
.masthead .shell {
  min-height: 82px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem 2rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  font: 1.25rem/1.2 var(--display);
  white-space: nowrap;
}
.brand img { width: 36px; height: 36px; }
.site-nav { display: flex; gap: .25rem 1.1rem; flex-wrap: wrap; }
.site-nav a {
  text-decoration: none;
  color: #ddc3b6;
  font-size: .86rem;
  padding: .45rem 0;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ember); border-color: var(--ember); }

.hero {
  background:
    radial-gradient(ellipse at 74% 44%, #67232b 0, #3c161d 24%, transparent 64%),
    radial-gradient(ellipse at 18% 100%, #34151b, transparent 56%),
    #190e12;
  padding: clamp(1.15rem, 3vw, 2rem) 0;
}
.frame {
  position: relative;
  border: 3px double #a53a3d;
  isolation: isolate;
}
.corner {
  position: absolute;
  width: 62px;
  height: 62px;
  pointer-events: none;
  background: url("esquina.svg") center / contain no-repeat;
}
.corner:nth-child(1) { top: 4px; left: 4px; }
.corner:nth-child(2) { top: 4px; right: 4px; scale: -1 1; }
.corner:nth-child(3) { bottom: 4px; left: 4px; scale: 1 -1; }
.corner:nth-child(4) { bottom: 4px; right: 4px; scale: -1; }
.hero .frame {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  align-items: center;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 4.8rem);
  min-height: 470px;
  box-shadow: inset 0 0 54px #10070a82;
}
.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 650;
}
.hero h1 {
  margin: 0;
  font: 400 clamp(3rem, 7.3vw, 6.5rem)/.89 var(--display);
  letter-spacing: -.065em;
  text-wrap: balance;
}
.hero h1 span { display: block; }
.hero h1 span:last-child { color: #e7be9b; font-style: italic; }
.lead { margin: 1.4rem 0 1.85rem; max-width: 42ch; color: #e1cbc0; }
.cta {
  display: inline-flex;
  gap: .8rem;
  align-items: center;
  padding: .7rem 1rem;
  border: 1px solid #c36761;
  background: #862f36;
  color: #fff3e1;
  text-decoration: none;
  font-size: .88rem;
  transition: background-color .2s;
}
.cta:hover { background: #a13d43; }
.book-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; }
.secondary-action { color: var(--gold); font-size: .86rem; text-underline-offset: .2em; }
.hero-mark {
  margin: 0;
  position: relative;
  display: grid;
  place-items: center;
}
.hero-mark::before {
  content: "";
  position: absolute;
  width: min(119%, 410px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 26px, #d56b6635 27px, transparent 28px 50px);
  mask-image: radial-gradient(circle, #000 39%, transparent 70%);
}
.hero-mark img { position: relative; width: min(92%, 320px); height: auto; filter: drop-shadow(0 0 24px #d4394f6b); }

.directory { padding: 2rem 0 3.25rem; }
.directory h2 { margin: 0 0 1rem; font: 400 clamp(1.8rem, 4vw, 2.65rem)/1.2 var(--display); }
.directory ul {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.directory li { display: flex; }
.card {
  position: relative;
  display: grid;
  align-content: start;
  gap: .32rem;
  flex: 1;
  min-width: 0;
  padding: 1.1rem 2.35rem 1.25rem 1.2rem;
  border: 1px solid #62333a;
  background: linear-gradient(135deg, #321a20, #201217);
  text-decoration: none;
  transition: translate .2s, border-color .2s, background-color .2s;
}
.card:hover, .card:focus-visible { translate: 0 -3px; border-color: var(--ember); }
.card strong { font: 400 1.4rem/1.2 var(--display); }
.card small { color: #dbc0b3; font-size: .83rem; line-height: 1.5; }
.card > span { position: absolute; right: .9rem; top: 1.05rem; color: var(--ember); }

.reading { max-width: 900px; margin-block: clamp(1.35rem, 4vw, 3.5rem); }
.paper {
  color-scheme: light;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 48% 11%, #fff0d8 0, transparent 64%),
    linear-gradient(90deg, #cfaa8c, var(--paper) 7%, var(--paper) 93%, #cfaa8c);
  padding: clamp(2rem, 6vw, 4.5rem);
  box-shadow: inset 0 0 30px 5px #5d251f76, 0 16px 55px #0005;
  font: 1.06rem/1.65 var(--display);
  overflow-wrap: anywhere;
}
.paper :focus-visible { outline-color: var(--ruby); }
.paper a { color: var(--ruby); }
.page-heading { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1.2rem; }
.page-heading > img { display: block; width: 48px; height: 48px; margin: 0 0 .8rem; }
.page-heading h1 { margin: 0; font: 400 clamp(2.3rem, 6vw, 4.65rem)/1 var(--display); letter-spacing: -.045em; }
.page-heading p:last-child { margin-bottom: 0; }
.chapter > :first-child { margin-top: 0; }
.chapter > :last-child { margin-bottom: 0; }
.warn { margin: 0 0 1.25rem; padding: .55rem .8rem; border-left: 2px solid var(--ruby); background: #a54b3920; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th { color: var(--muted); text-align: left; font: 600 .82rem/1.5 var(--body); }
.paper th, .paper td { padding: .58rem .4rem; border-bottom: 1px solid #a96f584d; }
.bar {
  display: inline-block;
  height: .42rem;
  max-width: 100%;
  background: linear-gradient(90deg, #962f38, #b7574c);
  border-radius: 1px;
  transform-origin: left;
  animation: fill-in .65s .2s backwards;
}
.rank-value { display: block; color: var(--muted); font: .8rem var(--body); }
.ranking td:nth-child(2) { width: 55%; }
.post { display: grid; grid-template-columns: minmax(96px, 116px) 1fr; gap: 1rem; padding-block: 1rem; border-bottom: 1px solid #a96f584d; }
.pu { color: var(--muted); font: .76rem/1.4 var(--body); }
.pu b { display: block; color: var(--ink); }
.av {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: .35rem 0;
  border-radius: 50%;
  color: var(--cream);
  font: 1rem var(--display);
}
.pb h2 { margin: 0; font: 400 1.45rem/1.2 var(--display); }
.pb p { margin: .65rem 0; }
.pb .d { display: block; margin-bottom: .25rem; color: var(--muted); font: .75rem var(--body); }
blockquote { margin: 1rem 0; border-left: 2px solid var(--ruby); padding-left: .9rem; font-style: italic; }
blockquote cite { display: block; font: 600 .8rem var(--body); }
.sig { font-style: italic; color: var(--muted); }
details { border-bottom: 1px solid #a96f586b; }
summary { cursor: pointer; padding: .9rem 0; font-weight: bold; color: #631c25; }
details > div { padding: 0 0 1rem 1.15rem; }
details > div > :first-child { margin-top: 0; }
details[open] > div { animation: reveal .3s ease-out; }
.chl { columns: 2; column-gap: 2rem; padding-left: 1.25rem; }
.chl li { break-inside: avoid; padding-bottom: .35rem; }
.chapter-guide { list-style: none; padding: 0; }
.chapter-guide li { border-bottom: 1px solid #a96f5838; padding: .5rem 0; }
.chapter-guide li:target { background: #a54b3920; }
.chapter-guide a { text-decoration-thickness: .06em; text-underline-offset: .14em; }
.pdf-page { color: var(--muted); font: .76rem/1.5 var(--body); }
.book-edition {
  display: grid;
  grid-template-columns: minmax(110px, .7fr) minmax(0, 1.3fr);
  gap: clamp(1rem, 4vw, 2rem);
  align-items: start;
}
.book-cover { display: block; width: 100%; height: auto; border: 1px solid #5f2929; box-shadow: 0 8px 20px #2810144a; }
.book-edition h2, .moments h2 { margin: 0 0 .5rem; font: 400 1.5rem/1.2 var(--display); }
.book-edition dl { margin: .75rem 0 1.25rem; }
.book-edition dt { font-weight: bold; }
.book-edition dd { margin: 0 0 .4rem; }
.paper a.cta { color: #fff3e1; }
.moments > article { padding-block: 1rem; border-bottom: 1px solid #a96f586b; }
.moments > article p { margin: .55rem 0; }
.fc { padding-left: 1.3rem; }
.fc li { margin: .62rem 0; }
.sm, .stats { color: var(--muted); font: .82rem/1.55 var(--body); }
.stats { padding-top: 1rem; }
.spoiler {
  max-width: 100%;
  background: #f6e5c9;
  color: #631c25;
  border: 1px solid #aa6655;
  border-radius: 2px;
  font: 600 .76rem/1.25 var(--body);
  padding: .15rem .4rem;
  cursor: pointer;
}
.spoiler-text { background: #ac665628; }

.footer { border-top: 1px solid #68333a; margin-top: 1rem; }
.footer .shell { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; justify-content: space-between; padding-block: 1.35rem; }
.footer p { margin: 0; }
.footer p, .footer a:not(.brand) { color: #dbc0b3; font-size: .8rem; }

.hero-copy, .hero-mark, .page-heading, .chapter, .directory li { animation: reveal .55s ease-out both; }
.hero-mark, .chapter { animation-delay: .13s; }
.directory li:nth-child(3n + 2) { animation-delay: .07s; }
.directory li:nth-child(3n + 3) { animation-delay: .14s; }
@keyframes reveal { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fill-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 800px) {
  .masthead .shell { padding-block: .65rem; }
  .directory ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero .frame { min-height: 0; }
}
@media (max-width: 580px) {
  .shell { width: calc(100% - 24px); }
  .site-nav { gap: .15rem .75rem; }
  .site-nav a { font-size: .8rem; }
  .hero .frame { grid-template-columns: 1fr; text-align: center; gap: 1.1rem; }
  .hero-mark { grid-row: 1; }
  .hero-mark img { width: clamp(116px, 35vw, 175px); }
  .lead { margin-inline: auto; }
  .book-actions { justify-content: center; }
  .book-edition { grid-template-columns: 1fr; }
  .book-cover { max-width: 230px; }
  .directory ul { grid-template-columns: 1fr; gap: .65rem; }
  .post { grid-template-columns: 1fr; gap: .4rem; }
  .pu { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
  .chl { columns: 1; }
  th.h, td.h { display: none; }
  .corner { width: 39px; height: 39px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
