/* gravityhop.app. The game's own look: its 5x7 pixel font for anything
   the game would say, the cave gradient behind it, crystal light for accents.
   Long reading text uses the system monospace so it stays comfortable. */

@font-face {
  font-family: "GravityHop Pixel";
  src: url("/fonts/gravityhop-pixel.woff2") format("woff2");
  font-display: swap;
}

:root {
  /* render_icon.gd's cave gradient, and the game's crystal colors. */
  --cave-top: #0e1424;
  --cave-bottom: #22122e;
  --panel: #10172a;
  --panel-edge: #2a3554;
  --ink: #e6f1ff;
  --dim: #8e9dbb;
  --faint: #56627e;
  --cyan: #73eff7;
  --violet: #aa6eff;
  --green: #a7f070;
  --amber: #ffb04a;
  --signal: #b98cff;
  /* One game pixel at the sizes the pixel font uses: 8 px per em row. */
  --px: 4px;
  --pixel: "GravityHop Pixel", ui-monospace, "SF Mono", Menlo, monospace;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 68ch;
  color-scheme: dark;
}

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

html {
  background: var(--cave-top);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.7 var(--mono);
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgb(170 110 255 / 0.12), transparent 70%),
    radial-gradient(50rem 30rem at -10% 40%, rgb(115 239 247 / 0.07), transparent 70%),
    linear-gradient(180deg, var(--cave-top), var(--cave-bottom) 140vh) fixed;
  -webkit-font-smoothing: antialiased;
}

/* A faint scanline over everything, like the game's stepped rendering. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgb(0 0 0 / 0.14) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

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

a {
  color: var(--cyan);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

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

.pixel,
h1,
h2,
h3,
.nav,
.tag,
.key,
.chip {
  font-family: var(--pixel);
  font-weight: normal;
  -webkit-font-smoothing: none;
  font-smooth: never;
  letter-spacing: 0;
}

.crisp {
  image-rendering: pixelated;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 8px 12px;
  background: var(--amber);
  color: var(--cave-top);
  z-index: 10;
}

.skip:focus {
  left: 8px;
}

.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

/* --- header ------------------------------------------------------------- */

.top {
  position: relative;
  z-index: 2;
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav {
  display: flex;
  gap: 20px;
  font-size: 16px;
  line-height: 1;
}

.nav a {
  color: var(--dim);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--cyan);
}

/* --- hero --------------------------------------------------------------- */

.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 32px;
  padding-block: 40px 72px;
}

.title {
  margin: 0;
  font-size: 64px;
  line-height: 1;
  color: var(--ink);
  text-shadow: 8px 8px 0 rgb(0 0 0 / 0.55);
}

.subtitle {
  margin: 20px 0 0;
  font-size: 24px;
  line-height: 1;
  color: var(--cyan);
}

/* The title screen's signal trace, stepped like the game draws it. */
.trace {
  display: block;
  width: 216px;
  height: 24px;
  margin: 20px 0 28px;
  color: var(--signal);
  shape-rendering: crispEdges;
}

.trace path {
  animation: trace 0.6s steps(3) infinite;
}

/* One period of the wave is 6 units: scroll by it and loop. */
@keyframes trace {
  to {
    transform: translateX(6px);
  }
}

.lede {
  max-width: 34ch;
  margin: 0 0 28px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.chip {
  padding: 10px 12px 8px;
  font-size: 16px;
  line-height: 1;
  color: var(--green);
  background: rgb(167 240 112 / 0.08);
  box-shadow: inset 0 0 0 2px rgb(167 240 112 / 0.35);
}

/* A pixel-cornered button, the game's PRIMARY kind. */
.cta {
  display: inline-block;
  padding: 16px 20px 14px;
  font: 16px/1 var(--pixel);
  -webkit-font-smoothing: none;
  color: var(--cave-top);
  background: var(--cyan);
  text-decoration: none;
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
}

.cta.soon {
  color: var(--cyan);
  background: transparent;
  clip-path: none;
  box-shadow: inset 0 0 0 2px var(--cyan);
}

.platforms {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--dim);
}

.hop {
  position: relative;
  justify-self: center;
  width: min(420px, 100%);
}

.hop img {
  width: 100%;
  filter: drop-shadow(0 0 28px rgb(255 176 74 / 0.25)) drop-shadow(0 0 60px rgb(115 239 247 / 0.15));
  animation: hover 2.4s steps(6) infinite alternate;
}

@keyframes hover {
  from {
    transform: translateY(6px);
  }
  to {
    transform: translateY(-14px);
  }
}

/* --- sections ----------------------------------------------------------- */

.section {
  padding-block: 72px;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.2;
  color: var(--ink);
}

.kicker {
  display: block;
  margin: 0 0 16px;
  font: 16px/1 var(--pixel);
  -webkit-font-smoothing: none;
  color: var(--amber);
}

.prose {
  max-width: var(--measure);
}

.prose p {
  margin: 0 0 18px;
  color: var(--ink);
}

.prose .quiet {
  color: var(--dim);
}

/* The field console frame from the iPhone Duo deck. */
.console {
  position: relative;
  margin: 0;
  padding: 12px;
  background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--panel-edge), 0 24px 60px rgb(0 0 0 / 0.45);
}

.console::before,
.console::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 0 solid var(--cyan);
}

.console::before {
  top: -6px;
  left: -6px;
  border-top-width: 4px;
  border-left-width: 4px;
}

.console::after {
  right: -6px;
  bottom: -6px;
  border-right-width: 4px;
  border-bottom-width: 4px;
}

.console video {
  width: 100%;
  aspect-ratio: 1280 / 590;
  background: #000;
}

.console figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 0;
  font: 16px/1 var(--pixel);
  -webkit-font-smoothing: none;
  color: var(--dim);
}

.live {
  color: var(--signal);
}

.live::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  background: var(--signal);
  vertical-align: 1px;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Transmissions, tagged by voice the way the game shows them. */
.log {
  display: grid;
  gap: 14px;
  max-width: var(--measure);
  margin: 32px 0 0;
  padding: 24px;
  list-style: none;
  background: rgb(8 10 20 / 0.6);
  box-shadow: inset 0 0 0 2px var(--panel-edge);
}

.log li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: baseline;
}

.tag {
  font-size: 16px;
  line-height: 1;
}

.tag.auto {
  color: var(--amber);
}

.tag.voss {
  color: var(--cyan);
}

.log .auto + span {
  font-family: var(--pixel);
  -webkit-font-smoothing: none;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}

.log .voss + span {
  font-family: var(--pixel);
  -webkit-font-smoothing: none;
  font-size: 16px;
  line-height: 1.5;
  color: var(--cyan);
}

/* --- controls ----------------------------------------------------------- */

.keys {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.key {
  display: grid;
  gap: 14px;
  padding: 24px;
  font-size: 16px;
  line-height: 1;
  background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--panel-edge), inset 0 -6px 0 rgb(0 0 0 / 0.35);
}

.key strong {
  font-weight: normal;
  font-size: 32px;
  line-height: 1;
}

.key.thrust strong {
  color: var(--amber);
}

.key.flip strong {
  color: var(--cyan);
}

.key span {
  color: var(--dim);
}

.key p {
  margin: 0;
  font: 15px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
}

/* --- gallery ------------------------------------------------------------ */

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 720px);
  gap: 16px;
  margin: 32px 0 0;
  padding: 0 0 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  list-style: none;
  scrollbar-color: var(--panel-edge) transparent;
}

.gallery li {
  scroll-snap-align: start;
}

.gallery img {
  width: 100%;
  aspect-ratio: 1434 / 660;
  box-shadow: inset 0 0 0 2px var(--panel-edge);
}

/* --- duo ---------------------------------------------------------------- */

.duo .wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 40px;
}

.duo img {
  width: 100%;
}

/* --- price -------------------------------------------------------------- */

.price {
  text-align: center;
}

.price h2 {
  font-size: 48px;
  color: var(--green);
}

.price .prose {
  margin-inline: auto;
}

/* --- legal and support pages --------------------------------------------- */

.page {
  padding-block: 40px 80px;
}

.page h1 {
  margin: 0 0 8px;
  font-size: 48px;
  line-height: 1.1;
}

.page .updated {
  margin: 0 0 40px;
  color: var(--dim);
}

.page h2 {
  margin: 48px 0 16px;
  font-size: 24px;
  line-height: 1.3;
  color: var(--cyan);
}

.page h3 {
  margin: 32px 0 8px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--amber);
}

.page p,
.page li {
  max-width: var(--measure);
}

.page ul {
  padding-left: 22px;
}

.page li {
  margin-bottom: 8px;
}

.page li::marker {
  color: var(--cyan);
}

.note {
  max-width: var(--measure);
  padding: 16px 20px;
  background: rgb(8 10 20 / 0.6);
  box-shadow: inset 4px 0 0 var(--cyan);
}

/* --- footer ------------------------------------------------------------- */

.foot {
  margin-top: 40px;
  padding-block: 40px;
  border-top: 2px solid var(--panel-edge);
  font-size: 14px;
  color: var(--dim);
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
}

.foot .nav {
  font-size: 16px;
}

.foot p {
  margin: 0;
  max-width: 60ch;
}

/* --- small screens ------------------------------------------------------ */

@media (max-width: 860px) {
  .hero .wrap,
  .duo .wrap {
    grid-template-columns: 1fr;
  }

  .hop {
    order: -1;
    width: min(260px, 70%);
  }

  .title {
    font-size: 48px;
  }

  .subtitle {
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  .top .wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .title {
    font-size: 40px;
  }

  .keys {
    grid-template-columns: 1fr;
  }

  .log li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .page h1,
  .price h2 {
    font-size: 32px;
  }

  .gallery {
    grid-auto-columns: 88%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
  }
}
