@font-face {
  font-family: Jersey;
  src: url("./assets/jersey20.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #050608;
  --orange: #f45100;
  --teal: #2a8a96;
  --muted: #9aa4b0;
  --float: 14px;
  --step: polygon(0 12px, 6px 12px, 6px 6px, 12px 6px, 12px 0, calc(100% - 12px) 0, calc(100% - 12px) 6px, calc(100% - 6px) 6px, calc(100% - 6px) 12px, 100% 12px, 100% calc(100% - 12px), calc(100% - 6px) calc(100% - 12px), calc(100% - 6px) calc(100% - 6px), calc(100% - 12px) calc(100% - 6px), calc(100% - 12px) 100%, 12px 100%, 12px calc(100% - 6px), 6px calc(100% - 6px), 6px calc(100% - 12px), 0 calc(100% - 12px));
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--ink);
}

body {
  margin: 0;
  color: #fff;
  font-family: Jersey, ui-monospace, monospace;
  font-size: 22px;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p {
  margin: 0;
  font-weight: 400;
}

/* Hero: a framed panel of pixel space, with the studio name in the middle. */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  margin: var(--float);
  height: calc(100svh - 2 * var(--float));
  min-height: 520px;
  max-height: 1100px;
  overflow: hidden;
  clip-path: var(--step);
  background: var(--ink);
}

.space {
  position: absolute;
  top: 0;
  left: 0;
  image-rendering: pixelated;
}

.hero-in {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0 24px 12vh;
  text-align: center;
}

/* The boot splash from the game: 17 frames of 820x200 stacked in one sheet. */
.hero h1 {
  animation: rise 1.4s var(--ease-out) 0.2s both;
}

.logo {
  --frame: 0;
  display: block;
  width: min(820px, 86vw);
  aspect-ratio: 820 / 200;
  background: url("./assets/enkota-logo.png") 0 calc(var(--frame) / 16 * 100%) / 100% 1700% no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(4px 4px 0 #000c);
}

.hero p {
  color: var(--muted);
  font-size: clamp(20px, 2vw, 30px);
  letter-spacing: 0.08em;
  text-shadow: 2px 2px 0 #000c;
  animation: rise 1.4s var(--ease-out) 0.6s both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}

/* Splatico: the trailer loop full width, copy on the left. */
.game {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 var(--float) var(--float);
  height: calc(100svh - 2 * var(--float));
  min-height: 560px;
  max-height: 1000px;
  overflow: hidden;
  clip-path: var(--step);
  background: var(--ink);
}

.game-film {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  object-fit: cover;
}

.game::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #050608b3 0%, #05060866 34%, #05060800 64%);
  pointer-events: none;
}

.game-right {
  justify-content: flex-end;
}

.game-right .game-copy {
  justify-items: end;
  text-align: right;
}

.game-right::after {
  background: linear-gradient(270deg, #050608b3 0%, #05060866 34%, #05060800 64%);
}

.game-copy {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 22px;
  width: min(600px, 100%);
  margin-inline: clamp(28px, 7vw, 120px);
}

/* The splats reach past the letters: line the S up with the text below. */
.game-copy h2 .splatico-logo {
  transform: translateX(-14.33%);
}

.game-copy h2 .pixel-logo {
  width: min(538px, 100%);
  image-rendering: pixelated;
}

.game-copy h2 img {
  display: block;
  width: min(460px, 100%);
  height: auto;
  filter: drop-shadow(0 4px 12px #0006);
}

.game-copy p {
  font-size: clamp(22px, 1.8vw, 28px);
  line-height: 1.3;
  color: #dcdce2;
  text-shadow: 2px 2px 0 #0008;
}

/* Stepped pixel button. */
.button {
  display: inline-flex;
  align-items: center;
  min-height: 64px;
  margin-top: 6px;
  padding: 12px 28px 16px;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  text-shadow: 2px 2px 0 #0006;
  background: var(--orange);
  box-shadow: inset 0 -6px 0 #0004, inset 0 4px 0 #fff3;
  clip-path: polygon(0 6px, 6px 6px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px));
  transition: transform 0.15s var(--ease-out), background-color 0.15s;
}

.button-soon,
.button-soon:hover {
  background: #4a4f5c;
  transform: none;
  cursor: default;
}

.button-icon {
  width: 18px;
  height: 20px;
  margin-left: 14px;
  flex-shrink: 0;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 #0006);
}

.button:hover {
  background: #ff6414;
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(2px);
}

.button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

/* Copy fades up once on screen. */
.js [data-reveal] > * {
  opacity: 0;
  transform: translateX(-48px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

@media (min-width: 801px) {
  .js .game-right [data-reveal]:not(.in) > * {
    transform: translateX(48px);
  }
}

.js [data-reveal].in > * {
  opacity: 1;
  transform: none;
}

.js [data-reveal].in > :nth-child(2) {
  transition-delay: 0.12s;
}

.js [data-reveal].in > :nth-child(3) {
  transition-delay: 0.24s;
}

.footer {
  padding: 24px 20px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 18px;
}

.footer p {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.pip {
  width: 6px;
  height: 6px;
  margin: 0 12px;
  background: var(--orange);
}

@media (max-width: 800px) {
  :root {
    --float: 8px;
  }

  .hero {
    height: calc(86svh - var(--float));
  }

  .game {
    --panel: min(56svh, 480px);
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: var(--panel) 0 64px;
    background: #0c0d12;
  }

  .game-film {
    inset: 0 -2px auto;
    height: var(--panel);
  }

  .game::after {
    inset: 0 0 auto;
    height: calc(var(--panel) + 2px);
    background: linear-gradient(0deg, #0c0d12 0%, #0c0d1200 45%);
  }

  .game-right .game-copy {
    justify-items: start;
    text-align: left;
  }

  .game-copy {
    width: auto;
    margin: -40px 24px 0;
  }

  .game-copy h2 img {
    width: min(280px, 100%);
  }

  .js [data-reveal] > * {
    transform: translateY(32px);
  }
}

@media (max-width: 640px) {
  .footer p {
    flex-direction: column;
    gap: 6px;
  }

  .pip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1,
  .hero p {
    animation: none;
  }

  .js [data-reveal] > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
