:root {
  --bg: #1b1a24;
  --panel: #24232f;
  --navy: #2b2d42;
  --line: #3a3950;
  --yellow: #ffd93d;
  --orange: #f4a261;
  --cream: #f4f1ea;
  --dim: #a7a3b8;
  --green: #5cae4c;
  --pixel: "Silkscreen", ui-monospace, monospace;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { image-rendering: pixelated; max-width: 100%; display: block; }

a { color: var(--yellow); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--navy);
  padding: 0.1em 0.35em;
}

h1, h2, h3 { font-family: var(--pixel); font-weight: 400; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.6rem, 3.6vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.05rem; color: var(--yellow); }

.hl { color: var(--yellow); }

/* Stepped "pixel" frame: corners cut one pixel-block in. */
.px-frame {
  background: var(--panel);
  box-shadow:
    0 -4px 0 0 var(--line),
    0 4px 0 0 var(--line),
    -4px 0 0 0 var(--line),
    4px 0 0 0 var(--line);
  margin: 4px;
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 64px);
  background: rgba(27, 26, 36, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--navy);
}
.brand { display: flex; gap: 10px; align-items: center; font-family: var(--pixel); font-size: 1.35rem; color: var(--cream); }
.brand:hover { text-decoration: none; }
.nav nav { display: flex; gap: 26px; align-items: center; font-size: 0.95rem; }
.nav nav a { color: var(--dim); }
.nav nav a:hover { color: var(--cream); text-decoration: none; }
.nav .nav-gh { color: var(--cream); border: 2px solid var(--line); padding: 4px 12px; }

main > section { padding-left: clamp(20px, 5vw, 64px); padding-right: clamp(20px, 5vw, 64px); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  max-width: 1360px; margin: 0 auto;
  padding-top: clamp(48px, 8vw, 104px); padding-bottom: 72px;
}
.eyebrow { font-family: var(--pixel); color: var(--orange); margin: 0 0 14px; font-size: 0.95rem; }
.lede { color: var(--dim); font-size: 1.15rem; max-width: 34em; }
.fine { color: var(--dim); font-size: 0.88rem; }
.hero-media video { width: 100%; display: block; aspect-ratio: 16 / 9; background: #000; }

.cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 12px; }
.btn {
  font-family: var(--pixel); font-size: 1rem;
  padding: 13px 22px;
  color: var(--cream); background: var(--navy);
  box-shadow: inset -4px -4px 0 rgba(0,0,0,0.3), inset 4px 4px 0 rgba(255,255,255,0.06);
  transition: transform 0.08s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--yellow); color: #1f2a3c; box-shadow: inset -4px -4px 0 var(--orange); }

/* Sprite strip */
.strip {
  background: var(--navy);
  padding-top: 40px; padding-bottom: 36px;
  text-align: center;
}
.sprites { display: flex; justify-content: center; gap: clamp(20px, 6vw, 80px); flex-wrap: wrap; }
.sprites img { width: 128px; height: auto; }
.strip p { color: var(--dim); margin: 22px 0 0; }

/* Generic sections */
.section { max-width: 1200px; margin: 0 auto; padding-top: 96px; padding-bottom: 8px; }
.sub { color: var(--dim); max-width: 46em; margin: 0 0 36px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.split p { color: var(--dim); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.checks li { background: var(--panel); padding: 16px 20px 16px 52px; position: relative; color: var(--dim); }
.checks li b { color: var(--cream); font-weight: 600; }
.checks li::before {
  content: ""; position: absolute; left: 20px; top: 22px; width: 12px; height: 12px;
  background: var(--green); box-shadow: 4px 4px 0 #3a7a3e;
}

/* Loop */
.loop { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 20px; align-items: center; }
.loop figure { margin: 4px; padding: 14px; }
.loop img { width: 100%; height: auto; image-rendering: auto; }
.loop figcaption { color: var(--dim); font-size: 0.95rem; padding-top: 12px; }
.tag { font-family: var(--pixel); color: #1f2a3c; background: var(--yellow); padding: 1px 8px; margin-right: 6px; }
.arrow { font-family: var(--pixel); font-size: 2.4rem; color: var(--yellow); }

/* Short film */
.short { padding: 10px; }
.short video { width: 100%; display: block; aspect-ratio: 16 / 9; background: #000; image-rendering: pixelated; }

/* Features */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--panel); padding: 22px 24px; border-top: 4px solid var(--navy); }
.card:hover { border-top-color: var(--yellow); }
.card p { color: var(--dim); margin: 0; font-size: 0.96rem; }
.editor { margin-top: 40px; padding: 10px; }
.editor img { width: 100%; height: auto; image-rendering: auto; }

/* Connect */
.steps { list-style: none; padding: 0; margin: 0 0 24px; counter-reset: step; display: grid; gap: 18px; }
.steps li { counter-increment: step; background: var(--panel); padding: 22px 24px 22px 76px; position: relative; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 22px; top: 20px;
  font-family: var(--pixel); font-size: 1.3rem; color: #1f2a3c;
  background: var(--yellow); width: 34px; height: 34px; display: grid; place-items: center;
}
.steps p { color: var(--dim); margin: 0; }
.code { position: relative; background: #13121a; margin-top: 10px; }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; }
.code code { background: none; padding: 0; font-size: 0.9rem; color: var(--cream); }
.copy {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--pixel); font-size: 0.8rem;
  background: var(--navy); color: var(--cream); border: 0; padding: 5px 10px; cursor: pointer;
}
.copy:hover { background: var(--line); }

/* Final CTA */
.final { text-align: center; padding-top: 110px; padding-bottom: 90px; }
.final img { margin: 0 auto 18px; }
.final .cta { justify-content: center; }

footer {
  border-top: 2px solid var(--navy);
  padding: 28px clamp(20px, 5vw, 64px);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  color: var(--dim); font-size: 0.9rem;
}
footer p { margin: 0; }

@media (max-width: 900px) {
  .hero, .split { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; }
  .loop { grid-template-columns: 1fr; }
  .arrow { transform: rotate(90deg); justify-self: center; }
  .nav nav a:not(.nav-gh) { display: none; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
}

/* Grid children may shrink below their content (long code, wide previews). */
.hero > *, .split > *, .loop > *, .grid > *, .steps li { min-width: 0; }
body { overflow-x: hidden; }

@media (max-width: 900px) {
  .hero, .split, .loop { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .steps li { padding-left: 24px; padding-top: 66px; }
  .sprites img { width: 96px; }
  .btn { width: 100%; text-align: center; }
}

/* Free palettes */
.pals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pal { background: var(--panel); border-top: 4px solid var(--navy); }
.pal:hover { border-top-color: var(--yellow); }
.swatches { display: flex; height: 56px; }
.swatches i { flex: 1; min-width: 0; }
.pal-meta { padding: 16px 22px 18px; }
.pal-meta h3 { margin: 0 0 4px; }
.pal-meta h3 span { color: var(--dim); font: 400 0.8rem var(--mono); margin-left: 6px; }
.pal-meta p { margin: 0; color: var(--dim); font-size: 0.94rem; }
.pal-meta .dl { margin-top: 10px; display: flex; gap: 14px; font-family: var(--mono); }
@media (max-width: 700px) { .pals { grid-template-columns: minmax(0, 1fr); } }

/* Windows logo on the download buttons */
.btn-ico { display: inline-block; width: 19px; height: 19px; vertical-align: -4px; margin-right: 10px; }
