:root {
  --ink: #05070a;
  --text: #f4f7fb;
  --muted: #8e99a8;
  --line: rgba(244, 247, 251, 0.13);
  --acid: #28c7ff;
  --mint: #86e7ff;
  --heat: #ff3158;
  --amber: #f8fbff;
  --violet: #5d6cff;
  --panel: rgba(5, 7, 10, 0.78);
  --canvas-line: rgba(244, 247, 251, 0.16);
  --canvas-grid: rgba(244, 247, 251, 0.18);
  --canvas-dim: rgba(244, 247, 251, 0.24);
  --canvas-label: rgba(244, 247, 251, 0.42);
  --canvas-label-active: rgba(5, 7, 10, 0.92);
  --canvas-accent-shadow: rgba(40, 199, 255, 0.42);
  --canvas-stop-shadow: rgba(255, 49, 88, 0.52);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(40, 199, 255, 0.09), transparent 30%, rgba(255, 49, 88, 0.08) 78%, transparent),
    var(--ink);
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  letter-spacing: 0;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  opacity: 0.18;
  background:
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(244, 247, 251, 0.18) 32px),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(244, 247, 251, 0.12) 32px);
}

body::after {
  opacity: 0.2;
  background: repeating-linear-gradient(
    -22deg,
    transparent 0 14px,
    rgba(255, 255, 255, 0.12) 15px,
    transparent 17px
  );
}

.stage {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.48fr);
  align-items: center;
  gap: clamp(16px, 4vw, 60px);
  overflow: hidden;
  padding: clamp(18px, 4vw, 56px);
  isolation: isolate;
}

.atlas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.brand-zone {
  min-width: 0;
  transform: translateY(-2vh);
}

.mini-strip {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--line);
  font-size: clamp(10px, 1.35vw, 12px);
  font-weight: 900;
}

.mini-strip span {
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  background: var(--acid);
}

.mini-strip span:first-child {
  justify-content: start;
}

.mini-strip span:nth-child(2) {
  background: var(--text);
}

.mini-strip span:last-child {
  color: var(--text);
  background: var(--heat);
}

.logo {
  position: relative;
  width: min(760px, 100%);
  display: flex;
  align-items: flex-end;
  margin: clamp(16px, 4vh, 34px) 0 0;
  color: var(--text);
  line-height: 0.74;
  letter-spacing: 0;
  text-transform: lowercase;
}

.logo::before,
.logo::after {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  content: "5sql";
  font-size: clamp(132px, 24vw, 344px);
  font-weight: 950;
  line-height: 0.74;
  letter-spacing: 0;
  text-transform: lowercase;
}

.logo::before {
  color: rgba(40, 199, 255, 0.22);
  transform: translate(10px, 10px);
}

.logo::after {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 49, 88, 0.68);
  text-stroke: 1px rgba(255, 49, 88, 0.68);
  clip-path: inset(58% 0 18% 0);
  transform: translate(-8px, 6px);
  animation: logo-slice 2.6s steps(2, end) infinite;
}

.logo-five {
  color: transparent;
  font-size: clamp(132px, 24vw, 344px);
  font-weight: 950;
  -webkit-text-stroke: 2px var(--acid);
  text-stroke: 2px var(--acid);
}

.logo-sql {
  margin-left: clamp(-18px, -2vw, -8px);
  color: var(--text);
  font-size: clamp(62px, 11vw, 168px);
  font-weight: 950;
}

.route-console {
  position: relative;
  min-width: 0;
  align-self: end;
  display: grid;
  gap: clamp(12px, 2vw, 18px);
  padding: clamp(16px, 2.8vw, 28px);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(244, 247, 251, 0.08), transparent 42%),
    var(--panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(12px);
}

.route-console::before {
  position: absolute;
  inset: -9px auto auto -9px;
  width: 52px;
  height: 52px;
  border-left: 3px solid var(--acid);
  border-top: 3px solid var(--acid);
  content: "";
}

.route-console::after {
  position: absolute;
  right: -9px;
  bottom: -9px;
  width: 52px;
  height: 52px;
  border-right: 3px solid var(--heat);
  border-bottom: 3px solid var(--heat);
  content: "";
}

.console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: clamp(11px, 1.45vw, 13px);
  font-weight: 900;
  text-transform: uppercase;
}

.console-head strong {
  color: var(--acid);
}

.number-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--acid);
}

.number-row strong {
  font-size: clamp(72px, 13vw, 156px);
  line-height: 0.8;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(40, 199, 255, 0.34);
}

.number-row span {
  color: var(--heat);
  font-size: clamp(20px, 3vw, 36px);
  font-weight: 900;
}

.route-console.is-done .number-row strong {
  color: var(--heat);
  text-shadow: 0 0 26px rgba(255, 49, 88, 0.5);
}

.rail {
  height: 14px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, rgba(244, 247, 251, 0.14) 0 1px, transparent 1px 16px),
    rgba(255, 255, 255, 0.04);
}

.rail i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--acid), var(--amber), var(--heat));
  box-shadow: 0 0 18px rgba(40, 199, 255, 0.44);
}

.trace {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(244, 247, 251, 0.68);
  font-size: clamp(11px, 1.55vw, 13px);
  line-height: 1.45;
}

.trace li {
  min-height: 20px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.trace li.is-hot {
  color: var(--acid);
}

.stop-gate {
  position: absolute;
  top: 8vh;
  right: clamp(12px, 3vw, 42px);
  z-index: -1;
  height: 84vh;
  width: 10px;
  background:
    repeating-linear-gradient(0deg, var(--heat) 0 18px, transparent 18px 30px),
    rgba(255, 49, 88, 0.16);
  box-shadow: 0 0 40px rgba(255, 49, 88, 0.34);
}

.stop-gate span {
  position: absolute;
  top: 0;
  right: 20px;
  color: rgba(255, 49, 88, 0.82);
  font-size: clamp(44px, 7vw, 86px);
  font-weight: 950;
  writing-mode: vertical-rl;
}

@keyframes logo-slice {
  0%,
  100% {
    clip-path: inset(58% 0 18% 0);
    transform: translate(-8px, 6px);
  }

  45% {
    clip-path: inset(15% 0 64% 0);
    transform: translate(8px, -3px);
  }

  70% {
    clip-path: inset(78% 0 6% 0);
    transform: translate(-3px, 9px);
  }
}

@media (max-width: 760px) {
  .stage {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.74fr) auto;
    align-items: stretch;
    gap: clamp(10px, 2.8vh, 18px);
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .brand-zone {
    display: grid;
    align-content: center;
    min-height: 0;
    transform: none;
  }

  .mini-strip {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto auto;
    font-size: 10px;
  }

  .mini-strip span {
    min-height: 28px;
    padding: 0 8px;
  }

  .logo {
    width: 100%;
    margin-top: clamp(10px, 2vh, 16px);
  }

  .logo::before,
  .logo::after {
    font-size: clamp(94px, 32vw, 136px);
    line-height: 0.76;
  }

  .logo::before {
    transform: translate(6px, 7px);
  }

  .logo::after {
    transform: translate(-5px, 4px);
  }

  .logo-five {
    font-size: clamp(94px, 32vw, 136px);
    line-height: 0.76;
  }

  .logo-sql {
    margin-left: -8px;
    font-size: clamp(48px, 15vw, 72px);
    line-height: 0.82;
  }

  .route-console {
    align-self: end;
    width: min(100%, 460px);
    justify-self: end;
    gap: 10px;
    padding: 14px;
  }

  .route-console::before,
  .route-console::after {
    width: 32px;
    height: 32px;
    border-width: 2px;
  }

  .console-head {
    font-size: 10px;
  }

  .number-row {
    gap: 8px;
  }

  .number-row strong {
    font-size: clamp(58px, 20vw, 86px);
  }

  .number-row span {
    font-size: clamp(18px, 6vw, 26px);
  }

  .rail {
    height: 12px;
  }

  .trace {
    gap: 5px;
    font-size: 11px;
  }

  .trace li {
    min-height: 16px;
  }

  .stop-gate {
    right: 8px;
    top: 10vh;
    height: 78vh;
    width: 7px;
    opacity: 0.62;
  }

  .stop-gate span {
    right: 14px;
    font-size: clamp(38px, 12vw, 58px);
  }
}

@media (max-height: 620px) {
  .stage {
    min-height: 390px;
  }

  .trace {
    display: none;
  }

  .number-row strong {
    font-size: clamp(58px, 12vw, 118px);
  }
}

@media (max-width: 420px) {
  body::before {
    background:
      repeating-linear-gradient(90deg, transparent 0 23px, rgba(244, 247, 251, 0.16) 24px),
      repeating-linear-gradient(0deg, transparent 0 23px, rgba(244, 247, 251, 0.1) 24px);
  }

  .stage {
    grid-template-rows: minmax(0, 0.68fr) auto;
  }

  .mini-strip span:first-child {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .route-console {
    justify-self: stretch;
  }
}

@media (max-width: 360px) {
  .mini-strip span:nth-child(2) {
    display: none;
  }

  .logo::before,
  .logo::after,
  .logo-five {
    font-size: clamp(84px, 30vw, 108px);
  }

  .logo-sql {
    font-size: clamp(42px, 14vw, 58px);
  }

  .trace li:nth-child(-n + 2) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
