/* Shared controls; the home page does not load the theme controller. */
button.theme-toggle {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; padding: 8px; border: 1px solid var(--line, #303846);
  border-radius: 7px; background: transparent; color: var(--ink, #dce5f2);
  cursor: pointer; vertical-align: middle;
}
button.theme-toggle:hover { background: #91a6c41a; color: var(--ink, #fff); }
button.theme-toggle:focus-visible { outline: 2px solid var(--accent, #3779d3); outline-offset: 4px; }
button.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
button.theme-toggle .theme-moon { display: none; }
:root[data-theme="light"] button.theme-toggle .theme-sun { display: none; }
:root[data-theme="light"] button.theme-toggle .theme-moon { display: block; }
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f9fc; --surface: #fff; --surface2: #edf2f8;
  --ink: #17283f; --paper: #17283f; --muted: #52647a; --quiet: #61728a;
  --line: #d4deeb; --blue: #2367bb; --amber: #895014; --violet: #7050a4; --teal: #18766b;
  --aliot-blue: #2367bb; --aliot-amber: #895014; --aliot-violet: #7050a4; --aliot-teal: #18766b;
  color: var(--ink); background: var(--bg);
}
:root[data-theme="light"] .live-star { mix-blend-mode: normal; }
:root[data-theme="light"] .live-star::before { opacity: .22; }
:root[data-theme="light"] .live-star .stellar-core img { mask-image: radial-gradient(circle, #000 48%, #000 55%, transparent 69%); }
:root[data-site="hub"] .site-header nav,
:root[data-site="cli"] .site-header nav { align-items: center; }

/* Hub, constellation, legal pages and the CLI share the same base styles. */
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) :is(a:hover, button:hover) { color: var(--ink); }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) :is(
  .brand small, .star-label strong, .text-button, .footer-wordmark, .workspace-section figcaption strong
) { color: var(--ink); }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) :is(
  .brand-divider, .site-header nav, .eyebrow, h1 span, .lede, .section-title > p,
  .product-entry p, .horizon-list p, .feature-line, .release-section p:not(.eyebrow),
  .cross-link, .site-footer p, .site-footer nav, .workspace-section figcaption,
  .legal-page p, .cli-start > p:not(.eyebrow), .doc-content p, .doc-content li,
  .doc-content td, .docs-page > p, .cli-section-nav, .review-lede, .icon-family-grid p,
  .icon-family-note, .about-caption, .about-section > p:nth-child(2) > span
) { color: var(--muted); }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) :is(
  .quiet-note, .section-rule, .status, .star-label small, .map-caption, .map-index,
  .product-bottom > span, .footer-note, .motion-control, .terminal-top, .terminal-bottom,
  .terminal-body .comment
) { color: var(--quiet); }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) :is(
  .site-header, .product-entry, .horizon-list article, .section-rule, .site-footer,
  .workspace-section figure, .release-section, .about-section, .terminal, .terminal-top,
  .terminal-bottom, .cli-section-nav, .doc-content th, .doc-content td, .icon-family-grid figure,
  .icon-sizes
) { border-color: var(--line); }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) :is(
  .terminal, .workspace-section figure, .icon-family-grid figure
) { background: var(--surface); box-shadow: 0 16px 45px #18395b0c; }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) .status { border-color: var(--line); background: var(--surface); }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) .button.primary:not(.sa-primary) { background: #dce8f7; color: #18324f; }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) .button.primary:not(.sa-primary):hover { background: #cddff4; }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) .button.secondary { color: var(--ink); border-color: #a7b9cf; }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) .product-entry code { color: #365574; }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) .orbit-lines { stroke: #7b8fa8; }
:root[data-theme="light"][data-site="hub"] .constellation::before { background: none; }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) .dust { background: #35577d; }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) .legal-page p a { color: #2367bb; }
:root[data-theme="light"]:is([data-site="hub"], [data-site="cli"]) .legal-draft { color: #71501e; background: #fff4dd; border-color: #d8bc86; }
:root[data-theme="light"][data-site="cli"] :is(.doc-content a, .doc-nav, .cli-start a:not(.button), .cli-section-nav a:hover) { color: #865016; }
:root[data-theme="light"][data-site="cli"] :is(.cli-start pre, .doc-content pre) { background: #f0f3f8; border-color: var(--line); color: #684818; }
:root[data-theme="light"][data-site="cli"] .terminal-cursor { background: #9b621e; }
:root[data-theme="light"][data-site="cli"] .amber-button { background: #f1d4a4 !important; color: #4e3415; }

@media (max-width: 680px) {
  :root:is([data-site="hub"], [data-site="cli"]) .site-header { height: auto; min-height: 82px; flex-wrap: wrap; gap: 14px; padding-block: 18px; }
  :root:is([data-site="hub"], [data-site="cli"]) .site-header nav { gap: 18px; margin-left: auto; }
  :root[data-site="hub"] .site-header .brand small { font-size: 9px; letter-spacing: 1px; }
}
