:root {
  --bg: #101010;
  --surface: #1a1a1b;
  --surface-2: #242426;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f4f4;
  --muted: #999b9f;
  --muted-2: #6d7075;
  --accent-a: #ffd7b5;
  --accent-b: #dfc4ff;
  --accent-c: #9ec8ff;
  --radius: 18px;
  --header-h: 72px;
  color-scheme: dark;
  font-family: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.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; }

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--header-h);
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}
.brand { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.brand-mark { position: relative; width: 24px; height: 24px; display: inline-block; transform: rotate(-7deg); }
.brand-mark i { position: absolute; inset: 0; display: block; border-radius: 7px 15px 7px 15px; transform-origin: center; }
.brand-mark i:nth-child(1) { background: linear-gradient(140deg, #fd5ca8, #a757f6); transform: translateX(-4px) rotate(36deg) scale(.72); }
.brand-mark i:nth-child(2) { background: linear-gradient(140deg, #8957f7, #4e92ff); transform: translateX(4px) rotate(-36deg) scale(.72); }
.brand-mark i:nth-child(3) { background: linear-gradient(140deg, #ff72bb, #6996ff); transform: scale(.34) rotate(45deg); }
.brand-name { font-size: 18px; font-weight: 600; letter-spacing: -.04em; }
.free-badge { padding: 2px 5px; border: 1px solid rgba(245,164,92,.7); border-radius: 999px; color: #ffc58f; font-size: 8px; font-weight: 700; letter-spacing: .08em; }
.desktop-nav { display: flex; align-items: center; gap: 34px; margin-left: 42px; }
.desktop-nav a { color: #a5a6aa; font-size: 14px; transition: color .2s ease; white-space: nowrap; }
.desktop-nav a:hover { color: #fff; }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.07); }
.source-link { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 17px; border-radius: 999px; background: #f2f2f2; color: #111; font-size: 13px; font-weight: 600; white-space: nowrap; }
.source-link i { font-size: 11px; }
.mobile-menu-toggle { display: none; }

.search-panel {
  position: fixed;
  z-index: 40;
  top: 12px;
  left: 50%;
  display: flex;
  align-items: center;
  width: min(680px, calc(100% - 32px));
  height: 52px;
  padding: 0 8px 0 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(31,31,33,.94);
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}
.search-panel input { min-width: 0; flex: 1; height: 100%; margin-left: 12px; border: 0; outline: 0; background: transparent; color: #fff; font-size: 15px; }
.search-panel input::placeholder { color: #777; }
.search-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); cursor: pointer; }

.mobile-menu { position: fixed; z-index: 35; inset: var(--header-h) 12px auto; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: rgba(29,29,31,.98); box-shadow: 0 24px 80px rgba(0,0,0,.6); }
.mobile-menu nav { display: grid; }
.mobile-menu a { padding: 15px 14px; border-radius: 12px; color: #d8d8da; font-weight: 600; }
.mobile-menu a:hover { background: rgba(255,255,255,.06); }

main { width: 100%; }
.hero { display: flex; flex-direction: column; align-items: center; min-height: 366px; padding: 58px 20px 48px; text-align: center; }
.eyebrow { padding: 3px 10px; border: 1px solid rgba(225,150,88,.75); border-radius: 999px; color: #f3d4bc; font-size: 10px; font-weight: 600; letter-spacing: .045em; }
.hero h1 { margin: 12px 0 14px; font-size: clamp(42px, 4.1vw, 62px); font-weight: 900; line-height: .92; letter-spacing: -.065em; }
.hero h1 span { color: transparent; background: linear-gradient(92deg, #ffe0bb 3%, #f4c6da 48%, #c4c9ff 90%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(18px 0 25px rgba(204,184,255,.24)); }
.hero p { max-width: 560px; margin: 0; color: #a9aaae; font-size: 16px; line-height: 1.55; }
.hero-cta { display: inline-flex; align-items: center; gap: 10px; min-height: 54px; margin-top: 27px; padding: 0 25px; border-radius: 999px; background: linear-gradient(180deg,#fff,#dce8f8); color: #101114; box-shadow: 0 8px 28px rgba(193,212,255,.12); font-size: 15px; font-weight: 700; transition: transform .25s ease, box-shadow .25s ease; }
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 38px rgba(193,212,255,.22); }

.catalog-controls { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0 24px; scroll-margin-top: 12px; }
.filter-rail { display: flex; align-items: center; min-width: 0; flex: 1; height: 44px; padding: 3px; overflow-x: auto; border: 1px solid var(--line); border-radius: 999px; scrollbar-width: none; }
.filter-rail::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; height: 36px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: #aaa; font-size: 13px; cursor: pointer; white-space: nowrap; }
.filter-chip:hover { color: #fff; }
.filter-chip.active { background: #252527; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.control-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sort-control { position: relative; display: flex; align-items: center; height: 42px; border: 1px solid var(--line); border-radius: 999px; background: #202022; }
.sort-control select { height: 100%; padding: 0 36px 0 18px; border: 0; outline: 0; appearance: none; background: transparent; color: #ddd; cursor: pointer; }
.sort-control i { position: absolute; right: 15px; font-size: 10px; pointer-events: none; }
.filter-more { display: none; align-items: center; gap: 8px; height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; background: #202022; cursor: pointer; }
.count-pill { display: inline-flex; align-items: center; gap: 5px; height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; color: #8f9195; font-size: 12px; white-space: nowrap; }
.count-pill strong { color: #eee; }
.extra-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 24px 0; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: #181819; }
.extra-filters button { height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #222224; color: #bfc0c3; cursor: pointer; }
.extra-filters button:hover, .extra-filters button.active { background: #f0f0f0; color: #111; }

.prompt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 12px; padding: 24px; }
.prompt-card { min-width: 0; content-visibility: auto; contain-intrinsic-size: auto 340px; }
.card-open { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; border: 0; border-radius: var(--radius); background: #1b1b1c; cursor: pointer; aspect-ratio: 4 / 3; }
.media-shell, .detail-media { position: absolute; inset: 0; display: block; overflow: hidden; background: #19191a; }
.media-shell img, .media-shell video, .detail-media img, .detail-media video { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .6s cubic-bezier(.22,1,.36,1), filter .3s ease; }
.media-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 7px; padding: clamp(16px, 2.2vw, 26px); overflow: hidden; background: radial-gradient(circle at 12% 10%, hsl(var(--fallback-hue) 42% 29%), transparent 48%), linear-gradient(145deg, hsl(calc(var(--fallback-hue) + 42) 34% 17%), #151516 72%); color: #fff; text-align: left; }
.media-fallback::before { content: ''; position: absolute; width: 60%; aspect-ratio: 1; top: -32%; right: -8%; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 0 0 18px rgba(255,255,255,.025), 0 0 0 42px rgba(255,255,255,.018); }
.media-fallback > * { position: relative; z-index: 1; }
.fallback-eyebrow { color: rgba(255,255,255,.58); font-size: 9px; font-weight: 700; letter-spacing: .11em; }
.media-fallback strong { max-width: 92%; font-size: clamp(17px, 2vw, 28px); line-height: 1.02; letter-spacing: -.045em; }
.media-fallback > span:last-child { color: rgba(255,255,255,.58); font-size: 11px; }
.card-open:hover img, .card-open:hover video { transform: scale(1.025); filter: brightness(1.04); }
.card-copy { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(12,12,13,.72); opacity: 0; backdrop-filter: blur(8px); transition: opacity .2s ease; }
.card-open:hover .card-copy { opacity: 1; }
.card-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 2px 0; }
.card-meta h2 { margin: 0 0 5px; overflow: hidden; color: #f1f1f1; font-size: 17px; font-weight: 700; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.card-meta p { margin: 0; color: #7f8793; font-size: 13px; }
.quick-copy { flex: 0 0 auto; width: 36px; height: 36px; margin-top: -3px; border: 0; border-radius: 50%; background: transparent; color: #8b8d92; cursor: pointer; }
.quick-copy:hover { background: rgba(255,255,255,.06); color: #fff; }

.empty-state { min-height: 380px; padding: 90px 20px; text-align: center; }
.empty-state i { color: #666; font-size: 26px; }
.empty-state h2 { margin: 18px 0 8px; }
.empty-state p { color: var(--muted); }
.empty-state button { margin-top: 12px; padding: 12px 18px; border: 0; border-radius: 999px; background: #eee; color: #111; cursor: pointer; }

body.detail-open .hero, body.detail-open .catalog-controls, body.detail-open .extra-filters { display: none !important; }
body.detail-open .prompt-grid { padding-top: 12px; }
.prompt-detail { grid-column: span 3; display: grid; grid-template-columns: minmax(0, 3.25fr) minmax(220px, 1fr); min-height: min(586px, calc(100vh - 104px)); overflow: hidden; border-radius: 24px; background: #28282a; }
.detail-preview { position: relative; min-height: 520px; background: #181819; }
.detail-back { position: absolute; z-index: 3; top: 9px; left: 9px; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; background: rgba(42,42,44,.88); color: #fff; cursor: pointer; backdrop-filter: blur(10px); }
.detail-panel { display: flex; flex-direction: column; justify-content: space-between; padding: 25px 22px 22px; background: #28282a; }
.detail-free { display: inline-block; margin-bottom: 15px; color: #a9dbbc; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.detail-panel h1 { margin: 0 0 7px; font-size: clamp(21px, 2vw, 28px); letter-spacing: -.04em; }
.detail-category { margin: 0; color: #8d95a2; font-size: 14px; }
.detail-likes { margin: 28px 0 0; color: #b8b8bb; font-size: 14px; }
.detail-actions { display: grid; gap: 9px; }
.detail-actions button, .reader-copy { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 44px; border: 1px solid rgba(255,255,255,.09); border-radius: 999px; background: #343437; cursor: pointer; }
.detail-actions button { min-width: 0; white-space: nowrap; }
.detail-actions .copy-full, .reader-copy { border: 0; background: #f1f1f1; color: #111; font-weight: 700; }
.detail-actions button:hover { filter: brightness(1.08); }

.prompt-reader { width: min(860px, calc(100% - 32px)); max-height: min(760px, calc(100dvh - 32px)); padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 24px; background: #1b1b1d; color: #eee; box-shadow: 0 30px 100px rgba(0,0,0,.7); }
.prompt-reader::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.reader-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.reader-header span { color: #a9dbbc; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.reader-header h2 { margin: 5px 0 0; font-size: 23px; }
.reader-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.07); cursor: pointer; }
.prompt-reader pre { max-height: calc(100dvh - 190px); margin: 0; padding: 22px; overflow: auto; color: #cacacd; font: 13px/1.65 "Inter",sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.reader-copy { position: sticky; bottom: 14px; width: calc(100% - 28px); margin: 0 14px 14px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; padding: 11px 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(34,34,36,.94); color: #fff; box-shadow: 0 14px 44px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transform: translate(-50%,12px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 34px 24px 40px; border-top: 1px solid var(--line); color: #6f7074; font-size: 12px; }
.site-footer a:hover { color: #ddd; }

@media (max-width: 1100px) {
  .desktop-nav { gap: 22px; margin-left: 28px; }
  .desktop-nav a:nth-child(3) { display: none; }
  .prompt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prompt-detail { grid-column: span 2; }
  .count-pill { display: none; }
  .filter-more { display: inline-flex; }
}

@media (max-width: 760px) {
  :root { --header-h: 68px; }
  .site-header { padding: 0 16px; }
  .brand-name { font-size: 17px; }
  .desktop-nav, .source-link { display: none; }
  .mobile-menu-toggle { display: grid; }
  .header-actions { gap: 0; }
  .hero { min-height: 368px; padding: 65px 16px 48px; }
  .hero h1 { max-width: 360px; margin-top: 13px; font-size: clamp(36px, 10vw, 42px); line-height: .94; }
  .hero p { max-width: 355px; font-size: 15px; }
  .hero-cta { min-height: 54px; }
  .catalog-controls { gap: 8px; padding: 0 16px; }
  .filter-rail { flex: 1; }
  .filter-rail .filter-chip:nth-child(n+6) { display: none; }
  .sort-control { display: none; }
  .filter-more { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .filter-more span { display: none; }
  .extra-filters { margin-inline: 16px; }
  .prompt-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 25px 12px; padding: 24px 16px; }
  .card-meta h2 { font-size: 16px; }
  .card-meta p { font-size: 12px; }
  .quick-copy { width: 30px; height: 30px; }
  .prompt-detail { grid-column: span 2; grid-template-columns: 1fr; min-height: 0; border-radius: 20px; }
  .detail-preview { min-height: 0; aspect-ratio: 4 / 3; }
  .detail-panel { min-height: 250px; gap: 30px; padding: 20px; }
  .detail-actions { grid-template-columns: 1fr 1fr; }
  .detail-actions .copy-full { grid-column: span 2; }
  .detail-actions button { gap: 7px; font-size: 12px; }
  body.detail-open .prompt-grid { padding-top: 8px; }
  .site-footer { flex-direction: column; padding-inline: 16px; }
}

@media (max-width: 420px) {
  .free-badge { display: none; }
  .hero { min-height: 360px; padding-top: 58px; }
  .hero h1 { font-size: 36px; }
  .filter-chip { padding-inline: 15px; }
  .filter-rail .filter-chip:nth-child(n+5) { display: none; }
  .card-open { border-radius: 15px; }
  .card-meta { padding-top: 11px; }
  .card-meta h2 { font-size: 15px; }
  .quick-copy { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
}
