/* Raster Bit Studios
   Layout idea: everything sits on a visible 8px raster grid, like a sprite sheet.
   Purple is the world, green is the "bit" that brings it to life. */
:root {
  --void: #170b2e;        /* Void Purple: page background */
  --deep: #241445;        /* Deep Purple: panels and cards */
  --electric: #9b5cff;    /* Electric Purple: primary brand colour */
  --phosphor: #3dff8f;    /* Phosphor Green: the bit, actions, highlights */
  --mint: #b6ffd8;        /* Mint: soft highlight on green */
  --lilac: #f3eeff;       /* Lilac White: main text */
  --muted: #a79bc8;       /* Muted Lilac: secondary text */
  --line: #3a2766;        /* Grid lines and borders */

  --font-display: "Silkscreen", "Courier New", monospace;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;

  --step: 8px;            /* The raster: every size is a multiple of 8 */
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background-color: var(--void);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: calc(var(--step) * 4) calc(var(--step) * 4);
  background-position: -1px -1px;
  background-attachment: fixed;
  color: var(--lilac);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
/* Fade the grid so it reads as texture, not graph paper. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 20%, rgba(23, 11, 46, 0.55), rgba(23, 11, 46, 0.92) 70%);
  pointer-events: none;
  z-index: -1;
}

a { color: var(--phosphor); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 3px;
}
img { max-width: 100%; display: block; }

.wrap {
  width: min(1080px, 100% - 32px);
  margin-inline: auto;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
  letter-spacing: 0.02em;
}
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.125rem; }
p { margin: 0; max-width: 65ch; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--phosphor);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(23, 11, 46, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--lilac);
}
.brand img { width: 32px; height: 32px; image-rendering: pixelated; }
.brand span { font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.04em; }
.nav { display: flex; gap: 24px; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}
.nav a:hover { color: var(--phosphor); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  text-decoration: none;
  border: 2px solid var(--phosphor);
  color: var(--void);
  background: var(--phosphor);
  box-shadow: 4px 4px 0 var(--electric);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--electric); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--electric); }
.btn.ghost {
  background: transparent;
  color: var(--phosphor);
  box-shadow: 4px 4px 0 var(--deep);
}
.btn-row { display: flex; gap: 16px; flex-wrap: wrap; }

/* --- Hero --- */
.hero { padding-block: 72px 56px; }
.hero .wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 48px;
  align-items: center;
}
.mark-frame {
  position: relative;
  width: 196px;
  aspect-ratio: 1;
  padding: 28px;
  border: 2px solid var(--line);
  background: var(--deep);
  overflow: hidden;
}
.mark-frame img { width: 100%; height: 100%; image-rendering: pixelated; }
/* The one moment of motion: a raster scanline sweeping the mark. */
.mark-frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  top: 0;
  background: linear-gradient(transparent, rgba(61, 255, 143, 0.55), transparent);
  animation: scan 3.2s linear infinite;
}
@keyframes scan {
  from { transform: translateY(-8px); }
  to { transform: translateY(204px); }
}
.hero h1 { font-size: clamp(2.25rem, 6vw, 4rem); }
.hero h1 .bit { color: var(--phosphor); }
.hero .lede { font-size: 1.25rem; color: var(--lilac); margin-top: 16px; }
.hero .sub { color: var(--muted); margin-top: 8px; }
.hero .btn-row { margin-top: 32px; }

/* --- Sections --- */
section { padding-block: 56px; }
.section-head { display: grid; gap: 8px; margin-bottom: 32px; }

/* --- Games --- */
.games { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.game-card {
  background: var(--deep);
  border: 2px solid var(--line);
  display: grid;
}
.game-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 2px solid var(--line); }
.game-body { padding: 24px; display: grid; gap: 16px; }
.game-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 8px;
  border: 1px solid currentColor;
  color: var(--phosphor);
  letter-spacing: 0.06em;
}
.pill.purple { color: var(--electric); }
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
  font-size: 0.9375rem;
}
.facts div { border-left: 2px solid var(--electric); padding-left: 12px; }
.facts dt { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }
.facts dd { margin: 0; }
.game-card.lab {
  place-content: center;
  text-align: center;
  padding: 32px 24px;
  border-style: dashed;
  gap: 16px;
}
.lab-grid {
  display: grid;
  grid-template-columns: repeat(5, 16px);
  gap: 4px;
  justify-content: center;
}
.lab-grid span { width: 16px; height: 16px; background: var(--line); }
.lab-grid span.on { background: var(--electric); }
.lab-grid span.bit { background: var(--phosphor); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.lab p { color: var(--muted); margin-inline: auto; }

/* --- About --- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.about-copy { display: grid; gap: 16px; }
.pillars { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.pillars li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 16px;
  background: var(--deep);
  border: 1px solid var(--line);
}
.pillars .px {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-family: var(--font-display);
  color: var(--void);
  background: var(--phosphor);
}
.pillars li:nth-child(2) .px { background: var(--electric); color: var(--lilac); }
.pillars li:nth-child(3) .px { background: var(--mint); }
.pillars h3 { margin-bottom: 4px; }
.pillars p { color: var(--muted); font-size: 0.9375rem; }

/* --- Follow links --- */
.links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.link-tile {
  display: grid;
  gap: 8px;
  padding: 24px;
  background: var(--deep);
  border: 2px solid var(--line);
  text-decoration: none;
  color: var(--lilac);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.link-tile:hover { border-color: var(--phosphor); transform: translateY(-2px); }
.link-tile .icon { width: 32px; height: 32px; color: var(--phosphor); }
.link-tile strong { font-family: var(--font-display); font-weight: 700; }
.link-tile small { color: var(--muted); font-family: var(--font-mono); font-size: 0.75rem; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--line); padding-block: 32px; margin-top: 32px; }
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--phosphor); }

/* --- Coming soon --- */
.soon {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 64px;
}
.soon-inner { display: grid; gap: 24px; justify-items: center; }
.soon h1 { font-size: clamp(2.5rem, 9vw, 5.5rem); }
.soon h1 .cursor { color: var(--phosphor); animation: blink 1s steps(2) infinite; }
.soon p { color: var(--muted); }

/* --- Brand kit --- */
.kit-section { display: grid; gap: 24px; }
.kit-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.panel { background: var(--deep); border: 1px solid var(--line); padding: 24px; display: grid; gap: 12px; }
.logo-stage { display: grid; place-items: center; min-height: 160px; padding: 24px; border: 1px solid var(--line); }
.logo-stage.dark { background: var(--void); }
.logo-stage.light { background: var(--lilac); }
.logo-stage.green { background: var(--phosphor); }
.lockup { display: flex; align-items: center; gap: 16px; }
.lockup img { width: 56px; height: 56px; image-rendering: pixelated; }
.lockup .word { font-family: var(--font-display); line-height: 1; }
.lockup .word b { display: block; font-size: 1.5rem; }
.lockup .word i { font-style: normal; font-size: 0.8125rem; letter-spacing: 0.4em; }
.logo-stage.light .lockup .word { color: var(--void); }
.logo-stage.green .lockup .word { color: var(--void); }
.caption { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); }
.swatch { display: grid; border: 1px solid var(--line); }
.swatch .chip { height: 96px; }
.swatch .meta { padding: 16px; background: var(--deep); display: grid; gap: 4px; }
.swatch .meta strong { font-family: var(--font-display); font-size: 0.9375rem; }
.swatch code { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.type-sample { display: grid; gap: 8px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.type-sample:last-child { border-bottom: 0; }
.do-dont { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.do-dont ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); }
.do h3 { color: var(--phosphor); }
.dont h3 { color: #ff6b8a; }
.copy-hex {
  justify-self: start;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: transparent;
  color: var(--phosphor);
  border: 1px solid var(--line);
  padding: 4px 8px;
  cursor: pointer;
}
.copy-hex:hover { border-color: var(--phosphor); }

/* --- Phone widths --- */
@media (max-width: 820px) {
  .hero .wrap, .about, .games, .do-dont { grid-template-columns: 1fr; }
  .links { grid-template-columns: repeat(2, 1fr); }
  .mark-frame { width: 140px; padding: 20px; }
  @keyframes scan { to { transform: translateY(148px); } }
}
@media (max-width: 440px) {
  .links, .facts { grid-template-columns: 1fr; }
  .nav { gap: 16px; }
}
