/* WebStudiy — polish layer (spacing, motion, conversion accents).
   Loaded after main.css via inc/polish.php. Safe to remove as a whole. */

:root {
  interpolate-size: allow-keywords;
}

/* ---------- scroll progress ---------- */
.ws-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 120;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #ff4a8f, #ffb1c5 60%, #6dfe9c);
  box-shadow: 0 0 12px rgba(255, 74, 143, 0.6);
}

/* ---------- reveal: deeper entrance + stagger ---------- */
.reveal {
  transform: translateY(28px);
  transition-duration: 0.8s;
  transition-delay: var(--rv-d, 0s);
}

.reveal.is-visible {
  transform: none;
}

/* after the entrance, give cards their hover transitions back */
.reveal.rv-done {
  --rv-d: 0s;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--ease), background-color 0.4s var(--ease);
}

.hero__content > .reveal:nth-child(2) { --rv-d: 0.1s; }
.hero__content > .reveal:nth-child(3) { --rv-d: 0.2s; }
.hero__content > .reveal:nth-child(4) { --rv-d: 0.3s; }
.hero__content > .reveal:nth-child(5) { --rv-d: 0.42s; }

.bento > .reveal:nth-child(2),
.services-grid > .reveal:nth-child(2),
.pricing-grid > .reveal:nth-child(2),
.process-grid > .reveal:nth-child(2),
.portfolio-bento > .reveal:nth-child(4n + 2) { --rv-d: 0.09s; }

.bento > .reveal:nth-child(3),
.services-grid > .reveal:nth-child(3),
.pricing-grid > .reveal:nth-child(3),
.process-grid > .reveal:nth-child(3),
.portfolio-bento > .reveal:nth-child(4n + 3) { --rv-d: 0.18s; }

.bento > .reveal:nth-child(4),
.services-grid > .reveal:nth-child(4),
.process-grid > .reveal:nth-child(4),
.portfolio-bento > .reveal:nth-child(4n + 4) { --rv-d: 0.27s; }

.process-grid > .reveal:nth-child(5) { --rv-d: 0.36s; }

.faq-grid .faq-item.reveal:nth-of-type(2) { --rv-d: 0.08s; }
.faq-grid .faq-item.reveal:nth-of-type(3) { --rv-d: 0.16s; }
.faq-grid .faq-item.reveal:nth-of-type(4) { --rv-d: 0.24s; }

/* ---------- hero ---------- */
.hero {
  /* main.css has calc() without spaces here, so the padding was ignored */
  padding: calc(var(--header-h) + 2.5rem) 2.5rem 4.5rem;
}

.hero__title,
.section-head h2,
.lead-magnet__panel h2,
.cta-band h2 {
  text-wrap: balance;
}

.hero__title .text-accent {
  background: linear-gradient(90deg, #ff4a8f 0%, #ff8db8 25%, #ffd0de 50%, #ff8db8 75%, #ff4a8f 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: ws-shimmer 7s linear infinite;
  filter: drop-shadow(0 0 28px rgba(255, 74, 143, 0.35));
  padding-bottom: 0.08em;
}

@keyframes ws-shimmer {
  to { background-position: -200% 0; }
}

.hero__text {
  text-wrap: pretty;
  margin-bottom: 2.25rem;
}

.hero__actions {
  margin-bottom: 2.75rem;
}

.hero__badges {
  border-top: 0;
  padding-top: 0;
  gap: 0.75rem;
}

.hero__badges li {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.1rem 0.6rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  color: rgba(233, 223, 239, 0.82);
  letter-spacing: 0.08em;
}

.hero__badges li::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4l2.6 2.6L13 6.6' fill='none' stroke='%23003919' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px 18px no-repeat,
    var(--secondary);
  box-shadow: 0 0 12px rgba(77, 224, 130, 0.45);
}

/* ---------- buttons ---------- */
.btn--primary {
  background: linear-gradient(135deg, #ff5c9b 0%, #ff3d88 55%, #ff2d87 100%);
  box-shadow: 0 10px 30px -8px rgba(255, 45, 135, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn--primary:hover {
  box-shadow: 0 16px 44px -8px rgba(255, 45, 135, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn--ghost:hover {
  border-color: rgba(255, 177, 197, 0.45);
  transform: translateY(-2px);
}

/* periodic shine on the main CTAs */
.hero__actions .btn--primary::before,
.lead-magnet__panel .btn--primary::before,
.cta-band .btn--primary::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  animation: ws-shine 4.8s ease-in-out infinite;
}

@keyframes ws-shine {
  0%, 62% { left: -60%; }
  100% { left: 130%; }
}

.cta-band .btn--primary {
  animation: ws-cta-pulse 2.8s ease-out infinite;
}

@keyframes ws-cta-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 177, 197, 0.55), 0 0 20px var(--primary-glow); }
  70%, 100% { box-shadow: 0 0 0 18px rgba(255, 177, 197, 0), 0 0 20px var(--primary-glow); }
}

.service-card .text-link,
.bento__item .text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.service-card .text-link::after,
.bento__item .text-link::after {
  content: "→";
  transition: transform 0.3s var(--ease);
}

.service-card:hover .text-link::after,
.bento__item:hover .text-link::after {
  transform: translateX(5px);
}

/* ---------- cursor spotlight on cards ---------- */
@media (hover: hover) and (pointer: fine) {
  .pricing-card:not(.is-featured),
  .faq-item,
  .portfolio-card {
    background-image: radial-gradient(380px circle at var(--mx, -500px) var(--my, -500px), rgba(255, 74, 143, 0.13), transparent 65%);
  }

  .service-card:not(.is-accent),
  .process-step__card {
    background-image:
      radial-gradient(380px circle at var(--mx, -500px) var(--my, -500px), rgba(255, 74, 143, 0.13), transparent 65%),
      linear-gradient(160deg, rgba(255, 74, 143, 0.08), transparent 52%);
  }
}

/* ---------- section rhythm ---------- */
.section-head {
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.section-head .lead {
  margin-top: 1.1rem;
}

.section.lead-magnet {
  padding-block: clamp(1rem, 3vw, 2.5rem);
}

.section.process {
  padding-bottom: calc(var(--section-pad) * 0.55);
}

.section.faq-block {
  padding-top: calc(var(--section-pad) * 0.55);
}

.section-cta {
  margin-top: 2.75rem;
}

/* ---------- pricing ---------- */
.pricing-card__content .btn {
  margin-top: auto;
}

.pricing-card .feature-list {
  margin-bottom: 1.25rem;
}

.pricing-card.is-featured .tag {
  position: absolute;
  top: 1.6rem;
  right: 1.6rem;
  margin: 0;
  padding: 0.35rem 0.75rem;
  background: var(--secondary);
  border-color: transparent;
  color: var(--on-secondary);
  font-weight: 700;
  box-shadow: 0 0 18px rgba(77, 224, 130, 0.45);
}

.pricing-card.is-featured {
  border-color: rgba(255, 74, 143, 0.7);
  box-shadow: 0 30px 80px -34px rgba(255, 74, 143, 0.7), 0 0 0 1px rgba(255, 74, 143, 0.25) inset;
}

@media (min-width: 981px) {
  .pricing-grid {
    padding-top: 16px;
    align-items: stretch;
  }

  .pricing-card.is-featured.is-visible {
    transform: translateY(-16px);
  }

  .pricing-card.is-featured.is-visible:hover {
    transform: translateY(-22px);
  }
}

.pricing-card__old-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pricing-card__save {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(77, 224, 130, 0.16);
  border: 1px solid rgba(77, 224, 130, 0.35);
  color: var(--secondary-fixed);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ---------- portfolio ---------- */
.portfolio-card__media {
  position: relative;
}

.portfolio-card__media::after {
  content: "Смотреть кейс →";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(180deg, rgba(22, 17, 28, 0.25), rgba(22, 17, 28, 0.78));
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .portfolio-card:hover .portfolio-card__media::after {
    opacity: 1;
  }

  .portfolio-bento .portfolio-card:hover .portfolio-card__media img {
    transform: scale(1.06);
  }
}

.portfolio-bento .tag-row {
  flex-wrap: nowrap;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
  mask-image: linear-gradient(90deg, #000 82%, transparent);
}

.portfolio-bento .portfolio-card__body h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- FAQ: smooth open ---------- */
.faq-item::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.35s var(--ease), content-visibility 0.35s allow-discrete;
}

.faq-item[open]::details-content {
  block-size: auto;
}

.faq-item:hover {
  transform: none;
}

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .hero {
    padding: calc(var(--header-h) + 1.5rem) 1.25rem 3rem;
  }

  .hero__content {
    width: 100%;
  }

  .hero__title {
    font-size: clamp(2rem, 10.2vw, 2.7rem);
  }

  .hero__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 0;
  }

  .hero__badges li {
    padding: 0.5rem 0.85rem 0.5rem 0.6rem;
    font-size: 10.5px;
    letter-spacing: 0.06em;
  }

  /* portfolio: swipeable row instead of 12 stacked cards */
  .portfolio-bento {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: -1rem;
    padding: 0.25rem 1rem 0.75rem;
    max-width: none;
    scroll-padding-inline: 1rem;
  }

  .portfolio-bento::-webkit-scrollbar {
    display: none;
  }

  .portfolio-bento > .portfolio-card {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }

  .portfolio-bento > .portfolio-card.reveal {
    opacity: 1;
    transform: none;
  }

  .portfolio-block .section-head::after {
    content: "Листайте →";
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-soft);
  }

  .section-cta {
    margin-top: 1.5rem;
  }

  .pricing-card.is-featured .tag {
    top: 1.25rem;
    right: 1.25rem;
  }
}

/* ---------- small fixes after visual review ---------- */
.portfolio-bento .tag-row .tag {
  flex: 0 0 auto;
  white-space: nowrap;
}

.code-chip {
  white-space: normal;
}

@media (max-width: 640px) {
  .process-step__card {
    min-height: 0;
  }
}
