:root {
  color-scheme: dark;
  --bg: #101411;
  --panel: #171d19;
  --panel-strong: #202821;
  --text: #f3f0e8;
  --muted: #b8c1b7;
  --line: rgba(243, 240, 232, 0.14);
  --accent: #d6dad4;
  --accent-strong: #aeb6ad;
  --danger: #f28e79;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.preview-light {
  color-scheme: light;
  --bg: #f4f0e8;
  --panel: #fffaf2;
  --panel-strong: #ede7dc;
  --text: #171510;
  --muted: #625f57;
  --line: rgba(23, 21, 16, 0.16);
  --accent: #1f211c;
  --accent-strong: #4e544a;
  --shadow: 0 24px 70px rgba(42, 35, 25, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: 76px;
}

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

button,
input,
select {
  font: inherit;
}

.site-header {
  min-height: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

body.preview-light .brand-mark {
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(244, 240, 232, 0.9) 43% 57%, transparent 58%),
    linear-gradient(135deg, #2e332d, #7c8377);
}

body.preview-light input,
body.preview-light select {
  background:
    linear-gradient(45deg, transparent 50%, #625f57 50%) calc(100% - 18px) 52% / 6px 6px no-repeat,
    linear-gradient(135deg, #625f57 50%, transparent 50%) calc(100% - 13px) 52% / 6px 6px no-repeat,
    rgba(255, 255, 255, 0.62);
}

body.preview-light input {
  background: rgba(255, 255, 255, 0.62);
}

body.preview-light .search-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.18)),
    rgba(255, 250, 242, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 30px 90px rgba(42, 35, 25, 0.18);
}

body.preview-light .search-panel::before {
  opacity: 0.22;
}

body.preview-light .hero::after {
  background:
    linear-gradient(90deg, rgba(244, 240, 232, 0.96), rgba(244, 240, 232, 0.44) 22%, rgba(244, 240, 232, 0.4) 78%, rgba(244, 240, 232, 0.96)),
    linear-gradient(180deg, rgba(244, 240, 232, 0.24), rgba(244, 240, 232, 0.34) 58%, var(--bg));
}

body.preview-light .hero-wallpaper-bg {
  opacity: 0.5;
}

body.preview-light .hero h1 {
  background:
    linear-gradient(135deg, rgba(120, 105, 116, 0.74), rgba(73, 130, 147, 0.58) 48%, rgba(103, 96, 83, 0.72)),
    linear-gradient(90deg, rgba(190, 86, 142, 0.28), rgba(62, 169, 206, 0.26), rgba(181, 126, 50, 0.24));
  background-clip: text;
  filter: drop-shadow(0 14px 40px rgba(30, 27, 24, 0.16));
  text-shadow: 0 1px 18px rgba(24, 20, 18, 0.1);
  -webkit-background-clip: text;
}

body.preview-light .wallpaper-card,
body.preview-light .download-dialog,
body.preview-light .actions-menu {
  background: rgba(255, 250, 242, 0.9);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 auto;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 20, 17, 0.92);
  backdrop-filter: blur(18px) saturate(1.2);
}

body.preview-light .topbar {
  background: rgba(244, 240, 232, 0.9);
}

.brand,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-weight: 800;
  font-size: 1.12rem;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(16, 20, 17, 0.9) 43% 57%, transparent 58%),
    linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24) inset;
}

.nav-actions a {
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-actions a:hover {
  color: var(--text);
}

.theme-toggle {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.theme-toggle span {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #d6dad4;
  box-shadow:
    0 -20px 0 -7px rgba(214, 218, 212, 0.44),
    0 20px 0 -7px rgba(214, 218, 212, 0.44),
    20px 0 0 -7px rgba(214, 218, 212, 0.44),
    -20px 0 0 -7px rgba(214, 218, 212, 0.44),
    14px 14px 0 -8px rgba(214, 218, 212, 0.36),
    -14px 14px 0 -8px rgba(214, 218, 212, 0.36),
    14px -14px 0 -8px rgba(214, 218, 212, 0.36),
    -14px -14px 0 -8px rgba(214, 218, 212, 0.36);
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body.preview-light .theme-toggle {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(23, 21, 16, 0.18);
}

body.preview-light .theme-toggle span {
  background: #f5b92e;
  transform: rotate(22deg) scale(1.08);
  box-shadow:
    0 -21px 0 -5px rgba(245, 185, 46, 0.95),
    0 21px 0 -5px rgba(245, 185, 46, 0.95),
    21px 0 0 -5px rgba(245, 185, 46, 0.95),
    -21px 0 0 -5px rgba(245, 185, 46, 0.95),
    15px 15px 0 -6px rgba(245, 185, 46, 0.82),
    -15px 15px 0 -6px rgba(245, 185, 46, 0.82),
    15px -15px 0 -6px rgba(245, 185, 46, 0.82),
    -15px -15px 0 -6px rgba(245, 185, 46, 0.82);
}

.hero {
  flex: 1;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: calc(100% - 48px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 28px;
  padding: 48px 0 64px;
  text-align: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(16, 20, 17, 0.95), rgba(16, 20, 17, 0.28) 24%, rgba(16, 20, 17, 0.26) 76%, rgba(16, 20, 17, 0.95)),
    linear-gradient(180deg, rgba(16, 20, 17, 0.42), rgba(16, 20, 17, 0.3) 48%, var(--bg));
}

.hero-copy,
.search-panel {
  position: relative;
  z-index: 1;
}

.hero-wallpaper-bg {
  position: absolute;
  inset: -18px -24px;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 7, 10, 0.12), rgba(5, 7, 10, 0.58)),
    url("hero-bokeh.png") center / cover no-repeat;
  filter: saturate(1.18) contrast(1.04);
  opacity: 0.88;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: #aeb6ad;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 1160px;
  margin-bottom: 14px;
  font-size: clamp(3.6rem, 6.4vw, 6.4rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero h1 {
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 0.06em;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.2) 42%, rgba(255, 255, 255, 0.62)),
    linear-gradient(90deg, rgba(255, 95, 167, 0.38), rgba(80, 213, 255, 0.34), rgba(255, 180, 72, 0.36));
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 16px 46px rgba(0, 0, 0, 0.38));
  text-shadow: 0 1px 20px rgba(255, 255, 255, 0.12);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.45;
}

.search-panel {
  isolation: isolate;
  overflow: hidden;
  width: min(100%, 1280px);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.035) 48%, rgba(255, 255, 255, 0.1)),
    rgba(12, 18, 14, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 28px 90px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(24px) saturate(1.45);
}

.search-panel::before {
  content: "";
  position: absolute;
  inset: -30% -12%;
  z-index: -1;
  background:
    radial-gradient(circle at 13% 35%, rgba(255, 112, 166, 0.38), transparent 24%),
    radial-gradient(circle at 72% 16%, rgba(68, 198, 255, 0.28), transparent 28%),
    radial-gradient(circle at 86% 84%, rgba(255, 169, 67, 0.22), transparent 24%),
    radial-gradient(circle at 30% 90%, rgba(39, 216, 143, 0.16), transparent 26%);
  filter: blur(28px);
  opacity: 0.38;
  pointer-events: none;
}

.search-panel label,
.filters label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 8px;
}

input,
select {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  outline: none;
}

input {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(8, 13, 10, 0.38);
  padding: 0 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 34px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(14px) saturate(1.25);
}

input[type="search"]::-webkit-search-cancel-button {
  width: 34px;
  height: 34px;
  margin-right: -6px;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 46%, rgba(255, 255, 255, 0.92) 47% 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(255, 255, 255, 0.92) 47% 53%, transparent 54%);
  background-position: center;
  background-size: 16px 16px;
  background-repeat: no-repeat;
  opacity: 0.82;
  cursor: pointer;
  -webkit-appearance: none;
}

select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #b8c1b7 50%) calc(100% - 18px) 52% / 6px 6px no-repeat,
    linear-gradient(135deg, #b8c1b7 50%, transparent 50%) calc(100% - 13px) 52% / 6px 6px no-repeat,
    rgba(255, 255, 255, 0.08);
  padding: 0 42px 0 14px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 0 4px rgba(214, 218, 212, 0.14),
    0 14px 38px rgba(0, 0, 0, 0.22);
}

select option {
  background: #111611;
}

button,
.primary-link {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #d6dad4;
  color: #0d1610;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

button:not(.image-wrap):hover,
.primary-link:hover {
  transform: scale(1.035);
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.quick-tags button,
.ghost-button,
.copy-button {
  min-height: 38px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(8, 13, 10, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px) saturate(1.2);
}

.quick-tags button {
  min-width: 108px;
  min-height: 42px;
  justify-content: center;
}

.quick-tags button:hover {
  border-color: rgba(214, 218, 212, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.055)),
    rgba(18, 25, 20, 0.48);
}

.gallery-jump {
  position: relative;
  z-index: 1;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(10, 15, 12, 0.26);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 54px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px) saturate(1.35);
  font-weight: 850;
}

.gallery-jump::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.78;
}

.ghost-button.is-active {
  background: var(--accent);
  color: var(--bg);
}

main {
  width: min(1540px, calc(100% - 40px));
  margin: 0 auto;
  padding: 10px 0 80px;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin-bottom: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.section-heading {
  grid-column: 1 / -1;
  max-width: 760px;
  margin-bottom: 10px;
}

.section-heading h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
}

.feature-strip article {
  border-top: 0;
  border-radius: 0;
  background: transparent;
}

.feature-strip article {
  padding: 0;
}

.feature-strip span {
  display: block;
  margin-bottom: 26px;
  color: #858d85;
  font-size: 0.8rem;
  font-weight: 800;
}

.feature-strip h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
  line-height: 1.1;
}

.feature-strip p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: -14px 0 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.trust-strip div {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 22px;
  background: rgba(23, 29, 25, 0.92);
}

.trust-strip span {
  color: #aeb6ad;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.trust-strip strong {
  max-width: 34ch;
  font-size: 1rem;
  line-height: 1.35;
}

body.preview-light .trust-strip {
  background: rgba(23, 21, 16, 0.12);
}

body.preview-light .trust-strip div {
  background: #fffaf2;
}

body.preview-light .trust-strip span {
  color: #716a5f;
}

body.preview-light .trust-strip strong {
  color: #27231d;
}

.featured-wallpaper {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.55fr);
  gap: 28px;
  align-items: stretch;
  margin: 34px 0 56px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.028);
}

.featured-wallpaper::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -34px;
  height: 1px;
  background: var(--line);
}

.featured-media {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border-radius: 8px;
  background: #111;
  cursor: pointer;
}

.featured-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: filter 180ms ease, transform 240ms ease;
}

.featured-media:hover img {
  filter: blur(1.2px) brightness(0.72) saturate(0.92);
  transform: scale(1.02);
}

.featured-media #featuredResolution {
  position: absolute;
  right: 14px;
  bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(0, 0, 0, 0.56);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.featured-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 8px;
}

.featured-copy h2 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 4vw, 4.6rem);
}

.featured-copy p:not(.section-kicker) {
  color: var(--muted);
  line-height: 1.55;
}

.featured-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 24px;
}

.featured-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: #dce1da;
  font-size: 0.82rem;
  font-weight: 800;
}

.featured-copy button {
  width: fit-content;
}

.collections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
  margin-bottom: 56px;
}

.saved-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.36fr) 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 42px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.session-copy {
  max-width: 44ch;
  color: var(--muted);
  line-height: 1.5;
}

.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.remember-saves {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  max-width: 360px;
  color: var(--text);
  cursor: pointer;
}

.remember-saves input {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 1px 0 0;
  accent-color: #d6dad4;
  cursor: pointer;
}

.remember-saves strong,
.remember-saves small {
  display: block;
}

.remember-saves strong {
  font-size: 0.94rem;
  line-height: 1.2;
}

.remember-saves small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.mini-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mini-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.mini-card button {
  width: 100%;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  display: block;
  text-align: left;
}

.mini-card .remove-saved-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(8, 11, 9, 0.72);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 850;
  backdrop-filter: blur(10px);
}

body.preview-light .mini-card .remove-saved-button {
  border-color: rgba(23, 21, 16, 0.18);
  background: rgba(255, 250, 242, 0.88);
  color: #171510;
}

.mini-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
}

.mini-card span {
  display: block;
  padding: 10px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.collection-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.collection-card {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
  white-space: normal;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.collection-card:last-child {
  border-right: 1px solid var(--line);
}

.collection-card span {
  font-size: 1rem;
  font-weight: 850;
}

.collection-card small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.collection-card.is-active {
  border-color: rgba(214, 218, 212, 0.56);
  background: rgba(214, 218, 212, 0.1);
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
  padding-bottom: 22px;
}

.toolbar > div:first-child {
  min-width: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  min-width: 0;
}

.filters label,
.filters select {
  min-width: 0;
  width: 100%;
}

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.results-meta p {
  margin: 0;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.library-status {
  min-height: 42px;
  color: var(--muted);
  font-size: 0.92rem;
}

.library-status p {
  margin: 0 0 14px;
}

.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.wallpaper-grid + .saved-section {
  margin-top: 58px;
}

.wallpaper-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.image-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-height: auto;
  padding: 0;
  border: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #222;
  border-radius: 0;
  cursor: zoom-in;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 240ms ease, filter 180ms ease;
}

.wallpaper-card:hover img {
  transform: scale(1.04);
  filter: blur(1.2px) brightness(0.72) saturate(0.92);
}

.resolution {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(0, 0, 0, 0.56);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 800;
}

.resolution {
  position: absolute;
  right: 12px;
  bottom: 12px;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 11, 9, 0.16);
  color: var(--text);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.preview-overlay::before {
  content: "Open larger view";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(246, 248, 243, 0.18);
  color: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 18px 44px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px) saturate(1.35);
  font-size: 0.9rem;
  font-weight: 800;
}

.wallpaper-card:hover .preview-overlay {
  opacity: 1;
  transform: translateY(0);
}

.featured-media:hover .preview-overlay {
  opacity: 1;
  transform: translateY(0);
}

.card-body {
  padding: 16px;
}

.card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.04rem;
}

.info-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: #b9c0b8;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.info-button.is-active {
  background: #d6dad4;
  color: #0d1610;
}

.description {
  min-height: 66px;
  color: var(--muted);
  line-height: 1.42;
  font-size: 0.94rem;
}

.info-panel {
  margin: 0 0 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.info-panel dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 0;
}

.info-panel div {
  min-width: 0;
}

.info-panel dt {
  color: #858d85;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.info-panel dd {
  margin: 3px 0 0;
  color: #dce1da;
  font-size: 0.88rem;
  font-weight: 750;
}

.desktop-preview {
  position: relative;
  display: block;
  width: 100%;
  min-height: auto;
  padding: 0;
  height: 112px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-position: center;
  background-size: cover;
  margin-bottom: 12px;
  cursor: zoom-in;
}

.desktop-preview span {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 0 rgba(255, 255, 255, 0.8);
}

body.preview-light .desktop-preview span {
  background: rgba(12, 16, 13, 0.78);
  box-shadow: 0 24px 0 rgba(12, 16, 13, 0.72);
}

.desktop-preview span:nth-child(1) {
  top: 12px;
}

.desktop-preview span:nth-child(2) {
  top: 60px;
}

.desktop-preview span:nth-child(3) {
  left: 42px;
  top: 12px;
}

.desktop-preview span:nth-child(4) {
  left: 42px;
  top: 60px;
}

.desktop-preview i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  background: rgba(8, 11, 9, 0.7);
  backdrop-filter: blur(8px);
}

body.preview-light .desktop-preview i {
  background: rgba(245, 247, 242, 0.72);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 52px;
  align-content: start;
}

.tag-list span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 0.78rem;
}

.card-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

.menu-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  gap: 3px;
  flex-direction: column;
  cursor: pointer;
}

.menu-button span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d6dad4;
}

.menu-button.is-active {
  background: rgba(214, 218, 212, 0.12);
  border-color: rgba(214, 218, 212, 0.48);
}

.actions-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  width: min(220px, 80vw);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141a15;
  box-shadow: var(--shadow);
}

.actions-menu .primary-link,
.actions-menu .copy-button,
.actions-menu .copy-source-button {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  padding: 0 12px;
  font-size: 0.92rem;
}

.actions-menu .copy-button,
.actions-menu .copy-source-button {
  margin-top: 6px;
}

.license-band {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 36px;
  align-items: start;
  margin-top: 58px;
  padding: 34px 0 0;
  border-top: 1px solid var(--line);
}

.license-band p:last-child {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.download-dialog {
  width: min(880px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.download-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  transform: translate(-50%, 12px);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
    rgba(13, 18, 15, 0.82);
  color: var(--text);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px) saturate(1.35);
  font-size: 0.92rem;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.site-footer {
  width: min(1540px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 48px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  color: var(--muted);
}

.site-footer a {
  padding-top: 20px;
  font-weight: 800;
}

body.info-page main {
  width: min(920px, calc(100% - 40px));
}

.page-hero {
  padding: 58px 0 34px;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-size: clamp(3rem, 7vw, 5.4rem);
}

.page-content {
  padding: 34px 0 80px;
}

.page-content section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.page-content p,
.page-content li {
  color: var(--muted);
  line-height: 1.7;
}

.page-content ul {
  padding-left: 20px;
}

.dialog-image {
  position: relative;
  aspect-ratio: 16 / 8;
  overflow: hidden;
  background: #111;
}

.dialog-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.dialog-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(8, 11, 9, 0.58);
  color: #fff;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px) saturate(1.3);
  transform: translateY(-50%);
}

button.dialog-nav:hover {
  background: rgba(246, 248, 243, 0.22);
  transform: translateY(-50%) scale(1.04);
}

.dialog-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.dialog-nav span {
  width: 14px;
  height: 14px;
  border-top: 3px solid currentColor;
  border-left: 3px solid currentColor;
}

.dialog-nav-previous {
  left: 18px;
}

.dialog-nav-previous span {
  transform: translateX(3px) rotate(-45deg);
}

.dialog-nav-next {
  right: 18px;
}

.dialog-nav-next span {
  transform: translateX(-3px) rotate(135deg);
}

body.preview-light .dialog-nav {
  border-color: rgba(23, 21, 16, 0.22);
  background: rgba(255, 250, 242, 0.72);
  color: #171510;
}

.dialog-desktop-layer {
  display: none;
}

.dialog-image.is-desktop-preview .dialog-desktop-layer {
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(rgba(10, 14, 11, 0.08), rgba(10, 14, 11, 0.08));
  pointer-events: none;
}

body.preview-light .dialog-image.is-desktop-preview .dialog-desktop-layer {
  background: linear-gradient(rgba(245, 247, 242, 0.08), rgba(245, 247, 242, 0.08));
}

.dialog-desktop-layer span {
  position: absolute;
  left: 28px;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 38px 0 rgba(255, 255, 255, 0.84);
}

body.preview-light .dialog-desktop-layer span {
  background: rgba(12, 16, 13, 0.78);
  box-shadow: 0 38px 0 rgba(12, 16, 13, 0.72);
}

.dialog-desktop-layer span:nth-child(1) {
  top: 28px;
}

.dialog-desktop-layer span:nth-child(2) {
  top: 104px;
}

.dialog-desktop-layer span:nth-child(3) {
  left: 76px;
  top: 28px;
}

.dialog-desktop-layer span:nth-child(4) {
  left: 76px;
  top: 104px;
}

.dialog-desktop-layer span:nth-child(5) {
  right: 34px;
  left: auto;
  top: 28px;
}

.dialog-desktop-layer span:nth-child(6) {
  right: 34px;
  left: auto;
  top: 104px;
}

.dialog-desktop-layer i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34px;
  background: rgba(8, 11, 9, 0.72);
  backdrop-filter: blur(10px);
}

body.preview-light .dialog-desktop-layer i {
  background: rgba(245, 247, 242, 0.72);
}

.dialog-body {
  padding: 24px;
}

.dialog-body h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.dialog-body p:not(.section-kicker) {
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

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

@media (max-width: 900px) {
  .toolbar,
  .license-band,
  .featured-wallpaper,
  .collections,
  .saved-section {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-bottom: 54px;
  }

  .toolbar {
    display: grid;
    align-items: stretch;
  }

  .feature-strip,
  .trust-strip,
  .collection-row,
  .mini-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 640px) {
  .site-header {
    min-height: auto;
  }

  .hero,
  main {
    width: calc(100% - 28px);
  }

  .topbar {
    padding: 14px;
  }

  .nav-actions {
    gap: 8px;
  }

  .nav-actions a {
    display: none;
  }

  .nav-actions a.nav-priority {
    display: inline-flex;
  }

  .hero {
    padding-top: 24px;
  }

  .hero-wallpaper-bg {
    inset: -18px -14px;
  }

  h1 {
    font-size: 3rem;
  }

  .hero h1 {
    max-width: 11ch;
    padding-inline: 0.14em;
  }

  .search-row,
  .filters,
  .feature-strip,
  .trust-strip,
  .collection-row,
  .mini-gallery,
  .wallpaper-grid,
  .card-actions {
    grid-template-columns: 1fr;
  }

  .results-meta {
    align-items: start;
    flex-direction: column;
    gap: 12px;
    padding: 14px 0;
  }

  .results-actions,
  .results-actions button {
    width: 100%;
  }

  .dialog-nav {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .dialog-nav-previous {
    left: 10px;
  }

  .dialog-nav-next {
    right: 10px;
  }

  .featured-copy button {
    width: 100%;
  }
}
