/* /research/paper: lectura sobria con la identidad del sitio (oro, Cinzel, fondo oscuro). Estático, sin JS. */
:root {
  --bg: #0f1113; --panel: #15191b; --line: rgba(201, 162, 39, .22); --line-soft: rgba(255, 255, 255, .08);
  --ink: #e4ddcc; --muted: #9a9384; --gold: #c9a227; --gold-hi: #f3d36b; --gold-lo: #7d6210; --link: #f0cf6a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.075rem/1.7 'Source Serif 4', Georgia, 'Times New Roman', serif;
  background-image: radial-gradient(900px 420px at 50% -120px, rgba(201, 162, 39, .10), transparent 70%); }
a { color: var(--link); text-decoration-color: rgba(240, 207, 106, .4); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #111; padding: 6px 12px; z-index: 20; }
.skip:focus { left: 8px; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: rgba(12, 14, 16, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  font-family: 'Cinzel', Georgia, serif; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--gold-hi); text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.topbar nav { display: flex; gap: 16px; align-items: center; font-size: .9rem; }
.topbar nav a { color: var(--ink); text-decoration: none; }
.topbar nav a:hover { color: var(--gold-hi); }
.topbar nav .pdf { border: 1px solid var(--line); padding: 3px 10px; border-radius: 4px; color: var(--gold-hi); }

.layout { display: grid; grid-template-columns: 250px minmax(0, 720px); gap: 56px; justify-content: center; padding: 40px 24px 96px; }
.toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; font: 500 .86rem/1.45 Inter, system-ui, sans-serif; }
.toc summary { font-family: 'Cinzel', serif; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; cursor: pointer; margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 14px; color: var(--muted); text-decoration: none; }
.toc li.l3 a { padding-left: 28px; font-size: .8rem; }
.toc li a:hover { color: var(--gold-hi); }

.paper-head { border-bottom: 1px solid var(--line); padding-bottom: 28px; margin-bottom: 8px; }
.kicker { font: 600 .74rem/1 Inter, system-ui, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
h1 { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: clamp(1.6rem, 3.6vw, 2.35rem); line-height: 1.22; margin: 0 0 12px; color: #f5efdf; }
.author { color: var(--muted); margin: 0 0 6px; font-style: italic; }
.doi { margin: 0 0 20px; font: .86rem/1.6 Inter, system-ui, sans-serif; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.btn { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); text-decoration: none;
  font: 600 .86rem/1.2 'Cinzel', Georgia, serif; letter-spacing: .04em; background: rgba(255, 255, 255, .02); }
.btn:hover { border-color: var(--gold); color: var(--gold-hi); }
.btn.gold { background: linear-gradient(180deg, #e2bd47, #b48d1c); color: #1a1405; border-color: #e2bd47; }
.btn.gold:hover { color: #000; filter: brightness(1.08); }

.es-summary { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 6px; padding: 16px 20px; font-size: .98rem; }
.es-summary h2 { font: 700 .8rem/1 'Cinzel', serif; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 4px 0 10px; border: 0; padding: 0; }
.es-summary p { margin: 0 0 10px; }
.es-summary p:last-child { margin-bottom: 0; }

.paper h2, .cite h2 { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 1.45rem; color: #f5efdf; margin: 2.4em 0 .6em; padding-top: .4em; border-top: 1px solid var(--line-soft); line-height: 1.3; }
.paper h3 { font-family: 'Cinzel', Georgia, serif; font-weight: 600; font-size: 1.12rem; color: var(--gold-hi); margin: 1.8em 0 .5em; }
h2, h3 { position: relative; }
.anchor { position: absolute; left: -1.1em; color: var(--gold-lo); text-decoration: none; opacity: 0; transition: opacity .15s; font-size: .9em; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
.paper p, .paper li { hyphens: auto; }
.paper ol, .paper ul { padding-left: 1.4em; }
.paper li { margin: .3em 0; }
.paper strong { color: #f5efdf; }
sub { font-size: .72em; line-height: 0; }
code { font: .86em/1.4 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace; background: rgba(255, 255, 255, .06); padding: .1em .35em; border-radius: 3px; }
pre { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 6px; padding: 14px 16px; overflow-x: auto; }
pre code { background: none; padding: 0; }

.math { overflow-x: auto; overflow-y: hidden; padding: .2em 0; margin: 1em 0; }
.katex { font-size: 1.08em; color: #f5efdf; }

.table-wrap { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--line-soft); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font: 400 .88rem/1.45 Inter, system-ui, sans-serif; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
th { color: var(--gold-hi); font-weight: 600; background: rgba(201, 162, 39, .06); }
tr:last-child td { border-bottom: 0; }

.diagram { margin: 1.6em 0; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.diagram svg { width: 100%; height: auto; display: block; color: var(--gold); font-family: Inter, system-ui, sans-serif; }
.diagram .d-title { fill: #f5efdf; font-size: 15px; font-weight: 600; }
.diagram .edges line { stroke: var(--gold); stroke-width: 1.4; }
.diagram .elabels text { fill: var(--muted); font-size: 12px; }
.diagram .box rect { fill: #1b2023; stroke: rgba(201, 162, 39, .45); }
.diagram .box.key rect { fill: rgba(201, 162, 39, .14); stroke: var(--gold-hi); stroke-width: 1.6; }
.diagram .bt { fill: #f5efdf; font-size: 14px; font-weight: 600; }
.diagram .bs { fill: var(--muted); font-size: 11.5px; }
.diagram figcaption { margin-top: 8px; color: var(--muted); font: .82rem/1.4 Inter, system-ui, sans-serif; }

.cite { margin-top: 3em; }
.cite pre { font-size: .82rem; }
.thanks { color: var(--muted); font-style: italic; }

@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 720px); gap: 0; padding: 24px 16px 72px; }
  .toc { position: static; max-height: none; margin-bottom: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; }
  .toc summary { margin: 0; }
  .toc details[open] summary { margin-bottom: 10px; }
  .anchor { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 1.02rem; }
  .topbar nav { gap: 10px; font-size: .8rem; }
  .brand { font-size: .9rem; }
  .brand img { width: 22px; height: 22px; }
}
@media print {
  :root { --bg: #fff; --panel: #fff; --ink: #111; --muted: #444; --link: #111; --line: #bbb; --line-soft: #ddd; }
  body { background: #fff; color: #111; }
  .topbar, .toc, .actions, .skip, .anchor { display: none !important; }
  .layout { display: block; padding: 0; }
  h1, .paper h2, .paper h3, .paper strong, .katex, th, .diagram .bt, .diagram .d-title { color: #111 !important; fill: #111 !important; }
}
