:root {
  color-scheme: dark;
  --bg: #0f1115;
  --bg-elev: #161a22;
  --bg-elev-2: #1d222c;
  --border: #262c38;
  --border-strong: #3a4150;
  --text: #e6e8ee;
  --text-dim: #9aa3b2;
  --accent: #6ea8ff;
  --accent-dim: #2b4a80;
  --danger: #ff6b6b;
  --good: #69d08a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 20% -10%, #1b2233 0%, transparent 60%),
    radial-gradient(900px 500px at 120% 10%, #1a2a2a 0%, transparent 55%), var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  margin-bottom: 28px;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.topbar .brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.topbar nav {
  display: flex;
  gap: 14px;
  font-size: 14px;
}

.topbar nav a {
  color: var(--text-dim);
}

.topbar nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.hero {
  padding: 32px 8px 24px;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin: 0 0 10px;
  line-height: 1.1;
  letter-spacing: -0.3px;
}

.hero p {
  color: var(--text-dim);
  max-width: 56ch;
  margin: 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 32px 4px 14px;
}

.section-title h2 {
  font-size: 18px;
  margin: 0;
  letter-spacing: 0.2px;
}

.section-title .muted {
  color: var(--text-dim);
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  color: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  text-decoration: none;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.card .thumb {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  background: #0c0f15;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 13px;
  overflow: hidden;
  position: relative;
}

.card h3 {
  margin: 4px 0 0;
  font-size: 16px;
}

.card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
}

.stage .hud {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.hud .stat {
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #0d1018;
  font-family: var(--font-mono);
  font-size: 13px;
}

.hud .stat b {
  color: var(--text);
  font-weight: 600;
}

.hud .stat span {
  color: var(--text-dim);
}

.btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: #232a38;
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn:hover {
  background: #2b3448;
  border-color: #4a5368;
}

.btn.primary {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #eaf1ff;
}

.btn.primary:hover {
  background: #365ea3;
}

canvas {
  background: #0b0d12;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: block;
  max-width: 100%;
  touch-action: none;
}

.help {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  max-width: 60ch;
}

.help kbd {
  font-family: var(--font-mono);
  background: #0d1018;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
}

footer {
  margin-top: 40px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

.touchpad {
  display: none;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 56px);
  gap: 6px;
  justify-content: center;
}

.touchpad button {
  border: 1px solid var(--border-strong);
  background: #232a38;
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 18px;
  cursor: pointer;
}

.touchpad button:active {
  background: #2b3448;
}

.touchpad .up { grid-column: 2; grid-row: 1; }
.touchpad .left { grid-column: 1; grid-row: 2; }
.touchpad .right { grid-column: 3; grid-row: 2; }
.touchpad .down { grid-column: 2; grid-row: 3; }

@media (pointer: coarse) {
  .touchpad { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== Landing page ===== */

.landing {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin-top: 12px;
}

.hero-big {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 36px;
  padding: 28px 4px 12px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  color: #cfe0ff;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  background: rgba(110, 168, 255, 0.1);
  margin-bottom: 18px;
}

.hero-big h1 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.hero-big h1 .accent {
  background: linear-gradient(120deg, #6ea8ff 0%, #b88cff 55%, #7ed3c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-big .lead {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 54ch;
  margin: 0 0 26px;
}

.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn.large {
  padding: 12px 22px;
  font-size: 15px;
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}

.btn.ghost:hover {
  background: #1a2030;
  color: var(--text);
}

.hero-art {
  aspect-ratio: 1 / 1;
  position: relative;
  display: grid;
  place-items: center;
}

.hero-art svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-art .drift-a {
  transform-origin: 150px 150px;
  animation: drift 14s ease-in-out infinite alternate;
}

.hero-art .drift-b {
  transform-origin: 150px 150px;
  animation: drift 18s ease-in-out -3s infinite alternate-reverse;
}

.hero-art .orbit-a {
  transform-origin: 150px 150px;
  animation: orbit 30s linear infinite;
}

.hero-art .orbit-b {
  transform-origin: 150px 150px;
  animation: orbit 42s linear reverse infinite;
}

.hero-art .pulse {
  transform-origin: center;
  animation: pulse 4.5s ease-in-out infinite;
}

@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(6px, -8px) rotate(8deg); }
}

@keyframes orbit {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50%      { transform: scale(1.06); opacity: 1; }
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.info-card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
}

.info-card .info-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(110, 168, 255, 0.12);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 16px;
  margin-bottom: 12px;
}

.info-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.info-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.5;
}

.featured .section-title { margin-top: 0; }

.feature-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.feature-art {
  position: relative;
  min-height: 220px;
  background: linear-gradient(135deg, #aad76b 0%, #88b944 100%);
  overflow: hidden;
}

.feature-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.feature-body {
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.feature-body h3 {
  margin: 10px 0 10px;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.feature-body p {
  margin: 0 0 18px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 46ch;
}

.feature-cta {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}

@media (max-width: 820px) {
  .hero-big {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .hero-art {
    max-width: 300px;
    margin: 0 auto;
  }
  .feature-card {
    grid-template-columns: 1fr;
  }
  .feature-art {
    min-height: 180px;
  }
}

