/* IndiGamer: one stylesheet for every page. All colours and fonts are tokens. */
:root {
  --paper: #f6f1e7;
  --card: #fffaf0;
  --ink: #1d1b16;
  --muted: #575146;
  --line: #d6ccb9;
  --accent: #b8321b;        /* chilli red: 5.6:1 with white, 5.2:1 on paper */
  --accent-hover: #962713;
  --on-accent: #fff8f2;
  --note-bg: #fbe9b7;
  --note-ink: #4a3a05;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-head: "Segoe UI Black", "Arial Black", system-ui, -apple-system, Roboto, sans-serif;
  --radius: 10px;
  --gutter: 16px;
  --max: 1080px;
  --col-gap: 40px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

/* Header */
.site-head { border-bottom: 2px solid var(--ink); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { font: 900 1.375rem/1 var(--font-head); color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand b { color: var(--accent); font-weight: inherit; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 12px 8px; min-height: 48px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

/* Type */
h1, h2, h3 { font-family: var(--font-head); font-weight: 900; line-height: 1.05; letter-spacing: -0.02em; margin: 0; overflow-wrap: break-word; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 7vw, 4.5rem); }
h2 { font-size: clamp(1.625rem, 4vw, 2.25rem); }
h3 { font-size: 1.25rem; line-height: 1.2; }
.lede { font-size: 1.1875rem; color: var(--muted); max-width: 38ch; margin: 16px 0 0; }
p { max-width: 65ch; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 24px; border-radius: var(--radius);
  font: 700 1.0625rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-secondary { background: var(--card); color: var(--ink); }
.btn-secondary:hover { color: var(--ink); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn[aria-disabled="true"] { background: transparent; color: var(--muted); border-style: dashed; border-color: var(--muted); box-shadow: none; cursor: not-allowed; transform: none; }
.btn-note { display: block; font-size: .9375rem; color: var(--muted); margin-top: 8px; }

/* Home hero */
.hero { padding: 48px 0 40px; }
.hero h1 { max-width: 14ch; }

/* Game grid */
.section { padding: 40px 0; border-top: 2px solid var(--ink); }
.section > .wrap > h2 { margin-bottom: 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.game-card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.game-card img { width: 100%; height: 100%; object-fit: cover; border-right: 2px solid var(--ink); }
.game-card .body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.game-card p { margin: 0; color: var(--muted); }
.game-card .actions { margin-top: auto; flex-direction: column; }
.game-card .btn { width: 100%; }
.tag { font-size: .875rem; font-weight: 600; color: var(--muted); }

/* Game page */
.game-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--col-gap); align-items: center; padding: 40px 0 48px; }
.game-hero .shot { justify-self: center; }
.shot { border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; box-shadow: 6px 6px 0 var(--ink); background: var(--ink); max-width: 300px; }
.facts { margin: 20px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .9375rem; }
.facts li { padding: 2px 0; }
.moments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--col-gap); }
.moment .shot { max-width: 100%; margin-bottom: 16px; }
.moment p { margin: 8px 0 0; color: var(--muted); }
.controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--col-gap); }
.controls dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.controls dt { font-weight: 700; }
.controls dd { margin: 0; color: var(--muted); }
kbd { font: 600 .875rem/1 var(--font-body); border: 1.5px solid var(--ink); border-bottom-width: 3px; border-radius: 5px; padding: 4px 8px; background: var(--card); }
.closer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--col-gap); align-items: center; }
.closer .shot { max-width: 240px; }

/* Plain text pages */
.prose { padding: 40px 0 56px; }
.prose h1 { margin-bottom: 16px; }
.prose h2 { font-size: 1.5rem; margin: 36px 0 8px; }
.note { background: var(--note-bg); color: var(--note-ink); border: 2px solid var(--note-ink); border-radius: var(--radius); padding: 16px; max-width: 65ch; }
.note strong { display: block; }

/* Footer */
.site-foot { border-top: 2px solid var(--ink); padding: 28px 0 40px; color: var(--muted); font-size: .9375rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-foot a { color: var(--ink); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-foot nav a { min-height: 48px; display: inline-flex; align-items: center; }

@media (max-width: 760px) {
  .game-hero, .closer { grid-template-columns: minmax(0, 1fr); gap: var(--col-gap); }
  .game-hero { padding-top: 28px; }
  .game-hero .shot { max-width: 240px; }
  .closer .shot { justify-self: center; }
  .moments { grid-template-columns: minmax(0, 1fr); }
  .moment { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr); gap: 16px; align-items: start; }
  .moment .shot { margin: 0; box-shadow: 3px 3px 0 var(--ink); border-radius: 10px; }
  .controls { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 32px 0 32px; }
}
@media (max-width: 420px) {
  .game-card { grid-template-columns: minmax(0, 1fr); }
  .game-card img { border-right: 0; border-bottom: 2px solid var(--ink); aspect-ratio: 4 / 3; object-position: 50% 62%; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .btn:hover, .btn:active { transition: none; transform: none; }
}

.controls { margin-top: 24px; }
.small-link { margin-top: 20px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--col-gap); align-items: center; }
.hero-shot { margin: 0; justify-self: center; }
.hero-shot .shot { max-width: 260px; transform: rotate(2deg); }
.hero-shot figcaption { margin-top: 16px; text-align: center; font-weight: 600; }
.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); }
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero-shot { display: none; }
}
.brand { min-height: 48px; display: inline-flex; align-items: center; }
.small-link a { display: inline-block; padding: 12px 0; }
.site-foot .wrap { align-items: center; }
.controls h3 { margin-bottom: 12px; }
/* Visible owner placeholder: must be gone before deploy (grep "class=\"todo\""). */
.todo { background: var(--note-bg); color: var(--note-ink); font-weight: 700; padding: 0 4px; border-radius: 4px; }
.prose ul { padding-left: 1.25em; max-width: 65ch; }
.prose li { margin: 4px 0; }
