/* =========================================================
   babapic — Homepage-specific styles
   ========================================================= */

/* ---------------------------------------------------------
   Hero — two-column: copy left, real dropzone elevated into a
   "product preview" panel on the right. Ambient blobs drift
   behind both, GPU-cheap (transform/opacity only).
   --------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-8) var(--space-7);
}

.hero__blob {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
}

.hero__blob--a {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle at 30% 30%, var(--color-accent), transparent 70%);
  top: -140px;
  left: -80px;
  animation: drift-a var(--dur-drift) ease-in-out infinite;
}

.hero__blob--b {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle at 70% 70%, #6f9599, transparent 70%);
  bottom: -120px;
  right: 6%;
  animation: drift-b calc(var(--dur-drift) * 1.2) ease-in-out infinite;
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-8);
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-accent);
  border: 1px solid var(--color-accent-border);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-4);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}

.hero__title {
  max-width: 14ch;
}

.hero__title .accent {
  color: var(--color-accent);
}

.hero__subtitle {
  max-width: 46ch;
  margin: var(--space-5) 0 0;
  font-size: var(--fs-body-lg);
  color: var(--color-text-muted);
}

.hero__cta-row {
  margin-top: var(--space-6);
}

.hero__trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-top: var(--space-6);
}

.hero__trust-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

.hero__trust-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-success);
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   Hero powder puffs — a pure-CSS colored haze that fills the right
   ~2/3 of the hero SECTION (not a card): 6 blurred circles bloom
   near their origin, then drift + scale outward while thinning to a
   lighter, more transparent color — reading like real powder
   dispersing. A left-edge mask keeps the densest color on the right
   so the copy on the left stays legible. No JS, no canvas, no images;
   animates transform + opacity only (one modest blur), so it's
   GPU-composited with no per-frame layout/paint. aria-hidden — the
   <h1> beside it carries the real meaning.
   --------------------------------------------------------- */
.hero-puffs {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 20%; /* widened: haze reaches further left toward the heading area */
  z-index: 0;
  pointer-events: none;
  /* Left-edge fade protects the copy: fully clear over the heading's left
     portion, then ramps up so only a soft/thin haze sits in the gap next to
     the text and the dense color stays out to the right. Mask is static
     (not animated), so it's cheap. */
  -webkit-mask-image: linear-gradient(to right, transparent 0, transparent 18%, #000 50%);
  mask-image: linear-gradient(to right, transparent 0, transparent 18%, #000 50%);
}

.hero-puff {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0;
  animation-name: hero-puff-drift;
  animation-duration: 5.5s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}

/* Fixed base position (set once, never animated) + a per-puff outward
   drift target read by the shared keyframes via custom properties — one
   keyframes definition for all six. Origins bias toward center-right and
   drifts push outward/rightward so density concentrates on the right.
   Colors: brand accent (teal) + accent-hover, plus festival tones
   tokens.css doesn't define (amber reuses --color-warning; pink, blue,
   and violet are hardcoded since the palette has no equivalents). */
.hero-puff--1 {
  top: 32%;
  left: 48%;
  background: var(--color-accent);
  --puff-x: 84px;
  --puff-y: -60px;
  animation-delay: 0s;
}

/* Amber + blue are the lightest tones — they sit furthest left (in the gap
   next to the text) and are held light by the mask, so they widen coverage
   leftward without harming heading legibility. */
.hero-puff--2 {
  top: 56%;
  left: 38%;
  background: var(--color-warning);
  --puff-x: 52px;
  --puff-y: 62px;
  animation-delay: 0.9s;
}

.hero-puff--3 {
  top: 44%;
  left: 64%;
  background: #d98fb3; /* soft pink — no token equivalent */
  --puff-x: 124px;
  --puff-y: 68px;
  animation-delay: 1.8s;
}

.hero-puff--4 {
  top: 40%;
  left: 42%;
  background: #6f9bd1; /* soft blue — no token equivalent */
  --puff-x: 40px;
  --puff-y: -54px;
  animation-delay: 2.7s;
}

.hero-puff--5 {
  top: 60%;
  left: 56%;
  background: var(--color-accent-hover);
  --puff-x: 96px;
  --puff-y: 48px;
  animation-delay: 3.6s;
}

/* Violet reaches furthest right to fill the open space toward the section
   edge; it lightens as it expands (opacity → 0), so the edge stays soft. */
.hero-puff--6 {
  top: 36%;
  left: 58%;
  background: #9b8bf4; /* soft violet — no token equivalent */
  --puff-x: 138px;
  --puff-y: -32px;
  animation-delay: 4.5s;
}

/* Powder curve: bloom quickly to strong color near the origin, stay
   fairly saturated through the first half while still small/mid-size,
   then thin out noticeably in the back half as it scales large and drifts
   outward — the expanding blurred circle spreads its color over more area
   AND drops opacity, so per-pixel density falls off toward the edges. */
@keyframes hero-puff-drift {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.4);
  }
  12% {
    opacity: 0.62;
    transform: translate(calc(var(--puff-x) * 0.15), calc(var(--puff-y) * 0.15)) scale(0.7);
  }
  45% {
    opacity: 0.5;
    transform: translate(calc(var(--puff-x) * 0.5), calc(var(--puff-y) * 0.5)) scale(1.4);
  }
  100% {
    opacity: 0;
    transform: translate(var(--puff-x), var(--puff-y)) scale(2.6);
  }
}

/* ---------------------------------------------------------
   Hero words — 3 sets cycling on a 9s loop (one visible at a time),
   each set 3 words stacked vertically that pop in from varied
   directions (left / right / below) with a slight stagger, hold, then
   exit upward. Boxless — floats directly over the haze, lifted for
   legibility by a soft light text-shadow (no solid panel). Uses the
   hero H1 display font. transform + opacity only.
   --------------------------------------------------------- */
.hero__stage {
  position: relative;
  z-index: 1;
  min-height: 380px;
}

.hero-words {
  position: absolute;
  inset: 0;
  /* Nudge the whole word stack slightly right of centre. Applied to the
     (non-animated) container, so it composes cleanly with the per-word
     entrance transforms without conflict. */
  transform: translateX(1.5rem);
}

.hero-words__set {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  text-align: center;
}

.hero-word {
  font-family: var(--font-serif);
  font-weight: var(--fw-semibold);
  font-size: clamp(2.625rem, 1.9rem + 2.6vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-text-heading);
  white-space: nowrap;
  /* Boxless legibility: a soft surface-colored halo lifts the dark text
     off the pastel haze without a visible panel behind it. */
  text-shadow: 0 0 14px rgba(251, 253, 252, 0.9), 0 1px 2px rgba(251, 253, 252, 0.7);
  opacity: 0;
  animation-name: hero-word-pop;
  animation-duration: 9s;
  animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
  will-change: transform, opacity;
}

/* Entrance direction per word via custom properties (one keyframe for
   all): word a from the left, b from the right, c from below. */
.hero-word--a {
  --word-from-x: -48px;
  --word-from-y: 0px;
}

.hero-word--b {
  --word-from-x: 48px;
  --word-from-y: 0px;
}

.hero-word--c {
  --word-from-x: 0px;
  --word-from-y: 38px;
}

/* "remove background" is a two-word phrase, longer than the single verbs it
   cycles with — drop its size a notch so it stays on one line and clears the
   stage's right edge without overflowing. */
.hero-word--wide {
  font-size: clamp(1.9rem, 1.35rem + 2vw, 2.7rem);
}

/* Set timing: each set offset by a third of the 9s loop (0s / 3s / 6s),
   so exactly one set is visible at a time. Within a set, the 3 words are
   nudged 0 / 0.15 / 0.3s apart for a staggered entrance. */
.hero-words__set--1 .hero-word--a { animation-delay: 0s; }
.hero-words__set--1 .hero-word--b { animation-delay: 0.15s; }
.hero-words__set--1 .hero-word--c { animation-delay: 0.3s; }

.hero-words__set--2 .hero-word--a { animation-delay: 3s; }
.hero-words__set--2 .hero-word--b { animation-delay: 3.15s; }
.hero-words__set--2 .hero-word--c { animation-delay: 3.3s; }

.hero-words__set--3 .hero-word--a { animation-delay: 6s; }
.hero-words__set--3 .hero-word--b { animation-delay: 6.15s; }
.hero-words__set--3 .hero-word--c { animation-delay: 6.3s; }

/* Each word occupies its set's ~1/3 window (with a springy overshoot on
   entry): enter from its direction, hold, then fade out upward. Fully
   hidden (opacity 0) outside the window so sets never visibly overlap. */
@keyframes hero-word-pop {
  0% {
    opacity: 0;
    transform: translate(var(--word-from-x), var(--word-from-y));
  }
  7% {
    opacity: 1;
    transform: translate(0, 0);
  }
  24% {
    opacity: 1;
    transform: translate(0, 0);
  }
  30%,
  100% {
    opacity: 0;
    transform: translate(0, -12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Freeze to a static frame: a few faint puffs on the right, held at a
     mid-expanded state, and word set 1 stacked, boxless, no motion. */
  .hero-puff {
    animation: none;
    opacity: 0.28;
    transform: translate(calc(var(--puff-x) * 0.5), calc(var(--puff-y) * 0.5)) scale(1.5);
  }

  .hero-puff--2,
  .hero-puff--4,
  .hero-puff--6 {
    display: none;
  }

  .hero-word {
    animation: none;
    opacity: 0;
    transform: none;
  }

  .hero-words__set--1 .hero-word {
    opacity: 1;
  }

  .hero-words__set--2,
  .hero-words__set--3 {
    display: none;
  }
}

@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }

  .hero__title {
    max-width: 20ch;
  }
}

@media (max-width: 640px) {
  .hero__blob--b {
    display: none;
  }

  .hero__blob--a {
    opacity: 0.2;
  }
}

/* ---------------------------------------------------------
   Stats strip — honest, verifiable facts about the product,
   replacing the idea of a "trusted by" logo wall babapic can't
   honestly claim.
   --------------------------------------------------------- */
.stats-section {
  background: var(--color-bg-raised);
  border-block: 1px solid var(--color-border);
  padding-block: var(--space-6);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  text-align: center;
  padding-inline: var(--space-4);
  border-left: 1px solid var(--color-border);
}

.stat:first-child {
  border-left: none;
}

.stat__num {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 1.5rem + 1vw, 2.4rem);
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat__label {
  display: block;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

@media (max-width: 720px) {
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5) 0;
  }

  .stat:nth-child(2n+1) {
    border-left: none;
  }

  .stat:nth-child(n+3) {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-5);
  }
}

/* ---------------------------------------------------------
   Tool showcase — broken grid. One featured card carries a
   stylized (clearly decorative, aria-hidden) preview of the
   real compress-image controls; the rest sit in a tighter grid
   around it via grid-auto-flow: dense.
   --------------------------------------------------------- */
.showcase {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: var(--space-4);
}

.tool-card--featured {
  grid-column: span 2;
  grid-row: span 2;
  justify-content: space-between;
}

.tool-preview {
  margin-top: var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.tool-preview__row {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.tool-preview__slider {
  height: 4px;
  border-radius: 999px;
  background: var(--color-surface-3);
  margin-bottom: var(--space-4);
  position: relative;
  overflow: hidden;
}

.tool-preview__slider::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 62%;
  background: var(--color-accent);
  border-radius: 999px;
}

.tool-preview__result {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

.tool-preview__result b {
  font-family: var(--font-serif);
  color: var(--color-accent);
  font-weight: var(--fw-regular);
  font-size: 1.05em;
}

/* Featured "New" badge — solid accent fill so it reads louder than the
   subtle "Popular" pill on the normal cards. */
.tool-card__badge--new {
  color: #fff;
  background: var(--color-accent);
}

/* Background-remover featured visual: a subject silhouette sitting on a
   transparency checkerboard, i.e. "background gone → transparent PNG".
   Pure CSS/SVG, decorative (aria-hidden) — no JS, nothing loaded. */
.tool-preview--cutout {
  padding: 0;
  overflow: hidden;
}

.cutout-demo {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 150px;
  /* Transparency checkerboard, built from the border token so it stays on-brand. */
  background-color: var(--color-surface);
  background-image:
    linear-gradient(45deg, var(--color-border) 25%, transparent 25%),
    linear-gradient(-45deg, var(--color-border) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--color-border) 75%),
    linear-gradient(-45deg, transparent 75%, var(--color-border) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  border-bottom: 1px solid var(--color-border);
}

.cutout-demo__subject {
  width: 88px;
  height: 88px;
  margin-bottom: -2px;
  color: var(--color-accent);
  filter: drop-shadow(0 3px 8px rgba(22, 38, 43, 0.18));
}

.tool-preview--cutout .tool-preview__result {
  padding: var(--space-3) var(--space-4);
}

@media (max-width: 960px) {
  .showcase {
    grid-template-columns: repeat(2, 1fr);
  }

  .tool-card--featured {
    grid-column: span 2;
    grid-row: span 1;
  }
}

@media (max-width: 640px) {
  .showcase {
    grid-template-columns: 1fr;
  }

  .tool-card--featured {
    grid-column: span 1;
  }
}

/* ---------------------------------------------------------
   How it works — a genuine 3-step sequence (order matters: you
   drop before it processes, it processes before you download),
   so the numbering earns its place here.
   --------------------------------------------------------- */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.steps::before {
  content: "";
  position: absolute;
  top: 38px;
  left: 12%;
  right: 12%;
  height: 1px;
  background: var(--color-border-strong);
}

.step {
  position: relative;
  text-align: center;
}

.step__num {
  width: 76px;
  height: 76px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  color: var(--color-accent);
  position: relative;
  z-index: 1;
}

.step h3 {
  font-size: var(--fs-body-lg);
  margin-bottom: var(--space-2);
}

.step p {
  color: var(--color-text-muted);
  font-size: var(--fs-small);
  max-width: 30ch;
  margin-inline: auto;
}

@media (max-width: 720px) {
  .steps {
    grid-template-columns: 1fr;
    gap: var(--space-7);
  }

  .steps::before {
    display: none;
  }
}

/* Trust / privacy section */
.trust-section {
  background: var(--color-bg-raised);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.trust-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.trust-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-accent-muted);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.trust-card__icon svg {
  width: 24px;
  height: 24px;
}

.trust-card h3 {
  margin-bottom: var(--space-2);
}

.trust-card p {
  color: var(--color-text-muted);
  font-size: var(--fs-small);
}

/* FAQ section width constraint on homepage */
.faq-section .faq-list {
  max-width: 760px;
  margin-inline: auto;
}

/* Final CTA */
.final-cta {
  text-align: center;
  background: linear-gradient(180deg, var(--color-surface), var(--color-bg-raised));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-5);
}

.final-cta h2 {
  margin-bottom: var(--space-3);
}

.final-cta p {
  color: var(--color-text-muted);
  max-width: 48ch;
  margin-inline: auto;
  margin-bottom: var(--space-5);
}

@media (max-width: 900px) {
  .trust-grid {
    grid-template-columns: 1fr;
  }
}
