@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  color-scheme: dark;
  --a: #cbff3f;
  --b: #38ffe2;
  --c: #ae50ff;
  --d: #ff43ad;
  --e: #ff833d;
  --ink: #09090d;
  --muted: #74757f;
  --stride: 0deg;
  --stride-opposite: 0deg;
}
:root[data-palette='electric'] {
  --a: #40eaff;
  --b: #4993ff;
  --c: #974bff;
  --d: #ff57ea;
  --e: #c5f6ff;
}
:root[data-palette='solar'] {
  --a: #fff069;
  --b: #ff9838;
  --c: #ff4949;
  --d: #ff51a6;
  --e: #ffdc7b;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: #eeeeef;
  font-family: 'DM Sans', Arial, sans-serif;
}
body {
  overflow: hidden;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--b);
  outline-offset: 6px;
}
button {
  touch-action: manipulation;
}
#playground {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  cursor: crosshair;
  background: radial-gradient(ellipse at 48% 40%, #15151d 0%, #0a0a0f 50%, #07070b 100%);
}
#trails {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
.ambient {
  position: absolute;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  opacity: 0.075;
  filter: blur(100px);
  transition: background 1.4s;
  pointer-events: none;
}
.ambient-one {
  left: -30%;
  top: 4%;
  background: var(--c);
}
.ambient-two {
  right: -24%;
  bottom: -28%;
  background: var(--a);
}
.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(#9992 1px, transparent 1px), linear-gradient(90deg, #9992 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.12;
  mask-image: radial-gradient(ellipse at 50% 44%, #000 0%, transparent 65%);
  transform: perspective(900px) rotateX(12deg) scale(1.1);
}
.orbit {
  position: absolute;
  left: 50%;
  top: 44%;
  border: 1px solid #77777716;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-16deg);
  pointer-events: none;
}
.orbit-one {
  width: min(85vw, 1100px);
  height: min(30vw, 380px);
}
.orbit-two {
  width: min(48vw, 660px);
  height: min(48vw, 660px);
}
.cross {
  position: absolute;
  color: #80818e66;
  font-family: 'Space Mono', monospace;
  font-size: 22px;
  font-weight: 400;
}
.cross-one {
  top: 29%;
  left: 10%;
}
.cross-two {
  right: 10%;
  top: 59%;
}
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 40px;
  z-index: 10;
  pointer-events: none;
}
.brand {
  color: #f0f0f2;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  font:
    700 12px 'Space Mono',
    monospace;
  letter-spacing: 1.8px;
  pointer-events: auto;
}
.brand-mark {
  font:
    bold 21px Arial,
    sans-serif;
  letter-spacing: -3px;
  color: var(--a);
  width: 36px;
  height: 36px;
  border: 1px solid #74757544;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 3px;
}
.brand-mark span {
  font-size: 12px;
  align-self: flex-end;
  margin-bottom: 8px;
  letter-spacing: 0;
}
.live-label {
  font:
    10px 'Space Mono',
    monospace;
  letter-spacing: 1.8px;
  color: #9a9aa5;
  display: flex;
  align-items: center;
  gap: 10px;
}
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--a);
  box-shadow: 0 0 10px var(--a);
}
.scene-heading {
  position: fixed;
  left: 50%;
  top: 23%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  pointer-events: none;
}
.index {
  color: var(--a);
  font:
    10px 'Space Mono',
    monospace;
}
.heading-line {
  width: 32px;
  height: 1px;
  background: #51515c;
}
h1 {
  font:
    10px 'Space Mono',
    monospace;
  letter-spacing: 2px;
  font-weight: 400;
  color: #aaaab7;
  margin: 0;
}
.side-note {
  position: fixed;
  left: 38px;
  top: 44%;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font:
    9px 'Space Mono',
    monospace;
  letter-spacing: 2.5px;
  color: #61616d;
  pointer-events: none;
}
#creature {
  position: absolute;
  left: 0;
  top: 0;
  width: 640px;
  height: 240px;
  transform-origin: 320px 120px;
  z-index: 4;
  will-change: transform;
  pointer-events: none;
}
.glyph {
  position: absolute;
  left: 0;
  top: 0;
  width: 120px;
  height: 170px;
  overflow: visible;
  transition:
    transform 1.45s cubic-bezier(0.68, 0, 0.2, 1),
    filter 1s;
  transform-origin: 60px 85px;
  fill: currentColor;
  stroke: #ffffff44;
  stroke-width: 0.6;
  shape-rendering: geometricPrecision;
  filter: drop-shadow(0 0 1px currentColor)
    drop-shadow(0 0 8px color-mix(in srgb, currentColor 35%, transparent));
}
.glyph:after {
  content: '';
}
.g0 {
  color: var(--a);
  transform: translate(4px, 25px);
}
.g1 {
  color: var(--b);
  transform: translate(132px, 25px);
}
.g2 {
  color: var(--c);
  transform: translate(260px, 25px);
}
.g3 {
  color: var(--d);
  transform: translate(388px, 25px);
}
.g4 {
  color: var(--e);
  transform: translate(516px, 25px);
}
.bug-details {
  position: absolute;
  width: 640px;
  height: 280px;
  left: 0;
  top: -18px;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.9s 0.2s;
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--b) 55%, transparent));
  stroke: var(--b);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.leg {
  stroke: url(#leg-color);
}
.shell {
  fill: #141d16;
  stroke: var(--a);
  stroke-width: 3;
  opacity: 0.75;
}
.spine {
  stroke: var(--c);
  stroke-width: 3;
}
.eye {
  fill: #fff;
  stroke: var(--b);
  stroke-width: 3;
  filter: drop-shadow(0 0 8px #fff);
}
.antenna {
  stroke: var(--a);
  stroke-width: 4;
}
.bug-aura {
  position: absolute;
  width: 280px;
  height: 240px;
  left: 180px;
  top: 0;
  border-radius: 50%;
  background: radial-gradient(
    ellipse,
    color-mix(in srgb, var(--a) 18%, transparent),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 1s;
}
.is-bug .bug-details,
.is-bug .bug-aura {
  opacity: 1;
}
.is-bug .g0 {
  transform: translate(166px, 20px) rotate(32deg) scale(0.82);
}
.is-bug .g1 {
  transform: translate(236px, 81px) rotate(-14deg) scale(0.65);
}
.is-bug .g2 {
  transform: translate(260px, -18px) rotate(180deg) scale(0.58);
}
.is-bug .g3 {
  transform: translate(289px, 81px) rotate(14deg) scale(0.65);
}
.is-bug .g4 {
  transform: translate(354px, 20px) rotate(-32deg) scale(0.82);
}
.intro {
  position: fixed;
  left: 20px;
  right: 20px;
  top: 66%;
  text-align: center;
  z-index: 8;
  pointer-events: none;
}
h2 {
  font-size: clamp(19px, 2vw, 26px);
  font-weight: 500;
  letter-spacing: -0.6px;
  margin: 0 0 12px;
}
h2 em {
  font-style: normal;
  color: #8b8b98;
}
.intro p {
  font-size: 12px;
  font-weight: 400;
  color: #737381;
  line-height: 1.7;
  margin: 0;
}
.bug-hint {
  display: none;
}
body[data-mode='bug'] .word-hint {
  display: none;
}
body[data-mode='bug'] .bug-hint {
  display: block;
}
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 28px auto 20px;
  pointer-events: auto;
  width: fit-content;
}
.controls button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  height: 47px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.25s,
    color 0.25s,
    transform 0.25s,
    border-color 0.25s;
}
.controls button:hover {
  transform: translateY(-2px);
}
.controls button:active {
  transform: translateY(0) scale(0.97);
}
.primary {
  background: var(--a);
  color: #10130a;
  border: 1px solid transparent;
  padding: 0 23px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 30px color-mix(in srgb, var(--a) 9%, transparent);
}
.primary:hover {
  background: #f0ffd5;
}
.controls svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
}
.secondary,
.summon {
  background: #17171fbb;
  border: 1px solid #35353f;
  color: #b6b6c0;
  font-size: 11px;
  font-weight: 500;
  padding: 0 16px;
  backdrop-filter: blur(10px);
}
.secondary:hover,
.summon:hover {
  background: #252530;
  border-color: #575763;
  color: #fff;
}
.summon {
  width: 47px;
  padding: 0;
  display: none !important;
}
body[data-mode='bug'] .summon {
  display: flex !important;
}
.color-wheel {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: conic-gradient(var(--a), var(--b), var(--c), var(--d), var(--e), var(--a));
  box-shadow: 0 0 6px #ffffff22;
}
.state-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: #61616f;
  font:
    9px 'Space Mono',
    monospace;
  letter-spacing: 1px;
}
.state-dot {
  width: 3px;
  height: 3px;
  background: var(--a);
  border-radius: 50%;
}
.footer {
  position: fixed;
  bottom: 27px;
  left: 40px;
  right: 40px;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #565661;
  font:
    9px 'Space Mono',
    monospace;
  letter-spacing: 1.2px;
  pointer-events: none;
}
.formula {
  color: #898994;
  letter-spacing: 2px;
}
.formula-arrow {
  color: var(--a);
  margin-left: 14px;
}
.footer-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 8px;
  letter-spacing: 1.8px;
}
.coordinates {
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-square {
  width: 5px;
  height: 5px;
  border: 1px solid var(--a);
  margin-left: 8px;
}
#palette-name {
  color: var(--a);
}
.no-js {
  position: fixed;
  bottom: 110px;
  left: 20px;
  right: 20px;
  text-align: center;
  z-index: 20;
  background: #161621;
  padding: 12px;
  color: var(--a);
  font-size: 12px;
}
body.motion-paused .leg {
  transition: none;
}
@media (min-width: 1600px) {
  .scene-heading {
    top: 25%;
  }
  .intro {
    top: 65%;
  }
}
@media (max-height: 680px) and (min-width: 700px) {
  .topbar {
    padding: 20px 32px;
  }
  .scene-heading {
    top: 20%;
  }
  .intro {
    top: 65%;
  }
  .controls {
    margin: 16px auto 12px;
  }
  .footer {
    bottom: 17px;
  }
  .intro h2 {
    font-size: 20px;
  }
  .intro p {
    font-size: 11px;
  }
}
@media (max-width: 700px) {
  .topbar {
    padding: 23px 22px;
  }
  .brand {
    gap: 10px;
    font-size: 10px;
    letter-spacing: 1.4px;
  }
  .brand-mark {
    width: 31px;
    height: 31px;
    font-size: 19px;
  }
  .brand-mark span {
    margin-bottom: 6px;
  }
  .live-label {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .scene-heading {
    top: 24%;
    gap: 9px;
  }
  h1 {
    font-size: 8px;
    letter-spacing: 1.35px;
  }
  .index {
    font-size: 8px;
  }
  .heading-line {
    width: 20px;
  }
  .side-note {
    display: none;
  }
  .cross-one {
    left: 7%;
    top: 33%;
  }
  .cross-two {
    right: 7%;
    top: 55%;
  }
  .orbit-one {
    width: 125vw;
    height: 45vw;
  }
  .orbit-two {
    width: 90vw;
    height: 90vw;
  }
  .intro {
    top: 61%;
    left: 20px;
    right: 20px;
  }
  h2 {
    font-size: 19px;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
  }
  .intro p {
    font-size: 11px;
    max-width: 290px;
    margin: 0 auto;
  }
  .controls {
    flex-wrap: wrap;
    max-width: 340px;
    gap: 8px;
    margin: 24px auto 17px;
  }
  .controls button {
    height: 44px;
  }
  .primary {
    flex-basis: 100%;
    max-width: 226px;
    margin: 0 calc((100% - 226px) / 2) 3px;
    padding: 0 23px;
  }
  .secondary {
    font-size: 10px;
    padding: 0 13px;
  }
  .summon {
    width: 40px;
  }
  .footer {
    left: 22px;
    right: 22px;
    bottom: 21px;
    font-size: 8px;
  }
  .footer-center {
    display: none;
  }
  .formula {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .formula-arrow {
    margin-left: 5px;
  }
  .palette-name {
    display: none;
  }
  .ambient {
    filter: blur(65px);
    width: 100vw;
    height: 100vw;
  }
  .grid {
    background-size: 56px 56px;
  }
  .state-line {
    font-size: 8px;
    letter-spacing: 0.6px;
  }
}
@media (max-width: 700px) {
  .controls {
    width: min(100%, 340px);
  }
}
@media (max-width: 380px) {
  .live-label {
    letter-spacing: 0.4px;
    font-size: 7px;
  }
  .intro {
    top: 59%;
  }
  h2 {
    font-size: 17px;
  }
  .scene-heading {
    gap: 6px;
  }
  h1 {
    font-size: 7px;
  }
  .controls {
    margin-top: 20px;
  }
  .footer {
    bottom: 13px;
  }
}
body.motion-paused .glyph,
body.motion-paused .bug-details,
body.motion-paused .bug-aura {
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .glyph,
  .bug-details,
  .bug-aura,
  .controls button,
  .ambient {
    transition: none;
  }
  .controls button:hover {
    transform: none;
  }
  .leg {
    transition: none;
  }
}

.brain-status {
  border-left: 1px solid #45454e;
  padding-left: 8px;
  color: #898993;
  font-size: 8px;
}
.brain-status[data-live='true'] {
  color: var(--a);
}
body[data-mode='word'] .brain-status {
  display: none;
}
@media (max-height: 480px) and (min-width: 700px) {
  .intro {
    top: auto;
    bottom: 48px;
  }
  .intro h2 {
    font-size: 17px;
    margin-bottom: 4px;
  }
  .intro p {
    display: none !important;
  }
  .controls {
    margin: 12px auto 8px;
  }
  .controls button {
    height: 38px;
  }
  .scene-heading {
    top: 25%;
  }
  .topbar {
    padding: 15px 24px;
  }
}

.instinct-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  font:
    8px 'Space Mono',
    monospace;
  letter-spacing: 0.6px;
  color: #93939c;
}
.sense {
  display: flex;
  align-items: center;
  gap: 5px;
}
.sense-track {
  width: 34px;
  height: 2px;
  background: #3d3d48;
}
.sense-track > span {
  display: block;
  height: 100%;
  background: var(--a);
  transition: width 0.7s linear;
}
.memory-value {
  color: var(--b);
}
body[data-mode='word'] .instinct-line {
  display: none;
}
@media (max-width: 700px) {
  .instinct-line {
    gap: 11px;
    font-size: 7px;
    letter-spacing: 0.35px;
  }
  .sense-track {
    width: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sense-track > span {
    transition: none;
  }
}
