/*
 * Heist in 30 - legal and support pages. One stylesheet, no framework, no external fonts
 * (a privacy page should not send the reader's IP to a font CDN).
 *
 * Colors, spacing and radii are copied from packages/heist_design/lib/src/tokens.dart
 * (HeistPalette.light / HeistPalette.dark, HeistSpace, HeistRadius, HeistStroke) - kierunek B
 * "Skok stulecia". Keep them in sync by hand when the tokens change.
 */

:root {
  color-scheme: light dark;

  /* HeistPalette.light */
  --bg: #f3e8d8;
  --surface: #fff9f0;
  --surface-raised: #e9dac3;
  --outline: #1f1a16;
  --text: #1f1a16;
  --text-muted: #5c5046;
  --accent: #2445c2;
  --on-accent: #ffffff;
  --loot: #eab22a;
  --on-loot: #1f1a16;
  --shadow: #1f1a16;
  --paper-dot: rgba(31, 26, 22, 0.075);

  /* HeistSpace */
  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 12px;
  --space-l: 16px;
  --space-xl: 24px;
  --space-xxl: 32px;

  /* HeistRadius, HeistStroke */
  --radius-m: 12px;
  --radius-l: 16px;
  --stroke-ink: 2px;

  /* HeistFont sizes (body 16, caption 13, title 22) */
  --font-body: 16px;
  --font-caption: 13px;
  --font-title: 22px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* HeistPalette.dark */
    --bg: #1b1420;
    --surface: #261d2e;
    --surface-raised: #33283d;
    --outline: #f3e6d3;
    --text: #f3e6d3;
    --text-muted: #bcad9b;
    --accent: #9db0ff;
    --on-accent: #1b1420;
    --loot: #ffd25e;
    --on-loot: #1b1420;
    --shadow: rgba(0, 0, 0, 0.55);
    --paper-dot: rgba(243, 230, 211, 0.05);
  }
}

* {
  box-sizing: border-box;
}

/* `hidden` must win over any display rule below (store buttons stay hidden until publication). */
[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--paper-dot) 1px, transparent 1px);
  background-size: 18px 18px;
  color: var(--text);
  font: 400 var(--font-body) / 1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-l) var(--space-l) var(--space-xxl);
  padding-left: max(var(--space-l), env(safe-area-inset-left));
  padding-right: max(var(--space-l), env(safe-area-inset-right));
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s) var(--space-l);
  margin-bottom: var(--space-xl);
}

.brand {
  display: inline-block;
  padding: var(--space-xs) var(--space-m);
  border: var(--stroke-ink) solid var(--outline);
  border-radius: var(--radius-m);
  background: var(--loot);
  color: var(--on-loot);
  box-shadow: 3px 3px 0 var(--shadow);
  font-weight: 800;
  font-stretch: semi-expanded;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-m);
  font-size: var(--font-caption);
}

nav a {
  color: var(--text);
}

nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: none;
}

.card {
  padding: var(--space-xl);
  border: var(--stroke-ink) solid var(--outline);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--shadow);
}

h1 {
  margin: 0 0 var(--space-xs);
  font-size: calc(var(--font-title) + 6px);
  font-weight: 800;
  font-stretch: semi-expanded;
  line-height: 1.2;
}

h2 {
  margin: var(--space-xl) 0 var(--space-s);
  font-size: var(--font-title);
  font-weight: 800;
  line-height: 1.25;
}

h3 {
  margin: var(--space-l) 0 var(--space-xs);
  font-size: var(--font-body);
}

p,
ul {
  margin: 0 0 var(--space-m);
}

li + li {
  margin-top: var(--space-xs);
}

.meta {
  color: var(--text-muted);
  font-size: var(--font-caption);
}

.lead {
  padding: var(--space-m) var(--space-l);
  border-radius: var(--radius-m);
  background: var(--surface-raised);
}

.button {
  display: inline-block;
  padding: var(--space-m) var(--space-l);
  border: var(--stroke-ink) solid var(--outline);
  border-radius: var(--radius-m);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 3px 3px 0 var(--shadow);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* Store buttons on the game page (landing/<lang>/index.html), shown after publication. */
.stores-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
}

.store-button {
  text-align: center;
}

footer {
  margin-top: var(--space-xl);
  color: var(--text-muted);
  font-size: var(--font-caption);
}

footer a {
  color: var(--text-muted);
}
