/* Hero product visualization */

.hero {
  position: relative;
  background: #fff;
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.hero__grid-texture {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 72% 38%, #000 20%, transparent 75%);
}

.hero__glow {
  position: absolute;
  top: 18%;
  right: 8%;
  width: min(36rem, 55vw);
  height: 28rem;
  background: radial-gradient(ellipse, rgba(37, 99, 235, 0.07) 0%, transparent 68%);
  filter: blur(8px);
}

.hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.hero__particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.25);
  animation: hvParticle 10s ease-in-out infinite;
}

.hero__particle:nth-child(1) { top: 22%; right: 28%; animation-delay: 0s; }
.hero__particle:nth-child(2) { top: 48%; right: 18%; animation-delay: 2.5s; }
.hero__particle:nth-child(3) { top: 34%; right: 42%; animation-delay: 5s; }

@keyframes hvParticle {
  0%, 100% { opacity: 0; transform: translate(0, 0); }
  30% { opacity: 0.6; }
  50% { transform: translate(-6px, -10px); opacity: 0.35; }
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.hero-layout {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(2rem, 3.5vw, 3rem);
    align-items: center;
  }

  .hero-content {
    max-width: 38rem;
    justify-content: center;
    padding-block: clamp(0.5rem, 1.5vw, 1rem);
  }

  .hero-eyebrow {
    margin-bottom: 0;
  }
}

/* Premium badge */
.hero-eyebrow {
  position: relative;
  display: inline-block;
  width: fit-content;
  align-self: flex-start;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.625rem;
  margin-bottom: 0;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(8, 145, 178, 0.14);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.hero-eyebrow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, transparent 30%, rgba(34, 211, 238, 0.35) 50%, transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: hvBadgeShine 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hvBadgeShine {
  0%, 80%, 100% { opacity: 0.3; transform: translateX(-120%); }
  40% { opacity: 1; transform: translateX(120%); }
}

/* Visualization */
.hero-visual {
  position: relative;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  aspect-ratio: 1.05;
  --hv-mx: 0;
  --hv-my: 0;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-visual.is-live {
  opacity: 1;
  transform: translateY(0);
}

.hero-visual:not(.is-live) .hv-dash,
.hero-visual:not(.is-live) .hv-card,
.hero-visual:not(.is-live) .hv-line,
.hero-visual:not(.is-live) .hv-ai__dot,
.hero__particle {
  animation-play-state: paused;
}

.hv-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  height: 65%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
  filter: blur(24px);
  pointer-events: none;
}

.hv-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hv-line {
  stroke: rgba(37, 99, 235, 0.12);
  stroke-width: 1;
  stroke-dasharray: 4 6;
  animation: hvLineFlow 5s linear infinite;
}

@keyframes hvLineFlow {
  to { stroke-dashoffset: -20; }
}

.hv-dash {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 62%;
  transform: translate3d(
    calc(-50% + var(--hv-mx) * 0.25px),
    calc(-50% + var(--hv-my) * 0.25px),
    0
  );
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 40px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  animation: hvFloat 7s ease-in-out infinite;
}

@keyframes hvFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}

.hv-dash__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #fafafa;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.hv-dash__dots {
  display: flex;
  gap: 0.25rem;
}

.hv-dash__dots span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #d4d4d8;
}

.hv-dash__label {
  font-size: 0.5625rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hv-dash__body {
  padding: 0.75rem;
}

.hv-dash__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.hv-dash__logo {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 5px;
}

.hv-dash__brand {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.hv-dash__tag {
  font-size: 0.5rem;
  color: rgba(15, 23, 42, 0.42);
}

.hv-dash__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.hv-dash__metric {
  padding: 0.4rem 0.45rem;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 8px;
}

.hv-dash__metric span {
  display: block;
  font-size: 0.5rem;
  color: rgba(15, 23, 42, 0.42);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.hv-dash__metric strong {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.hv-dash__metric em {
  font-size: 0.5rem;
  font-style: normal;
  font-weight: 600;
  color: #15803d;
}

.hv-dash__chart {
  display: block;
  width: 100%;
  height: 2.75rem;
}

.hv-chart-line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
}

.hero-visual.is-live .hv-chart-line {
  animation: hvChartDraw 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

@keyframes hvChartDraw {
  to { stroke-dashoffset: 0; }
}

.hv-chart-area {
  opacity: 0;
}

.hero-visual.is-live .hv-chart-area {
  animation: hvAreaFade 0.8s ease 0.8s forwards;
}

@keyframes hvAreaFade {
  to { opacity: 1; }
}

/* Floating cards */
.hv-card {
  position: absolute;
  z-index: 4;
  padding: 0.45rem 0.55rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: hvCardFloat 6s ease-in-out infinite;
  animation-delay: var(--hv-delay, 0s);
  transform: translate3d(
    calc(var(--hv-mx, 0) * 0.35px * var(--hv-depth, 1)),
    calc(var(--hv-my, 0) * 0.35px * var(--hv-depth, 1)),
    0
  );
}

.hv-card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

@keyframes hvCardFloat {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -4px; }
}

.hv-card__label {
  font-size: 0.5rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.42);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.hv-card__value {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.hv-card__meta {
  font-size: 0.5rem;
  color: rgba(15, 23, 42, 0.45);
  margin-top: 0.1rem;
}

.hv-card--crm { top: 6%; right: 2%; --hv-delay: 0.3s; --hv-depth: 1.2; }
.hv-card--support { top: 38%; left: 0; --hv-delay: 0.9s; --hv-depth: 0.9; }
.hv-card--inventory { bottom: 18%; left: 4%; --hv-delay: 1.5s; --hv-depth: 1; }
.hv-card--orders { bottom: 8%; right: 6%; --hv-delay: 2.1s; --hv-depth: 1.1; }
.hv-card--revenue { top: 14%; left: 6%; --hv-delay: 0.6s; --hv-depth: 1.3; }
.hv-card--ai { bottom: 32%; right: 0; --hv-delay: 1.8s; --hv-depth: 0.8; padding: 0.35rem 0.5rem; }

.hv-ai {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.5625rem;
  font-weight: 600;
  color: #2563eb;
}

.hv-ai__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2563eb;
  animation: hvPulse 2s ease-in-out infinite;
}

@keyframes hvPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.hv-notify {
  position: absolute;
  top: 24%;
  right: 14%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  font-size: 0.5625rem;
  font-weight: 500;
  color: var(--ink);
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.hv-notify.is-show {
  opacity: 1;
  transform: translateX(0);
}

.hv-notify__icon {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 4px;
  background: #eff6ff;
  display: grid;
  place-items: center;
  font-size: 0.625rem;
}

/* Carousel overlap */
.hero-carousel-wrap {
  position: relative;
  z-index: 2;
  margin-top: clamp(-1.5rem, -2vw, -0.75rem);
  padding-top: clamp(1.5rem, 2.5vw, 2rem);
}

.hero-carousel-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9), transparent);
  pointer-events: none;
  z-index: 1;
}

@media (max-width: 1023px) {
  .hero-visual {
    max-width: 28rem;
    order: 2;
  }

  .hero-content {
    order: 1;
  }

  .hv-card--crm { right: 0; }
  .hv-card--support { left: -2%; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-visual,
  .hv-dash,
  .hv-card,
  .hv-line,
  .hero__particle,
  .hero-eyebrow::before,
  .hv-ai__dot {
    animation: none !important;
    transition: none !important;
  }

  .hero-visual {
    opacity: 1;
    transform: none;
  }

  .hv-chart-line { stroke-dashoffset: 0; }
  .hv-chart-area { opacity: 1; }
}
