@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700;8..60,800&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #f6f3ec;
  --bg-vign: #efe9db;
  --bg-raised: #fffdf8;
  --ink: #241f18;
  --ink-soft: #55503f;
  --ink-faint: #8a8471;
  --line: #ddd6c4;
  --line-soft: #e7e1d2;
  --accent: #b5470f;
  --accent-2: #c97a2f;
  --accent-soft: #f0dcc9;
  --ok-bg: #e3ecd9; --ok-ink: #3d5a2c; --ok-line: #a9c48f;
  --no-bg: #f4dcd6; --no-ink: #7a2f22; --no-line: #d99c8c;
  --warn-bg: #f5e6c8; --warn-ink: #6b4e12; --warn-line: #dcb968;
  --code-bg: #ece6d6;
  --shadow: 0 1px 2px rgba(70, 50, 20, 0.06), 0 6px 20px -6px rgba(70, 50, 20, 0.14);
  --shadow-sm: 0 1px 2px rgba(70, 50, 20, 0.08);
  --shadow-lift: 0 4px 10px -2px rgba(70, 50, 20, 0.10), 0 16px 32px -12px rgba(70, 50, 20, 0.22);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17140f; --bg-vign: #1c1811; --bg-raised: #211d16;
    --ink: #f1ece0; --ink-soft: #c6bfab; --ink-faint: #8b846f;
    --line: #3a352a; --line-soft: #2c2820; --accent: #e8823f; --accent-2: #f0a65e; --accent-soft: #3a2a1c;
    --ok-bg: #26301f; --ok-ink: #b9d6a0; --ok-line: #4a6236;
    --no-bg: #34211d; --no-ink: #e8a99a; --no-line: #6e3a30;
    --warn-bg: #382c14; --warn-ink: #e6c675; --warn-line: #6b551f;
    --code-bg: #241f16;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 28px -8px rgba(0,0,0,0.55);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
    --shadow-lift: 0 6px 14px -4px rgba(0,0,0,0.4), 0 22px 44px -16px rgba(0,0,0,0.6);
  }
}
:root[data-theme="dark"] {
  --bg: #17140f; --bg-vign: #1c1811; --bg-raised: #211d16;
  --ink: #f1ece0; --ink-soft: #c6bfab; --ink-faint: #8b846f;
  --line: #3a352a; --line-soft: #2c2820; --accent: #e8823f; --accent-2: #f0a65e; --accent-soft: #3a2a1c;
  --ok-bg: #26301f; --ok-ink: #b9d6a0; --ok-line: #4a6236;
  --no-bg: #34211d; --no-ink: #e8a99a; --no-line: #6e3a30;
  --warn-bg: #382c14; --warn-ink: #e6c675; --warn-line: #6b551f;
  --code-bg: #241f16;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 28px -8px rgba(0,0,0,0.55);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
  --shadow-lift: 0 6px 14px -4px rgba(0,0,0,0.4), 0 22px 44px -16px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 900px 500px at 12% -8%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 0%, var(--bg-vign) 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* topband */
.topband { height: 4px; background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 45%, var(--accent) 100%); background-size: 200% 100%; }

.shell { display: flex; max-width: 1180px; margin: 0 auto; align-items: flex-start; }
.backlink { display: inline-flex; align-items: center; gap: 6px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-faint); text-decoration: none; margin-bottom: 22px; transition: color .15s ease, transform .15s ease; }
.backlink:hover { color: var(--accent); transform: translateX(-2px); }

nav.toc { position: sticky; top: 0; align-self: flex-start; width: 236px; flex: 0 0 236px; padding: 40px 18px 40px 24px; display: none; }
@media (min-width: 900px) { nav.toc { display: block; max-height: 100vh; overflow-y: auto; } }
nav.toc .eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.08em; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 14px; }
nav.toc a.item { display: block; font-size: 13px; color: var(--ink-soft); text-decoration: none; padding: 6px 0 6px 14px; border-left: 2px solid var(--line); line-height: 1.35; transition: color .15s ease, border-color .15s ease, background .15s ease; border-radius: 0 6px 6px 0; }
nav.toc a.item:hover { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); }
nav.toc a.item.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
nav.toc a.item .n { font-family: 'IBM Plex Mono', monospace; color: var(--ink-faint); margin-right: 5px; }

main { flex: 1 1 auto; min-width: 0; padding: 40px 20px 80px; }
@media (min-width: 640px) { main { padding: 56px 40px 100px; } }

.kicker { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); flex: none; }

h1 { font-family: 'Source Serif 4', serif; font-weight: 800; font-size: clamp(28px, 5vw, 44px); line-height: 1.08; margin: 0 0 12px; text-wrap: balance; letter-spacing: -0.015em; }
.dek { font-size: 16px; color: var(--ink-soft); max-width: 62ch; line-height: 1.6; margin: 0 0 28px; }

.verdict { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 24px 0 36px; }
@media (min-width: 560px) { .verdict { grid-template-columns: 1fr 1fr; } }
.verdict-card { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px 18px 52px; background: var(--bg-raised); box-shadow: var(--shadow-sm); transition: box-shadow .2s ease, transform .2s ease; }
.verdict-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.verdict-card::before { position: absolute; left: 16px; top: 18px; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 14px; }
.verdict-card.no { border-color: var(--no-line); background: linear-gradient(180deg, var(--no-bg), var(--bg-raised) 140%); }
.verdict-card.no::before { content: "✕"; background: var(--no-line); color: var(--bg-raised); }
.verdict-card.ok { border-color: var(--ok-line); background: linear-gradient(180deg, var(--ok-bg), var(--bg-raised) 140%); }
.verdict-card.ok::before { content: "✓"; background: var(--ok-line); color: var(--bg-raised); }
.verdict-card .tag { font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-bottom: 6px; display: block; }
.verdict-card.no .tag { color: var(--no-ink); }
.verdict-card.ok .tag { color: var(--ok-ink); }
.verdict-card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink); }

section { margin: 52px 0; padding-top: 8px; scroll-margin-top: 20px; }
section h2 { font-family: 'Source Serif 4', serif; font-size: 24px; font-weight: 700; margin: 0 0 6px; display: flex; align-items: center; gap: 12px; letter-spacing: -0.01em; }
section h2 .idx { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--accent); font-weight: 700; background: var(--accent-soft); border-radius: 8px; padding: 5px 9px; line-height: 1; flex: none; }
section h3 { font-family: 'IBM Plex Sans', sans-serif; font-size: 16px; font-weight: 600; margin: 22px 0 8px; color: var(--ink); }
.rule { height: 1px; background: linear-gradient(90deg, var(--line), transparent 85%); margin: 0 0 20px; }

p { line-height: 1.68; color: var(--ink-soft); font-size: 15px; max-width: 70ch; margin: 0 0 14px; }
strong { color: var(--ink); }
ul, ol { padding-left: 22px; margin: 0 0 16px; max-width: 70ch; }
li { line-height: 1.6; color: var(--ink-soft); font-size: 15px; margin-bottom: 8px; }
li strong { color: var(--ink); }

.table-wrap { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 480px; }
thead th { background: linear-gradient(180deg, var(--ink) 0%, #33291e 100%); color: #fbf4ea; font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; text-align: left; padding: 11px 14px; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); vertical-align: top; }
tr:nth-child(even) td { background: color-mix(in srgb, var(--code-bg) 55%, transparent); }
tr:last-child td { border-bottom: none; }
td strong { color: var(--ink); }
.pill { display: inline-block; font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; padding: 3px 8px; border-radius: 6px; margin-top: 4px; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid var(--ok-line); }
.pill.no { background: var(--no-bg); color: var(--no-ink); border: 1px solid var(--no-line); }

.note { position: relative; border-left: 3px solid; border-radius: 0 10px 10px 0; padding: 14px 16px 14px 42px; margin: 18px 0; font-size: 13.5px; line-height: 1.6; box-shadow: var(--shadow-sm); }
.note::before { position: absolute; left: 14px; top: 14px; font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 13px; }
.note.good { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.note.good::before { content: "✓"; }
.note.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.note.warn::before { content: "!"; }
.note.hon { border-color: var(--no-line); background: var(--no-bg); color: var(--no-ink); }
.note.hon::before { content: "◆"; }
.note strong { color: inherit; }

code { font-family: 'IBM Plex Mono', monospace; background: var(--code-bg); color: var(--ink); padding: 1px 6px; border-radius: 5px; font-size: 0.9em; }

.bignum { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 18px 0 26px; }
.bignum .cell { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow-sm); border-top: 3px solid var(--accent); }
.bignum .cell .v { font-family: 'IBM Plex Mono', monospace; font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.bignum .cell .l { font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.35; }

.valoracion { counter-reset: v; list-style: none; padding: 0; margin: 18px 0; display: flex; flex-direction: column; gap: 12px; }
.valoracion li { counter-increment: v; position: relative; padding-left: 40px; margin: 0; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 14px 50px; box-shadow: var(--shadow-sm); transition: box-shadow .2s ease; }
.valoracion li:hover { box-shadow: var(--shadow-lift); }
.valoracion li::before { content: counter(v); position: absolute; left: 14px; top: 14px; font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 13px; color: #fff; width: 24px; height: 24px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

footer { max-width: 70ch; padding-top: 24px; margin-top: 12px; border-top: 1px solid var(--line); position: relative; }
footer::before { content: ""; position: absolute; top: -1px; left: 0; width: 60px; height: 2px; background: var(--accent); }
footer p { font-size: 12.5px; color: var(--ink-faint); }
.src-list { font-size: 12.5px; color: var(--ink-faint); line-height: 1.7; }
.src-list a { color: var(--ink-faint); }
a { color: var(--accent); }

.themebtn { position: fixed; bottom: 18px; right: 18px; z-index: 5; font-family: 'IBM Plex Mono', monospace; font-size: 11px; background: var(--bg-raised); color: var(--ink-soft); border: 1px solid var(--line); border-radius: 20px; padding: 8px 14px; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.themebtn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }

/* hub-specific */
.list { display: flex; flex-direction: column; gap: 10px; }
.study { display: block; text-decoration: none; color: inherit; padding: 22px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-raised); box-shadow: var(--shadow-sm); transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease; }
.study:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: var(--accent-2); }
.study .row1 { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.study .title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.study .ico { font-size: 24px; line-height: 1; flex: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15)); }
.study h2 { font-family: 'Source Serif 4', serif; font-size: 21px; font-weight: 700; margin: 0; color: var(--ink); }
.study .arrow { font-family: 'IBM Plex Mono', monospace; color: var(--accent); font-size: 18px; flex-shrink: 0; transition: transform .18s ease; }
.study:hover .arrow { transform: translateX(3px); }
.study p { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin: 8px 0 0; max-width: 60ch; }
.study .tag { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin-top: 12px; display: block; }
.study.soon { opacity: 0.55; pointer-events: none; box-shadow: none; }
.study.soon .tag { color: var(--accent); }

.doc { display: block; text-decoration: none; color: inherit; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); margin-bottom: 8px; box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, transform .15s ease; }
.doc:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.doc .row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.doc h2 { font-family: 'Source Serif 4', serif; font-size: 18px; font-weight: 700; margin: 0; color: var(--ink); }
.doc .arrow { font-family: 'IBM Plex Mono', monospace; color: var(--accent); font-size: 16px; flex-shrink: 0; }
.doc p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 6px 0 0; max-width: 62ch; }
.doc .tag { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin-top: 8px; display: block; }
