:root {
  --bg: #08090a;
  --surface: #101012;
  --surface-hover: #141417;
  --line: #23252b;
  --line-hover: #3a3d46;
  --text: #f4f5f8;
  --muted: #8a8f98;
  --accent: #5e6ad2;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 20px 0 18px;
  background: rgba(8, 9, 10, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.lede {
  margin: 8px 0 20px;
  color: var(--muted);
}

.count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

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

.filter {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.filter:hover {
  border-color: var(--line-hover);
  color: var(--text);
}

.filter.is-active {
  background: #fff;
  border-color: #fff;
  color: #0b0c0e;
}

.filter:focus-visible,
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-height: 100%;
}

.card:hover {
  background: var(--surface-hover);
  border-color: var(--line-hover);
}

.thumb {
  aspect-ratio: 16 / 10;
  background: #0c0d10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 16px;
  flex: 1;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-head h2 {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.open {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: #0b0c0e;
  background: #e8e9ed;
  border-radius: 999px;
  padding: 4px 9px;
}

.card:hover .open {
  background: #fff;
}

.desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.tag {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

.empty {
  color: var(--muted);
  padding: 48px 0;
}

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

@media (min-width: 1080px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page {
    width: min(1180px, calc(100% - 32px));
    padding-top: 24px;
  }

  h1 {
    font-size: 24px;
  }

  .top-row {
    align-items: baseline;
  }
}

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