@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --ink: #140c0a;
  --night: #1d1210;
  --panel: #2a1a16;
  --line: #4a2f27;
  --cream: #fff1e0;
  --muted: #d9bfa8;
  --orange: #f08a4b;
  --orange-deep: #e2683a;
  --display: "Fredoka", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font: 1rem/1.6 var(--body);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--orange);
}

:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  margin-bottom: 1.25rem;
}

/* Hero: the key art has a dark, empty left side made for the logo. */
.hero {
  background:
    linear-gradient(90deg, rgb(20 12 10 / 0.86) 0%, rgb(20 12 10 / 0.6) 38%, rgb(20 12 10 / 0) 62%),
    linear-gradient(0deg, var(--night) 0%, rgb(29 18 16 / 0) 22%),
    url("/assets/hero.webp") right center / cover no-repeat var(--ink);
  min-height: min(78vh, 640px);
  display: flex;
  align-items: center;
}

.hero-inner {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
  padding-block: 3rem;
}

.hero-inner > * {
  max-width: 30rem;
}

.hero h1 img {
  width: min(100%, 28rem);
}

.tagline {
  font: 600 clamp(1.3rem, 3vw, 1.7rem) / 1.2 var(--display);
  color: var(--orange);
  margin: 1.5rem 0 0.5rem;
}

.intro {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
  text-shadow: 0 1px 6px var(--ink);
}

main > section,
#games {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
  padding-block: 3rem 1rem;
  scroll-margin-top: 1rem;
}

.game-section:not([hidden]) ~ .game-section {
  margin-top: 3.5rem;
}

.game-section h2:has(+ .section-note) {
  margin-bottom: 0.35rem;
}

.section-note {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.button {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  border: 2px solid var(--orange);
  color: var(--cream);
  font: 600 1rem/1.2 var(--display);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.button:hover,
.button.primary {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}

.button.primary:hover {
  background: var(--cream);
  border-color: var(--cream);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filters button {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: 500 1rem/1.2 var(--display);
  cursor: pointer;
}

.filters button:hover {
  border-color: var(--orange);
  color: var(--cream);
}

.filters button[aria-pressed="true"] {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--ink);
}

.games,
.links,
.tags {
  list-style: none;
  margin: 0;
  padding: 0;
}

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.5rem;
}

.game {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
}

/* Cover art comes in several shapes (Steam, itch.io, OpenGame). Each one is
   shown whole, over a blurred copy of itself that fills the 16:9 frame. */
.game-art {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink);
}

.game-art::before {
  content: "";
  position: absolute;
  inset: -2rem;
  background: var(--art) center / cover;
  filter: blur(18px) brightness(0.7);
}

.game-art img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s;
}

.game:hover .game-art img {
  transform: scale(1.03);
}

.game-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem 1.35rem;
}

.game h3 {
  font-size: 1.45rem;
}

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

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tags li {
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.tags .badge {
  background: var(--orange-deep);
  border-color: var(--orange-deep);
  color: var(--ink);
  font-weight: 700;
}

.game-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.4rem;
}

.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border: 2px solid var(--orange-deep);
  border-radius: 1rem;
}

.callout div {
  flex: 1 1 18rem;
}

.callout h3 {
  font-size: 1.35rem;
}

.callout p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
}

.links a {
  display: block;
  height: 100%;
  padding: 1rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  text-decoration: none;
  transition: border-color 0.15s;
}

.links a:hover {
  border-color: var(--orange);
}

.links strong {
  display: block;
  font: 600 1.3rem/1.3 var(--display);
  color: var(--cream);
}

.links span {
  color: var(--muted);
}

.site-footer {
  padding: 3rem 1rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.not-found {
  min-height: 70vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
  text-align: center;
}

.not-found img {
  width: min(100%, 24rem);
}

/* Narrow screens: show the characters on top and the text below them. */
@media (max-width: 720px) {
  .hero {
    background:
      linear-gradient(0deg, var(--night) 0%, var(--night) 12%, rgb(29 18 16 / 0) 100%) bottom / 100% 55% no-repeat,
      url("/assets/hero.webp") 80% top / auto 21rem no-repeat var(--night);
    min-height: 0;
    align-items: flex-end;
  }

  .hero-inner {
    padding-block: 15rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
