/* animations.css — reveal-on-scroll, hover micro-interactions */

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 100;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-d) 100%);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 120ms linear;
  pointer-events: none;
}

/* ---------- Hero animated dot pattern ---------- */
.hero { position: relative; }
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, rgba(177, 29, 29, 0.10) 1.2px, transparent 1.5px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 30% 30%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 30%, black 0%, transparent 70%);
  animation: dotsDrift 22s linear infinite;
  pointer-events: none;
  opacity: 0.9;
}
@keyframes dotsDrift {
  0%   { background-position: 0 0; }
  100% { background-position: 280px 280px; }
}

/* Floating decorative blobs in hero */
.hero-shape {
  position: absolute; pointer-events: none;
  border-radius: 50%;
  opacity: 0.18;
  filter: blur(30px);
  z-index: 0;
}
.hero-shape.s1 {
  width: 280px; height: 280px;
  background: var(--accent);
  top: 8%; right: -60px;
  animation: floatA 14s ease-in-out infinite;
}
.hero-shape.s2 {
  width: 200px; height: 200px;
  background: var(--gold);
  bottom: -40px; left: 20%;
  animation: floatB 18s ease-in-out infinite;
  opacity: 0.14;
}
@keyframes floatA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-30px, 28px) scale(1.06); }
}
@keyframes floatB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(40px, -20px) scale(0.94); }
}

/* ---------- Hero photo glow ring ---------- */
.hero-photo { position: relative; }
.hero-photo::before {
  content: '';
  position: absolute; inset: -8px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), transparent 50%, var(--gold));
  opacity: 0.45;
  z-index: -1;
  filter: blur(18px);
  animation: photoGlow 4s ease-in-out infinite;
}
@keyframes photoGlow {
  0%, 100% { opacity: 0.30; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.04); }
}

/* ---------- Base reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}
[data-reveal="up"]    { transform: translateY(28px); }
[data-reveal="down"]  { transform: translateY(-20px); }
[data-reveal="right"] { transform: translateX(-28px); }
[data-reveal="left"]  { transform: translateX(28px); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal="fade"]  { transform: none; }
[data-reveal].is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* Stagger children */
[data-reveal-children] > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-reveal-children].is-visible > *:nth-child(1)  { opacity: 1; transform: none; transition-delay: 60ms; }
[data-reveal-children].is-visible > *:nth-child(2)  { opacity: 1; transform: none; transition-delay: 130ms; }
[data-reveal-children].is-visible > *:nth-child(3)  { opacity: 1; transform: none; transition-delay: 200ms; }
[data-reveal-children].is-visible > *:nth-child(4)  { opacity: 1; transform: none; transition-delay: 270ms; }
[data-reveal-children].is-visible > *:nth-child(5)  { opacity: 1; transform: none; transition-delay: 340ms; }
[data-reveal-children].is-visible > *:nth-child(6)  { opacity: 1; transform: none; transition-delay: 410ms; }
[data-reveal-children].is-visible > *:nth-child(7)  { opacity: 1; transform: none; transition-delay: 480ms; }
[data-reveal-children].is-visible > *:nth-child(8)  { opacity: 1; transform: none; transition-delay: 550ms; }
[data-reveal-children].is-visible > *:nth-child(n+9) { opacity: 1; transform: none; transition-delay: 600ms; }

/* ---------- Hero entrance ---------- */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.hero-text > * {
  opacity: 0;
  animation: heroFadeUp 800ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.hero-text > *:nth-child(1) { animation-delay: 50ms; }
.hero-text > *:nth-child(2) { animation-delay: 180ms; }
.hero-text > *:nth-child(3) { animation-delay: 310ms; }
.hero-text > *:nth-child(4) { animation-delay: 440ms; }
.hero-text > *:nth-child(5) { animation-delay: 570ms; }
.hero-photo {
  opacity: 0;
  animation: heroFadeIn 900ms cubic-bezier(0.2, 0.8, 0.2, 1) 300ms forwards;
}
.coach-hero-inner > * {
  opacity: 0;
  animation: heroFadeUp 800ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.coach-hero-inner > *:nth-child(1) { animation-delay: 50ms; }
.coach-hero-inner > *:nth-child(2) { animation-delay: 150ms; }
.coach-hero-inner > *:nth-child(3) { animation-delay: 280ms; }
.coach-hero-inner > *:nth-child(4) { animation-delay: 410ms; }
.coach-hero-inner > *:nth-child(5) { animation-delay: 540ms; }
.coach-hero-inner > *:nth-child(6) { animation-delay: 670ms; }

/* ---------- Pulse on accent dot ---------- */
@keyframes accentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(177, 29, 29, 0.45); }
  70%      { box-shadow: 0 0 0 10px rgba(177, 29, 29, 0); }
}
.hero-photo-tag .dot,
.coach-hero-eyebrow .dot {
  animation: accentPulse 2.4s ease-out infinite;
}

/* ---------- Method letter — gradient + hover bounce ---------- */
.method-letter,
.method-recap-letter .rl-letter {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-d) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.method-card:hover .method-letter,
.method-recap-letter:hover .rl-letter { transform: scale(1.08) rotate(-3deg); }

/* Continuous gentle float on method cards */
@keyframes methodFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
.method-card { animation: methodFloat 6s ease-in-out infinite; }
.method-card:nth-child(2) { animation-delay: -1.5s; }
.method-card:nth-child(3) { animation-delay: -3s; }
.method-card:nth-child(4) { animation-delay: -4.5s; }

/* ---------- Course card shine ---------- */
.course .thumb { isolation: isolate; }
.course .thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg,
              transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  z-index: 2;
}
.course:hover .thumb::after { transform: translateX(100%); }

/* ---------- Button shimmer + arrow nudge ---------- */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(120deg,
              transparent 30%, rgba(255,255,255,0.28) 50%, transparent 70%);
  transition: left 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.btn-primary:hover::before { left: 100%; }

@keyframes arrowNudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-4px); }
}
.btn-primary svg { animation: arrowNudge 1.8s ease-in-out infinite; }
.btn-primary:hover svg { animation: none; transform: translateX(-6px); transition: transform 200ms; }

/* ---------- Marquee strip ---------- */
.marquee {
  background: var(--bg-dark);
  color: var(--fg-on-dark-1);
  padding: 22px 0;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.marquee-track {
  display: flex;
  gap: 56px;
  white-space: nowrap;
  animation: marqueeScroll 28s linear infinite;
  width: max-content;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  display: inline-flex; align-items: center; gap: 14px;
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.marquee-item .dot-mark {
  color: var(--accent);
  font-size: 22px; line-height: 0.4;
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Floating background blobs ---------- */
@keyframes floatSlow {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(20px, -16px); }
}
.callout::before,
.cta-band::before {
  animation: floatSlow 9s ease-in-out infinite;
}

/* ---------- Press play breath ---------- */
@keyframes breath {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.06); }
}
.press-play { animation: breath 2.6s ease-in-out infinite; }
.press-card:hover .press-play { animation: none; }

/* ---------- Stat number bounce ---------- */
@keyframes statBounce {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
.about-stats.is-visible .stat-num { animation: statBounce 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.about-stats.is-visible div:nth-child(2) .stat-num { animation-delay: 120ms; }
.about-stats.is-visible div:nth-child(3) .stat-num { animation-delay: 240ms; }

/* ---------- Hero scroll cue ---------- */
.scroll-cue {
  position: absolute;
  bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--fg-3);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  opacity: 0;
  animation: heroFadeIn 800ms ease-out 1200ms forwards;
  pointer-events: none;
}
.scroll-cue-line {
  width: 1px; height: 32px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  transform-origin: 0 0;
  animation: scrollCueLine 1.8s ease-in-out infinite;
}
@keyframes scrollCueLine {
  0%   { transform: scaleY(0); transform-origin: 0 0; opacity: 0; }
  40%  { transform: scaleY(1); transform-origin: 0 0; opacity: 1; }
  80%  { transform: scaleY(1); transform-origin: 0 100%; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: 0 100%; opacity: 0; }
}
@media (max-width: 900px) { .scroll-cue { display: none; } }

/* ---------- Hero photo Ken-Burns on hover ---------- */
.hero-photo img {
  transition: transform 6s ease-out;
}
.hero-photo:hover img { transform: scale(1.06); }

/* ---------- Section title accent underline ---------- */
.section-title .accent {
  position: relative;
  display: inline-block;
}
.section-title .accent::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1) 250ms;
}
.section-head.is-visible .section-title .accent::after { transform: scaleX(1); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal-children] > *,
  .hero-text > *,
  .hero-photo,
  .coach-hero-inner > *,
  .marquee-track,
  .method-card,
  .scroll-cue,
  .scroll-cue-line,
  .hero::before,
  .hero-shape,
  .hero-photo::before,
  .hero-photo-tag .dot,
  .coach-hero-eyebrow .dot,
  .btn-primary svg,
  .press-play {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}
