/*
  Sim Game Studio: the one stylesheet for the whole site (the homepage, the game pages, the
  legal documents, the 404). Dark navy, off-white text, one lime accent used sparingly, blocky
  2px borders, square corners. A system font stack and no url() of any kind: the site loads
  nothing from anyone, and tests/site.test.ts fails if that changes.

  Colours: navy and lime are Pocket Goal's own (the icon's night sky and the keeper's kit).
  Every text pair below is at least 9:1 on its background; --line is 3:1 on --bg, as a border
  that marks something you can press has to be.
*/

:root {
  color-scheme: dark;

  --bg: #0b1430;
  --bg-deep: #08102a;
  --panel: #121d44;
  --line: #4a60a8;
  --line-soft: #2b3d80;
  --text: #eef1fb;
  --muted: #b7c0e3;
  --lime: #c6f03c;
  --lime-hover: #d9f77c;
  --lime-shade: #5f7a12;
  --ink: #0b1430;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 1rem;
}

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 var(--font);
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

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

/* ---- Links and focus --------------------------------------------------------------------- */

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--lime);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--lime);
}

:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}

/* ---- Layout ------------------------------------------------------------------------------ */

.wrap {
  width: min(100% - 2 * var(--gutter), 64rem);
  margin-inline: auto;
}

main.wrap {
  padding-block: clamp(2rem, 6vw, 4rem);
}

/* ---- Header ------------------------------------------------------------------------------ */

.site-header {
  background: var(--bg-deep);
  border-bottom: 2px solid var(--line);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-block: 0.35rem;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--lime);
}

.brand img {
  flex: none;
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.25rem;
}

.site-nav a {
  display: inline-block;
  padding-block: 0.6rem;
  color: var(--text);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--lime);
  text-decoration: underline;
  text-decoration-color: var(--lime);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

/* ---- Footer ------------------------------------------------------------------------------ */

.site-footer {
  background: var(--bg-deep);
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  display: grid;
  gap: 0.5rem;
  padding-block: 1.75rem;
}

.site-footer p {
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.footer-nav a,
.site-footer p a {
  display: inline-block;
  padding-block: 0.15rem;
}

/* ---- Headings and text ------------------------------------------------------------------- */

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
}

h2 {
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem);
}

h3 {
  font-size: 1.1875rem;
}

/* A small lime square before every section title: the one place the accent repeats. */
main h2::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.55em;
  background: var(--lime);
  vertical-align: 0.05em;
}

p {
  margin: 0 0 1rem;
}

.eyebrow,
.game-kicker,
.doc-kicker {
  margin: 0 0 0.75rem;
  color: var(--lime);
  font: 700 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lede {
  max-width: 40ch;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  line-height: 1.5;
}

/* ---- Buttons and badges ------------------------------------------------------------------ */

.button {
  display: inline-block;
  min-height: 2.75rem;
  padding: 0.6rem 1.15rem;
  background: var(--lime);
  border: 2px solid var(--lime);
  box-shadow: 4px 4px 0 var(--lime-shade);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.4;
  text-decoration: none;
  transition: transform 80ms steps(2), box-shadow 80ms steps(2);
}

.button:hover {
  background: var(--lime-hover);
  border-color: var(--lime-hover);
  color: var(--ink);
}

.button:active {
  box-shadow: 1px 1px 0 var(--lime-shade);
  transform: translate(3px, 3px);
}

.badge,
.status {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.25rem 0.65rem;
  border: 2px solid var(--lime);
  color: var(--lime);
  font: 700 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Homepage ---------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding-bottom: 1rem;
}

.hero h1 {
  margin-bottom: 0.4em;
}

.hero .lede {
  margin-bottom: 0;
}

.hero-mark {
  display: block;
  width: 9rem;
  height: 9rem;
  image-rendering: pixelated;
}

main > section,
.game > section {
  margin-top: clamp(2.5rem, 7vw, 4rem);
  scroll-margin-top: 1rem;
}

main > :first-child {
  margin-top: 0;
}

main > section > :last-child,
.game > section > :last-child {
  margin-bottom: 0;
}

.game-card {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.5rem;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 var(--bg-deep);
}

.game-icon {
  display: block;
  width: 100%;
  border: 2px solid var(--line);
  image-rendering: pixelated;
}

.game-body > :last-child {
  margin-bottom: 0;
}

.game-body h3 {
  margin-bottom: 0.35em;
  font-size: 1.5rem;
}

.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 1rem 0 0;
  padding: 0;
  font-size: 0.9375rem;
  list-style: none;
}

.doc-links a {
  display: inline-block;
  padding-block: 0.15rem;
}

.mail {
  font-size: clamp(1.125rem, 1rem + 1vw, 1.5rem);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ---- Game page --------------------------------------------------------------------------- */

.game-hero {
  display: block;
  width: 100%;
  margin-bottom: 2rem;
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 var(--bg-deep);
  image-rendering: pixelated;
}

.game-head .lede {
  max-width: 44ch;
  margin-bottom: 1.25rem;
}

.steps,
.features {
  margin: 1.25rem 0 0;
  padding: 0;
}

.steps {
  display: grid;
  gap: 1rem;
  list-style: none;
  counter-reset: step;
  max-width: 46rem;
}

.steps li {
  position: relative;
  min-height: 2.5rem;
  padding-left: 3.5rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--lime);
  color: var(--ink);
  font: 800 1.125rem/1 var(--mono);
}

.features {
  display: grid;
  gap: 0.6rem;
  max-width: 46rem;
  padding-left: 1.4rem;
  list-style: square;
}

.features li::marker {
  color: var(--lime);
}

.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 17rem));
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.shots figure {
  margin: 0;
}

.shots img {
  display: block;
  width: 100%;
  border: 2px solid var(--line);
  image-rendering: pixelated;
}

.shots figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.9375rem;
  text-align: center;
}

.cta-links {
  margin: 0 0 1rem;
}

/* ---- Notes ------------------------------------------------------------------------------- */

.note {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--panel);
  border: 2px solid var(--line);
  border-left: 8px solid var(--lime);
}

.note > :first-child {
  margin-top: 0;
}

.note > :last-child {
  margin-bottom: 0;
}

.note-title {
  margin-bottom: 0.4rem;
  font-size: 1.0625rem;
}

/* ---- Legal documents --------------------------------------------------------------------- */

.doc {
  max-width: 70ch;
  margin-inline: auto;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.doc h1 {
  margin-bottom: 0.3em;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 2.75rem);
}

.doc-kicker {
  margin-bottom: 0.5rem;
}

.doc-meta {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2.5rem;
}

.doc-nav a {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border: 2px solid var(--line);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-decoration: none;
}

.doc-nav a:hover {
  border-color: var(--lime);
  color: var(--lime);
}

[aria-current="page"] {
  font-weight: 800;
}

.doc-nav [aria-current="page"] {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}

.doc section {
  margin-top: 2.75rem;
  scroll-margin-top: 1rem;
}

.doc h2 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
}

.doc h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1875rem;
}

.doc p,
.doc ul,
.doc ol,
.doc dl,
.doc blockquote {
  margin: 0 0 1rem;
}

.doc ul,
.doc ol {
  padding-left: 1.5rem;
}

.doc ul {
  list-style: square;
}

.doc li::marker {
  color: var(--lime);
}

.doc li + li {
  margin-top: 0.4rem;
}

.doc li > ul,
.doc li > ol {
  margin-top: 0.4rem;
  margin-bottom: 0;
}

.doc a {
  overflow-wrap: anywhere;
}

.doc strong {
  font-weight: 700;
}

.doc code {
  padding: 0.1em 0.35em;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  font: 0.9em var(--mono);
}

.doc blockquote {
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 4px solid var(--line);
  color: var(--muted);
}

.doc hr {
  margin: 2rem 0;
  border: 0;
  border-top: 2px solid var(--line-soft);
}

/* The table is its own scroll box, so a wide one scrolls sideways on a phone instead of
   pushing the page wider than the screen. */
.doc-table {
  display: block;
  max-width: 100%;
  margin: 0 0 1.5rem;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.doc-table caption {
  padding-bottom: 0.5rem;
  color: var(--muted);
  text-align: left;
}

.doc-table th,
.doc-table td {
  min-width: 8rem;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.doc-table th {
  background: var(--panel);
  font-weight: 700;
}

/* ---- 404 --------------------------------------------------------------------------------- */

.not-found {
  max-width: 40rem;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  margin: 1.5rem 0;
}

/* ---- Phones ------------------------------------------------------------------------------ */

@media (max-width: 40rem) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hero-mark {
    order: -1;
    width: 5rem;
    height: 5rem;
  }

  .game-card {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
  }

  .game-icon {
    width: 6rem;
  }

  .shots {
    grid-template-columns: minmax(0, 18rem);
    gap: 2rem;
  }

  .game-hero,
  .game-card {
    box-shadow: 4px 4px 0 var(--bg-deep);
  }

  /* Columns this wide read as sentences; the table scrolls sideways instead of squeezing them. */
  .doc-table th,
  .doc-table td {
    min-width: 10rem;
  }
}

@media (max-width: 30rem) {
  .site-nav {
    gap: 0 1rem;
  }

  .doc {
    font-size: 1rem;
    line-height: 1.7;
  }
}

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

/* A legal page is the kind of page that gets printed: plain black on white, no chrome. */
@media print {
  :root {
    --bg: #fff;
    --bg-deep: #fff;
    --panel: #fff;
    --line: #666;
    --line-soft: #999;
    --text: #000;
    --muted: #333;
    --lime: #000;
    --ink: #fff;
  }

  .site-header,
  .site-footer,
  .doc-nav {
    display: none;
  }

  a {
    text-decoration-color: currentcolor;
  }
}
