/* ==========================================================================
   Pixelpocalypse Games — shared styles
   ========================================================================== */

@font-face {
  font-family: "C64";
  src: url("../assets/c-64.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Company / brand */
  --navy: #1e2a8c;
  --navy-deep: #141d63;
  --navy-ink: #0c123f;

  /* Pound Sand apocalypse palette */
  --sand: #f0a83c;
  --amber: #ff8a1e;
  --orange: #ff5f1a;
  --ember: #e03a12;

  --paper: #f4f1e8;
  --paper-dim: #e4dfcf;
  --ink: #14162b;
  --night: #0a0b16;

  --maxw: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "C64", "Courier New", monospace;
  background: var(--night);
  color: #ece9f5;
  line-height: 1.6;
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
}

img { image-rendering: pixelated; }

h1, h2, h3 {
  font-family: "C64", "Courier New", monospace;
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin: 0 0 0.6em;
}

a { color: inherit; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "C64", monospace;
  font-size: 15px;
  text-decoration: none;
  padding: 16px 26px;
  border: 3px solid var(--ink);
  background: var(--navy);
  color: #fff;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .08s steps(2), box-shadow .08s steps(2);
  cursor: pointer;
}
.btn:hover { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--ink); }

.btn--steam {
  background: var(--orange);
  color: var(--night);
  border-color: var(--night);
  box-shadow: 6px 6px 0 var(--night);
}
.btn--steam:hover { box-shadow: 3px 3px 0 var(--night); }

.btn--ghost {
  background: transparent;
  color: var(--navy);
  box-shadow: 6px 6px 0 rgba(20,22,43,.25);
}

/* ---- Top nav -------------------------------------------------------------- */

.nav {
  border-bottom: 4px solid #000;
  background: #0f1020;
  position: sticky;
  top: 0;
  z-index: 30;
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #eef0ff;
  font-size: 15px;
}
.nav__brand img { height: 42px; width: auto; }
.nav__brand span { white-space: nowrap; }
/* stylized = white/knocked-out version of the logo for the dark nav */
.nav__logo--stylized { filter: brightness(0) invert(1); }
.nav__links { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; font-size: 13px; }
/* each title stays on one line; wrapping happens between links, never mid-title */
.nav__links a {
  text-decoration: none;
  color: #d6d9f2;
  white-space: nowrap;
  padding-bottom: 3px;
  border-bottom: 3px solid transparent;   /* reserve space so hover doesn't shift text */
}
.nav__links a:hover { color: var(--orange); border-bottom-color: var(--orange); }

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

.footer {
  background: var(--navy-ink);
  color: #cfd3ff;
  border-top: 4px solid var(--ink);
  margin-top: 80px;
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 46px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.footer img { height: 60px; }
.footer__logo { filter: brightness(0) invert(1); }
.footer a { color: var(--sand); }

/* ==========================================================================
   Landing page
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  /* flat deep-space base with a subtle dark vignette (no colour blob) */
  background:
    radial-gradient(120% 92% at 50% 28%, transparent 55%, rgba(0,0,0,.7) 100%),
    #0a0b16;
  color: #fff;
  text-align: center;
  padding: 84px 24px 96px;
  border-bottom: 4px solid #000;
}
/* faint pixel grid overlay */
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
/* real company logo, full colour, big and centered */
.hero__logo {
  width: 360px;
  max-width: 74vw;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 26px rgba(120,140,255,.35));
}
.hero__tag {
  position: relative;
  z-index: 1;
  font-size: 15px;
  max-width: 640px;
  margin: 30px auto 0;
  color: #c7ccff;
  line-height: 1.9;
}

.section { padding: 68px 0 10px; }
.section__head {
  font-size: 22px;
  color: #cbd0ff;
  display: inline-block;
  border-bottom: 5px solid var(--orange);
  padding-bottom: 8px;
  margin-bottom: 40px;
}
.about__body {
  max-width: 720px;
  font-size: 14px;
  line-height: 2;
  color: #cdd0e4;
}

/* Game card */
.games { display: grid; gap: 30px; }
.gamecard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 4px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  background: var(--night);
  text-decoration: none;
  color: #fff;
  overflow: hidden;
  transition: transform .1s steps(2), box-shadow .1s steps(2);
}
.gamecard:hover { transform: translate(4px,4px); box-shadow: 6px 6px 0 var(--ink); }
.gamecard__art {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: #0a0b16;
  overflow: hidden;
}
/* fallback: a logo shown centred when a game has no capsule art */
.gamecard__art img { width: 82%; max-width: 380px; }
/* capsule art fills the whole panel, Steam-style */
.gamecard__art img.gamecard__cap {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
}
.gamecard__body { padding: 40px 38px; display: flex; flex-direction: column; }
.gamecard__body h3 { font-size: 20px; color: var(--sand); }
.gamecard__body p { font-size: 13px; color: #d6d3e6; line-height: 1.9; }
.gamecard__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 22px; }
.tag {
  font-size: 10px;
  padding: 6px 10px;
  border: 2px solid var(--orange);
  color: var(--orange);
}
.gamecard__cta {
  margin-top: auto;
  font-size: 12px;
  color: var(--orange);
}
.gamecard__cta::after { content: " \25B6"; }

/* ==========================================================================
   Pound Sand game page
   ========================================================================== */

.ps { background: var(--night); color: #f0ead9; }
.ps .nav { background: #0f1020; border-bottom-color: #000; }
.ps .nav__brand { color: var(--sand); }
.ps .nav__links a { color: #d8d2c2; }
.ps .nav__links a:hover { color: var(--orange); }

.ps-hero {
  position: relative;
  text-align: center;
  padding: 72px 24px 84px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 4px solid #000;
  /* the real pixel-art banner is set per-game via JS (background-image) */
  background-color: #0a0b16;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
/* dark scrim over the art so the logo + text stay legible */
.ps-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,9,18,.28) 0%, rgba(8,9,18,.44) 45%, rgba(8,9,18,.9) 100%);
  pointer-events: none;
  z-index: 0;
}

/* "poster" hero: the art already has the logo baked in, so show the whole
   piece crisp and uncropped on the flat dark hero, with the tagline + buttons
   in a clean band beneath it (no scrim, no text over the art). */
.ps-hero--poster {
  min-height: 0;
  padding: 52px 24px 64px;
  background-image: none !important;
  background:
    radial-gradient(120% 100% at 50% 20%, transparent 55%, rgba(0,0,0,.6) 100%),
    #0a0b16;
}
.ps-hero--poster::before { display: none; }
.ps-hero--poster .ps-hero__logo {
  width: 960px;
  max-width: 94vw;
  margin-bottom: 26px;
  filter: drop-shadow(0 10px 26px rgba(0,0,0,.55));
}
.ps-hero__logo {
  position: relative; z-index: 1;
  width: 560px; max-width: 84vw;
  filter: drop-shadow(4px 4px 0 rgba(0,0,0,.7)) drop-shadow(0 0 22px rgba(0,0,0,.55));
}
.ps-hero__tag {
  position: relative; z-index: 1;
  font-size: 15px;
  max-width: 680px;
  margin: 18px auto 30px;
  color: #fff4dd;
  line-height: 1.9;
  text-shadow: 2px 2px 0 rgba(0,0,0,.5);
}
.ps-hero__cta { position: relative; z-index: 1; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }

.ps-section { padding: 66px 0 6px; }
.ps-section__head {
  font-size: 20px;
  color: var(--sand);
  border-bottom: 5px solid var(--orange);
  display: inline-block;
  padding-bottom: 8px;
  margin-bottom: 36px;
}

/* HUD-style stat strip */
.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 3px solid #000;
  background: #120d0a;
  margin: 0 0 4px;
}
.hud__cell { padding: 22px 20px; border-right: 3px solid #000; }
.hud__cell:last-child { border-right: 0; }
.hud__k { font-size: 11px; color: var(--sand); }
.hud__v { font-size: 26px; color: var(--orange); margin-top: 8px; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature {
  border: 3px solid #000;
  background: #15101c;
  padding: 26px 22px;
  box-shadow: 6px 6px 0 #000;
}
.feature h3 { font-size: 14px; color: var(--sand); }
.feature p { font-size: 12px; color: #d9d1c4; line-height: 1.9; margin: 0; }
.feature__ico { font-size: 26px; margin-bottom: 10px; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gallery a { border: 3px solid #000; overflow: hidden; display: block; box-shadow: 5px 5px 0 #000; line-height: 0; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s steps(3); }
.gallery a:hover img { transform: scale(1.06); }
.gallery--wide { grid-template-columns: repeat(2, 1fr); margin-top: 14px; }

.ps .footer { background: #08060c; color: #d8cdb8; }
.ps .footer a { color: var(--orange); }

/* ---- "Coming soon" button (Steam page not public yet) --------------------- */
.btn--soon {
  background: #2a2438;
  color: #b9b2c9;
  border-color: #000;
  box-shadow: 6px 6px 0 #000;
  cursor: not-allowed;
}
.btn--soon:hover { transform: none; box-shadow: 6px 6px 0 #000; }
.btn--soon:active { transform: none; box-shadow: 6px 6px 0 #000; }

/* ---- Trailer (responsive 16:9 YouTube embed) ------------------------------ */
.trailer {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border: 4px solid #000;
  box-shadow: 10px 10px 0 #000;
  background: #000;
}
.trailer iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 16 / 9) {
  .trailer { height: 0; padding-bottom: 56.25%; }
}

/* ==========================================================================
   Per-game accent colours (the hero art itself is now the background —
   these just tint headings, buttons, tags and links for each game's identity)
   ========================================================================== */

/* Quicksant — fresh grass green */
.game--quicksant .nav__brand,
.game--quicksant .ps-section__head,
.game--quicksant .feature h3,
.game--quicksant .gamecard__body h3 { color: #a7e05a; }
.game--quicksant .ps-section__head,
.game--quicksant .section__head { border-bottom-color: #7cc23a; }
.game--quicksant .nav__links a:hover { color: #a7e05a; border-bottom-color: #a7e05a; }
.game--quicksant .tag { border-color: #7cc23a; color: #a7e05a; }
.game--quicksant .gamecard__cta { color: #a7e05a; }
.game--quicksant .btn--steam { background: #7cc23a; color: #0a0f06; }
.game--quicksant .footer a { color: #a7e05a; }

/* Star Sand Skimmer — cyan */
.game--sss .nav__brand,
.game--sss .ps-section__head,
.game--sss .feature h3,
.game--sss .gamecard__body h3 { color: #6fdcf0; }
.game--sss .ps-section__head,
.game--sss .section__head { border-bottom-color: #4fd1e6; }
.game--sss .nav__links a:hover { color: #6fdcf0; border-bottom-color: #6fdcf0; }
.game--sss .tag { border-color: #4fd1e6; color: #6fdcf0; }
.game--sss .gamecard__cta { color: #6fdcf0; }
.game--sss .btn--steam { background: #4fd1e6; color: #05060f; }
.game--sss .footer a { color: #6fdcf0; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 760px) {
  .nav__links { gap: 14px; font-size: 11px; }
  .gamecard { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .hud { grid-template-columns: 1fr; }
  .hud__cell { border-right: 0; border-bottom: 3px solid #000; }
  .hud__cell:last-child { border-bottom: 0; }
  .section__head, .ps-section__head { font-size: 18px; }
}

@media (max-width: 460px) {
  .nav__brand span { display: none; }
  .gallery { grid-template-columns: 1fr; }
  .gallery--wide { grid-template-columns: 1fr; }
}
