:root {
  --bg: #09090d;
  --bg-2: #121218;
  --ink: #f3efe6;
  --muted: #b7b1a4;
  --line: rgba(243, 239, 230, 0.12);
  --gold: #c6a45b;
  --paper: #16151c;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(198, 164, 91, 0.12), transparent 50%),
    radial-gradient(900px 500px at 110% 0%, rgba(62, 198, 255, 0.08), transparent 46%),
    var(--bg);
  font-family: "Source Sans 3", system-ui, sans-serif;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 8;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>");
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(9, 9, 13, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #06102a;
}
.brand small {
  display: block;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--muted);
}
.brand strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
}
.head-nav {
  display: flex;
  gap: 18px;
  font-weight: 600;
}
.head-nav a {
  text-decoration: none;
  color: var(--muted);
}
.head-nav a:hover { color: var(--ink); }

.hero, .catalog, .site-foot {
  width: min(1120px, calc(100% - 36px));
  margin-inline: auto;
}
.hero {
  padding: clamp(48px, 8vw, 96px) 0 28px;
}
.eyebrow {
  margin: 0 0 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}
h1, h2 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
h1 {
  margin: 0 0 18px;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  max-width: 14ch;
}
.lede {
  max-width: 46ch;
  font-size: 1.15rem;
  color: var(--muted);
}
.hero-count {
  margin-top: 28px;
  display: inline-block;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
}

.catalog { padding: 24px 0 64px; }
.catalog-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
.catalog-bar h2 { margin: 0; font-size: 1.8rem; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.filter[aria-pressed="true"],
.filter:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.search input {
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
}
.search input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.featured { margin-bottom: 22px; }
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.card {
  display: grid;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 100%;
  transition: transform 180ms ease, border-color 180ms ease;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 55%, white 10%); }
.cover {
  position: relative;
  aspect-ratio: 21 / 13;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 46%),
    #0c0c12;
  overflow: hidden;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}
.body {
  padding: 18px 18px 20px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.body h3 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.55rem;
  line-height: 1.15;
}
.blurb { margin: 0; color: var(--muted); }
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tags li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid var(--line);
}
.btn.play {
  background: var(--accent);
  color: #111;
  border-color: transparent;
}
.btn.repo { color: var(--ink); }
.btn.repo:hover { background: rgba(255, 255, 255, 0.05); }

.card.wide {
  display: grid;
}
.card.wide .cover { min-height: 240px; }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
}

.site-foot {
  padding: 28px 0 48px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.noscript { padding: 24px; text-align: center; }

@media (min-width: 720px) {
  .catalog-bar {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card.wide {
    grid-template-columns: 1.2fr 1fr;
  }
  .card.wide .cover {
    aspect-ratio: auto;
    min-height: 100%;
  }
}
@media (min-width: 1020px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .featured .card.wide { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
  .card:hover { transform: none; }
}
