* {
  box-sizing: border-box;
}
:root {
  color-scheme: dark;
  --tone: 199;
  --light: hsl(var(--tone) 100% 71%);
  --line: hsl(var(--tone) 65% 55%/0.23);
  --ink: #ecf7ff;
  --muted: #90a9bf;
  font:
    15px system-ui,
    sans-serif;
  background: #02050b;
  color: var(--ink);
}
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  background:
    radial-gradient(ellipse 63% 55% at 50% 32%, hsl(var(--tone) 95% 21%/0.38), transparent 84%),
    linear-gradient(#030812, #02050b);
}
body:before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse, #000, transparent 80%);
  opacity: 0.24;
}
button,
input,
select,
a {
  font: inherit;
  color: inherit;
}
button,
a {
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.2s;
}
button {
  border: 0;
  background: none;
  padding: 0 12px;
  min-height: 44px;
  color: var(--muted);
}
button:hover,
button[aria-pressed='true'],
a:hover {
  color: var(--light);
}
:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 3px;
}
header,
footer,
.row,
.controls,
.hint,
.time,
#search,
label,
strong {
  display: flex;
  align-items: center;
}
header,
footer {
  justify-content: space-between;
  width: 94%;
  max-width: 1650px;
  margin-inline: auto;
}
header {
  height: 74px;
  border-bottom: 1px solid var(--line);
}
strong {
  font:
    bold italic 21px Arial,
    sans-serif;
  letter-spacing: 2px;
  gap: 5px;
}
strong span,
#tracker,
#add,
#done,
#save {
  color: var(--light);
}
strong img {
  width: 34px;
  margin-right: 5px;
  filter: drop-shadow(0 0 9px var(--light));
}
svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
  vertical-align: middle;
}
#network,
footer,
h2,
#boot,
#date {
  font:
    11px ui-monospace,
    Consolas,
    monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}
#network {
  margin-right: 12px;
}
#network:before,
footer span:first-child:before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--light);
  box-shadow: 0 0 10px var(--light);
  margin-right: 9px;
  vertical-align: 2px;
}
#network.offline:before {
  background: #ffad64;
}
[aria-pressed='true'] .off,
[aria-pressed='false'] .on,
[hidden] {
  display: none !important;
}
main {
  margin: auto 0;
  position: relative;
  text-align: center;
  padding: 12px 0 24px;
}
#stage {
  position: relative;
  height: clamp(255px, 37svh, 520px);
  display: grid;
  place-items: center;
}
canvas {
  position: absolute;
  width: 100%;
  height: 140%;
  top: -20%;
  left: 0;
  pointer-events: none;
}
#replay {
  position: relative;
  height: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
}
#replay img {
  width: 68%;
  filter: drop-shadow(0 0 5px var(--light)) drop-shadow(0 0 17px var(--light));
}
#replay:hover {
  transform: scale(1.065);
}
#workspace {
  position: relative;
  width: min(92%, 910px);
  margin: auto;
}
.time {
  justify-content: center;
  position: relative;
  margin: 9px 0 4px;
  font:
    300 clamp(56px, 8svh, 94px) / 1.05 'Segoe UI',
    system-ui,
    sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.045em;
  text-shadow: 0 0 28px var(--line);
}
#seconds {
  position: absolute;
  left: calc(50% + 1.85em);
  font-size: inherit;
  color: var(--light);
  display: flex;
  align-items: center;
}
#seconds small {
  font: 0.23em monospace;
  letter-spacing: 0.05em;
}
#date {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--light);
}
#search {
  width: min(100%, 714px);
  margin: clamp(23px, 3.6svh, 50px) auto 0;
  padding: 6px 7px 6px 21px;
  gap: 16px;
  height: 61px;
  border: 1px solid hsl(var(--tone) 90% 55%/0.57);
  background: linear-gradient(
    105deg,
    hsl(var(--tone) 80% 14%/0.61),
    #08111f 65%,
    hsl(var(--tone) 82% 17%/0.56)
  );
  box-shadow:
    0 0 26px hsl(var(--tone) 95% 45%/0.12),
    inset 0 0 16px var(--line);
  border-radius: 14px;
  color: var(--light);
}
#search:focus-within {
  border-color: var(--light);
  box-shadow: 0 0 32px var(--line);
}
#q {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  height: 100%;
  font-size: 17px;
  color: var(--ink);
}
::placeholder {
  color: var(--muted);
  opacity: 1;
}
kbd {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
}
#search button,
#save {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--light);
  color: #031323;
  min-width: 52px;
}
#search button:hover,
#save:hover {
  background: white;
}
.hint {
  justify-content: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
}
#tracker {
  font: 13px monospace;
  padding: 0;
}
.dock {
  margin: clamp(8px, 2svh, 32px) auto 0;
}
.row {
  gap: 5px;
  font-size: 14px;
}
h2 {
  margin-right: auto;
  color: #c0d0de;
  font-weight: bold;
}
.dock h2:before {
  content: '';
  display: inline-block;
  width: 17px;
  height: 8px;
  background: repeating-linear-gradient(115deg, var(--light) 0 2px, transparent 2px 5px);
  margin-right: 9px;
}
#sites {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 11px;
  margin-top: 6px;
}
#sites > * {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  text-decoration: none;
  min-width: 0;
  height: 99px;
  background: linear-gradient(155deg, #0d1929bb, #07101c99);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  color: #cfdeec;
  font-size: 13px;
}
#sites > *:hover,
#sites > *:focus-visible {
  transform: translateY(-4px);
  border-color: var(--light);
  background: linear-gradient(var(--line), #07101c);
  color: white;
}
#sites b {
  color: var(--light);
  font: 600 20px monospace;
  text-shadow: 0 0 12px var(--light);
}
#sites svg {
  width: 27px;
  height: 27px;
  filter: drop-shadow(0 0 8px var(--line));
}
#sites span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#sites button:after {
  content: '✎';
  position: absolute;
  top: 5px;
  right: 8px;
}
footer {
  font-size: 10px;
  letter-spacing: 1.5px;
  min-height: 46px;
  border-top: 1px solid var(--line);
}
dialog {
  background: #08121f;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(94%, 440px);
  padding: 21px;
  max-height: 88svh;
}
dialog::backdrop {
  background: #01050ccc;
  backdrop-filter: blur(9px);
}
dialog h2 {
  font-size: 15px;
}
label {
  min-height: 54px;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
label input,
select {
  max-width: 58%;
  background: #101f32;
  border: 1px solid var(--line);
  padding: 9px;
  border-radius: 6px;
  font-size: 16px;
}
input[type='checkbox'] {
  accent-color: var(--light);
  width: 22px;
  height: 22px;
}
#editor label {
  flex-direction: column;
  align-items: stretch;
  padding: 16px 0;
}
#editor input {
  max-width: 100%;
}
#save {
  margin-left: auto;
}
#reset,
#remove,
#error {
  color: #ff9999;
}
p {
  color: var(--muted);
  font-size: 13px;
}
#notice:not(:empty) {
  position: fixed;
  bottom: 7%;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px;
  background: #132941;
  border-radius: 10px;
  z-index: 5;
}
#boot {
  position: fixed;
  inset: 64% 0 auto;
  display: grid;
  justify-items: center;
  gap: 15px;
}
#boot strong {
  font-size: 26px;
  letter-spacing: 8px;
  color: white;
}
progress {
  height: 4px;
  width: min(72vw, 340px);
  accent-color: var(--light);
}
.booting #stage {
  transform: translateY(calc(39svh - 50%));
}
.booting main {
  position: fixed;
  inset: 0;
}
.booting :is(header, #workspace, footer, #replay) {
  visibility: hidden;
}
.booting #replay {
  visibility: visible;
  animation: energize 1.8s both;
}
@keyframes energize {
  0%,
  20% {
    opacity: 0;
    transform: scale(0.45);
  }
  65% {
    opacity: 1;
    transform: scale(1.08);
  }
}
@keyframes unfold {
  from {
    opacity: 0;
    transform: translateY(19px);
    filter: blur(5px);
  }
}
.arrive :is(header, .time, #date, #search, .hint, .dock, footer) {
  animation: unfold 0.58s backwards;
}
.arrive #search {
  animation-delay: 0.09s;
}
.arrive .dock {
  animation-delay: 0.2s;
}
.arrive #stage {
  transition: transform 0.62s;
}
@media (max-width: 800px) {
  #sites {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  #sites > * {
    height: 80px;
    gap: 7px;
  }
  #stage {
    height: clamp(210px, 32svh, 360px);
  }
  header {
    height: 59px;
  }
  #network,
  footer {
    letter-spacing: 1px;
    font-size: 9px;
  }
  #network {
    margin-right: 0;
  }
  #search {
    gap: 9px;
    padding-left: 12px;
    height: 55px;
  }
  #q {
    font-size: 16px;
  }
  kbd {
    display: none;
  }
  #date {
    font-size: 10px;
    letter-spacing: 1.7px;
  }
  #seconds {
    left: calc(50% + 1.66em);
  }
  .time {
    font-size: 54px;
  }
  #sites > * {
    font-size: 12px;
  }
  .controls button {
    padding: 0 9px;
  }
  strong {
    font-size: 17px;
  }
  footer {
    min-height: 40px;
  }
  #boot {
    inset: 61% 0 auto;
  }
}
@media (max-width: 370px) {
  #network {
    display: none;
  }
  .time {
    font-size: 46px;
  }
  #sites {
    gap: 5px;
  }
  #search > svg {
    display: none;
  }
}
@media (max-height: 500px) {
  #stage {
    height: 160px;
  }
  #boot {
    inset: 60% 0 auto;
    gap: 6px;
  }
}
.static *,
.static *::before,
.static *::after {
  transition: none !important;
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
@media (max-height: 780px) and (min-width: 801px) {
  #stage {
    height: 32svh;
  }
  .dock {
    margin-top: 0;
  }
  #sites > * {
    height: 80px;
  }
  #search {
    margin-top: 18px;
  }
  header {
    height: 60px;
  }
}
@media (max-width: 410px) {
  #search > svg {
    display: none;
  }
  #search button {
    min-width: 44px;
  }
}
@media (max-height: 500px) {
  .booting #stage {
    height: 42svh;
  }
}

/* The assembly scanner only exists during startup. */
.booting #stage::after {
  content: '';
  position: absolute;
  width: min(96%, 750px);
  height: 18%;
  background: linear-gradient(transparent, var(--line));
  border-bottom: 1px solid var(--light);
  mask-image: linear-gradient(90deg, transparent, black 40%, black 60%, transparent);
  animation: sweep 1.5s 0.45s cubic-bezier(0.2, 0.65, 0.3, 1) both;
  pointer-events: none;
}
@keyframes sweep {
  from {
    opacity: 0;
    transform: translateY(-310%);
  }
  30%,
  70% {
    opacity: 0.9;
  }
  to {
    opacity: 0;
    transform: translateY(255%);
  }
}
.booting #boot {
  animation: lock-on 0.45s both;
}
@keyframes lock-on {
  from {
    opacity: 0;
    transform: scale(1.08);
    letter-spacing: 0.7em;
  }
}
.arrive #sites > * {
  animation: unfold 0.38s 0.24s backwards;
}
.arrive #sites > :nth-child(2n) {
  animation-delay: 0.31s;
}
.arrive #sites > :nth-child(3n) {
  animation-delay: 0.38s;
}
@media (max-height: 580px) {
  .booting #stage {
    height: 42svh;
    transform: translateY(calc(31svh - 50%));
  }
  .booting #boot {
    inset: 58% 0 auto;
    gap: 6px;
  }
}
