/* ============================================================
   PROMPTS — 24 промта, фильтр, копирование, креатив-движок
   ============================================================ */

.prompts {
  position: relative;
  padding: var(--section-pad) var(--pad);
  background: var(--bg);
  border-top: 1px solid var(--hair);
}
.prompts .wrap { max-width: var(--maxw); margin: 0 auto; }

/* ---- ФИЛЬТР (sticky) ---- */
.p-filter {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 calc(var(--pad) * -1) clamp(34px, 4vw, 56px);
  padding: clamp(14px, 1.6vw, 20px) var(--pad);
  background: rgba(244, 245, 246, 0.82);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--hair);
}
.p-pill {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--graphite);
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 100px;
  padding: 9px 17px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.p-pill:hover { border-color: rgba(88,117,164,0.55); color: var(--blue-deep); }
.p-pill.is-active {
  color: #fff;
  background: var(--graphite);
  border-color: var(--graphite);
}

/* ---- СЕТКА ---- */
.p-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(14px, 1.4vw, 22px);
  align-items: start;
}

/* ---- КАРТОЧКА ПРОМТА ---- */
.p-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: 5px;
  padding: clamp(22px, 2.2vw, 34px);
  display: flex;
  flex-direction: column;
  transition: border-color 0.4s var(--ease), box-shadow 0.5s var(--ease);
}
.p-card:hover {
  border-color: rgba(88,117,164,0.4);
  box-shadow: 0 24px 50px -34px rgba(48,82,128,0.4);
}

.p-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.p-no {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: lining-nums;
}
.p-no b { color: var(--blue); font-weight: 500; }

.p-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--graphite);
  border: 1px solid var(--hair);
  border-radius: 100px;
  padding: 5px 11px;
  white-space: nowrap;
}
.p-tool::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue);
}
.p-tool.tool-nano::before { background: #b0783c; }

.p-title {
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.18;
  color: var(--ink);
}
.p-desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--graphite);
}

.p-actions {
  margin-top: clamp(18px, 2vw, 24px);
  display: flex;
  align-items: center;
  gap: 10px;
}
.p-copy, .p-toggle {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.3s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.p-copy {
  color: #fff;
  background: var(--graphite);
  border: 1px solid var(--graphite);
  padding: 10px 16px;
}
.p-copy:hover { background: var(--blue); border-color: var(--blue); }
.p-copy.copied { background: var(--blue-deep); border-color: var(--blue-deep); }
.p-toggle {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--hair);
  padding: 10px 14px;
}
.p-toggle:hover { border-color: rgba(88,117,164,0.55); color: var(--blue-deep); }
.p-toggle .chev { transition: transform 0.4s var(--ease); }
.p-card.open .p-toggle .chev { transform: rotate(180deg); }

/* тело промта */
.p-body {
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease), opacity 0.4s var(--ease), margin 0.4s var(--ease);
}
.p-card.open .p-body {
  max-height: 2400px;
  opacity: 1;
  margin-top: clamp(16px, 1.8vw, 22px);
}
.p-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.62;
  color: var(--graphite);
  background: var(--grey-soft);
  border: 1px solid var(--hair);
  border-left: 2px solid var(--blue);
  border-radius: 4px;
  padding: clamp(16px, 1.8vw, 22px);
}

/* ---- FEATURED: КРЕАТИВ-ДВИЖОК ---- */
.p-card.featured {
  grid-column: 1 / -1;
  background: var(--white);
  border-color: rgba(88,117,164,0.4);
  border-top: 3px solid var(--blue);
}
.p-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: clamp(18px, 2vw, 26px);
  background: var(--hair);
  border: 1px solid var(--hair);
  border-radius: 5px;
  overflow: hidden;
}
.p-flow-step {
  background: var(--grey-soft);
  padding: clamp(16px, 1.6vw, 22px);
}
.p-flow-step .n {
  font-size: 11px; letter-spacing: 0.16em; color: var(--blue);
  font-variant-numeric: lining-nums; display: block; margin-bottom: 10px;
}
.p-flow-step .t { font-size: 13.5px; line-height: 1.45; color: var(--graphite); }
.p-flow-step .t b { color: var(--ink); font-weight: 500; }

.p-download {
  margin-top: clamp(16px, 1.8vw, 22px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--blue-deep);
  text-decoration: none;
  border: 1px dashed rgba(88,117,164,0.5);
  border-radius: 4px;
  padding: 12px 18px;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.p-download:hover { background: rgba(88,117,164,0.08); border-color: var(--blue); }

/* примеры запуска движка */
.p-examples {
  margin-top: clamp(18px, 2vw, 26px);
  border-top: 1px solid var(--hair);
  padding-top: clamp(16px, 1.8vw, 22px);
}
.p-examples > .lbl {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); display: block; margin-bottom: 14px;
}
.p-ex {
  padding: 16px 0;
  border-bottom: 1px solid var(--hair);
}
.p-ex:last-child { border-bottom: none; }
.ex-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.ex-no {
  flex: none;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-variant-numeric: lining-nums;
}
.ex-no b { color: var(--blue); font-weight: 500; }
.ex-row .ex-t { flex: 1; font-size: 14px; line-height: 1.45; color: var(--graphite); }
.ex-row .ex-t b { color: var(--ink); font-weight: 500; }
.ex-row .p-tool { flex: none; align-self: center; }
.ex-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.ex-actions .p-copy,
.ex-actions .p-toggle { padding: 8px 13px; font-size: 12px; }
.p-ex .p-body { max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.5s var(--ease), opacity 0.4s var(--ease), margin 0.4s var(--ease); }
.p-ex.open .p-body { max-height: 900px; opacity: 1; margin-top: 12px; }

/* служебное */
.mono { color: var(--blue); }
.p-empty { text-align: center; color: var(--muted); padding: 40px 0; }
.p-card.hide { display: none; }

/* ---- REVEAL стаггер ---- */
.p-card[data-reveal]:nth-child(odd) { transition-delay: 0.04s; }
.p-card[data-reveal]:nth-child(even) { transition-delay: 0.12s; }

/* ---- АДАПТИВ ---- */
@media (max-width: 860px) {
  .p-grid { grid-template-columns: 1fr; }
  .p-flow { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .p-flow { grid-template-columns: 1fr; }
  .p-actions { flex-wrap: wrap; }
  .p-ex { flex-direction: column; gap: 10px; }
}
