:root {
  --bg: #0b0b0c;
  --bg-elevated: #141416;
  --search-bg: #1c1c1e;
  --search-border: #2a2a2e;
  --text: #f2f2f2;
  --muted: #9a9a9e;
  --orange: #f26722;
  --orange-soft: rgba(242, 103, 34, 0.35);
  --card-radius: 12px;
  --header-h: 64px;
}

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

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  min-height: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr minmax(220px, 520px) 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(11, 11, 12, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  justify-self: start;
}

.logo svg {
  width: 28px;
  height: 28px;
}

.search {
  position: relative;
  width: 100%;
}

.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--search-border);
  border-radius: 999px;
  background: var(--search-bg);
  color: var(--text);
  outline: none;
}

.search input::placeholder {
  color: #7a7a80;
}

.search input:focus {
  border-color: #3a3a40;
  background: #222226;
}

.header-spacer {
  justify-self: end;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 20px 80px;
}

.featured {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.featured::-webkit-scrollbar {
  display: none;
}

.featured-card {
  position: relative;
  flex: 0 0 280px;
  height: 158px;
  border-radius: 14px;
  overflow: hidden;
  scroll-snap-align: start;
  isolation: isolate;
}

.featured-card:only-child {
  flex-basis: min(420px, 100%);
}

.featured-card img,
.featured-card .poster-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 20%, rgba(0, 0, 0, 0.72) 100%);
}

.featured-card .tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.featured-copy {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 1;
}

.featured-copy h2 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.featured-copy p {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.featured-card:hover {
  outline: 2px solid var(--orange);
  outline-offset: 0;
}

.tabs {
  display: flex;
  gap: 28px;
  margin: 28px 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.tab svg {
  width: 16px;
  height: 16px;
}

.tab.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.tab:hover:not(.active) {
  color: var(--text);
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 22px 16px;
}

.model-card {
  display: block;
  min-width: 0;
}

.thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--bg-elevated);
}

.thumb img,
.thumb .poster-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-fallback {
  background:
    radial-gradient(circle at 70% 30%, var(--orange-soft), transparent 55%),
    linear-gradient(160deg, #2a241e, #121214);
}

.model-card:hover .thumb,
.model-card:focus-visible .thumb {
  outline: 2px solid var(--orange);
  outline-offset: 0;
}

.stats {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stats svg {
  width: 13px;
  height: 13px;
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-top: 8px;
}

.meta h3 {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta .author {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  display: none;
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}

.empty.visible {
  display: block;
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: auto 1fr;
    height: auto;
    padding: 12px 16px;
    gap: 10px;
  }

  .header-spacer {
    display: none;
  }

  .search {
    grid-column: 1 / -1;
  }

  .page {
    padding: 16px 16px 64px;
  }

  .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 10px;
  }

  .featured-card {
    flex-basis: 78vw;
  }
}
