/* ==========================================================================
   Lab Tested Games — site styles
   One stylesheet, no build step. Edit colours in :root and everything follows.
   ========================================================================== */

:root {
  /* Palette — carried over from the Piranha Club in-game theme */
  --bg:         #0c0b0e;
  --bg-raised:  #14131a;
  --bg-hover:   #1c1b24;
  --border:     #2a2835;
  --border-warm:#3d3529;

  --text:       #e4e0d8;
  --text-dim:   #a09b92;
  --text-faint: #6c675f;

  --accent:     #c8a84e;
  --accent-dim: #8a7535;
  --accent-glow:#c8a84e22;

  --danger:     #b84035;
  --success:    #4a8858;

  /* Type */
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --body:  "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --measure: 68rem;   /* max page width */
  --narrow:  44rem;   /* max width for running prose */
}

/* --- Reset ---------------------------------------------------------------- */

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

body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote {
  margin: 0;
}

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

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p + p { margin-top: 1em; }

a {
  color: var(--accent);
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 0.2em;
}
a:hover { color: #dcbe66; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4rem 0;
}

::selection { background: var(--accent); color: var(--bg); }

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

/* --- Layout helpers ------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.narrow { max-width: var(--narrow); }

.section { padding-block: clamp(3rem, 8vw, 6rem); scroll-margin-top: 5rem; }
.section--tight { padding-block: clamp(2rem, 5vw, 3.5rem); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.lede {
  font-size: 1.2rem;
  color: var(--text-dim);
  max-width: var(--narrow);
}

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); font-size: 0.9rem; }

/* --- Skip link ------------------------------------------------------------ */

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem;
  z-index: 100;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 3px;
}

/* --- Site header ---------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 11, 14, 0.88);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.brand:hover { color: var(--text); }
.brand__mark {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav a {
  color: var(--text-dim);
  text-decoration: none;
  /* 0.75rem block padding keeps the tap target at/above the 44px minimum
     without changing where the text sits. */
  padding-block: 0.75rem;
  border-bottom: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.nav a:hover { color: var(--text); border-bottom-color: var(--accent-dim); }
.nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Hero ----------------------------------------------------------------- */

.hero {
  padding-block: clamp(4rem, 12vw, 8rem);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(120% 90% at 15% 0%, var(--accent-glow) 0%, transparent 60%),
    var(--bg);
}

.hero h1 { max-width: 20ch; }
.hero .lede { margin-top: 1.5rem; }
.hero__actions { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 1rem; }

/* Game page hero with key art */
.hero--art {
  padding: 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.hero--art img {
  width: 100%;
  max-height: 64vh;
  object-fit: cover;
  object-position: center 40%;
}
.hero--art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      rgba(12,11,14,0.15) 0%,
      rgba(12,11,14,0.10) 25%,
      rgba(12,11,14,0.62) 60%,
      rgba(12,11,14,0.96) 100%);
  pointer-events: none;
}
.hero--art .hero__caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 1;
  padding-block: 2rem;
}

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

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--accent-dim);
  border-radius: 2px;
  color: var(--accent);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn--solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn--solid:hover { background: #dcbe66; border-color: #dcbe66; color: var(--bg); }
.btn--quiet { border-color: var(--border); color: var(--text-dim); }
.btn--quiet:hover { background: var(--bg-hover); border-color: var(--border-warm); color: var(--text); }

/* Placeholder state — looks like a button, deliberately does nothing. Used for
   "Coming to Steam" until the store page is public. */
.btn--static { cursor: default; border-style: dashed; }
.btn--static:hover {
  background: transparent;
  border-color: var(--border-warm);
  color: var(--text-dim);
}

/* --- Cards & grids -------------------------------------------------------- */

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

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.5rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--text-dim); font-size: 0.97rem; }

/* Feature card for a game on the landing page */
.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
@media (min-width: 52rem) {
  .game-card { grid-template-columns: 1.15fr 1fr; }
}
.game-card__art { position: relative; min-height: 15rem; }
.game-card__art img { width: 100%; height: 100%; object-fit: cover; }
.game-card__body { padding: clamp(1.5rem, 4vw, 2.5rem); align-self: center; }
.game-card__body h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.75rem;
}
.game-card__meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 1.5rem;
}

/* Screenshot gallery */
.shots {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}
.shots img {
  border: 1px solid var(--border);
  border-radius: 3px;
}

/* --- Scenario rows (game page) --------------------------------------------
   One full-width row per scenario, colour-coded to the team colours used in
   the game itself (see PLAYER_COLORS in src/styles/theme.js).

   The colour is always partly visible rather than hover-only, so the coding
   still reads on touch devices, where :hover never fires. Hover and keyboard
   focus deepen it.
   -------------------------------------------------------------------------- */

.scenarios { display: grid; gap: 1rem; }

.scenario {
  --scn: var(--accent);
  --scn-bg: var(--bg-hover);
  position: relative;
  display: grid;
  gap: 0.5rem 2.5rem;
  padding: 1.6rem 1.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--scn);
  border-radius: 3px;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

@media (min-width: 50rem) {
  .scenario { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
}

/* Tinted wash, deepened on hover/focus. Kept on a pseudo-element so the
   transition is a simple opacity fade and the text never inherits it. */
.scenario::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scn-bg);
  opacity: 0.16;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.scenario:hover::before,
.scenario:focus-within::before { opacity: 0.5; }

.scenario:hover,
.scenario:focus-within {
  border-color: var(--scn);
  border-left-color: var(--scn);
}

.scenario > * { position: relative; }

.scenario__hook {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--scn);
  margin-bottom: 0.4rem;
}

.scenario__team {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--scn);
  margin: 0;
}

.scenario__body {
  color: var(--text-dim);
  font-size: 0.99rem;
  /* Long store copy reads badly at full width; cap the line length rather than
     the column, so the row still fills the page. */
  max-width: 62ch;
}

/* Team colours, lifted directly from the game */
.scenario--losange  { --scn: #e8c840; --scn-bg: #1e3d7a; }
.scenario--chambers { --scn: #5ba8d5; --scn-bg: #1a3348; }
.scenario--foxboro  { --scn: #e8e4dc; --scn-bg: #0e3020; }

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

.features { list-style: none; padding: 0; display: grid; gap: 1.5rem; }
@media (min-width: 46rem) {
  .features { grid-template-columns: 1fr 1fr; gap: 1.75rem 2.5rem; }
}
.features li { padding-left: 1.5rem; position: relative; }
.features li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.65em;
  width: 0.5rem; height: 1px;
  background: var(--accent);
}
.features strong { display: block; font-family: var(--serif); font-size: 1.1rem; margin-bottom: 0.2rem; }
.features span { color: var(--text-dim); font-size: 0.97rem; }

/* --- Fact sheet (definition list) ----------------------------------------- */

.facts {
  border-top: 1px solid var(--border);
  font-size: 0.97rem;
}
.facts > div {
  display: grid;
  gap: 0.25rem 2rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 40rem) {
  .facts > div { grid-template-columns: 12rem 1fr; }
}
.facts dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-top: 0.25em;
}
.facts dd { margin: 0; color: var(--text); }

/* --- Steps (numbered process) --------------------------------------------- */

.steps { list-style: none; counter-reset: step; padding: 0; display: grid; gap: 1.75rem; }
.steps li { position: relative; padding-left: 3rem; }
.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0.15em;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid var(--border-warm);
  border-radius: 50%;
  width: 2rem; height: 2rem;
  display: grid;
  place-content: center;
}
.steps strong { display: block; font-family: var(--serif); font-size: 1.1rem; margin-bottom: 0.2rem; }
.steps span { color: var(--text-dim); font-size: 0.97rem; }

/* --- Callout -------------------------------------------------------------- */

.callout {
  border-left: 2px solid var(--accent-dim);
  background: var(--bg-raised);
  padding: 1.25rem 1.5rem;
  border-radius: 0 3px 3px 0;
  color: var(--text-dim);
  font-size: 0.97rem;
}
.callout strong { color: var(--text); }

/* --- Forms ---------------------------------------------------------------- */

.form { display: grid; gap: 1.5rem; max-width: var(--narrow); }

.field { display: grid; gap: 0.45rem; }

.field label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.field label .req { color: var(--accent); }

.field input,
.field textarea,
.field select {
  font-family: var(--body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.7rem 0.85rem;
  width: 100%;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent-dim);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field textarea { min-height: 9rem; resize: vertical; }
.field .hint { color: var(--text-faint); font-size: 0.85rem; }

.field-row { display: grid; gap: 1.5rem; }
@media (min-width: 40rem) { .field-row { grid-template-columns: 1fr 1fr; } }

/* Honeypot — hidden from humans, catches naive bots */
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* --- Download list -------------------------------------------------------- */

.downloads { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.downloads li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
}
.downloads .meta { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }

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

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 3rem;
  color: var(--text-faint);
  font-size: 0.9rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  justify-content: space-between;
  align-items: baseline;
}
.site-footer a {
  color: var(--text-dim);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.site-footer a:hover { color: var(--accent); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }

/* --- Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* --- Studio logo ----------------------------------------------------------
   Transparent PNGs cropped to the artwork, so no blend-mode trickery is needed
   and the logo sits correctly on any background. Two variants exist: the cream
   one for dark surfaces (the site) and the black one for light surfaces (the
   press kit). Native ratio is 1995x1142, roughly 7:4.
   -------------------------------------------------------------------------- */

.brand__logo {
  height: 2.1rem;
  width: auto;
  flex: none;
}

.hero--split {
  display: grid;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}
@media (min-width: 54rem) {
  .hero--split { grid-template-columns: 1.5fr 1fr; }
}

.hero__logo {
  width: min(100%, 26rem);
  justify-self: center;
}

.logo-swatch {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  margin-bottom: 2rem;
}
.logo-swatch figure { margin: 0; }
.logo-swatch img {
  border: 1px solid var(--border);
  border-radius: 3px;
  width: 100%;
  padding: 1.25rem;
}
/* The artwork is transparent, so each tile supplies the surface it is meant
   to be seen on. */
.logo-swatch .on-dark  img { background: var(--bg); }
.logo-swatch .on-light img { background: #ffffff; }
.logo-swatch figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 0.6rem;
}
