:root {
  --black: #030303;
  --white: #f2f1ed;
  --steel: #85898c;
  --muted: #a6a6a0;
  --red: #680b0b;
  --line: rgba(242, 241, 237, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--black);
  color: var(--white);
  font-family:
    "Arial Narrow",
    "Inter Tight",
    "Helvetica Neue",
    Arial,
    sans-serif;
  text-rendering: geometricPrecision;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--black);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

body::before {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.018) 0 1px,
      rgba(0, 0, 0, 0.046) 1px 4px
    ),
    linear-gradient(90deg, rgba(255, 0, 64, 0.11), transparent 22%, transparent 78%, rgba(0, 210, 255, 0.11));
  background-size:
    100% 5px,
    100% 100%;
  mix-blend-mode: screen;
  opacity: 0.36;
  animation: interlace-shift 3.2s steps(9, end) infinite;
}

body::after {
  background:
    radial-gradient(ellipse at center, transparent 0 56%, rgba(0, 0, 0, 0.28) 100%),
    linear-gradient(90deg, rgba(255, 0, 48, 0.12), transparent 46%, rgba(0, 210, 255, 0.12));
  mix-blend-mode: overlay;
  opacity: 1;
  animation: chroma-breathe 4.8s ease-in-out infinite;
}

a {
  color: inherit;
}

.shell {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto auto;
  padding: 24px 24px 42px;
  overflow: hidden;
  text-shadow:
    2px 0 rgba(255, 0, 64, 0.52),
    -2px 0 rgba(0, 210, 255, 0.44),
    0 0 10px rgba(242, 241, 237, 0.08);
}

.lobby,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.lobby {
  z-index: -4;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.06) 50%, rgba(0, 0, 0, 0.68)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.22) 48%, rgba(0, 0, 0, 0.56)),
    url("assets/lobby-background.png") center / cover no-repeat;
  filter: brightness(1.38) contrast(1.08) saturate(0.82);
}

.lobby::before,
.lobby::after {
  content: "";
  position: absolute;
  inset: 0;
}

.lobby::before {
  background: radial-gradient(ellipse at center, transparent 0 44%, rgba(0, 0, 0, 0.28) 84%);
  mix-blend-mode: screen;
  opacity: 0.34;
}

.lobby::after {
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin: 24px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.48),
    inset 0 0 54px rgba(0, 0, 0, 0.58);
}

.grain {
  z-index: -3;
  opacity: 0.58;
  background-image:
    radial-gradient(circle at 23% 31%, rgba(255, 255, 255, 0.5) 0 0.65px, transparent 1px),
    radial-gradient(circle at 74% 18%, rgba(255, 255, 255, 0.34) 0 0.55px, transparent 1px),
    radial-gradient(circle at 42% 78%, rgba(255, 255, 255, 0.24) 0 0.5px, transparent 1px),
    radial-gradient(circle at 81% 63%, rgba(0, 0, 0, 0.56) 0 0.72px, transparent 1.2px);
  background-size:
    5px 7px,
    9px 6px,
    13px 11px,
    17px 19px;
  mix-blend-mode: overlay;
  filter: contrast(1.28);
  will-change: opacity, background-position, filter;
  animation: grain-breathe 8.5s ease-in-out infinite;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 32px;
  padding: 64px 0 40px;
}

.mark-frame {
  position: relative;
  width: min(38vw, 490px);
  min-width: min(100%, 220px);
  background: transparent;
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.78),
    0 0 120px rgba(242, 241, 237, 0.06);
}

.mark {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  filter:
    invert(1)
    brightness(1.02)
    drop-shadow(3.2px 0 rgba(255, 0, 64, 0.58))
    drop-shadow(-3.2px 0 rgba(0, 210, 255, 0.5))
    drop-shadow(0 0 16px rgba(242, 241, 237, 0.08));
  opacity: 0.94;
}

.terminal {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
  gap: 8px;
  width: min(76vw, 980px);
  margin: 0;
  color: var(--white);
  font-size: 10px;
  letter-spacing: 0.18em;
  line-height: 1.35;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.5);
  min-height: 68px;
  align-items: center;
  padding: 12px 16px;
  font-family:
    "Cascadia Mono",
    "Consolas",
    "SFMono-Regular",
    monospace;
}

.terminal-line,
.terminal-meter {
  width: 520px;
  max-width: 52%;
}

.terminal-line {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.terminal-meter {
  display: grid;
  width: 420px;
  max-width: 46%;
  grid-template-columns: minmax(180px, 360px) auto;
  align-items: center;
  justify-content: end;
  gap: 12px;
}

.terminal-prompt,
.terminal-percent {
  color: var(--muted);
}

.terminal-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.terminal-track {
  --cells: 36;
  width: 100%;
  position: relative;
  height: 12px;
  display: grid;
  grid-template-columns: repeat(var(--cells), minmax(0, 1fr));
  gap: 2px;
  overflow: hidden;
  border: 1px solid rgba(242, 241, 237, 0.34);
  background: rgba(242, 241, 237, 0.05);
}

.terminal-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(242, 241, 237, 0.12), transparent);
  opacity: 0;
  transform: translateX(-80%);
  animation: defrag-scan 6.3s steps(10, end) infinite;
  pointer-events: none;
}

.defrag-cell {
  min-width: 0;
  height: 100%;
  background: rgba(242, 241, 237, 0.08);
  opacity: 0.44;
  transform: translateX(var(--shift, 0));
  transition:
    background-color 203ms steps(1, end),
    opacity 203ms steps(1, end),
    transform 315ms steps(2, end);
}

.defrag-cell.is-filled {
  background: rgba(242, 241, 237, 0.72);
  opacity: 0.9;
}

.defrag-cell.is-hot {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 12px rgba(242, 241, 237, 0.2);
  opacity: 1;
}

.defrag-cell.is-fragment {
  background: rgba(242, 241, 237, 0.28);
  opacity: 0.7;
}

.defrag-cell.is-gap {
  background: transparent;
  opacity: 0.2;
}

.terminal-percent {
  justify-self: end;
  min-width: 3ch;
}

@keyframes defrag-scan {
  0% {
    opacity: 0;
    transform: translateX(-80%);
  }

  12% {
    opacity: 0.55;
  }

  44% {
    opacity: 0.22;
  }

  100% {
    opacity: 0;
    transform: translateX(80%);
  }
}

.product-link {
  justify-self: center;
  width: min(76vw, 980px);
  min-height: 58px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  padding: 0 0 18px;
  color: var(--white);
  text-decoration: none;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(242, 241, 237, 0.7);
  transition:
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.product-link span,
.product-link strong {
  letter-spacing: 0.22em;
}

.product-link span {
  color: var(--steel);
  font-size: 10px;
}

.product-link strong {
  position: relative;
  padding-right: 42px;
  font-size: 18px;
  font-weight: 700;
}

.product-link strong::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 28px;
  height: 1px;
  background: currentColor;
  transform: translateY(-50%);
}

.product-link:hover,
.product-link:focus-visible {
  color: #ffffff;
  border-color: #ffffff;
  transform: translateY(-2px);
  outline: none;
}

.product-link:focus-visible {
  box-shadow: 0 10px 0 -9px var(--red);
}

.footer {
  justify-self: center;
  width: min(76vw, 980px);
  padding: 14px 0 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.footer a {
  text-decoration: none;
  transition: color 160ms ease;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--white);
  outline: none;
}

@media (max-width: 760px) {
  .shell {
    padding: 16px 16px 34px;
  }

  .lobby::after {
    margin: 16px;
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
    font-size: 9px;
    letter-spacing: 0.16em;
  }

  .hero {
    gap: 22px;
    padding: 48px 0 28px;
  }

  .terminal,
  .product-link,
  .footer {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
  }

  .mark-frame {
    width: 50%;
    min-width: 190px;
  }

  .shell {
    text-shadow:
      1.4px 0 rgba(255, 0, 64, 0.46),
      -1.4px 0 rgba(0, 210, 255, 0.38),
      0 0 8px rgba(242, 241, 237, 0.08);
  }

  .terminal {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    justify-self: center;
    font-size: 8px;
    letter-spacing: 0.08em;
    min-height: 82px;
    padding: 12px 14px;
    justify-items: stretch;
    position: relative;
  }

  .terminal > .terminal-line {
    position: absolute;
    top: 16px;
    left: auto;
    right: 14px;
    width: max-content;
    max-width: calc(100vw - 60px);
    justify-self: end;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    text-align: right;
    direction: ltr;
    transform: translateX(-100%);
  }

  .terminal > .terminal-meter {
    position: absolute;
    right: 14px;
    bottom: 18px;
    width: 240px;
    max-width: 58vw;
    justify-self: end;
    grid-template-columns: 1fr;
  }

  .terminal-text {
    display: block;
    overflow: visible;
    text-overflow: clip;
    text-align: right;
    white-space: nowrap;
  }

  .terminal-prompt {
    margin-right: 0;
  }

  .terminal-track {
    width: 100%;
  }

  .terminal-percent {
    display: none;
  }

  .product-link {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    justify-content: flex-start;
    gap: 10px;
    min-height: 58px;
  }

  .product-link span {
    font-size: 8px;
    letter-spacing: 0.14em;
  }

  .product-link strong {
    flex: 0 0 auto;
    width: max-content;
    max-width: 100%;
    padding-right: 30px;
    font-size: 13px;
    letter-spacing: 0.14em;
  }

  .product-link strong::after {
    width: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes interlace-shift {
  0%,
  100% {
    background-position:
      0 0,
      0 0;
  }

  36% {
    background-position:
      0 2px,
      3px 0;
  }

  67% {
    background-position:
      0 -2px,
      -3px 0;
  }
}

@keyframes chroma-breathe {
  0%,
  100% {
    opacity: 0.88;
    transform: translateX(0);
  }

  50% {
    opacity: 1;
    transform: translateX(1.8px);
  }
}

@keyframes grain-breathe {
  0%,
  100% {
    background-position:
      0 0,
      0 0,
      0 0,
      0 0;
    filter: contrast(1.22);
    opacity: 0.5;
  }

  48% {
    background-position:
      7px -5px,
      -9px 4px,
      6px 9px,
      -5px -7px;
    filter: contrast(1.38);
    opacity: 0.68;
  }

  72% {
    background-position:
      3px -2px,
      -4px 7px,
      9px 3px,
      -8px -3px;
    filter: contrast(1.32);
    opacity: 0.6;
  }
}
