:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece4;
  --ink: #16181d;
  --muted: #5d6270;
  --line: #ddd8cc;
  --accent: #9a7a2e;
  --accent-soft: #f2e9d2;
  --t1: #1f7a5a;
  --t2: #2d5fa8;
  --t3: #8a4b9c;
  --risk-lo: #1f7a5a;
  --risk-mid: #a7731a;
  --risk-hi: #b23b3b;
  --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 8px 24px rgba(20, 20, 30, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014; --surface: #161920; --surface-2: #1d212a; --ink: #ecebe6; --muted: #9aa0ad;
    --line: #2a2f3a; --accent: #d4b16a; --accent-soft: #2b2617; --t1: #4cc597; --t2: #7aa7ec; --t3: #c58fd6;
    --risk-lo: #4cc597; --risk-mid: #e0a84a; --risk-hi: #ec7a7a; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1014; --surface: #161920; --surface-2: #1d212a; --ink: #ecebe6; --muted: #9aa0ad;
  --line: #2a2f3a; --accent: #d4b16a; --accent-soft: #2b2617; --t1: #4cc597; --t2: #7aa7ec; --t3: #c58fd6;
  --risk-lo: #4cc597; --risk-mid: #e0a84a; --risk-hi: #ec7a7a; --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.6 Inter, system-ui, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { font-weight: 600; letter-spacing: .12em; font-size: 13px; white-space: nowrap; }
.brand .mark { color: var(--accent); }
.brand .sub { color: var(--muted); letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.nav { display: flex; gap: 18px; margin-left: auto; overflow-x: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.theme { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; }

.hero { padding: 56px 0 24px; }
.eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 12px; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 5vw, 50px); line-height: 1.08; margin: 0 0 16px; }
h1 em { font-weight: 400; color: var(--muted); }
.lead { font-size: 17px; color: var(--muted); max-width: 760px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 28px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .v { font-family: Fraunces, Georgia, serif; font-size: 26px; font-weight: 600; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .s { font-size: 11px; color: var(--muted); opacity: .8; margin-top: 4px; }

.sec { padding: 40px 0 8px; border-top: 1px solid var(--line); margin-top: 32px; }
.sec-h { margin-bottom: 20px; }
.sec-h h2 { font-size: clamp(22px, 3vw, 30px); margin: 8px 0 6px; }
.sec-h p { color: var(--muted); margin: 0; max-width: 780px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.t1 { color: var(--t1); background: color-mix(in srgb, var(--t1) 12%, transparent); }
.t2 { color: var(--t2); background: color-mix(in srgb, var(--t2) 12%, transparent); }
.t3 { color: var(--t3); background: color-mix(in srgb, var(--t3) 12%, transparent); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.card h3 { font-size: 19px; margin: 0; line-height: 1.25; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; background: var(--surface-2); border-radius: 6px; padding: 3px 8px; color: var(--muted); }
.chip b { color: var(--ink); font-weight: 600; }
.card p { margin: 0; color: var(--muted); }
.card .label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 600; margin-top: 4px; }
.card ol, .card ul { margin: 0; padding-left: 18px; }
.card li { margin: 2px 0; }
.rank { font-family: Fraunces, Georgia, serif; color: var(--accent); font-size: 14px; }
.slim .card { padding: 16px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { font-weight: 600; }
.risk { font-size: 12px; font-weight: 600; }
.risk.bajo { color: var(--risk-lo); } .risk.medio { color: var(--risk-mid); } .risk.alto { color: var(--risk-hi); }

.note { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 14px 16px; border-radius: 8px; font-size: 14px; }
.note ul { margin: 6px 0 0; padding-left: 18px; }

.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.book { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.book h3 { font-size: 16px; margin: 0 0 2px; }
.book .au { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.book p { margin: 0 0 6px; font-size: 14px; }
.book .ap { color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 20px 22px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline .w { font-size: 12px; color: var(--accent); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.timeline h3 { margin: 2px 0 4px; font-size: 17px; }
.timeline p { margin: 0; color: var(--muted); }

.entry { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 14px; }
.entry summary { cursor: pointer; list-style: none; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.entry summary::-webkit-details-marker { display: none; }
.entry .d { font-size: 12px; color: var(--accent); font-weight: 600; }
.entry h3 { margin: 0; font-size: 18px; }
.entry .body { margin-top: 10px; color: var(--muted); }
.entry .body h4 { color: var(--ink); font-size: 13px; margin: 12px 0 4px; }
.entry ul { margin: 0; padding-left: 18px; }
.empty { color: var(--muted); }

.fuentes { columns: 2 320px; padding-left: 18px; font-size: 13px; }
.fuentes li { break-inside: avoid; margin-bottom: 6px; color: var(--muted); }
.disclaimer { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding: 24px 0 48px; margin-top: 32px; }

@media (max-width: 640px) {
  .brand .sub { display: none; }
  .nav { gap: 12px; }
  .cards { grid-template-columns: 1fr; }
}
