/* ============================================================
   LIFETHINKLER ANIMATIONS
   ============================================================ */

/* ------------------------------------------------------------
   Fade-up (applied to cards and sections via JS observer)
   ------------------------------------------------------------ */

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger for card grids */
.card:nth-child(1)  { transition-delay: 0.00s; }
.card:nth-child(2)  { transition-delay: 0.08s; }
.card:nth-child(3)  { transition-delay: 0.16s; }
.card:nth-child(4)  { transition-delay: 0.24s; }
.card:nth-child(5)  { transition-delay: 0.08s; }
.card:nth-child(6)  { transition-delay: 0.16s; }

/* Fade-in (no vertical shift) */
.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
}

/* Slide-in from left */
.slide-in-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide-in from right */
.slide-in-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ------------------------------------------------------------
   Hover lift on cards (CSS only)
   ------------------------------------------------------------ */

.article-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

/* Tool card hover */
.tool-card {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ------------------------------------------------------------
   Typewriter (hero only — pure CSS)
   ------------------------------------------------------------ */

.typewriter {
  display: inline-block;
  overflow: hidden;
  border-right: 2px solid var(--color-gold);
  white-space: nowrap;
  max-width: 100%;
  animation:
    typing 3.5s steps(45, end) forwards,
    blink 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

/* ------------------------------------------------------------
   Gold shimmer on heading accents (subtle)
   ------------------------------------------------------------ */

.shimmer {
  background: linear-gradient(
    90deg,
    var(--color-gold) 0%,
    #f0d07a 50%,
    var(--color-gold) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

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

/* ------------------------------------------------------------
   Pulse dot (for live/active indicators)
   ------------------------------------------------------------ */

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-sage);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

/* ------------------------------------------------------------
   Skeleton loading (for dynamic content)
   ------------------------------------------------------------ */

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% auto;
  animation: skeleton-wave 1.5s linear infinite;
  border-radius: 4px;
}

@keyframes skeleton-wave {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ------------------------------------------------------------
   Section orb — animated background blobs
   ------------------------------------------------------------ */

@keyframes orb-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(18px, -14px) scale(1.06); }
  66%       { transform: translate(-12px, 9px) scale(0.96); }
}

@keyframes orb-drift-alt {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(-16px, 12px) scale(1.04); }
  66%       { transform: translate(10px, -8px) scale(0.98); }
}

.section-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
  animation: orb-drift 14s ease-in-out infinite;
}

.section-orb--alt {
  animation-name: orb-drift-alt;
  animation-duration: 18s;
}

/* Dot grid for light sections */
.dot-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,0,0,0.065) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
  z-index: 0;
}

/* Subtle grid for dark sections */
.grid-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201,168,76,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  pointer-events: none;
  z-index: 0;
}

/* ------------------------------------------------------------
   Reduced motion — respect user preference
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .fade-up,
  .fade-in,
  .slide-in-left,
  .slide-in-right {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .typewriter {
    animation: none;
    border-right: none;
    width: 100%;
  }

  .shimmer {
    animation: none;
  }

  .skeleton {
    animation: none;
  }

  .article-card:hover,
  .tool-card:hover {
    transform: none;
  }

  .section-orb {
    animation: none;
  }
}
