/* =====================================================================
   enhance.css — shared premium layer loaded on every page AFTER the
   page's own stylesheet. Adds: branded preloader, custom cursor, film
   grain texture, upgraded hero (status pill, dual CTA, stat strip) and
   button micro-interactions. Uses the same design tokens as the theme;
   redeclared here so this file works standalone on each page.
   ===================================================================== */

:root {
  --e-grad: linear-gradient(135deg, #6d5efc 0%, #a855f7 50%, #22d3ee 100%);
  --e-primary: #6d5efc;
  --e-accent: #22d3ee;
  --e-text: #eceef7;
  --e-dim: #a6abc7;
  --e-surface: rgba(255, 255, 255, 0.05);
  --e-border: rgba(255, 255, 255, 0.12);
}

/* ---------- film grain texture (very subtle, fixed) ---------- */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 8s steps(6) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -4%); }
  60% { transform: translate(-3%, 2%); }
  80% { transform: translate(4%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ---------- branded preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
  background: #07070f;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.preloader .loader-ring {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--e-primary);
  border-right-color: var(--e-accent);
  animation: spin 0.9s linear infinite;
}
.preloader .loader-name {
  font-family: "Space Grotesk", "Poppins", sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.4rem;
  background: var(--e-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulseName 1.4s ease-in-out infinite;
}
.preloader.loaded {
  opacity: 0;
  visibility: hidden;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulseName {
  0%, 100% { opacity: 0.55; letter-spacing: 0.4rem; }
  50% { opacity: 1; letter-spacing: 0.7rem; }
}

/* ---------- custom cursor (fine-pointer devices only) ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 100000;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cursor-dot {
  width: 7px;
  height: 7px;
  background: #fff;
  mix-blend-mode: difference;
}
.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(124, 131, 255, 0.8);
  box-shadow: 0 0 16px rgba(109, 94, 252, 0.5);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease,
    background 0.25s ease, opacity 0.3s ease;
}
.cursor-ring.hovering {
  width: 58px;
  height: 58px;
  border-color: rgba(34, 211, 238, 0.9);
  background: rgba(109, 94, 252, 0.12);
}
body.custom-cursor.cursor-ready .cursor-dot,
body.custom-cursor.cursor-ready .cursor-ring {
  opacity: 1;
}
@media (pointer: fine) {
  body.custom-cursor,
  body.custom-cursor a,
  body.custom-cursor button,
  body.custom-cursor .btn,
  body.custom-cursor .tilt {
    cursor: none;
  }
}

/* ---------- upgraded hero pieces ---------- */
.home .content .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1.4rem;
  margin-bottom: 1.8rem;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--e-text);
  background: var(--e-surface);
  border: 1px solid var(--e-border);
  border-radius: 3em;
  backdrop-filter: blur(8px);
  animation: fadeUp 0.9s ease both;
}
.home .content .status-pill .pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2ee6a6;
  box-shadow: 0 0 0 0 rgba(46, 230, 166, 0.7);
  animation: livePulse 1.8s ease-out infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 230, 166, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(46, 230, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 230, 166, 0); }
}

.home .content .hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
  margin-top: 1.5rem;
  animation: fadeUp 0.9s ease 0.3s both;
}
.home .content .hero-cta .btn {
  margin-top: 0;
  animation: gradientShift 6s ease infinite;
}
.home .content .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.5rem 2.6rem;
  border-radius: 4em;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--e-text);
  background: transparent;
  border: 1.5px solid var(--e-border);
  transition: 0.3s;
}
.home .content .btn-ghost:hover {
  border-color: var(--e-accent);
  color: #fff;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.25);
  transform: translateY(-3px);
}
.home .content .btn-ghost i {
  transition: transform 0.3s;
}
.home .content .btn-ghost:hover i {
  transform: translateX(5px);
}

.home .content .hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.6rem;
  margin-top: 3rem;
  animation: fadeUp 0.9s ease 0.5s both;
}
.home .content .hero-stats .stat h3 {
  font-family: "Space Grotesk", "Poppins", sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  background: var(--e-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.home .content .hero-stats .stat p {
  font-size: 1.3rem;
  color: var(--e-dim);
  padding: 0;
  margin-top: 0.2rem;
  text-transform: none;
}
.home .content .hero-stats .stat {
  position: relative;
}
.home .content .hero-stats .stat:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -1.3rem;
  top: 10%;
  height: 80%;
  width: 1px;
  background: var(--e-border);
}

@media (max-width: 450px) {
  .home .content .hero-stats {
    gap: 1.8rem;
  }
  .home .content .hero-stats .stat h3 {
    font-size: 2.2rem;
  }
}

/* ---------- button shine micro-interaction ---------- */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.btn:hover::before {
  left: 140%;
}

/* keyframes reused by hero (declared here so file is standalone) */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain,
  .preloader .loader-ring,
  .preloader .loader-name,
  .status-pill .pulse-dot {
    animation: none !important;
  }
}
