/* Chaotic Game Studios — shared site stylesheet (2026-09-12).
 *
 * Every page loads this one file, including the legal pages. That is the
 * point: privacy.html and terms.html are the two most-visited pages on the
 * site by roughly 40x (store listings link them), and they used to be bare
 * documents with no navigation — a dead end for the several hundred players
 * a week who land there. They now wear the same shell as everything else.
 *
 * Dark-only on purpose: the studio brand is a near-black ground with the
 * red-orange accent, and every product site matches. No light palette.
 * Display face is the same Ubuntu Sans Condensed the Strike-Command site
 * uses, self-hosted — no Google Fonts, no third-party request.
 */

@font-face {
  font-family: "CGS Condensed";
  src: url("ubuntusans-condensed-800.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "CGS Condensed";
  src: url("ubuntusans-condensed-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --ink: #08080c;
  --surface: #101017;
  --surface-2: #16161f;
  --raised: #1d1d28;
  --line: #24242f;
  --line-soft: #1a1a24;
  --text: #f5f5f8;
  --muted: #9a9aa8;
  --dim: #6a6a7a;
  --brand: #ff4d3d;
  --brand-hi: #ff7a6b;
  --ember: #ff9a3d;
  --live: #2fd47a;
  --display: "CGS Condensed", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --sys: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 16px;
  --r-sm: 10px;
  --max: 1120px;
  --pad: clamp(18px, 4vw, 28px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sys);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The studio word is "chaotic" — so the ground is not flat. A single fixed
 * layer of two slow, offset radial embers, well under the content. Cheap
 * (no repaint on scroll, no JS) and it stops the page reading as a template. */
body::before {
  content: "";
  position: fixed;
  inset: -20vh -10vw;
  z-index: -2;
  background:
    radial-gradient(38vw 38vw at 12% 4%, rgba(255, 77, 61, 0.13), transparent 62%),
    radial-gradient(30vw 30vw at 92% 22%, rgba(255, 154, 61, 0.08), transparent 60%);
  animation: drift 34s ease-in-out infinite alternate;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 3px 3px;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(2.5%, 2%, 0) scale(1.07); }
}

a { color: var(--brand); text-decoration: none; font-weight: 600; }
a:hover { color: var(--brand-hi); text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* ------------------------------- masthead ------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 8, 12, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.masthead .bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand img { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.brand b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}
.brand b i { color: var(--brand); font-style: normal; }
.navlinks { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.navlinks a {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 8px;
  white-space: nowrap;
}
.navlinks a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.navlinks a.cta {
  color: var(--ink);
  background: var(--brand);
}
.navlinks a.cta:hover { background: var(--brand-hi); color: var(--ink); }

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

.hero { padding: clamp(56px, 11vw, 104px) 0 clamp(34px, 6vw, 56px); }
.hero .eyebrow {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12.5px;
  color: var(--brand);
  margin: 0 0 14px;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(42px, 9.5vw, 92px);
  line-height: 0.94;
  letter-spacing: -0.005em;
  margin: 0 0 20px;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  color: var(--brand);
  /* the one flourish: the brand word flickers awake once, then holds */
  animation: wake 1100ms steps(1) 1;
}
@keyframes wake {
  0%, 12%, 26% { opacity: 0.25; }
  6%, 20%, 100% { opacity: 1; }
}
.hero p.lede {
  font-size: clamp(16px, 2.1vw, 19px);
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 26px;
}
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 11px;
  font-weight: 800;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn.primary { background: var(--brand); color: var(--ink); }
.btn.primary:hover { background: var(--brand-hi); color: var(--ink); text-decoration: none; }
.btn.ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn.ghost:hover { border-color: var(--brand); color: var(--text); text-decoration: none; }

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

section { padding: clamp(34px, 6vw, 60px) 0; }
.sec-head { margin-bottom: 22px; }
.sec-head h2 {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0.01em;
  margin: 0 0 6px;
  text-wrap: balance;
}
.sec-head p { color: var(--muted); margin: 0; font-size: 15px; max-width: 66ch; }
.rule { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

/* --------------------------------- games -------------------------------- */

.games { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }

.game {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .16s ease, transform .16s ease;
}
.game:hover { border-color: rgba(255, 77, 61, 0.5); transform: translateY(-2px); }
.game .top { display: flex; gap: 13px; align-items: flex-start; }
.game .icon {
  width: 62px; height: 62px; border-radius: 15px; flex: none;
  border: 1px solid var(--line); background: var(--surface-2);
}
.game h3 {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 19px;
  letter-spacing: 0.015em;
  margin: 0 0 3px;
  line-height: 1.12;
}
.game h3 a { color: var(--text); }
.game h3 a:hover { color: var(--brand); text-decoration: none; }
.game .desc { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.55; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.chip.live { color: var(--live); border-color: rgba(47, 212, 122, .38); background: rgba(47, 212, 122, .1); }
.chip.dev  { color: var(--ember); border-color: rgba(255, 154, 61, .34); background: rgba(255, 154, 61, .09); }

.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.shots img {
  width: 100%; height: auto; border-radius: 8px;
  border: 1px solid var(--line);
}
.shots a:hover img { border-color: var(--brand); }

.storelinks { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; font-weight: 700; }

/* ------------------------------ generic card ---------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(18px, 3vw, 26px);
}
.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* --------------------------- long-form documents ------------------------ */

.doc { max-width: 76ch; }
.doc h1 {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(30px, 5.5vw, 44px);
  margin: 0 0 6px;
  line-height: 1.05;
}
.doc .updated { color: var(--dim); font-size: 13.5px; margin: 0 0 26px; }
.doc h2 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 19px;
  letter-spacing: 0.03em;
  margin: 32px 0 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--text);
}
.doc h3 { font-size: 15.5px; margin: 20px 0 6px; }
.doc p, .doc li { color: #d8d8e2; font-size: 15.5px; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc code {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; font-size: 13.5px;
}
.doc table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14.5px; }
.doc th, .doc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
.doc th { color: var(--muted); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; }

/* Wide content must scroll inside itself, never the page. */
.scroll-x { overflow-x: auto; }

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

footer.site {
  margin-top: clamp(40px, 7vw, 72px);
  border-top: 1px solid var(--line-soft);
  background: rgba(16, 16, 23, 0.5);
}
footer.site .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 34px var(--pad) 40px;
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
footer.site h4 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 12px;
  color: var(--dim);
  margin: 0 0 10px;
}
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { margin-bottom: 7px; }
footer.site li a { color: var(--muted); font-weight: 600; font-size: 14px; }
footer.site li a:hover { color: var(--brand); text-decoration: none; }
footer.site .legal {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) 34px;
  color: var(--dim);
  font-size: 12.5px;
}

/* -------------------------------- a11y ---------------------------------- */

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand); color: var(--ink);
  padding: 10px 16px; font-weight: 800; border-radius: 0 0 8px 0; z-index: 100;
}
.skip:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .hero h1 em { animation: none; }
  * { transition: none !important; }
}
