:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #e8edf2;
  --ink: #1f2933;
  --muted: #5d6874;
  --steel: #2f3f52;
  --gold: #b9772c;
  --gold-soft: #f6e6cc;
  --line: #dbe2e9;
  --shadow: 0 1px 2px rgba(31, 41, 51, .06), 0 8px 24px rgba(31, 41, 51, .06);
  --radius: 16px;
  --serif: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14191f; --surface: #1c232b; --surface-2: #222b35; --ink: #ece7df; --muted: #a3acb6;
    --steel: #9fb4cc; --gold: #e0a65c; --gold-soft: #3a2e1f; --line: #2e3843;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14191f; --surface: #1c232b; --surface-2: #222b35; --ink: #ece7df; --muted: #a3acb6;
  --steel: #9fb4cc; --gold: #e0a65c; --gold-soft: #3a2e1f; --line: #2e3843;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; text-wrap: balance; line-height: 1.15; color: var(--ink); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 .5em; }
.wrap { width: min(1140px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 1.25rem/1 var(--serif); }
.brand em { color: var(--gold); font-style: italic; }
nav { display: flex; align-items: center; gap: 22px; }
nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
nav a:not(.btn):hover { color: var(--gold); }
@media (max-width: 680px) { nav a:not(.btn) { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 999px; background: var(--steel); color: #fff; font: 600 .98rem/1 var(--sans); text-decoration: none; border: 0; cursor: pointer; transition: transform .15s, box-shadow .15s; }
:root[data-theme="dark"] .btn { color: #14191f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { color: #14191f; } }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-sm { padding: 9px 16px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--ink) !important; box-shadow: inset 0 0 0 1.5px var(--line); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Hero */
.hero { padding: clamp(40px, 7vw, 90px) 0 clamp(40px, 6vw, 70px); background: radial-gradient(1200px 500px at 85% 10%, var(--gold-soft), transparent 70%); }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; color: var(--gold); margin: 0 0 14px; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); margin: 0; }
.hero h1 em { color: var(--gold); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin-top: 20px; }
.hero-img img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 28px; box-shadow: var(--shadow); }
@media (max-width: 820px) { .hero-inner { grid-template-columns: 1fr; } .hero-img { order: -1; } .hero-img img { aspect-ratio: 4/3; } }

/* Traits */
.traits { padding: 56px 0 24px; }
.traits ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.traits li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.traits strong { font: 700 1.15rem/1.2 var(--serif); color: var(--steel); }
.traits span { color: var(--muted); font-size: .95rem; line-height: 1.5; }

/* Cards */
#articulos { padding: 48px 0 72px; }
.section-head p { color: var(--muted); margin-top: -4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; margin-top: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-img img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.card-body { padding: 18px 20px 22px; }
.card h3 { font-size: 1.3rem; margin: 4px 0 8px; }
.card h3 a { color: inherit; text-decoration: none; }
.card p { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.55; }
.meta { font-size: .82rem !important; color: var(--muted); letter-spacing: .02em; }

/* CTA band */
.cta-band { background: var(--steel); color: #f4efe7; padding: 64px 0; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #d6dde5; }
.cta-band .btn { background: var(--gold); color: #1f2933; }
.cta-band .btn-ghost { color: #fff !important; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); background: transparent; }
:root[data-theme="dark"] .cta-band { background: #222e3c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cta-band { background: #222e3c; } }
.todo { background: rgba(255,255,255,.1); border: 1px dashed rgba(255,255,255,.4); padding: 10px 14px; border-radius: 10px; margin: 0; }
.todo code { color: #ffd9a3; }

/* Post */
.post-hero { padding: 40px 0 8px; }
.back { font-size: .9rem; text-decoration: none; font-weight: 500; }
.post-hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 18px 0 10px; }
.post-cover { width: 100%; max-height: 520px; object-fit: cover; border-radius: 22px; margin: 18px 0 8px; box-shadow: var(--shadow); }
.prose { padding-bottom: 56px; }
.prose h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); margin: 2em 0 .5em; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--gold); }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--gold); color: var(--muted); font-style: italic; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: 16px; margin-inline: auto; max-height: 640px; width: auto; }
.prose figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .96rem; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); font-weight: 600; }
.video { position: relative; aspect-ratio: 16/9; margin: 2em 0; border-radius: 16px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.related { padding: 56px 0 72px; }

/* Quiz & calculator */
.quiz, .calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 1.5em 0; }
.quiz fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.quiz legend { font-weight: 600; margin-bottom: 10px; display: flex; gap: 10px; line-height: 1.45; }
.quiz legend span { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; font-size: .85rem; }
.quiz label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; cursor: pointer; line-height: 1.45; }
.quiz label:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.quiz input { accent-color: var(--gold); margin-top: 4px; }
.quiz-result { margin-top: 18px; padding: 16px 18px; border-radius: 12px; background: var(--gold-soft); }
.calc label { font-weight: 600; }
.calc-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.calc input { width: 160px; padding: 11px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
.calc input:focus { outline: 2px solid var(--gold); border-color: transparent; }
.calc-out { margin: 4px 0 0; color: var(--muted); }
.calc-out strong { color: var(--ink); font-size: 1.15rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 24px; color: var(--muted); font-size: .92rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-inner p { max-width: 38em; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.legal { margin-top: 18px; font-size: .82rem; }
.notfound { padding: 100px 0; text-align: center; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .card { transition: none; } }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
