/* Synergic APIs — hoja compartida. Developer-first, dos temas por CSS vars:
   CLARO por defecto (:root) y oscuro via html[data-theme="dark"] (toggle en
   site.js con persistencia en localStorage; decisión del 2026-08-02).
   Sin dependencias externas (fuentes del sistema por privacidad).
   Contrastes del tema claro verificados WCAG AA (accent 4.75:1+, dim 5.5:1+,
   texto botón primario 5.0:1) — no cambiar un color sin re-validar. */

:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --bg-soft: #eef2f6;
  --bg-card: #ffffff;
  --border: #d8dfe7;
  --text: #1c2430;
  --text-dim: #5a6675;
  --accent: #1a7f4e;
  --accent-dim: #bfe3d2;
  --danger: #c0392b;
  --header-bg: rgba(247, 249, 251, 0.92);
  --btn-primary-text: #ffffff;
  --shadow-tip: 0 4px 14px rgba(15, 23, 42, 0.18);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --bg-soft: #151b23;
  --bg-card: #161d27;
  --border: #2a3441;
  --text: #e6e8eb;
  --text-dim: #9aa4b2;
  --accent: #4cc38a;
  --accent-dim: #2c5e46;
  --danger: #e5534b;
  --header-bg: rgba(13, 17, 23, 0.92);
  --btn-primary-text: #08110c;
  --shadow-tip: 0 4px 14px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- header ---------- */
header.site {
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
header.site .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.8rem; padding-bottom: 0.8rem; gap: 1rem; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.05rem; color: var(--text); letter-spacing: 0.2px; }
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }
nav.main { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
nav.main a { color: var(--text-dim); font-size: 0.92rem; }
nav.main a:hover { color: var(--text); text-decoration: none; }

/* ---------- botones ---------- */
.btn {
  display: inline-block; padding: 0.55rem 1.1rem; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text);
  font-size: 0.92rem; font-weight: 600; cursor: pointer; background: var(--bg-card);
}
.btn:hover { border-color: var(--text-dim); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--btn-primary-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.disabled, .btn:disabled {
  opacity: 0.45; cursor: not-allowed; pointer-events: none;
}
.btn.theme-toggle { padding: 0.45rem 0.6rem; line-height: 0; }
.theme-toggle svg { width: 16px; height: 16px; vertical-align: middle; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- hero ---------- */
.hero { padding: 4.5rem 0 3rem; }
.hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); line-height: 1.2; margin: 0 0 1rem; }
.hero p.sub { color: var(--text-dim); font-size: 1.1rem; max-width: 40rem; margin: 0 0 1.8rem; }
.hero .actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* ---------- secciones ---------- */
section { padding: 2.5rem 0; }
section h2 { font-size: 1.5rem; margin: 0 0 1.2rem; }
section p.lead { color: var(--text-dim); max-width: 44rem; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.4rem;
}
.card h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.card p { color: var(--text-dim); font-size: 0.95rem; margin: 0.4rem 0 1rem; }
.card ul { color: var(--text-dim); font-size: 0.92rem; margin: 0 0 1rem; padding-left: 1.2rem; }

/* ---------- code / pre ----------
   Los bloques de código y la key-box son OSCUROS EN AMBOS TEMAS (patrón
   docs claras + terminal oscuro); sus colores de sintaxis están calibrados
   para ese fondo fijo y el texto base va explícito (no hereda del tema). */
pre, code { font-family: var(--mono); }
code.inline { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 5px; padding: 0.1rem 0.35rem; font-size: 0.85em; }
pre.block {
  background: #0a0e14; border: 1px solid #263041; border-radius: 10px;
  color: #e6e8eb;
  padding: 1rem 1.2rem; overflow-x: auto; font-size: 0.84rem; line-height: 1.55;
}
pre.block .c { color: #8b949e; } /* comentario */
pre.block .k { color: #79b8ff; } /* keyword/campo */
pre.block .s { color: #9ecbff; } /* string */
pre.block .n { color: #ffab70; } /* número */

/* ---------- tablas ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-dim); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
td code { font-size: 0.82rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.table-wrap table { min-width: 560px; }
.table-wrap th { background: var(--bg-soft); }

/* ---------- pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.plan { display: flex; flex-direction: column; }
.plan .price { font-size: 1.7rem; font-weight: 700; margin: 0.3rem 0; }
.plan .price small { font-size: 0.85rem; color: var(--text-dim); font-weight: 400; }
.plan ul { flex: 1; }
.plan.featured { border-color: var(--accent-dim); box-shadow: 0 0 0 1px var(--accent-dim); }
.plan .tag {
  align-self: flex-start; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); border: 1px solid var(--accent-dim); border-radius: 99px; padding: 0.1rem 0.6rem; margin-bottom: 0.4rem;
}
p.pricing-note { color: var(--text-dim); font-size: 0.88rem; margin-top: 1rem; }

/* ---------- FAQ ---------- */
details {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0.8rem 1.1rem; margin-bottom: 0.7rem; background: var(--bg-card);
}
details summary { cursor: pointer; font-weight: 600; font-size: 0.97rem; }
details p { color: var(--text-dim); font-size: 0.93rem; margin: 0.7rem 0 0.2rem; }

/* ---------- demo widget ---------- */
.demo-box { margin-top: 1rem; }
.demo-box .demo-out {
  min-height: 6rem; margin-top: 0.8rem; white-space: pre-wrap; word-break: break-word;
}
.demo-status { font-size: 0.85rem; color: var(--text-dim); margin-left: 0.8rem; }

/* ---------- formularios ---------- */
form.stack { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 1.2rem 0; }
input[type="email"] {
  flex: 1 1 260px; padding: 0.6rem 0.9rem; font-size: 1rem;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
}
input[type="email"]:focus { outline: none; border-color: var(--accent); }
.field-error { color: var(--danger); font-size: 0.9rem; }

/* ---------- key reveal (oscura en ambos temas, como pre.block) ---------- */
.key-box {
  background: #0a0e14; border: 1px solid #2c5e46; border-radius: 10px;
  color: #e6e8eb;
  padding: 1rem 1.2rem; font-family: var(--mono); font-size: 0.95rem;
  word-break: break-all; margin: 1rem 0;
}
.notice {
  border-left: 3px solid var(--accent); background: var(--bg-soft);
  padding: 0.7rem 1rem; border-radius: 0 8px 8px 0; font-size: 0.92rem; color: var(--text-dim);
}
.notice.warn { border-left-color: #d29922; }

/* ---------- gráficas (widgets SEO) ----------
   Colores dataviz validados con el validador de la skill POR TEMA:
   claro = serie #1a7f4e sobre superficie #ffffff (2026-08-02, todas las
   checks PASS); oscuro = serie #37a877 sobre #161d27 (validación previa).
   Grid/ejes recesivos, un paso sobre la superficie; el texto usa tokens
   de texto, nunca el color de la serie. */
:root {
  --chart-line: #1a7f4e;
  --chart-surface: #ffffff;
  --chart-grid: #e7ecf1;
  --chart-axis: #cbd4de;
}
:root[data-theme="dark"] {
  --chart-line: #37a877;
  --chart-surface: #161d27;
  --chart-grid: #212a36;
  --chart-axis: #2f3a49;
}

.chart-figure { position: relative; outline: none; }
.chart-figure:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 8px; }

.chart-line-path { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart-axis { stroke: var(--chart-axis); stroke-width: 1; }
.chart-crosshair { stroke: var(--text-dim); stroke-width: 1; }
.chart-dot { fill: var(--chart-line); stroke: var(--chart-surface); stroke-width: 2; }
.chart-tick { fill: var(--text-dim); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart-note { fill: var(--text); font-size: 11.5px; font-weight: 600; font-family: var(--sans); }

.chart-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.35rem 0.6rem; font-size: 0.85rem; white-space: nowrap;
  box-shadow: var(--shadow-tip);
}
.chart-tip-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-tip-label { color: var(--text-dim); font-size: 0.78rem; }

.chart-empty {
  color: var(--text-dim); font-size: 0.95rem; text-align: center;
  padding: 3rem 1rem; border: 1px dashed var(--border); border-radius: 10px;
}

.chart-controls { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.8rem; flex-wrap: wrap; }
.chart-controls .label { color: var(--text-dim); font-size: 0.85rem; }
.btn.toggle { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.btn.toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

.chart-table { margin-top: 1rem; max-height: 320px; overflow-y: auto; }
.chart-table table { min-width: 0; }
details.chart-data summary { color: var(--text-dim); font-size: 0.9rem; }

/* ---------- hero number (widgets) ---------- */
.stat-hero { margin: 0.5rem 0 0.2rem; }
.stat-hero .value {
  font-size: clamp(1.7rem, 6.5vw, 3.4rem); font-weight: 700; line-height: 1.15;
  letter-spacing: -0.01em; overflow-wrap: break-word;
}
.stat-hero .asof { color: var(--text-dim); font-size: 0.95rem; margin-top: 0.3rem; }
.stat-hero .delta { color: var(--text-dim); font-size: 0.95rem; margin-top: 0.15rem; font-variant-numeric: tabular-nums; }
.stat-hero.loading .value { color: var(--text-dim); }

/* ---------- páginas legales ---------- */
.legal h2 { font-size: 1.15rem; margin: 1.8rem 0 0.5rem; }
.legal p, .legal li { color: var(--text-dim); font-size: 0.95rem; }
.legal .updated { font-size: 0.85rem; color: var(--text-dim); }

/* ---------- announcement bar ---------- */
a.announce {
  display: block; text-align: center; font-size: 0.85rem;
  padding: 0.45rem 1.25rem; background: var(--bg-soft);
  border-bottom: 1px solid var(--border); color: var(--text-dim);
}
a.announce strong { color: var(--accent); font-weight: 600; }
a.announce:hover { text-decoration: none; color: var(--text); }

/* ---------- vitals / metric chips ----------
   Chips de datos verificables (profundidad, fuente, freshness). El chip de
   estado solo se enciende si /health responde ok (site.js); NUNCA lleva
   latencias: no hay medición continua real que publicar. */
ul.vitals { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.6rem 0 0; padding: 0; list-style: none; }
ul.vitals li {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--mono); font-size: 0.78rem; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0.3rem 0.65rem; background: var(--bg-card);
  font-variant-numeric: tabular-nums;
}
ul.vitals li strong { color: var(--text); font-weight: 600; }
ul.vitals .dot-status { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex: none; }
ul.vitals li.ok { border-color: var(--accent-dim); color: var(--accent); }
ul.vitals li.ok .dot-status { background: var(--accent); }

/* ---------- plan badges (docs) ---------- */
a.badge-plan {
  display: inline-block; font-family: var(--mono); font-size: 0.68rem;
  font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-dim);
  border-radius: 4px; padding: 0.05rem 0.4rem; margin-left: 0.4rem;
  vertical-align: 1px; white-space: nowrap;
}
a.badge-plan:hover { text-decoration: none; border-color: var(--accent); }
p.plan-legend { color: var(--text-dim); font-size: 0.88rem; margin-top: 0.9rem; }
p.plan-legend .badge-plan { margin-left: 0; }

/* ---------- data provenance ---------- */
.source-note {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: var(--bg-card); border-radius: 0 10px 10px 0;
  padding: 1rem 1.3rem; margin: 1.2rem 0;
}
.source-note p { color: var(--text-dim); font-size: 0.92rem; margin: 0.6rem 0; }
.source-note p:first-child { margin-top: 0; }
.source-note p:last-child { margin-bottom: 0; }
.source-note strong { color: var(--text); }

/* ---------- CTA band (repetido tras bloques de docs) ---------- */
.cta-band {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-card); padding: 0.9rem 1.2rem; margin: 1.6rem 0 0;
}
.cta-note { color: var(--text-dim); font-size: 0.85rem; font-family: var(--mono); }

/* ---------- related (cero dead-ends) ---------- */
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.9rem; }
a.related-card {
  display: flex; flex-direction: column; gap: 0.25rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.9rem 1.1rem; color: var(--text);
}
a.related-card:hover { text-decoration: none; border-color: var(--accent-dim); }
a.related-card strong { font-size: 0.95rem; }
a.related-card span { color: var(--text-dim); font-size: 0.84rem; }

/* ---------- FAQ groups ---------- */
.faq-group { margin-top: 1.6rem; }
.faq-group h3 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); margin: 0 0 0.8rem;
}

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--border); margin-top: 3rem;
  padding: 2rem 0 2.5rem; color: var(--text-dim); font-size: 0.85rem;
}
footer.site a { color: var(--text-dim); }
footer.site a:hover { color: var(--text); }
.footer-cta {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  padding-bottom: 1.6rem; border-bottom: 1px solid var(--border); margin-bottom: 1.6rem;
}
nav.footer-map {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem; margin-bottom: 1.8rem;
}
nav.footer-map h4 {
  margin: 0 0 0.6rem; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text);
}
nav.footer-map a { display: block; padding: 0.18rem 0; font-size: 0.88rem; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding-top: 1.2rem; font-size: 0.82rem;
}

/* ---------- code tabs (cURL / Python / JS / MCP) ---------- */
.code-tabs { margin: 1rem 0; }
.code-tabs .tab-bar {
  display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: -1px;
}
.code-tabs [role="tab"] {
  background: var(--bg-soft); color: var(--text-dim);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 8px 8px 0 0; padding: 0.4rem 0.9rem;
  font-size: 0.85rem; font-weight: 600; font-family: var(--sans); cursor: pointer;
}
.code-tabs [role="tab"][aria-selected="true"] {
  background: #0a0e14; color: #e6e8eb; border-color: #263041;
  position: relative; z-index: 1;
}
.code-tabs .tab-panel[hidden] { display: none; }
.code-tabs .tab-panel pre.block { margin: 0; border-top-left-radius: 0; }

/* ---------- endpoint reference ---------- */
details.endpoint-doc {
  padding: 0; overflow: hidden;
}
details.endpoint-doc summary {
  padding: 0.8rem 1.1rem; font-weight: 400;
}
details.endpoint-doc summary code { font-size: 0.88rem; font-weight: 600; }
details.endpoint-doc summary .sum-note { color: var(--text-dim); font-size: 0.88rem; }
details.endpoint-doc .ep-body { padding: 0 1.1rem 1rem; }
details.endpoint-doc h4 {
  margin: 1.1rem 0 0.5rem; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-dim);
}
details.endpoint-doc .table-wrap { border-radius: 8px; }
details.endpoint-doc table { min-width: 480px; font-size: 0.85rem; }
details.endpoint-doc pre.block { font-size: 0.8rem; }

/* ---------- pricing compare table ---------- */
.compare-wrap table { min-width: 640px; }
.compare-wrap th:first-child, .compare-wrap td:first-child { min-width: 180px; }
.compare-wrap td.yes { color: var(--accent); font-weight: 700; }
.compare-wrap td.no { color: var(--text-dim); }
.compare-wrap td, .compare-wrap th { text-align: center; }
.compare-wrap td:first-child, .compare-wrap th:first-child { text-align: left; }
.compare-wrap td { font-variant-numeric: tabular-nums; }

/* ---------- two-column split (signup) ---------- */
.split-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start;
}
@media (max-width: 720px) { .split-2 { grid-template-columns: 1fr; } }

/* ---------- hero demo (home) ---------- */
.hero-demo { margin-top: 1.6rem; }
.hero-demo .demo-out { max-height: 320px; overflow-y: auto; }

/* ---------- bulk data / CSV ---------- */
.bulk-note { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.6rem; }

@media (max-width: 600px) {
  .hero { padding-top: 3rem; }
  th, td { padding: 0.5rem 0.6rem; }
}
