:root {
  color-scheme: dark;
  --bg: #090a0c;
  --surface: #15171c;
  --surface-soft: #1d2228;
  --border: #303741;
  --text: #f3f5f7;
  --muted: #a9b0ba;
  --accent: #d8b768;
  --accent-strong: #f0d98a;
  --shadow: rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

img {
  display: block;
  max-width: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr minmax(180px, 260px);
  gap: 24px;
  align-items: center;
  padding: 16px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--border);
  background: rgba(9, 10, 12, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  font-size: 18px;
  font-weight: 800;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.site-nav a:hover,
.section-heading a:hover,
.metadata-list a:hover,
.source-card a:hover {
  color: var(--accent-strong);
}

.header-search input,
.page-search input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.hero {
  min-height: min(72vh, 720px);
  display: flex;
  align-items: end;
  padding: clamp(88px, 14vw, 160px) clamp(18px, 5vw, 72px) clamp(44px, 8vw, 86px);
  background:
    linear-gradient(180deg, rgba(9, 10, 12, 0.08), var(--bg)),
    radial-gradient(circle at 78% 24%, rgba(216, 183, 104, 0.26), transparent 28%),
    linear-gradient(125deg, #10161f, #11100e 58%, #251e16);
  border-bottom: 1px solid var(--border);
}

.hero-inner,
.section,
.page-heading,
.text-page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.hero-inner {
  margin-left: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(44px, 9vw, 104px);
}

.hero-copy {
  max-width: 560px;
  margin: 20px 0 28px;
  color: var(--muted);
  font-size: 18px;
}

.primary-link,
.page-search button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #17130a;
  padding: 0 18px;
  font-weight: 800;
  font: inherit;
  cursor: pointer;
}

.section {
  padding: 56px 0;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 40px;
}

.feature-item {
  display: grid;
  gap: 8px;
  min-height: 132px;
  align-content: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.feature-item strong {
  color: var(--text);
  font-size: 18px;
}

.feature-item span {
  color: var(--muted);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: 28px;
}

.section-heading a {
  color: var(--muted);
  font-size: 14px;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

.category-pills a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 12px;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.category-pills a:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.category-grid,
.wallpaper-grid {
  display: grid;
  gap: 16px;
}

.category-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 18px;
}

.category-card,
.source-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.category-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  height: 100%;
  min-width: 0;
  min-height: 214px;
  align-content: start;
  gap: 10px;
  padding: 20px;
  overflow: hidden;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.category-card:hover,
.category-card:focus-visible {
  border-color: rgba(216, 183, 104, 0.62);
  background: var(--surface-soft);
  box-shadow: 0 18px 42px var(--shadow);
  transform: translateY(-2px);
}

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

.category-card-icon {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(216, 183, 104, 0.38);
  border-radius: 8px;
  background: rgba(216, 183, 104, 0.12);
  color: var(--accent-strong);
  font-family: ui-serif, Georgia, serif;
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
}

.category-card-icon::before {
  content: '◇';
}

.category-card[data-category-slug='architecture'] .category-card-icon::before {
  content: '⌂';
}

.category-card[data-category-slug='vintage'] .category-card-icon::before {
  content: '◷';
}

.category-card[data-category-slug='cities'] .category-card-icon::before {
  content: '▦';
}

.category-card[data-category-slug='art'] .category-card-icon::before {
  content: '✎';
}

.category-card[data-category-slug='maps'] .category-card-icon::before {
  content: '⌖';
}

.category-card[data-category-slug='space'] .category-card-icon::before {
  content: '✦';
}

.category-card[data-category-slug='posters'] .category-card-icon::before {
  content: '▤';
}

.category-card[data-category-slug='nature'] .category-card-icon::before {
  content: '☼';
}

.category-card[data-category-slug='textures-patterns'] .category-card-icon::before {
  content: '▧';
}

.category-card-title {
  min-height: 31px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.category-card-description {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.wallpaper-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wallpaper-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 18px 48px var(--shadow);
}

.wallpaper-link {
  display: grid;
  gap: 8px;
}

.wallpaper-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-soft);
}

.wallpaper-card-title,
.wallpaper-card-meta {
  padding: 0 12px;
}

.wallpaper-card-title {
  padding-top: 6px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.wallpaper-card-meta {
  padding-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.page-heading {
  padding: 58px 0 18px;
}

.page-heading h1,
.text-page h1 {
  font-size: clamp(34px, 6vw, 68px);
}

.page-heading p:not(.eyebrow),
.text-page p {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
}

.page-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  max-width: 640px;
  margin-top: 22px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 28px;
  width: min(1320px, calc(100% - 36px));
  margin: 0 auto;
  padding: 38px 0 64px;
}

.preview-panel {
  min-width: 0;
}

.preview-panel img {
  width: 100%;
  max-height: calc(100vh - 140px);
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface);
}

.detail-panel {
  align-self: start;
  position: sticky;
  top: 92px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
}

.detail-panel h1 {
  font-size: 32px;
}

.license-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.license-badges span {
  border: 1px solid rgba(216, 183, 104, 0.45);
  border-radius: 999px;
  background: rgba(216, 183, 104, 0.12);
  color: var(--accent-strong);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}

.detail-description {
  color: var(--muted);
}

.metadata-list {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.metadata-list div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
}

.metadata-list dt {
  color: var(--muted);
}

.metadata-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.metadata-list a,
.source-card a {
  color: var(--accent);
}

.download-list {
  display: grid;
  gap: 10px;
}

.download-list h2 {
  font-size: 20px;
}

.download-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.download-link {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.download-link span {
  font-weight: 800;
}

.download-link small {
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag-list a {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
}

.text-page {
  padding: 72px 0;
}

.source-list {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.source-card {
  padding: 18px;
}

.source-card h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.source-card p {
  margin-bottom: 0;
}

.empty-state {
  color: var(--muted);
}

.load-more-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 74px;
  padding-top: 28px;
}

.load-more-button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.load-more-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.load-more-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.load-more-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(4, minmax(140px, 1fr));
  gap: 28px;
  padding: 42px clamp(18px, 4vw, 52px) 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.footer-brand p {
  max-width: 420px;
  margin: 12px 0 0;
}

.footer-column {
  display: grid;
  align-content: start;
  gap: 8px;
}

.footer-column h2 {
  color: var(--text);
  font-size: 14px;
}

.footer-column a:hover {
  color: var(--accent-strong);
}

.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

@media (max-width: 1020px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .wallpaper-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-strip {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }

  .site-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .hero {
    min-height: 620px;
  }

  .section {
    padding: 36px 0;
  }

  .section-heading,
  .page-search,
  .metadata-list div {
    grid-template-columns: 1fr;
  }

  .wallpaper-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 190px;
  }

  .detail-panel {
    padding: 18px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}
