@font-face {
  font-family: Antonio;
  src: url('fonts/Antonio.ttf') format('truetype');
  font-weight: 100 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ground: #000;
  --structure: #ff9966;
  --control: #cc99cc;
  --data: #99ccff;
  --text: #ede7db;
  --brightness: 0.85;
  --motion-speed: 1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font:
    14px/1.5 system-ui,
    sans-serif;
  overflow: hidden;
}
::selection {
  background: var(--control);
  color: var(--ground);
}
#display {
  width: 100vw;
  height: 100svh;
  display: grid;
  place-items: center;
  padding: 1.5vw;
  filter: brightness(var(--brightness));
}
#display svg {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100svh;
}
.enter .scene-frame {
  animation: assemble-frame 850ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.enter .scene-panel {
  animation: reveal-data 650ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--order) * 130ms + 180ms);
}
.arc-sweep {
  transform-origin: 0 0;
  transform: rotate(-12deg);
  animation: arc-scan calc(8s * var(--motion-speed)) ease-in-out infinite alternate;
}
.sensor-sweep {
  animation: sensor-scan calc(4200ms * var(--motion-speed)) linear infinite alternate;
}
.spectrum-bar {
  animation: spectrum calc(2300ms * var(--motion-speed)) ease-in-out infinite alternate;
  animation-delay: var(--phase);
}
.core-cell {
  animation: energy calc(2800ms * var(--motion-speed)) ease-in-out infinite alternate;
  animation-delay: var(--phase);
}
.signal-trace {
  stroke-dasharray: 120 5;
  animation: flow calc(12s * var(--motion-speed)) linear infinite;
  animation-delay: var(--phase);
}
.network-flow {
  stroke-dasharray: 12 8;
  animation: flow calc(16s * var(--motion-speed)) linear infinite;
}
body.calm {
  --motion-speed: 3;
}
body.motion-still #display *,
body.reduced-motion #display * {
  animation: none !important;
}
body.paused #display *,
body.suspended #display * {
  animation-play-state: paused !important;
}
@keyframes assemble-frame {
  from {
    clip-path: inset(0 96% 0 0);
  }
  to {
    clip-path: inset(0);
  }
}
@keyframes reveal-data {
  from {
    opacity: 0.2;
    clip-path: inset(0 0 90% 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0);
  }
}
@keyframes arc-scan {
  from {
    transform: rotate(-78deg);
  }
  to {
    transform: rotate(68deg);
  }
}
@keyframes spectrum {
  from {
    transform: scaleY(0.72);
  }
  to {
    transform: scaleY(1);
  }
}
@keyframes sensor-scan {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(var(--scan-distance));
  }
}
@keyframes energy {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 1;
  }
}
@keyframes flow {
  to {
    stroke-dashoffset: -260;
  }
}
#loading {
  padding: 24px;
  color: var(--structure);
}
#dock {
  position: fixed;
  z-index: 1;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, calc(100% - 32px));
  background: var(--ground);
  border: 2px solid var(--control);
  border-radius: 30px 12px 30px 12px;
  padding: 18px 24px;
  max-height: calc(100svh - 104px);
  overflow-y: auto;
  scrollbar-color: var(--control) var(--ground);
  transition: opacity 200ms ease;
}
body.controls-hidden #dock {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#controls-toggle {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  min-height: 52px;
  padding: 0;
  border: 2px solid var(--control);
  border-radius: 50%;
  background: var(--ground);
  color: var(--control);
}
#controls-toggle svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}
#controls-toggle[aria-expanded='true'] {
  background: var(--control);
  color: var(--ground);
}
#controls-toggle:hover,
#controls-minimize:hover {
  background: #ffcc66;
  color: var(--ground);
}
#controls-toggle:focus-visible {
  outline-color: #ffff99;
  outline-offset: 4px;
}
.dock-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}
#controls-minimize {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid var(--control);
  border-radius: 50%;
  background: var(--ground);
  color: var(--control);
}
#controls-minimize svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
#controls-minimize:focus-visible {
  outline-color: #ffff99;
  outline-offset: 4px;
}
.dock-heading,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
h1 {
  margin: 0;
  font:
    500 28px/1 Antonio,
    sans-serif;
  color: var(--structure);
}
h1 span {
  margin-left: 9px;
  font-size: 18px;
  color: var(--control);
}
a {
  color: var(--data);
  text-underline-offset: 5px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 12px 0 18px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--data);
  font-size: 12px;
}
.feed-setting {
  grid-column: span 2;
}
.feed-note {
  font-size: 11px;
  color: var(--data);
  margin: -5px 0 14px;
  max-width: 75ch;
}
select {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--control);
  background: var(--ground);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  border-radius: 4px;
}
input {
  min-width: 0;
  min-height: 44px;
  accent-color: var(--control);
}
.bank {
  display: flex;
  gap: 3px;
}
button {
  border: 0;
  min-height: 44px;
  padding: 8px 22px;
  font:
    500 18px/1 Antonio,
    sans-serif;
  text-transform: uppercase;
  background: var(--control);
  color: var(--ground);
  cursor: pointer;
  white-space: nowrap;
}
button:first-child {
  border-radius: 24px 0 0 24px;
  background: var(--structure);
}
button:last-child {
  border-radius: 0 24px 24px 0;
}
button:hover {
  background: #ffcc66;
}
:focus-visible {
  outline: 2px solid #ffff99;
  outline-offset: 4px;
}
button:focus-visible {
  outline-color: var(--ground);
  outline-offset: -5px;
}
#display:focus {
  outline: none;
}
.keys,
#status {
  font-size: 11px;
  color: var(--data);
}
#status {
  margin: 10px 0 0;
}
body.native #dock,
body.native #controls-toggle {
  display: none;
}
body.native {
  cursor: none;
}
@media (max-width: 650px) {
  #dock {
    padding: 14px 16px;
    bottom: 80px;
    max-height: calc(100svh - 96px);
  }
  .dock-heading {
    align-items: flex-start;
    gap: 12px;
  }
  .dock-tools {
    gap: 10px;
  }
  .dock-heading h1 span {
    display: block;
    margin: 6px 0 0;
    font-size: 16px;
  }
  .settings {
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    margin-top: 4px;
  }
  .keys {
    display: none;
  }
  .actions,
  .bank {
    width: 100%;
  }
  button {
    flex: 1;
    padding: 8px 12px;
    font-size: 16px;
  }
  #display {
    padding: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  #display * {
    animation: none !important;
  }
  #dock {
    transition: none;
  }
}
