/* SPDX-License-Identifier: MIT OR Apache-2.0 */
/* Rigby2D website. Colours follow the brand lockup: charcoal, steel blues and off-white. */

:root {
  --bg: #0a0a0b;
  --bg-alt: #111214;
  --surface: #17181b;
  --surface-hover: #1e2024;
  --line: #26282d;
  --text: #f4f4f5;
  --muted: #a9adb5;
  --steel: #7ba7c7;
  --ice: #b5d3e7;
  --glow: rgba(64, 140, 230, 0.16);
  --radius: 14px;
  --font: Inter, 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', Consolas, monospace;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

[hidden] {
  display: none !important;
}

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

code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--ice);
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  font-weight: 650;
}

h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 620;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 20;
  background: var(--surface);
  padding: 8px 12px;
}

/* ---- navigation ---- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 10, 11, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 600;
}
.brand b {
  color: var(--steel);
  font-weight: 600;
}

.nav nav {
  display: flex;
  gap: 4px;
  margin: 0 auto;
}
.nav nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  transition: color 0.15s, background 0.15s;
}
.nav nav a:hover {
  color: var(--text);
  background: var(--surface);
}
.nav nav .nav-extra {
  display: none;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.nav-icon:hover {
  color: var(--text);
  background: var(--surface);
}
.nav-icon.reddit:hover {
  color: #ff4500;
}

/* ---- buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 560;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover {
  background: var(--surface-hover);
  border-color: #34373d;
}
.btn.primary {
  background: var(--ice);
  border-color: var(--ice);
  color: #0a0a0b;
}
.btn.primary:hover {
  background: #cfe3f1;
}
.btn.small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.92rem;
}

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

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(55% 70% at 78% 45%, var(--glow), transparent 70%),
    radial-gradient(40% 40% at 15% 20%, rgba(123, 167, 199, 0.06), transparent 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: center;
  min-height: min(760px, calc(100vh - 60px));
  padding-top: 40px;
  padding-bottom: 40px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--steel);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.accent {
  color: var(--ice);
}

.lede {
  max-width: 34em;
  color: var(--muted);
  font-size: 1.15rem;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 14px;
}

.fine {
  color: #7d818a;
  font-size: 0.88rem;
}

.stage {
  margin: 0;
  width: 100%;
}

#hero,
.stage-fallback {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 10;
  max-height: 620px;
}

.stage-fallback {
  object-fit: contain;
}

.stage figcaption {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  color: #7d818a;
  font-size: 0.85rem;
}

.stage {
  position: relative;
}
.stage-line {
  min-height: 1.6em;
  margin: 6px 8% 0;
  text-align: center;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 500;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}
.stage-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
}
.sound {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.sound[aria-pressed='true'] {
  color: var(--text);
  border-color: var(--steel);
}
.stage-controls {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-alt);
}
.stage-controls button {
  min-width: 64px;
  padding: 0 10px;
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.stage-controls button[aria-pressed='true'] {
  background: var(--surface-hover);
  color: var(--text);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
}
[data-cost] {
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--steel);
}

/* ---- strip ---- */

.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.strip-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.strip-row div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 24px 20px;
  border-left: 1px solid var(--line);
}
.strip-row div:first-child {
  border-left: 0;
}
.strip-row b {
  font-size: 1.25rem;
  font-weight: 620;
}
.strip-row span {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.section {
  padding: 96px 0;
}
.section.alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-lede {
  max-width: 40em;
  margin: 0 0 40px;
  color: var(--muted);
  font-size: 1.08rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.showcase {
  margin-top: 48px;
}
.video {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  background: var(--surface);
}
.video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.video:hover img {
  transform: scale(1.015);
}
.play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  background: rgba(10, 10, 11, 0.72);
  border: 1px solid rgba(244, 244, 245, 0.3);
}
.play::after {
  content: '';
  position: absolute;
  left: 34px;
  top: 26px;
  border-left: 24px solid var(--text);
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
}
.video-label {
  position: absolute;
  left: 20px;
  bottom: 16px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(10, 10, 11, 0.72);
  color: var(--text);
  font-size: 0.92rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split p {
  color: var(--muted);
}

.ticks {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}
.ticks li {
  position: relative;
  padding: 4px 0 4px 26px;
}
.ticks li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 12px;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--steel);
  border-bottom: 2px solid var(--steel);
  transform: rotate(-45deg);
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bubble {
  margin: 0;
  max-width: 90%;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 4px;
  background: var(--surface);
  color: var(--text) !important;
}
.bubble:nth-child(even) {
  align-self: flex-end;
  border-radius: 16px 16px 4px 16px;
}

.code {
  margin: 0;
  overflow-x: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0e0f11;
  font: 0.92rem/1.7 var(--mono);
}
.code code {
  color: #d4d6db;
  font-size: inherit;
}
.code .k {
  color: var(--steel);
}
.code .s {
  color: #a5d6a7;
}
.code .n {
  color: #f0b27a;
}
.code .c {
  color: #6b7079;
}

.downloads {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.dl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.dl:hover {
  border-color: var(--steel);
  background: var(--surface-hover);
}
.dl span {
  color: var(--muted);
  font-size: 0.93rem;
}

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

.foot {
  padding: 64px 0 32px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
}
.foot-brand p {
  margin: 12px 0 18px;
  max-width: 280px;
  color: var(--muted);
  font-size: 0.93rem;
}
.foot-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.foot-col h4 {
  margin: 4px 0 6px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.foot-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
}
.foot-col a:hover {
  color: var(--text);
}
.foot-legal {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.foot-legal p {
  margin: 0;
  max-width: 820px;
  color: #7d818a;
  font-size: 0.84rem;
}
.foot-legal a {
  color: var(--muted);
  font-size: 0.86rem;
}

/* ---- responsive ---- */

@media (max-width: 1000px) {
  .nav-download {
    display: none !important;
  }
  .foot-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .foot-brand {
    grid-column: 1 / -1;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .strip-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .strip-row div:nth-child(3) {
    border-left: 0;
  }
  .strip-row div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 820px) {
  .nav nav {
    display: none;
  }
  .nav-actions {
    margin-left: auto;
  }
  .nav-icon {
    display: none;
  }
  .hero-grid,
  .split {
    grid-template-columns: 1fr;
  }
  .hero-grid {
    min-height: 0;
    gap: 12px;
  }
  #hero,
  .stage-fallback {
    aspect-ratio: 1 / 1;
    max-height: 460px;
  }
  .downloads {
    grid-template-columns: 1fr 1fr;
  }
  .foot-legal {
    flex-direction: column;
  }
  .section {
    padding: 72px 0;
  }
}

@media (max-width: 560px) {
  .wrap {
    padding: 0 16px;
  }
  .cards,
  .downloads,
  .strip-row {
    grid-template-columns: 1fr;
  }
  .strip-row div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .strip-row div:first-child {
    border-top: 0;
  }
  .cta .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .video img,
  .btn,
  .dl {
    transition: none;
  }
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}
.card h3 a:hover {
  color: var(--ice);
}
.card h3 a::after {
  content: ' →';
  color: var(--steel);
  opacity: 0;
  transition: opacity 0.15s;
}
.card:hover h3 a::after {
  opacity: 1;
}

.showcase.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 820px) {
  .showcase.two {
    grid-template-columns: 1fr;
  }
}

/* ---- Demos page ---- */

.nav nav a[aria-current='page'] {
  color: var(--text);
}

.page-head {
  padding: 72px 0 8px;
  background: radial-gradient(60% 120% at 20% 0%, var(--glow), transparent 70%);
}
.page-head .section-lede {
  margin-bottom: 0;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--steel);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demos-section {
  padding-top: 48px;
}
.demo-list {
  display: grid;
  gap: 20px;
}
.demo {
  display: grid;
  grid-template-columns: minmax(0, 360px) 1fr;
  gap: 28px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.demo-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: #0f1012;
}
.demo-body h2 {
  margin-bottom: 8px;
  font-size: 1.6rem;
}
.demo-body > p {
  margin: 0 0 14px;
  color: var(--muted);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 3px 10px;
  font-size: 0.8rem;
  color: var(--ice);
  border: 1px solid rgba(123, 167, 199, 0.28);
  border-radius: 999px;
  background: rgba(123, 167, 199, 0.07);
}
.demo-body > .demo-files {
  font-size: 0.85rem;
}
.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.license-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.license-grid .section-lede {
  margin-bottom: 24px;
}
.license-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.license-summary > div {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.license-summary h3 {
  margin-bottom: 10px;
}
.license-summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.license-summary li {
  position: relative;
  padding: 4px 0 4px 26px;
  color: var(--muted);
  font-size: 0.95rem;
}
.license-summary li::before {
  position: absolute;
  left: 0;
  top: 4px;
  font-weight: 700;
}
.license-summary .yes h3 {
  color: #8fd5a6;
}
.license-summary .yes li::before {
  content: '✓';
  color: #8fd5a6;
}
.license-summary .no h3 {
  color: #f0a08a;
}
.license-summary .no li::before {
  content: '✕';
  color: #f0a08a;
}
.license-full {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.license-full summary {
  padding: 16px 22px;
  cursor: pointer;
  font-weight: 600;
}
.license-full[open] summary {
  border-bottom: 1px solid var(--line);
}
.license-full > .fine {
  padding: 0 22px 18px;
}
.license-text {
  padding: 6px 22px 4px;
  color: var(--muted);
  font-size: 0.95rem;
}
.license-text h2 {
  margin: 1.2em 0 0.4em;
  font-size: 1.15rem;
  color: var(--text);
}
.license-text li {
  margin-bottom: 6px;
}

@media (max-width: 820px) {
  .demo {
    grid-template-columns: 1fr;
  }
  .license-summary {
    grid-template-columns: 1fr;
  }
}
.license-text .anchor {
  display: none;
}

/* ---- mobile menu ---- */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav.open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav.open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
.nav.open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 820px) {
  .nav-row {
    gap: 12px;
  }
  .nav-toggle {
    display: flex;
  }
  .nav nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }
  .nav.open nav {
    display: flex;
  }
  .nav.open {
    background: var(--bg);
  }
  .nav nav a,
  .nav nav .nav-extra {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 4px;
    border-radius: 0;
    font-size: 1.05rem;
    color: var(--text);
    border-bottom: 1px solid var(--line);
  }
  .nav nav a:hover {
    background: none;
  }
  .nav nav a:last-child {
    border-bottom: 0;
  }
  .nav nav a[aria-current='page'] {
    color: var(--steel);
  }
}

@media (max-width: 380px) {
  .nav .btn.small {
    padding: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle span {
    transition: none;
  }
}

.waitlist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  max-width: 520px;
}
.waitlist button {
  font: inherit;
  cursor: pointer;
}
.waitlist .hp {
  display: none;
}
.waitlist label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.waitlist input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.waitlist input:focus {
  outline: 2px solid var(--steel);
  outline-offset: 1px;
}

/* Devlog (blog/devlog.js) */
.post-wrap {
  max-width: 820px;
}
.post h1 {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 8px 0 12px;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.post-meta a {
  color: var(--steel);
}
.post-tag {
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text);
}
.post-video,
.post-hero {
  display: block;
  width: 100%;
  height: auto;
  margin: 28px 0;
  border-radius: var(--radius);
}
.post-body {
  font-size: 17px;
  line-height: 1.7;
}
.post-body h2 {
  margin-top: 40px;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}
.post-body code {
  font-family: var(--mono);
  font-size: 0.92em;
}
.post-follow {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.post-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  overflow: hidden;
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.post-card:hover {
  border-color: var(--steel);
  transform: translateY(-2px);
}
.post-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.post-card .post-meta,
.post-card b,
.post-card > span:last-child {
  padding: 0 18px;
}
.post-card b {
  color: var(--text);
  font-size: 19px;
  letter-spacing: -0.01em;
}

/* r/rigby2d: the community, everywhere */
.btn.reddit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ff4500;
  border-color: #ff4500;
  color: #fff;
}
.btn.reddit:hover {
  background: #ff5f24;
  border-color: #ff5f24;
}
.community {
  background: radial-gradient(60% 120% at 12% 50%, rgba(255, 69, 0, 0.16), transparent 70%);
}
.community-row {
  display: flex;
  align-items: center;
  gap: 40px;
}
.community-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  border-radius: 36px;
  background: #ff4500;
  color: #fff;
  box-shadow: 0 24px 60px rgba(255, 69, 0, 0.3);
}
.community-callout {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 69, 0, 0.45);
  background: rgba(255, 69, 0, 0.08);
}
.community-callout p {
  margin: 0;
  flex: 1;
}
@media (max-width: 720px) {
  .community-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .community-mark {
    width: 90px;
    height: 90px;
    border-radius: 22px;
  }
  .community-mark svg {
    width: 56px;
    height: 56px;
  }
  .community-callout {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .foot-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- Add-ons: the marketplace ---- */

.market-head {
  padding-bottom: 24px;
}
.market {
  padding-top: 32px;
}
.market-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-alt);
}
.market-bar input[type='search'] {
  flex: 1 1 240px;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.market-bar input[type='search']:focus {
  outline: 2px solid var(--steel);
  outline-offset: -1px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}
.chips button:hover {
  color: var(--text);
}
.chips button[aria-pressed='true'] {
  border-color: var(--steel);
  background: rgba(123, 167, 199, 0.16);
  color: var(--text);
}
.market-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.88rem;
}
.market-sort select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}
.market-count {
  margin: 16px 2px;
}
.market-empty {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
}
.addon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.addon-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.addon-card:hover {
  border-color: var(--steel);
  background: var(--surface-hover);
  transform: translateY(-2px);
}
.addon-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.addon-card-head b {
  display: block;
  font-size: 1.05rem;
}
.addon-card-head small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}
.addon-card-desc {
  flex: 1;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.addon-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.addon-card-meta {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}
.addon-tile {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, hsl(var(--hue) 70% 58%), hsl(calc(var(--hue) + 50) 70% 46%));
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
}
.addon-tile.big {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  font-size: 2rem;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}
.badge {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(123, 167, 199, 0.18);
  color: var(--ice);
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: 52px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 16px;
  left: 18px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--steel);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.85rem;
}
.steps b {
  display: block;
  margin-bottom: 6px;
}
.steps span {
  color: var(--muted);
  font-size: 0.92rem;
}
.crumbs {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}
.addon-title {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.addon-title h1 {
  margin: 0;
}
.addon-title .section-lede {
  margin: 8px 0 12px;
}
.addon-head {
  padding-bottom: 0;
}
.addon-body {
  padding-top: 48px;
}
.addon-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}
.addon-readme img {
  max-width: 100%;
}
.addon-side h4 {
  margin: 24px 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.addon-install {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.addon-install h4 {
  margin-top: 0;
}
.addon-install ol {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: 0.92rem;
}
.addon-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 24px 0 0;
  font-size: 0.92rem;
}
.addon-facts dt {
  color: var(--muted);
}
.addon-facts dd {
  margin: 0;
}
.addon-versions {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.addon-versions th,
.addon-versions td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.addon-versions th {
  color: var(--muted);
  font-weight: 500;
}
@media (max-width: 1000px) {
  .steps {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 820px) {
  .addon-layout {
    grid-template-columns: 1fr;
  }
  .market-sort {
    margin-left: 0;
  }
}
@media (max-width: 560px) {
  .steps {
    grid-template-columns: 1fr;
  }
  .addon-title {
    flex-direction: column;
  }
}

/* ---- icons and artwork on the landing page (icons.js, site/art) ---- */

.strip-row div {
  position: relative;
  padding-left: 64px;
}
.strip-row div > .i {
  position: absolute;
  left: 20px;
  top: 26px;
  width: 28px;
  height: 28px;
  color: var(--steel);
}
.card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(94, 162, 255, 0.2), rgba(143, 123, 255, 0.2));
  border: 1px solid rgba(123, 167, 199, 0.3);
  color: var(--ice);
  transition: transform 0.2s ease;
}
.card:hover .card-icon {
  transform: translateY(-2px) rotate(-4deg);
}
.card h3 {
  margin-top: 0;
}

/* Engines: brand marks in their colours. */
.engine-godot { --brand: #478cbf; }
.engine-unity { --brand: #ffffff; }
.engine-phaser { --brand: #8dd35f; }
.engine-javascript { --brand: #f7df1e; }
.engine-rust { --brand: #f74c00; }
.engines {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin: 28px 0 18px;
}
.engine {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.engine:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}
.engine .m {
  flex: none;
  width: 28px;
  height: 28px;
  color: var(--brand);
}
.engine b {
  display: block;
  font-size: 0.98rem;
}
.engine small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}
.runtimes-split {
  align-items: center;
}
.runtime-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 460px;
  border-radius: 24px;
  background:
    radial-gradient(50% 50% at 50% 55%, rgba(94, 162, 255, 0.28), transparent 70%),
    radial-gradient(40% 40% at 70% 20%, rgba(143, 123, 255, 0.2), transparent 70%);
}
.runtime-art img {
  position: relative;
  z-index: 1;
  height: 440px;
  width: auto;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.5));
}
.orbit {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(23, 24, 27, 0.9);
  backdrop-filter: blur(6px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  animation: bob 5s ease-in-out infinite;
}
.orbit .m {
  width: 32px;
  height: 32px;
}
.o1 { left: 8%; top: 14%; color: #478cbf; }
.o2 { right: 8%; top: 10%; color: #fff; animation-delay: -1s; }
.o3 { right: 4%; top: 52%; color: #8dd35f; animation-delay: -2s; }
.o4 { left: 4%; top: 56%; color: #f7df1e; animation-delay: -3s; }
.o5 { left: 16%; bottom: 6%; color: #f74c00; animation-delay: -4s; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Downloads: a mark for each platform. */
.dl.with-icon {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: start;
  column-gap: 14px;
  row-gap: 4px;
  align-items: start;
}
.dl.with-icon .dl-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}
.dl.with-icon .dl-icon svg {
  width: 24px;
  height: 24px;
}
.dl .dl-icon.dl-globe { color: #8f7bff; }
.dl .dl-icon.dl-windows { color: #3fa9f5; }
.dl .dl-icon.dl-apple { color: #f4f4f5; }
.dl .dl-icon.dl-linux { color: #fcc624; }
.dl .dl-icon.dl-bot { color: var(--ice); }
.dl .dl-icon.dl-unity { color: #fff; }
.dl .dl-icon.dl-godot { color: #478cbf; }
.dl .dl-icon.dl-phaser { color: #8dd35f; }

/* Community: NILA next to the call to join. */
.community-row {
  position: relative;
}
.community-art {
  flex: none;
  height: 300px;
  width: auto;
  margin-left: auto;
  filter: drop-shadow(0 24px 32px rgba(0, 0, 0, 0.5));
}

@media (max-width: 820px) {
  .runtime-art {
    min-height: 360px;
  }
  .runtime-art img {
    height: 340px;
  }
  .community-art {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .orbit {
    animation: none;
  }
}

/* ---- Coming from DragonBones (dragonbones.js) ---- */

.db-section {
  background:
    radial-gradient(50% 70% at 78% 50%, rgba(247, 76, 0, 0.12), transparent 70%),
    radial-gradient(40% 60% at 70% 80%, rgba(94, 162, 255, 0.12), transparent 70%);
  border-bottom: 1px solid var(--line);
}
.db-split {
  align-items: center;
}
.db-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.db-stage canvas {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(60% 18% at 50% 88%, rgba(0, 0, 0, 0.55), transparent 70%),
    radial-gradient(70% 70% at 50% 45%, rgba(94, 162, 255, 0.16), transparent 70%),
    linear-gradient(180deg, #14161b, #0c0d10);
  transition: opacity 0.2s;
}
.db-section.loading .db-stage canvas {
  opacity: 0.4;
}
.db-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.db-moves button {
  height: 28px;
  font-size: 0.82rem;
}
.db-credit {
  margin: 0;
  font-size: 0.78rem;
}

/* ---- Comparison pages (compare/compare.js) ---- */

.vs-head .cta {
  margin-top: 24px;
}
.vs-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.vs-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.vs-table th,
.vs-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.vs-table tr:last-child th,
.vs-table tr:last-child td {
  border-bottom: 0;
}
.vs-table thead th {
  background: var(--bg-alt);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.vs-table thead th.ours {
  color: var(--ice);
}
.vs-table tbody th {
  width: 18%;
  color: var(--text);
  font-weight: 600;
}
.vs-table td.ours {
  width: 41%;
  background: rgba(94, 162, 255, 0.07);
  color: var(--text);
}
.vs-table td {
  color: var(--muted);
}
.vs-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 56px 0;
}
.vs-list {
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}
.vs-faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}
.vs-faq details {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.vs-faq summary {
  cursor: pointer;
  font-weight: 600;
}
.vs-faq p {
  margin: 10px 0 0;
  color: var(--muted);
}
.vs-others {
  margin-top: 24px;
}
@media (max-width: 820px) {
  .vs-columns {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .vs-table th,
  .vs-table td {
    padding: 10px 12px;
    font-size: 0.88rem;
  }
}
.vs-why {
  list-style: none;
  padding-left: 0;
}
.vs-why li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: var(--text);
}
.vs-why li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #6fdc9f;
  font-weight: 700;
}

/* ---- Switching to Rigby2D (home) ---- */
.switch-section {
  border-bottom: 1px solid var(--line);
}
.switch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.switch-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.switch-card:hover {
  border-color: var(--steel);
  transform: translateY(-2px);
}
.switch-card b {
  font-size: 1.15rem;
}
.switch-card span {
  flex: 1;
  color: var(--muted);
  font-size: 0.93rem;
}
.switch-card em {
  font-style: normal;
  font-weight: 600;
  color: var(--ice);
  font-size: 0.92rem;
}
@media (max-width: 1000px) {
  .switch-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .switch-grid {
    grid-template-columns: 1fr;
  }
}
