/* Base: tokens (heredados del sitio principal + tema oscuro), tipografía, encabezado, botones, hero. */
:root {
  color-scheme: light;
  --ink: #17243a;
  --ink-soft: #536176;
  --muted: #5f6d82;
  --paper: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --tint: #eef2f7;
  --line: #e2e7ef;
  --line-strong: #d4dce7;
  --navy: #183b67;
  --accent: #2f659b;
  --accent-soft: #eaf1f8;
  --btn-bg: #183b67;
  --btn-bg-hover: #214e7e;
  --btn-ink: #ffffff;
  --warm: #9a6a1f;
  --ok: #2c7a5a;
  --ok-soft: #e1f1e9;
  --bad: #b3402f;
  --bad-soft: #f8e5e1;
  --focus: #77a9d8;
  --edge: #9fb2c8;
  --deep: #142d4a;
  --deep-ink: #e5ebf3;
  --shadow: 0 20px 55px rgba(25, 47, 77, .08);

  /* nodos de árbol */
  --n-op-fill: #183b67;   --n-op-stroke: #0f2a4a;   --n-op-ink: #ffffff;
  --n-fn-fill: #9cc4b2;   --n-fn-stroke: #5f9784;   --n-fn-ink: #10243b;
  --n-var-fill: #eaf1f8;  --n-var-stroke: #2f659b;  --n-var-ink: #183b67;
  --n-const-fill: #f0e8d9; --n-const-stroke: #a88b55; --n-const-ink: #4a3a17;

  --serif: Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Manrope", "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eef7;
  --ink-soft: #aebbd0;
  --muted: #93a3ba;
  --paper: #0e1a2b;
  --surface: #152338;
  --surface-2: #1b2d46;
  --tint: #111f33;
  --line: #26364d;
  --line-strong: #34475f;
  --navy: #9ec5ec;
  --accent: #7db3e6;
  --accent-soft: #1b2f49;
  --btn-bg: #3a78b5;
  --btn-bg-hover: #4a8ccc;
  --btn-ink: #ffffff;
  --warm: #e0b26a;
  --ok: #6fcf9f;
  --ok-soft: #153327;
  --bad: #f0907f;
  --bad-soft: #3a1d19;
  --focus: #8fc0f0;
  --edge: #4b6280;
  --deep: #0a1423;
  --deep-ink: #e5ebf3;
  --shadow: 0 20px 55px rgba(0, 0, 0, .35);

  --n-op-fill: #3a78b5;   --n-op-stroke: #8fc0f0;   --n-op-ink: #ffffff;
  --n-fn-fill: #5e9c86;   --n-fn-stroke: #9cd0bb;   --n-fn-ink: #0b1a17;
  --n-var-fill: #1b2f49;  --n-var-stroke: #7db3e6;  --n-var-ink: #dbeafa;
  --n-const-fill: #3a3226; --n-const-stroke: #c8ad78; --n-const-ink: #f0e8d9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; }
body { margin: 0; overflow-x: hidden; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.65; -webkit-font-smoothing: antialiased; transition: background .25s, color .25s; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .92em; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--surface); padding: .75rem 1rem; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }
[hidden] { display: none !important; }

/* Encabezado */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.nav-wrap, .section-shell, .footer-inner, .footer-bottom { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.nav-wrap { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 1rem; padding-top: .55rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.brand-mark { width: 39px; height: 39px; padding: 5px; background: #fff; border-radius: 11px; box-shadow: inset 0 0 0 1px var(--line); object-fit: contain; }
.brand-name { display: grid; font-size: .77rem; line-height: 1.35; letter-spacing: -.02em; color: var(--ink-soft); }
.brand-name b { font-size: .83rem; color: var(--ink); font-weight: 700; }
.primary-nav { display: contents; }
.nav-top { grid-row: 1; grid-column: 2; justify-self: end; display: flex; align-items: center; gap: 1rem; }
.nav-links { grid-row: 2; grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0 clamp(.9rem, 1.6vw, 1.5rem); margin-top: .35rem; padding: .15rem 0 .45rem; border-top: 1px solid var(--line); }
.primary-nav a { white-space: nowrap; color: var(--ink-soft); font-size: .78rem; font-weight: 600; transition: color .2s; }
.nav-links a { padding: .45rem 0; }
.primary-nav a:hover, .primary-nav a:focus-visible, .primary-nav a.is-current { color: var(--accent); }
.primary-nav a.is-current { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.nav-site { color: var(--ink-soft); }
.nav-tools { display: flex; align-items: center; gap: .5rem; }
.language-toggle, .icon-toggle { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 7px; color: var(--navy); font-weight: 800; cursor: pointer; }
.language-toggle { padding: .42rem .65rem; font-size: .75rem; }
.icon-toggle { display: grid; place-items: center; width: 34px; height: 33px; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
.menu-toggle { display: none; }

/* Botones */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 1rem; min-height: 48px; padding: .75rem 1.1rem; border-radius: 8px; border: 1px solid transparent; font-size: .83rem; font-weight: 700; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--btn-bg); color: var(--btn-ink); box-shadow: 0 8px 20px rgba(24, 59, 103, .16); }
.button-primary:hover { background: var(--btn-bg-hover); }
.button-secondary { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.text-btn { border: 0; background: none; padding: .25rem .1rem; color: var(--accent); font-size: .78rem; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-link { display: inline-flex; align-items: center; gap: .55rem; color: var(--accent); font-size: .8rem; font-weight: 800; }

/* Encabezados de sección */
.eyebrow { display: flex; align-items: center; gap: .65rem; margin: 0 0 1.25rem; color: var(--accent); text-transform: uppercase; font-size: .68rem; font-weight: 800; letter-spacing: .16em; }
.eyebrow-line { display: inline-block; width: 27px; height: 2px; background: currentColor; }
.content-section { padding-top: clamp(5rem, 9vw, 8rem); padding-bottom: clamp(5rem, 8vw, 7rem); }
.tinted-section { background: var(--tint); width: 100%; max-width: none; padding-left: max(24px, calc((100% - 1160px) / 2)); padding-right: max(24px, calc((100% - 1160px) / 2)); }
.section-heading { max-width: 760px; margin-bottom: 2.6rem; }
.section-heading h2 { margin: 0; font: 700 clamp(2rem, 4vw, 3.1rem)/1.15 var(--display); letter-spacing: -.06em; }
.section-intro { max-width: 620px; margin: .9rem 0 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.8; }
.section-intro.wide { max-width: 760px; }
.lead-question { margin: 1rem 0 0; color: var(--ink-soft); font: 500 clamp(1.1rem, 2vw, 1.35rem)/1.5 var(--display); letter-spacing: -.02em; }
.section-footnote { margin: 1.2rem 0 0; color: var(--muted); font-size: .76rem; }

/* Hero */
.hero { display: grid; grid-template-columns: .95fr 1.05fr; align-items: center; gap: clamp(2.5rem, 6vw, 5.5rem); padding-top: clamp(3.5rem, 7vw, 6.5rem); padding-bottom: clamp(4rem, 7vw, 6rem); min-height: 620px; }
.hero h1 { margin: 0; font-family: var(--display); font-size: clamp(2.8rem, 5.6vw, 5rem); line-height: 1.04; letter-spacing: -.065em; font-weight: 800; }
.hero-sub { margin: .9rem 0 0; color: var(--accent); font: 700 clamp(1.15rem, 2vw, 1.5rem)/1.3 var(--display); letter-spacing: -.03em; }
.hero-lead { max-width: 560px; margin: 1.3rem 0 0; color: var(--ink-soft); font-size: clamp(1rem, 1.4vw, 1.08rem); line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-meta { display: flex; align-items: center; gap: .55rem; margin-top: 1.8rem; color: var(--muted); font-size: .75rem; }
.meta-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #6b9a86; }

/* Footer */
.site-footer { background: #10243b; color: #c3cfdd; padding: 1.7rem 0 1rem; }
:root[data-theme="dark"] .site-footer { background: #091220; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-bottom: 1.4rem; }
.footer-brand .brand-name, .footer-brand .brand-name b { color: #e5ebf3; }
.footer-inner > p { margin: 0; font-size: .75rem; }
.back-top { color: #d9e4f0; font-size: .75rem; font-weight: 700; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .12); color: #9db0c6; font-size: .67rem; }
