/* Demos gallery */
.demos-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 290;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.demos-gallery-modal.is-open {
  display: flex;
}

.demos-gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(94, 76, 74, 0.45);
  backdrop-filter: blur(6px);
}

.demos-gallery-modal__panel {
  position: relative;
  width: min(100%, 420px);
  max-height: min(88vh, 640px);
  overflow-y: auto;
  padding: 24px 18px 20px;
  text-align: center;
  animation: slideUp 0.35s ease;
  -webkit-overflow-scrolling: touch;
}

.demos-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.demos-gallery-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 10px;
  border-radius: 18px;
  border: 1.5px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.demos-gallery-item:hover {
  transform: translateY(-2px);
  border-color: var(--pearl-pink);
  box-shadow: 0 8px 22px rgba(232, 195, 214, 0.35);
}

.demos-gallery-item__thumb {
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  position: relative;
  background: #f5e8ef;
}

.demos-gallery-item__thumb--live {
  pointer-events: none;
}

.demos-gallery-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demos-gallery-item__name {
  font-family: var(--font-display);
  font-size: 14px;
  font-style: italic;
  color: var(--dark-cocoa);
  line-height: 1.3;
}

.demos-gallery-item__tag {
  font-size: 10px;
  color: var(--soft-taupe);
  letter-spacing: 0.04em;
}

/* Demo modal — iPhone preview */
.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.demo-modal.is-open {
  display: flex;
}

.demo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(94, 76, 74, 0.45);
  backdrop-filter: blur(6px);
}

.demo-modal__panel {
  position: relative;
  width: min(100%, 340px);
  padding: 24px 20px 20px;
  text-align: center;
  animation: slideUp 0.35s ease;
}

.demo-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--dark-cocoa);
}

.demo-modal__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 4px;
}

.demo-modal__subtitle {
  font-size: 12px;
  color: var(--soft-taupe);
  margin: 0 0 18px;
}

.demo-phone {
  width: clamp(160px, 52vw, 200px);
  margin: 0 auto 14px;
  padding: 10px 6px;
  border-radius: 32px;
  background: linear-gradient(180deg, #3a3a3a, #1a1a1a);
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.28),
    0 0 32px -8px var(--glow-lavender);
}

.demo-phone__notch {
  width: 56px;
  height: 5px;
  margin: 0 auto 8px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.5);
}

.demo-phone__screen {
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 9 / 19.5;
  background: #111;
  display: flex;
  flex-direction: column;
}

.demo-phone__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.demo-modal__hint {
  font-size: 11px;
  font-style: italic;
  color: var(--soft-taupe);
  margin: 0 0 16px;
}

.demo-modal__actions {
  display: grid;
  gap: 8px;
}

.package-actions {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

/* Deliverables */
.deliverables-grid {
  display: grid;
  gap: 12px;
}

.deliverable-card {
  padding: 18px 16px;
  text-align: left;
}

.deliverable-card h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 10px;
}

.deliverable-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.deliverable-card li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--soft-taupe);
  line-height: 1.5;
}

.deliverable-card li::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 32% 28%, #fff, var(--pearl-pink), var(--lavender));
}

/* Відгуки */
.reviews-section {
  position: relative;
}

.review-stars {
  display: inline-flex;
  gap: 3px;
  margin-bottom: 14px;
}

.review-stars span {
  width: 10px;
  height: 10px;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background: linear-gradient(135deg, var(--pearl-pink), var(--lavender));
  box-shadow: 0 0 8px rgba(232, 195, 214, 0.35);
}

.review-stars--sm span {
  width: 7px;
  height: 7px;
}

.review-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--dark-cocoa);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(232, 195, 214, 0.45));
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 18px rgba(216, 201, 232, 0.28);
}

.review-avatar--sm {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.reviews-grid {
  display: grid;
  gap: 12px;
}

.review-card {
  padding: 16px;
  border-radius: 22px;
  text-align: left;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.review-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(216, 201, 232, 0.22);
}

.review-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.review-card__identity {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.review-card__identity strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--dark-cocoa);
}

.review-card__event {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft-taupe);
}

.review-card__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--dark-cocoa);
  opacity: 0.92;
}

.reviews-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.reviews-metric {
  padding: 14px 10px;
  border-radius: 20px;
  text-align: center;
}

.reviews-metric strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--dark-cocoa), #8d6b7a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.reviews-metric span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--soft-taupe);
  line-height: 1.35;
}

/* Copy link row */
.copy-link-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.copy-link-row .btn {
  width: auto;
  padding: 10px 18px;
  font-size: 12px;
}

/* Sticky mobile CTA */
.sticky-cta {
  display: none;
  position: fixed;
  transition: transform 0.28s ease;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 10px max(16px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
  background: linear-gradient(transparent, rgba(248, 242, 234, 0.92) 30%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sticky-cta .btn {
  box-shadow: 0 8px 28px rgba(232, 195, 214, 0.5);
}

@media (max-width: 767px) {
  .sticky-cta.is-visible {
    display: block;
  }

  body.has-sticky-cta {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

/* Pearl cursor — desktop only */
.pearl-cursor,
.pearl-cursor-trail {
  display: none;
}

@media (pointer: fine) and (min-width: 1024px) {
  body.has-pearl-cursor {
    cursor: none;
  }

  body.has-pearl-cursor a,
  body.has-pearl-cursor button,
  body.has-pearl-cursor input,
  body.has-pearl-cursor textarea,
  body.has-pearl-cursor select,
  body.has-pearl-cursor label {
    cursor: none;
  }

  .pearl-cursor {
    display: block;
    position: fixed;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(circle at 32% 28%, #fff 0%, var(--pearl-pink) 55%, var(--lavender) 100%);
    box-shadow:
      0 0 12px var(--glow-pink),
      0 0 4px rgba(255, 255, 255, 0.9);
    transition: transform 0.12s ease;
  }

  .pearl-cursor.is-pressed {
    transform: scale(0.85);
  }

  .pearl-cursor-trail {
    display: block;
    position: fixed;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.45;
    background: radial-gradient(circle, #fff, var(--pearl-pink));
    transition: opacity 0.35s ease, transform 0.35s ease;
  }
}

/* Soft button sparkles */
.btn-sparkle {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(circle, #fff, var(--pearl-pink));
  box-shadow: 0 0 8px var(--glow-lavender);
  animation: sparkle-fade 0.7s ease forwards;
}

@keyframes sparkle-fade {
  0% { opacity: 0.9; transform: scale(1) translate(0, 0); }
  100% { opacity: 0; transform: scale(0.3) translate(var(--dx, 0), var(--dy, -12px)); }
}

.portfolio-item[data-open-demo] {
  cursor: pointer;
}

.copy-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 400;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 12px;
  background: rgba(94, 76, 74, 0.88);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 768px) {
  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .deliverables-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-sparkle {
    animation: none;
    display: none;
  }

  body.has-pearl-cursor {
    cursor: auto;
  }

  .pearl-cursor,
  .pearl-cursor-trail {
    display: none !important;
  }
}
