@import url("/fonts/option-a/fonts.css");
@import url("/fonts/source-han-serif-sc/fonts.css");

:root {
  color-scheme: light;
  --experience-surface: #ffffff;
  --experience-surface-alt: #fafaf9;
  --experience-panel: rgba(255, 255, 255, 0.9);
  --experience-panel-strong: rgba(250, 250, 249, 0.96);
  --experience-ink: #292825;
  --experience-text: #4a4842;
  --experience-muted: #6a6861;
  --experience-subtle: #92908a;
  --experience-line: #e7e5e4;
  --experience-line-strong: #d6d3d1;
  --experience-accent: #ea580c;
  --experience-accent-soft: rgba(234, 88, 12, 0.09);
  --experience-shadow: 0 18px 52px rgba(41, 37, 36, 0.1);
  --ink: var(--experience-ink);
  --text: var(--experience-ink);
  --muted: var(--experience-muted);
  --line: var(--experience-line);
  --border: var(--experience-line);
  --panel-border: var(--experience-line);
  --panel: var(--experience-panel);
  --panel-strong: var(--experience-panel-strong);
  --glass: var(--experience-panel);
  --glass-strong: var(--experience-panel-strong);
  --accent: var(--experience-accent);
  --accent-soft: var(--experience-accent-soft);
  --shadow: var(--experience-shadow);
  font-family: "IBM Plex Serif", serif;
}

html.dark {
  color-scheme: dark;
  --experience-surface: #0c0a09;
  --experience-surface-alt: #1c1917;
  --experience-panel: rgba(28, 25, 23, 0.9);
  --experience-panel-strong: rgba(28, 25, 23, 0.97);
  --experience-ink: #f2efe8;
  --experience-text: #d6d3d1;
  --experience-muted: #a8a29e;
  --experience-subtle: #78716c;
  --experience-line: #292524;
  --experience-line-strong: #44403c;
  --experience-accent: #fb923c;
  --experience-accent-soft: rgba(251, 146, 60, 0.12);
  --experience-shadow: 0 20px 58px rgba(0, 0, 0, 0.28);
}

html[lang^="zh"],
html[lang^="zh"] body,
html[lang^="zh"] button,
html[lang^="zh"] input,
html[lang^="zh"] select {
  font-family: "Source Han Serif SC", serif;
  font-synthesis: none;
}

body {
  color: var(--experience-ink);
  background: var(--experience-surface);
  transition: color 180ms ease, background-color 180ms ease;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--experience-accent);
  outline-offset: 3px;
}

.experience-theme-toggle {
  flex: 0 0 auto;
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  padding: 0;
  border: 1px solid var(--experience-line);
  border-radius: 4px;
  background: var(--experience-panel-strong);
  color: var(--experience-muted);
  box-shadow: none;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.experience-theme-toggle:hover {
  border-color: var(--experience-accent);
  color: var(--experience-accent);
  background: var(--experience-accent-soft);
}

.theme-icon {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.theme-icon--sun,
html.dark .theme-icon--moon {
  display: none;
}

html.dark .theme-icon--sun {
  display: block;
}

/* Keep the scientific scene immersive while bringing its interface into the
   same editorial system as the rest of the site. */
.experience-nav {
  color: var(--experience-muted);
}

.experience-nav a {
  color: var(--experience-text);
}

.experience-nav a:hover,
.experience-nav a:focus-visible {
  color: var(--experience-accent);
}

.experience-nav span {
  color: var(--experience-subtle);
}

.experience-nav .experience-theme-toggle {
  margin-inline-start: auto;
}

.experience-stage:not(.experience-stage--three-body):not(.experience-stage--solar) #app {
  background:
    linear-gradient(140deg, rgba(250, 250, 249, 0.78), rgba(245, 245, 244, 0.58)),
    var(--experience-surface) !important;
}

html.dark .experience-stage:not(.experience-stage--three-body):not(.experience-stage--solar) #app {
  background:
    linear-gradient(140deg, rgba(28, 25, 23, 0.82), rgba(12, 10, 9, 0.94)),
    var(--experience-surface) !important;
}

.glass-panel,
.glass,
.control-panel,
.telemetry,
.hint-bar {
  border-color: var(--experience-line) !important;
  border-radius: 4px !important;
  background: var(--experience-panel) !important;
  color: var(--experience-ink);
  box-shadow: var(--experience-shadow) !important;
  backdrop-filter: blur(18px) saturate(110%);
  -webkit-backdrop-filter: blur(18px) saturate(110%);
}

.eyebrow,
.kicker,
.panel-kicker,
.telemetry-head span {
  color: var(--experience-accent) !important;
}

.hero-copy h1,
.hero-panel h1,
.hero h1,
.control-panel h2,
.controls__heading strong,
.info-panel h2 {
  color: var(--experience-ink);
}

.lede,
.subtitle,
.hero p,
.source-credit,
.preset-description,
.hint,
.interaction-hint {
  color: var(--experience-muted) !important;
}

.experience-stage--three-body .hero h1,
.experience-stage--solar .hero-copy h1 {
  color: #f5f5f4;
}

.experience-stage--three-body .hero > p,
.experience-stage--solar .source-credit {
  color: rgba(245, 245, 244, 0.68) !important;
}

.experience-stage--three-body .experience-nav,
.experience-stage--solar .experience-nav {
  width: fit-content;
  padding: 0.3rem;
  border: 1px solid var(--experience-line);
  border-radius: 4px;
  background: var(--experience-panel);
  box-shadow: var(--experience-shadow);
}

.experience-stage--three-body .experience-nav a,
.experience-stage--solar .experience-nav a {
  padding-inline: 0.35rem;
}

.experience-stage--three-body .experience-nav span,
.experience-stage--solar .experience-nav span {
  color: var(--experience-muted);
}

.icon-button,
.control-button,
.stage-button,
.preset,
.secondary-action,
.button-grid button,
.path-action,
.planet-chip,
.scene-toolbar button {
  border-color: var(--experience-line) !important;
  background: var(--experience-surface-alt) !important;
  color: var(--experience-text) !important;
}

.icon-button:hover,
.control-button:hover,
.stage-button:hover,
.preset:hover,
.secondary-action:hover,
.button-grid button:hover,
.path-action:hover,
.planet-chip:hover,
.scene-toolbar button:hover {
  border-color: var(--experience-accent) !important;
  background: var(--experience-accent-soft) !important;
  color: var(--experience-accent) !important;
}

.control-button.is-active,
.stage-button.is-active,
.preset.active,
.button-grid button[aria-pressed="true"],
.scene-toolbar button.is-active {
  border-color: color-mix(in srgb, var(--experience-accent) 52%, var(--experience-line)) !important;
  background: var(--experience-accent-soft) !important;
  color: var(--experience-accent) !important;
}

input[type="range"] {
  accent-color: var(--experience-accent);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
