/* ============ tokens ============ */
:root {
  --bg: #f2efe6;
  --surface: #fbf9f3;
  --ink: #1b1a17;
  --muted: #6b675e;
  --accent: #ff5a36;
  --on-accent: #1b1a17;
  --dot: rgba(27, 26, 23, 0.08);

  --b: 3px;                                /* border width */
  --shadow: 4px 4px 0 var(--ink);
  --shadow-up: 7px 7px 0 var(--ink);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110;
    --surface: #1c1b19;
    --ink: #f2efe6;
    --muted: #9a958a;
    --accent: #ff6b4a;
    --on-accent: #121110;
    --dot: rgba(242, 239, 230, 0.06);
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.5px);
  background-size: 18px 18px;
  color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; }
p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }

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

:focus-visible {
  outline: var(--b) solid var(--accent);
  outline-offset: 4px;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 640px) { .wrap { padding-inline: 32px; } }

.skip {
  position: absolute; left: 16px; top: -100px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; padding: 8px 12px; z-index: 10;
}
.skip:focus { top: 16px; }

/* ============ header ============ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding-block: 28px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.logo-dot {
  width: 0.32em;
  height: 0.32em;
  background: var(--accent);
  border-radius: 50%;
  transition: transform 0.3s var(--ease);
}
.logo:hover .logo-dot { transform: translateY(-0.35em); }

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 22px;
  font-size: 15px;
  font-weight: 600;
}
.nav span { display: contents; }
.nav a, .foot-links a {
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 3px;
  padding-bottom: 2px;
  transition: background-size 0.25s var(--ease);
}
.nav a:hover, .foot-links a:hover { background-size: 100% 3px; }
.ico {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
  vertical-align: -0.18em;
  margin-right: 0.4em;
}

/* ============ hero ============ */
.hero { padding-block: 56px 48px; }
@media (min-width: 640px) { .hero { padding-block: 88px 64px; } }

.hero h1 {
  font-size: clamp(42px, 9vw, 92px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  max-width: 12ch;
}
.hl {
  background: var(--accent);
  color: var(--on-accent);
  padding: 0 0.1em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.intro {
  margin-top: 24px;
  max-width: 44ch;
  color: var(--muted);
  font-size: 18px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 36px 0 0;
}
.stat {
  border: var(--b) solid var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 10px 16px 12px;
  min-width: 120px;
}
.stat dt {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat dd {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

@media (max-width: 480px) {
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat { min-width: 0; padding: 8px 10px 10px; }
  .stat dd { font-size: 24px; }
}

/* ============ section head ============ */
.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.section-head h2 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.count { color: var(--muted); }
.rule {
  flex: 1;
  height: var(--b);
  background: var(--ink);
}

/* ============ game grid ============ */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 28px;
}

.card { display: flex; }

.card-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-decoration: none;
  background: var(--surface);
  border: var(--b) solid var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.card-link:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-up);
}
.card-link:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-bottom: var(--b) solid var(--ink);
  overflow: hidden;
  background: var(--bg);
}
.thumb img, .thumb svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease);
}
.card-link:hover .thumb img, .card-link:hover .thumb svg { transform: scale(1.04); }
.thumb img.is-icon { object-position: center 40%; }  /* square game icon cropped to 16:9 */

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: var(--on-accent);
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px 3px;
}
.num {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #1b1a17;               /* fixed: sits on cover art, not theme */
  color: #f2efe6;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px 3px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
  flex: 1;
}

.meta {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.meta span + span::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 10px;
  vertical-align: 1px;
  background: var(--accent);
  border-radius: 50%;
}

.card h3 { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }

.card p { color: var(--muted); font-size: 15px; }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 10px;
}
.visits { font-size: 14px; color: var(--muted); }
.visits strong { color: var(--ink); font-weight: 700; }

.play {
  font-weight: 700;
  font-size: 14px;
  border: 2px solid var(--ink);
  padding: 4px 12px 5px;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.card-link:hover .play, .card-link:focus-visible .play {
  background: var(--accent);
  color: var(--on-accent);
}

.empty {
  border: var(--b) dashed var(--muted);
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

/* ============ footer ============ */
.site-footer {
  margin-top: 96px;
  padding-block: 28px 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  border-top: var(--b) solid var(--ink);
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-weight: 600;
  font-size: 15px;
}
.fine { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ============ motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
