:root {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f9f7;
  --panel: #ffffff;
  --line: #d8e1da;
  --text: #101612;
  --muted: #5f6c64;
  --accent: #087d35;
  --accent2: #075f2c;
  --shadow: 0 24px 70px rgba(18, 35, 24, 0.1);
}

body,
.site-header,
.tool-shell,
.live-rail,
.explorer-panel,
.content-box {
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  width: min(1240px, calc(100% - 40px));
  max-width: 1240px;
  padding-inline: 2px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  flex: 0 0 auto;
  font-size: 18px;
  letter-spacing: 0.14em;
}

.site-header nav {
  align-items: center;
  gap: 15px;
}

.site-header nav a {
  position: relative;
  padding-block: 8px;
  white-space: nowrap;
}

.site-header nav a[aria-current="page"] {
  color: var(--text);
}

.site-header nav a[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  height: 1px;
  background: var(--accent);
  content: "";
}

.theme-toggle,
.nav-toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.theme-toggle {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  white-space: nowrap;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.language-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.language-label {
  color: var(--muted);
  font: 800 9px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.language-switcher select {
  width: 108px;
  max-width: 108px;
  min-height: 36px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font:
    800 10px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  cursor: pointer;
}

.language-switcher select:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 10px;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  margin: 5px 0;
  background: currentColor;
  transition:
    transform 140ms ease,
    opacity 140ms ease;
}

.site-header.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-header.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.status-label {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font:
    800 10px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-label.available {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  color: var(--accent);
}

.status-label.experimental {
  border-color: #866330;
  color: #d6a877;
}

html[data-theme="light"] .status-label.experimental {
  color: #785015;
}

.status-label.research {
  border-color: #4e6681;
  color: #9fc6f2;
}

html[data-theme="light"] .status-label.research {
  color: #315f8c;
}

.status-label.roadmap {
  border-style: dashed;
}

.status-index {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 26px 0 64px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.status-index a,
.status-index div {
  min-width: 0;
  padding: 20px 18px;
  color: var(--text);
  text-decoration: none;
}

.status-index > * + * {
  border-left: 1px solid var(--line);
}

.status-index strong,
.status-index small {
  display: block;
}

.status-index strong {
  margin-top: 12px;
  font-size: 14px;
}

.status-index small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.status-index a:hover strong {
  color: var(--accent);
}

.hero-bg-image,
.hero-bg-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-bg-image {
  z-index: -3;
  display: block;
  object-fit: cover;
  object-position: center;
}

.hero-bg-shade {
  z-index: -2;
  background:
    linear-gradient(
      90deg,
      rgba(5, 7, 6, 0.84) 0%,
      rgba(5, 7, 6, 0.67) 39%,
      rgba(5, 7, 6, 0.18) 72%,
      rgba(5, 7, 6, 0.3) 100%
    ),
    linear-gradient(180deg, rgba(5, 7, 6, 0.05) 50%, var(--bg) 100%);
  pointer-events: none;
}

.hero .nasa-credit {
  position: absolute;
  z-index: 3;
  right: 22px;
  bottom: 20px;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  text-decoration: none;
  backdrop-filter: blur(8px);
}

.hero .nasa-credit:hover {
  color: #fff;
}

html[data-theme="light"] body {
  background: var(--bg);
}

html[data-theme="light"] .hero-bg-shade {
  background:
    linear-gradient(
      90deg,
      rgba(247, 249, 247, 0.8) 0%,
      rgba(247, 249, 247, 0.56) 43%,
      rgba(247, 249, 247, 0.07) 74%,
      rgba(247, 249, 247, 0.2) 100%
    ),
    linear-gradient(180deg, rgba(247, 249, 247, 0.02) 48%, var(--bg) 100%) !important;
}

html[data-theme="light"] .hero p,
html[data-theme="light"] .hero-credit {
  color: #334139;
}

html[data-theme="light"] .chips span,
html[data-theme="light"] .secondary,
html[data-theme="light"] .secondary-link,
html[data-theme="light"] .social-btn,
html[data-theme="light"] .network-tab,
html[data-theme="light"] .desert-callout,
html[data-theme="light"] .origins,
html[data-theme="light"] .developers,
html[data-theme="light"] .community,
html[data-theme="light"] .curve-card,
html[data-theme="light"] .tool-shell,
html[data-theme="light"] .live-rail,
html[data-theme="light"] .output-block,
html[data-theme="light"] .pipeline article,
html[data-theme="light"] .comparison-grid article,
html[data-theme="light"] .recovery-grid article,
html[data-theme="light"] .reference-grid a,
html[data-theme="light"] .explorer-panel,
html[data-theme="light"] .research-grid article,
html[data-theme="light"] .publication-feature,
html[data-theme="light"] .publication-list article,
html[data-theme="light"] .content-box {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

html[data-theme="light"] .desert-callout,
html[data-theme="light"] .origins,
html[data-theme="light"] .developers,
html[data-theme="light"] .community,
html[data-theme="light"] .curve-card {
  background-image: none;
}

html[data-theme="light"] .warning {
  border-color: #d6b690;
  background: #fff7ef;
  color: #735f4b;
}

html[data-theme="light"] .warning strong {
  color: #75491f;
}

html[data-theme="light"] .form-grid label,
html[data-theme="light"] .wide-label,
html[data-theme="light"] .output-block pre,
html[data-theme="light"] .pipeline code {
  color: var(--text);
}

html[data-theme="light"] .address-card {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line)) !important;
  background: #eef7f0 !important;
}

html[data-theme="light"] .tabs,
html[data-theme="light"] .engine-note,
html[data-theme="light"] .registry-note,
html[data-theme="light"] .explorer-notice,
html[data-theme="light"] .callout {
  background: #eef5f0;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

html[data-theme="light"] .terminal-window,
html[data-theme="light"] .term,
html[data-theme="light"] .flow {
  border-color: #294235;
  background: #111713;
  color: #dcffe6;
}

html[data-theme="light"] .nasa-credit {
  color: rgba(255, 255, 255, 0.82);
}

.footer-brand {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.footer-sovereignty {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  text-align: center;
}

.footer-sovereignty strong {
  color: var(--text);
  font-size: 13px;
}

.footer-sovereignty span {
  color: var(--accent);
  font-size: 11px;
}

.footer-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: right;
}

@media (max-width: 920px) {
  .site-header {
    height: 68px;
    width: min(100% - 24px, 1240px);
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .site-header nav {
    display: none;
    position: absolute;
    z-index: 300;
    top: 61px;
    right: 0;
    left: 0;
    max-height: calc(100vh - 78px);
    padding: 8px;
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
  }

  .site-header.nav-open nav {
    display: flex;
  }

  .site-header nav a {
    display: block !important;
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
  }

  .site-header nav a[aria-current="page"]::after {
    display: none;
  }

  .site-header nav a[aria-current="page"] {
    color: var(--accent);
  }

  .site-header .theme-toggle {
    width: calc(100% - 12px);
    margin: 9px 6px 5px;
  }

  .language-switcher {
    width: 100%;
    margin: 7px 0 0;
    padding: 0;
    border: 0;
  }

  .language-label {
    min-width: 70px;
  }

  .language-switcher select {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 760px) {
  .hero .nasa-credit {
    right: auto;
    bottom: 18px;
    left: 20px;
  }

  .status-index {
    grid-template-columns: 1fr 1fr;
  }

  .footer-sovereignty,
  .footer-meta {
    text-align: left;
  }

  .status-index > * + * {
    border-left: 0;
  }

  .status-index > :nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .status-index > :nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 480px) {
  .status-index {
    grid-template-columns: 1fr;
  }

  .status-index > :nth-child(even) {
    border-left: 0;
  }

  .status-index > * + * {
    border-top: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
