:root {
  --bg-black: #020403;
  --panel: rgba(2, 10, 8, 0.78);
  --neon-green: #66ff33;
  --neon-green-hot: #ccffbd;
  --corrupt-red: #ff2448;
  --corrupt-red-soft: rgba(255, 36, 72, 0.34);
  --white: #f3fff7;
  --muted: #b4efa4;
  --font-terminal: "Press Start 2P", "Courier New", Monaco, "Lucida Console", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-black);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  font-family: var(--font-terminal);
  background: #000;
}

#binary-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.steam-page {
  position: relative;
  z-index: 3;
  display: grid;
  min-height: 100vh;
  padding: 28px 18px;
  place-items: center;
}

.hero {
  width: min(100%, 920px);
  text-align: center;
  transform: translateY(-6vh);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1 {
  margin: 0;
  color: var(--white);
  font-size: 4.7rem;
  line-height: 0.95;
  text-transform: uppercase;
}

.title-logo {
  display: block;
  width: min(100%, 820px);
  height: auto;
  margin: 0 auto;
  image-rendering: pixelated;
}

.hero__subtitle {
  max-width: 720px;
  margin: 18px auto 0;
  color: var(--white);
  font-size: 1.32rem;
  line-height: 1.5;
}

.steam-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 500px);
  margin: 46px auto 0;
}

.steam-link {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  padding: 0;
  align-items: end;
  border: 1px solid #66ff33;
  color: var(--white);
  background: #050805;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}



.steam-link__image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  object-fit: cover;
  opacity: 0.82;
  transition: opacity 160ms ease, transform 160ms ease;
}

.steam-link__label {
  position: relative;
  z-index: 4;
  display: block;
  width: 100%;
  padding: 14px 12px;
  background: rgba(0, 0, 0, 0.72);
  transition: background 160ms ease, color 160ms ease;
}

.steam-link:hover,
.steam-link:focus-visible {
  border-color: var(--neon-green-hot);
  background: #071107;
  transform: translateY(-2px);
}

.steam-link:hover .steam-link__image,
.steam-link:focus-visible .steam-link__image {
  opacity: 1;
  transform: scale(1.035);
}

.steam-link:focus-visible {
  outline: 2px solid var(--neon-green-hot);
  outline-offset: 4px;
}

.steam-link--primary {
  border-color: rgba(102, 255, 51, 0.72);
  color: var(--neon-green);
  background: #050805;
}

.steam-link--primary:hover,
.steam-link--primary:focus-visible {
  color: #001b08;
  background: #071107;
}

.steam-link--primary .steam-link__image {
  opacity: 0.82;
}

.steam-link--primary .steam-link__label {
  background: rgba(0, 28, 8, 0.78);
}

.steam-link--primary:hover .steam-link__label,
.steam-link--primary:focus-visible .steam-link__label {
  background: rgba(204, 255, 189, 0.9);
}

body.trailer-open,
body.content-open {
  overflow: hidden;
}

.trailer-modal,
.content-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  padding: 72px 18px 18px;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.trailer-modal[hidden],
.content-modal[hidden] {
  display: none;
}

.trailer-modal.is-open,
.content-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.trailer-modal__backdrop,
.content-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(102, 255, 51, 0.055) 0,
      rgba(102, 255, 51, 0.055) 1px,
      transparent 1px,
      transparent 5px
    ),
    rgba(0, 0, 0, 0.82);
}

.trailer-modal__dialog,
.content-modal__dialog {
  position: relative;
  width: min(100%, 980px);
  border: 2px solid rgba(102, 255, 51, 0.72);
  background: #020403;
}

.trailer-modal__close,
.content-modal__close {
  position: absolute;
  right: 10px;
  bottom: calc(100% + 10px);
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid rgba(102, 255, 51, 0.72);
  color: var(--neon-green);
  background: rgba(2, 4, 3, 0.92);
  font: inherit;
  font-size: 0.72rem;
  text-transform: uppercase;
  cursor: pointer;
}

.trailer-modal__close:hover,
.trailer-modal__close:focus-visible,
.content-modal__close:hover,
.content-modal__close:focus-visible {
  color: #001b08;
  background: var(--neon-green);
  outline: 2px solid var(--neon-green-hot);
  outline-offset: 3px;
}

.content-modal__dialog {
  max-height: min(86vh, 760px);
  overflow: visible;
}

.content-modal__title {
  margin: 0;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(102, 255, 51, 0.34);
  color: var(--neon-green);
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
}

.content-modal__body {
  max-height: calc(86vh - 96px);
  overflow: auto;
  padding: 18px;
}

.content-slide {
  display: grid;
  gap: 16px;
}

.content-slide__media {
  display: block;
  width: 100%;
  max-height: 48vh;
  border: 1px solid rgba(102, 255, 51, 0.36);
  background: #000;
  image-rendering: pixelated;
  object-fit: contain;
}

.content-modal--screenshots {
  /*
    Screenshot images are 1920x1080, so 16:9 is the correct frame.
    This reserves vertical room for the close button, title, caption, and
    Prev/Next controls before deciding how wide the 16:9 image can be.
  */
  --screenshot-ui-space: 320px;
}

.content-modal--screenshots .content-modal__dialog {
  width: min(94vw, 1180px, calc((100vh - var(--screenshot-ui-space)) * 16 / 9));
}

.content-modal--screenshots .content-modal__body {
  max-height: none;
  overflow: visible;
  padding: 12px;
}

.content-modal--screenshots .content-slide {
  gap: 10px;
}

.content-modal--screenshots .content-slide__media {
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: none;
  object-fit: contain;
}

.content-modal--screenshots .content-slide__heading {
  font-size: 0.82rem;
}

.content-modal--screenshots .content-slide__text {
  font-size: 0.96rem;
  line-height: 1.45;
}

.content-modal--screenshots .content-modal__controls {
  margin-top: 12px;
}

.content-slide__heading {
  margin: 0;
  color: var(--white);
  font-size: 0.9rem;
  line-height: 1.5;
  text-transform: uppercase;
}

.content-slide__text {
  margin: 0;
  color: rgba(243, 255, 247, 0.82);
  font-family: "Courier New", Monaco, "Lucida Console", monospace;
  font-size: 1rem;
  line-height: 1.6;
}

.content-modal__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.content-modal__button {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(102, 255, 51, 0.68);
  color: var(--neon-green);
  background: #020403;
  font: inherit;
  font-size: 0.7rem;
  text-transform: uppercase;
  cursor: pointer;
}

.content-modal__button:hover,
.content-modal__button:focus-visible {
  color: #001b08;
  background: var(--neon-green);
  outline: 2px solid var(--neon-green-hot);
  outline-offset: 3px;
}

.content-modal__counter {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
  text-transform: uppercase;
}

.trailer-modal__video {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(102, 255, 51, 0.12), rgba(255, 36, 72, 0.08)),
    #000;
}

.trailer-modal__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 720px) {
  .steam-page {
    padding: 22px 14px;
  }

  .hero {
    transform: translateY(-3vh);
  }

  h1 {
    font-size: 2.65rem;
  }

  .hero__subtitle {
    font-size: 1.04rem;
  }

  .steam-actions {
    grid-template-columns: 1fr;
    gap: 10px;
    width: min(100%, 340px);
    margin-top: 36px;
  }

  .steam-link {
    font-size: 0.72rem;
  }

  .steam-link__label {
    padding: 12px 10px;
  }

  .trailer-modal,
  .content-modal {
    padding: 64px 12px 12px;
  }

  .trailer-modal__close,
  .content-modal__close {
    right: 0;
    bottom: calc(100% + 8px);
    min-height: 38px;
    font-size: 0.62rem;
  }

  .content-modal__title {
    padding: 16px 12px 12px;
    font-size: 0.78rem;
  }

  .content-modal__body {
    max-height: calc(86vh - 86px);
    padding: 12px;
  }

  .content-slide__heading {
    font-size: 0.76rem;
  }

  .content-slide__text {
    font-size: 0.94rem;
  }

  .content-modal__button {
    font-size: 0.6rem;
  }
}

@media (max-height: 820px) {
  .content-modal--screenshots {
    --screenshot-ui-space: 300px;
  }
}

@media (max-height: 680px) {
  .content-modal--screenshots {
    --screenshot-ui-space: 270px;
  }

  .content-modal--screenshots .content-slide__text {
    font-size: 0.88rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 1.55rem;
  }

  .hero__subtitle {
    font-size: 0.98rem;
  }
}

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