:root {
  --ink: #0b0b0c;
  --ink-2: #161614;
  --stone: #e7e1d6;
  --stone-dim: #a39c91;
  --brass: #b9925a;
  --brass-2: #e0c48a;
  --red: #d64532;
  --red-2: #e15a48;
  --line: rgba(231, 225, 214, 0.14);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --header: 4.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1000px 520px at 88% -8%, rgba(185, 146, 90, 0.18), transparent 55%),
    radial-gradient(700px 420px at -10% 20%, rgba(214, 69, 50, 0.08), transparent 50%),
    var(--ink);
  color: var(--stone);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.02rem;
  line-height: 1.5;
  color-scheme: dark;
}

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

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

::selection {
  background: var(--brass);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--brass-2);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  background: var(--brass);
  color: var(--ink);
  padding: 0.55rem 0.8rem;
  text-decoration: none;
}

.skip:focus {
  top: 0.8rem;
}

.wrap {
  width: min(1180px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header);
  padding: 0.75rem 1.25rem;
  background: rgba(11, 11, 12, 0.84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.brand img {
  height: 46px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-nav > a:not(.store):not(.app-store) {
  text-decoration: none;
  color: var(--stone-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.header-nav > a:not(.store):not(.app-store):hover {
  color: var(--stone);
}

.app-store {
  display: inline-flex;
  line-height: 0;
}

.app-store img {
  height: 40px;
  width: auto;
}

.app-store-lg img {
  height: 54px;
}

.app-store:hover {
  opacity: 0.88;
}

.category-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
}

.category-bar h1 {
  margin: 0;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back {
  justify-self: start;
  text-decoration: none;
  color: var(--stone-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.back::before {
  content: "← ";
}

.back:hover {
  color: var(--stone);
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.store:hover {
  background: var(--red-2);
}

.store-icon {
  display: inline-flex;
  width: 15px;
  height: 15px;
}

.store-icon svg {
  width: 15px;
  height: 15px;
}

.store-short {
  display: none;
}

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: calc(100vh - var(--header) - 7.5rem);
  overflow: hidden;
}

.hero-collage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: 1.15fr 0.85fr;
  gap: 8px;
}

.hero-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 11, 12, 0.2), rgba(11, 11, 12, 0.55) 70%, var(--ink)),
    linear-gradient(90deg, rgba(11, 11, 12, 0.88) 0%, rgba(11, 11, 12, 0.72) 38%, rgba(11, 11, 12, 0.28) 68%, rgba(11, 11, 12, 0.15) 100%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 3rem 0 2.6rem;
}

.hero-copy {
  max-width: 38rem;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--brass);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.3rem, 6.4vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.pitch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
}

.pitch li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  color: var(--stone);
  font-size: 0.88rem;
}

.download-band {
  margin-top: 2.5rem;
  border-block: 1px solid var(--line);
  background: rgba(185, 146, 90, 0.06);
}

.download-band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.4rem 0;
}

.download-band h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  letter-spacing: -0.03em;
}

.download-band p:last-child {
  max-width: 36rem;
  margin: 0.7rem 0 0;
  color: var(--stone-dim);
}

.hero h1 em {
  font-style: italic;
  color: var(--brass-2);
}

.lede {
  max-width: 38rem;
  margin: 1.4rem 0 0;
  color: var(--stone-dim);
  font-size: 1.16rem;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1.8rem;
}

.text-link {
  color: var(--stone);
  text-underline-offset: 0.28em;
}

.text-link:hover {
  color: var(--brass-2);
}

.hero-mark {
  justify-self: end;
  height: min(58vh, 500px);
  width: auto;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45));
}

.filmstrip {
  overflow: hidden;
  margin: 0;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.film-track {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: marquee 90s linear infinite;
}

.filmstrip:hover .film-track {
  animation-play-state: paused;
}

.film-track img {
  width: 210px;
  height: 270px;
  object-fit: cover;
  background: var(--ink-2);
  filter: saturate(0.9);
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.library {
  padding: 4.5rem 0 1rem;
}

.library-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}

.library-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.search-form {
  width: min(360px, 100%);
}

.search-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--stone-dim);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.search-form input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0;
  border-radius: 0;
}

.search-form input::placeholder {
  color: #6f6a62;
}

.search-status,
.note,
.empty {
  color: var(--stone-dim);
  min-height: 1.4rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0.4rem 0 1.6rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.stats span {
  color: var(--stone-dim);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.category-grid,
.design-grid,
.related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.category-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background:
    linear-gradient(160deg, #2a241c, #12110f 60%);
  text-decoration: none;
  color: var(--stone);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.category-card:hover img,
.category-card:focus-visible img {
  transform: scale(1.05);
}

.category-card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.4rem 0.9rem 0.85rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  font-family: var(--serif);
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.category-card:hover span,
.category-card:focus-visible span {
  color: var(--brass-2);
}

.is-hidden {
  display: none !important;
}

.category-lede {
  margin: 1.4rem 0 1.2rem;
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 6px;
}

.design a {
  display: block;
  aspect-ratio: 1;
  background: var(--ink-2);
  cursor: zoom-in;
}

.design img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.related h2 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2rem;
}

.related ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.related a {
  display: inline-block;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--stone);
}

.related a:hover {
  border-color: var(--brass);
  color: var(--brass-2);
}

.site-footer {
  margin-top: 4.5rem;
  border-top: 1px solid var(--line);
  padding: 2.4rem 0 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr;
  gap: 2rem;
}

.footer-brand {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.7rem;
}

.footer-grid p {
  margin: 0 0 0.7rem;
  color: var(--stone-dim);
}

.footer-label {
  color: var(--brass) !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.footer-grid a {
  display: block;
  margin: 0.35rem 0;
  color: var(--stone);
  text-decoration: none;
}

.footer-grid a:hover {
  color: var(--brass-2);
}

.copyright {
  width: min(1180px, calc(100% - 2.5rem));
  margin: 1.8rem auto 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--stone-dim);
  font-size: 0.82rem;
}

#viewer {
  display: flex;
  flex-direction: column;
  width: min(1080px, calc(100vw - 1.5rem));
  height: min(92vh, 920px);
  max-height: calc(100vh - 1.5rem);
  padding: 0;
  border: 1px solid var(--line);
  background: #090909;
  color: var(--stone);
}

#viewer::backdrop {
  background: rgba(0, 0, 0, 0.84);
}

.viewer-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.viewer-source {
  display: block;
  margin: 0 0.95rem 0.15rem;
  color: var(--brass-2);
  font-size: 0.92rem;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-source:hover {
  text-decoration: underline;
}

.viewer-source[hidden] {
  display: none;
}

#viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
}

#viewer-img.ready {
  opacity: 1;
}

.viewer-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem 0.85rem;
  border-top: 1px solid var(--line);
}

.viewer-controls p {
  margin: 0;
  color: var(--stone-dim);
  font-variant-numeric: tabular-nums;
}

.viewer-controls button {
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

.viewer-controls button:hover {
  border-color: var(--brass);
  color: var(--brass-2);
}

#viewer-close {
  justify-self: end;
}

@media (max-width: 800px) {
  .hero {
    display: block;
    min-height: 0;
  }

  .hero-collage {
    position: relative;
    height: 220px;
    grid-template-rows: 1fr;
  }

  .hero-collage img:nth-child(n + 5) {
    display: none;
  }

  .hero::after {
    background: linear-gradient(180deg, transparent 40%, var(--ink));
  }

  .hero-inner {
    padding-top: 1.6rem;
  }

  .download-band-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .library-head,
  .footer-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .library-head {
    align-items: stretch;
  }

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

  .category-card span {
    font-size: 1.35rem;
  }
}

@media (max-width: 640px) {
  .store-long {
    display: none;
  }

  .store-short {
    display: inline;
  }

  .header-nav > a:not(.store):not(.app-store) {
    display: none;
  }

  .brand span {
    font-size: 1.2rem;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .viewer-controls {
    grid-template-columns: 1fr 1fr;
  }

  #viewer-count {
    order: -1;
    grid-column: 1 / -1;
    text-align: center;
  }
}

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

  .film-track {
    animation: none;
  }

  .filmstrip {
    overflow-x: auto;
  }

  .category-card img {
    transition: none;
  }
}
