.abstract-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  color: #cab1ff;
  opacity: .30;
}
.abstract-field pre {
  position: absolute;
  margin: 0;
  font: 500 clamp(8px, 1.05vw, 16px)/1.12 'IBM Plex Mono', monospace;
  white-space: pre;
}
.abstract-field .rings { left: 7%; top: 21%; transform: rotate(-10deg); }
.abstract-field .ribbon { right: 10%; top: 18%; transform: rotate(9deg); }
.abstract-field .shards { right: 12%; bottom: 14%; }
.abstract-field .disc { left: 15%; bottom: 16%; }
.shell { position: relative; z-index: 1; }
.ascii-galaxy { opacity: .54; }
.ascii-waves, .ascii-depth { opacity: .52; }

.theme-toggle {
  --switch-surface: #110b1b;
  --switch-line: #8462aa;
  --switch-muted: #c4b1da;
  --switch-active: #d4ff76;
  --switch-ink: #1c260d;
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  width: 62px;
  min-height: 30px;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--switch-line);
  border-radius: 999px;
  background: var(--switch-surface);
  color: var(--switch-muted);
  box-shadow: inset 0 0 8px #af7cff19, 0 0 11px #af7cff1a;
  font: 600 15px/1 'DM Mono', monospace;
  vertical-align: top;
}
.theme-toggle:hover { border-color: var(--switch-active); }
.theme-toggle-part {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
}
.theme-toggle[aria-pressed="false"] .theme-dark,
.theme-toggle[aria-pressed="true"] .theme-light {
  background: var(--switch-active);
  color: var(--switch-ink);
  box-shadow: 0 0 7px color-mix(in srgb, var(--switch-active) 45%, transparent);
}
.theme-toggle-icon { width: 13px; height: 13px; }
.theme-toggle:hover .theme-toggle-part { outline: 1px solid var(--switch-line); }

html[data-theme-transition]::view-transition,
html[data-theme-transition]::view-transition-group(root) { pointer-events: none; }
html[data-theme-transition]::view-transition-old(root),
html[data-theme-transition]::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
html[data-theme-transition]::view-transition-old(root) { z-index: 1; }
html[data-theme-transition]::view-transition-new(root) { z-index: 2; }

html[data-theme="light"] {
  color-scheme: light;
  --light-ink: #21182a;
  --light-muted: #554562;
  --light-accent: #56338b;
}
html[data-theme="light"] body,
html[data-theme="light"] .ether {
  background: radial-gradient(ellipse at 50% 52%, #e6d9f4, #f2eef8 72%);
  color: var(--light-ink);
}
html[data-theme="light"] .brand {
  background: none;
  color: var(--light-ink);
  -webkit-text-fill-color: var(--light-ink);
  filter: none;
}
html[data-theme="light"] .brand span { -webkit-text-fill-color: var(--light-accent); }
html[data-theme="light"] .abstract-field { color: #4c2a7c; opacity: .43; }
html[data-theme="light"] .ascii-galaxy,
html[data-theme="light"] .ascii-waves,
html[data-theme="light"] .ascii-depth {
  opacity: .55;
  filter: brightness(.62) saturate(.72);
}
html[data-theme="light"] .background-spine { border-color: #66469050; }
html[data-theme="light"] .theme-toggle {
  --switch-surface: #faf6ff;
  --switch-line: #9073b1;
  --switch-muted: #533a70;
  --switch-active: #56338b;
  --switch-ink: #fff;
}
html[data-theme="light"] :is(.header > p, .telemetry, .side-note, .system-label, .system-label span, .footer-line, #current-label, #counter, #counter i, .motion-status, .entry-loader) { color: var(--light-muted); }
html[data-theme="light"] :is(.telemetry b, .footer-line button) { color: var(--light-accent); }
html[data-theme="light"] :is(.header nav a, .chamber-controls button, .close-dialog) {
  background: #fcf9ff;
  color: var(--light-ink);
  border-color: #674992;
}
html[data-theme="light"] :is(.header nav a[aria-current], .chamber-controls button:hover) {
  color: #fff;
  background: var(--light-accent);
}
html[data-theme="light"] .panel:not(.image-card) .frame-surface { fill: #fffaff; }
html[data-theme="light"] .panel :is(.frame-track, .frame-light) { stroke: #674992; filter: none; }
html[data-theme="light"] .panel .frame-echo { stroke: #765625; }
html[data-theme="light"] .panel :is(h1,h2,p,small,strong) { color: var(--light-ink); }
html[data-theme="light"] .panel :is(h1 em,h2 em,.micro,.instrument-code) { color: var(--light-accent); text-shadow: none; }
html[data-theme="light"] .panel .tags span { color: var(--light-ink); background: #eee6f6; border-color: #735f8e; }
html[data-theme="light"] .panel .ink-button { color: #fff; background: var(--light-accent); border-color: var(--light-accent); }
html[data-theme="light"] .panel .signal-bars i { background: var(--light-accent); }
html[data-theme="light"] .panel.image-card .instrument-code { color: #f8efff; }
html[data-theme="light"] dialog { background: #fffaff; color: var(--light-ink); border-color: var(--light-accent); }
html[data-theme="light"] dialog .micro { color: var(--light-accent); }
html[data-theme="light"] dialog::backdrop { background: #e5dceddb; }
html[data-theme="light"] :is(a,button):focus-visible { outline-color: var(--light-accent); }

@media (max-width: 600px) {
  .abstract-field .rings { left: 4%; top: 24%; }
  .abstract-field .ribbon { right: 4%; top: 27%; }
  .abstract-field .disc { left: 8%; }
}

@media (max-height: 480px) {
  .header { flex-direction: column; gap: 5px; }
  .theme-toggle { min-height: 30px; padding: 2px; }
}
