/* Game Library: porcelain capsule wall.
   Palette and type are derived from one idea: each game is a glazed
   ceramic tile with a recessed screenshot window and a maker's mark. */

:root {
  --porcelain: #eef0f3;
  --glaze: #fafbfc;
  --glaze-hi: #ffffff;
  --kiln: #14161c;
  --slate: #5c6370;
  --slate-soft: #6b7280;
  --hairline: #d8dce3;
  --arc: #4b2eff;
  --arc-press: #3a1fe6;
  --arc-soft: #e6e2ff;

  --font-display: "Unbounded", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius-tile: 22px;
  --radius-window: 14px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --tile-shadow:
    inset 0 1px 0 var(--glaze-hi),
    0 0 0 1px rgba(20, 22, 28, 0.06),
    0 2px 4px rgba(20, 22, 28, 0.04),
    0 14px 30px -14px rgba(20, 22, 28, 0.28);
  --tile-shadow-lift:
    inset 0 1px 0 var(--glaze-hi),
    0 0 0 1px rgba(20, 22, 28, 0.07),
    0 6px 12px rgba(20, 22, 28, 0.06),
    0 30px 50px -18px rgba(20, 22, 28, 0.38);
}

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

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

body {
  min-width: 320px;
  margin: 0;
  color: var(--kiln);
  background:
    radial-gradient(1200px 520px at 85% -10%, rgba(75, 46, 255, 0.07), transparent 60%),
    var(--porcelain);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

body.sheet-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 50;
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--kiln);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.frame {
  width: min(1240px, calc(100% - 32px));
  margin-inline: auto;
}

/* ---------- Top bar (mirrors the main site's nav) ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(238, 240, 243, 0.86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}

.topbar.scrolled {
  border-bottom-color: var(--hairline);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  width: 24px;
  height: 24px;
  border: 1px solid var(--kiln);
  border-radius: 10px;
  background: var(--glaze-hi);
}

.brand-mark::after {
  position: absolute;
  inset: 6px;
  border-radius: 5px;
  background: var(--kiln);
  content: "";
}

.topbar-links {
  display: flex;
  gap: 4px;
  font-size: 14px;
  color: var(--slate);
}

.topbar-links a {
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.topbar-links a:hover {
  color: var(--kiln);
  background: rgba(20, 22, 28, 0.06);
}

.topbar-links a[aria-current="page"] {
  color: var(--kiln);
  background: var(--glaze-hi);
  box-shadow: 0 0 0 1px var(--hairline);
}

/* ---------- Intro ---------- */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: end;
  gap: 32px 48px;
  padding: clamp(40px, 8vw, 96px) 0 clamp(28px, 4vw, 44px);
}

.intro-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(54px, 10.5vw, 150px);
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.intro-copy {
  padding-bottom: 8px;
}

.intro-lede {
  max-width: 34ch;
  margin: 0 0 16px;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.45;
  color: var(--kiln);
  text-wrap: pretty;
}

.intro-ledger {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
}

.intro-ledger span + span::before {
  content: "\00B7";
  margin: 0 10px;
  color: var(--slate-soft);
}

/* ---------- Controls ---------- */

.controls {
  display: grid;
  gap: 14px;
  padding: 18px 0 22px;
  border-top: 1px solid var(--hairline);
}

.intro[hidden] {
  display: none;
}

/* With the intro hidden, the controls sit directly under the top bar. */
.intro[hidden] + .controls {
  padding-top: clamp(20px, 3vw, 32px);
  border-top: 0;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-divider {
  width: 1px;
  height: 22px;
  background: var(--hairline);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--kiln);
  background: var(--glaze);
  box-shadow: inset 0 0 0 1px var(--hairline);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms var(--ease-out);
}

.chip:hover {
  background: var(--glaze-hi);
  box-shadow: inset 0 0 0 1px #c3c8d1;
}

.chip:active {
  transform: scale(0.97);
}

.chip[aria-pressed="true"] {
  color: #fff;
  background: var(--arc);
  box-shadow: none;
}

.chip-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-soft);
}

.chip[aria-pressed="true"] .chip-count {
  color: rgba(255, 255, 255, 0.72);
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  max-width: 360px;
  min-height: 40px;
  padding: 0 12px;
  gap: 8px;
  border-radius: 999px;
  color: var(--slate);
  background: var(--glaze-hi);
  box-shadow: inset 0 0 0 1px var(--hairline), inset 0 1px 2px rgba(20, 22, 28, 0.05);
}

.search:focus-within {
  box-shadow: inset 0 0 0 2px var(--arc);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 0;
  outline: 0;
  font-size: 15px;
  color: var(--kiln);
  background: transparent;
}

.search input::placeholder {
  color: var(--slate-soft);
}

.search kbd {
  padding: 1px 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate);
  background: var(--porcelain);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.sort select {
  min-height: 40px;
  padding: 0 34px 0 14px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235c6370' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") right 14px center / 10px 6px no-repeat,
    var(--glaze-hi);
  box-shadow: inset 0 0 0 1px var(--hairline);
  appearance: none;
  cursor: pointer;
}

.count {
  margin: 0 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
}

/* ---------- The wall ---------- */

.wall {
  display: grid;
  /* 4 columns from ~1000px wide, so the 3 featured tiles read larger. */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 228px), 1fr));
  gap: 30px 24px;
  margin: 0;
  padding: 6px 0 40px;
  list-style: none;
}

.capsule {
  perspective: 900px;
  animation: settle 620ms var(--ease-out) both;
  animation-delay: calc(min(var(--i, 0), 14) * 34ms);
}

.wall.settled .capsule {
  animation: none;
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.tile {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  padding: 9px 9px 16px;
  border: 0;
  border-radius: var(--radius-tile);
  text-align: left;
  background: linear-gradient(180deg, var(--glaze-hi) 0%, var(--glaze) 100%);
  box-shadow: var(--tile-shadow);
  cursor: pointer;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 520ms var(--ease-out), box-shadow 320ms ease;
}

.tile:hover,
.tile:focus-visible {
  box-shadow: var(--tile-shadow-lift);
}

.tile.is-tracking {
  transition: transform 90ms linear, box-shadow 320ms ease;
}

/* Specular light on the glaze, positioned by the pointer. */
.tile::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    520px circle at var(--mx, 30%) var(--my, 0%),
    rgba(255, 255, 255, 0.42),
    rgba(255, 255, 255, 0.1) 26%,
    rgba(255, 255, 255, 0) 52%
  );
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms ease;
  content: "";
}

.tile:hover::after {
  opacity: 1;
}

.tile-window {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-window);
  background: #0b0d12;
  box-shadow: 0 0 0 1px rgba(20, 22, 28, 0.1);
}

.tile-window img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease-out);
}

.tile:hover .tile-window img {
  transform: scale(1.035);
}

/* Glaze over the screenshot: a recessed rim and a soft top highlight. */
.tile-window::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 34%);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
  content: "";
}

.tile-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 14px 7px 0;
}

.tile-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.tile-tagline {
  grid-column: 1 / -1;
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
  color: var(--slate);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tile-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate-soft);
}

/* ---------- Maker's mark: a stamp pressed into the glaze ---------- */

.mark {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgba(20, 22, 28, 0.5);
  background: var(--glaze);
  box-shadow:
    inset 0 1px 2px rgba(20, 22, 28, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.mark[hidden] {
  display: none;
}

.tile .mark {
  grid-row: 1;
  grid-column: 2;
  align-self: start;
}

/* ---------- Empty state ---------- */

.empty {
  padding: 56px 0 80px;
  text-align: center;
  color: var(--slate);
}

.empty p {
  margin: 0 0 10px;
}

.text-button {
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  color: var(--arc);
  background: var(--arc-soft);
  cursor: pointer;
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--slate);
}

.footer p {
  margin: 0;
}

.footer a {
  color: var(--kiln);
  font-weight: 500;
  text-underline-offset: 3px;
}

/* ---------- Detail sheet ---------- */

.sheet {
  width: min(1120px, calc(100% - 24px));
  max-width: none;
  max-height: min(94dvh, 980px);
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 28px 28px 0 0;
  color: var(--kiln);
  background: linear-gradient(180deg, var(--glaze-hi), var(--glaze) 40%);
  box-shadow: 0 -20px 60px rgba(20, 22, 28, 0.28);
  overflow: hidden;
}

.sheet[open] {
  animation: sheet-rise 460ms var(--ease-out);
}

.sheet.is-closing {
  animation: sheet-sink 260ms ease-in forwards;
}

.sheet::backdrop {
  background: rgba(20, 22, 28, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sheet[open]::backdrop {
  animation: fade-in 300ms ease;
}

.sheet.is-closing::backdrop {
  animation: fade-out 260ms ease forwards;
}

@keyframes sheet-rise {
  from {
    transform: translateY(100%);
  }
}

@keyframes sheet-sink {
  to {
    transform: translateY(100%);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

.sheet-panel {
  position: relative;
  display: grid;
  max-height: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet-media {
  position: relative;
  margin: 12px 12px 0;
  overflow: hidden;
  border-radius: 20px;
  background: #0b0d12;
  /* Full sheet width; 16:9 until the viewport is short, then cover-crop. */
  height: min(58dvh, calc((min(1120px, 100vw - 24px) - 24px) * 0.5625));
}

.sheet-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet-media::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  content: "";
}

.sheet-nav {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  display: flex;
  gap: 8px;
}

.round-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  color: var(--kiln);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms var(--ease-out);
}

.round-button:hover {
  background: #fff;
}

.round-button:active {
  transform: scale(0.94);
}

.sheet-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
}

.sheet-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 22px 40px;
  padding: 24px 32px 32px;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.sheet-head .mark {
  flex: none;
  margin-top: 4px;
}

.sheet-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.sheet-tagline {
  max-width: 52ch;
  margin: 0;
  font-size: 17px;
  color: var(--slate);
  text-wrap: pretty;
}

.specs {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 24px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}

.specs div {
  min-width: 0;
}

.specs dt {
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate-soft);
}

.specs dd {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.sheet-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  gap: 10px;
  min-width: 230px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms var(--ease-out), box-shadow 160ms ease;
}

.button:active {
  transform: scale(0.98);
}

.button-primary {
  color: #fff;
  background: var(--arc);
  box-shadow: 0 10px 24px -10px rgba(75, 46, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.button-primary:hover {
  background: var(--arc-press);
}

.button-secondary {
  color: var(--kiln);
  background: var(--glaze-hi);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.button-secondary:hover {
  box-shadow: inset 0 0 0 1px #b9bfca;
}

.private-note {
  margin: 0;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  color: var(--slate);
  background: var(--porcelain);
}

/* ---------- Featured row ---------- */

.featured {
  padding: clamp(20px, 3vw, 32px) 0 clamp(26px, 3vw, 36px);
}

.featured-label {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.feature {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 10px 10px 18px;
  border-radius: 26px;
  background: linear-gradient(180deg, var(--glaze-hi) 0%, var(--glaze) 100%);
  box-shadow: var(--tile-shadow);
}

.feature-link {
  text-decoration: none;
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

.feature-window {
  border-radius: 18px;
}

.video-window {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b0d12;
  box-shadow: 0 0 0 1px rgba(20, 22, 28, 0.1);
}

.video-window::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
  content: "";
}

.feature-media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sound-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px 0 11px;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: rgba(12, 14, 20, 0.58);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: background 200ms ease, box-shadow 200ms ease, opacity 260ms ease, transform 260ms var(--ease-out);
}

.sound-toggle:active {
  transform: scale(0.97);
}

.sound-toggle .icon-sound,
.sound-toggle[aria-pressed="true"] .icon-muted {
  display: none;
}

.sound-toggle[aria-pressed="true"] .icon-sound {
  display: block;
}

.sound-toggle[aria-pressed="true"] {
  background: var(--arc);
  box-shadow: 0 8px 20px -8px rgba(75, 46, 255, 0.8);
}

.sound-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(12, 14, 20, 0.85);
}

/* With sound on, the button gets out of the way so the video is clean. */
.video-window.sound-on .sound-toggle {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.video-window.sound-on.reveal .sound-toggle,
.video-window.sound-on .sound-toggle:focus-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@media (hover: hover) {
  .video-window.sound-on:hover .sound-toggle {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

/* Video failed to load: keep the poster, drop the sound control. */
.no-player .sound-toggle {
  display: none;
}

.feature-body {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 16px 8px 0;
}

.feature-eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate-soft);
}

.feature-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.feature-text {
  max-width: 46ch;
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--slate);
  text-wrap: pretty;
}

.feature-cta {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  margin-top: 8px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--arc);
  text-decoration: none;
  text-underline-offset: 3px;
}

a.feature-cta:hover,
.feature-link:hover .feature-cta {
  text-decoration: underline;
}

.feature-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  margin-top: 8px;
}

.feature-actions .feature-cta {
  margin-top: 0;
}

.feature-pause {
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
  background: none;
  cursor: pointer;
  text-underline-offset: 3px;
}

.feature-pause:hover {
  color: var(--kiln);
  text-decoration: underline;
}

.no-player .feature-pause {
  display: none;
}

@media (max-width: 1000px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Thinklet takes the full first row, image beside the copy. */
  .feature-link {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    gap: 8px;
  }

  .feature-link .feature-body {
    padding: 8px 16px;
  }
}

@media (max-width: 640px) {
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .feature-link {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .feature-link .feature-body {
    padding: 16px 8px 0;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sheet {
    width: 100%;
    border-radius: 24px 24px 0 0;
  }

  .sheet-body {
    grid-template-columns: 1fr;
    padding: 20px 20px 28px;
  }

  .sheet-actions {
    grid-column: 1;
    grid-row: auto;
    min-width: 0;
  }

  .sheet-close {
    top: 20px;
    right: 20px;
  }
}

@media (max-width: 560px) {
  .topbar-links a:first-child {
    display: none;
  }

  .filter-row {
    flex-wrap: nowrap;
    margin-inline: -16px;
    padding: 2px 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .chips {
    flex-wrap: nowrap;
  }

  .chip {
    flex: none;
  }

  .search {
    max-width: none;
  }

  .search kbd {
    display: none;
  }

  .count {
    width: 100%;
    margin-left: 0;
  }

  .sheet-media {
    height: min(52dvh, calc((100vw - 16px) * 0.5625));
    margin: 8px 8px 0;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .capsule,
  .sheet[open],
  .sheet.is-closing,
  .sheet[open]::backdrop,
  .sheet.is-closing::backdrop {
    animation: none;
  }

  .tile,
  .tile-window img {
    transition: none;
  }

  .tile:hover .tile-window img {
    transform: none;
  }
}
