:root {
  --bg: #050814;
  --panel: #08111f;
  --panel-strong: #0b1628;
  --line: #254665;
  --line-soft: rgba(37, 70, 101, 0.6);
  --text: #f2f7ff;
  --muted: #8fa8c6;
  --dim: #6f87a7;
  --cyan: #00e5ff;
  --blue: #4d7cff;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(20, 50, 79, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 50, 79, 0.12) 1px, transparent 1px),
    radial-gradient(circle at 75% 12%, rgba(0, 229, 255, 0.12), transparent 28rem),
    linear-gradient(145deg, var(--bg), #0a1224);
  background-size: 48px 48px, 48px 48px, auto, auto;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: calc(100% - 32px);
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  min-height: 220px;
  padding: 30px 32px;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.32);
  border-radius: var(--radius);
  background: rgba(7, 16, 31, 0.84);
  box-shadow: 0 18px 42px rgba(0, 229, 255, 0.12);
}

.hero > *,
.toolbar > *,
.filter-row > *,
.site-card > * {
  min-width: 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(var(--cyan), var(--blue));
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  max-width: 720px;
  font-size: 56px;
  line-height: 1.05;
}

.hero-copy {
  max-width: 720px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.stats {
  align-self: start;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: var(--radius);
  background: rgba(8, 21, 41, 0.92);
}

.stat-label {
  display: block;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
}

.stat-value {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  font-weight: 800;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 16px;
  align-items: end;
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 17, 31, 0.94);
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-input,
.select-input {
  height: 44px;
  border: 1px solid #2a567b;
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-strong);
  outline: none;
}

.search-input {
  width: 100%;
  padding: 0 14px;
}

.select-input {
  min-width: 130px;
  padding: 0 12px;
}

.search-input:focus,
.select-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}

.clear-button,
.page-button {
  height: 44px;
  border: 1px solid #44617f;
  border-radius: 6px;
  color: #c1d6ef;
  font-weight: 800;
  background: #111a2f;
  cursor: pointer;
}

.clear-button {
  padding: 0 18px;
}

.clear-button:hover,
.page-button:hover:not(:disabled) {
  border-color: var(--cyan);
  color: #d8fbff;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: start;
  margin: 24px 0 14px;
}

.result-count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.tag-cloud,
.site-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud {
  max-height: none;
  overflow: hidden;
}

.tag-cloud-collapsed {
  max-height: 30px;
}

.tag {
  min-height: 30px;
  padding: 0 13px;
  border: 1px solid #29466d;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: rgba(17, 26, 47, 0.88);
  cursor: pointer;
  white-space: nowrap;
}

.tag:hover,
.tag-active {
  border-color: var(--cyan);
  color: #b7f8ff;
  background: rgba(0, 229, 255, 0.16);
}

.tag-toggle {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #44617f;
  border-radius: 999px;
  color: #c1d6ef;
  font-size: 13px;
  font-weight: 800;
  background: #111a2f;
  cursor: pointer;
  white-space: nowrap;
}

.tag-toggle:hover {
  border-color: var(--cyan);
  color: #d8fbff;
}

.site-list {
  display: grid;
  gap: 12px;
}

.site-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: 20px;
  position: relative;
  padding: 18px 22px 18px 26px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(9, 20, 38, 0.96);
}

.site-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 3px;
  background: #355b7e;
}

.site-card:hover {
  border-color: rgba(0, 229, 255, 0.75);
  box-shadow: 0 12px 26px rgba(0, 229, 255, 0.1);
}

.site-title {
  display: inline-block;
  max-width: 100%;
  color: #eaf7ff;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.site-title:hover {
  color: var(--cyan);
}

.site-url,
.site-description {
  margin: 8px 0 0;
}

.site-url {
  color: #4fddf2;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.site-description {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.site-tags {
  align-content: center;
  justify-content: flex-end;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 22px;
}

.page-button {
  min-width: 86px;
  padding: 0 16px;
}

.page-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-summary,
.empty-state {
  color: var(--muted);
  font-weight: 700;
}

.empty-state {
  margin: 0;
  padding: 28px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(9, 20, 38, 0.9);
}

@media (max-width: 820px) {
  .app-shell {
    width: calc(100% - 24px);
    max-width: 560px;
    padding-top: 20px;
  }

  .hero,
  .toolbar,
  .filter-row,
  .site-card {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 24px;
  }

  h1 {
    font-size: 34px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .stats {
    max-width: 100%;
  }

  .filter-row {
    gap: 10px;
  }

  .site-card {
    padding-right: 18px;
  }

  .site-tags {
    justify-content: flex-start;
  }

  .pagination {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .app-shell {
    max-width: 366px;
  }

  .hero {
    padding: 24px 20px;
  }

  .hero-copy {
    max-width: 300px;
  }
}
