/* ============================================================
   PETER CALLAIS INSTITUTE — ANIMATIONS
   animations.css
   ============================================================ */

/* 1. PAGE LOAD FADE-IN
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
body {
  animation: fadeIn 0.4s ease forwards;
}

/* 2. ANIMATE-ON-SCROLL BASE
   ============================================================ */
.fade-up,
.fade-left,
.fade-right,
.scale-in,
.fade-in {
  opacity: 0;
  transition-property: opacity, transform;
  transition-duration: 0.65s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up   { transform: translateY(36px); }
.fade-left { transform: translateX(-36px); }
.fade-right{ transform: translateX(36px); }
.scale-in  { transform: scale(0.92); }
.fade-in   { transform: none; }

.fade-up.visible,
.fade-left.visible,
.fade-right.visible,
.scale-in.visible,
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* 3. STAGGER CHILDREN
   For containers with .stagger-children — JS adds delay to children
   ============================================================ */
.stagger-children > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.stagger-children > *.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Pre-set delay classes (JS adds inline delays too, but these help) */
[data-delay="1"] { transition-delay: 0.1s !important; }
[data-delay="2"] { transition-delay: 0.2s !important; }
[data-delay="3"] { transition-delay: 0.3s !important; }
[data-delay="4"] { transition-delay: 0.4s !important; }
[data-delay="5"] { transition-delay: 0.5s !important; }
[data-delay="6"] { transition-delay: 0.6s !important; }

/* 4. HERO WORD-BY-WORD STAGGER
   ============================================================ */
.hero-words .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  animation: wordReveal 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes wordReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* 5. ANIMATED UNDERLINE FOR NAV / LINKS
   ============================================================ */
.animated-link {
  position: relative;
  text-decoration: none;
}
.animated-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}
.animated-link:hover::after { width: 100%; }

/* 6. GRADIENT TEXT ANIMATION
   ============================================================ */
.gradient-text-animated {
  background: linear-gradient(135deg, #7A1330 0%, #C8A951 50%, #7A1330 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s linear infinite;
}
@keyframes gradientShift {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* 7. CARD HOVER GLOW
   ============================================================ */
.card-glow {
  transition: box-shadow 0.3s ease;
}
.card-glow:hover {
  box-shadow: 0 0 0 2px rgba(200,169,81,0.35), 0 20px 50px rgba(0,0,0,0.18);
}

/* 8. PULSE ANIMATION (for CTAs / badges)
   ============================================================ */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,169,81,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(200,169,81,0); }
}
.pulse { animation: pulse 2.5s infinite; }

/* 9. SPIN (for loading states)
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin { animation: spin 0.8s linear infinite; }

/* 10. SHIMMER (skeleton loading)
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}
.skeleton {
  background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
  background-size: 800px 104px;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
}

/* 11. COUNTER NUMBER ANIMATION
   The JS animates the textContent. These are purely display styles.
   ============================================================ */
.counter-value {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  color: #C8A951;
  line-height: 1;
}

/* 12. PARTICLE / CANVAS NODE STYLES (homepage hero)
   Canvas is styled in JS but these classes support it
   ============================================================ */
.particle-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* 13. PROGRESS BAR (for skills / competencies)
   ============================================================ */
.progress-bar {
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(to right, #7A1330, #C8A951);
  border-radius: 999px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill.animated { width: var(--target-width, 0%); }

/* 14. FLIP CARD (optional, for team cards)
   ============================================================ */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
}
.flip-card-inner {
  position: relative;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}
.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card-front,
.flip-card-back {
  backface-visibility: hidden;
  position: absolute;
  inset: 0;
}
.flip-card-back {
  transform: rotateY(180deg);
}

/* 15. GLOW BORDER (hover on dark cards)
   ============================================================ */
@keyframes glowBorder {
  0%, 100% { border-color: rgba(200,169,81,0.2); }
  50%       { border-color: rgba(200,169,81,0.6); }
}
.glow-border-anim {
  animation: glowBorder 2.5s ease-in-out infinite;
}

/* 16. SECTION TRANSITION (clip-path reveal)
   ============================================================ */
@keyframes clipReveal {
  from { clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); }
  to   { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}
.clip-reveal {
  animation: clipReveal 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 17. MARQUEE ANIMATION (partners strip)
   Defined in style.css, extended here
   ============================================================ */
.marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

/* 18. MOBILE MENU STAGGER
   ============================================================ */
#mobile-menu .mobile-nav-link:nth-child(1)  { transition-delay: 0.05s; }
#mobile-menu .mobile-nav-link:nth-child(2)  { transition-delay: 0.10s; }
#mobile-menu .mobile-nav-link:nth-child(3)  { transition-delay: 0.15s; }
#mobile-menu .mobile-nav-link:nth-child(4)  { transition-delay: 0.20s; }
#mobile-menu .mobile-nav-link:nth-child(5)  { transition-delay: 0.25s; }
#mobile-menu .mobile-nav-link:nth-child(6)  { transition-delay: 0.30s; }
#mobile-menu .mobile-nav-link:nth-child(7)  { transition-delay: 0.35s; }
#mobile-menu .mobile-nav-link:nth-child(8)  { transition-delay: 0.40s; }
#mobile-menu .mobile-nav-link:nth-child(9)  { transition-delay: 0.45s; }
#mobile-menu .mobile-nav-link:nth-child(10) { transition-delay: 0.50s; }

/* 19. HOVER LIFT UTILITY
   ============================================================ */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.15);
}

/* 20. BUTTON RIPPLE EFFECT
   ============================================================ */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  animation: rippleEffect 0.6s linear;
  pointer-events: none;
}
@keyframes rippleEffect {
  to { transform: scale(4); opacity: 0; }
}

/* 21. TYPEWRITER CURSOR
   ============================================================ */
.typewriter::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: #C8A951;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* 22. NOTIFICATION SLIDE-IN
   ============================================================ */
@keyframes slideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.slide-in-right { animation: slideInRight 0.4s ease forwards; }

/* 23. NUMBER TICK (odometer-style)
   ============================================================ */
@keyframes numberTick {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.number-tick { animation: numberTick 0.3s ease forwards; }

/* 24. SECTION-WIDE ANIMATED BACKGROUNDS (Dean / Director)
   Two distinct, full-bleed ambient animations covering the ENTIRE
   section (both the quote/text column and the profile card) —
   "Aurora Drift" (soft drifting light) for the Dean's section,
   "Orbit Rings" (rotating rings + satellites) for the Director's.
   Neither reuses the hero's dot/connection particle-network look.
   ============================================================ */
.section-anim-dark {
  position: relative;
  overflow: hidden;
}
.section-anim-dark > .container {
  position: relative;
  z-index: 2;
}
.director-card-anim {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(150deg, var(--maroon-dark) 0%, var(--navy) 100%);
}
/* Darkens the full-bleed animation so text stays legible on top */
.director-card-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(5,10,20,0.35) 0%, rgba(5,10,20,0.62) 55%, rgba(5,10,20,0.85) 100%);
}
/* Text recolored for legibility on the dark animated section */
.section-anim-dark .section-title { color: var(--white); }
.section-anim-dark .director-quote {
  color: var(--gold-light);
  background: rgba(255,255,255,0.07);
}

/* ── Dean — drifting particle network ── */
.section-particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Dean — full-bleed video background ── */
.section-anim-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.section-anim-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Director — Orbit Rings ──
   Sized with min(vh, px) rather than % of width, so the rings stay
   proportioned circles even when this animates a full wide section
   rather than just the small profile card. */
.orbit-ring {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(200,169,81,0.3);
  transform: translate(-50%, -50%);
}
.orbit-ring--1 { width: min(38vh, 300px); height: min(38vh, 300px); }
.orbit-ring--2 { width: min(58vh, 440px); height: min(58vh, 440px); border-color: rgba(200,169,81,0.18); }
.orbit-ring--3 { width: min(80vh, 580px); height: min(80vh, 580px); border-color: rgba(255,255,255,0.1); }

.orbit-wrap {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  animation: orbitSpin linear infinite;
}
.orbit-wrap--1 { animation-duration: 16s; }
.orbit-wrap--2 { animation-duration: 26s; animation-direction: reverse; }
.orbit-wrap--3 { animation-duration: 38s; }
@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}
.orbit-dot {
  position: absolute;
  left: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px 3px rgba(200,169,81,0.65);
  transform: translate(-50%, -50%);
}
.orbit-wrap--1 .orbit-dot { top: calc(-1 * min(19vh, 150px)); }
.orbit-wrap--2 .orbit-dot { top: calc(-1 * min(29vh, 220px)); background: #fff; box-shadow: 0 0 10px 2px rgba(255,255,255,0.55); }
.orbit-wrap--3 .orbit-dot { top: calc(-1 * min(40vh, 290px)); background: rgba(226,201,126,0.9); box-shadow: 0 0 12px 3px rgba(226,201,126,0.5); }

.liquid-hero {
  background: linear-gradient(160deg, #05010D 0%, #12042E 45%, #1A0630 100%);
}

.liquid-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
  animation: liquidGridDrift 30s linear infinite;
  pointer-events: none;
}

.liquid-blob {
  position: absolute;
  z-index: 0;
  filter: blur(60px);
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0.85;
  will-change: transform, border-radius;
}

.liquid-blob--1 {
  width: 520px;
  height: 520px;
  top: -18%;
  left: -10%;
  background: radial-gradient(circle at 30% 30%, rgba(139,92,246,0.95) 0%, rgba(139,92,246,0) 72%);
  animation: liquidMorph1 16s ease-in-out infinite, liquidDrift1 24s ease-in-out infinite;
}

.liquid-blob--2 {
  width: 460px;
  height: 460px;
  bottom: -15%;
  right: -8%;
  background: radial-gradient(circle at 60% 40%, rgba(247,37,133,0.9) 0%, rgba(247,37,133,0) 72%);
  animation: liquidMorph2 18s ease-in-out infinite, liquidDrift2 26s ease-in-out infinite;
}

.liquid-blob--3 {
  width: 380px;
  height: 380px;
  top: 20%;
  right: 18%;
  background: radial-gradient(circle at 40% 60%, rgba(0,229,255,0.85) 0%, rgba(0,229,255,0) 72%);
  animation: liquidMorph3 20s ease-in-out infinite, liquidDrift3 22s ease-in-out infinite;
}

.liquid-blob--4 {
  width: 300px;
  height: 300px;
  bottom: 10%;
  left: 15%;
  background: radial-gradient(circle at 50% 50%, rgba(255,182,39,0.8) 0%, rgba(255,182,39,0) 72%);
  animation: liquidMorph1 14s ease-in-out infinite reverse, liquidDrift1 20s ease-in-out infinite reverse;
}

.liquid-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.05;
  pointer-events: none;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.liquid-hero-title {
  text-shadow: 0 0 50px rgba(139,92,246,0.55), 0 0 90px rgba(247,37,133,0.25);
}

@keyframes liquidGridDrift {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 48px 96px, 48px 96px; }
}

@keyframes liquidMorph1 {
  0%, 100% { border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%; }
  50%      { border-radius: 60% 40% 30% 70% / 55% 65% 35% 45%; }
}
@keyframes liquidMorph2 {
  0%, 100% { border-radius: 55% 45% 40% 60% / 60% 50% 50% 40%; }
  50%      { border-radius: 35% 65% 60% 40% / 40% 55% 45% 60%; }
}
@keyframes liquidMorph3 {
  0%, 100% { border-radius: 48% 52% 55% 45% / 40% 60% 40% 60%; }
  50%      { border-radius: 62% 38% 42% 58% / 58% 42% 58% 42%; }
}
@keyframes liquidDrift1 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(6%, 8%) scale(1.15); }
}
@keyframes liquidDrift2 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(-8%, -6%) scale(1.1); }
}
@keyframes liquidDrift3 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(-5%, 10%) scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
  .liquid-blob, .liquid-grid { animation: none; }
  .orbit-wrap { animation: none; }
}
