/* coolai.art — prompt gallery */

:root {
  --bg: #14121a;
  --surface: #1d1a26;
  --surface-2: #262230;
  --line: #322d40;
  --text: #f4f2ec;
  --muted: #9b96a8;
  --faint: #6f6a7e;

  /* model hues — the color system of the site */
  --midjourney: #ff7a59;
  --flux: #53d6e0;
  --sdxl: #f5b841;
  --dalle: #a78bfa;

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;

  --radius: 10px;
  --maxw: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- header ---------- */

.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark .tld { color: var(--faint); font-weight: 400; }

.site-head nav {
  font-size: 0.9rem;
  color: var(--muted);
}
.site-head nav a { text-decoration: none; color: var(--muted); }
.site-head nav a:hover { color: var(--text); }

/* ---------- hero ---------- */

.hero {
  padding: 3.2rem 0 2.2rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 0.9rem;
  max-width: 22ch;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--midjourney), var(--sdxl), var(--flux), var(--dalle));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--muted);
  max-width: 52ch;
  margin: 0;
}

/* ---------- filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.6rem 0 0.4rem;
}

.chip {
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 120ms, border-color 120ms, background 120ms;
}

.chip:hover { color: var(--text); }

.chip[aria-pressed="true"] {
  color: var(--bg);
  border-color: transparent;
  background: var(--text);
}

.chip.style { text-transform: capitalize; }
.chip.tag { font-size: 0.78rem; }

.filters.tags {
  padding-top: 0.2rem;
  padding-bottom: 0.6rem;
}

/* ---------- gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.1rem;
  padding: 1.4rem 0 3rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 140ms ease, border-color 140ms ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent, var(--faint));
}

.card { --accent: var(--sdxl); }

.card.hidden { display: none; }

.card-thumb {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}
.card-thumb img, .card-thumb svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 0.95rem 0.95rem;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.model-tag {
  color: var(--accent, var(--muted));
  font-weight: 600;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
}
.card h2 a { text-decoration: none; }
.card h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent, var(--faint)); }

.card .prompt-snip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  margin-top: auto;
  padding-top: 0.4rem;
}

/* ---------- copy button ---------- */

.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.42rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.copy-btn:hover { border-color: var(--accent, var(--faint)); }
.copy-btn.copied {
  background: var(--accent, var(--text));
  border-color: transparent;
  color: var(--bg);
}

/* ---------- detail page ---------- */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2.2rem;
  padding: 2.4rem 0 3rem;
  align-items: start;
}

.detail-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.detail-media img, .detail-media svg { width: 100%; display: block; }

.detail-info h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0.2rem 0 1rem;
}

.crumb {
  font-size: 0.85rem;
  color: var(--muted);
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--text); }

.prompt-block {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.65;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent, var(--faint));
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 3.2rem;
  margin: 0 0 1.2rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-block .copy-btn {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
}

.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0 0 1.4rem;
}
.spec th, .spec td {
  text-align: left;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.spec th {
  color: var(--muted);
  font-weight: 500;
  width: 38%;
}

.notes {
  color: var(--muted);
  font-size: 0.95rem;
  border-left: 2px solid var(--line);
  padding-left: 0.9rem;
  margin: 0 0 1.4rem;
}

.detail-info .model-tag { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }

.model-tag { --accent: var(--sdxl); }

.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.8rem 0 0.4rem; }
.tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-transform: lowercase;
}

/* ---------- related ---------- */

.related { padding: 0 0 3rem; }
.related h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

/* ---------- prose pages (about, privacy) ---------- */

.prose {
  max-width: 62ch;
  padding: 2.4rem 0 3rem;
}
.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 1.2rem;
}
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.6rem;
}
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose a { color: var(--text); text-decoration-color: var(--faint); }
.prose .updated {
  font-size: 0.82rem;
  color: var(--faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- pagination ---------- */

.pagination.hidden { display: none; }
.no-results {
  font-family: var(--font-body);
  color: var(--muted);
  text-align: center;
  padding: 2rem 0 2.5rem;
}
.no-results.hidden { display: none; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.4rem 0 2.5rem;
  flex-wrap: wrap;
}
.page-link, .page-num {
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.38rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  transition: color 120ms, border-color 120ms, background 120ms;
}
.page-link:hover, .page-num:hover { color: var(--text); border-color: var(--faint); }
.page-link.disabled { opacity: 0.3; pointer-events: none; }
.page-num.active {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}
.page-numbers { display: flex; gap: 0.3rem; }

/* ---------- ad slots ---------- */

.ad-slot {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
}
.ad-slot:empty { display: none; }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.2rem;
  color: var(--faint);
  font-size: 0.85rem;
}
.site-foot a { color: var(--muted); }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .detail { grid-template-columns: 1fr; gap: 1.4rem; }
  .hero { padding: 2.2rem 0 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .card:hover { transition: none; transform: none; }
}

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