/* Lowlight Studio: shared tokens and base styles for all three sites.
   Colours come from the game's art/palette.json. Motion only runs when <html> has class "m"
   (set by /js/init.js when the visitor has not asked for reduced motion and has not paused it). */

@font-face {
  font-family: 'Pixelify Sans';
  src: url('/_astro/pixelify-sans-latin-400-normal.DLrIX9QE.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Pixelify Sans';
  src: url('/_astro/pixelify-sans-latin-700-normal.D3Xxx3QE.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #120b1f;
  --night: #1c1640;
  --night-mid: #2d2466;
  --street: #3a2f5c;
  --dusk: #5a2e6b;
  --dusk-glow: #a8405a;
  --paper: #f6ecd8;
  --steel: #8a86b8;
  --lantern-glow: #ffb84d;
  --lantern: #ff6a2b;
  --lantern-red: #d4263f;
  --neon-pink: #ff3ea5;
  --neon-teal: #34e8d8;
  --tip: #ffe03b;

  --font-display: 'Pixelify Sans', ui-monospace, monospace;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --wrap: 72rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; }
img.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; }
img.px { image-rendering: pixelated; }

h1, h2, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .01em;
  margin: 0 0 .4em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 9vw, 7rem); }
h2 { font-size: clamp(2rem, 6vw, 4.5rem); }
h3 { font-size: 1.35rem; margin: 0 0 .4em; line-height: 1.25; }
p { margin: 0 0 1em; max-width: 60ch; }
.lede { font-size: clamp(1.15rem, 2.2vw, 1.45rem); color: var(--paper); }
.muted { color: var(--steel); }

a { color: var(--neon-teal); text-underline-offset: .18em; }
a:hover { color: var(--paper); }
:focus-visible { outline: 3px solid var(--neon-teal); outline-offset: 2px; border-radius: 2px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.center { text-align: center; }
.center p { margin-inline: auto; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--lantern-glow); color: var(--ink); padding: .6rem 1rem; font-weight: 700;
}
.skip:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- buttons (as the game's PLAY button) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .6rem 1.4rem;
  font: 700 1.1rem/1 var(--font-display); letter-spacing: .03em;
  color: var(--ink); background: var(--lantern-glow);
  border: 0; border-bottom: 3px solid var(--lantern); border-radius: 4px;
  text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), background-color .15s;
}
.btn:hover { background: var(--tip); color: var(--ink); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); border-bottom-width: 1px; }
.btn.ghost { background: transparent; color: var(--paper); border: 2px solid var(--street); border-bottom-width: 3px; }
.btn.ghost:hover { border-color: var(--lantern-glow); color: var(--lantern-glow); }

.soon {
  display: inline-flex; align-items: center; gap: .55em; min-height: 48px;
  padding: .55rem 1.1rem; border: 2px dashed var(--steel); border-radius: 6px;
  font-weight: 600; color: var(--paper);
}
.soon .dot { width: .6em; height: .6em; background: var(--tip); box-shadow: 0 0 10px var(--tip); }
.play-badge { display: inline-block; padding: 12px; line-height: 0; }
.play-badge img { height: 56px; width: auto; }

/* ---------- header ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  padding: .9rem 0;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand {
  display: inline-flex; align-items: center; gap: .55rem; text-decoration: none;
  color: var(--paper); font: 700 1.15rem/1 var(--font-display); letter-spacing: .02em;
  min-height: 44px;
}
.brand img { width: 28px; height: 28px; }
.site-nav ul { list-style: none; display: flex; gap: .25rem 1.1rem; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a { color: var(--paper); text-decoration: none; display: inline-block; padding: .55rem .1rem; font-size: 1rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--lantern-glow); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--lantern); text-decoration-thickness: 2px; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--steel); padding: 3.5rem 0 2.5rem; font-size: .95rem; }
.site-footer .cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.site-footer nav a { color: var(--paper); text-decoration: none; display: inline-block; padding: .35rem 0; }
.site-footer nav a:hover { color: var(--lantern-glow); }
.site-footer h2 { font-size: 1rem; color: var(--paper); margin-bottom: .6rem; }
.site-footer small { display: block; margin-top: .4rem; max-width: 60ch; }
.motion-toggle {
  min-height: 44px; padding: .5rem 1rem; background: transparent; color: var(--paper);
  border: 2px solid var(--street); border-radius: 4px; font: inherit; cursor: pointer;
}
.motion-toggle:hover { border-color: var(--neon-teal); }
.motion-toggle[aria-pressed="true"] { border-color: var(--lantern-glow); color: var(--lantern-glow); }
.no-js .motion-toggle { display: none; }

/* ---------- pixel stage: art scaled by whole numbers ---------- */
/* --u is one art pixel in CSS px (an integer). Stages set it by breakpoint. */
.stage { --u: 2px; position: relative; width: calc(180 * var(--u)); height: calc(320 * var(--u)); }
.stage > img, .stage .layer { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (min-height: 700px) and (min-width: 560px) { .stage { --u: 3px; } }
@media (min-height: 1020px) and (min-width: 760px) { .stage { --u: 4px; } }

/* ---------- glow recipe ---------- */
.glow-bg { position: relative; isolation: isolate; }
.glow-bg::before {
  content: ''; position: absolute; inset: -20%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgb(255 184 77 / .3), rgb(255 184 77 / 0));
}

/* ---------- reveal on scroll (only with motion on) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.m .reveal { animation: rise .4s var(--ease) both paused; }
.m .reveal.in { animation-play-state: running; }
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  .m .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 5% cover 25%;
  }
}

/* ---------- prose pages (privacy, contact) ---------- */
.prose { padding: 8rem 0 5rem; }
.prose .wrap { max-width: 46rem; }
.prose h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.prose h2 { font-family: var(--font-body); font-size: 1.4rem; line-height: 1.3; margin: 2.2em 0 .5em; color: var(--lantern-glow); }
.prose ul { padding-left: 1.2em; max-width: 60ch; }
.prose li { margin-bottom: .4em; }
.prose .meta { color: var(--steel); }
.card {
  background: var(--night-mid); border: 2px solid var(--street); border-radius: 8px; padding: 1.4rem 1.5rem;
}
.card p:last-child { margin-bottom: 0; }

/* ---------- 404 ---------- */
.lost { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 6rem 1rem; }
.lost img { width: 256px; height: 192px; }
