/* Apex-local Polaris page — match apex shell / platform (#070a0d) */

html[data-theme="dark"]:has(> body.apex-local.polaris-doc) {
  --alt-bg: #070a0d;
  background: #070a0d;
}

.apex-local.polaris-doc {
  --pd-bg: var(--alt-bg, #070a0d);
  --pd-fg: #f2f4f5;
  --pd-muted: #929aa5;
  --pd-border: #262626;
  --alt-bg: #070a0d;
}

html[data-theme="dark"] .apex-local.polaris-doc,
html[data-theme="dark"] body.landing-altitude.apex-local.polaris-doc {
  --pd-bg: #070a0d;
  --pd-fg: #f2f4f5;
  --pd-muted: #929aa5;
  --pd-border: #262626;
  background: #070a0d;
  color: var(--pd-fg);
}

html[data-theme="light"] .apex-local.polaris-doc,
html[data-theme="light"] body.landing-altitude.apex-local.polaris-doc {
  --pd-bg: #ffffff;
  --pd-fg: #171919;
  --pd-muted: #5e6460;
  --pd-border: #e5e7eb;
  background: #ffffff;
  color: var(--pd-fg);
}

/* Horizon hero — force site shell; kill grey lift from grain/glow */
.apex-local.polaris-doc .polaris-horizon {
  --ph-bg: var(--alt-bg, #070a0d);
  --ph-fg: #f5f5f1;
  --ph-muted: #b5bdc4;
  --ph-meta: #9aa5ae;
  background: var(--ph-bg) !important;
}

.apex-local.polaris-doc .polaris-horizon-grain,
.marketing-local .polaris-horizon-grain {
  opacity: 0;
  visibility: hidden;
}

.apex-local.polaris-doc .polaris-horizon-glow,
.marketing-local .polaris-horizon-glow {
  background: radial-gradient(
    ellipse 46% 16% at 50% 102%,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(173, 186, 199, 0.07) 16%,
    rgba(88, 102, 119, 0.05) 32%,
    transparent 68%
  );
  opacity: 0.65;
}

.apex-local.polaris-doc .polaris-horizon-rim,
.marketing-local .polaris-horizon-rim {
  border-color: rgba(203, 217, 234, 0.16);
  box-shadow: 0 -4px 20px rgba(165, 188, 215, 0.05);
}

.apex-local.polaris-doc .polaris-doc-main {
  background: var(--pd-bg, #070a0d);
}

html[data-theme="light"] .apex-local.polaris-doc .polaris-horizon {
  --ph-bg: #070a0d; /* keep hero dark in light mode, matching live */
  background: #070a0d !important;
}

html[data-theme="light"] .apex-local.polaris-doc .polaris-doc-main {
  background: #ffffff;
}

/* Soften code / CTA surfaces to match terminal tokens */
.apex-local.polaris-doc .polaris-doc-code {
  background: #141414;
  border: 1px solid #262626;
}

.apex-local.polaris-doc .polaris-doc-cta-row a.primary {
  background: #f3f3f3;
  color: #0c0c0c;
}

html[data-theme="light"] .apex-local.polaris-doc .polaris-doc-cta-row a.primary {
  background: #111827;
  color: #fff;
}

.apex-local.polaris-doc .polaris-doc-cta-row a.ghost {
  border-color: #262626;
  color: var(--pd-fg);
}

/* Example chart card on charcoal */
.apex-local.polaris-doc .polaris-example-terminal {
  border-color: #262626;
  background: #141414;
}

/* No footer CTA card on the Polaris one-pager — keep a top rule for the link grid */
.apex-local.polaris-doc .alt-footer-cta {
  display: none;
}

.apex-local.polaris-doc .alt-footer-shell {
  border-top: 1px solid color-mix(in srgb, var(--alt-fg, #fff) 10%, transparent);
  padding-top: 3.25rem;
}
