:root {
  color-scheme: light;

  --page: #f5f3ee;
  --ink: #23221f;
  --muted: #625f58;
  --rule: #8a857b;
  --hover: #ebe8e1;
  --active: #e1ddd4;
  --focus: #23221f;
  --preview-bg: #191918;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --row-padding: clamp(1rem, 2.5vw, 2rem);
  --content-width: 76rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --page: #191918;
    --ink: #f0eee8;
    --muted: #b7b3aa;
    --rule: #817d74;
    --hover: #252523;
    --active: #30302c;
    --focus: #f0eee8;
  }
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
}

.catalogue,
.site-footer {
  width: calc(100% - var(--gutter) - var(--gutter));
  max-width: var(--content-width);
  margin-inline: auto;
}

.catalogue {
  padding-top: clamp(3rem, 7vw, 6rem);
}

.masthead {
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.masthead h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.masthead p {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.125rem);
}

.game-list {
  /* the rows' padding sits outside the text column, so game names line up with the title */
  margin: 0 calc(var(--row-padding) * -1);
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.game-list > li {
  border-bottom: 1px solid var(--rule);
}

.game-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  min-width: 0;
  padding: var(--row-padding);
  background: var(--page);
  color: var(--ink);
  text-decoration: none;
}

.game-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.game-copy h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.375rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.game-summary {
  max-width: 45ch;
  margin: 1rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.55;
}

.game-details {
  max-width: 52ch;
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.game-meta {
  display: grid;
  gap: 0.375rem;
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.game-meta > div {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0.5rem;
}

.game-meta dt {
  font-weight: 600;
}

.game-meta dd {
  margin: 0;
  color: var(--muted);
}

.play-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 1.5rem;
  font-size: 1rem;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.25em;
}

.game-shot {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1200 / 615;
  background: var(--preview-bg);
}

.game-link:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}

.game-link:focus-visible .play-label {
  text-decoration-color: currentColor;
}

@media (hover: hover) {
  .game-link:hover {
    background: var(--hover);
  }

  .game-link:hover .play-label {
    text-decoration-color: currentColor;
  }
}

.game-link:active {
  background: var(--active);
}

.site-footer {
  padding-block: 1.5rem 3rem;
}

.site-footer p {
  max-width: 90ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

@media (min-width: 46rem) {
  .game-link {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .game-link {
    transition: background-color 120ms ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-link {
    transition: none;
  }
}

@media (forced-colors: active) {
  .game-link {
    color: LinkText;
  }

  .game-link:focus-visible {
    outline-color: Highlight;
  }

  .play-label {
    text-decoration-color: currentColor;
  }
}
