/* ═══════════════════════════════════════════════════════
   DESTROLA — ANIMATIONS
   Scroll Reveal · GSAP Hooks · Transitions · Keyframes
═══════════════════════════════════════════════════════ */

/* ─── SCROLL REVEAL BASE STATES ──────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}
.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.6s var(--ease-smooth), transform 0.6s var(--ease-smooth);
}

.reveal.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-scale.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger delay helpers */
.delay-1 { transition-delay: 80ms; }
.delay-2 { transition-delay: 160ms; }
.delay-3 { transition-delay: 240ms; }
.delay-4 { transition-delay: 320ms; }
.delay-5 { transition-delay: 400ms; }
.delay-6 { transition-delay: 480ms; }

/* ─── GSAP SPLIT-TEXT HOOKS ──────────────────────────── */
/* SplitText wraps chars/words — these keep layout stable */
.split-wrap { overflow: hidden; display: block; }
.split-char, .split-word {
  display: inline-block;
  will-change: transform, opacity;
}

/* Pre-animation state set via JS — GSAP animates FROM these */
[data-gsap-hero] .split-char { opacity: 0; transform: translateY(110%); }

/* ─── HERO CARD STACK ────────────────────────────────── */
.hero-stack {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1000px;
  perspective-origin: 50% 40%;
}

.hero-card {
  position: absolute;
  border-radius: var(--radius-lg);
  will-change: transform;
  transition: border-color 400ms ease, box-shadow 400ms ease;
}

/* Hovered card gets a stronger shadow to reinforce it coming forward */
.hero-card:hover {
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(242,229,225,0.08);
  transition: box-shadow 300ms ease;
}

/* Scattered pile — each card has its own offset, width, and rotation */
.hero-card:nth-child(1) { top: 10px;  left: 10px; right: 28px; z-index: 1; transform: rotate(-4.5deg); }
.hero-card:nth-child(2) { top: 84px;  left: -6px; right: 16px; z-index: 2; transform: rotate(2.8deg);  }
.hero-card:nth-child(3) { top: 168px; left: 18px; right: 4px;  z-index: 3; transform: rotate(-1.8deg); }
.hero-card:nth-child(4) { top: 250px; left: 0px;  right: 22px; z-index: 4; transform: rotate(3.2deg);  }
.hero-card:nth-child(5) { top: 328px; left: 8px;  right: 10px; z-index: 5; transform: rotate(-1.2deg); }

/* ─── STAT COUNTER ───────────────────────────────────── */
[data-counter] { transition: color 200ms; }
[data-counter].counting { color: var(--accent); }

/* ─── TAB PROGRESS BAR ───────────────────────────────── */
.tab-progress-bar {
  height: 2px;
  background: var(--accent);
  width: 0;
  border-radius: 1px;
  transition: none;
}
.tab-progress-bar.running {
  width: 100%;
  transition: width 10000ms linear;
}

/* ─── HOVER LIFT ─────────────────────────────────────── */
.hover-lift {
  transition: transform 250ms var(--ease-smooth), box-shadow 250ms var(--ease-smooth);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ─── HOVER GLOW ─────────────────────────────────────── */
.hover-glow {
  transition: box-shadow 300ms var(--ease-smooth);
}
.hover-glow:hover {
  box-shadow: var(--shadow-glow-orange);
}

/* ─── PULSE ──────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%       { box-shadow: 0 0 0 8px transparent; }
}
.pulse { animation: pulse 2.4s ease-in-out infinite; }

/* ─── FLICKER (logo / accent element) ───────────────── */
@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  96%            { opacity: 0.4; }
  97%            { opacity: 1; }
  98%            { opacity: 0.6; }
  99%            { opacity: 1; }
}
.flicker { animation: flicker 8s ease-in-out infinite; }

/* ─── BADGE PING ─────────────────────────────────────── */
@keyframes ping {
  0%    { transform: scale(1);   opacity: 0.6; }
  100%  { transform: scale(2.2); opacity: 0; }
}
.badge-live::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  animation: ping 1.8s ease-out infinite;
}

/* ─── BACKGROUND SHIMMER (skeleton / loading) ────────── */
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}
.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    rgba(242,229,225,0.06) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

/* ─── FLOAT (decorative elements) ───────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
.float { animation: float 4s var(--ease-inout) infinite; }
.float-slow { animation: float 6s var(--ease-inout) infinite; }

/* ─── ROTATE SLOW ────────────────────────────────────── */
@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.rotate-slow { animation: rotateSlow 20s linear infinite; }

/* ─── DRAW LINE (horizontal rule / underline) ────────── */
@keyframes drawLine {
  from { width: 0; }
  to   { width: 100%; }
}
.draw-line::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--accent);
  width: 0;
}
.draw-line.is-visible::after {
  animation: drawLine 0.8s var(--ease-smooth) forwards;
  animation-delay: 300ms;
}

/* ─── PAGE TRANSITION OVERLAY ────────────────────────── */
.page-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 9000;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 400ms var(--ease-smooth);
  pointer-events: none;
}
.page-overlay.out {
  transform: scaleY(1);
  transform-origin: bottom;
  pointer-events: all;
}
.page-overlay.in {
  transform: scaleY(0);
  transform-origin: top;
}

/* ─── ACCORDION CHEVRON ──────────────────────────────── */
.faq-icon {
  transition: transform 300ms var(--ease-smooth);
  flex-shrink: 0;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }

/* ─── MOBILE MENU STAGGER ────────────────────────────── */
/* Extra stagger slots beyond layout.css's 6 */
.mobile-menu.open a:nth-child(7) { transition-delay: 280ms; }
.mobile-menu.open a:nth-child(8) { transition-delay: 320ms; }

/* ─── TESTIMONIAL DOT ────────────────────────────────── */
.dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--border-mid);
  cursor: pointer;
  transition: background 200ms, width 300ms var(--ease-smooth);
}
.dot.active {
  background: var(--accent);
  width: 18px;
}

/* ─── XP BAR FILL TRIGGER ────────────────────────────── */
.xp-fill.animate { width: var(--xp-target, 72%); }

/* ─── CARD BORDER GLOW ON HOVER ──────────────────────── */
.card {
  transition: border-color 250ms, box-shadow 250ms;
}
.card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-md);
}
.card-featured:hover {
  box-shadow: var(--shadow-glow-orange);
}

/* ═══════════════════════════════════════════════════════
   PHASE 2 — MODERN UI COMPONENTS
   Border Beam · Ambient Orbs · Text Shimmer · Spotlight
   Scroll Progress · Ripple · Tilt · Cursor Glow · Grid
═══════════════════════════════════════════════════════ */

/* ─── CSS @property for smooth angle animation ───────── */
@property --beam-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ─── KEYFRAMES ──────────────────────────────────────── */
@keyframes beamRotate {
  to { --beam-angle: 360deg; }
}

@keyframes orbDrift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(24px, -18px) scale(1.04); }
  66%  { transform: translate(-16px, 12px) scale(0.98); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes textShimmer {
  from { background-position: 200% center; }
  to   { background-position: -200% center; }
}

@keyframes rippleAnim {
  to { transform: scale(5); opacity: 0; }
}

@keyframes btnShimmer {
  0%   { left: -100%; }
  45%  { left: 150%; }
  100% { left: 150%; }
}

@keyframes gradientPan {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ─── BORDER BEAM CARD ───────────────────────────────── */
/* Animated sweeping light around card border             */
.card-beam {
  isolation: isolate;
  position: relative;
}
.card-beam::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--beam-angle),
    transparent 20%,
    rgba(206, 68, 39, 0.8) 50%,
    transparent 80%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: beamRotate 4s linear infinite;
  z-index: -1;
}

/* ─── TEXT SHIMMER ───────────────────────────────────── */
.text-shimmer {
  background: linear-gradient(
    100deg,
    var(--accent)  0%,
    #ff7a50       35%,
    #ff9070       50%,
    #ff7a50       65%,
    var(--accent) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 5s linear infinite;
  display: inline;
}

/* ─── HERO AMBIENT BACKGROUND ────────────────────────── */
.hero-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}
.hero-orb-1 {
  width: clamp(280px, 40vw, 500px);
  height: clamp(280px, 40vw, 500px);
  background: radial-gradient(circle, rgba(206, 68, 39, 0.13) 0%, transparent 70%);
  top: -8%; right: -4%;
  animation: orbDrift 14s ease-in-out infinite;
}
.hero-orb-2 {
  width: clamp(200px, 28vw, 380px);
  height: clamp(200px, 28vw, 380px);
  background: radial-gradient(circle, rgba(22, 80, 40, 0.18) 0%, transparent 70%);
  bottom: 12%; left: -4%;
  animation: orbDrift 18s ease-in-out infinite reverse;
}
.hero-orb-3 {
  width: clamp(120px, 16vw, 240px);
  height: clamp(120px, 16vw, 240px);
  background: radial-gradient(circle, rgba(206, 68, 39, 0.06) 0%, transparent 70%);
  top: 40%; left: 32%;
  animation: orbDrift 22s ease-in-out infinite 2s;
}

/* ─── HERO GRID OVERLAY ──────────────────────────────── */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 65% at center, rgba(0,0,0,0.22) 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at center, rgba(0,0,0,0.22) 0%, transparent 100%);
}

/* ─── SCROLL PROGRESS BAR ────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #ff7a50);
  box-shadow: 0 0 12px var(--accent-glow), 0 0 24px var(--accent-glow);
  z-index: 9999;
  pointer-events: none;
  transition: width 80ms linear;
}

/* ─── SPOTLIGHT CURSOR (dark sections) ───────────────── */
.spotlight-section {
  position: relative;
  overflow: hidden;
}
.spotlight-el {
  position: absolute;
  pointer-events: none;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(206, 68, 39, 0.08) 0%, transparent 65%);
  transform: translate(-50%, -50%);
  z-index: 0;
  opacity: 0;
  transition: opacity 400ms ease;
  will-change: left, top;
}

/* ─── CURSOR GLOW ────────────────────────────────────── */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(206, 68, 39, 0.04) 0%, transparent 65%);
  pointer-events: none;
  z-index: 9997;
  will-change: transform;
}

/* ─── RIPPLE CLICK EFFECT ────────────────────────────── */
.ripple-el {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transform: scale(0);
  animation: rippleAnim 0.55s ease-out forwards;
  pointer-events: none;
}

/* ─── SHIMMER SWEEP ON BUTTON ────────────────────────── */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: skewX(-20deg);
  animation: btnShimmer 4s ease-in-out infinite;
}

/* ─── TILT CARD BASE ─────────────────────────────────── */
[data-tilt] {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 350ms var(--ease-smooth), box-shadow 350ms var(--ease-smooth);
}

/* ─── GLOW LINE SEPARATOR ────────────────────────────── */
.glow-line {
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  box-shadow: 0 0 14px var(--accent-glow);
  opacity: 0.5;
  border: none;
}

/* ─── SECTION AMBIENT ────────────────────────────────── */
.section-ambient {
  position: relative;
  overflow: hidden;
}
.section-ambient::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(206, 68, 39, 0.5) 50%, transparent 100%);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ─── ANIMATED GRADIENT BACKGROUND ──────────────────── */
.bg-gradient-anim {
  background: linear-gradient(135deg,
    var(--bg-primary) 0%,
    var(--bg-secondary) 40%,
    var(--bg-primary) 100%
  );
  background-size: 200% 200%;
  animation: gradientPan 14s ease infinite;
}

/* ─── STAT BLOCK ACCENT LINE ─────────────────────────── */
.stat-block {
  position: relative;
}
.stat-block::after {
  content: '';
  position: absolute;
  bottom: 0; left: var(--sp-6);
  width: 28px; height: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ─── FEATURE VISUAL GLOW ────────────────────────────── */
.feature-visual {
  position: relative;
}
.feature-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(206, 68, 39, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

/* ─── SECTION PARALLAX TEXTURE ───────────────────────── */
section:not(.section-dark) {
  position: relative;
  isolation: isolate;
}

section:not(.section-dark):not(.hero):not(.hero-full) {
  overflow: hidden;
}

.section-texture-bg {
  position: absolute;
  inset: -30% 0;
  background: url('../img/LettermarkBG.jpg') center / 1000px auto repeat;
  opacity: 0.12;
  filter: blur(2px);
  z-index: -1;
  pointer-events: none;
  will-change: transform;
}
