:root {
  color-scheme: dark;
  --canvas: oklch(0.145 0.008 275);
  --surface: oklch(0.19 0.01 275);
  --raised: oklch(0.235 0.014 275);
  --ink: oklch(0.94 0.012 90);
  --muted: oklch(0.7 0.018 275);
  --coral: oklch(0.72 0.18 35);
  --paper: oklch(0.88 0.11 95);
  --line: oklch(0.94 0.012 90 / 0.11);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  overflow-x: hidden;
}

a { color: inherit; }

button,
input,
select { font: inherit; }

button,
a { touch-action: manipulation; }

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

.skip-link {
  position: fixed;
  z-index: 100;
  inset: 12px auto auto 12px;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--canvas);
  transform: translateY(-160%);
  transition: transform 160ms ease-out;
}

.skip-link:focus { transform: translateY(0); }

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

.masthead,
main,
footer {
  width: min(100%, 1440px);
  margin-inline: auto;
  padding-inline: max(20px, env(safe-area-inset-left));
}

.masthead { padding-top: 20px; }

.masthead__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-chip svg {
  width: 31px;
  height: 31px;
  fill: var(--coral);
}

nav { display: flex; gap: 8px; }

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 160ms ease-out, background-color 160ms ease-out, transform 120ms ease-out;
}

nav a:active { transform: scale(0.96); }

.masthead__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 48px;
  align-items: end;
  padding: clamp(64px, 9vw, 132px) 0 clamp(56px, 8vw, 112px);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--paper);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
}

h1,
h2,
h3,
p { text-wrap: pretty; }

h1 {
  margin: 0;
  font-family: "Arial Narrow", "Aptos Narrow", "Helvetica Neue", sans-serif;
  font-size: clamp(58px, 10vw, 146px);
  font-stretch: condensed;
  font-weight: 800;
  line-height: 0.78;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

h1 em {
  color: var(--coral);
  font-family: Georgia, serif;
  font-weight: 400;
  text-transform: none;
}

.manifesto {
  padding-bottom: 4px;
  color: var(--muted);
}

.manifesto > p {
  margin: 0;
  max-width: 38ch;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 42px 0 0;
}

.stats div { border-top: 1px solid var(--line); padding-top: 12px; }
.stats dt { color: var(--ink); font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stats dd { margin: 3px 0 0; font-size: 11px; line-height: 1.35; }

.filter-deck {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.36fr) minmax(0, 1fr);
  gap: 32px;
  align-items: end;
  padding-block: 18px;
  background: color-mix(in oklch, var(--canvas) 94%, transparent);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.filter-deck__heading .eyebrow { margin-bottom: 5px; }
.filter-deck h2 { margin: 0; font-size: 22px; letter-spacing: -0.012em; }

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 160px auto;
  gap: 8px;
}

.search-field { position: relative; }
.search-field svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  transform: translateY(-50%);
  pointer-events: none;
}

input,
select,
.quiet-button {
  width: 100%;
  min-height: 46px;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-sm);
}

input { padding: 0 16px 0 43px; }
input::placeholder { color: var(--muted); }
select { padding: 0 36px 0 13px; }

.quiet-button {
  width: auto;
  padding: 0 16px;
  color: var(--muted);
  cursor: pointer;
  transition: color 160ms ease-out, background-color 160ms ease-out, transform 120ms ease-out;
}
.quiet-button:active { transform: scale(0.96); }

.gallery-section { padding-block: 28px 80px; }

.gallery-status {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 12px;
}
.gallery-status p { margin: 0; }
.gallery-status strong { color: var(--paper); font-variant-numeric: tabular-nums; }

.gallery { columns: 4 280px; column-gap: 12px; }

.prompt-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border-radius: var(--radius-md);
  break-inside: avoid;
  outline: 1px solid oklch(0.94 0.012 90 / 0.08);
  outline-offset: -1px;
}

.prompt-card figure { position: relative; margin: 0; overflow: hidden; background: var(--raised); }
.prompt-card__image { display: block; width: 100%; height: auto; background: var(--raised); }
.prompt-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  padding: 6px 9px;
  overflow: hidden;
  color: var(--canvas);
  background: var(--paper);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.prompt-card__body { padding: 16px; }
.prompt-card__source { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.prompt-card__source-link { min-height: 40px; display: inline-flex; align-items: center; color: var(--muted); }
.prompt-card__title { margin: 8px 0 8px; font-size: 19px; line-height: 1.16; letter-spacing: -0.012em; }
.prompt-card__prompt { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.prompt-card__tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0 0; padding: 0; list-style: none; }
.prompt-card__tags li { padding: 4px 7px; color: var(--muted); background: var(--raised); border-radius: var(--radius-sm); font-size: 10px; }
.prompt-card__actions { display: grid; grid-template-columns: 1fr 1.15fr; gap: 7px; margin-top: 16px; }
.prompt-card__actions button,
.prompt-card__actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease-out, color 160ms ease-out, transform 120ms ease-out;
}
.copy-button { color: var(--ink); background: var(--raised); }
.freegen-button { color: var(--canvas); background: var(--coral); }
.prompt-card__actions button:active,
.prompt-card__actions a:active { transform: scale(0.96); }

.load-zone { display: grid; place-items: center; min-height: 120px; }
.load-more,
.empty button {
  min-height: 46px;
  padding: 0 20px;
  color: var(--canvas);
  background: var(--paper);
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 750;
  cursor: pointer;
  transition: transform 120ms ease-out;
}
.load-more:active,
.empty button:active { transform: scale(0.96); }
.load-more[hidden] { display: none; }

.empty { padding: 12vh 0; text-align: center; }
.empty span { color: var(--coral); font-size: 12px; letter-spacing: 0.12em; }
.empty h2 { margin: 12px 0 24px; font-size: clamp(36px, 6vw, 80px); letter-spacing: -0.04em; }

.rights-note {
  display: grid;
  grid-template-columns: 0.35fr minmax(280px, 0.8fr) minmax(220px, 0.55fr);
  gap: 32px;
  align-items: start;
  padding: 80px 0;
  border-top: 1px solid var(--line);
}
.rights-note h2 { margin: 0; max-width: 16ch; font-family: Georgia, serif; font-size: clamp(32px, 4vw, 58px); font-weight: 400; line-height: 1.03; letter-spacing: -0.035em; }
.rights-note > p:not(.eyebrow) { margin: 0; color: var(--muted); line-height: 1.65; }
.rights-note > a { grid-column: 3; min-height: 40px; color: var(--paper); font-weight: 700; }

footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-block: 28px max(28px, env(safe-area-inset-bottom));
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}
footer p { margin: 0; }
footer p:nth-child(2) { text-align: center; }
footer p:last-child { text-align: right; }

@media (hover: hover) {
  nav a:hover,
  .quiet-button:hover,
  .copy-button:hover { color: var(--ink); background: var(--raised); }
  .freegen-button:hover { background: oklch(0.78 0.17 35); }
  .prompt-card figure img { transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1); }
  .prompt-card:hover figure img { transform: scale(1.018); }
}

@media (max-width: 960px) {
  .masthead__grid { grid-template-columns: 1fr; gap: 40px; }
  .manifesto { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: end; }
  .stats { margin: 0; }
  .filter-deck { grid-template-columns: 1fr; gap: 12px; }
  .filters { grid-template-columns: minmax(200px, 1fr) 150px 150px auto; }
  .rights-note { grid-template-columns: 0.3fr 1fr; }
  .rights-note > p:not(.eyebrow), .rights-note > a { grid-column: 2; }
}

@media (max-width: 700px) {
  .masthead, main, footer {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .masthead__bar { align-items: center; }
  .brand-chip { min-width: 0; }
  .brand-chip span { max-width: 112px; line-height: 1.15; }
  nav { flex: 0 0 auto; gap: 2px; }
  nav a { min-height: 40px; padding-inline: 7px; font-size: 11px; }
  .masthead__grid { padding-block: 56px 64px; }
  .manifesto { display: block; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 32px; }
  .stats div:last-child { grid-column: 1 / -1; }
  .filter-deck { position: static; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .quiet-button { width: 100%; }
  .gallery-status p:last-child { display: none; }
  .gallery { columns: 1; }
  .rights-note { display: block; padding-block: 60px; }
  .rights-note h2 { margin-bottom: 24px; }
  .rights-note > a { display: inline-flex; align-items: center; margin-top: 22px; }
  footer { grid-template-columns: 1fr; }
  footer p:nth-child(2), footer p:last-child { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
