/* ============================================================
   ANIMATIONS - mlic.co
   ============================================================ */

/* ---- Page loader ---- */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.loader-logo {
  display: block;
  height: 72px;
  width: auto;
}

.loader-bar-wrap {
  width: 120px;
  height: 1px;
  background: rgba(var(--theme-fg-rgb),0.1);
  overflow: hidden;
}

.loader-bar {
  height: 100%;
  background: var(--theme-fg);
  animation: loaderBar 0.9s var(--ease-premium) forwards;
}

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

/* ---- Noise overlay ---- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: var(--color-noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

html.theme-ready body {
  transition: color 0.3s var(--ease-premium), background-color 0.3s var(--ease-premium);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.32s;
  animation-timing-function: var(--ease-smooth);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.01ms;
  }

  .theme-toggle,
  .theme-toggle-track::before,
  .theme-toggle-symbol,
  .theme-logo,
  .hero-m-img,
  .work-image img,
  .work-detail-visual img {
    transition: none !important;
  }
}

/* ---- Custom cursor ---- */
.cursor {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(var(--theme-fg-rgb),0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 8999;
  transition: width 0.25s var(--ease-premium),
              height 0.25s var(--ease-premium),
              border-color 0.25s var(--ease-premium),
              background 0.25s var(--ease-premium);
  will-change: transform;
}

.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--theme-fg);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9000;
  will-change: transform;
}

.cursor--hover {
  width: 56px;
  height: 56px;
  border-color: rgba(var(--theme-fg-rgb),0.9);
  background: rgba(var(--theme-fg-rgb),0.05);
}

.cursor--click {
  width: 32px;
  height: 32px;
  background: rgba(var(--theme-fg-rgb),0.1);
}

/* ---- Hero entrance ---- */
.hero-title .line {
  overflow: visible;
}

.hero-title .line-inner {
  display: block;
}

/* ---- Scroll reveal base ---- */
.reveal {
  opacity: 0;
  transform: translateY(48px);
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(56px) scale(0.98);
}

/* ---- Work card filter hide ---- */
.work-card.hidden {
  display: none;
}

/* ---- Page ready (body class) ---- */
body:not(.page-ready) {
  overflow: hidden;
}

/* ---- Float animation (3D fallback) ---- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}

/* Prefers reduced motion overrides intentionally not applied. */
