/**
 * Effects layer — gradients, depth, decorative backgrounds, motion.
 * Token-driven only. All motion is transform/opacity and fully disabled
 * by the global prefers-reduced-motion rule in base.css.
 */

/* ── Section depth ──────────────────────────────────────────────────── */
.rt-section--navy,
.rt-section--navy-deep {
  background-image: radial-gradient(
      ellipse 80% 60% at 70% -10%,
      var(--rt-navy-700) 0%,
      transparent 60%
    ),
    linear-gradient(180deg, var(--rt-navy) 0%, var(--rt-navy-900) 100%);
}

.rt-hero {
  position: relative;
  overflow: hidden;
}

/* Decorative dot grid (pure CSS, no assets) */
.rt-bg-dots {
  position: relative;
}
.rt-bg-dots::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    color-mix(in srgb, var(--rt-navy) 14%, transparent) 1.5px,
    transparent 1.5px
  );
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
  pointer-events: none;
}
.rt-section--navy.rt-bg-dots::before,
.rt-section--navy-deep.rt-bg-dots::before {
  background-image: radial-gradient(
    color-mix(in srgb, var(--rt-white) 12%, transparent) 1.5px,
    transparent 1.5px
  );
}
.rt-bg-dots > * {
  position: relative;
}

/* Coral glow accent for hero/CTA moments */
.rt-glow {
  position: relative;
}
.rt-glow::after {
  content: "";
  position: absolute;
  width: 38rem;
  height: 38rem;
  right: -12rem;
  top: -14rem;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--rt-cta) 22%, transparent) 0%,
    transparent 65%
  );
  pointer-events: none;
}

/* Wave divider between sections (token-colored, flips with --flip) */
.rt-divider {
  display: block;
  width: 100%;
  height: clamp(2.5rem, 6vw, 5rem);
  color: var(--rt-surface);
}
.rt-divider--navy {
  color: var(--rt-navy);
}
.rt-divider--white {
  color: var(--rt-white);
}
.rt-divider--flip {
  transform: scaleY(-1);
}

/* ── Cards & interactive depth ──────────────────────────────────────── */
.rt-card,
.rt-sku-card,
.rt-post-card,
.rt-plan {
  transition: transform var(--rt-dur) var(--rt-ease),
    box-shadow var(--rt-dur) var(--rt-ease);
}
.rt-card:hover,
.rt-sku-card:hover,
.rt-post-card:hover {
  box-shadow: var(--rt-shadow);
}
.rt-plan--featured {
  background-image: linear-gradient(
    180deg,
    color-mix(in srgb, var(--rt-cta) 5%, var(--rt-white)) 0%,
    var(--rt-white) 30%
  );
}

/* Icon chip used in feature/pain/wedge cards */
.rt-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
  border-radius: var(--rt-radius);
  background: var(--rt-coral-tint);
  color: var(--rt-cta-alt);
  margin-bottom: var(--rt-space-4);
}
.rt-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}
.rt-icon--navy {
  background: var(--rt-surface-2);
  color: var(--rt-navy);
}
.rt-on-dark .rt-icon,
.rt-section--navy .rt-icon {
  background: color-mix(in srgb, var(--rt-white) 10%, transparent);
  color: var(--rt-coral-soft);
}

/* Button shine sweep on primary CTAs */
.rt-btn--primary {
  position: relative;
  overflow: hidden;
}
.rt-btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    color-mix(in srgb, var(--rt-white) 35%, transparent) 50%,
    transparent 70%
  );
  transform: translateX(-110%);
}
.rt-btn--primary:hover::after {
  transform: translateX(110%);
  transition: transform 600ms var(--rt-ease);
}

/* ── Motion ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  /* Staggered reveals: parents with .rt-stagger delay their .rt-rise children */
  .rt-stagger > .rt-rise:nth-child(2) {
    transition-delay: 90ms;
  }
  .rt-stagger > .rt-rise:nth-child(3) {
    transition-delay: 180ms;
  }
  .rt-stagger > .rt-rise:nth-child(4) {
    transition-delay: 270ms;
  }
  .rt-stagger > .rt-rise:nth-child(5) {
    transition-delay: 360ms;
  }
  .rt-stagger > .rt-rise:nth-child(6) {
    transition-delay: 450ms;
  }

  /* Gentle float for hero illustration cards */
  @keyframes rt-float {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-12px);
    }
  }
  .rt-float {
    animation: rt-float 6s ease-in-out infinite;
  }
  .rt-float--late {
    animation-delay: -3s;
  }

  /* Slow pulse for badges that should draw the eye (used sparingly) */
  @keyframes rt-pulse {
    0%,
    100% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.05);
    }
  }
  .rt-pulse {
    animation: rt-pulse 2.6s ease-in-out infinite;
  }

  /* Marquee for the integrations strip */
  @keyframes rt-marquee {
    from {
      transform: translateX(0);
    }
    to {
      transform: translateX(-50%);
    }
  }
  .rt-marquee__track {
    animation: rt-marquee 28s linear infinite;
  }
  .rt-marquee:hover .rt-marquee__track {
    animation-play-state: paused;
  }

  /* "Sell everywhere" hub: order sync crawls along the connector wires toward
     the Rocktomic node, which softly pulses so the center reads as live. The
     dash period is 2.9 (1.3 + 1.6); offset of 5.8 = two periods, so it loops
     seamlessly. Per-wire durations stagger the flow so it feels organic. */
  @keyframes rt-hub-flow {
    to {
      stroke-dashoffset: 5.8;
    }
  }
  .rt-hub__wires line {
    animation: rt-hub-flow 1.4s linear infinite;
  }
  .rt-hub__wires line:nth-child(2) { animation-duration: 1.7s; }
  .rt-hub__wires line:nth-child(3) { animation-duration: 1.2s; }
  .rt-hub__wires line:nth-child(4) { animation-duration: 1.6s; }
  .rt-hub__wires line:nth-child(5) { animation-duration: 1.3s; }
  .rt-hub__wires line:nth-child(6) { animation-duration: 1.8s; }
  .rt-hub__wires line:nth-child(7) { animation-duration: 1.45s; }

  /* Channel tiles float (Printful-style), each on its own offset so the cluster
     drifts organically. The keyframe keeps the centering translate so the tiles
     stay on their ring positions. Hover pauses the bob (see components.css). */
  @keyframes rt-hub-bob {
    0%,
    100% {
      transform: translate(-50%, -50%);
    }
    50% {
      transform: translate(-50%, calc(-50% - 7px));
    }
  }
  .rt-hub__tile {
    animation: rt-hub-bob 4.8s ease-in-out infinite;
  }
  .rt-hub__tile--1 { animation-delay: -0.2s; }
  .rt-hub__tile--2 { animation-delay: -1.4s; }
  .rt-hub__tile--3 { animation-delay: -0.7s; }
  .rt-hub__tile--4 { animation-delay: -2.1s; }
  .rt-hub__tile--5 { animation-delay: -1s; }
  .rt-hub__tile--6 { animation-delay: -2.6s; }
  .rt-hub__tile--7 { animation-delay: -0.5s; }

  @keyframes rt-hub-ping {
    0% {
      box-shadow: 0 0 0 0 color-mix(in srgb, var(--rt-cta) 45%, transparent);
    }
    70%,
    100% {
      box-shadow: 0 0 0 1.5rem color-mix(in srgb, var(--rt-cta) 0%, transparent);
    }
  }
  .rt-hub__node::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    animation: rt-hub-ping 2.8s ease-out infinite;
  }
}

.rt-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.rt-marquee__track {
  display: flex;
  gap: var(--rt-space-7);
  width: max-content;
  align-items: center;
}
.rt-marquee__item {
  font-size: var(--rt-text-md);
  font-weight: var(--rt-weight-heavy);
  letter-spacing: var(--rt-tracking-tight);
  color: var(--rt-ink-soft);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--rt-space-2);
}
.rt-on-dark .rt-marquee__item,
.rt-section--navy .rt-marquee__item {
  color: var(--rt-on-navy-soft);
}

/* Count-up stats: JS sets the number; CSS just reserves tabular figures */
.rt-stat__num {
  font-variant-numeric: tabular-nums;
}

/* ── Hero collage of floating product cards ─────────────────────────── */
.rt-collage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--rt-space-5);
  align-items: start;
}
.rt-collage .rt-sku-card {
  box-shadow: var(--rt-shadow);
}
.rt-collage > :nth-child(2) {
  margin-top: var(--rt-space-7);
}

/* Illustration sizing inside cards/heroes */
.rt-illo {
  display: block;
  width: 100%;
  height: auto;
}
.rt-sku-card__media .rt-illo,
.rt-post-card__media .rt-illo {
  height: 100%;
  width: 100%;
  object-fit: contain;
  padding: var(--rt-space-4);
}
.rt-sku-card__media,
.rt-post-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--rt-surface) 0%, var(--rt-surface-2) 100%);
}

/* ── v4 micro-polish ────────────────────────────────────────────────── */

/* Animated link underlines in prose/nav contexts */
.rt-prose a,
.rt-footer__cols a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size var(--rt-dur) var(--rt-ease);
}
.rt-prose a:hover,
.rt-footer__cols a:hover {
  background-size: 100% 1px;
}

/* Coral hairline ring on interactive card hover */
.rt-card:hover,
.rt-sku-card:hover,
.rt-post-card:hover,
.rt-plan:hover {
  outline: 1px solid color-mix(in srgb, var(--rt-cta) 35%, transparent);
  outline-offset: 0;
}

/* Rendering performance: skip offscreen section work (Lighthouse TBT/LCP) */
.rt-section--tight,
.rt-section:not(.rt-hero) {
  content-visibility: auto;
  contain-intrinsic-size: auto 640px;
}

/* Crisper image rendering in cards */
.rt-sku-card__media img,
.rt-post-card__media img {
  transition: transform var(--rt-dur-slow) var(--rt-ease);
}
.rt-sku-card:hover .rt-sku-card__media img,
.rt-post-card:hover .rt-post-card__media img {
  transform: scale(1.03);
}
@media (prefers-reduced-motion: reduce) {
  .rt-sku-card:hover .rt-sku-card__media img,
  .rt-post-card:hover .rt-post-card__media img {
    transform: none;
  }
}
