:root {
  --black: #090806;
  --paper: #fff8d6;
  --banana: #ffe84a;
  --cyan: #31e7d4;
  --pink: #ff5b8a;
  --ink-soft: rgba(9, 8, 6, 0.66);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(9, 8, 6, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(9, 8, 6, 0.055) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  color: var(--black);
  font-family: "Bahnschrift", "DIN Condensed", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--black);
  background: rgba(255, 248, 214, 0.92);
  padding: 0 28px;
  backdrop-filter: blur(12px);
}

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

.brand,
.nav a {
  text-decoration: none;
  font-weight: 950;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 3px solid var(--black);
  background: var(--banana);
  transform: rotate(-5deg);
  box-shadow: 5px 5px 0 var(--black);
}

.nav a {
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  max-width: none;
  margin: 0 auto;
  min-height: 680px;
  padding: 72px max(28px, calc((100vw - 1520px) / 2 + 28px)) 42px;
  border-bottom: 3px solid var(--black);
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(255, 248, 214, 0.97) 0%, rgba(255, 248, 214, 0.78) 34%, rgba(255, 248, 214, 0.18) 62%, rgba(255, 248, 214, 0.04) 100%),
    linear-gradient(0deg, rgba(255, 248, 214, 0.26), transparent 46%);
  content: "";
  pointer-events: none;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-backdrop-track {
  position: absolute;
  top: 58px;
  right: -20px;
  display: flex;
  width: max-content;
  gap: 18px;
  animation: heroPan 38s linear infinite;
}

.hero-backdrop img {
  width: clamp(210px, 18vw, 330px);
  height: clamp(300px, 31vw, 480px);
  border: 3px solid var(--black);
  background: var(--black);
  box-shadow: 8px 8px 0 var(--black);
  object-fit: cover;
  opacity: 0.94;
}

.hero-backdrop img:nth-child(2n) {
  margin-top: 74px;
}

.hero-backdrop img:nth-child(3n) {
  margin-top: 132px;
}

@keyframes heroPan {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(50%);
  }
}

.kicker,
.eyebrow {
  width: fit-content;
  border: 3px solid var(--black);
  background: var(--cyan);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--black);
}

.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 22px 0 0;
  font-size: clamp(54px, 9vw, 138px);
  line-height: 0.82;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.lede {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: clamp(19px, 2.1vw, 28px);
  font-weight: 850;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(118px, 1fr));
  gap: 10px;
  width: min(520px, 100%);
}

.hero-stats div {
  min-height: 112px;
  border: 3px solid var(--black);
  background: var(--black);
  color: var(--paper);
  padding: 14px;
  box-shadow: 6px 6px 0 var(--banana);
}

.hero-stats strong,
.hero-stats span {
  display: block;
}

.hero-stats strong {
  color: var(--banana);
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
}

.hero-stats span {
  margin-top: 9px;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.gallery-section,
.sources,
.faq-section {
  border-top: 3px solid var(--black);
  padding: 42px 28px 72px;
}

.gallery-head,
.status-line,
.filters,
.prompt-grid,
.section-head,
.source-grid,
.faq-grid {
  max-width: 1520px;
  margin-right: auto;
  margin-left: auto;
}

.gallery-head {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 460px);
  gap: 22px;
  align-items: end;
}

.gallery-head h2,
.section-head h2 {
  margin: 0;
  font-size: clamp(38px, 6vw, 88px);
  line-height: 0.9;
  text-transform: uppercase;
}

.section-head p {
  max-width: 720px;
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 850;
}

.search {
  display: grid;
  gap: 8px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.search input {
  min-height: 52px;
  border: 3px solid var(--black);
  background: var(--paper);
  padding: 0 14px;
  box-shadow: 5px 5px 0 var(--black);
  outline: none;
}

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

.filters button {
  min-height: 40px;
  border: 3px solid var(--black);
  background: var(--paper);
  padding: 0 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
}

.filters button.active {
  background: var(--black);
  color: var(--banana);
}

.filters span {
  margin-left: 8px;
  opacity: 0.65;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  margin-bottom: 18px;
}

.status-line p {
  margin: 0;
  font-size: 20px;
  font-weight: 950;
}

.status-line span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 850;
  text-align: right;
}

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

.prompt-card {
  display: grid;
  overflow: hidden;
  border: 3px solid var(--black);
  background: rgba(255, 248, 214, 0.96);
  box-shadow: 6px 6px 0 var(--black);
}

.prompt-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 var(--black);
}

.prompt-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 0;
  border-bottom: 3px solid var(--black);
  background: var(--black);
  padding: 0;
  cursor: pointer;
}

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

.prompt-card-body {
  display: grid;
  gap: 11px;
  padding: 14px;
}

.card-tags,
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.card-tags span,
.metrics b {
  border: 2px solid var(--black);
  background: var(--paper);
  padding: 4px 7px;
}

.prompt-card h3 {
  display: -webkit-box;
  min-height: 2em;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 24px;
  line-height: 1;
}

.load-wrap {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

#loadMore,
.prompt-box button,
.button-main,
.button-ghost {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--black);
  background: var(--banana);
  padding: 0 18px;
  box-shadow: 5px 5px 0 var(--black);
  color: var(--black);
  cursor: pointer;
  font-weight: 950;
  text-decoration: none;
}

.button-ghost {
  background: var(--paper);
}

.prompt-image.image-failed {
  position: relative;
  display: grid;
  place-items: center;
}

.prompt-image.image-failed img {
  opacity: 0;
}

.prompt-image.image-failed::after {
  position: absolute;
  inset: 14px;
  display: grid;
  place-items: center;
  border: 2px solid var(--banana);
  color: var(--banana);
  content: "Preview unavailable";
  font-size: 13px;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.hero-backdrop img.image-failed,
.modal-media img.image-failed {
  display: none;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 8, 6, 0.76);
}

.modal-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 1.12fr) minmax(360px, 0.88fr);
  width: min(1420px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border: 3px solid var(--black);
  background: var(--paper);
  box-shadow: 10px 10px 0 var(--banana);
}

.modal-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 3px solid var(--black);
  background: var(--banana);
  cursor: pointer;
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
}

.modal-media {
  display: grid;
  min-height: 520px;
  max-height: 92vh;
  place-items: center;
  border-right: 3px solid var(--black);
  background: var(--black);
}

.modal-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 92vh;
  object-fit: contain;
}

.modal-detail {
  display: grid;
  gap: 14px;
  align-content: start;
  max-height: 92vh;
  overflow: auto;
  padding: 26px;
}

.modal-kicker {
  width: fit-content;
  border: 3px solid var(--black);
  background: var(--cyan);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.modal-detail h2 {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 54px);
  line-height: 0.95;
}

.modal-metrics,
.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-metrics span,
.source-actions a,
.source-actions span {
  border: 2px solid var(--black);
  background: var(--paper);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
  text-transform: uppercase;
}

.prompt-box {
  border: 3px solid var(--black);
  background: #fffdf0;
}

.prompt-box > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 3px solid var(--black);
  padding: 10px;
}

.prompt-box pre {
  max-height: 320px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
  font-family: "Cascadia Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.sources {
  background: var(--banana);
}

.faq-section {
  background: var(--paper);
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.source-grid article {
  min-height: 190px;
  border: 3px solid var(--black);
  background: var(--paper);
  padding: 18px;
  box-shadow: 6px 6px 0 var(--black);
}

.faq-grid article {
  min-height: 180px;
  border: 3px solid var(--black);
  background: #fffdf0;
  padding: 18px;
  box-shadow: 6px 6px 0 var(--black);
}

.source-grid span {
  color: var(--pink);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.source-grid strong {
  display: block;
  margin-top: 12px;
  font-size: 24px;
  line-height: 1;
}

.faq-grid strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.source-grid p,
.faq-grid p {
  color: var(--ink-soft);
  font-weight: 800;
  line-height: 1.42;
}

.footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  border-top: 3px solid var(--black);
  background: var(--black);
  color: var(--paper);
  padding: 30px 36px;
}

.footer strong {
  color: var(--banana);
  font-size: 20px;
}

.footer p {
  max-width: 560px;
  margin: 8px 0 0;
  color: rgba(255, 248, 214, 0.68);
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.footer a {
  color: var(--paper);
  text-decoration: none;
}

.empty-state {
  grid-column: 1 / -1;
  border: 3px solid var(--black);
  background: var(--paper);
  padding: 22px;
  font-weight: 950;
}

.legal-page {
  max-width: 860px;
  min-height: calc(100vh - 66px);
  padding: 80px 32px;
}

.category-hero {
  max-width: 1120px;
  padding: 86px 28px 58px;
}

.category-hero h1 {
  margin: 22px 0 0;
  font-size: clamp(54px, 9vw, 124px);
  line-height: 0.86;
  text-transform: uppercase;
}

.category-hero p {
  max-width: 760px;
  color: var(--ink-soft);
  font-size: 22px;
  font-weight: 850;
  line-height: 1.38;
}

.legal-page h1 {
  margin: 0 0 22px;
  font-size: clamp(48px, 8vw, 110px);
  line-height: 0.86;
}

.legal-page p {
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .hero,
  .gallery-head,
  .footer {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .prompt-grid,
  .source-grid,
  .faq-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-card {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .modal-media {
    min-height: 360px;
    max-height: 48vh;
    border-right: 0;
    border-bottom: 3px solid var(--black);
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 0 14px;
  }

  .nav {
    display: none;
  }

  .hero,
  .gallery-section,
  .sources,
  .faq-section {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero {
    padding-top: 54px;
  }

  .hero h1 {
    max-width: 340px;
    font-size: 44px;
    line-height: 0.9;
  }

  .gallery-head h2,
  .section-head h2 {
    font-size: 34px;
    line-height: 1;
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  .lede {
    max-width: 310px;
    font-size: 16px;
    word-break: break-all;
  }

  .section-head p {
    max-width: 100%;
    font-size: 16px;
    word-break: break-all;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    max-width: 100%;
  }

  .hero-stats div {
    min-height: 70px;
    padding: 10px;
    box-shadow: 3px 3px 0 var(--banana);
  }

  .hero-stats strong {
    font-size: 24px;
  }

  .hero-stats span {
    font-size: 9px;
  }

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

  .source-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

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

  .filters button {
    width: 100%;
    padding: 0 8px;
  }

  .status-line {
    display: block;
  }

  .status-line span {
    display: block;
    margin-top: 8px;
    text-align: left;
  }

  .modal {
    padding: 10px;
  }

  .modal-detail {
    padding: 16px;
  }
}
