/* Xorlot — dirección de arte provisional (fintech editorial) */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #141a21;
  --ink-2: #4a5560;
  --ink-3: #7b8791;
  --line: #e4e1d9;
  --accent: #0f6b5a;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ec;
  --warn-bg: #fff4e5;
  --warn-ink: #7a4a00;
  --warn-line: #f2cf8a;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(20, 26, 33, 0.06);
  --max: 1120px;
  --font: "Instrument Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1317; --surface: #161c22; --ink: #eef1f3; --ink-2: #b7c0c8; --ink-3: #8b96a0;
    --line: #27303a; --accent: #4fc3a3; --accent-ink: #0b1511; --accent-soft: #13302a;
    --warn-bg: #2b2210; --warn-ink: #f2d39a; --warn-line: #5a4312; --shadow: 0 10px 30px rgba(0,0,0,.35);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 17px; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.3rem, 5.5vw, 4.2rem); }
h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
.small { font-size: .92rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* header */
.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.wordmark { font-family: var(--serif); font-size: 1.5rem; letter-spacing: .02em; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.wordmark .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.wordmark small { font-family: var(--font); font-size: .7rem; color: var(--ink-3); letter-spacing: .12em; text-transform: uppercase; margin-left: 6px; }
nav.main a { color: var(--ink-2); text-decoration: none; margin-left: 20px; font-size: .95rem; }
nav.main a:hover { color: var(--ink); }
@media (max-width: 720px) { nav.main a:not(.btn) { display: none; } }

/* risk band */
.risk-band { background: var(--warn-bg); color: var(--warn-ink); border-bottom: 1px solid var(--warn-line); font-size: .9rem; }
.risk-band .wrap { padding: 10px 16px; display: flex; gap: 10px; align-items: flex-start; }
.risk-band strong { font-weight: 600; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-size: 1rem; font-family: inherit; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; min-height: 44px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15,107,90,.25); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* sections */
section { padding: clamp(56px, 8vw, 110px) 0; }
section + section { border-top: 1px solid var(--line); }
.eyebrow { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 14px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.card .num { font-family: var(--serif); font-size: 2rem; color: var(--accent); line-height: 1; margin-bottom: 10px; }

/* hero */
.hero { padding-top: clamp(48px, 7vw, 90px); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } }
.hero p.lead { font-size: 1.22rem; color: var(--ink-2); max-width: 54ch; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero .note { margin-top: 14px; font-size: .9rem; color: var(--ink-3); }
.figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.figure .label { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }

/* leverage visual */
.lev { display: grid; gap: 10px; }
.lev .row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: .92rem; }
.lev .bar { height: 14px; border-radius: 999px; background: var(--line); position: relative; overflow: hidden; }
.lev .bar span { position: absolute; inset: 0 auto 0 50%; width: 0; border-radius: 999px; }
.lev .bar span.up { background: var(--accent); transform-origin: left; }
.lev .bar span.down { background: #c0392b; right: 50%; left: auto; transform-origin: right; }
.lev .legend { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-3); }

/* steps */
.steps { counter-reset: s; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { position: relative; padding: 26px 26px 26px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.step::before { counter-increment: s; content: counter(s, decimal-leading-zero); font-family: var(--serif); font-size: 2.2rem; color: var(--accent); display: block; margin-bottom: 8px; }

/* list with checks */
ul.check { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
ul.check li { padding-left: 30px; position: relative; }
ul.check li::before { content: ""; position: absolute; left: 0; top: .45em; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent); }
ul.check li::after { content: ""; position: absolute; left: 6px; top: .72em; width: 7px; height: 4px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

/* labels */
.tag { display: inline-block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); margin-left: 6px; vertical-align: middle; }

/* table */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.table-wrap { overflow-x: auto; }

/* faq */
details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 10px; }
summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { padding: 0 18px 16px; margin: 0; color: var(--ink-2); }

/* form */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
input[type="text"], input[type="email"], select { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: var(--bg); color: var(--ink); min-height: 46px; }
input:focus, select:focus { border-color: var(--accent); }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; color: var(--ink-2); font-weight: 400; }
.consent input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.msg { border-radius: var(--radius-sm); padding: 12px 14px; font-size: .95rem; margin-top: 12px; display: none; }
.msg.error { display: block; background: #fdecea; color: #7a1f17; border: 1px solid #f5b7b1; }
.msg.ok { display: block; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
.field-error { color: #b03a2e; font-size: .88rem; margin-top: 6px; display: none; }
.field.invalid .field-error { display: block; }
.field.invalid input { border-color: #b03a2e; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 40px 0 60px; font-size: .9rem; color: var(--ink-2); }
footer .cols { display: grid; gap: 24px; grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 720px) { footer .cols { grid-template-columns: 1fr; } }
footer a { color: var(--ink-2); }
footer .legal { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--ink-3); }

/* reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* guide / article */
.article { max-width: 720px; margin: 0 auto; padding: 40px 16px 80px; }
.article h2 { margin-top: 2.2em; }
.article .box { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 16px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.4em 0; }
.article .box.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0; }
.toc ol { margin: 0; padding-left: 20px; }
@media print {
  .top, .risk-band, footer, .no-print, .btn { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .article { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
}
