:root {
  color-scheme: light dark;
  --paper: #faf9f5;
  --surface: #ffffff;
  --ink: #222222;
  --muted: #5f5f5f;
  --navy: #292929;
  --navy-2: #5f5f5f;
  --accent: #000000;
  --rule: #d6d6d6;
  --soft: #f0f0f0;
  --focus: #000000;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --reading: 790px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--serif); line-height: 1.78; font-size: 18px; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: white; padding: .6rem .9rem; font-family: var(--sans); }
.skip-link:focus { top: 1rem; }
.site-header { background: var(--navy); color: white; border-bottom: 1px solid var(--rule); }
.header-inner { max-width: 1530px; margin: 0 auto; padding: 1.2rem 2rem; display: flex; gap: 2rem; justify-content: space-between; align-items: center; }
.brand { display: inline-flex; flex-direction: column; color: white; text-decoration: none; line-height: 1.12; }
.brand:hover { color: white; }
.brand-collection { font: 500 .66rem/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; opacity: .8; }
.brand-title { margin-top: .25rem; font: 400 1.62rem/1.3 var(--serif); letter-spacing: .005em; }
.main-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.9rem; font: 400 .85rem/1.4 var(--sans); }
.main-nav a { color: #f5f6f8; text-decoration: none; }
.main-nav a:hover { text-decoration: underline; }
.preview-banner { padding: .45rem 1rem; text-align: center; background: #f6e8b9; color: #3b321e; border-bottom: 1px solid #dac98f; font: 600 .78rem/1.4 var(--sans); }
.page-shell { width: min(var(--reading), calc(100% - 2.5rem)); margin: 0 auto; }
.home-intro { padding: 2.9rem 0 2.5rem; max-width: var(--reading); }
.eyebrow { margin: 0 0 .85rem; color: var(--muted); font: 600 .66rem/1.65 var(--sans); letter-spacing: .11em; text-transform: uppercase; }
.eyebrow a { color: inherit; }
h1,h2,h3,h4 { font-family: var(--serif); line-height: 1.25; font-weight: 400; color: var(--ink); text-wrap: pretty; }
h1 { font-size: clamp(2.5rem, 5vw, 2.9rem); letter-spacing: -.025em; margin: .2rem 0 .8rem; }
h2 { font-size: 1.65rem; margin-top: 2.6rem; }
h3 { font-size: 1.24rem; margin-top: 2rem; }
.home-subtitle { margin: .4rem 0 1.3rem; font-size: 1.35rem; line-height: 1.55; color: var(--muted); }
.home-deck { max-width: 760px; font-size: 1.08rem; color: var(--ink); }
.home-search, .search-form div { display: flex; gap: .55rem; margin-top: 1.8rem; }
input[type='search'] { min-width: 0; min-height: 46px; flex: 1; padding: .6rem .8rem; border: 1px solid var(--rule); border-radius: 2px; font: 1rem/1.25 var(--sans); background: var(--surface); color: var(--ink); }
button { min-height: 44px; border: 1px solid var(--navy); border-radius: 2px; background: var(--navy); color: white; padding: .55rem 1.2rem; font: 500 .78rem/1.25 var(--sans); cursor: pointer; }
button:hover { background: var(--navy-2); }
.home-section { padding: 2.2rem 0; border-top: 1px solid var(--rule); }
.section-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.section-heading h2, .home-section > h2 { margin-top: 0; }
.section-heading a { font: .86rem/1.4 var(--sans); }
.family-columns { columns: 2 320px; column-gap: 3rem; }
.family-link { display: flex; justify-content: space-between; gap: 1rem; break-inside: avoid; padding: .75rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.family-link span { color: var(--navy); }
.family-link small { color: var(--muted); font: .75rem/1.5 var(--sans); white-space: nowrap; }
.mechanism-list { list-style: none; padding: 0; margin: 1.2rem 0; border-top: 1px solid var(--rule); }
.mechanism-list li { margin: 0; border-bottom: 1px solid var(--rule); }
.mechanism-list a { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.4fr); gap: 1.3rem; padding: 1rem 0; text-decoration: none; }
.mechanism-list strong { color: var(--navy); font-weight: 600; }
.mechanism-list span { color: #464c55; }
.quiet-note { border-left: 3px solid #b9b6ac; padding: .2rem 0 .2rem 1.1rem; color: #50555d; max-width: 780px; }
.manifesto blockquote { max-width: 760px; margin: 1.5rem 0 0; padding: 0 0 0 1.2rem; border-left: 3px solid var(--accent); font-size: 1.25rem; color: #33343a; }
.text-page { max-width: 900px; padding: 4rem 0 6rem; }
.text-page > h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.lead { font-size: 1.18rem; color: #3f454e; max-width: 760px; }
.family-index section { padding: 1.15rem 0 1.25rem; border-bottom: 1px solid var(--rule); }
.family-index section h2 { margin: 0 0 .3rem; font-size: 1.25rem; }
.family-index section p { margin: .25rem 0; }
.family-index small { font: .78rem/1.4 var(--sans); color: var(--muted); }
.reading-shell { width: min(1530px, calc(100% - 4rem)); margin: 0 auto; display: grid; grid-template-columns: 230px minmax(0, var(--reading)) 195px; justify-content: center; align-items: start; gap: 2.7rem; padding: 1.7rem 0 4rem; }
.left-rail,.right-rail { font-family: var(--sans); font-size: .78rem; color: var(--muted); }
.left-rail { padding-top: 1rem; }
.back-link { display: inline-block; margin-bottom: 1.3rem; text-decoration: none; }
.mechanism-meta { margin: 0; }
.mechanism-meta dt { font-weight: 700; color: #4a5058; margin-top: .75rem; }
.mechanism-meta dd { margin: .1rem 0 0; }
.draft-label { display: inline-block; margin-top: 1rem; padding: .28rem .48rem; border: 1px solid #caa95b; background: #fff6d9; color: #654d16; }
.article { min-width: 0; }
.article-header { padding-bottom: 1.8rem; border-bottom: 1px solid var(--rule); margin-bottom: 2.4rem; }
.article-header h1 { font-size: clamp(2.12rem, 5vw, 2.5rem); }
.article-summary { margin: 1rem 0 0; color: var(--muted); font-size: 1.18rem; }
.prose p, .prose li { max-width: 72ch; }
.prose p { margin: 1rem 0; }
.prose ul,.prose ol { padding-left: 1.4rem; }
.prose blockquote { margin: 1.6rem 0; padding: .1rem 0 .1rem 1.1rem; border-left: 3px solid #aaa69d; color: #43474e; }
.prose code { font-family: var(--mono); font-size: .86em; background: #efeee9; padding: .12em .28em; border-radius: 2px; }
.prose pre { overflow: auto; padding: 1rem; background: #20242b; color: #f2f2ef; border-radius: 2px; font: .83rem/1.5 var(--mono); }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose th,.prose td { padding: .55rem .7rem; border: 1px solid var(--rule); text-align: left; vertical-align: top; }
.prose th { background: #efeee9; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4rem 0; }
.prose .mermaid { background: white; border: 1px solid var(--rule); padding: 1rem; color: var(--ink); overflow-x: auto; }
.related { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.related h2 { margin-top: 0; }
.toc { position: sticky; top: 1.3rem; max-height: calc(100vh - 2.6rem); overflow: auto; }
.toc > p { font-weight: 700; color: #3a4048; margin: 0 0 .6rem; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: .38rem 0; }
.toc a { color: #5e646d; text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.toc-level-3 { padding-left: .8rem; }
.search-form { margin: 2rem 0 1rem; }
.search-form > label { display: block; font: 700 .84rem/1.4 var(--sans); margin-bottom: .35rem; }
.search-status { min-height: 1.5em; color: var(--muted); font: .86rem/1.4 var(--sans); }
.search-results { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.search-results li { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.search-results h2 { font-size: 1.18rem; margin: 0 0 .25rem; }
.search-results p { margin: .2rem 0; }
.search-meta { color: var(--muted); font: .75rem/1.4 var(--sans); }
.site-footer { width: min(1466px, 100%); margin: 0 auto; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 2rem; padding: 1.8rem 2rem 2.5rem; color: var(--muted); font: .72rem/1.7 var(--sans); background: transparent; }
.site-footer nav { display: flex; gap: 1rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.error-page { min-height: 65vh; }
@media (max-width: 1120px) {
  .reading-shell { grid-template-columns: minmax(0, var(--reading)) 210px; }
  .left-rail { display: none; }
}
@media (max-width: 820px) {
  body { font-size: 17px; }
  .header-inner { align-items: flex-start; flex-direction: column; gap: .7rem; }
  .main-nav { gap: .35rem 1rem; }
  .home-intro { padding: 3.6rem 0 3rem; }
  .reading-shell { display: block; width: min(100% - 2rem, var(--reading)); padding-top: 2.3rem; }
  .right-rail { display: none; }
  .mechanism-list a { grid-template-columns: 1fr; gap: .3rem; }
  .site-footer { flex-direction: column; }
}
@media (max-width: 520px) {
  .page-shell { width: min(100% - 1.4rem, 1180px); }
  .home-search, .search-form div { display: block; }
  input[type='search'] { width: 100%; }
  button { margin-top: .5rem; width: 100%; }
  .family-columns { columns: 1; }
}
@media print {
  .site-header,.site-footer,.left-rail,.right-rail,.preview-banner,.home-search { display: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  .reading-shell,.page-shell { display: block; width: auto; max-width: none; margin: 0; padding: 0; }
  a { color: black; text-decoration: none; }
  .prose a[href^='http']::after { content: ' (' attr(href) ')'; font-size: .8em; }
}

/* Edición de lectura: catálogo y figuras, sin dependencia tipográfica externa. */
[hidden] { display: none !important; }
main:focus { outline: none; }
h2[id], h3[id], a[id] { scroll-margin-top: 1.5rem; }
.order-label { display: inline; margin-right: .8rem; color: var(--muted); font: .8rem var(--sans); font-variant-numeric: tabular-nums; }
.edition-line, .article-byline { color: var(--muted); font: .8rem/1.6 var(--sans); margin-top: 1rem; }
.breadcrumbs { margin: 0 0 1.3rem; color: var(--muted); font: .78rem/1.5 var(--sans); }
.breadcrumbs span { margin: 0 .5rem; }
.main-nav a[aria-current] { text-decoration: underline; text-underline-offset: .3rem; }
.prose { overflow-wrap: break-word; }
.prose figure { margin: 2rem 0; }
.prose figure img { width: 100%; max-width: 680px; height: auto; display: block; margin: 0 auto; }
.prose figcaption { margin: .6rem 0; color: #505762; font: .8rem/1.6 var(--sans); }
.prose figure, .prose tr { break-inside: avoid; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 1.5rem 0; }
.table-scroll table { min-width: 420px; }
.mobile-toc { display: none; }
.toc a[aria-current] { color: var(--navy); font-weight: 700; text-decoration: underline; }
.chapter-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: 1.25rem; }
.chapter-nav a { text-decoration: none; font-size: 1rem; }
.chapter-nav a:last-child { text-align: right; }
.chapter-nav small { display: block; color: var(--muted); font: .75rem/1.5 var(--sans); margin-bottom: .4rem; }
.article-note { color: var(--muted); font: .77rem/1.6 var(--sans); margin-top: 2rem !important; }
.catalog-page { max-width: 1020px; }
.small-links { font: .85rem/1.7 var(--sans); }
.catalog-filters { display: grid; grid-template-columns: 1.3fr .8fr 1fr; gap: .8rem; padding: 1rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: 2rem; }
.catalog-filters label { min-width: 0; font: .78rem/1.5 var(--sans); color: var(--muted); }
.catalog-filters input, .catalog-filters select { display: block; width: 100%; margin-top: .4rem; border: 1px solid #aeb3ba; background: #fff; color: var(--ink); padding: .65rem; font: .9rem var(--sans); border-radius: 2px; min-height: 42px; }
.catalog-list { list-style: none; padding: 0; }
.catalog-item { display: grid; grid-template-columns: 2.8rem 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.catalog-number { color: #637082; font: .82rem/1.6 var(--sans); font-variant-numeric: tabular-nums; padding-top: .1rem; }
.catalog-item h3 { font-size: 1.15rem; margin: 0 0 .3rem; }
.catalog-item p { margin: .3rem 0; color: #454d58; font-size: .98rem; }
.catalog-state { font: .73rem/1.5 var(--sans); color: #526457; }
.catalog-item[data-state="planned"] .catalog-state { color: #68625a; }
.catalog-item[data-state="planned"] h3 { font-weight: 400; }
.reading-route { margin: 2.5rem 0; border-top: 1px solid var(--rule); padding: .5rem 0 0; }
.reading-route li { padding: .22rem 0; }
.planned-list { color: var(--muted); }
.source-entry { padding: 1.2rem 0; border-bottom: 1px solid var(--rule); }
.source-entry h2 { margin: 0 0 .6rem; font-size: 1.07rem; line-height: 1.5; overflow-wrap: anywhere; }
.source-entry summary { cursor: pointer; font: .82rem/1.5 var(--sans); color: var(--muted); }
.source-entry details p { font-size: .95rem; }
@media (max-width: 820px) {
  .mobile-toc { display: block; margin-top: 1.3rem; padding: .75rem 0; border-top: 1px solid var(--rule); font: .85rem/1.7 var(--sans); }
  .mobile-toc summary { cursor: pointer; }
  .mobile-toc ol { margin-bottom: 0; }
  .article-header h1 { font-size: clamp(2rem, 6vw, 3rem); }
  .catalog-filters { grid-template-columns: 1fr 1fr; }
  .catalog-filters label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .main-nav a { padding: .35rem 0; }
  .header-inner { padding: 1rem; }
  .home-intro { padding: 2.5rem 0 2rem; }
  .section-heading { display: block; }
  .chapter-nav { grid-template-columns: 1fr; }
  .chapter-nav a:last-child { text-align: left; }
  .catalog-item { grid-template-columns: 2rem 1fr; gap: .4rem; }
  .catalog-filters { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171717;
    --surface: #202020;
    --ink: #e5e5e5;
    --muted: #aaaaaa;
    --navy: #292929;
    --navy-2: #aaaaaa;
    --accent: #ffffff;
    --rule: #444444;
    --soft: #242424;
    --focus: #ffffff;
  }
  .mechanism-list span,
  .quiet-note,
  .manifesto blockquote,
  .lead,
  .family-index small,
  .article-summary,
  .prose blockquote,
  .prose figcaption,
  .catalog-item p { color: var(--muted); }
  .mechanism-list strong,
  .family-link span,
  .toc a[aria-current] { color: var(--ink); }
  .prose code,
  .prose th,
  .catalog-filters input,
  .catalog-filters select { background: var(--soft); color: var(--ink); }
  .prose pre { background: var(--soft); color: var(--ink); border: 1px solid var(--rule); }
  .prose .mermaid { background: #fff; color: #222; }
}
@media print {
  .mobile-toc,.chapter-nav,.catalog-filters,.breadcrumbs,.article-note { display: none !important; }
  .article-header h1 { font-size: 24pt; }
  .article-header { margin-bottom: 1rem; padding-bottom: 1rem; }
  .prose figure img { max-height: 15cm; width: auto; max-width: 100%; }
  .table-scroll { overflow: visible; }
  .table-scroll table { min-width: 0; }
  h2,h3 { break-after: avoid; }
}
