:root {
  color-scheme: dark;
  --ink: #f7f4ea;
  --muted: #b8c6be;
  --bg: #111717;
  --panel: #172121;
  --panel-strong: #202a27;
  --line: rgba(247, 244, 234, 0.16);
  --coal: #0c1110;
  --ember: #ef6f45;
  --gold: #f1c15d;
  --aqua: #5fc8b3;
  --leaf: #85b96f;
  --clay: #bc7b62;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(17, 23, 23, 0.96), rgba(27, 34, 30, 0.96)),
    linear-gradient(90deg, #111717, #283028);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(247, 244, 234, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 244, 234, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

a {
  color: inherit;
}

p,
h1,
h2 {
  margin-top: 0;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.site-header,
main,
.site-footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo,
.nav {
  display: flex;
  align-items: center;
}

.logo {
  gap: 10px;
  font-weight: 900;
  text-decoration: none;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(0deg, var(--aqua) 0 22%, transparent 22% 34%, var(--gold) 34% 56%, transparent 56% 68%, var(--ember) 68%),
    var(--coal);
}

.nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.nav a {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.hero {
  min-height: calc(100vh - 130px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
  gap: 34px;
  align-items: center;
  padding: 40px 0 60px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--aqua);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(3.2rem, 8vw, 7.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.45rem, 2.4vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  font-size: clamp(1.08rem, 2vw, 1.3rem);
}

.actions,
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
button {
  min-height: 44px;
  border: 1px solid rgba(247, 244, 234, 0.24);
  border-radius: 6px;
  padding: 11px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
button:hover {
  border-color: rgba(241, 193, 93, 0.78);
  background: rgba(255, 255, 255, 0.12);
}

.primary,
#start {
  color: #19150f;
  border-color: transparent;
  background: var(--gold);
}

.hero-art {
  min-height: 480px;
  position: relative;
  display: grid;
  place-items: end center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(95, 200, 179, 0.14), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--coal);
}

.hero-art::before {
  position: absolute;
  inset: 22px;
  content: "";
  border: 1px solid rgba(247, 244, 234, 0.08);
  border-radius: 8px;
}

.stack-piece {
  position: absolute;
  height: 42px;
  border-radius: 6px;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.24);
}

.piece-one {
  bottom: 72px;
  width: 70%;
  background: var(--aqua);
}

.piece-two {
  bottom: 122px;
  width: 57%;
  background: var(--gold);
}

.piece-three {
  bottom: 172px;
  width: 44%;
  background: var(--ember);
}

.piece-four {
  bottom: 222px;
  width: 31%;
  background: var(--leaf);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 40px;
}

.feature-card,
.rail-card,
.article-main,
.game-panel,
.ad-slot {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 33, 33, 0.78);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.2);
}

.feature-card,
.rail-card {
  padding: 24px;
}

.text-link {
  color: var(--gold);
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
  padding: 34px 0 60px;
}

.article-layout.narrow {
  grid-template-columns: minmax(0, 780px);
  justify-content: center;
}

.article-main {
  padding: clamp(24px, 5vw, 48px);
}

.article-main h1 {
  font-size: clamp(2.7rem, 6vw, 5.6rem);
}

.article-main h2 {
  margin-top: 30px;
}

.side-rail {
  display: grid;
  gap: 14px;
}

.ad-slot {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: rgba(247, 244, 234, 0.62);
  text-align: center;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.035) 0 10px,
      rgba(255, 255, 255, 0.012) 10px 20px
    ),
    rgba(32, 42, 39, 0.74);
}

.ad-slot span {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ad-slot.compact {
  min-height: 180px;
}

.game-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: stretch;
  padding: 20px 0 60px;
}

.game-panel {
  min-height: 650px;
  padding: clamp(16px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.game-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.game-head h1 {
  margin-bottom: 0;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1;
}

.scoreboard {
  min-width: 96px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: right;
  background: rgba(255, 255, 255, 0.05);
}

.scoreboard span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.scoreboard strong {
  display: block;
  font-size: 1.65rem;
}

canvas {
  width: 100%;
  flex: 1 1 auto;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--coal);
}

.controls {
  justify-content: flex-end;
}

.site-footer {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

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

@media (max-width: 900px) {
  .hero,
  .article-layout,
  .game-page {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 28px;
  }

  .hero-art {
    min-height: 340px;
  }

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

  .game-panel {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 20px, 1160px);
  }

  .site-header {
    padding-top: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  h1 {
    font-size: clamp(2.7rem, 16vw, 4.2rem);
  }

  .hero-art {
    min-height: 280px;
  }

  .game-head {
    align-items: stretch;
    flex-direction: column;
  }

  .scoreboard {
    text-align: left;
  }

  .actions a,
  .controls button {
    flex: 1 1 140px;
    text-align: center;
  }
}
