:root {
  color-scheme: dark;
  background: var(--sds-bg, #080d17);
  color: var(--sds-silver, #e3e9f4);
  font-family: var(--sds-font-ui, system-ui, sans-serif);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, p { margin: 0; }

.console {
  width: min(90%, 78rem);
  min-height: 100svh;
  margin-inline: auto;
  padding-block: clamp(2rem, 7vw, 6rem);
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  align-content: center;
}

.readout {
  min-height: 19rem;
  display: grid;
  align-items: center;
}

.status {
  color: var(--sds-accent, #91b9b5);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status:not(:empty) { margin-bottom: 1.25rem; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

button {
  min-width: 44px;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--sds-accent, #91b9b5);
  border-radius: 3px;
  background: var(--sds-accent, #91b9b5);
  color: var(--sds-bg, #080d17);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

#skip {
  border-color: var(--sds-control-border, #687992);
  background: transparent;
  color: inherit;
}

button[aria-disabled="true"] { cursor: default; }

button:focus-visible, h1:focus-visible {
  outline: 2px solid var(--sds-accent, #91b9b5);
  outline-offset: 4px;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 550;
  line-height: 1;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}

.coming {
  margin-top: 1rem;
  font-size: 1.125rem;
  font-weight: 650;
}

.description {
  margin-top: 0.65rem;
  max-width: 35ch;
  color: var(--sds-text-muted, #b4c0d3);
  line-height: 1.65;
}

.chart {
  overflow: hidden;
  aspect-ratio: 640 / 500;
  border: 1px solid var(--sds-rule, #2c3647);
  background: radial-gradient(ellipse at 55% 40%, #142134, #090f1b 76%);
}

.chart svg { display: block; width: 100%; height: 100%; }
.reticle { stroke: #465970; opacity: 0.64; }
.field { fill: #a7b4c8; opacity: 0.56; }

.original, .discovery {
  color: var(--sds-silver, #e3e9f4);
  fill: currentColor;
}
.original path, .discovery path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.original { opacity: 0.48; }
[data-state="ready"] .original { opacity: 0.76; }
[data-state="scanning"] .original { opacity: 1; }

.signal { stroke: var(--sds-accent, #91b9b5); }
[data-state="discovered"] .signal, [data-state="revealed"] .signal { opacity: 0.55; }
[data-state="ready"] .discovery, [data-state="scanning"] .discovery path { opacity: 0; }
[data-state="scanning"] .discovery circle { opacity: 0; }

.sweep { opacity: 0; }
.sweep path { stroke: var(--sds-accent, #91b9b5); stroke-opacity: 0.65; }

@media (prefers-reduced-motion: no-preference) {
  [data-state="scanning"] .sweep { animation: sweep 700ms ease-in-out both; }
  [data-state="scanning"] .original { animation: focus-pattern 370ms ease-out both; }
  [data-state="scanning"] .discovery circle { animation: light-point 55ms ease-out var(--delay) both; }
  .discovery circle:nth-of-type(1) { --delay: 370ms; }
  .discovery circle:nth-of-type(2) { --delay: 430ms; }
  .discovery circle:nth-of-type(3) { --delay: 490ms; }
  .discovery circle:nth-of-type(4) { --delay: 550ms; }
  .discovery circle:nth-of-type(5) { --delay: 610ms; }
  [data-state="discovered"] .discovery path { animation: draw 210ms ease-out both; }

  @keyframes sweep {
    0% { opacity: 0; transform: translateX(0); }
    12%, 82% { opacity: 1; }
    100% { opacity: 0; transform: translateX(730px); }
  }
  @keyframes focus-pattern {
    from { opacity: 0.76; }
    to { opacity: 1; }
  }
  @keyframes light-point { to { opacity: 1; } }
  @keyframes draw {
    from { stroke-dasharray: 1; stroke-dashoffset: 1; }
    to { stroke-dasharray: 1; stroke-dashoffset: 0; }
  }
}

@media (max-width: 48rem) {
  .console { grid-template-columns: minmax(0, 1fr); }
  .readout { min-height: 17rem; }
}
