/* brand.css — Zaveli v4 con soporte nativo Light + Dark (light-dark() + color-scheme).
 * Tipografía: Host Grotesk + JetBrains Mono (fallback Figtree local).
 * Compatible con todos los tokens --ld-* de las páginas secundarias.
 */
@font-face {
  font-family: Figtree;
  src: url('/fonts/Figtree-latin-variable.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --ld-font-serif: "Host Grotesk", Figtree, -apple-system, BlinkMacSystemFont, sans-serif;
  --ld-font-sans: "Host Grotesk", Figtree, -apple-system, BlinkMacSystemFont, sans-serif;
  --ld-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Raw tokens */
  --ld-bg-l: #F6F8FC; --ld-bg-d: #0A0D14;
  --ld-surf-l: #FFFFFF; --ld-surf-d: #131824;
  --ld-surfm-l: #EEF2F8; --ld-surfm-d: #1A2130;
  --ld-fg-l: #0F172A; --ld-fg-d: #E9EDF3;
  --ld-sec-l: #475569; --ld-sec-d: #94A0B4;
  --ld-mut-l: #64748B; --ld-mut-d: #7B879B;
  --ld-bdr-l: rgba(15, 23, 42, 0.12); --ld-bdr-d: rgba(233, 237, 243, 0.12);
  --ld-bdrc-l: rgba(15, 23, 42, 0.24); --ld-bdrc-d: rgba(233, 237, 243, 0.24);
  --ld-pri-l: #1D4ED8; --ld-pri-d: #5AB9FC;
  --ld-prih-l: #1E40AF; --ld-prih-d: #7CC8FD;
  --ld-onp-l: #FFFFFF; --ld-onp-d: #07131F;
  --ld-accs-l: rgba(29, 78, 216, 0.10); --ld-accs-d: rgba(90, 185, 252, 0.14);
  --ld-hdr-l: rgba(246, 248, 252, 0.88); --ld-hdr-d: rgba(10, 13, 20, 0.86);
  --ld-ftr-l: #EDF1F7; --ld-ftr-d: #07090F;

  /* Fallback defaults (light) */
  --ld-background: var(--ld-bg-l);
  --ld-surface: var(--ld-surf-l);
  --ld-surface-muted: var(--ld-surfm-l);
  --ld-foreground: var(--ld-fg-l);
  --ld-text-secondary: var(--ld-sec-l);
  --ld-text-muted: var(--ld-mut-l);
  --ld-border: var(--ld-bdr-l);
  --ld-border-control: var(--ld-bdrc-l);
  --ld-primary: var(--ld-pri-l);
  --ld-primary-hover: var(--ld-prih-l);
  --ld-primary-active: var(--ld-prih-l);
  --ld-on-primary: var(--ld-onp-l);
  --ld-accent: var(--ld-pri-l);
  --ld-accent-ink: var(--ld-pri-l);
  --ld-accent-soft: var(--ld-accs-l);
  --ld-focus: var(--ld-pri-l);
  --ld-header-bg: var(--ld-hdr-l);
  --ld-footer-bg: var(--ld-ftr-l);

  --ld-success: #16A34A;
  --ld-success-soft: rgba(22, 163, 74, 0.14);
  --ld-danger: #DC2626;
  --ld-danger-soft: rgba(220, 38, 38, 0.14);
  --ld-overlay: rgba(7, 9, 15, 0.65);

  --ld-radius-control: 10px;
  --ld-radius-panel: 14px;
  --ld-radius-dialog: 16px;
  --ld-content-max: 1220px;
  --ld-gutter: 40px;
  --ld-control-height: 44px;
  --ld-duration: 150ms;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
  --ld-background: var(--ld-bg-d);
  --ld-surface: var(--ld-surf-d);
  --ld-surface-muted: var(--ld-surfm-d);
  --ld-foreground: var(--ld-fg-d);
  --ld-text-secondary: var(--ld-sec-d);
  --ld-text-muted: var(--ld-mut-d);
  --ld-border: var(--ld-bdr-d);
  --ld-border-control: var(--ld-bdrc-d);
  --ld-primary: var(--ld-pri-d);
  --ld-primary-hover: var(--ld-prih-d);
  --ld-primary-active: var(--ld-prih-d);
  --ld-on-primary: var(--ld-onp-d);
  --ld-accent: var(--ld-pri-d);
  --ld-accent-ink: var(--ld-pri-d);
  --ld-accent-soft: var(--ld-accs-d);
  --ld-focus: var(--ld-pri-d);
  --ld-header-bg: var(--ld-hdr-d);
  --ld-footer-bg: var(--ld-ftr-d);
}
:root:has(> head > meta[name="color-scheme"][content="light"]) { color-scheme: light; }

.zv-logo-dark, .zv-ico-sun { display: none; }
.zv-logo-light, .zv-ico-moon { display: block; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) .zv-logo-dark,
:root:has(> head > meta[name="color-scheme"][content="dark"]) .zv-ico-sun { display: block; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) .zv-logo-light,
:root:has(> head > meta[name="color-scheme"][content="dark"]) .zv-ico-moon { display: none; }

@media (max-width: 950px) { :root { --ld-gutter: 24px; } }
@media (max-width: 680px) { :root { --ld-gutter: 18px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ld-background);
  color: var(--ld-foreground);
  font: 400 16px/1.6 var(--ld-font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main h1, main h2 { font-family: var(--ld-font-sans); font-weight: 500; letter-spacing: -.035em; }
img, svg { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
button, a, summary { touch-action: manipulation; }
::selection { background: var(--ld-primary); color: var(--ld-on-primary); }
:is(a, button, input, textarea, select, summary):focus-visible { outline: 2px solid var(--ld-focus); outline-offset: 3px; }
html[lang="es"] [data-lang="en"], html[lang="en"] [data-lang="es"] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.ld-wrap { width: min(var(--ld-content-max), 100%); padding: 0 var(--ld-gutter); margin: 0 auto; }

.ld-skip {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--ld-primary); color: var(--ld-on-primary);
  padding: 10px 16px; border-radius: var(--ld-radius-control);
  font-weight: 600; text-decoration: none;
}
.ld-skip:focus { top: 12px; }

.ld-button {
  min-height: var(--ld-control-height);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--ld-primary); border-radius: var(--ld-radius-control);
  font: 600 15px/20px var(--ld-font-sans);
  background: var(--ld-primary); color: var(--ld-on-primary);
  text-decoration: none; cursor: pointer;
  transition: transform var(--ld-duration), background var(--ld-duration), border-color var(--ld-duration);
}
.ld-button:hover { transform: translateY(-2px); background: var(--ld-primary-hover); border-color: var(--ld-primary-hover); }
.ld-button:active { transform: translateY(0); }
.ld-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ld-button--outline { background: transparent; color: var(--ld-foreground); border-color: var(--ld-border-control); }
.ld-button--outline:hover { background: var(--ld-surface-muted); border-color: var(--ld-foreground); }

.ld-textlink { font-size: 15px; font-weight: 500; color: var(--ld-accent); text-underline-offset: 5px; }
.ld-textlink:hover { color: var(--ld-foreground); }

.ld-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ld-header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ld-border);
}
.ld-nav { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.ld-brand { display: inline-flex; align-items: center; flex: none; text-decoration: none; }
.ld-brand img, .ld-brand--z img { width: 176px; height: auto; }
.ld-nav-links { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 400; color: var(--ld-text-secondary); }
.ld-nav-links a { text-decoration: none; padding: 6px 0; transition: color var(--ld-duration); }
.ld-nav-links a:hover, .ld-nav-links a[aria-current="page"] { color: var(--ld-foreground); }
.ld-nav-links a[aria-current="page"] { font-weight: 600; text-decoration: underline; text-decoration-color: var(--ld-primary); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.ld-nav-cta { display: flex; align-items: center; gap: 12px; }
.ld-nav-cta .ld-button { min-height: 40px; padding: 8px 16px; font-size: 14.5px; }

.ld-theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; border-radius: 9px;
  border: 1px solid var(--ld-border-control); background: var(--ld-surface);
  color: var(--ld-foreground); cursor: pointer;
}
.ld-theme-btn:hover { border-color: var(--ld-primary); color: var(--ld-primary); }
.ld-theme-btn svg { width: 18px; height: 18px; }

.ld-lang { display: inline-flex; align-items: center; gap: 2px; font: 500 12.5px/1 var(--ld-font-mono); }
.ld-lang button { min-width: 30px; min-height: 30px; padding: 0 5px; border: 0; background: none; cursor: pointer; color: var(--ld-text-secondary); }
.ld-lang button[aria-current="page"], .ld-lang button[aria-pressed="true"] { color: var(--ld-foreground); font-weight: 700; text-decoration: underline; text-underline-offset: 5px; }
.ld-lang .ld-sep { color: var(--ld-border-control); }

.ld-menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: var(--ld-surface); border: 1px solid var(--ld-border-control); border-radius: var(--ld-radius-control); cursor: pointer;
}
.ld-menu-toggle svg { width: 20px; height: 20px; }
.ld-menu-toggle .ld-i-close { display: none; }
.ld-header.menu-open .ld-menu-toggle .ld-i-open { display: none; }
.ld-header.menu-open .ld-menu-toggle .ld-i-close { display: block; }

@media (max-width: 950px) {
  .ld-nav { min-height: 66px; gap: 14px; flex-wrap: wrap; }
  .ld-brand img, .ld-brand--z img { width: 146px; }
  .ld-menu-toggle { display: inline-flex; }
  .ld-nav-cta .ld-button { display: none; }
  .ld-nav-links { display: none; order: 3; width: 100%; flex-direction: column; align-items: stretch; gap: 0; border-top: 1px solid var(--ld-border); padding: 8px 0 18px; }
  .ld-nav-links a { padding: 13px 0; font-size: 16px; border-bottom: 1px solid var(--ld-border); color: var(--ld-foreground); }
  .ld-header.menu-open .ld-nav-links { display: flex; max-height: calc(100vh - 80px); overflow-y: auto; }
  .ld-nav-links .ld-nav-cta-item { display: inline-flex; margin-top: 14px; border: 0; color: var(--ld-on-primary); }
}
@media (min-width: 951px) { .ld-nav-links .ld-nav-cta-item { display: none; } }

.ld-nav-links--dense { gap: 22px; font-size: 14.5px; }

.ld-footer { background: var(--ld-footer-bg); color: var(--ld-foreground); border-top: 1px solid var(--ld-border); }
.ld-footer a { text-underline-offset: 4px; text-decoration: none; }
.ld-footer a:hover { color: var(--ld-accent); text-decoration: underline; }
.ld-footer :is(a, button):focus-visible { outline-color: var(--ld-accent); }
.ld-footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-top: 64px; padding-bottom: 44px; }
.ld-footer-brand img, .ld-footer-brand--z img { width: 176px; height: auto; margin-bottom: 18px; }
.ld-footer p { margin: 0 0 8px; font-size: 14px; color: var(--ld-text-secondary); line-height: 1.6; }
.ld-footer h3 { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--ld-foreground); }
.ld-footer ul { list-style: none; margin: 0; padding: 0; }
.ld-footer li { margin-bottom: 8px; }
.ld-footer li a, .ld-footer p a { font-size: 14px; color: var(--ld-text-secondary); }
.ld-footer li a:hover, .ld-footer p a:hover { color: var(--ld-accent); }
.ld-footer-legal { border-top: 1px solid var(--ld-border); padding-top: 22px; padding-bottom: 28px; display: flex; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; font-size: 13px; color: var(--ld-text-secondary); }
.ld-footer-legal a { color: var(--ld-foreground); }
@media (max-width: 950px) { .ld-footer-grid { grid-template-columns: 1fr 1fr; } .ld-footer-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .ld-footer-grid { grid-template-columns: 1fr; padding-top: 48px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ld-button { transition: none; }
}
