/**
 * Napwood motion layer — scroll reveals, hero float, chrome animations.
 */

@keyframes nw-fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes nw-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes nw-slide-left {
  from {
    opacity: 0;
    transform: translate3d(-36px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes nw-slide-right {
  from {
    opacity: 0;
    transform: translate3d(36px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes nw-zoom-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes nw-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -12px, 0); }
}

@keyframes nw-float-chip {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -8px, 0); }
}

@keyframes nw-pulse-glow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}

@keyframes nw-chart-grow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes nw-preloader-bar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

@keyframes nw-spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Page decorations */
.nw-page-decor {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.nw-page-decor__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent 75%);
}

.nw-page-decor__noise {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' 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");
}

.nw-main,
.nw-header,
.nw-footer,
.nw-promo,
.nw-cookie,
.nw-preloader {
  position: relative;
  z-index: 1;
}

/* Scroll reveal */
.nw-motion-on [data-nw-reveal] {
  opacity: 0;
}

.nw-motion-on [data-nw-reveal].is-visible {
  animation-duration: var(--nw-motion-duration, 700ms);
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  animation-delay: calc(var(--nw-reveal-delay, 0ms));
}

.nw-motion-on [data-nw-reveal="fade-up"].is-visible { animation-name: nw-fade-up; }
.nw-motion-on [data-nw-reveal="fade-in"].is-visible { animation-name: nw-fade-in; }
.nw-motion-on [data-nw-reveal="slide-left"].is-visible { animation-name: nw-slide-left; }
.nw-motion-on [data-nw-reveal="slide-right"].is-visible { animation-name: nw-slide-right; }
.nw-motion-on [data-nw-reveal="zoom"].is-visible { animation-name: nw-zoom-in; }

/* Hero visual */
.nw-hero__visual-wrap {
  position: relative;
}

.nw-hero__orbs {
  position: absolute;
  inset: -10% -5%;
  z-index: 0;
  pointer-events: none;
}

.nw-blob {
  position: absolute;
  width: min(42vw, 280px);
  height: min(42vw, 280px);
}

.nw-blob--1 { top: -8%; right: 0; animation: nw-pulse-glow 8s ease-in-out infinite; }
.nw-blob--2 { bottom: 5%; left: -8%; animation: nw-pulse-glow 10s ease-in-out infinite reverse; }
.nw-blob--3 { top: 35%; right: 20%; width: 180px; height: 180px; animation: nw-spin-slow 24s linear infinite; opacity: 0.7; }

.nw-hero__visual {
  position: relative;
  z-index: 1;
}

.nw-hero-float .nw-hero__visual-wrap {
  animation: nw-float 6s ease-in-out infinite;
}

.nw-hero__chips {
  position: absolute;
  inset: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  pointer-events: none;
  z-index: 2;
}

.nw-hero__chip {
  position: absolute;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(14, 20, 33, 0.92);
  border: 1px solid rgba(185, 251, 106, 0.35);
  color: var(--nw-text);
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  animation: nw-float-chip 5s ease-in-out infinite;
}

.nw-hero__chip--1 { top: 8%; left: -4%; animation-delay: 0s; }
.nw-hero__chip--2 { top: 42%; right: -6%; animation-delay: 0.8s; }
.nw-hero__chip--3 { bottom: 8%; left: 12%; animation-delay: 1.4s; }

.nw-hero__video {
  border-radius: calc(var(--nw-radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--nw-border);
  box-shadow: var(--nw-shadow);
  aspect-ratio: 16 / 10;
}

.nw-hero__video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.nw-dashboard-card--rich {
  position: relative;
  overflow: hidden;
}

.nw-dashboard-card__top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.nw-dashboard-card__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.nw-dashboard-card__dot--accent {
  background: var(--nw-primary);
}

.nw-dashboard-card__title-bar {
  flex: 1;
  height: 8px;
  margin-left: 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.nw-dashboard-card__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.nw-dashboard-card__metric {
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--nw-border);
}

.nw-dashboard-card__metric--accent {
  border-color: rgba(185, 251, 106, 0.35);
}

.nw-dashboard-card__metric-label {
  display: block;
  font-size: 0.7rem;
  color: var(--nw-text-muted);
  margin-bottom: 0.25rem;
}

.nw-dashboard-card__metric strong {
  font-size: 1.35rem;
  color: var(--nw-text);
}

.nw-dashboard-card__chart {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  height: 88px;
  margin-bottom: 1rem;
  padding: 0.5rem 0.25rem 0;
}

.nw-dashboard-card__chart span {
  flex: 1;
  height: var(--h);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--nw-primary), rgba(185, 251, 106, 0.2));
  transform-origin: bottom;
  animation: nw-chart-grow 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.nw-dashboard-card__chart span:nth-child(2) { animation-delay: 0.1s; }
.nw-dashboard-card__chart span:nth-child(3) { animation-delay: 0.2s; }
.nw-dashboard-card__chart span:nth-child(4) { animation-delay: 0.3s; }
.nw-dashboard-card__chart span:nth-child(5) { animation-delay: 0.4s; }
.nw-dashboard-card__chart span:nth-child(6) { animation-delay: 0.5s; }

/* Preloader */
.nw-preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--nw-bg);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.nw-preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.nw-preloader__inner {
  text-align: center;
}

.nw-preloader__mark {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--nw-primary), #7ed957);
  color: #0a0f18;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  animation: nw-pulse-glow 1.5s ease-in-out infinite;
}

.nw-preloader__text {
  margin: 0 0 1rem;
  color: var(--nw-text-muted);
  font-size: 0.9rem;
}

.nw-preloader__bar {
  display: block;
  width: 140px;
  height: 3px;
  margin-inline: auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.nw-preloader__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--nw-primary);
  animation: nw-preloader-bar 1.1s ease-in-out infinite;
}

/* Back to top */
.nw-back-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--nw-border);
  border-radius: 12px;
  background: rgba(14, 20, 33, 0.92);
  color: var(--nw-text);
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nw-back-top:hover {
  color: var(--nw-primary);
  border-color: rgba(185, 251, 106, 0.35);
  transform: translateY(-2px);
}

.nw-back-top svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* Card hover polish */
.nw-price-card,
.nw-testimonial {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.nw-price-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.nw-testimonial:hover {
  transform: translateY(-4px);
  border-color: rgba(185, 251, 106, 0.2);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nw-motion-on [data-nw-reveal] {
    opacity: 1;
    animation: none !important;
  }

  .nw-hero-float .nw-hero__visual-wrap,
  .nw-hero__chip,
  .nw-blob,
  .nw-dashboard-card__chart span,
  .nw-preloader__mark,
  .nw-preloader__bar::after {
    animation: none !important;
  }
}

body.nw-motion-off [data-nw-reveal] {
  opacity: 1;
}

@media (max-width: 960px) {
  .nw-hero__chip {
    display: none;
  }
}
