/* ==========================================================================
   NEXORA — Hero Banner (v2)
   Section-scoped styles. Built on top of design tokens in style.css and the
   reveal system in animations.css.
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: clamp(88px, 12vh, 120px) clamp(48px, 6vh, 72px);
  isolation: isolate;
}

/* --------------------------------------------------------------------------
   Background — layered glow + grid, hero-specific palette
   -------------------------------------------------------------------------- */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg-primary);
}

.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0;
  animation: hero-glow-in 1.8s var(--ease-premium) forwards;
}

.hero__glow--green {
  width: 480px;
  height: 480px;
  top: -160px;
  left: -140px;
  background: #0c4a6e;
  animation: hero-glow-in 1.8s var(--ease-premium) forwards, drift-a 22s ease-in-out 1.8s infinite;
}

.hero__glow--cyan {
  width: 460px;
  height: 460px;
  top: 6%;
  right: -140px;
  background: var(--accent-primary);
  animation: hero-glow-in 1.8s var(--ease-premium) 0.15s forwards, drift-b 26s ease-in-out 1.95s infinite;
}

.hero__glow--violet {
  width: 380px;
  height: 380px;
  bottom: -160px;
  left: 30%;
  background: var(--accent-secondary);
  animation: hero-glow-in 1.8s var(--ease-premium) 0.3s forwards, drift-a 28s ease-in-out 2.1s infinite;
}

@keyframes hero-glow-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 0.16; transform: scale(1); }
}

@keyframes hero-accent-drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 65% 55% at 50% 30%, black, transparent 80%);
  opacity: 0.55;
}

/* --------------------------------------------------------------------------
   Layout — 45 / 55 balanced split
   -------------------------------------------------------------------------- */
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero__content {
  max-width: 500px;
}

/* --------------------------------------------------------------------------
   Eyebrow badge
   -------------------------------------------------------------------------- */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.5em 0.95em;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-color-strong);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 24px -12px rgba(34, 211, 238, 0.5);
  font-size: 11.5px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.09em;
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}

.hero__badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 8px 1px rgba(34, 211, 238, 0.8);
  animation: badge-pulse 2.4s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.8); }
}

/* --------------------------------------------------------------------------
   Headline
   -------------------------------------------------------------------------- */
.hero__headline {
  font-size: clamp(2.5rem, 2.05rem + 2.1vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.026em;
  margin-bottom: var(--space-4);
  max-width: 560px;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

.hero__headline-line {
  display: block;
}

.hero__headline .text-gradient {
  /* background-image (not the `background` shorthand) — the shorthand
     resets background-clip to border-box, which breaks the text-clipped
     gradient from the base .text-gradient rule and paints a solid block. */
  background-image: linear-gradient(100deg, var(--accent-primary) 0%, var(--accent-secondary) 45%, var(--accent-primary) 90%);
  background-size: 220% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hero-accent-drift 10s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Description / CTA / trust
   -------------------------------------------------------------------------- */
.hero__description {
  font-size: var(--fs-base);
  color: #b7bec9;
  line-height: 1.65;
  max-width: 460px;
  margin-bottom: var(--space-6);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.hero__cta .btn-primary {
  position: relative;
  overflow: hidden;
}

.hero__cta .btn-primary::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}

.hero__cta .btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  transition: left 0.6s var(--ease-premium);
}

.hero__cta .btn-primary:hover::after {
  left: 130%;
}

.hero__cta .btn-primary .arrow {
  display: inline-block;
  transition: transform var(--duration-base) var(--ease-premium);
}

.hero__cta .btn-primary:hover .arrow {
  transform: translateX(4px);
}

.hero__trust {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.hero__trust svg {
  flex-shrink: 0;
  color: var(--success);
}

/* --------------------------------------------------------------------------
   Product experience — wrapper (parallax target, viewport-safe bounds)
   -------------------------------------------------------------------------- */
.hero__product {
  position: relative;
  padding: 34px 28px;
}

.hero__product-glow {
  position: absolute;
  inset: 4% 2%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 32% 28%, rgba(12, 74, 110, 0.18), transparent 55%),
    radial-gradient(circle at 68% 38%, rgba(34, 211, 238, 0.22), transparent 55%),
    radial-gradient(circle at 50% 78%, rgba(124, 108, 255, 0.15), transparent 60%);
  filter: blur(70px);
}

/* Three.js depth layer — sits behind the real HTML dashboard (still the
   source of truth for all text/content), fades in only once WebGL has
   actually initialized. Never blocks pointer events — the HTML dashboard
   above it keeps handling its own cursor interaction untouched. */
.hero__three-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero__three-canvas.is-ready {
  opacity: 1;
}

.hero__product-inner {
  position: relative;
  z-index: 1;
  perspective: 900px;
  transition: transform 0.35s var(--ease-premium);
  will-change: transform;
}

/* Secondary offset layer — cheap depth cue, purely decorative */
.dashboard-depth {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  transform: translate(14px, 16px) rotate(-1.1deg) scale(0.985);
  z-index: 0;
}

/* --------------------------------------------------------------------------
   Dashboard shell
   -------------------------------------------------------------------------- */
.dashboard {
  position: relative;
  z-index: 1;
  background: rgba(12, 16, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow:
    0 26px 64px -14px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 90px -22px rgba(34, 211, 238, 0.32);
  padding: var(--space-5);
  overflow: hidden;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  transition:
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform-origin 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.5s ease,
    border-color 0.4s ease;
  will-change: transform;
}

.dashboard.is-tracking {
  transition: transform 0.12s linear, transform-origin 0.12s linear, box-shadow 0.15s ease, border-color 0.3s ease;
}

.dashboard.is-active {
  border-color: var(--border-accent);
  box-shadow:
    0 26px 64px -14px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 110px -20px rgba(34, 211, 238, 0.42);
}

.dashboard::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(34, 211, 238, 0.055), transparent 55%),
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.05), transparent 40%);
  pointer-events: none;
}

.dashboard::after {
  content: "";
  position: absolute;
  top: 0;
  left: 14%;
  right: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  pointer-events: none;
}

.dashboard__cursor-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22), rgba(124, 108, 255, 0.12) 45%, transparent 72%);
  filter: blur(26px);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: -1;
}

.dashboard.is-active .dashboard__cursor-glow {
  opacity: 1;
}

.dashboard__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.dashboard__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.dashboard__brand .mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #05121a;
  flex-shrink: 0;
}

.dashboard__live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--success);
  font-weight: var(--fw-medium);
}

.dashboard__live .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: badge-pulse 2.2s ease-in-out infinite;
}

.dashboard__icons {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  margin-left: auto;
}

.dashboard__icons svg {
  width: 15px;
  height: 15px;
}

/* --------------------------------------------------------------------------
   Workflow — compact horizontal flow
   -------------------------------------------------------------------------- */
.workflow {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-4);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.dashboard.is-tracking .workflow {
  transition: transform 0.12s linear;
}

.workflow__node {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
  transition: border-color var(--duration-base) var(--ease-premium);
}

.workflow__node .label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workflow__node .value {
  display: block;
  font-size: 10.5px;
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workflow__node--active {
  border-color: var(--border-accent);
  box-shadow: 0 0 18px -8px rgba(34, 211, 238, 0.55);
}

.workflow__node--active .value {
  color: var(--accent-primary-strong);
  animation: processing-pulse 1.8s ease-in-out infinite;
}

@keyframes processing-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.workflow__node--done .value {
  color: var(--success);
}

.workflow__connector {
  position: relative;
  width: 18px;
  height: 1px;
  flex-shrink: 0;
  background: var(--border-color-strong);
  margin-inline: 4px;
  overflow: visible;
}

.workflow__connector::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 10px 2px rgba(34, 211, 238, 0.8);
  transform: translateY(-50%);
  animation: workflow-pulse-h 2.6s ease-in-out infinite;
}

.workflow__connector:nth-of-type(4)::after { animation-delay: 0.6s; }
.workflow__connector:nth-of-type(6)::after { animation-delay: 1.2s; }

@keyframes workflow-pulse-h {
  0% { left: -3px; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: 15px; opacity: 0; }
}

/* --------------------------------------------------------------------------
   Panels row — conversation + side stats
   -------------------------------------------------------------------------- */
.dashboard__panels {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-4);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.dashboard.is-tracking .dashboard__panels {
  transition: transform 0.12s linear;
}

/* Chat panel */
.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  min-width: 0;
}

.chat-bubble {
  max-width: 90%;
  padding: 0.5em 0.75em;
  border-radius: var(--radius-sm);
  font-size: 11px;
  line-height: 1.4;
}

.chat-bubble--in {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-bottom-left-radius: 3px;
}

.chat-bubble--out {
  align-self: flex-end;
  background: var(--accent-gradient-soft);
  color: var(--text-primary);
  border: 1px solid var(--border-accent);
  border-bottom-right-radius: 3px;
}

.chat-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 0.55em 0.75em;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  border-bottom-left-radius: 3px;
}

.chat-typing span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* Side stats — analytics + campaign, stacked */
.side-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.stat-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}

.stat-block__label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-block__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.stat-block__row strong {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  font-weight: var(--fw-bold);
}

.stat-block__chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  margin-top: 8px;
}

.stat-block__chart span {
  flex: 1;
  background: var(--accent-gradient);
  border-radius: 2px;
  opacity: 0.85;
  animation: bar-breathe 3.2s ease-in-out infinite;
  transform-origin: bottom;
}

.stat-block__chart span:nth-child(1) { height: 40%; animation-delay: 0s; }
.stat-block__chart span:nth-child(2) { height: 65%; animation-delay: 0.2s; }
.stat-block__chart span:nth-child(3) { height: 50%; animation-delay: 0.4s; }
.stat-block__chart span:nth-child(4) { height: 85%; animation-delay: 0.6s; }
.stat-block__chart span:nth-child(5) { height: 100%; animation-delay: 0.8s; }

@keyframes bar-breathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.88); }
}

.campaign-block__track {
  height: 5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 6px;
}

.campaign-block__fill {
  height: 100%;
  width: 0;
  border-radius: var(--radius-pill);
  background: var(--accent-gradient);
  transition: width 1.1s var(--ease-premium) 0.3s;
}

.campaign-block__fill.is-visible {
  width: var(--fill, 92%);
}

.campaign-block__percent {
  margin-top: 5px;
  font-size: 9px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Floating cards — exactly two, anchored to the dashboard, viewport-safe
   -------------------------------------------------------------------------- */
.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(13, 17, 23, 0.86);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  padding: 9px 12px;
  z-index: 2;
  max-width: 192px;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.hero__product.is-tracking .float-card {
  transition: transform 0.12s linear;
}

.float-card--completed {
  top: -6px;
  right: 10px;
}

.float-card--automation {
  bottom: -6px;
  left: 10px;
}

.float-card__icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.float-card--completed .float-card__icon {
  background: rgba(52, 211, 153, 0.14);
  color: var(--success);
}

.float-card--automation .float-card__icon {
  background: rgba(34, 211, 238, 0.14);
  color: var(--accent-primary-strong);
}

.float-card__title {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  line-height: 1.3;
}

.float-card__sub {
  font-size: 10px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Bottom hero transition hint
   -------------------------------------------------------------------------- */
.hero__bottom-line {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(600px, 70%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
  opacity: 0.7;
  animation: line-pulse 4s ease-in-out infinite;
}

@keyframes line-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* --------------------------------------------------------------------------
   Reveal overrides specific to the hero
   -------------------------------------------------------------------------- */
.hero__product[data-reveal] {
  transform: translateX(48px);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1279px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }
}

@media (max-width: 1023px) {
  .hero {
    min-height: 0;
  }

  .hero__inner {
    grid-template-columns: 1fr;
  }

  .hero__content {
    max-width: 620px;
    margin-inline: auto;
    text-align: center;
  }

  .hero__headline,
  .hero__description {
    margin-inline: auto;
  }

  .hero__cta,
  .hero__trust {
    justify-content: center;
  }

  .hero__product {
    max-width: 560px;
    margin-inline: auto;
    margin-top: var(--space-8);
  }

  .hero__product[data-reveal] {
    transform: translateY(28px);
  }
}

@media (max-width: 767px) {
  .hero {
    padding-block: clamp(100px, 22vw, 128px) 56px;
  }

  .hero__product {
    padding: 24px 16px;
    margin-top: var(--space-7);
  }

  .dashboard__panels {
    grid-template-columns: 1fr;
  }

  .workflow__node .label {
    display: none;
  }

  .float-card {
    max-width: 168px;
    padding: 8px 10px;
  }

  .float-card--completed {
    top: -10px;
    right: 4px;
  }

  .float-card--automation {
    bottom: -10px;
    left: 4px;
  }

  .float-card__title {
    font-size: 10px;
  }

  .hero__product[data-reveal] {
    transform: translateY(20px);
  }
}

@media (max-width: 374px) {
  .float-card__sub {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__glow,
  .hero__badge .dot,
  .dashboard__live .dot,
  .workflow__connector::after,
  .workflow__node--active .value,
  .stat-block__chart span,
  .chat-typing span,
  .hero__headline .text-gradient,
  .hero__bottom-line {
    animation: none !important;
    opacity: 0.2;
  }

  .hero__headline .text-gradient {
    opacity: 1;
    background-position: 30% 50%;
  }

  .hero__cta .btn-primary::after {
    transition: none;
  }

  .hero__product-inner,
  .dashboard,
  .workflow,
  .dashboard__panels,
  .float-card {
    transform: none !important;
  }

  .dashboard__cursor-glow {
    display: none;
  }
}
