/*
 * ludufre.com/ports — Dangerous Dave × Supaplex hotsite.
 * Every image is native-resolution game art scaled with image-rendering: pixelated; every font is the
 * game's own bitmap font (fonts/*.woff2: 8 px per em, so multiples of 8px land on whole pixels).
 */

@font-face {
  font-family: 'Dave VGA';
  src: url('fonts/dave-vga.woff2') format('woff2');
  font-display: block;
}
@font-face {
  font-family: 'Supaplex Thin';
  src: url('fonts/supaplex-6.woff2') format('woff2');
  font-display: block;
}
@font-face {
  font-family: 'Supaplex Bold';
  src: url('fonts/supaplex-8.woff2') format('woff2');
  font-display: block;
}

/* The split position, animated when one half is hovered. */
@property --s {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 50%;
}

:root {
  --k: 3; /* sprite scale */
  --dave-red: #d8241c;
  --dave-yellow: #fcfc54;
  --dave-green: #54fc54;
  --dave-cyan: #54fcfc;
  --spx-green: #0a8a4a;
  --spx-grey: #8c8c9c;
  --spx-grey-hi: #c8c8d4;
  --spx-grey-lo: #4c4c5c;
  --spx-blue: #2c3cd8;
  --spx-red: #f02020;
  --spx-yellow: #fcd820;
  --gold: #ffd640;
  --topbar: 44px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: #000;
}

body {
  margin: 0;
  background: #000;
  color: #fff;
  font-family: 'Supaplex Thin', monospace;
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

img,
video {
  max-width: 100%;
  display: block;
}

.px,
.spr {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: fixed;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--gold);
  color: #000;
  font-family: 'Supaplex Bold';
  text-decoration: none;
}
.skip:focus {
  top: 8px;
}

.dave-font {
  font-family: 'Dave VGA', monospace;
}
.spx-font {
  font-family: 'Supaplex Bold', monospace;
}
.small {
  font-size: 16px;
  opacity: 0.8;
}

/* ── top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: calc(var(--topbar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, rgba(40, 0, 0, 0.82), rgba(0, 0, 0, 0.82) 50%, rgba(0, 30, 14, 0.82));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 2px solid rgba(255, 214, 64, 0.35);
  font-family: 'Supaplex Bold';
}
.topbar__home {
  text-decoration: none;
  font-size: 16px;
  white-space: nowrap;
}
.topbar__home:hover {
  color: var(--gold);
}
.topbar__title {
  font-family: 'Dave VGA';
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--gold);
}
.lang {
  display: flex;
  gap: 4px;
}
.lang button {
  font: inherit;
  font-size: 16px;
  line-height: 1;
  padding: 6px 8px;
  min-width: 40px;
  min-height: 32px;
  cursor: pointer;
  color: #fff;
  background: #111;
  border: 2px solid #444;
}
.lang button[aria-pressed='true'] {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

/* ── sprites: horizontal strips animated with steps() ─────────────────────── */
.spr {
  display: inline-block;
  width: calc(var(--fw) * var(--k));
  height: calc(var(--fh) * var(--k));
  background-repeat: no-repeat;
  background-size: calc(var(--fw) * var(--n) * var(--k)) 100%;
  animation: sprite var(--dur, 0.6s) steps(var(--n)) infinite;
}
@keyframes sprite {
  to {
    background-position-x: calc(var(--fw) * var(--n) * var(--k) * -1);
  }
}
.flip {
  transform: scaleX(-1);
}
.spr--dave-logo { --fw: 112px; --fh: 47px; --n: 4; --dur: 0.5s; background-image: url('img/dave-logo.png'); }
.spr--dave-walk { --fw: 20px; --fh: 16px; --n: 4; --dur: 0.45s; background-image: url('img/dave-walk.png'); }
.spr--fire { --fw: 16px; --fh: 16px; --n: 4; --dur: 0.4s; background-image: url('img/dave-fire.png'); }
.spr--trophy { --fw: 16px; --fh: 16px; --n: 5; --dur: 0.7s; background-image: url('img/dave-trophy.png'); }
.spr--spider { --fw: 28px; --fh: 20px; --n: 4; --dur: 0.5s; background-image: url('img/dave-spider.png'); }
.spr--sun { --fw: 24px; --fh: 21px; --n: 4; --dur: 0.4s; background-image: url('img/dave-sun.png'); }
.spr--snik { --fw: 16px; --fh: 16px; --n: 8; --dur: 0.6s; background-image: url('img/spx-snik.png'); }
.spr--electron { --fw: 16px; --fh: 16px; --n: 8; --dur: 0.5s; background-image: url('img/spx-electron.png'); }
.spr--murphy-eat { --fw: 16px; --fh: 16px; --n: 4; --dur: 0.5s; background-image: url('img/spx-murphy-eat.png'); }

/* ═══════════════════════════════ HERO ═══════════════════════════════ */
.hero {
  --s: 50%;
  --tilt: 5vw;
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  transition: --s 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (hover: hover) {
  .hero:has(.hero__half--dave:hover) {
    --s: 58%;
  }
  .hero:has(.hero__half--spx:hover) {
    --s: 42%;
  }
}
.hero__half {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  color: #fff;
  outline-offset: -6px;
}
.hero__half--dave {
  z-index: 2;
  background: #000;
  clip-path: polygon(0 0, calc(var(--s) + var(--tilt)) 0, calc(var(--s) - var(--tilt)) 100%, 0 100%);
}
.hero__half--spx {
  z-index: 1;
  background: #021 url('img/spx-base.png') 0 0 / 48px 48px;
}
.hero__half--spx::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 45%, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.72) 70%);
}
.hero__seam {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(180deg, #fff, var(--gold) 30%, #ff8a00 70%, #fff);
  clip-path: polygon(
    calc(var(--s) + var(--tilt) - 3px) 0,
    calc(var(--s) + var(--tilt) + 3px) 0,
    calc(var(--s) - var(--tilt) + 3px) 100%,
    calc(var(--s) - var(--tilt) - 3px) 100%
  );
  filter: drop-shadow(0 0 6px var(--gold));
  animation: seam 2.4s ease-in-out infinite;
}
@keyframes seam {
  50% {
    opacity: 0.65;
  }
}

/* each half lays out inside the part of the screen that is actually visible */
.hero__inner {
  position: absolute;
  top: var(--topbar);
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 24px 120px;
  text-align: center;
}
.hero__half--dave .hero__inner {
  left: 0;
  width: calc(var(--s) - var(--tilt) * 0.6);
}
.hero__half--spx .hero__inner {
  right: 0;
  width: calc(100% - var(--s) - var(--tilt) * 0.6);
}
.hero__logo {
  --k: 3;
  max-width: 100%;
}
.hero__kicker {
  margin: 0;
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--gold);
}
.hero__tag {
  margin: 0;
  font-size: 24px;
  line-height: 1.4;
  max-width: 22ch;
}
.hero__half--dave .hero__tag {
  color: #fff;
  text-shadow: 3px 3px 0 var(--dave-red);
}
.hero__half--spx .hero__tag {
  color: #fff;
  text-shadow: 2px 2px 0 #000, 0 0 12px rgba(0, 0, 0, 0.9);
}
.hero__cta {
  margin-top: 6px;
  font-size: 16px;
  padding: 10px 18px;
  animation: bob 1.4s ease-in-out infinite;
}
@keyframes bob {
  50% {
    transform: translateY(5px);
  }
}
.dave-btn {
  font-family: 'Dave VGA';
  color: #000;
  background: var(--dave-yellow);
  box-shadow: 4px 4px 0 var(--dave-red);
}
.spx-btn {
  font-family: 'Supaplex Bold';
  color: #000;
  background: linear-gradient(180deg, var(--spx-grey-hi), var(--spx-grey));
  border: 3px solid;
  border-color: #eee var(--spx-grey-lo) var(--spx-grey-lo) #eee;
}

/* Dave scenery */
.dave-ceiling,
.dave-floor {
  position: absolute;
  left: 0;
  right: 0;
  height: 48px;
  background: url('img/dave-brick.png') 0 0 / 48px 48px;
}
.dave-ceiling {
  top: 0;
}
.dave-floor {
  bottom: 0;
}
.runner {
  position: absolute;
  bottom: 100%;
  left: 0;
  animation: run 9s linear infinite;
}
.runner .spr {
  animation:
    sprite var(--dur) steps(var(--n)) infinite,
    hop 9s ease-in-out infinite;
}
@keyframes run {
  from {
    transform: translateX(-80px);
  }
  to {
    transform: translateX(calc(50vw + 40px));
  }
}
@keyframes hop {
  0%,
  38%,
  52%,
  100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-90px);
  }
}
.fires {
  /* right under the top of Dave's hop (45% of the run) */
  position: absolute;
  bottom: 100%;
  left: calc(0.45 * (50vw + 120px) - 80px - 38px);
  display: flex;
}
.fires .spr {
  --k: 3;
}
.hero__props {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.prop {
  position: absolute;
}
.prop--trophy {
  top: 14%;
  left: 9%;
  animation:
    sprite var(--dur) steps(var(--n)) infinite,
    float 3s ease-in-out infinite;
}
.prop--spider {
  top: 48px;
  right: 14%;
  animation:
    sprite var(--dur) steps(var(--n)) infinite,
    dangle 5s ease-in-out infinite;
}
.prop--spider::before {
  content: '';
  position: absolute;
  bottom: 90%;
  left: 50%;
  width: 2px;
  height: 400px;
  background: #888;
}
.prop--sun {
  bottom: 30%;
  left: 7%;
  animation:
    sprite var(--dur) steps(var(--n)) infinite,
    orbit 7s ease-in-out infinite;
}
@keyframes float {
  50% {
    transform: translateY(-14px);
  }
}
@keyframes dangle {
  50% {
    transform: translateY(110px);
  }
}
@keyframes orbit {
  25% {
    transform: translate(40px, -30px);
  }
  50% {
    transform: translate(80px, 0);
  }
  75% {
    transform: translate(40px, 30px);
  }
}
.gem-row {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 150px;
  display: flex;
  justify-content: center;
  gap: 18px;
}
.gemspr {
  width: 32px;
  height: 32px;
  background: url('img/dave-gems.png') calc(var(--i) * -32px) 0 / 192px 32px no-repeat;
  image-rendering: pixelated;
  animation: twinkle 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.2s);
}
@keyframes twinkle {
  50% {
    transform: translateY(-6px);
    filter: brightness(1.5);
  }
}

/* Supaplex scenery */
.spx-hwrow {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 48px;
  background: url('img/spx-hardware.png') 0 0 / 48px 48px;
}
.hero__spxlogo {
  width: min(448px, 92%);
  height: auto;
  filter: drop-shadow(4px 4px 0 #000);
  animation: logoGlow 2s ease-in-out infinite;
}
@keyframes logoGlow {
  50% {
    filter: drop-shadow(4px 4px 0 #000) drop-shadow(0 0 10px rgba(252, 216, 32, 0.8));
  }
}
.spx-monitor {
  width: min(400px, 88%);
  padding: 8px;
  background: linear-gradient(135deg, var(--spx-grey-hi), var(--spx-grey) 50%, var(--spx-grey-lo));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}
.spx-monitor img {
  width: 100%;
  height: auto;
  border: 2px solid #111;
}
.spx-corridor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 96px;
  background:
    url('img/spx-hardware.png') 0 100% / 48px 48px repeat-x,
    #000;
}
.snik {
  position: absolute;
  top: 0;
  left: 0;
  animation: snikRun 8s linear infinite;
}
.snik .spr {
  transform: rotate(-90deg);
}
@keyframes snikRun {
  from {
    transform: translateX(calc(50vw + 60px));
  }
  to {
    transform: translateX(-60px);
  }
}
.zonk-roll {
  position: absolute;
  top: 0;
  left: 0;
  animation: zonkRun 6s linear infinite;
  animation-delay: -2s;
}
.zonk-roll img {
  width: 48px;
  height: 48px;
  animation: spin 0.8s steps(4) infinite;
}
@keyframes zonkRun {
  from {
    transform: translateX(-60px);
  }
  to {
    transform: translateX(calc(50vw + 60px));
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.prop--electron {
  bottom: 120px;
  right: 10%;
  animation:
    sprite var(--dur) steps(var(--n)) infinite,
    float 2.4s ease-in-out infinite;
}

/* the title badge on the seam */
.hero__badge {
  position: absolute;
  z-index: 4;
  left: var(--s);
  bottom: 22px;
  transform: translateX(-50%);
  margin: 0;
  padding: 14px 22px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.88);
  border: 4px solid var(--gold);
  box-shadow:
    0 0 0 4px #000,
    0 0 26px rgba(255, 214, 64, 0.45);
  font-weight: normal;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}
.hero__badge-main {
  font-family: 'Dave VGA';
  font-size: 40px;
  line-height: 1;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 4px 4px 0 var(--dave-red);
}
.hero__badge-sub {
  font-size: 16px;
  line-height: 1.2;
}
.hero__badge-sub .dave-font {
  color: var(--dave-yellow);
}
.hero__badge-sub .spx-font {
  color: var(--spx-yellow);
}
.hero__badge-sub .amp {
  font-family: 'Supaplex Bold';
  color: #fff;
}
.hero__badge-by {
  font-size: 16px;
  color: var(--gold);
}

/* ═══════════════════════════ THE TWO SIDES ═══════════════════════════ */
.ports {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.side {
  position: relative;
  min-width: 0;
  scroll-margin-top: var(--topbar);
}
.side__wrap {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 56px clamp(16px, 4vw, 48px) 72px;
}
.side__head {
  text-align: center;
  margin-bottom: 18px;
}
.block {
  position: relative;
  margin: 36px 0;
}
.block p {
  margin: 0.6em 0 0;
}
.screen {
  margin: 28px 0 10px;
}
.screen__frame video {
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 7;
  background: #000;
}
.screen figcaption {
  margin-top: 8px;
  font-size: 16px;
  text-align: center;
  opacity: 0.8;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.gallery img {
  width: 100%;
  height: auto;
  transition: transform 0.25s;
}
.gallery img:hover {
  transform: scale(1.06) rotate(-1deg);
  position: relative;
  z-index: 2;
}
.specs {
  display: grid;
  gap: 2px;
  margin: 36px 0;
}
.specs div {
  display: grid;
  grid-template-columns: 9ch 1fr;
  gap: 12px;
  padding: 8px 12px;
}
.specs dt,
.specs dd {
  margin: 0;
}
.pad {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  margin-top: 10px;
}
.pad th {
  width: 1%;
  white-space: nowrap;
  text-align: left;
  font-weight: normal;
  padding-right: 14px;
  vertical-align: top;
}
.pad td {
  vertical-align: top;
}
.btn {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 4px;
  border-radius: 50%;
  font-family: 'Supaplex Bold';
  font-size: 16px;
  line-height: 1;
  color: #fff;
  box-shadow:
    inset -2px -3px 0 rgba(0, 0, 0, 0.35),
    0 2px 0 #000;
}
.btn--a { background: #d02028; }
.btn--b { background: #e8c020; color: #000; }
.btn--x { background: #2848d0; }
.btn--y { background: #20a050; }
.btn--dpad { background: #333; border-radius: 6px; }
.btn--wide { background: #555; border-radius: 14px; min-width: 64px; font-size: 16px; }
.btn--sh { background: #888; border-radius: 10px 10px 4px 4px; min-width: 40px; color: #000; }

.download {
  text-align: center;
}
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 14px auto 10px;
  padding: 14px 20px;
  max-width: 100%;
  text-decoration: none;
  text-align: left;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.dl-btn img {
  width: 48px;
  height: 48px;
  flex: none;
}
.dl-btn strong {
  display: block;
  font-weight: normal;
  font-size: 24px;
  line-height: 1.2;
}
.dl-btn small {
  display: block;
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  opacity: 0.85;
}
.dl-btn:hover {
  transform: translate(-2px, -2px);
}
.dl-btn:active {
  transform: translate(2px, 2px);
}
.credits {
  margin-top: 48px;
  font-size: 16px;
  text-align: center;
  opacity: 0.75;
}

/* collectibles, each standing on a small ledge between the blocks */
.ledge {
  display: flex;
  align-items: flex-end;
  margin: 28px 0;
}
.ledge--l {
  justify-content: flex-start;
}
.ledge--r {
  justify-content: flex-end;
}
.ledge--c {
  justify-content: center;
}
.ledge--dave {
  min-height: 40px;
}
.ledge--dave .gem::after {
  /* the brick ledge it sits on */
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 96px;
  height: 16px;
  transform: translateX(-50%);
  background: url('img/dave-brick.png') 0 0 / 16px 16px;
  image-rendering: pixelated;
}
.ledge--dave .gem {
  animation: glint 1.6s ease-in-out infinite;
}
.ledge--dave.ledge--r .gem {
  margin-right: 40px;
}
.ledge--dave.ledge--l .gem {
  margin-left: 40px;
}
.ledge--dave .gem--trophy {
  animation:
    trophy 0.7s steps(5) infinite,
    glint 1.6s ease-in-out infinite;
}
@keyframes glint {
  50% {
    filter: brightness(1.6);
  }
}
/* Supaplex: [base][infotron][base], like a pocket dug in the level */
.ledge--spx::before,
.ledge--spx::after {
  content: '';
  width: 40px;
  height: 40px;
  background: url('img/spx-base.png') 0 0 / 40px 40px;
  image-rendering: pixelated;
}
.ledge--spx .infotron {
  margin: 0;
  background-color: #000;
  animation: none;
}
.gem,
.infotron {
  position: relative;
  z-index: 5;
  width: 40px;
  height: 40px;
  margin: 0 12px 16px;
  padding: 0;
  border: 0;
  cursor: pointer;
  background-color: transparent;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  animation: twinkle 1.6s ease-in-out infinite;
}
.gem:hover,
.infotron:hover {
  filter: brightness(1.4) drop-shadow(0 0 6px #fff);
}
.gem {
  --f: 0;
  background-image: url('img/dave-gems.png');
  background-size: 240px 40px;
  background-position: calc(var(--f) * -40px) 0;
}
.gem--trophy {
  background-image: url('img/dave-trophy.png');
  background-size: 200px 40px;
  background-position: 0 0;
  animation:
    trophy 0.7s steps(5) infinite,
    twinkle 1.6s ease-in-out infinite;
}
@keyframes trophy {
  to {
    background-position-x: -200px;
  }
}
.infotron {
  background-image: url('img/spx-infotron.png');
  background-size: 40px 40px;
}
.gem.is-taken,
.infotron.is-taken {
  pointer-events: none;
  animation: none;
}
.gem.is-taken {
  animation: pop 0.5s forwards;
}
@keyframes pop {
  to {
    transform: translateY(-40px) scale(0.2);
    opacity: 0;
  }
}
.infotron.is-taken {
  background-image: url('img/spx-infoexpl.png');
  background-size: 320px 40px;
  animation: boom 0.5s steps(8) forwards;
}
@keyframes boom {
  to {
    background-position-x: -320px;
    visibility: hidden;
  }
}
.float-pts {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  font-family: 'Dave VGA';
  font-size: 24px;
  color: var(--dave-yellow);
  text-shadow: 2px 2px 0 #000;
  animation: rise 0.9s ease-out forwards;
}
@keyframes rise {
  to {
    transform: translateY(-48px);
    opacity: 0;
  }
}

/* ── Dave side ──────────────────────────────────────────────────────────── */
.side--dave {
  background:
    url('img/dave-brick.png') 0 0 / 32px 32px repeat-y,
    #000;
  border-right: 0;
  font-family: 'Dave VGA', monospace;
  line-height: 1.9;
}
.side--dave::after {
  /* brick column on the outer edge, like the level walls */
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 8px;
  background: linear-gradient(90deg, transparent, rgba(255, 214, 64, 0.5));
}
.side--dave .side__wrap {
  padding-left: clamp(40px, 5vw, 64px);
}
.side__logo {
  --k: 4;
  max-width: 100%;
}
.dave-lead {
  font-size: 16px;
  margin: 14px auto 0;
  max-width: 34em;
}
.dave-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  margin: 22px 0 4px;
  padding: 10px 12px;
  background: #000;
  border-top: 2px solid #aaa;
  border-bottom: 2px solid #aaa;
}
.dave-hud img {
  width: 124px;
  height: 22px;
}
.dave-hud .digits {
  margin-right: 10px;
}
.digits {
  display: inline-flex;
  gap: 2px;
  font-size: 0;
}
.digits i {
  width: 16px;
  height: 22px;
  background: url('img/dave-digits.png') 0 0 / 160px 22px no-repeat;
  image-rendering: pixelated;
}
.digits.is-bump {
  animation: bump 0.3s;
}
@keyframes bump {
  50% {
    transform: scale(1.25);
  }
}
.hint {
  margin: 4px 0 0;
  text-align: center;
  font-size: 16px;
  color: var(--dave-cyan);
}
.screen--dave .screen__frame {
  padding: 16px;
  background: url('img/dave-brick.png') 0 0 / 32px 32px;
  box-shadow:
    0 0 0 4px #000,
    0 0 0 6px var(--dave-red);
}
.dave-h {
  margin: 0;
  font-family: 'Dave VGA';
  font-weight: normal;
  font-size: 24px;
  line-height: 1.3;
  color: var(--dave-yellow);
  text-shadow: 3px 3px 0 var(--dave-red);
}
.dave-list {
  margin: 0.6em 0 0;
  padding: 0;
  list-style: none;
}
.dave-list li {
  position: relative;
  padding-left: 30px;
  margin: 0.5em 0;
}
.dave-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 20px;
  height: 20px;
  background: url('img/dave-gems.png') 0 0 / 120px 20px no-repeat;
  image-rendering: pixelated;
}
.specs--dave div {
  background: #100;
  border-left: 4px solid var(--dave-red);
}
.specs--dave dt {
  color: var(--dave-green);
}
.door-msg {
  width: min(352px, 100%);
  height: auto;
  margin: 10px auto 0;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}
.dl-btn--dave {
  font-family: 'Dave VGA';
  color: #000;
  background: var(--dave-yellow);
  box-shadow: 6px 6px 0 var(--dave-red);
}
.dl-btn--dave:hover {
  box-shadow: 8px 8px 0 var(--dave-red);
}
.side__fire {
  height: 48px;
  background:
    url('img/dave-brick.png') 0 100% / 48px 48px repeat-x;
}
.gallery--dave img {
  border: 3px solid var(--dave-red);
}
.pad--dave td {
  color: #fff;
}

/* ── Supaplex side ──────────────────────────────────────────────────────── */
.side--spx {
  background: #031a0c url('img/spx-base.png') 0 0 / 48px 48px;
  font-family: 'Supaplex Thin', monospace;
}
.side--spx::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.7));
  pointer-events: none;
}
.spx-titlebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.spx-titlebar .spr {
  --k: 3;
  flex: none;
}
.side__spxlogo {
  width: min(384px, 70%);
  height: auto;
  filter: drop-shadow(3px 3px 0 #000);
}
.spx-lead {
  margin: 14px auto 0;
  max-width: 34em;
  font-size: 16px;
  color: #dfe;
}
.spx-panel {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 22px 0 4px;
  padding: 8px 12px;
  background: linear-gradient(180deg, var(--spx-grey-hi), var(--spx-grey));
  border: 3px solid;
  border-color: #eee var(--spx-grey-lo) var(--spx-grey-lo) #eee;
  color: #000;
  font-family: 'Supaplex Bold';
}
.spx-panel__label {
  font-size: 16px;
  background: linear-gradient(180deg, var(--spx-red) 0 45%, #ff9020 45% 70%, var(--spx-yellow) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(1px 1px 0 #000);
}
.spx-panel__count {
  min-width: 4ch;
  padding: 2px 8px;
  background: #000;
  color: var(--spx-red);
  font-size: 24px;
  line-height: 1.1;
  text-align: center;
}
.spx-panel__msg {
  grid-column: 1 / -1;
  padding: 2px 8px;
  background: #000;
  color: #3ce06c;
  font-family: 'Supaplex Thin';
  font-size: 16px;
  text-align: center;
}
.spx-panel__exit img {
  width: 32px;
  height: 32px;
  opacity: 0.35;
  transition: opacity 0.3s;
}
.spx-panel.is-done .spx-panel__exit img {
  opacity: 1;
  animation: twinkle 0.8s ease-in-out infinite;
}
.spx-panel.is-done .spx-panel__count {
  color: var(--spx-yellow);
}
.screen--spx .screen__frame {
  padding: 12px;
  background: linear-gradient(135deg, var(--spx-grey-hi), var(--spx-grey) 45%, var(--spx-grey-lo));
  border: 3px solid;
  border-color: #eee #222 #222 #eee;
}
.screen--spx .screen__frame video {
  border: 3px solid;
  border-color: var(--spx-grey-lo) #ddd #ddd var(--spx-grey-lo);
}
.side--spx figcaption {
  color: #cfe;
}
.panelbox {
  padding: 16px 18px 18px;
  background: linear-gradient(180deg, var(--spx-grey), #7a7a8a);
  border: 3px solid;
  border-color: #ddd var(--spx-grey-lo) var(--spx-grey-lo) #ddd;
  color: #10189c;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}
.panelbox p,
.panelbox td {
  color: #0c1480;
}
.spx-h {
  margin: 0;
  font-family: 'Supaplex Bold';
  font-weight: normal;
  font-size: 24px;
  line-height: 1.3;
  background: linear-gradient(180deg, var(--spx-red) 0 40%, #ff9020 40% 65%, var(--spx-yellow) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(2px 2px 0 #000);
}
.specs--spx div {
  background: rgba(0, 0, 0, 0.82);
  border-left: 4px solid var(--spx-red);
}
.specs--spx dt {
  color: var(--spx-yellow);
  font-family: 'Supaplex Bold';
}
.specs--spx dd {
  color: #8fb0ff;
}
.dl-btn--spx {
  font-family: 'Supaplex Bold';
  color: #000;
  background: linear-gradient(180deg, var(--spx-grey-hi), var(--spx-grey));
  border: 4px solid;
  border-color: #fff var(--spx-grey-lo) var(--spx-grey-lo) #fff;
  box-shadow: 0 6px 0 #000;
}
.dl-btn--spx strong {
  color: #b00;
}
.src-link a {
  color: var(--spx-yellow);
  overflow-wrap: anywhere;
}
.side--spx .small,
.side--spx .credits {
  color: #dfe;
}
.gallery--spx img {
  border: 3px solid;
  border-color: #ddd var(--spx-grey-lo) var(--spx-grey-lo) #ddd;
}

/* ── footer + mobile switcher ───────────────────────────────────────────── */
.site-foot {
  padding: 32px 16px calc(32px + env(safe-area-inset-bottom));
  text-align: center;
  font-family: 'Supaplex Bold';
  font-size: 16px;
  background: #000;
  border-top: 2px solid #222;
}
.site-foot a {
  color: var(--gold);
}
.switcher {
  display: none;
}

/* ═══════════════════════════ PHONES & TABLETS ═══════════════════════════ */
@media (max-width: 960px) {
  :root {
    --k: 2;
  }
  /* the hero splits horizontally: Dave on top, Supaplex below */
  .hero {
    --tilt: 3vh;
    --badge: 62px; /* half the height of the title badge sitting on the seam */
    height: max(100svh, 760px);
    min-height: 760px;
  }
  .hero__half--dave {
    clip-path: polygon(0 0, 100% 0, 100% calc(var(--s) - var(--tilt)), 0 calc(var(--s) + var(--tilt)));
  }
  .hero__seam {
    clip-path: polygon(
      0 calc(var(--s) + var(--tilt) - 3px),
      100% calc(var(--s) - var(--tilt) - 3px),
      100% calc(var(--s) - var(--tilt) + 3px),
      0 calc(var(--s) + var(--tilt) + 3px)
    );
    background: linear-gradient(90deg, #fff, var(--gold) 30%, #ff8a00 70%, #fff);
  }
  .hero__inner {
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    gap: 8px;
    padding: 12px 16px;
  }
  .hero__half--dave .hero__inner {
    top: var(--topbar);
    bottom: auto;
    height: calc(var(--s) - var(--topbar) - var(--tilt) - var(--badge));
    justify-content: center;
    padding-bottom: 40px;
  }
  .hero__half--spx .hero__inner {
    top: calc(var(--s) + var(--tilt) + var(--badge));
    bottom: 0;
    padding-top: 4px;
    padding-bottom: 64px;
  }
  .hero__logo {
    --k: 2;
  }
  .hero__tag {
    font-size: 16px;
  }
  .hero__kicker {
    display: none;
  }
  .hero__cta {
    display: none;
  }
  .dave-ceiling {
    display: none;
  }
  .dave-floor {
    height: 24px;
    background-size: 24px 24px;
  }
  .fires {
    left: calc(0.45 * (100vw + 100px) - 60px - 22px);
  }
  .gem-row {
    display: none;
  }
  .prop--sun {
    display: none;
  }
  .prop--trophy {
    top: 64px;
    left: 6%;
  }
  .prop--spider {
    top: var(--topbar);
    right: 4%;
    animation:
      sprite var(--dur) steps(var(--n)) infinite,
      dangleShort 5s ease-in-out infinite;
  }
  @keyframes dangleShort {
    50% {
      transform: translateY(36px);
    }
  }
  .spx-hwrow {
    display: none;
  }
  .spx-monitor {
    width: min(240px, 62%);
    padding: 5px;
  }
  .hero__spxlogo {
    width: min(320px, 80%);
  }
  .spx-corridor {
    height: 56px;
    background-size: 32px 32px;
  }
  .zonk-roll img {
    width: 32px;
    height: 32px;
  }
  .prop--electron {
    display: none;
  }
  @keyframes run {
    from {
      transform: translateX(-60px);
    }
    to {
      transform: translateX(calc(100vw + 40px));
    }
  }
  @keyframes snikRun {
    from {
      transform: translateX(calc(100vw + 40px));
    }
    to {
      transform: translateX(-40px);
    }
  }
  @keyframes zonkRun {
    from {
      transform: translateX(-40px);
    }
    to {
      transform: translateX(calc(100vw + 40px));
    }
  }
  .hero__badge {
    left: 50%;
    top: var(--s);
    bottom: auto;
    transform: translate(-50%, -50%) rotate(-2deg);
    padding: 10px 14px 8px;
  }
  .hero__badge-main {
    font-size: 32px;
  }

  .ports {
    grid-template-columns: 1fr;
  }
  .side__wrap {
    padding: 40px 16px 64px;
  }
  .side--dave .side__wrap {
    padding-left: 32px;
    padding-right: 14px;
    font-size: 14px;
  }
  .side--dave .dave-lead,
  .side--dave .hint,
  .side--dave figcaption,
  .side--dave .small,
  .side--dave .credits {
    font-size: 14px;
  }
  .dave-h,
  .spx-h {
    font-size: 20px;
  }
  .side--dave {
    background-size: 24px 24px;
  }
  .side__logo {
    --k: 2.5;
  }
  .specs div {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .gallery {
    grid-template-columns: 1fr 1fr;
  }
  .gallery img:last-child {
    grid-column: 1 / -1;
  }
  .dl-btn strong {
    font-size: 16px;
  }
  .switcher {
    position: fixed;
    z-index: 40;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom));
    transform: translate(-50%, 140%);
    display: flex;
    gap: 0;
    border: 3px solid var(--gold);
    box-shadow:
      0 0 0 3px #000,
      0 6px 18px rgba(0, 0, 0, 0.6);
    transition: transform 0.35s;
  }
  .switcher.is-on {
    transform: translate(-50%, 0);
  }
  .switcher a {
    min-width: 120px;
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 6px 14px;
    text-decoration: none;
    font-size: 16px;
  }
  .switcher__dave {
    font-family: 'Dave VGA';
    background: #300;
    color: #fff;
  }
  .switcher__spx {
    font-family: 'Supaplex Bold';
    background: #032;
    color: #fff;
  }
  .switcher a.is-active.switcher__dave {
    background: var(--dave-yellow);
    color: #000;
  }
  .switcher a.is-active.switcher__spx {
    background: var(--spx-grey-hi);
    color: #900;
  }
  .site-foot {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 600px) {
  .topbar__title {
    display: none;
  }
  .lang button {
    min-width: 36px;
    padding: 6px;
  }
}

@media (max-width: 380px) {
  .hero__badge-main {
    font-size: 24px;
  }
  .hero__badge-sub {
    font-size: 12px;
  }
}

/* ── motion off ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .runner {
    transform: translateX(20vw);
  }
}
