:root {
  font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;
  --bg: #010101;
  --panel: rgba(10, 10, 10, 0.85);
  --text: #f1f1f1;
  --muted: #9e9e9e;
  --accent: #c0c0c0;
  color: var(--text);
  background-color: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 2rem clamp(1.5rem, 5vw, 4rem) 4rem;
  background: radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.08), transparent 45%),
    radial-gradient(circle at 90% 0%, rgba(255, 255, 255, 0.05), transparent 50%), var(--bg);
  line-height: 1.6;
}

.page-hero {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  margin-bottom: 2.5rem;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin: 0.1rem 0 1rem;
}

.hero-content .lede {
  color: var(--muted);
  max-width: 640px;
}

.eyebrow {
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
}

.hero-meta div {
  padding: 0.9rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  min-width: 150px;
}

.hero-meta strong {
  display: block;
  color: #fff;
}

.hero-card {
  background: linear-gradient(145deg, rgba(12, 12, 12, 0.9), rgba(45, 45, 45, 0.9));
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
}

.hero-card button {
  width: 100%;
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.hero-card button:hover {
  background: rgba(255, 255, 255, 0.05);
}

.hero-card .muted {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.filter-section {
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
select {
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.7);
  color: var(--text);
  padding: 0.65rem 0.9rem;
}

.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.wallpaper-card {
  margin: 0;
  border: none;
  padding: 0;
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #0a0a0a;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.65);
  transform: translateZ(0);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.wallpaper-card:hover,
.wallpaper-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.78);
}

.wallpaper-media {
  position: absolute;
  inset: 0;
  display: block;
}

.wallpaper-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.05);
  transform: scale(1.001);
  transition: transform 700ms ease;
}

.wallpaper-card:hover .wallpaper-media img,
.wallpaper-card:focus-within .wallpaper-media img {
  transform: scale(1.035);
}

.wallpaper-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.9rem 0.9rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.wallpaper-card:hover .wallpaper-topbar,
.wallpaper-card:focus-within .wallpaper-topbar {
  opacity: 1;
  transform: translateY(0);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  font-weight: 650;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.chip:hover {
  background: rgba(0, 0, 0, 0.5);
}

.topbar-spacer {
  flex: 1;
}

.wallpaper-bottombar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 1rem 1.05rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.55) 55%,
    rgba(0, 0, 0, 0) 100%
  );
}

.wallpaper-bottombar .caption {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.wallpaper-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  color: #fff;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallpaper-card .meta {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallpaper-card .actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wallpaper-card .download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
}

.wallpaper-card .download:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.4);
}

.wallpaper-card .download:active {
  transform: scale(0.98);
}

.wallpaper-card .download-desktop {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.75);
  color: #050505;
}

.wallpaper-card .download-desktop:hover {
  background: #fff;
  border-color: #fff;
}

.wallpaper-card .download-mobile {
  min-width: 112px;
}

.wallpaper-card .download:focus-visible,
.chip:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

/* Touch device support */
@media (hover: none) {
  .wallpaper-topbar {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-hint {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.error,
.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 960px) {
  .page-hero {
    grid-template-columns: 1fr;
  }
}
