/* The Playable Things home page and 404. The per-game accent colours (.card--<slug>) are appended
   by scripts/build.mjs from games.config.mjs. */

:root {
  --bg: #0c0d0f;
  --raised: #15171b;
  --line: #2b2e35;
  --text: #f2f1ec;
  --dim: #a4a7b0;
  --accent: #c6f24e;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 10; background: var(--accent); color: #10130a; padding: 8px 14px; font-weight: 650; }
.skip:focus { top: 16px; }

.top, main, .end { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
.brand rect { fill: var(--accent); }
.brand path { fill: var(--bg); }
.top nav { display: flex; gap: clamp(16px, 3vw, 32px); }
.top nav a { color: var(--dim); text-decoration: none; font-size: 15px; padding: 10px 0; }
.top nav a:hover { color: var(--text); }

.intro { padding-block: clamp(40px, 9vw, 112px) clamp(40px, 7vw, 88px); }
.eyebrow { font: 500 13px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 22px; }
h1 { font-size: clamp(2.6rem, 8.2vw, 6.5rem); line-height: 0.98; font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; }
h1 span { color: var(--accent); }
.lede { margin-top: 28px; max-width: 62ch; color: var(--dim); font-size: clamp(1.05rem, 1.6vw, 1.25rem); text-wrap: pretty; }

.section-title { font: 500 13px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.card { grid-column: span 2; }
.card:nth-child(-n + 2) { grid-column: span 3; }
.card a {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none;
  background: var(--raised); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.card a:hover { border-color: var(--accent); transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .card a { transition: none; } .card a:hover { transform: none; } }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.card__body { display: flex; flex-direction: column; gap: 4px; padding: 20px 22px 24px; }
.card__status { align-self: flex-start; font: 500 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.card__title { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.1; font-weight: 750; letter-spacing: -0.02em; }
.card__genre { color: var(--dim); font-size: 15px; }
.card__tagline { margin-top: 10px; font-size: 16px; line-height: 1.5; text-wrap: pretty; }

@media (max-width: 960px) {
  .card, .card:nth-child(-n + 2) { grid-column: span 3; }
  .card:last-child:nth-child(odd) { grid-column: span 6; }
}
@media (max-width: 620px) {
  .card, .card:nth-child(-n + 2), .card:last-child:nth-child(odd) { grid-column: span 6; }
}

.news {
  margin-block: clamp(56px, 9vw, 120px) clamp(40px, 6vw, 72px);
  padding: clamp(24px, 4vw, 48px);
  background: var(--raised); border: 1px solid var(--line); border-radius: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap;
}
.news__pitch { flex: 1 1 340px; }
.news h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); line-height: 1.1; font-weight: 800; letter-spacing: -0.025em; }
.news p { margin-top: 12px; color: var(--dim); max-width: 48ch; }
.news form { flex: 1 1 340px; display: flex; gap: 10px; max-width: 520px; }
.news input[type="email"] {
  flex: 1 1 auto; min-width: 0; height: 52px; padding: 0 16px;
  background: var(--bg); color: var(--text); border: 1px solid #4a4e58; border-radius: 8px;
  font: inherit;
}
.news input[type="email"]::placeholder { color: #8a8d96; opacity: 1; }
.news button {
  flex: none; height: 52px; padding: 0 22px;
  background: var(--accent); color: #10130a; border: 0; border-radius: 8px; cursor: pointer;
  font: inherit; font-weight: 650;
}
.news button:hover { background: #d8ff6b; }
@media (max-width: 460px) { .news form { flex-wrap: wrap; } .news button { flex: 1 1 100%; } }

.end { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 28px 44px; color: var(--dim); font-size: 14px; border-top: 1px solid var(--line); }
.end a:hover { color: var(--text); }

/* 404 */
.lost { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 20px; padding-block: 48px; }
.lost h1 { font-size: clamp(2.4rem, 7vw, 5rem); }
.lost p { color: var(--dim); max-width: 52ch; }
.lost ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.lost li a { display: block; padding: 10px 16px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.lost li a:hover { border-color: var(--accent); }

.card--annhexation { --accent: #5fb0ee; }
.card--hyperpulse { --accent: #ff3cd7; }
.card--warden { --accent: #f0591c; }
.card--assembly-line { --accent: #f5b800; }
.card--aftertouch { --accent: #edba5e; }
