/* bluemakes.games - one stylesheet for every page.
   A light take on Piet Mondrian: plain white pages with solid black borders, square corners,
   and red, yellow and blue used as accents (heading squares, card strips, buttons). */

:root {
  --ink: #111111;          /* text and borders */
  --paper: #ffffff;
  --muted: #555555;
  --red: #e1262c;
  --yellow: #f6c90e;
  --blue: #1d4fa0;
  --border: 3px solid var(--ink);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max-width: 1000px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
}

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

a { color: var(--ink); }

h1, h2, h3 { font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px;
}

/* ---------- Header and footer ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: var(--border);
  margin-bottom: 40px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.15rem;
  text-decoration: none;
}

.logo img { width: 40px; height: 40px; border: var(--border); }

.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }

.site-nav a {
  padding: 6px 10px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 4px solid transparent;
}

/* each nav link underlines in its own colour */
.site-nav a:nth-child(1):hover { border-color: var(--red); }
.site-nav a:nth-child(2):hover { border-color: var(--yellow); }
.site-nav a:nth-child(3):hover { border-color: var(--blue); }
.site-nav a:nth-child(4):hover { border-color: var(--ink); }

.site-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 56px;
  padding-top: 16px;
  border-top: var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* three little colour squares at the start of the footer */
.site-footer::before {
  content: "";
  width: 48px;
  height: 14px;
  background: linear-gradient(90deg, var(--red) 33%, var(--yellow) 33% 66%, var(--blue) 66%);
  border: 2px solid var(--ink);
}

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

.section { margin-bottom: 56px; scroll-margin-top: 16px; }

.section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 1.8rem;
}

/* the coloured square before each heading; set per section with style="--swatch: ..." */
.section h2::before {
  content: "";
  width: 20px;
  height: 20px;
  background: var(--swatch, var(--red));
  border: var(--border);
}

/* ---------- Steam games ---------- */

.steam-game {
  padding: 20px;
  border: var(--border);
  border-left-width: 12px;
  border-left-color: var(--red);
  margin-bottom: 16px;
}

.steam-game.upcoming { border-left-color: var(--yellow); }

.steam-game h3 { margin: 0 0 8px; font-size: 1.3rem; }
.steam-game p  { margin: 0 0 12px; }
.steam-game p:last-child { margin-bottom: 0; }

/* Steam's own store widget is 646 px wide; let it shrink on phones. */
.steam-widget {
  display: block;
  width: 100%;
  max-width: 646px;
  height: 190px;
  border: 0;
  margin-bottom: 12px;
}

.coming-soon {
  display: inline-block;
  padding: 4px 10px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Web game cards ---------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.game-card {
  display: flex;
  flex-direction: column;
  border: var(--border);
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s;
}

.game-card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }

.game-card img {
  width: 100%;
  aspect-ratio: 315 / 250;
  object-fit: cover;
  border-bottom: var(--border);
}

.game-card .info { padding: 12px 14px; flex: 1; }
.game-card h3 { margin: 0 0 4px; font-size: 1.1rem; }
.game-card p  { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* coloured "Play" strip at the bottom; the colour cycles red, yellow, blue.
   nth-of-type, not nth-child: the grid also holds a <noscript>, which nth-child would count. */
.game-card .play {
  padding: 8px 14px;
  border-top: var(--border);
  font-weight: 900;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.game-card:nth-of-type(3n+1) .play { background: var(--red); }
.game-card:nth-of-type(3n+2) .play { background: var(--yellow); }
.game-card:nth-of-type(3n+3) .play { background: var(--blue); color: var(--paper); }

/* ---------- Buttons and the newsletter form ---------- */

.signup { display: flex; flex-wrap: wrap; gap: 8px; max-width: 520px; }

.signup input {
  flex: 1 1 220px;
  padding: 10px 12px;
  border: var(--border);
  font: inherit;
}

.button,
.signup button,
.player-actions button,
.player-actions a {
  display: inline-block;
  padding: 8px 16px;
  border: var(--border);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.signup button { background: var(--blue); color: var(--paper); }

.button:hover,
.signup button:hover,
.player-actions button:hover,
.player-actions a:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }

.form-note { color: var(--muted); font-size: 0.9rem; }

/* hidden on screen, still read out by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Play page ---------- */

.player-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.player-head h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.player-actions { display: flex; gap: 8px; }
.player-actions button { background: var(--yellow); }

.player iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;   /* replaced with the game's own shape by play.js */
  border: var(--border);
  background: var(--ink);
}
