/* ==========================================================================
   Belle Prairie Games — the site's only stylesheet.
   Self-hosted fonts, no external requests, no JavaScript.
   ========================================================================== */

/* --- Fonts (SIL Open Font License; licences sit alongside the files) ------ */

@font-face {
  font-family: "Russo One";
  src: url("../fonts/RussoOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------------
   A game page overrides --accent (and only --accent) via its body class;
   every rule below reads it.
   ------------------------------------------------------------------------ */

:root {
  color-scheme: dark;

  --bg:          #0b0d10;
  --bg-raised:   #12161c;
  --bg-inset:    #080a0d;
  --line:        rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text:       #e8eaed;
  --text-dim:   #98a1ac;
  --text-faint: #6b747f;

  --accent:     #e5b33d;   /* prairie gold — the studio colour */
  --accent-ink: #0b0d10;

  --display: "Russo One", Impact, system-ui, sans-serif;
  --body: "Chakra Petch", "Segoe UI", system-ui, -apple-system, sans-serif;

  --wrap: 1120px;
  --radius: 14px;
  --step: clamp(3rem, 7vw, 5.5rem);
}

body.game-blastomino         { --accent: #35e0e0; }  /* neon cyan */
body.game-conscription-chess { --accent: #8fb96a; }  /* board green */
body.game-hexalode           { --accent: #f0a03c; }  /* ore amber */

/* --- Base ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.68;
  overflow-x: hidden;
}

/* A faint accent wash at the top of the page and a hairline grid over the
   ground. Both are decoration only. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 70vh;
  background: radial-gradient(120% 100% at 50% -25%,
    color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.3;
  -webkit-mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

/* Everything real sits above the two decorative layers. */
.site-header, main, .site-footer { position: relative; z-index: 1; }

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

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
}

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: 1.1rem;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}
.wordmark::before {
  content: "";
  width: 11px;
  height: 11px;
  flex: none;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 70%, transparent);
}
.wordmark:hover { color: var(--accent); }

.site-nav {
  display: flex;
  gap: clamp(0.9rem, 3vw, 1.9rem);
  flex-wrap: wrap;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding-block: 0.15rem;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* --- Home hero ----------------------------------------------------------- */

.hero {
  padding-block: clamp(3.5rem, 10vw, 7rem) var(--step);
  text-align: center;
}
.hero h1 {
  font-size: clamp(2.4rem, 8vw, 5rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--accent); }
.hero .tagline {
  margin: 1.5rem auto 0;
  max-width: 46ch;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  color: var(--text-dim);
  text-wrap: balance;
}

.rule {
  width: 70px;
  height: 3px;
  margin: 2rem auto 0;
  background: var(--accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* --- Sections ------------------------------------------------------------ */

.section { padding-block: var(--step); }
.section + .section { padding-top: 0; }

.section-title {
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-family: var(--body);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.prose { max-width: 62ch; }
.prose p { margin: 0 0 1.15rem; }
.prose p:last-child { margin-bottom: 0; }
.prose .lead {
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem);
  line-height: 1.5;
  color: var(--text);
}

/* --- Game cards (home) --------------------------------------------------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 1.5rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.75;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-raised));
}
.game-card .art {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  object-fit: contain;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  padding: 6px;
}
.game-card h3 {
  font-size: 1.28rem;
  color: var(--text);
  text-wrap: balance;
}
.game-card:hover h3 { color: var(--accent); }
.game-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98rem;
  flex: 1;
}
.game-card .more {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

/* Per-card accent on the home grid. */
.game-card.c-blastomino         { --accent: #35e0e0; }
.game-card.c-conscription-chess { --accent: #8fb96a; }
.game-card.c-hexalode           { --accent: #f0a03c; }

/* --- Chips --------------------------------------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.chip {
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-dim);
  white-space: nowrap;
}
.chip.is-status {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

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

.game-hero {
  padding-block: clamp(2.5rem, 7vw, 4.5rem) var(--step);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.game-hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  text-transform: uppercase;
  text-wrap: balance;
}
.game-hero .kicker {
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}
.game-hero .tagline {
  margin: 1.25rem 0 1.75rem;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.35rem);
  color: var(--text-dim);
  max-width: 34ch;
  text-wrap: balance;
}

.hero-art {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(70% 70% at 50% 45%,
      color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 70%),
    var(--bg-inset);
  padding: clamp(1.5rem, 5vw, 3rem);
  overflow: hidden;
}
/* The game icons are full-bleed squares with their own backgrounds; round them
   so they do not read as a hard box inside the glow. */
.hero-art img {
  width: min(78%, 340px);
  border-radius: 24px;
}

/* --- Spec strip ---------------------------------------------------------- */

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0;
}
.specs > div {
  background: var(--bg-raised);
  padding: 1.15rem 1.35rem;
}
.specs dt {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
.specs dd {
  margin: 0.35rem 0 0;
  font-family: var(--display);
  font-size: 1rem;
  color: var(--text);
}

/* --- Feature list -------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.features li {
  padding: 1.5rem 1.6rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.features h3 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.features p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.97rem;
}

/* --- Screenshots --------------------------------------------------------- */

/* Phone screenshots are capped rather than stretched to the column, so two
   shots on one page and three on another still come out the same size. */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 300px));
  justify-content: start;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 640px) {
  .shots { justify-content: center; }
}
.shots li, .shots figure { margin: 0; }
.shots img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-inset);
}
.shots figcaption {
  margin-top: 0.7rem;
  font-size: 0.86rem;
  color: var(--text-faint);
}
.shots.is-wide {
  grid-template-columns: minmax(0, 1fr);
  max-width: 880px;
}
/* A single hero screenshot, centred and held to a readable width. */
.shots.is-feature {
  grid-template-columns: minmax(0, 1fr);
  max-width: 560px;
}
/* Phone screenshots vary in height; top-align them rather than stretching. */
.shots > li { align-self: start; }

/* --- HexaLode hero: a hex field composed from the game's own tile art ----- */

.hex-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}
.hex-scene .tile {
  position: absolute;
  width: 36%;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
}
/* A bedrock plateau with two ore territories around it — the game's own premise. */
.hex-scene .t1 { top: 14%; left: 32%; }
.hex-scene .t2 { top: 36%; left: 6%;  }
.hex-scene .t3 { top: 36%; left: 58%; }

/* Overseer.png is a 2x2 sheet of four poses; show only the top-left one. */
.hex-scene .overseer {
  position: absolute;
  top: 64%;
  left: 42%;
  width: 20%;
  aspect-ratio: 1 / 1;
  background-image: url("../img/hexalode/overseer.png");
  background-size: 200% 200%;
  background-position: 0 0;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  z-index: 2;
}
.hex-scene .ship {
  position: absolute;
  top: 2%;
  right: 2%;
  width: 21%;
  image-rendering: pixelated;
  opacity: 0.9;
}

.pixel { image-rendering: pixelated; }

/* --- Pull quote ---------------------------------------------------------- */

.quote {
  margin: 0;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.quote::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}
.quote p {
  margin: 0 0 0.9rem;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.28rem);
  line-height: 1.5;
  color: var(--text);
  text-wrap: balance;
}
.quote p:last-of-type { margin-bottom: 0; }
.quote footer {
  margin-top: 1.1rem;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* --- Back link ----------------------------------------------------------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-dim);
}
.back-link::before { content: "\2190"; color: var(--accent); }
.back-link:hover { color: var(--accent); }

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

.site-footer {
  margin-top: var(--step);
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3.5rem;
  color: var(--text-faint);
  font-size: 0.87rem;
}
.site-footer .wrap > .row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: baseline;
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }
.site-footer .credits {
  margin: 1.25rem 0 0;
  max-width: 64ch;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-faint);
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 820px) {
  .game-hero { grid-template-columns: minmax(0, 1fr); }
  .game-hero .hero-art { order: -1; width: 100%; max-width: 400px; }
  .game-hero .tagline { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .game-card:hover { transform: none; }
}

@media print {
  body::before, body::after { display: none; }
  body { background: #fff; color: #000; }
}
