/*
 * Snakoff design tokens. The ONLY place raw values live: every other stylesheet uses var(--…).
 * See docs/DESIGN.md for the reasoning.
 */

/* The display face: an original 5×7 bitmap font, hand-placed in src/world/glyphs.ts and compiled to
   a 2 kB webfont by scripts/make-pixel-font.ts. Only for short, loud words; sentences use the
   system font (no download, and long text in a pixel font is tiring). Sizes in multiples of 8 px
   keep every pixel on whole CSS pixels. */
@font-face {
  font-family: 'Snake Pixel';
  font-style: normal;
  font-display: block;
  font-weight: 400;
  src: url('../assets/pixel-CEnRslI3.woff') format('woff');
}
:root {
  /* Colour (Night 6, direction D): quiet dark sheets, warm ink, one ember accent (the snake's).
     The world carries the identity; the chrome stays out of its way. --c-bg follows the day's biome. */
  --c-bg: #0e0d14;
  --c-surface: #18161f;
  --c-surface-2: #23202c;
  --c-line: rgba(255, 241, 214, 0.1);
  --c-text: #fff1d6;
  --c-text-2: #b9ad9a;
  --c-text-3: #a09684;
  --c-accent: #f26a43;
  --c-accent-hi: #ff9a5c;
  --c-accent-ink: #1d0a0c;
  /* Accent used as text (links, small labels). */
  --c-accent-text: #ff9a5c;
  --c-accent-soft: rgba(242, 106, 67, 0.16);
  /* Earned-only things (champion, streak, podium): never the colour of anything on sale. */
  --c-gold: #f2c84a;
  /* Used sparingly: "you're out", crashes. */
  --c-warn: #f07a6a;
  --c-warn-soft: rgba(240, 122, 106, 0.14);
  /* Game-only colours (food, streak flame) never appear as UI chrome. */
  --c-food: #ffd65a;
  --c-scrim: rgba(8, 7, 12, 0.76);

  /* Type: the system font for sentences, the pixel face (--font-px) for loud words. */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-px: 'Snake Pixel', ui-monospace, monospace;
  --fs-s: 15px;
  --fs-m: 20px;
  --fs-l: 44px;
  /* 400: what the app has always rendered (the old Google Fonts link had no 500, so 500 fell back to 400). */
  --fw-regular: 400;
  --fw-bold: 700;
  --lh: 1.4;
  --lh-tight: 1.1;

  /* Spacing: a 4 px base. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* Shape: square, with stepped "pixel" corners (--step clips them) instead of rounding. */
  --r-s: 0;
  --r-m: 0;
  --r-pill: 0;
  --st: 4px;
  --step: polygon(0 var(--st), var(--st) var(--st), var(--st) 0, calc(100% - var(--st)) 0, calc(100% - var(--st)) var(--st), 100% var(--st), 100% calc(100% - var(--st)), calc(100% - var(--st)) calc(100% - var(--st)), calc(100% - var(--st)) 100%, var(--st) 100%, var(--st) calc(100% - var(--st)), 0 calc(100% - var(--st)));
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);

  /* Sizes. */
  --tap: 48px;
  --tap-l: 64px;
  --content: 480px;

  /* Motion: short, for feedback and transitions only. */
  --t-fast: 120ms;
  --t: 180ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

/* Direction D is dark only: the places are lit scenes, and a light sheet under them would glare. */

@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion='full']) {
    --t-fast: 0ms;
    --t: 0ms;
  }
}
:root[data-motion='reduced'] {
  --t-fast: 0ms;
  --t: 0ms;
}


/* Static pages (How to play, About, Privacy, Terms): same tokens as the app. */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: var(--fs-s);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
}
main {
  max-width: var(--content);
  margin: 0 auto;
  padding: calc(var(--safe-top) + var(--sp-5)) var(--sp-4) calc(var(--safe-bottom) + var(--sp-7));
  line-height: var(--lh);
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--c-text);
  text-decoration: none;
  font-weight: var(--fw-bold);
  font-size: var(--fs-m);
}
.brand b {
  color: var(--c-accent-text);
  font-weight: var(--fw-bold);
}
.play {
  background: var(--c-accent);
  color: var(--c-accent-ink);
  font-weight: var(--fw-bold);
  text-decoration: none;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
}
h1 {
  font-size: var(--fs-l);
  line-height: var(--lh-tight);
  margin: 0 0 var(--sp-4);
}
h2 {
  font-size: var(--fs-m);
  margin: var(--sp-6) 0 var(--sp-2);
}
p,
li {
  color: var(--c-text-2);
}
li + li {
  margin-top: var(--sp-2);
}
a {
  color: var(--c-accent-text);
}
.card {
  background: var(--c-surface);
  border-radius: var(--r-m);
  padding: var(--sp-1) var(--sp-4);
}
.note {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-s);
  background: var(--c-surface);
  color: var(--c-text-2);
}
table {
  width: 100%;
  border-collapse: collapse;
}
td,
th {
  text-align: left;
  padding: var(--sp-2) var(--sp-1);
  box-shadow: 0 1px 0 var(--c-line);
}
/* Status page: keep the check names on one line. */
.status th {
  white-space: nowrap;
  padding-right: var(--sp-4);
}
footer {
  margin-top: var(--sp-7);
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
footer a {
  color: var(--c-text-3);
  text-decoration: none;
}
/* Guides and press (static, SEO): the crumb, the Play now button, related links, media. */
.crumb {
  margin: 0 0 var(--sp-2);
}
.cta {
  margin: var(--sp-6) 0;
}
.cta .play {
  display: inline-block;
}
.more ul,
.guides {
  padding-left: var(--sp-4);
}
.press-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-weight: var(--fw-bold);
  font-size: var(--fs-l);
}
.press-logo b {
  color: var(--c-accent-text);
}
.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.shots li + li {
  margin-top: 0;
}
.shots img,
.clip video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-m);
  background: var(--c-surface);
}
.shots a {
  display: block;
}
.clip {
  margin: var(--sp-4) 0;
}
.clip video {
  max-width: 280px;
}

/* Night 30: the content site (scripts/build-content.ts), on top of the app's tokens and the static
   pages' base (src/pages/page.css): the pixel header, readable long text, tables, cards, the footer. */
.site {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--safe-top, 0px) + var(--sp-4)) var(--sp-4) calc(var(--safe-bottom, 0px) + var(--sp-7));
}
.site main {
  max-width: none;
  margin: 0;
  padding: 0;
  font-size: 17px;
  line-height: 1.6;
}
.px {
  font-family: var(--font-px);
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: none;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-5);
  /* A dithered pixel rule under the header, like the app's sheets. */
  background: linear-gradient(90deg, var(--c-line) 50%, transparent 0) 0 100% / 8px 4px repeat-x;
}
.site-header .brand {
  font-size: 24px;
  gap: var(--sp-3);
}
.site-header .brand img {
  image-rendering: pixelated;
}
.site-header .brand b {
  color: var(--c-accent-text);
  font-weight: 400;
}
.site-header .play {
  font-size: 16px;
  padding: var(--sp-3) var(--sp-5);
  clip-path: var(--step);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site h1 {
  font: 400 32px/1.25 var(--font-px);
  color: var(--c-text);
  margin: var(--sp-2) 0 var(--sp-4);
}
.site h2 {
  font-size: 22px;
  color: var(--c-text);
  margin: var(--sp-7) 0 var(--sp-3);
}
.site h3 {
  font-size: 18px;
  color: var(--c-text);
  margin: var(--sp-5) 0 var(--sp-2);
}
.site p,
.site li {
  color: var(--c-text-2);
}
.site p {
  margin: 0 0 var(--sp-4);
}
.site strong {
  color: var(--c-text);
}
.lede {
  font-size: 19px;
}
.crumb {
  font-size: 14px;
  color: var(--c-text-3);
}
.crumb a {
  color: var(--c-text-3);
}
.table {
  overflow-x: auto;
  margin: 0 0 var(--sp-4);
  background: var(--c-surface);
  clip-path: var(--step);
  padding: var(--sp-1) var(--sp-3);
}
.table table {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.table th {
  color: var(--c-text);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--sp-1) var(--sp-4);
  margin: 0 0 var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-surface);
  clip-path: var(--step);
}
.facts dt {
  color: var(--c-text-3);
}
.facts dd {
  margin: 0;
  color: var(--c-text);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-3);
  margin: 0 0 var(--sp-5);
  padding: 0;
  list-style: none;
}
.cards li {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-surface);
  clip-path: var(--step);
}
.cards a {
  font-weight: var(--fw-bold);
  text-decoration: none;
}
.cards p {
  margin: var(--sp-1) 0 0;
  font-size: 15px;
}
.board-img {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  image-rendering: pixelated;
  margin: 0 0 var(--sp-5);
  background: var(--c-surface);
}
.meta {
  color: var(--c-text-3);
  font-size: 14px;
}
.site-footer {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  display: block;
  background: linear-gradient(90deg, var(--c-line) 50%, transparent 0) 0 0 / 8px 4px repeat-x;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-3);
}
.site-footer a {
  color: var(--c-text-3);
  text-decoration: none;
  padding: var(--sp-1) 0;
}
.site-footer a:hover {
  color: var(--c-text);
  text-decoration: underline;
}
.fine {
  font-size: 13px;
  color: var(--c-text-3);
}
