:root {
  color-scheme: dark;
  --bg: #121110;
  --surface: #1c1a18;
  --surface-2: #25221f;
  --line: #3b3630;
  --text: #f4eee6;
  --muted: #b9aea2;
  --coral: #ff6f61;
  --mint: #58d68d;
  --amber: #f2c94c;
  --danger: #ff7b7b;
  --shadow: 0 18px 50px rgb(0 0 0 / 0.32);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgb(255 111 97 / 0.12), transparent 240px),
    var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(16px, 4vw, 48px) 18px;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(18 17 16 / 0.9);
  backdrop-filter: blur(16px);
}

h1,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
  font-weight: 760;
}

.kicker {
  color: var(--mint);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 280px;
}

.search {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  min-width: 180px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.search input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.switch input {
  accent-color: var(--coral);
}

.icon-button,
.primary {
  height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #16120f;
  background: var(--coral);
  font-weight: 760;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.primary {
  padding: 0 16px;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 16px clamp(16px, 4vw, 48px) 48px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 16px;
  scrollbar-width: thin;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
}

.tab[aria-pressed="true"] {
  color: var(--text);
  border-color: rgb(88 214 141 / 0.7);
  background: rgb(88 214 141 / 0.12);
}

.count {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.status {
  min-height: 28px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.status strong {
  color: var(--danger);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.thumb-card {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset;
  overflow: hidden;
  transform: translateY(0);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.thumb-card:hover {
  border-color: rgb(255 111 97 / 0.7);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.thumb-card figure {
  margin: 0;
}

.thumb-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #070707;
}

.blurred .thumb-card img {
  filter: blur(14px);
  transform: scale(1.04);
  transition: filter 160ms ease;
}

.blurred .thumb-card:hover img,
.blurred .thumb-card:focus-visible img {
  filter: blur(0);
}

.thumb-card figcaption {
  display: grid;
  gap: 6px;
  min-height: 98px;
  padding: 10px;
}

.source-name,
.thumb-card time {
  color: var(--muted);
  font-size: 12px;
}

.source-name {
  color: var(--mint);
  font-weight: 760;
}

.thumb-card strong {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgb(11 10 9 / 0.86);
  backdrop-filter: blur(12px);
}

.gate[hidden] {
  display: none;
}

.gate-panel {
  width: min(460px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.gate-panel h1 {
  margin: 8px 0 12px;
  font-size: 28px;
}

.gate-panel p:not(.kicker) {
  color: var(--muted);
  line-height: 1.65;
}

.gate-actions {
  margin-top: 22px;
}

@media (max-width: 720px) {
  .topbar {
    position: static;
    display: grid;
    padding-top: 20px;
  }

  .toolbar {
    justify-content: stretch;
    min-width: 0;
  }

  .search {
    min-width: 0;
    flex: 1;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
