:root {
  --paper: #f1ede3;
  --white: #fffdf7;
  --ink: #0b0b0b;
  --orange: #ff4f00;
  --yellow: #ffd60a;
  --blue: #2442ff;
  --green: #00d65c;
  --concrete: #d9d4c6;
  --b: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --display: "Archivo Black", Impact, "Arial Black", sans-serif;
  --body: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(11, 11, 11, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 11, 11, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  overflow-x: hidden;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: stretch; justify-content: space-between;
  background: var(--paper); border-bottom: var(--b);
}
.brand {
  display: flex; align-items: center; gap: 12px; padding: 12px var(--gutter);
  text-decoration: none; border-right: var(--b);
}
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-word { font-family: var(--display); font-size: 1.25rem; letter-spacing: -0.01em; }
.brand-word .dot { color: var(--orange); }
.nav-links { display: flex; }
.nav-links a {
  display: flex; align-items: center; padding: 0 clamp(14px, 2.5vw, 28px);
  font-family: var(--mono); font-weight: 700; font-size: 0.8rem; text-transform: uppercase;
  text-decoration: none; border-left: var(--b);
}
.nav-links a:hover { background: var(--yellow); }
.nav-install {
  display: flex; align-items: center; gap: 6px; padding: 0 clamp(14px, 2.5vw, 28px);
  font-family: var(--mono); font-weight: 700; font-size: 0.8rem; text-transform: uppercase;
  color: var(--ink); background: var(--orange); border: 0; border-left: var(--b); cursor: pointer;
}
.nav-install[hidden] { display: none; }
.nav-install:hover { background: var(--yellow); }
.nav-install:active { background: var(--ink); color: var(--paper); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-weight: 700; font-size: 1rem; text-transform: uppercase;
  text-decoration: none; padding: 16px 24px;
  border: var(--b); box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.btn-orange { background: var(--orange); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--paper); box-shadow: 6px 6px 0 var(--orange); }
.btn-ink:hover { box-shadow: 8px 8px 0 var(--orange); }

/* ---------- hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) var(--gutter) clamp(48px, 7vw, 88px);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center;
}
.stamp {
  display: inline-block; margin: 0 0 24px; padding: 6px 12px;
  font-family: var(--mono); font-weight: 700; font-size: 0.78rem;
  background: var(--yellow); border: var(--b);
}
.headline {
  margin: 0; line-height: 0.9; letter-spacing: -0.03em;
  font-size: clamp(3rem, 8.4vw, 7rem);
}
.headline mark {
  display: inline-block; margin-top: 0.1em; padding: 0.04em 0.12em 0.06em;
  background: var(--orange); color: var(--ink); border: var(--b); box-shadow: var(--shadow);
}
.lede {
  margin: 28px 0 0; font-family: var(--mono); font-weight: 700; font-size: clamp(1rem, 1.6vw, 1.2rem);
  text-transform: uppercase;
}
.hero-cta { margin-top: 32px; }

/* hero voxel box */
.voxel-box {
  margin: 0; background: var(--blue); border: var(--b); box-shadow: 10px 10px 0 var(--ink);
  display: flex; flex-direction: column;
}
.box-bar, .box-foot {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 14px; font-family: var(--mono); font-weight: 700; font-size: 0.75rem;
  background: var(--ink); color: var(--paper);
}
#hero-vox {
  display: block; width: 100%; aspect-ratio: 1 / 1; cursor: pointer;
  background-image:
    linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 32px 32px;
}
.box-foot {
  border: 0; border-top: var(--b); background: var(--yellow); color: var(--ink);
  justify-content: center; align-items: center; cursor: pointer; font-size: 0.95rem;
  padding: 14px; touch-action: manipulation;
}
.box-foot:hover { background: var(--orange); }
.box-foot:active { background: var(--ink); color: var(--yellow); }
.box-foot kbd {
  font-family: var(--mono); font-size: 0.7rem; padding: 2px 6px; margin-left: 4px;
  border: 2px solid currentColor; border-radius: 0;
}

/* voxel stack game */
.vs-meta { display: inline-flex; align-items: center; gap: 12px; }
.vs-sound {
  font: inherit; color: var(--ink); background: var(--paper); border: 0;
  padding: 2px 8px; cursor: pointer;
}
.vs-sound[aria-pressed="false"] { background: transparent; color: var(--paper); text-decoration: line-through; }
.vs-stage { position: relative; overflow: hidden; }
#hero-vox { touch-action: manipulation; -webkit-tap-highlight-color: transparent; outline: none; }
#hero-vox:focus-visible { outline: 3px dashed var(--yellow); outline-offset: -8px; }
.vs-hud {
  position: absolute; top: 10px; left: 0; right: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.vs-score {
  font-family: var(--display); font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1;
  color: var(--white); text-shadow: 4px 4px 0 var(--ink);
}
.vs-combo {
  font-family: var(--mono); font-weight: 700; font-size: 0.75rem;
  background: var(--yellow); border: 2px solid var(--ink); padding: 2px 8px;
}
.vs-combo[hidden] { display: none; }
.vs-msg { display: none; }
.vs-msg.is-attract, .vs-msg.is-over {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none;
  background: var(--white); border: var(--b); box-shadow: 6px 6px 0 var(--ink);
  padding: 12px 18px; text-align: center; white-space: nowrap;
}
.vs-msg.is-attract { bottom: 16px; }
.vs-msg.is-attract b { animation: blink 1.1s steps(2, start) infinite; }
.vs-msg.is-over { top: 50%; transform: translate(-50%, -50%); animation: slam .35s cubic-bezier(.2, 1.6, .4, 1) .55s both; }
.vs-msg b { font-family: var(--display); font-weight: 400; font-size: clamp(1.3rem, 3vw, 1.9rem); line-height: 1; }
.vs-msg span { font-family: var(--display); font-size: clamp(2rem, 5vw, 3rem); line-height: 1; color: var(--orange); -webkit-text-stroke: 1.5px var(--ink); }
.vs-msg small { font-family: var(--mono); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; }
.vs-msg em {
  font-style: normal; font-family: var(--mono); font-weight: 700; font-size: 0.72rem;
  background: var(--green); border: 2px solid var(--ink); padding: 1px 8px; margin-bottom: 4px;
}
.vs-pop {
  position: absolute; left: 0; right: 0; top: 30%; text-align: center; pointer-events: none;
  font-family: var(--display); font-size: clamp(1.2rem, 3vw, 1.7rem); color: var(--yellow);
  text-shadow: 3px 3px 0 var(--ink); -webkit-text-stroke: 1px var(--ink); opacity: 0;
}
.vs-pop.big { font-size: clamp(1.8rem, 4.4vw, 2.6rem); color: var(--green); }
.vs-pop.show { animation: popup .95s ease-out both; }
@keyframes popup {
  0% { opacity: 0; transform: scale(.5) rotate(-4deg); }
  18% { opacity: 1; transform: scale(1.15) rotate(2deg); }
  30% { transform: scale(1) rotate(-1deg); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-34px); }
}
@keyframes blink { to { visibility: hidden; } }
@keyframes slam { from { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
canvas.smashable { cursor: crosshair; }
@media (hover: none) { .box-foot kbd { display: none; } }

/* ---------- ticker ---------- */
.ticker {
  overflow: hidden; background: var(--ink); color: var(--paper);
  border-top: var(--b); border-bottom: var(--b);
  transform: rotate(-1deg); margin: 0 -20px; position: relative; z-index: 2;
}
.ticker-track {
  display: flex; width: max-content; white-space: nowrap;
  font-family: var(--display); font-size: clamp(1.1rem, 2.4vw, 1.6rem); text-transform: uppercase;
  padding: 12px 0; animation: ticker 28s linear infinite;
}
.ticker-track span { padding: 0 22px; }
.ticker-track .sq { color: var(--orange); padding: 0; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- featured ---------- */
.featured-wrap { max-width: var(--max); margin: 0 auto; padding: clamp(56px, 8vw, 96px) var(--gutter) 0; }
.feature { background: var(--white); border: var(--b); box-shadow: 12px 12px 0 var(--ink); }
.feature-bar {
  display: flex; justify-content: space-between; padding: 10px 16px;
  background: var(--orange); border-bottom: var(--b);
  font-family: var(--mono); font-weight: 700; font-size: 0.8rem;
}
.feature-grid { display: grid; grid-template-columns: 1.15fr 1fr; }
.feature-art {
  position: relative; border-right: var(--b); min-height: 420px; background: var(--ink);
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 32px 32px;
}
.feature-art canvas, .feature-art img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.feature-body { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; gap: 18px; container-type: inline-size; }
.feature-title { margin: 0; line-height: 0.88; letter-spacing: -0.03em; font-size: min(5rem, 12cqi); }
.feature-blurb { margin: 0; font-size: 1.1rem; font-weight: 500; max-width: 420px; }
.feature-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin-top: 10px; }
.feature-url { font-family: var(--mono); font-size: 0.85rem; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.feature-url:hover { background: var(--yellow); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--mono); font-weight: 700; font-size: 0.7rem; text-transform: uppercase;
  padding: 4px 9px; border: 2px solid var(--ink); background: var(--white);
}
.tag.status-live { background: var(--green); }
.tag.status-beta { background: var(--yellow); }
.tag.status-soon { background: var(--concrete); }

/* ---------- library ---------- */
.library { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 120px) var(--gutter) 24px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 32px; padding-bottom: 14px; border-bottom: var(--b);
}
.section-head h2, .about h2 { margin: 0; line-height: 0.9; letter-spacing: -0.02em; font-size: clamp(2.2rem, 5vw, 3.6rem); }
.count {
  font-family: var(--mono); font-weight: 700; font-size: 0.8rem;
  padding: 6px 10px; background: var(--ink); color: var(--paper);
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; }
.card {
  --hue: var(--orange);
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--white); border: var(--b); box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
a.card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
a.card:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.card-art {
  position: relative; aspect-ratio: 4 / 3; border-bottom: var(--b);
  background-color: color-mix(in srgb, var(--hue) 22%, var(--paper));
  background-image:
    linear-gradient(rgba(11,11,11,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,11,11,.07) 1px, transparent 1px);
  background-size: 24px 24px;
}
.card-art canvas, .card-art img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.card-body { padding: 16px 18px 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-num { font-family: var(--mono); font-weight: 700; font-size: 0.75rem; }
.card-title { margin: 0; font-size: 1.6rem; line-height: 1; letter-spacing: -0.01em; }
.card-tagline { margin: 0 0 16px; font-weight: 500; }
.card-url {
  margin: auto -18px 0; padding: 10px 18px; border-top: var(--b);
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-weight: 700; font-size: 0.8rem;
}
a.card:hover .card-url { background: var(--ink); color: var(--paper); }

.card.placeholder { border-style: dashed; box-shadow: none; background: transparent; }
.card.placeholder .card-art { background-color: transparent; border-bottom-style: dashed; }
.card.placeholder .card-url { border-top-style: dashed; }

/* ---------- how to play ---------- */
.about {
  max-width: var(--max); margin: 0 auto; padding: clamp(64px, 9vw, 110px) var(--gutter);
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 32px; align-items: start;
}
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border: var(--b); box-shadow: var(--shadow); background: var(--white); }
.steps li {
  display: flex; flex-direction: column; gap: 28px; padding: 18px;
  font-family: var(--display); font-size: clamp(1.1rem, 2vw, 1.5rem); text-transform: uppercase; line-height: 1;
}
.steps li + li { border-left: var(--b); }
.steps li span {
  align-self: flex-start; font-family: var(--mono); font-weight: 700; font-size: 0.8rem;
  padding: 4px 8px; background: var(--orange); border: 2px solid var(--ink);
}
.steps li:nth-child(2) span { background: var(--yellow); }
.steps li:nth-child(3) span { background: var(--green); }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: var(--paper); border-top: var(--b); overflow: hidden; }
.foot-word {
  display: block; font-family: var(--display); line-height: 0.8; letter-spacing: -0.04em;
  font-size: clamp(5rem, 24vw, 22rem); padding: 24px var(--gutter) 0; color: var(--paper);
}
.foot-meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
  padding: 18px var(--gutter); border-top: 3px solid var(--paper);
  font-family: var(--mono); font-weight: 700; font-size: 0.78rem;
}

.foot-support {
  color: var(--paper); text-decoration: none; text-transform: uppercase;
  border-bottom: 2px solid var(--orange); opacity: 0.75;
}
.foot-support:hover, .foot-support:focus-visible { opacity: 1; color: var(--yellow); border-color: var(--yellow); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-art { border-right: 0; border-bottom: var(--b); min-height: 0; aspect-ratio: 4 / 3; }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .brand-word { font-size: 1.05rem; }
  .nav-links a, .nav-install { padding: 0 12px; font-size: 0.72rem; }
  /* make room for the install button on phones */
  .nav-links:has(.nav-install:not([hidden])) .nav-how { display: none; }
  .steps { grid-template-columns: 1fr; }
  .steps li + li { border-left: 0; border-top: var(--b); }
  .steps li { flex-direction: row; align-items: center; gap: 16px; }
  .feature { box-shadow: 8px 8px 0 var(--ink); }
  .voxel-box { box-shadow: 7px 7px 0 var(--ink); }
  .vs-msg.is-attract { bottom: 10px; padding: 7px 12px; box-shadow: 4px 4px 0 var(--ink); }
  .vs-msg.is-attract b { font-size: 1.1rem; }
  .vs-msg small { font-size: 0.62rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .btn, .card { transition: none; }
  .vs-msg.is-attract b, .vs-msg.is-over { animation: none; }
  .vs-pop.show { animation: fade 1s both; }
  @keyframes fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
}

/* ---------- voxel models (a game's own character) ---------- */
.feature-art canvas.model { background: radial-gradient(ellipse 60% 55% at 50% 60%, color-mix(in srgb, var(--hue, #e8542e) 36%, transparent), transparent 70%); }
.card-art canvas.model { background: radial-gradient(ellipse 55% 50% at 50% 60%, rgba(255, 253, 247, 0.55), transparent 72%); }
