/* ==========================================================================
   Fork Yeah! — FUN layer
   Extra animations, attention-getting bits, layered on top of the base.
   ========================================================================== */

/* ============================================================
   1. SCROLL PROGRESS BAR (top of page)
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 1100;
  background: linear-gradient(90deg, var(--orange), var(--yellow), var(--green));
  box-shadow: 0 0 12px rgba(242, 106, 46, 0.6);
  transition: width 80ms linear;
  pointer-events: none;
}

/* ============================================================
   2. CURSOR TRAIL (forks/sparkles that follow the cursor)
   ============================================================ */
.cursor-trail-dot {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  font-size: 18px;
  user-select: none;
  will-change: transform, opacity;
  animation: trail-pop 0.9s ease-out forwards;
}

@keyframes trail-pop {
  0%   { transform: translate(-50%, -50%) scale(0.4) rotate(0deg);   opacity: 0; }
  20%  { transform: translate(-50%, -50%) scale(1.2) rotate(20deg);  opacity: 1; }
  100% { transform: translate(-50%, -60%) scale(0.6) rotate(180deg); opacity: 0; }
}

/* ============================================================
   3. HERO — animated gradient blobs + extras
   ============================================================ */
.hero {
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(242, 106, 46, 0.10), transparent),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(78, 124, 89, 0.07), transparent),
    var(--cream);
}

.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}
.hero__blob--1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, var(--orange), transparent 70%);
  top: -120px; left: -100px;
  animation: blob-float-a 14s ease-in-out infinite;
}
.hero__blob--2 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, var(--yellow), transparent 70%);
  bottom: -120px; right: -80px;
  animation: blob-float-b 18s ease-in-out infinite;
}
.hero__blob--3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--green), transparent 70%);
  top: 50%; right: 30%;
  opacity: 0.35;
  animation: blob-float-c 22s ease-in-out infinite;
}

@keyframes blob-float-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(60px, 40px) scale(1.1); }
  66%      { transform: translate(-30px, 80px) scale(0.95); }
}
@keyframes blob-float-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-80px, -60px) scale(1.15); }
}
@keyframes blob-float-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%      { transform: translate(-100px, 40px) scale(1.2); }
  70%      { transform: translate(60px, -40px) scale(0.9); }
}

.hero__inner { position: relative; z-index: 2; }

/* Word rotator inside hero title */
.hero__title { position: relative; }
.word-rotator {
  display: inline-block;
  position: relative;
  height: 1.1em;
  vertical-align: bottom;
  overflow: hidden;
  color: var(--orange);
  min-width: 6.5ch;
}
.word-rotator__word {
  display: block;
  animation: rotator 9s cubic-bezier(0.7, 0, 0.3, 1) infinite;
}
.word-rotator__word > span {
  display: block;
  height: 1.1em;
  line-height: 1.1;
}
@keyframes rotator {
  0%, 18%   { transform: translateY(0); }
  22%, 40%  { transform: translateY(-1.1em); }
  44%, 62%  { transform: translateY(-2.2em); }
  66%, 84%  { transform: translateY(-3.3em); }
  88%, 100% { transform: translateY(-4.4em); }
}

/* Squiggly underline under accent */
.hero__title--accent {
  position: relative;
  display: inline-block;
}
.hero__title--accent::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.08em;
  height: 0.18em;
  background:
    radial-gradient(circle at 12% 50%, var(--orange) 35%, transparent 40%) 0 0/22px 100% repeat-x;
  opacity: 0.75;
  transform: scaleX(0);
  transform-origin: left;
  animation: squiggle-in 1.2s var(--ease-bounce) 1s forwards,
             squiggle-wiggle 4s ease-in-out 2.2s infinite;
}
@keyframes squiggle-in {
  to { transform: scaleX(1); }
}
@keyframes squiggle-wiggle {
  0%, 100% { transform: translateY(0) scaleX(1); }
  50%      { transform: translateY(2px) scaleX(1.02); }
}

/* Phone screenshot — float + tilt + shimmer */
.hero__screenshot-wrap {
  perspective: 1200px;
}
.hero__screenshot {
  animation: phone-float 6s ease-in-out infinite;
  transition: transform 0.6s var(--ease-smooth), filter 0.6s ease;
  transform-style: preserve-3d;
  will-change: transform;
}
@keyframes phone-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-14px) rotate(2deg); }
}
.hero__screenshot-wrap:hover .hero__screenshot {
  animation-play-state: paused;
  transform: translateY(-10px) rotate(0) scale(1.03);
  filter: drop-shadow(0 32px 56px rgba(41, 25, 16, 0.28));
}

/* Floating rating chips orbiting the phone */
.hero__chip {
  position: absolute;
  padding: 8px 14px 8px 10px;
  background: white;
  border-radius: var(--radius-pill);
  box-shadow: 0 12px 32px rgba(41, 25, 16, 0.18), 0 2px 6px rgba(41, 25, 16, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: var(--weight-bold);
  white-space: nowrap;
  z-index: 5;
  border: 1.5px solid var(--divider);
}
.hero__chip img { width: 22px; height: 22px; }

.hero__chip--yeah {
  top: 14%;
  left: -8%;
  color: var(--green);
  animation: chip-bob 5s ease-in-out infinite;
}
.hero__chip--meh {
  bottom: 24%;
  left: -14%;
  color: #b07e00;
  animation: chip-bob 5.5s ease-in-out 0.7s infinite;
}
.hero__chip--no {
  top: 36%;
  right: -8%;
  color: var(--red);
  animation: chip-bob 6s ease-in-out 1.4s infinite;
}
.hero__chip--vote {
  bottom: 8%;
  right: -10%;
  color: var(--orange);
  animation: chip-bob 5.2s ease-in-out 0.3s infinite;
}
@keyframes chip-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-12px) rotate(3deg); }
}

@media (max-width: 900px) {
  .hero__chip--yeah { left: 2%; top: 6%; }
  .hero__chip--meh  { left: -2%; bottom: 16%; }
  .hero__chip--no   { right: 2%; top: 28%; }
  .hero__chip--vote { right: -2%; bottom: 4%; }
}

/* Magnetic CTA pulse */
.nav__cta {
  position: relative;
  overflow: hidden;
}
.nav__cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s ease;
}
.nav__cta:hover::before { transform: translateX(120%); }

.hero__app-store {
  position: relative;
  animation: cta-breathe 3s ease-in-out infinite;
}
@keyframes cta-breathe {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 6px 14px rgba(242,106,46,0.0)); }
  50%      { transform: scale(1.04); filter: drop-shadow(0 12px 24px rgba(242,106,46,0.35)); }
}
.hero__app-store::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 14px;
  border: 2px solid var(--orange);
  opacity: 0;
  pointer-events: none;
  animation: cta-ring 2.4s ease-out infinite;
}
@keyframes cta-ring {
  0%   { transform: scale(0.9); opacity: 0.55; }
  80%  { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* See more arrow nudge */
.hero__see-more svg {
  animation: arrow-nudge 1.6s ease-in-out infinite;
}
@keyframes arrow-nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* ============================================================
   4. MARQUEE — scrolling cuisine ribbon
   ============================================================ */
.marquee {
  position: relative;
  background: var(--brown);
  color: var(--cream);
  padding: 18px 0;
  overflow: hidden;
  border-top: 3px solid var(--orange);
  border-bottom: 3px solid var(--orange);
}
.marquee::before, .marquee::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}
.marquee::before {
  left: 0;
  background: linear-gradient(90deg, var(--brown), transparent);
}
.marquee::after {
  right: 0;
  background: linear-gradient(-90deg, var(--brown), transparent);
}
.marquee__track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: marquee-scroll 40s linear infinite;
  width: max-content;
}
.marquee__item {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: var(--weight-black);
  font-style: italic;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  letter-spacing: -0.01em;
}
.marquee__item span {
  color: var(--orange);
  font-style: normal;
  font-family: var(--font-body);
  font-size: 22px;
}
.marquee__dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
}
@keyframes marquee-scroll {
  to { transform: translateX(-50%); }
}
.marquee:hover .marquee__track { animation-play-state: paused; }

@media (min-width: 768px) {
  .marquee__item { font-size: 36px; }
  .marquee__item span { font-size: 28px; }
}

/* ============================================================
   5. FEATURES — card lift + icon spin + sweep
   ============================================================ */
.feature-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%),
              rgba(242, 106, 46, 0.10), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 0;
}
.feature-card:hover::before { opacity: 1; }
.feature-card > * { position: relative; z-index: 1; }

.feature-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: var(--shadow-xl);
  border-color: rgba(242, 106, 46, 0.35);
}

.feature-card__icon {
  transition: transform 0.5s var(--ease-bounce);
}
.feature-card:hover .feature-card__icon {
  transform: rotate(-12deg) scale(1.12);
}
.feature-card:hover .feature-card__icon--orange { background: var(--orange); color: white; }
.feature-card:hover .feature-card__icon--green  { background: var(--green);  color: white; }
.feature-card:hover .feature-card__icon--yellow { background: var(--yellow); color: var(--brown); }
.feature-card:hover .feature-card__icon--red    { background: var(--red);    color: white; }

/* Idle wiggle on icons (very subtle) */
.feature-card__icon {
  animation: icon-idle 6s ease-in-out infinite;
}
.feature-card:nth-child(2n) .feature-card__icon { animation-delay: 1.5s; }
.feature-card:nth-child(3n) .feature-card__icon { animation-delay: 3s; }
@keyframes icon-idle {
  0%, 92%, 100% { transform: rotate(0deg); }
  94%           { transform: rotate(-8deg); }
  96%           { transform: rotate(8deg); }
  98%           { transform: rotate(-4deg); }
}

/* ============================================================
   6. STATS BAR — animated counters
   ============================================================ */
.stats {
  background: var(--brown);
  color: var(--cream);
  padding: 56px 0;
  position: relative;
  overflow: hidden;
}
.stats::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 30%, rgba(242,106,46,0.15), transparent 50%),
    radial-gradient(circle at 85% 70%, rgba(244,180,0,0.10), transparent 50%);
  pointer-events: none;
}
.stats__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  text-align: center;
}
.stats__num {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 76px);
  font-weight: var(--weight-black);
  color: var(--orange);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stats__num .suffix {
  color: var(--yellow);
  font-style: italic;
}
.stats__label {
  margin-top: 8px;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250, 243, 232, 0.7);
}
@media (min-width: 768px) {
  .stats__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   7. HOW IT WORKS — bigger demos, dancing
   ============================================================ */
.step__number {
  position: relative;
  animation: step-number-pulse 2.4s ease-in-out infinite;
}
.step__number::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed var(--orange);
  opacity: 0.6;
  animation: step-spin 14s linear infinite;
}
@keyframes step-number-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
@keyframes step-spin {
  to { transform: rotate(360deg); }
}

.step:hover .step__demo { transform: scale(1.06); }
.step__demo { transition: transform 0.4s var(--ease-bounce); }

/* ============================================================
   8. SCREENSHOTS — bobbing + tilt
   ============================================================ */
.screenshot-item {
  animation: screenshot-bob 7s ease-in-out infinite;
}
.screenshot-item:nth-child(2) { animation-delay: 0.4s; }
.screenshot-item:nth-child(3) { animation-delay: 0.8s; }
.screenshot-item:nth-child(4) { animation-delay: 1.2s; }
.screenshot-item:nth-child(5) { animation-delay: 1.6s; }
@keyframes screenshot-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-10px) rotate(1.5deg); }
}
.screenshot-item:nth-child(even) {
  animation-name: screenshot-bob-rev;
}
@keyframes screenshot-bob-rev {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50%      { transform: translateY(-12px) rotate(-2deg); }
}

.screenshot-item__img:hover {
  transform: translateY(-12px) scale(1.06) rotate(0) !important;
}

/* ============================================================
   9. RATINGS — emoji bounce + tilt
   ============================================================ */
.rating-card {
  transition: transform 0.4s var(--ease-bounce), box-shadow 0.4s, border-color 0.4s;
}
.rating-card__icon img {
  transition: transform 0.4s var(--ease-bounce);
  animation: emoji-idle 4s ease-in-out infinite;
}
.rating-card--meh .rating-card__icon img  { animation-delay: 0.6s; }
.rating-card--no .rating-card__icon img   { animation-delay: 1.2s; }
@keyframes emoji-idle {
  0%, 100%  { transform: translateY(0) rotate(-4deg); }
  50%       { transform: translateY(-6px) rotate(4deg); }
}
.rating-card:hover .rating-card__icon img {
  animation: emoji-cheer 0.8s var(--ease-bounce);
  transform: scale(1.2);
}
@keyframes emoji-cheer {
  0%   { transform: scale(1) rotate(0); }
  20%  { transform: scale(1.3) rotate(-15deg); }
  40%  { transform: scale(1.15) rotate(15deg); }
  60%  { transform: scale(1.25) rotate(-10deg); }
  100% { transform: scale(1.2) rotate(0); }
}
.rating-card:hover {
  transform: translateY(-10px) rotate(-1deg);
  box-shadow: var(--shadow-xl);
}
.rating-card--meh:hover { transform: translateY(-10px) rotate(0); }
.rating-card--no:hover  { transform: translateY(-10px) rotate(1deg); }

/* ============================================================
   10. FINAL CTA — letter wave + giant pulse
   ============================================================ */
.final-cta__title {
  position: relative;
}
.final-cta__title .wave-letter {
  display: inline-block;
  animation: letter-wave 2.5s ease-in-out infinite;
}
@keyframes letter-wave {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.final-cta__logo {
  animation: logo-bounce 3s ease-in-out infinite;
}
@keyframes logo-bounce {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-10px) rotate(3deg); }
}

.final-cta__button {
  position: relative;
}
.final-cta__button::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 16px;
  border: 2px solid var(--orange);
  opacity: 0;
  pointer-events: none;
  animation: cta-ring 2.4s ease-out infinite;
}
.final-cta__button:hover {
  transform: translateY(-5px) scale(1.04);
}

/* ============================================================
   11. NAV brand wiggle + animated wordmark stripe
   ============================================================ */
.nav__brand:hover .nav__logo {
  animation: logo-wiggle 0.6s var(--ease-bounce);
}
@keyframes logo-wiggle {
  0%   { transform: rotate(0); }
  25%  { transform: rotate(-12deg) scale(1.1); }
  50%  { transform: rotate(12deg) scale(1.1); }
  75%  { transform: rotate(-6deg) scale(1.05); }
  100% { transform: rotate(0); }
}
.nav::before {
  background-size: 300% 100%;
  animation: nav-stripe 8s linear infinite;
}
@keyframes nav-stripe {
  to { background-position: -300% 0; }
}

/* ============================================================
   12. CONFETTI BURST CONTAINER (JS-driven)
   ============================================================ */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 14px;
  z-index: 9999;
  pointer-events: none;
  will-change: transform, opacity;
  border-radius: 2px;
}

/* ============================================================
   13. EASTER-EGG: tilt-on-cursor for hero phone
   ============================================================ */
.tilt-target {
  transition: transform 0.18s ease-out;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero__blob,
  .hero__screenshot,
  .hero__chip,
  .marquee__track,
  .nav::before,
  .step__number,
  .step__number::after,
  .screenshot-item,
  .rating-card__icon img,
  .final-cta__title .wave-letter,
  .final-cta__logo,
  .hero__app-store,
  .hero__app-store::after,
  .final-cta__button::before,
  .feature-card__icon,
  .word-rotator__word,
  .hero__title--accent::after {
    animation: none !important;
  }
  .word-rotator { min-width: 0; }
  .word-rotator__word > span:not(:first-child) { display: none; }
}
