/* ============================================
   BORRE.STORE — Animations
   ============================================ */

/* ── Scroll Reveal Base ── */
.reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.reveal-stagger > .reveal {
  transition-delay: calc(var(--stagger, 0) * 0.1s);
}



/* ── Hero Entrance ── */
.hero__tag {
  opacity: 0;
  transform: translateY(1rem);
  animation: heroFadeIn 0.8s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__title {
  opacity: 0;
  transform: perspective(900px) rotateX(-55deg) translateY(1rem);
  transform-origin: center top;
  animation: heroTitleIn 1s 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroTitleIn {
  to {
    opacity: 1;
    transform: perspective(900px) rotateX(0deg) translateY(0);
  }
}

.hero__subtitle {
  opacity: 0;
  transform: translateY(1rem);
  animation: heroFadeIn 0.8s 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__actions {
  opacity: 0;
  transform: translateY(1rem);
  animation: heroFadeIn 0.8s 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__watermark {
  opacity: 0;
  animation: watermarkIn 1.5s 0.5s ease-out forwards;
  transform: translate(calc(var(--mx, 0) * -22px), calc(var(--my, 0) * -12px));
  transition: transform 0.2s ease-out;
}

@keyframes heroFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes watermarkIn {
  to {
    opacity: 0.1;
  }
}

/* ── Hero Background Ken Burns ── */
.hero::before {
  animation: kenBurns 25s ease-in-out infinite alternate;
}

@keyframes kenBurns {
  0%   { transform: scale(1)   translate(0, 0); }
  100% { transform: scale(1.08) translate(-1%, -1%); }
}

/* ── Hero 3D: Cube Spin ── */
.hero__cube-inner {
  animation: cubeSpin 24s linear infinite;
}

@keyframes cubeSpin {
  from { transform: rotateX(-18deg) rotateY(0deg); }
  to   { transform: rotateX(-18deg) rotateY(360deg); }
}

/* ── Hero 3D: Grid Flow ── */
.hero__grid {
  animation: gridFlow 5s linear infinite;
}

@keyframes gridFlow {
  to { background-position: 0 56px; }
}

/* ── Hero: Strike Draw ── */
.hero__strike::after {
  animation: strikeDraw 0.5s 1.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes strikeDraw {
  to { transform: scaleX(1); }
}

/* ── Hero: Scroll Indicator ── */
.hero__scroll {
  opacity: 0;
  animation: heroFadeIn 0.8s 1.4s ease forwards;
}

.hero__scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-primary);
  animation: scrollPulse 1.8s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%        { top: -100%; }
  60%, 100% { top: 100%; }
}

/* ── Hero: Primary CTA Sheen ── */
#hero-audit {
  position: relative;
  overflow: hidden;
}

#hero-audit::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 60%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  animation: btnSheen 5s ease-in-out infinite;
}

@keyframes btnSheen {
  0%, 55% { left: -150%; }
  100%    { left: 160%; }
}

/* ── FAQ Accordion ── */
.faq-item__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.faq-item.is-open .faq-item__answer {
  max-height: 40rem;
  padding-top: 1rem;
}

.faq-item__icon {
  transition: transform 0.3s ease;
  font-size: 1.25rem;
}

.faq-item.is-open .faq-item__icon {
  transform: rotate(45deg);
}

/* ── Service Cell Hover ── */
.service-cell {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
}

.service-cell::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary-container);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-cell:hover {
  background-color: var(--color-surface-container);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.06);
}

.service-cell:hover::before {
  opacity: 1;
}

/* ── Card Hover Polish ── */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ── Focus Visible (keyboard) ── */
.btn:focus-visible,
.nav__link:focus-visible,
.footer__link:focus-visible,
.nav__logo:focus-visible,
.footer__logo:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ── Quiz Radio Selection ── */
.radio-option:has(input:checked) {
  border-color: var(--color-primary);
  background-color: rgba(168, 232, 255, 0.05);
}

/* ── RAG Diagram Pulse ── */
.rag__arrow-dot {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(168, 232, 255, 0.4); }
  50%      { opacity: 0.7; box-shadow: 0 0 8px 4px rgba(168, 232, 255, 0); }
}

/* ── Stat Box Number Animation ── */
.stat-box__value {
  transition: color 0.3s ease;
}

.stat-box:hover .stat-box__value {
  color: var(--color-primary-container);
}

/* ── Funnel Stage Hover ── */
.funnel__stage {
  transition: transform 0.3s ease;
}

.funnel__stage:hover {
  transform: translateY(-4px);
}

/* ── Nav Active Link ── */
.nav__link.is-active {
  color: var(--color-primary);
}

.nav__link.is-active::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--color-primary-container);
  margin-top: 0.25rem;
  border-radius: 1px;
}

/* ── Quiz Score Animation ── */
.quiz__score-value {
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Smooth scroll offset ── */
html {
  scroll-padding-top: 6rem;
}

/* ── Dynamic Canvas & Cursor ── */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

#cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition: width 0.3s ease, height 0.3s ease, background 0.3s ease;
  mix-blend-mode: screen;
}

#cursor-glow.active {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
}

/* ── Hover Spotlight Effect ── */
.spotlight-card {
  position: relative;
  overflow: hidden;
}

.spotlight-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.06), transparent 40%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 1;
}

.spotlight-card:hover::after {
  opacity: 1;
}

/* ── Text Glitch / Decode ── */
.decode-text {
  position: relative;
  display: inline-block;
}

/* ── Scroll Progress Bar ── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(to right, var(--color-primary-container), var(--color-primary));
  z-index: 100;
  transform-origin: left;
  transform: scaleX(0);
  width: 100%;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes grow-progress {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }
    #scroll-progress {
      animation: grow-progress auto linear;
      animation-timeline: scroll(root block);
    }
  }
}

/* ── Page Load Reveal ── */
body {
  opacity: 0;
  animation: pageReveal 0.6s 0.1s ease forwards;
}

@keyframes pageReveal {
  to { opacity: 1; }
}

/* ── Hero Trust Badges Entrance ── */
.hero__trust {
  opacity: 0;
  transform: translateY(1rem);
  animation: heroFadeIn 0.8s 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Contrast Column Hover ── */
.contrast__col {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.contrast__col:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.contrast__col--bad:hover {
  border-color: rgba(255, 107, 107, 0.4);
}

.contrast__col--good:hover {
  border-color: rgba(168, 232, 255, 0.4);
}

/* ── Social Proof Number Hover ── */
.social-proof__stat {
  transition: transform 0.3s ease;
}

.social-proof__stat:hover {
  transform: translateY(-4px);
}

.social-proof__stat:hover .social-proof__number {
  color: var(--color-primary-container);
  transition: color 0.3s ease;
}

/* ── Inline CTA Hover ── */
.inline-cta {
  transition: background-color 0.4s ease;
}

.inline-cta:hover {
  background-color: var(--color-surface-container-low);
}

/* ── FAQ Progressive Reveal ── */
.faq-item.is-hidden {
  display: none;
}

.faq__show-more .btn {
  transition: all 0.3s ease;
}

/* ── Background Color Morph ── */
body {
  transition: background-color 0.8s ease;
}

/* ── Word-by-Word Text Reveal ── */
.word-reveal {
  display: inline-block;
  opacity: 0;
  transform: translateY(1.2em);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--word-index) * 0.06s);
}

.word-reveal-container.is-revealed .word-reveal {
  opacity: 1;
  transform: translateY(0);
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero__tag,
  .hero__title,
  .hero__subtitle,
  .hero__actions,
  .hero__scroll,
  .hero__trust {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero__watermark {
    opacity: 0.1 !important;
    transform: none !important;
  }

  .hero__strike::after {
    transform: scaleX(1) !important;
  }

  .marquee__track {
    animation: none !important;
    transform: none !important;
  }

  #cursor-glow,
  #bg-canvas,
  .hero__cube,
  .hero__grid,
  .hero__scroll-line::after,
  #hero-audit::after {
    display: none !important;
  }

  body {
    opacity: 1 !important;
  }
}
