:root[data-theme="light"] {
  color-scheme: light;
  --hairline: rgb(29 34 41 / 15%);
}

:root[data-theme="night"] {
  color-scheme: dark;
  --hairline: rgb(221 231 242 / 16%);
}

:root[data-theme="light"] body {
  --world-bg: #f1eee6;
  --world-bg-soft: #e7e3d9;
  --world-ink: #1c2229;
  --world-muted: rgb(28 34 41 / 68%);
  --world-faint: rgb(28 34 41 / 55%);
  --world-accent: #526b86;
  color: var(--world-ink);
  background: var(--world-bg);
}

:root[data-theme="night"] body {
  --world-bg: #111a27;
  --world-bg-soft: #172333;
  --world-ink: #edf1f4;
  --world-muted: rgb(226 234 241 / 74%);
  --world-faint: rgb(226 234 241 / 57%);
  --world-accent: #a9bfd7;
  color: var(--world-ink);
  background:
    radial-gradient(circle at 82% 7%, rgb(191 210 227 / 8%), transparent 21rem),
    linear-gradient(180deg, #152132, #111a27 42rem);
}

:root[data-theme] body[data-cinematic="true"] {
  --world-bg: #000;
  --world-bg-soft: #030306;
  --world-ink: #f2efe8;
  --world-muted: rgb(235 231 223 / 68%);
  --world-faint: rgb(235 231 223 / 52%);
  color: var(--world-ink);
  background: #000;
}

.theme-changing body,
.theme-changing .home-section,
.theme-changing .universe-shell,
.theme-changing .site-footer {
  transition: color 420ms ease, background-color 420ms ease, border-color 420ms ease;
}

:root[data-theme="light"] body.home-page {
  color: #20262d;
  background: #f1eee6;
}

:root[data-theme="light"] .home-section:not(.home-harbin) {
  color: #20262d;
  background: #f1eee6;
}

:root[data-theme="light"] .home-highlights,
:root[data-theme="light"] .home-works,
:root[data-theme="light"] .home-notes,
:root[data-theme="light"] .home-atlas,
:root[data-theme="light"] .home-closing {
  background: #eeebe3;
}

:root[data-theme="light"] .home-worlds {
  background: #e8e5dd;
}

:root[data-theme="light"] .home-kicker,
:root[data-theme="light"] .home-highlights .home-kicker,
:root[data-theme="light"] .home-works .home-kicker,
:root[data-theme="light"] .home-atlas .home-kicker,
:root[data-theme="light"] .home-copy,
:root[data-theme="light"] .home-highlights .home-copy,
:root[data-theme="light"] .home-works .home-copy,
:root[data-theme="light"] .home-atlas .home-copy,
:root[data-theme="light"] .home-note p,
:root[data-theme="light"] .home-note__type {
  color: rgb(32 38 45 / 58%);
}

:root[data-theme="light"] .home-worlds::before {
  background: linear-gradient(180deg, #eeebe3, transparent);
}

:root[data-theme="light"] .home-worlds::after {
  background: linear-gradient(0deg, #eeebe3, transparent);
}

:root[data-theme="light"] .worlds-field__arc,
:root[data-theme="light"] .world-orbit__trace {
  border-color: rgb(48 61 75 / 12%);
}

:root[data-theme="light"] .worlds-field__quiet {
  background: radial-gradient(ellipse at 50% 40%, #e8e5dd 0 30%, rgb(232 229 221 / 84%) 48%, transparent 76%);
}

:root[data-theme="light"] .world-orbit,
:root[data-theme="light"] .world-orbit__caption,
:root[data-theme="light"] .world-orbit__caption strong,
:root[data-theme="light"] .world-card {
  color: #20262d;
}

:root[data-theme="light"] .world-orbit {
  border-color: rgb(32 38 45 / 12%);
  background: rgb(255 255 255 / 16%);
}

:root[data-theme="light"] .world-orbit__caption,
:root[data-theme="light"] .world-card__meta,
:root[data-theme="light"] .world-card p {
  color: rgb(32 38 45 / 56%);
}

:root[data-theme="light"] .world-orbit__caption {
  border-color: rgb(32 38 45 / 14%);
}

:root[data-theme="light"] .world-card {
  border-color: rgb(32 38 45 / 11%);
  background: rgb(255 255 255 / 38%);
  box-shadow: inset 0 1px rgb(255 255 255 / 42%);
}

:root[data-theme="light"] .world-card:hover {
  border-color: rgb(32 38 45 / 20%);
  background: rgb(255 255 255 / 62%);
}

:root[data-theme="light"] .home-note-list,
:root[data-theme="light"] .home-note {
  border-color: rgb(32 38 45 / 12%);
}

:root[data-theme="light"] .highlight-count {
  color: rgb(32 38 45 / 58%);
}

:root[data-theme="light"] .home-footer,
:root[data-theme="light"] .closing-copy > p,
:root[data-theme="light"] .closing-links a {
  color: rgb(32 38 45 / 62%);
}

:root[data-theme="light"] .closing-links a:hover {
  color: #20262d;
}

:root[data-theme="light"] .home-footer {
  background: #e8e5dd;
}

:root[data-theme="night"] body.home-page {
  color: #eef2f5;
  background: #111a27;
}

:root[data-theme="night"] .home-highlights,
:root[data-theme="night"] .home-works,
:root[data-theme="night"] .home-notes,
:root[data-theme="night"] .home-atlas,
:root[data-theme="night"] .home-closing,
:root[data-theme="night"] .home-footer {
  background: #111a27;
}

:root[data-theme="night"] .home-worlds {
  background: #142031;
}

:root[data-theme="night"] .home-worlds::before {
  background: linear-gradient(180deg, #111a27, transparent);
}

:root[data-theme="night"] .home-worlds::after {
  background: linear-gradient(0deg, #111a27, transparent);
}

:root[data-theme="night"] .worlds-field__quiet {
  background: radial-gradient(ellipse at 50% 40%, #142031 0 30%, rgb(20 32 49 / 82%) 48%, transparent 76%);
}

:root[data-theme="night"] .world-card {
  background: rgb(27 41 58 / 84%);
}

:root[data-theme="light"] .black-hole-world {
  --bh-void: #f1eee6;
  --world-bg: #f1eee6;
  --world-bg-soft: #e7e3d9;
  --world-ink: #20242a;
  --world-muted: rgb(32 36 42 / 68%);
  --world-faint: rgb(32 36 42 / 55%);
  --world-accent: #8b643d;
  background: #f1eee6;
}

:root[data-theme="night"] .black-hole-world {
  --bh-void: #111923;
  --world-bg: #111923;
  --world-bg-soft: #182331;
  --world-ink: #f0eee9;
  --world-muted: rgb(240 238 233 / 72%);
  --world-faint: rgb(240 238 233 / 56%);
  background: #111923;
}

:root[data-theme="light"] .harbin-world {
  --world-bg: #eaf0f2;
  --world-bg-soft: #dde7eb;
  --world-ink: #1b2833;
  --world-muted: rgb(27 40 51 / 67%);
  --world-faint: rgb(27 40 51 / 54%);
  background: #eaf0f2;
}

:root[data-theme="night"] .harbin-world {
  --world-bg: #122131;
  --world-bg-soft: #192d42;
  --world-ink: #edf4f8;
  background: #122131;
}

:root[data-theme="light"] body[data-world="fate"] {
  --world-bg: #f3eddf;
  --world-bg-soft: #e9dfca;
  --world-ink: #29251f;
  --world-muted: rgb(41 37 31 / 68%);
  --world-faint: rgb(41 37 31 / 55%);
  background: #f3eddf;
}

:root[data-theme="night"] body[data-world="fate"] {
  --world-bg: #1c1a20;
  --world-bg-soft: #28242c;
  --world-ink: #f1e9dc;
  background: #1c1a20;
}

:root[data-theme="light"] body[data-world="lab"] .hud,
:root[data-theme="light"] body[data-world="lab"] .return-link,
:root[data-theme="light"] body:not([data-world]) .hud,
:root[data-theme="light"] body:not([data-world]) .top-left {
  text-shadow: 0 1px 20px rgb(255 255 255 / 72%);
}

:root[data-theme="light"] body[data-world="lab"] .site-theme-dock .site-theme-toggle,
:root[data-theme="light"] body:not([data-world]) .site-theme-dock .site-theme-toggle {
  color: #20262d;
  border-color: rgb(32 38 45 / 28%);
  background: rgb(244 241 233 / 88%);
  box-shadow: 0 0.8rem 2.5rem rgb(0 0 0 / 12%);
}

@media (prefers-reduced-motion: reduce) {
  .theme-changing body,
  .theme-changing .home-section,
  .theme-changing .universe-shell,
  .theme-changing .site-footer {
    transition: none;
  }
}
