/* Mellish Prompt Library v3 */

:root {
  --bg: #08060d;
  --bg-2: #120c1d;
  --card: rgba(20, 14, 32, 0.78);
  --text: #f7eefc;
  --muted: #c9b8d6;
  --soft: #9c87ad;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.28);
  --thumb-border: rgba(0, 0, 0, 0.65);
  --pink: #ff65c8;
  --violet: #9d72ff;
  --blue: #66d9ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --max-width: 1180px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 101, 200, 0.2), transparent 28rem),
    radial-gradient(circle at 80% 0%, rgba(102, 217, 255, 0.16), transparent 24rem),
    radial-gradient(circle at 50% 80%, rgba(157, 114, 255, 0.16), transparent 32rem),
    linear-gradient(145deg, var(--bg), var(--bg-2) 58%, #050308);
  color: var(--text);
  font-family: var(--font);
}

body.lightbox-open {
  overflow: hidden !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 85%);
}

a { color: inherit; }

.site-hero {
  position: relative;
  overflow: hidden;
  min-height: 640px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.hero-glow {
  position: absolute;
  inset: auto -10% -30% -10%;
  height: 420px;
  background:
    radial-gradient(circle, rgba(255, 101, 200, 0.28), transparent 44%),
    radial-gradient(circle at 62% 52%, rgba(102, 217, 255, 0.22), transparent 32%);
  filter: blur(18px);
  opacity: 0.72;
}

.topbar,
.hero-copy,
.page-wrap,
.site-footer {
  position: relative;
  z-index: 1;
  width: min(var(--max-width), calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.home-link { text-decoration: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.02));
  box-shadow: 0 0 30px rgba(255, 101, 200, 0.24);
  font-family: var(--serif);
}

.home-link {
  color: var(--muted);
  font-size: 0.95rem;
}

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

.hero-copy {
  max-width: 920px;
  margin-top: 110px;
  margin-left: max(calc((100% - var(--max-width)) / 2), 16px);
}

.eyebrow {
  width: fit-content;
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 101, 200, 0.32);
  border-radius: 999px;
  background: rgba(255, 101, 200, 0.08);
  color: #ffd6f0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.02;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(3.8rem, 12vw, 9rem);
  font-weight: 400;
  letter-spacing: -0.08em;
  text-shadow:
    0 0 22px rgba(255, 101, 200, 0.28),
    0 0 60px rgba(102, 217, 255, 0.12);
}

.intro {
  max-width: 780px;
  margin: 24px 0 0;
  color: var(--text);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  line-height: 1.65;
}

.intro.muted {
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover { transform: translateY(-2px); }

.button.primary {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 36px rgba(255, 101, 200, 0.26);
}

.button.ghost { background: rgba(255,255,255,0.06); }

.page-wrap { padding: 48px 0 64px; }

.controls-card,
.notes-card {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.055);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.controls-card h2,
.notes-card h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 400;
}

.controls-card p,
.notes-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.controls {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(160px, 220px);
  gap: 14px;
  width: min(100%, 500px);
}

.search-label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0,0,0,0.26);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

input:focus, select:focus {
  border-color: rgba(255, 101, 200, 0.65);
  box-shadow: 0 0 0 4px rgba(255, 101, 200, 0.12);
}

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

.prompt-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035)),
    var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.prompt-card:hover { border-color: rgba(255,255,255,0.26); }

.card-topline,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-pill,
.safe-pill,
.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.category-pill {
  color: #ffd6f0;
  border-color: rgba(255, 101, 200, 0.28);
  background: rgba(255, 101, 200, 0.08);
}

.safe-pill {
  color: #d8f7ff;
  border-color: rgba(102, 217, 255, 0.26);
  background: rgba(102, 217, 255, 0.07);
}

.prompt-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.prompt-description {
  margin: -6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.prompt-box {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(0,0,0,0.28);
}

.prompt-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.copy-btn {
  min-height: 34px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}

.copy-btn:hover,
.copy-btn.copied {
  border-color: rgba(255, 101, 200, 0.55);
  background: rgba(255, 101, 200, 0.16);
}

.prompt-text {
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  color: #f5e8ff;
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
}

.image-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: auto;
}

figure { margin: 0; }

.image-preview-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  cursor: zoom-in;
}

figure img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--thumb-border);
  border-radius: var(--radius-lg);
  background: rgba(0,0,0,0.65);
  transition: transform 160ms ease, border-color 160ms ease, filter 160ms ease;
}

.image-preview-btn:hover img {
  transform: translateY(-2px);
  border-color: rgba(255, 101, 200, 0.45);
  filter: brightness(1.08);
}

figcaption {
  margin-top: 8px;
  color: var(--soft);
  font-size: 0.78rem;
  text-align: center;
}

/* Hard-fixed image preview. Kept deliberately specific to avoid theme/CSS clashes. */
#imageLightbox.lightbox {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100vw !important;
  height: 100vh !important;
  padding: 72px 24px 40px !important;
  background: rgba(0, 0, 0, 0.88) !important;
  backdrop-filter: blur(18px);
}

#imageLightbox.lightbox.is-open,
#imageLightbox.lightbox[aria-hidden="false"] {
  display: flex !important;
}

.lightbox-inner {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 96vw;
  max-height: 88vh;
  margin: 0 !important;
}

#lightboxImage {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: min(1100px, 94vw) !important;
  max-height: 78vh !important;
  object-fit: contain !important;
  border: 1px solid rgba(0,0,0,0.85) !important;
  border-radius: 24px !important;
  background: #000 !important;
  box-shadow: 0 30px 100px rgba(0,0,0,0.85) !important;
}

#lightboxCaption {
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
}

.lightbox-close {
  position: fixed !important;
  top: 20px;
  right: 22px;
  z-index: 1000000 !important;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 101, 200, 0.2);
}

.notes-card {
  display: block;
  margin-top: 28px;
}

.notes-card code { color: #ffd6f0; }

.empty-state {
  grid-column: 1 / -1;
  padding: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-xl);
  color: var(--muted);
  text-align: center;
}

.site-footer {
  padding: 34px 0 48px;
  color: var(--soft);
  text-align: center;
}

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

  .controls-card {
    align-items: stretch;
    flex-direction: column;
  }

  .controls { width: 100%; }
}

@media (max-width: 680px) {
  .site-hero {
    min-height: auto;
    padding: 18px 0 56px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-copy { margin-top: 70px; }

  .controls,
  .prompt-grid,
  .image-pair {
    grid-template-columns: 1fr;
  }

  .prompt-card,
  .controls-card,
  .notes-card {
    border-radius: 22px;
  }

  #imageLightbox.lightbox {
    padding: 72px 12px 28px !important;
  }

  #lightboxImage {
    max-width: 96vw !important;
    max-height: 76vh !important;
    border-radius: 18px !important;
  }
}

/* v4 hero cleanup: centered header, no hero action buttons */

.centered-hero {
  width: min(900px, calc(100% - 32px));
  max-width: 900px;
  margin: 110px auto 0;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.centered-hero .eyebrow {
  margin-left: auto;
  margin-right: auto;
}

.centered-hero .intro {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.centered-hero h1 {
  text-align: center;
}

@media (max-width: 680px) {
  .centered-hero {
    margin-top: 70px;
  }
}

