/* Shared look for every Bullet and Hell page: the game's fonts, palette and chrome. */

/* Latin subsets as WOFF2 (tools/prepare_assets.py). */
@font-face { font-family: "Pirata One"; src: url("../assets/fonts/pirata-one.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Grenze"; src: url("../assets/fonts/grenze.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../assets/fonts/barlow-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ink: #0f0b09;        /* splash near-black */
  --soot: #18100c;
  --char: #24160f;
  --blood: #7a0c10;
  --crimson: #c3161c;
  --crimson-text: #ec4a3f; /* crimson for small text: 5.2:1 on --ink, 4.6:1 on the hottest background */
  --ember: #ff6a1a;
  --molten: #ffb04a;
  --brass: #c9a24a;
  --brass-hi: #f1d58a;
  --bone: #eadcc3;
  --ash: #9d8f7f;
  --display: "Pirata One", "UnifrakturCook", serif;
  --serif: "Grenze", Georgia, serif;
  --ui: "Barlow", system-ui, sans-serif;
  --gutter: clamp(18px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--bone);
  font: 400 clamp(17px, 1.05rem + .2vw, 21px) / 1.5 var(--serif);
  background: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--crimson); color: var(--bone); }
img, video, canvas { display: block; max-width: 100%; }
a { color: var(--molten); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1; margin: 0; letter-spacing: .01em; }
p { margin: 0 0 1em; }
.ui { font-family: var(--ui); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; font-size: .72em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--molten); outline-offset: 3px; }

/* Canvas the dither shader draws into (or, without WebGL2, the still in its place), covering its box. */
.bh-dither { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Store buttons, rendered from site.config.js by tools/build_page.mjs. */
.bh-store {
  --plate: linear-gradient(180deg, #3a2412, #1b0f08 60%, #2a170b);
  position: relative; display: inline-flex; align-items: center; gap: .7em;
  padding: .85em 1.5em .8em; min-height: 3.2em;
  font-family: var(--display); font-size: clamp(20px, 1.2rem + .6vw, 28px); line-height: 1;
  color: var(--brass-hi); text-decoration: none; text-shadow: 0 1px 0 #000, 0 0 12px rgba(255, 160, 60, .35);
  background: var(--plate);
  border: 1px solid #6b4a1e; box-shadow: inset 0 1px 0 rgba(255, 220, 140, .25), inset 0 -2px 0 rgba(0, 0, 0, .5), 0 0 0 3px #0c0705, 0 0 0 4px #4a2f12, 0 10px 30px rgba(0, 0, 0, .6);
  transition: transform .15s ease, box-shadow .2s ease, color .2s ease;
}
.bh-store svg { width: 1.1em; height: 1.1em; flex: none; fill: currentColor; }
.bh-store small { display: block; font: 500 .45em/1.2 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--ash); margin-top: .35em; }
.bh-store:is(a):hover, .bh-store:is(a):focus-visible {
  transform: translateY(-2px); color: #fff3cf; outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 220, 140, .35), inset 0 -2px 0 rgba(0, 0, 0, .5), 0 0 0 3px #0c0705, 0 0 0 4px var(--ember), 0 0 34px rgba(255, 106, 26, .55);
}
/* Sealed until the store page exists: a darker plate, the store named plainly, when it opens underneath. */
.bh-store.is-soon {
  --plate: linear-gradient(180deg, #24170e, #140c07 60%, #1c1009);
  color: #d9c08a; cursor: default; text-shadow: 0 1px 0 #000;
  box-shadow: inset 0 1px 0 rgba(255, 220, 140, .12), inset 0 -2px 0 rgba(0, 0, 0, .5), 0 0 0 3px #0c0705, 0 0 0 4px #3a2610, 0 10px 30px rgba(0, 0, 0, .6);
}
.bh-store.is-soon svg { opacity: .55; }
.bh-store.is-soon small { color: #b8a58c; }

/* Reveal on scroll. */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .bh-store { transition: none; }
}
