/* ============================================
   Utility Classes
   ============================================ */

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Text colors */
.text-primary { color: var(--color-primary); }
.text-white { color: #fff; }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }

/* Background utilities */
.bg-primary { background-color: var(--color-primary); }
.bg-white { background-color: #fff; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }

/* Spacing utilities */
.mb-2 { margin-bottom: var(--space-sm); }
.mb-4 { margin-bottom: var(--space-md); }
.mb-6 { margin-bottom: var(--space-lg); }
.mb-8 { margin-bottom: 32px; }
.mb-12 { margin-bottom: var(--space-xl); }

.mt-4 { margin-top: var(--space-md); }
.mt-6 { margin-top: var(--space-lg); }
.mt-8 { margin-top: 32px; }

/* Width */
.w-full { width: 100%; }
.max-w-3xl { max-width: 768px; }
.max-w-4xl { max-width: 896px; }
.max-w-5xl { max-width: 1024px; }

/* Visibility per breakpoint */
.hide-mobile {
  display: none;
}

.hide-desktop {
  display: block;
}

.show-desktop-flex {
  display: none;
}

@media (min-width: 1024px) {
  .hide-mobile {
    display: block;
  }

  .hide-desktop {
    display: none;
  }

  .show-desktop-flex {
    display: flex;
  }
}

/* Aspect ratios */
.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-video {
  aspect-ratio: 16 / 9;
}

/* Image fit */
.object-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.object-contain {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Animation utility classes */
.animate-fade-in {
  opacity: 0;
}

.animate-fade-up {
  opacity: 0;
  transform: translateY(30px);
}

.animate-fade-down {
  opacity: 0;
  transform: translateY(-30px);
}

.animate-fade-left {
  opacity: 0;
  transform: translateX(-30px);
}

.animate-fade-right {
  opacity: 0;
  transform: translateX(30px);
}

.animate-scale {
  opacity: 0;
  transform: scale(0.9);
}

/* Scroll-reveal */
@media (prefers-reduced-motion: no-preference) {
  [data-animate='fade-in'] {
    opacity: 0;
  }

  [data-animate='fade-up'] {
    opacity: 0;
    transform: translateY(30px);
  }

  [data-animate='fade-down'] {
    opacity: 0;
    transform: translateY(-30px);
  }

  [data-animate='fade-left'] {
    opacity: 0;
    transform: translateX(-30px);
  }

  [data-animate='fade-right'] {
    opacity: 0;
    transform: translateX(30px);
  }

  [data-animate='scale'] {
    opacity: 0;
    transform: scale(0.9);
  }

  [data-stagger] > * {
    opacity: 0;
    transform: translateY(30px);
  }

  [data-stagger][data-stagger-motion='fade'] > * {
    opacity: 0;
    transform: none;
  }

  [data-stagger][data-entrance-played] > * {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-animate],
  [data-stagger] > * {
    opacity: 1;
    transform: none;
  }
}

/* Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0, 0, 0, 0);
}

/* Glassmorphism patterns */
.glass {
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Decorative gradient blob */
.blob {
  position: absolute;
  z-index: 0;
  border-radius: 9999px;
  filter: blur(96px);
  pointer-events: none;
}

/* Grain texture overlay */
.grain-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}