
/* Concepto: estudio de detective. Fondo negro cálido, dorado como único acento, series numeradas como los carruseles de Instagram. */
:root {
  --bg: #0e0c0a;
  --surface: #171410;
  --line: #2c261e;
  --fg: #ece6d9;
  --muted: #a89f8e;
  --accent: #d9a640;
  --on-accent: #0e0c0a;
  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --logo: url("logo-detective.png");
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f2efea; --surface: #fbfaf7; --line: #d8d2c6; --fg: #16130f; --muted: #5c554a; --accent: #85570a; --on-accent: #fffaf0;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f2efea; --surface: #fbfaf7; --line: #d8d2c6; --fg: #16130f; --muted: #5c554a; --accent: #85570a; --on-accent: #fffaf0;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.125rem/1.65 var(--body);
  padding-inline: max(16px, 4vw);
  padding-block: 0 3rem;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.wrap { max-width: 72rem; margin-inline: auto; }

.label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Encabezado */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-block: 0.7rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; font-family: var(--display); font-weight: 800; font-stretch: 90%; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; margin-right: auto; }
.logo { display: block; flex: none; border-radius: 50%; background: #fff var(--logo) center / cover no-repeat; aspect-ratio: 1; }
.brand .logo { width: 2.4rem; }
.brand-text { display: grid; gap: 0.15rem; line-height: 1.1; }
.brand .by { font: italic 400 0.88rem/1.2 var(--body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.nav { display: flex; gap: 1.4rem; overflow-x: auto; min-width: 0; white-space: nowrap; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { font-family: var(--display); font-weight: 600; font-size: 0.76rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); padding-block: 0.4rem; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.theme { font: 600 0.72rem var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); background: none; border: 1px solid var(--line); padding: 0.4rem 0.7rem; cursor: pointer; }
.theme:hover { color: var(--fg); border-color: var(--muted); }
@media (max-width: 44rem) {
  .nav { order: 3; flex-basis: 100%; }
}

/* Portada */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; padding-block: 2.5rem 2.75rem; align-items: center; }
.hero .logo { width: 8.5rem; order: -1; }
.hero h1 { font-family: var(--display); font-weight: 800; font-stretch: 88%; font-size: clamp(2.5rem, 8.5vw, 5rem); line-height: 1.02; letter-spacing: -0.015em; text-wrap: balance; margin-block: 0.9rem 1.1rem; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.sub { font-size: 1.3rem; color: var(--muted); max-width: 34rem; }
@media (min-width: 48rem) {
  .hero { grid-template-columns: minmax(0, 1fr) auto; gap: 3rem; }
  .hero .logo { width: clamp(13rem, 27vw, 19rem); order: 0; }
}

/* Bloques de sección en portada */
.block-title { font-family: var(--display); font-weight: 800; font-stretch: 90%; font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; padding-block: 0.4rem 1rem; }
.tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 3rem; }
.tile { background: var(--surface); padding: 1.5rem; display: grid; gap: 0.6rem; align-content: start; min-width: 0; }
.tile h2 { font-family: var(--display); font-weight: 800; font-stretch: 90%; font-size: 1.7rem; line-height: 1.1; }
.tile p { color: var(--muted); font-size: 1rem; line-height: 1.55; }
.tile .go { font-family: var(--display); font-weight: 700; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.tile:hover h2 { color: var(--accent); }
@media (min-width: 52rem) {
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tile { grid-column: span 2; }
}

/* Listas de entradas */
.rows { display: grid; }
.row { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; gap: 0.5rem 1rem; align-items: baseline; padding-block: 1.3rem; border-top: 1px solid var(--line); }
.row:last-child { border-bottom: 1px solid var(--line); }
.row .n { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 1.6rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.row h3 { font-family: var(--display); font-weight: 700; font-stretch: 92%; font-size: 1.4rem; line-height: 1.2; text-wrap: balance; }
.row .lede { color: var(--muted); font-size: 1.02rem; line-height: 1.5; margin-top: 0.3rem; }
.row .meta { font-family: var(--display); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.25rem; }
.row .arrow { font-family: var(--display); font-weight: 700; color: var(--muted); }
.row:hover h3, .row:hover .arrow { color: var(--accent); }
.row > div { min-width: 0; }

/* Páginas de sección */
.page-head { padding-block: 2.5rem 1.75rem; display: grid; gap: 0.8rem; max-width: 46rem; }
.page-head h1 { font-family: var(--display); font-weight: 800; font-stretch: 88%; font-size: clamp(2.2rem, 6.5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.01em; text-wrap: balance; }
.page-head p { color: var(--muted); font-size: 1.2rem; }

/* Artículo */
.article { max-width: 40rem; padding-block: 2.25rem 1rem; display: grid; gap: 1.6rem; }
.back { font-family: var(--display); font-weight: 600; font-size: 0.76rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.back:hover { color: var(--accent); }
.article h1 { font-family: var(--display); font-weight: 800; font-stretch: 88%; font-size: clamp(2.2rem, 6.8vw, 3.5rem); line-height: 1.05; letter-spacing: -0.01em; text-wrap: balance; }
.article .lede { font-style: italic; font-size: 1.4rem; line-height: 1.45; color: var(--muted); }
.article .head { display: grid; gap: 0.9rem; }
.prose { display: grid; gap: 1.15rem; }
.prose p { max-width: 65ch; }
.tip { background: var(--surface); border-top: 2px solid var(--accent); padding: 1.25rem 1.4rem 1.4rem; display: grid; gap: 0.5rem; }
.tip p { font-size: 1.05rem; }
.ref { font-size: 0.92rem; color: var(--muted); }
.draft { display: inline-block; justify-self: start; font-family: var(--display); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; border: 1px solid var(--accent); color: var(--accent); padding: 0.25rem 0.55rem; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.25rem; max-width: 40rem; margin-top: 1rem; }
.pager a { display: grid; gap: 0.2rem; min-width: 0; max-width: 18rem; }
.pager a:last-child { text-align: right; margin-left: auto; }
.pager strong { font-family: var(--display); font-weight: 700; font-stretch: 92%; font-size: 1.1rem; line-height: 1.25; }
.pager a:hover strong { color: var(--accent); }

/* Descargas */
.files { display: grid; }
.file { display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto; gap: 0.5rem 1.25rem; align-items: center; padding-block: 1.3rem; border-top: 1px solid var(--line); }
.file:last-child { border-bottom: 1px solid var(--line); }
.ext { font-family: var(--display); font-weight: 800; font-size: 0.85rem; letter-spacing: 0.06em; text-align: center; border: 1px solid var(--accent); color: var(--accent); padding: 0.45rem 0; }
.file h3 { font-family: var(--display); font-weight: 700; font-stretch: 92%; font-size: 1.25rem; line-height: 1.2; }
.file p { color: var(--muted); font-size: 1rem; line-height: 1.5; margin-top: 0.25rem; }
.btn { font: 700 0.76rem var(--display); letter-spacing: 0.13em; text-transform: uppercase; background: var(--accent); color: var(--on-accent); border: 0; padding: 0.8rem 1.2rem; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; cursor: default; }
.status { min-height: 1.6rem; margin-top: 1rem; color: var(--muted); font-size: 1rem; }
@media (max-width: 36rem) {
  .file { grid-template-columns: minmax(0, 1fr); }
  .ext { justify-self: start; padding-inline: 0.8rem; }
  .btn { justify-self: start; }
  .row { grid-template-columns: 2.6rem minmax(0, 1fr); }
  .row .arrow { display: none; }
}

/* Bibliografía */
.book-group { margin-bottom: 2.5rem; }
.book { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem 2rem; padding-block: 1.2rem; border-top: 1px solid var(--line); }
.book:last-child { border-bottom: 1px solid var(--line); }
.book h3 { font-family: var(--display); font-weight: 700; font-stretch: 92%; font-size: 1.25rem; line-height: 1.2; text-wrap: balance; }
.book .author { display: block; margin-top: 0.25rem; font-style: italic; color: var(--accent); font-size: 1.02rem; }
.book p { color: var(--muted); font-size: 1.02rem; line-height: 1.55; }
@media (min-width: 40rem) {
  .book { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
}

/* Código QR */
.share { margin-top: 3rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem 2rem; align-items: center; }
.share h2 { font-family: var(--display); font-weight: 800; font-stretch: 90%; font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.15; text-wrap: balance; margin-block: 0.4rem 0.6rem; }
.share p { color: var(--muted); font-size: 1.02rem; line-height: 1.55; max-width: 34rem; }
.share .btn { margin-top: 1rem; }
.qr { width: 10rem; max-width: 100%; background: #fff; padding: 0.55rem; line-height: 0; }
.qr svg { display: block; width: 100%; height: auto; }
@media (min-width: 40rem) {
  .share { grid-template-columns: auto minmax(0, 1fr); }
}

/* Pie */
.foot { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; color: var(--muted); font-size: 0.98rem; }
.foot a { color: var(--fg); border-bottom: 1px solid var(--accent); }
.foot a:hover { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  .tile, .row, .btn { transition: background-color 0.15s, color 0.15s, filter 0.15s; }
}

.header-monogram { display: block; flex: none; order: 2; width: 2.75rem; height: 2.75rem; border-radius: 0.45rem; }
.btn { display: inline-block; text-decoration: none; }
