/* ════════════════════════════════════════════════════
   OWLINKX — animations.css
   All new feature styles, modular + clearly sectioned.
   Each block maps 1-to-1 with a JS module in /js/
════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────
   PAGE LOADER  ←→  js/loader.js
──────────────────────────────────────────────────── */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-0);
  z-index: 50000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.page-loader.loader-exit {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.loader-logo-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  object-fit: cover;
  animation: loader-pulse 1.8s ease-in-out infinite;
  position: relative;
  z-index: 1;
}
@keyframes loader-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 16px rgba(139,92,246,0.5));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 36px rgba(139,92,246,0.9));
    transform: scale(1.04);
  }
}

.loader-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  animation: loader-ring-out 2s ease-out infinite;
}
.loader-ring-1 {
  width: 110px; height: 110px;
  border-color: rgba(139,92,246,0.5);
  top: -10px; left: -10px;
}
.loader-ring-2 {
  width: 140px; height: 140px;
  border-color: rgba(34,211,238,0.25);
  top: -25px; left: -25px;
  animation-delay: 0.55s;
}
@keyframes loader-ring-out {
  0%   { transform: scale(0.75); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}

.loader-name {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-0);
  letter-spacing: -0.02em;
  animation: loader-fade-up 0.6s var(--ease-expo) 0.2s both;
}

.loader-bar-wrap {
  width: 160px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 1px;
  overflow: hidden;
  animation: loader-fade-up 0.6s var(--ease-expo) 0.35s both;
}
.loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--cyan-mid));
  border-radius: 1px;
  transition: width 0.2s ease;
  box-shadow: 0 0 8px rgba(139,92,246,0.6);
}

.loader-tagline {
  font-size: 13px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  animation: loader-fade-up 0.6s var(--ease-expo) 0.5s both;
}
@keyframes loader-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}


/* ────────────────────────────────────────────────────
   SCROLL PROGRESS BAR  ←→  js/progress.js
──────────────────────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 200;
  background: transparent;
  pointer-events: none;
}
.scroll-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--cyan-mid));
  box-shadow: 0 0 10px rgba(139,92,246,0.7);
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}


/* ────────────────────────────────────────────────────
   CUSTOM CURSOR  ←→  js/cursor.js
──────────────────────────────────────────────────── */
/* Only applied when cursor.js adds these to DOM */
.cursor-dot {
  position: fixed;
  width: 6px; height: 6px;
  background: white;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10002;
  /* translate is set by JS */
  top: 0; left: 0;
  mix-blend-mode: difference;
  transition: transform 0.05s linear;
  will-change: transform;
}
.cursor-ring {
  position: fixed;
  width: 30px; height: 30px;
  border: 1.5px solid rgba(139,92,246,0.65);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
  top: 0; left: 0;
  /* center correction applied by JS */
  transition: width 0.35s var(--ease-spring), height 0.35s var(--ease-spring),
              border-color 0.25s ease, opacity 0.25s;
  will-change: transform;
}
.cursor-ring.is-hovering {
  width: 52px; height: 52px;
  border-color: rgba(34,211,238,0.75);
}
.cursor-ring.is-clicking {
  width: 22px; height: 22px;
  border-color: rgba(245,158,11,0.9);
}
.cursor-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
}

/* Hide default cursor when custom cursor is active */
body.has-custom-cursor,
body.has-custom-cursor * {
  cursor: none !important;
}


/* ────────────────────────────────────────────────────
   MARQUEE TICKER  ←→  js/marquee.js
──────────────────────────────────────────────────── */
.marquee-strip {
  width: 100%;
  overflow: hidden;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: relative;
  /* Fade edges */
  mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  animation: marquee-scroll 28s linear infinite;
  will-change: transform;
}
.marquee-track:hover { animation-play-state: paused; }

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); } /* 50% because track is doubled by JS */
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: color 0.2s;
}
.marquee-item:hover { color: var(--text-0); }
.marquee-icon { font-size: 14px; }
.marquee-sep {
  color: var(--text-4);
  font-size: 16px;
  padding: 0 4px;
}


/* ────────────────────────────────────────────────────
   CARD SPOTLIGHT HOVER  ←→  js/spotlight.js
──────────────────────────────────────────────────── */
.spotlight-card { position: relative; }

/* The spotlight pseudo-element reacts to --mx/--my CSS vars set by JS */
.card-spotlight {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 50%),
    rgba(139,92,246,0.10) 0%,
    transparent 60%
  );
  z-index: 0;
}
.spotlight-card:hover .card-spotlight { opacity: 1; }

/* Ensure card content sits above spotlight */
.spotlight-card > *:not(.card-spotlight) { position: relative; z-index: 1; }


/* ────────────────────────────────────────────────────
   CONIC GRADIENT BORDER  ←→  CSS-only (no JS needed)
   Uses @property for animated --border-angle
──────────────────────────────────────────────────── */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.product-card-frame {
  border-radius: var(--r-2xl);
  padding: 1.5px;
  background: var(--border); /* default = subtle static border */
  position: relative;
  transition: background 0.4s ease;
}

/* On hover: animate the conic gradient */
.product-card-frame:hover {
  background: conic-gradient(
    from var(--border-angle),
    var(--violet) 0deg,
    var(--cyan-mid) 90deg,
    var(--purple-light) 200deg,
    var(--cyan-light) 270deg,
    var(--violet) 360deg
  );
  animation: border-angle-spin 4s linear infinite;
}
@keyframes border-angle-spin {
  to { --border-angle: 360deg; }
}

/* Remove card's own border since frame handles it */
.product-card-frame .product-card {
  border: none;
  border-radius: calc(var(--r-2xl) - 1.5px);
  height: 100%;
  background: #101122; /* Solid dark color prevents conic gradient bleed */
}


/* ────────────────────────────────────────────────────
   TEXT SCRAMBLE  ←→  js/scramble.js
──────────────────────────────────────────────────── */
[data-scramble] {
  /* Text looks normal; JS handles the scramble on reveal */
}
[data-scramble].is-scrambling {
  /* Removed text-shadow to prevent Safari/Chrome layout displacement bugs */
}


/* ────────────────────────────────────────────────────
   BENTO PHILOSOPHY GRID  ←→  HTML structure only
──────────────────────────────────────────────────── */
.philosophy-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: repeat(3, auto);
  gap: 16px;
}

/* Featured card spans all 3 rows */
.philosophy-card--featured {
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px 28px;
}
.philosophy-card--featured .phil-icon {
  font-size: 36px;
  margin-bottom: 0;
}
.philosophy-card--featured h3 {
  font-size: 22px;
}
.philosophy-card--featured p {
  font-size: 15px;
  color: var(--text-1);
}

/* Logo inside featured card */
.phil-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 30px 0;
}

/* Wrapper for the logo and its smoke effect */
.phil-logo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Smooth Neon Smoke Effect (GPU Composited) */
.phil-logo-wrap::before,
.phil-logo-wrap::after {
  content: '';
  position: absolute;
  /* Start smaller so it looks like it emits from the logo */
  inset: -10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
  /* Both layers use the same rising animation, staggered by delay */
  animation: smoke-rise 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Core purple smoke plume */
.phil-logo-wrap::before {
  background: radial-gradient(circle, rgba(139,92,246,0.6) 0%, rgba(139,92,246,0) 70%);
  filter: blur(12px);
}

/* Secondary cyan smoke plume (offset delay to create continuous stream) */
.phil-logo-wrap::after {
  background: radial-gradient(circle, rgba(34,211,238,0.4) 0%, rgba(34,211,238,0) 65%);
  filter: blur(16px);
  animation-delay: -3s; /* Starts halfway through the loop */
}

/* Continuous upward smoke drift loop */
@keyframes smoke-rise {
  0% { 
    /* Emits from the bottom center of the logo, small and invisible */
    opacity: 0; 
    transform: translateY(20px) scale(0.6); 
  }
  25% {
    /* Becomes visible as it rises */
    opacity: 0.8;
  }
  100% { 
    /* Drifts up, expands, and completely fades out into the background */
    opacity: 0; 
    transform: translateY(-70px) scale(1.8); 
  }
}

/* The actual owl logo (kept perfectly static to contrast with the smoke) */
.phil-logo-flames {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 22px;
  z-index: 1;
}

/* Checklist inside featured card */
.phil-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}
.phil-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
}
.phil-check {
  color: var(--cyan-mid);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Zero stat at bottom of featured card */
.phil-zero-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.phil-zero-num {
  font-family: 'Outfit', sans-serif;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(110deg, var(--purple-light), var(--cyan-mid));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.phil-zero-label {
  font-size: 11px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
}

/* Mobile: collapse to single column */
@media (max-width: 768px) {
  .philosophy-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .philosophy-card--featured { grid-row: auto; }
}


/* ────────────────────────────────────────────────────
   COUNTER ANIMATION  ←→  js/counters.js
──────────────────────────────────────────────────── */
[data-count-to] {
  /* Number is set by JS on scroll entry */
  display: block;
}


/* ────────────────────────────────────────────────────
   BUTTON RIPPLE  ←→  js/interactions.js
──────────────────────────────────────────────────── */
.ripple {
  overflow: hidden; /* needed for ripple containment */
}

/* Ripple element injected by JS on click */
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  pointer-events: none;
  animation: ripple-expand 0.55s var(--ease-out-expo) forwards;
}
@keyframes ripple-expand {
  to { transform: scale(4); opacity: 0; }
}


/* ────────────────────────────────────────────────────
   NAV ACTIVE SECTION INDICATOR  ←→  js/nav.js
──────────────────────────────────────────────────── */
/* Underline indicator that slides under active nav link */
.nav-indicator {
  position: absolute;
  bottom: -14px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--cyan-mid));
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(139,92,246,0.5);
  transition: left 0.4s var(--ease-expo), width 0.4s var(--ease-expo), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}
.nav-inner { position: relative; }

/* Nav link active state */
.nav-link.is-active { color: var(--text-0); }


/* ────────────────────────────────────────────────────
   STAGGER CHILDREN  ←→  js/reveal.js
──────────────────────────────────────────────────── */
.stagger-children .feature-item {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.5s var(--ease-expo), transform 0.5s var(--ease-expo);
}
.stagger-children.visible .feature-item:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: none; }
.stagger-children.visible .feature-item:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: none; }
.stagger-children.visible .feature-item:nth-child(3) { transition-delay: 0.19s; opacity: 1; transform: none; }
.stagger-children.visible .feature-item:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: none; }


/* ────────────────────────────────────────────────────
   STARFIELD  ←→  integrated into js/owl-canvas.js
   (no extra CSS needed — rendered on existing canvas)
──────────────────────────────────────────────────── */


/* ────────────────────────────────────────────────────
   GENERAL REFINEMENTS
──────────────────────────────────────────────────── */

/* Smooth reveal for philosophy featured card zero-stat */
.phil-zero-stat {
  animation: none; /* JS handles via card-reveal parent */
}

/* Enhanced product card hover when frame is present */
.product-card-frame .product-card:hover {
  box-shadow: none; /* frame handles the glow */
}
#neighowl-card:hover { box-shadow: 0 24px 64px rgba(124,58,237,0.12) inset; }
#appaudio-card:hover { box-shadow: 0 24px 64px rgba(34,211,238,0.08) inset; }

/* Dev card spotlight fix */
.dev-card .card-spotlight {
  background: radial-gradient(
    300px circle at var(--mx, 50%) var(--my, 50%),
    rgba(139,92,246,0.08) 0%,
    transparent 60%
  );
}
