/* ROSSO — Animations & micro-interactions
   Small, tasteful, designer-touched. Respects prefers-reduced-motion.
*/

/* ============ PULSE on WIP banner dot ============ */
@keyframes rosso-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(200, 16, 46, 0.18),
      0 0 0 0   rgba(200, 16, 46, 0.0);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(200, 16, 46, 0.18),
      0 0 0 10px rgba(200, 16, 46, 0.0);
  }
}
.wip-banner .dot { animation: rosso-pulse 2s ease-out infinite; }

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s cubic-bezier(.2,.6,.2,1),
    transform 0.7s cubic-bezier(.2,.6,.2,1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }

/* ============ FLOAT (gentle bob on app mocks) ============ */
@keyframes rosso-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
.float-anim { animation: rosso-float 5.5s ease-in-out infinite; }
.float-anim.d1 { animation-delay: 0s; }
.float-anim.d2 { animation-delay: 1.4s; }
.float-anim.d3 { animation-delay: 2.8s; }
.float-anim.d4 { animation-delay: 4.2s; }

/* ============ BUTTON LIFT ============ */
.btn {
  transition:
    transform 0.16s cubic-bezier(.2,.7,.2,1),
    filter 0.15s,
    background 0.15s,
    box-shadow 0.18s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn.primary:hover {
  box-shadow: 0 8px 22px -8px rgba(200, 16, 46, 0.55);
}

/* ============ SCRIBBLE UNDERLINE (hand-drawn under italic red words) ============ */
.scribble-under {
  position: relative;
  display: inline-block;
  padding-bottom: 0.05em;
}
.scribble-under::after {
  content: '';
  position: absolute;
  left: -3%;
  right: -3%;
  bottom: -0.04em;
  height: 0.34em;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 14' preserveAspectRatio='none'><path d='M3 9 Q 28 0, 55 7 T 110 7 T 165 6 T 217 9' fill='none' stroke='%23C8102E' stroke-width='2.5' stroke-linecap='round' opacity='0.85'/></svg>") no-repeat center/100% 100%;
  pointer-events: none;
  opacity: 0;
  transform: scaleX(0.6);
  transform-origin: left center;
  transition: opacity 0.55s 0.2s ease-out, transform 0.7s 0.2s cubic-bezier(.2,.6,.2,1);
}
.reveal.is-visible .scribble-under::after,
section.is-visible .scribble-under::after {
  opacity: 1;
  transform: scaleX(1);
}
/* Fallback: if no IO, show the scribble anyway */
.no-io .scribble-under::after,
html:not(.has-io) .scribble-under::after {
  opacity: 1;
  transform: scaleX(1);
}

/* Su mobile la sottolineatura era troppo vicina al testo: spingiamo giù */
@media (max-width: 900px) {
  .scribble-under::after {
    bottom: -0.14em;
    height: 0.32em;
  }
}

/* ============ PRESS MARQUEE (continuous scroll) ============ */
.press-marquee-wrap {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%);
}
.press-marquee {
  display: flex;
  gap: 0;
  width: max-content;
  animation: rosso-marquee 80s linear infinite;
}
.press-marquee:hover { animation-play-state: paused; }
.press-marquee .press-card {
  width: 320px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
}
@keyframes rosso-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============ COUNTER POP-IN ============ */
.stat-num.counting {
  display: inline-block;
}

/* ============ DECORATIVE DROP & SPARK ============ */
.drop-accent {
  display: inline-block;
  width: 12px;
  height: 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18'><path d='M7 0 C 4.5 5, 0.5 9, 0.5 12 a 6.5 6.5 0 0 0 13 0 C 13.5 9, 9.5 5, 7 0 Z' fill='%23C8102E'/></svg>") no-repeat center/contain;
  vertical-align: middle;
}
.drop-deco {
  position: absolute;
  pointer-events: none;
  opacity: 0.18;
}
.spark {
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
  opacity: 0.55;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><path d='M4 0 L4.6 3.4 L8 4 L4.6 4.6 L4 8 L3.4 4.6 L0 4 L3.4 3.4 Z' fill='%23C8102E'/></svg>") no-repeat center/contain;
  animation: rosso-twinkle 3.2s ease-in-out infinite;
}
.spark.s2 { animation-delay: 1.1s; }
.spark.s3 { animation-delay: 2.0s; }
@keyframes rosso-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.85); }
  50%      { opacity: 0.85; transform: scale(1.1); }
}

/* ============ DOT PATTERN (hero bg) ============ */
.bg-dots { position: relative; }
.bg-dots::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(61, 8, 16, 0.07) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom right, rgba(0,0,0,0.7), transparent 70%);
          mask-image: linear-gradient(to bottom right, rgba(0,0,0,0.7), transparent 70%);
  z-index: 0;
}
.bg-dots > * { position: relative; z-index: 1; }

/* ============ ROTATING TAG (small accent) ============ */
.rotate-tag {
  display: inline-block;
  transform: rotate(-2deg);
}
.rotate-tag.r {
  transform: rotate(1.5deg);
}

/* ============ MOBILE-ONLY ANIMATIONS ============ */
@keyframes rosso-shimmer {
  0%, 100% { left: -100%; }
  60%, 100% { left: 110%; }
}

@keyframes rosso-arrow-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

@keyframes rosso-tap-pulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.4); }
  100% { box-shadow: 0 0 0 18px rgba(200, 16, 46, 0); }
}

/* Tap-active effect for mobile buttons */
@media (max-width: 900px) {
  .btn:active,
  .store-badge:active,
  .hero-badge:active,
  .footer-socials a:active,
  .nav-burger:active {
    transform: scale(0.96);
    transition: transform 0.1s ease-out !important;
  }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .wip-banner .dot,
  .float-anim,
  .press-marquee,
  .spark {
    animation: none !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .scribble-under::after {
    opacity: 1 !important;
    transform: scaleX(1) !important;
    transition: none !important;
  }
  .btn { transition: none !important; }
}
