:root {
  color-scheme: dark light;
  --bg: #11100f;
  --surface: #1b1917;
  --surface-raised: #24211e;
  --text: #f7f3ed;
  --muted: #c3bbb1;
  --line: #4b443d;
  --accent: #f4c981;
  --accent-text: #241706;
  --shadow: 0 24px 70px rgb(0 0 0 / 30%);
  --radius: 22px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Apple SD Gothic Neo",
    system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3efe9;
    --surface: #fffdf9;
    --surface-raised: #f8f2ea;
    --text: #1a1714;
    --muted: #675f57;
    --line: #c9beb2;
    --accent: #7c4d08;
    --accent-text: #fffaf0;
    --shadow: 0 24px 70px rgb(65 48 31 / 12%);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% -10%, rgb(244 201 129 / 12%), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 20px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
}

.wordmark > span {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.wordmark small,
.eyebrow {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.13em;
}

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

.filter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-fallback {
  grid-template-columns: 1fr;
  place-items: center;
  aspect-ratio: 3 / 2;
}

.preview-fallback span {
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.14em;
}

.preview-panel {
  position: relative;
  display: grid;
  place-items: end start;
  min-width: 0;
  padding: clamp(14px, 3vw, 24px);
}

.preview-panel:first-child {
  background:
    linear-gradient(145deg, transparent 24%, rgb(255 255 255 / 8%)),
    linear-gradient(25deg, #22272a, #918679 66%, #dcc9a9);
}

.preview-panel:last-child {
  border-left: 1px solid rgb(255 255 255 / 28%);
  background:
    linear-gradient(145deg, transparent 24%, rgb(255 255 255 / 12%)),
    linear-gradient(25deg, #24201c, #a06e45 61%, #f2c378);
}

.preview-panel span {
  padding: 5px 8px;
  border-radius: 8px;
  background: rgb(17 16 15 / 72%);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.detail h1,
.creator-hero h1,
.state-card h1 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.gift-card {
  width: min(620px, 100%);
  margin: clamp(30px, 8vh, 80px) auto 0;
  padding: clamp(28px, 6vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.gift-card h1 {
  margin: 10px 0 0;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.gift-card > p:not(.eyebrow, .preview-note) {
  max-width: 46ch;
  margin: 18px auto 0;
  color: var(--muted);
}

.gift-mark {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  border-radius: 26px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 1.25rem;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.description {
  max-width: 56ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.creator-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
}

.creator-line a {
  min-height: 44px;
  padding: 9px 0;
  color: var(--text);
  font-weight: 680;
  text-underline-offset: 4px;
}

.proof-list,
.link-list,
.tags,
.filter-grid {
  margin: 0;
  padding: 0;
  list-style: none;
}

.proof-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 24px;
}

.proof-list li {
  display: grid;
  gap: 1px;
}

.proof-list strong {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.proof-list span,
.preview-note,
.card-meta,
.empty-copy {
  color: var(--muted);
  font-size: 0.84rem;
}

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

.tags li {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.84rem;
}

.primary-action,
.secondary-action,
.retry-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
  border-radius: 14px;
  font: inherit;
  font-weight: 720;
  text-decoration: none;
}

.primary-action {
  width: 100%;
  margin-top: 28px;
  padding: 13px 18px;
  background: var(--accent);
  color: var(--accent-text);
}

.preview-note {
  margin: 12px 0 0;
  text-align: center;
}

.creator-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: end;
  padding: clamp(26px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.creator-hero h1 {
  font-size: clamp(2.4rem, 7vw, 5rem);
}

.creator-handle {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: var(--mono);
}

.creator-actions {
  display: grid;
  gap: 10px;
  min-width: min(320px, 100%);
}

.creator-actions .primary-action {
  margin-top: 0;
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.secondary-action {
  min-width: 118px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
}

.collection-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 52px;
}

.collection-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: -0.035em;
}

.collection-heading p {
  margin: 0;
  color: var(--muted);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.filter-card {
  min-width: 0;
}

.filter-card > a {
  display: block;
  min-height: 44px;
  text-decoration: none;
}

.card-preview {
  display: grid;
  place-items: end start;
  aspect-ratio: 4 / 5;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 76% 18%, rgb(244 201 129 / 46%), transparent 31%),
    linear-gradient(150deg, #252423, #8a684c 58%, #dca868);
}

.card-preview span {
  padding: 4px 7px;
  border-radius: 7px;
  background: rgb(17 16 15 / 72%);
  color: white;
  font-family: var(--mono);
  font-size: 0.68rem;
}

.filter-card h3 {
  margin: 11px 0 0;
  font-size: 1rem;
  line-height: 1.35;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 5px 0 0;
}

.state-card {
  width: min(620px, 100%);
  margin: clamp(30px, 10vh, 100px) auto 0;
  padding: clamp(28px, 6vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.state-card h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
}

.state-card > p:not(.eyebrow) {
  margin: 16px auto 0;
  max-width: 46ch;
  color: var(--muted);
}

.retry-button {
  margin-top: 24px;
  padding: 11px 20px;
  border: 0;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}

.loading-block {
  width: min(680px, 100%);
  height: 340px;
  margin: 50px auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(110deg, var(--surface) 30%, var(--surface-raised) 50%, var(--surface) 70%);
  background-size: 220% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  to {
    background-position-x: -220%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .loading-block {
    animation: none;
  }
}

@media (max-width: 780px) {
  .site-header,
  main {
    width: min(100% - 28px, 620px);
  }

  .site-header {
    padding-top: 18px;
  }

  main {
    padding-top: 8px;
  }

  .filter-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .preview {
    aspect-ratio: 1 / 1;
  }

  .preview-fallback {
    aspect-ratio: 3 / 2;
  }

  .creator-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .link-list {
    justify-content: flex-start;
  }

  .creator-actions {
    min-width: 0;
  }

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

@media (max-width: 430px) {
  .wordmark small {
    display: none;
  }

  .preview-panel {
    padding: 10px;
  }

  .filter-grid {
    gap: 12px;
  }

  .card-meta {
    display: grid;
  }
}
