:root {
  --paper: #f2f0eb;
  --ink: #161514;
  --muted: #6b6862;
  --rule: #d9d5cc;
  --frame: #e6e3dc;
  --accent: #d9431e;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
  --pad: clamp(16px, 4vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121211;
    --ink: #ecebe6;
    --muted: #8f8c85;
    --rule: #2a2927;
    --frame: #1c1b1a;
    --accent: #ff6a3d;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* Top bar */
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px var(--pad);
  border-bottom: 1px solid var(--rule);
}
.name {
  font: 400 26px/1 var(--serif);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.top nav a {
  font: 400 13px/1 var(--mono);
  text-decoration: none;
  color: var(--muted);
  transition: color .15s;
}
.top nav a:hover { color: var(--ink); }

main {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Intro */
.intro {
  padding: clamp(56px, 10vw, 128px) 0 clamp(40px, 6vw, 72px);
  max-width: 900px;
}
.intro h1 {
  margin: 0;
  font: 400 clamp(44px, 7.4vw, 104px)/0.98 var(--serif);
  letter-spacing: -0.025em;
}
.intro h1 em { color: var(--muted); }
.lede {
  margin: 28px 0 0;
  max-width: 44ch;
  color: var(--muted);
  font-size: 17px;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
  gap: clamp(40px, 5vw, 64px) clamp(24px, 3vw, 40px);
  padding-bottom: clamp(64px, 10vw, 120px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.frame {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--frame);
  border-radius: 6px;
}
.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform .7s cubic-bezier(.2, .7, .2, 1), filter .4s;
}

.meta {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0 16px;
  padding-top: 20px;
  border-top: 1px solid transparent;
}
.num {
  font: 400 13px/2.3 var(--mono);
  color: var(--muted);
}
.body h2 {
  margin: 0;
  font: 400 clamp(30px, 3vw, 38px)/1.1 var(--serif);
  letter-spacing: -0.015em;
}
.play { text-decoration: none; }
/* The title link covers the whole card, so a click anywhere opens the game. */
.play::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.play:focus-visible { outline: none; }
.card:has(.play:focus-visible) .frame {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.body p {
  margin: 10px 0 0;
  max-width: 52ch;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font: 400 12px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  font: 400 13px/2.3 var(--mono);
}
.go { white-space: nowrap; }
.arrow {
  display: inline-block;
  transition: transform .25s ease;
}
.src {
  position: relative;
  z-index: 2; /* sits above the card-wide link */
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
  line-height: 1.4;
}
.src:hover { color: var(--ink); text-decoration-color: currentColor; }

@media (hover: hover) {
  .card:hover .frame img { transform: scale(1.035); }
  .card:hover .go { color: var(--accent); }
  .card:hover .arrow { transform: translateX(4px); }
  .card:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
}

@media (max-width: 560px) {
  .meta { grid-template-columns: 1fr auto; }
  .num { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Footer */
.foot {
  display: flex;
  justify-content: space-between;
  padding: 22px var(--pad);
  border-top: 1px solid var(--rule);
  font: 400 12px/1 var(--mono);
  color: var(--muted);
}
