/* ═══════════════════════════════════════════
   ALPHA KLID — ANIMATIONS & EFFECTS
   Keyframes, Scroll Reveals, Transitions
   ═══════════════════════════════════════════ */

/* ─── SCROLL ANIMATIONS ─── */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* stagger children */
.stagger > *:nth-child(1) { transition-delay: 0s; }
.stagger > *:nth-child(2) { transition-delay: 0.12s; }
.stagger > *:nth-child(3) { transition-delay: 0.24s; }
.stagger > *:nth-child(4) { transition-delay: 0.36s; }
.stagger > *:nth-child(5) { transition-delay: 0.48s; }
.stagger > *:nth-child(6) { transition-delay: 0.6s; }

/* ─── HERO ANIMATIONS ─── */
@keyframes hero-visual-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes hero-fade {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── HERO TEXT REVEAL ─── */
@keyframes hero-text-reveal {
  from { clip-path: inset(0 0 0 100%); opacity: 0; transform: translateY(15px); }
  to { clip-path: inset(0 0 0 0); opacity: 1; transform: translateY(0); }
}
.hero-word {
  display: inline-block;
  animation: hero-text-reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

/* ─── SCROLL WHEEL ANIMATION ─── */
@keyframes scroll-wheel {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

/* ─── HERO BG KEN BURNS ─── */
@keyframes ken-burns {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* ─── IMPACT CARD ROTATING BORDER ─── */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes rotate-border {
  to { --border-angle: 360deg; }
}
.impact-card {
  position: relative;
}
.impact-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--border-angle), transparent 70%, var(--gold) 85%, transparent 100%);
  -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: rotate-border 4s linear infinite;
  opacity: 0;
  transition: opacity 0.5s;
}
.impact-card:hover::before {
  opacity: 1;
}

/* ─── STORY HIGHLIGHT ANIMATION ─── */
.story-content .narrative strong {
  background: linear-gradient(transparent 60%, rgba(201,168,76,0.25) 60%);
  background-size: 0% 100%;
  background-repeat: no-repeat;
  background-position: right;
  transition: background-size 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0 2px;
}
.story-content .narrative strong.highlighted {
  background-size: 100% 100%;
}

/* ─── PAIN POINT NUMBER WATERMARKS ─── */
.pain-item {
  position: relative;
  overflow: hidden;
}
.pain-item::before {
  content: attr(data-index);
  font-family: var(--serif);
  font-size: 7rem;
  position: absolute;
  top: -15px;
  left: 10px;
  color: rgba(201,168,76,0.04);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s;
  transform: scale(0.8);
  opacity: 0;
}
.pain-item.visible::before {
  transform: scale(1);
  opacity: 1;
}

/* ─── CHATBOT MESSAGE FADE ─── */
@keyframes chatFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── TYPING DOTS ─── */
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* ═══════════════════════════════════════════
   PREMIUM ANIMATIONS
   ═══════════════════════════════════════════ */

/* ─── PRELOADER ─── */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader-logo {
  font-family: var(--serif);
  font-size: 2.5rem;
  color: var(--gold);
  letter-spacing: 8px;
  font-weight: 700;
  opacity: 0;
  animation: preloader-fade 1s 0.2s forwards;
}
@keyframes preloader-fade {
  0% { opacity: 0; transform: scale(0.9); }
  60% { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}

/* ─── PAGE TRANSITION ─── */
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: fade-out 0.25s ease-in;
}
::view-transition-new(root) {
  animation: fade-in 0.25s ease-out;
}
@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* Fallback for browsers without View Transitions */
main {
  animation: fade-in 0.3s ease-out;
}

/* ─── NOISE/GRAIN TEXTURE ─── */
.hero::after,
.pain-points::after,
.impact::after,
.approach::after,
.final-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ─── FLOATING GOLD PARTICLES (hero only) ─── */
@keyframes float-particle {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: var(--particle-opacity, 0.2); }
  90% { opacity: var(--particle-opacity, 0.2); }
  100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}
.hero .gold-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.hero .gold-particle {
  position: absolute;
  bottom: -10px;
  width: var(--size, 4px);
  height: var(--size, 4px);
  background: var(--gold);
  border-radius: 50%;
  animation: float-particle var(--duration, 18s) var(--delay, 0s) linear infinite;
  --particle-opacity: 0.2;
}

/* ─── GRADIENT MESH (dark sections) ─── */
@keyframes mesh-shift-1 {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes mesh-shift-2 {
  0%, 100% { background-position: 100% 0%; }
  50% { background-position: 0% 100%; }
}
.gradient-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.gradient-mesh::before,
.gradient-mesh::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
}
.gradient-mesh::before {
  background: radial-gradient(ellipse at 30% 20%, rgba(201,168,76,0.3), transparent 50%);
  background-size: 200% 200%;
  animation: mesh-shift-1 25s ease-in-out infinite;
}
.gradient-mesh::after {
  background: radial-gradient(ellipse at 70% 80%, rgba(100,80,200,0.2), transparent 50%);
  background-size: 200% 200%;
  animation: mesh-shift-2 35s ease-in-out infinite;
}

/* ─── IMAGE CLIP-PATH REVEAL ─── */
.img-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.img-reveal.visible {
  clip-path: inset(0 0 0 0);
}

/* ─── MAGNETIC BUTTON ─── */
.magnetic-btn {
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ─── ENHANCED 3D TILT GLARE ─── */
.program-card .tilt-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255,255,255,0.08), transparent 60%);
  z-index: 2;
}
.program-card:hover .tilt-glare {
  opacity: 1;
}

/* ─── LINK HOVER — WAVY UNDERLINE ─── */
@keyframes wave-underline {
  0% { background-position: 0 100%; }
  100% { background-position: 200% 100%; }
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .preloader { display: none; }
  .reveal, .reveal-right, .reveal-left, .reveal-scale {
    opacity: 1;
    transform: none;
  }
  .img-reveal { clip-path: none; }
  .hero .gold-particles { display: none; }
  .gradient-mesh { display: none; }
}
