/* Small Biomes design tokens, direction "Przekrój" (docs/strona/SPEC.md §2.2–2.3).
   scripts/contrast.mjs checks every text and UI pair against WCAG 2.1 AA; the build stops below it. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-next-400.39dad5dc6a.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-next-700.d874cb35df.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans-600.7f4b52c2ed.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* depth of the water column, top to bottom */
  --panel: #163f4c;
  --bg: #0e2a36;
  --deep: #0a1d27;
  /* surface bands from the game palette "Złota toń": decoration only, never under text */
  --band-1: #3cb4b0;
  --band-2: #2a8e9c;
  --band-3: #206a86;
  --band-4: #1a4a6c;

  --text: #e6f0ee;
  --muted: #a9c3c2;
  --accent: #d9b84a;
  --cta: #ff8a5c;
  --cta-text: #0a1d27;
  --ok: #7fd1a8;
  --err: #ff8f85;
  --focus: #ffe08a;

  --font-text: "Atkinson Hyperlegible Next", Verdana, sans-serif;
  --font-pixel: "Pixelify Sans", "Atkinson Hyperlegible Next", sans-serif;

  /* spacing scale */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;

  /* type scale 1.25 */
  --t-small: 0.875rem;
  --t-body: 1rem;
  --t-h4: 1.25rem;
  --t-h3: 1.563rem;
  --t-h2: 1.953rem;
  --t-h1: 2.441rem;
  --t-hero: 3.052rem;

  --line: 3px;
  --lift: 4px;
  --measure: 68ch;
  --page: 72rem;
}

/* Small Biomes store. The page is a cross-section of a water column: each section sits a little deeper.
   Square corners, 3 px lines, hard shadows without blur, pixel art only at whole-number scales. */

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
@media (min-width: 48em) { html { font-size: 112.5%; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--t-body)/1.5 var(--font-text);
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; }
.px { image-rendering: crisp-edges; image-rendering: pixelated; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--s4); font-weight: 700; }
h1 { font-size: var(--t-h1); line-height: 1.15; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); }
p, ul, ol, dl { margin: 0 0 var(--s4); max-width: var(--measure); }
li + li { margin-top: var(--s2); }
strong { font-weight: 700; }

a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: var(--line) solid var(--focus); outline-offset: 3px; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--s4); }
@media (min-width: 48em) { .wrap { padding: 0 var(--s6); } }

.vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--s2); top: -100px; z-index: 10;
  background: var(--focus); color: var(--deep); padding: var(--s3) var(--s4); font-weight: 700;
}
.skip:focus { top: var(--s2); }

/* surface: four hard bands, the top of the water column */
.surface { display: block; height: 4px; background: var(--band-1);
  box-shadow: 0 4px 0 var(--band-2), 0 8px 0 var(--band-3), 0 12px 0 var(--band-4); margin-bottom: 12px; }

/* header */
.site-header { background: var(--panel); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s5); padding-top: var(--s3); padding-bottom: var(--s3); }
.brand { display: inline-flex; align-items: center; gap: var(--s3); min-height: 48px; color: var(--text); text-decoration: none; }
.brand img { width: 48px; height: 48px; }
.brand span { font: 600 1.375rem/1 var(--font-pixel); }
.nav { display: flex; flex-wrap: wrap; gap: 0 var(--s4); margin: 0; padding: 0; list-style: none; max-width: none; }
.nav li + li { margin-top: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 var(--s1); font-weight: 700; }
.nav a[aria-current="page"] { color: var(--text); text-decoration-color: var(--accent); }

.lang-hint { background: var(--deep); margin: 0; max-width: none; text-align: right; }
.lang-hint .wrap { display: block; }
.lang-hint a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }

/* sections step deeper */
.band { padding: var(--s7) 0; }
.band-1 { background: var(--panel); }
.band-2 { background: var(--bg); border-top: var(--line) solid var(--band-4); }
.band-3 { background: var(--deep); }
@media (min-width: 48em) { .band { padding: var(--s8) 0; } }

/* hero */
.hero { padding-top: var(--s6); }
.hero-grid { display: grid; gap: var(--s6); align-items: center; }
@media (min-width: 56em) { .hero-grid { grid-template-columns: 1fr 1fr; } }
.hero h1 { font-size: var(--t-h1); }
@media (min-width: 48em) { .hero h1 { font-size: var(--t-hero); } }
.lead { font-size: var(--t-h4); color: var(--text); }
.hero-art { margin: 0; justify-self: center; }
/* the poster is 6x art (1080x1920) shown at exactly 1/3; the frame is two shadow rings, so it never eats into the picture */
.hero-art img, .hero-art canvas { display: block; width: 360px; height: 640px; max-width: none;
  box-shadow: 0 0 0 var(--line) var(--deep), 0 0 0 calc(2 * var(--line)) var(--band-3); }
/* phones: 360 px and the frame do not fit between the side margins, so the poster takes the full width */
@media (max-width: 24.5em) {
  .hero-art { justify-self: stretch; display: flex; flex-direction: column; align-items: center; margin-inline: calc(-1 * var(--s4)); }
  .hero-art figcaption { padding-inline: var(--s4); align-self: stretch; }
}
@media (max-width: 22.4em) { .hero-art img, .hero-art canvas { width: 180px; height: 320px; } }
.hero-art figcaption { color: var(--muted); font-size: var(--t-small); margin-top: var(--s3); }

/* buttons: square, 3 px line, hard 4 px shadow that the press removes */
.actions { display: flex; flex-wrap: wrap; gap: var(--s4); margin: var(--s5) 0 var(--s3); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: var(--s3) var(--s5);
  border: var(--line) solid var(--deep); box-shadow: 0 var(--lift) 0 var(--deep);
  font: 700 var(--t-h4)/1.2 var(--font-text); text-decoration: none; cursor: pointer;
}
.btn:active { transform: translateY(var(--lift)); box-shadow: 0 0 0 var(--deep); }
.btn-buy { background: var(--cta); color: var(--cta-text); }
.btn-play { background: var(--accent); color: var(--deep); }
.btn-plain { background: transparent; color: var(--text); border-color: var(--accent); box-shadow: 0 var(--lift) 0 var(--deep); }
.btn:hover { color: var(--deep); text-decoration: underline; }
.btn-plain:hover { color: var(--text); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }
/* the price stays in the text font: in Pixelify Sans 5 reads as S and Z as 2 */
.price { font: 700 var(--t-h3)/1.2 var(--font-text); color: var(--text); margin-bottom: var(--s2); }
.fine { color: var(--muted); font-size: var(--t-small); }

/* buy block: the price, the refund and the seller always stand next to the button */
.buy { background: var(--panel); border: var(--line) solid var(--accent); padding: var(--s5); max-width: 40rem; }
.buy p { max-width: none; }
.buy .actions { margin-top: var(--s3); }

/* three points about the game */
.points { display: grid; gap: var(--s5); margin: 0; padding: 0; list-style: none; max-width: none; }
.points li + li { margin-top: 0; }
@media (min-width: 48em) { .points { grid-template-columns: repeat(3, 1fr); } }
.points h3 { font-size: var(--t-h4); }
.points figure { margin: 0 0 var(--s3); padding: calc(2 * var(--line)); }
.points img { display: block; box-shadow: 0 0 0 var(--line) var(--deep), 0 0 0 calc(2 * var(--line)) var(--band-3); }

/* trust strip: four plain sentences, a kelp-coloured line on the left */
.trust { display: grid; gap: var(--s4); margin: 0; padding: 0; list-style: none; max-width: none; }
.trust li { border-left: var(--line) solid var(--accent); padding-left: var(--s4); margin: 0; }
@media (min-width: 48em) { .trust { grid-template-columns: repeat(2, 1fr); } }

/* lab: 160x90 art at exactly 2x (1x on screens too narrow for 320 px), never a fractional scale */
.lab { display: grid; grid-template-columns: repeat(auto-fill, calc(320px + 2 * var(--line))); gap: var(--s6) var(--s5); margin: 0; padding: 0; list-style: none; max-width: none; }
.lab li { margin: 0; }
.lab figure { margin: 0 0 var(--s3); width: max-content; background: var(--deep); border: var(--line) solid var(--band-4); }
.lab img { display: block; width: 320px; height: 180px; max-width: none; }
@media (max-width: 22.4em) {
  .lab { grid-template-columns: 1fr; }
  .lab img { width: 160px; height: 90px; }
}
.lab h3 { font-size: var(--t-h4); margin-bottom: var(--s2); }
.lab p { color: var(--muted); }

/* screenshots: tall frames at 1x of the 4x screen files */
.shots { display: flex; flex-wrap: wrap; gap: var(--s5); margin: 0 0 var(--s6); padding: calc(2 * var(--line)); list-style: none; max-width: none; }
.shots li { margin: 0; }
.shots img { display: block; box-shadow: 0 0 0 var(--line) var(--deep), 0 0 0 calc(2 * var(--line)) var(--band-3); }

/* text pages */
/* only top and bottom: the side padding comes from .wrap */
.page { padding-top: var(--s6); padding-bottom: var(--s8); }
.legal { line-height: 1.65; }
.legal h2 { font-size: var(--t-h3); margin-top: var(--s6); scroll-margin-top: var(--s4); }
.legal ul { padding-left: var(--s5); }
.legal li { margin-bottom: var(--s2); }
.legal .draft, .note { background: var(--panel); border-left: var(--line) solid var(--cta); padding: var(--s3) var(--s4); max-width: var(--measure); }
.version { color: var(--muted); font-size: var(--t-small); margin-top: var(--s6); }

/* FAQ */
.faq { max-width: var(--measure); }
.faq details { border-top: var(--line) solid var(--band-4); }
.faq details:last-child { border-bottom: var(--line) solid var(--band-4); }
.faq summary { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: var(--s3) 0; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
/* square +/- box; the empty alt text keeps screen readers on the question (they already say expanded/collapsed) */
.faq summary::before {
  content: "+"; content: "+" / "";
  flex: none; display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem;
  border: var(--line) solid var(--accent); color: var(--accent); font-weight: 700; line-height: 1;
}
.faq details[open] > summary::before { content: "-"; content: "-" / ""; }
.faq details > div { padding-bottom: var(--s4); }

/* forms */
.form { max-width: 32rem; }
label { display: block; font-weight: 700; margin-bottom: var(--s2); }
input[type="text"], input[type="email"] {
  display: block; width: 100%; min-height: 52px; padding: var(--s3); margin-bottom: var(--s4);
  background: var(--deep); color: var(--text); border: var(--line) solid var(--muted); font: inherit; font-size: var(--t-h4);
}
input::placeholder { color: var(--muted); }
.status { min-height: 1.5em; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
/* the key stays on one line: it shrinks with the screen instead of breaking after a dash (M2 review) */
.key { font: 700 clamp(0.9rem, 4.8vw, var(--t-h3))/1.3 var(--font-text); letter-spacing: 0.08em; white-space: nowrap; width: max-content; max-width: 100%; background: var(--deep); border: var(--line) solid var(--accent); padding: var(--s4); }
.devices { padding: 0; list-style: none; }
.devices li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); border-top: var(--line) solid var(--band-4); padding: var(--s3) 0; margin: 0; }

noscript p, .noscript { background: var(--panel); border-left: var(--line) solid var(--cta); padding: var(--s3) var(--s4); }
[hidden] { display: none !important; }

/* footer: the deepest band */
.site-footer { background: var(--deep); color: var(--muted); padding: var(--s7) 0 var(--s8); border-top: var(--line) solid var(--band-4); }
.site-footer p { max-width: var(--measure); }
.site-footer .who { color: var(--text); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 var(--s5); margin: var(--s4) 0; padding: 0; list-style: none; max-width: none; }
.foot-links li + li { margin-top: 0; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }

/* checkout page on the pay host */
.checkout { padding-top: var(--s6); padding-bottom: var(--s8); }
.checkout-frame { min-height: 32rem; background: var(--text); border: var(--line) solid var(--deep); margin: var(--s4) 0; }
.mock-pay { display: grid; gap: var(--s3); padding: var(--s5); color: var(--deep); }
.mock-pay p { color: var(--deep); }
.mock-pay .btn-plain { color: var(--deep); border-color: var(--deep); }
.mock-pay .btn-plain:hover { color: var(--deep); }
.mock-pay :focus-visible { outline-color: var(--deep); } /* the yellow outline vanishes on the light panel */

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