/* Colours and type come from Crater itself (src/styles.css in the game); the ping pong
   section borrows pingpong.beer's table blue and ball orange. */
:root {
  --ink: #14160f;
  --panel: #23281c;
  --line: #3c4332;
  --paper: #f3ecda;
  --mute: #b4ad98;
  --rust: #e25a1c;
  --rust-bright: #f0763a;
  --moss: #b6c76a;
  --table: #1a4f9a;
  --board: #0f1b2e;
  --board-ink: #f4f7fb;
  --board-muted: #a9b8cd;
  --ball: #e85d14;
  --font-sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --font-display: "Syne", "Avenir Next", "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.9rem);
}

h2 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
}

p {
  margin: 0;
}

.wrap {
  width: min(1180px, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  margin-bottom: 0.9rem;
  color: var(--moss);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.big {
  margin-block: 1.1rem;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 500;
  line-height: 1.35;
}

/* Header */
.site-header {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--gutter);
  background: rgb(20 22 15 / 0.82);
  backdrop-filter: blur(10px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav {
  display: flex;
  gap: clamp(14px, 3vw, 30px);
  font-size: 0.95rem;
}

.site-header nav a {
  color: var(--mute);
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--paper);
}

/* Hero */
.hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: min(100svh, 900px);
  overflow: hidden;
  background: #111a38;
}

.hero-image {
  position: absolute;
  inset: 0 auto 0 0;
  width: 128%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: 0 100%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgb(10 14 32 / 0.72), rgb(10 14 32 / 0) 62%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin-inline: auto;
  padding: clamp(104px, 15vh, 150px) var(--gutter) 48px;
}

.hero-copy h1 {
  max-width: 10em;
}

.lede {
  max-width: 26em;
  margin-top: 1.2rem;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.45;
}

/* Sections */
.crater-intro,
.hood,
.pingpong {
  padding-block: clamp(64px, 10vw, 120px);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.5rem;
}

/* Screenshots: scrolls and swipes on its own; the arrows come from gallery.js. */
.gallery {
  position: relative;
  min-width: 0;
}

.gallery-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

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

.gallery-track img {
  border-radius: 6px;
}

.gallery-track p {
  margin-top: 0.6rem;
  padding-right: 4rem;
  color: var(--mute);
  font-size: 0.92rem;
}

.gallery-arrows {
  position: absolute;
  inset: 0 0 auto;
  display: none;
  align-items: center;
  justify-content: space-between;
  aspect-ratio: 8 / 5;
  padding-inline: 10px;
  pointer-events: none;
}

.gallery.ready .gallery-arrows {
  display: flex;
}

.gallery-arrows button {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: rgb(20 22 15 / 0.78);
  font-size: 1.2rem;
  line-height: 1;
  pointer-events: auto;
}

.gallery-arrows button:disabled {
  visibility: hidden;
}

.gallery-count {
  position: absolute;
  right: 0;
  bottom: 0;
  color: var(--mute);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin-block: clamp(48px, 7vw, 80px) 0;
}

.facts div {
  border-top: 2px solid var(--line);
  padding-top: 14px;
}

.facts dt {
  color: var(--rust-bright);
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.1;
}

.facts dd {
  margin: 0.3rem 0 0;
  color: var(--mute);
  font-size: 1rem;
  line-height: 1.4;
}

/* Arenas */
.arenas h2 {
  margin-bottom: 28px;
}

.arena-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(420px, 82vw);
  gap: 20px;
  margin: 0;
  padding: 0 max(var(--gutter), calc((100vw - 1180px) / 2 + var(--gutter))) 18px;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-color: var(--line) transparent;
}

.arena-strip li {
  scroll-snap-align: start;
}

.arena-strip img {
  aspect-ratio: 8 / 5;
  object-fit: cover;
  border-radius: 6px;
}

.arena-strip h3 {
  margin-top: 14px;
}

.arena-strip p {
  margin-top: 4px;
  color: var(--mute);
  font-size: 1rem;
  line-height: 1.4;
}

/* The kit */
.kit {
  padding-top: clamp(64px, 10vw, 120px);
}

.kit-groups {
  columns: 2;
  column-gap: clamp(32px, 6vw, 72px);
  margin-top: 28px;
}

.kit-groups section {
  break-inside: avoid;
  padding-bottom: 32px;
}

.kit-groups h3 {
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
  color: var(--rust-bright);
}

.kit-groups dl {
  margin: 0;
}

.kit-groups dl div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
}

.kit-groups dt {
  font-weight: 600;
}

.kit-groups dd {
  margin: 0;
  color: var(--mute);
  font-size: 1rem;
  line-height: 1.4;
}

/* Under the hood */
.hood .big {
  max-width: 34em;
}

.toy {
  margin-top: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}

#toy {
  display: block;
  width: 100%;
  height: clamp(240px, 36vw, 400px);
  background: linear-gradient(#7fb6e6, #c2dcf0);
  cursor: crosshair;
  touch-action: manipulation;
}

.toy-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 14px;
}

#toy-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.toy-actions {
  display: flex;
  gap: 8px;
}

button,
.button {
  display: inline-block;
  border: 0;
  border-radius: 6px;
  padding: 0.55rem 1rem;
  background: var(--rust);
  color: #fff;
  font: 600 1rem var(--font-sans);
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  filter: brightness(1.1);
}

.button.ghost {
  background: transparent;
  color: var(--paper);
  box-shadow: inset 0 0 0 1px var(--mute);
}

button.quiet {
  background: transparent;
  color: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}

.tech {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin-top: 44px;
}

.tech p {
  margin-top: 8px;
  color: var(--mute);
  font-size: 1rem;
  line-height: 1.5;
}

/* Ping pong */
.pingpong {
  background: var(--board);
  color: var(--board-ink);
}

.pingpong h2 {
  font-size: clamp(1.6rem, 2.9vw, 2.4rem);
}

.pingpong .eyebrow {
  color: #ff9a5c;
}

.pingpong p:not(.eyebrow, .big) {
  color: var(--board-muted);
}

.pingpong .button {
  margin-top: 1.5rem;
  background: var(--ball);
}

.pingpong .signup {
  margin-top: 1rem;
  overflow-wrap: anywhere;
}

.pingpong .signup a {
  color: var(--board-ink);
}

.bracket {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  padding: clamp(18px, 3vw, 32px);
  border-radius: 6px;
  background: var(--table);
}

.round {
  display: grid;
  gap: 24px;
}

.match {
  position: relative;
  display: grid;
  border-radius: 4px;
  overflow: hidden;
  background: var(--board);
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}

.match span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  color: var(--board-muted);
}

.match span + span {
  border-top: 1px solid rgb(255 255 255 / 0.1);
}

.match .won {
  color: var(--board-ink);
  font-weight: 600;
}

.match .won b {
  color: #ff9a5c;
}

/* Store and footer */
.store {
  padding-block: clamp(48px, 7vw, 72px);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.store h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
}

.store p {
  margin-top: 0.6rem;
  color: var(--mute);
}

.site-footer {
  padding-block: 28px;
  color: var(--mute);
  font-size: 0.92rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .facts,
  .tech {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kit-groups {
    columns: 1;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 17px;
  }

  .site-header nav {
    display: none;
  }

  .hero {
    align-items: flex-end;
  }

  .hero-copy {
    padding-top: 0;
  }

  .tech {
    grid-template-columns: minmax(0, 1fr);
  }

  .kit-groups dl div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .hero-image {
    width: 100%;
    object-position: 50% 100%;
  }

  .hero::after {
    background: linear-gradient(to top, rgb(10 14 32 / 0.86) 42%, rgb(10 14 32 / 0) 68%);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
