/* ==========================================================================
   02 Hero — headline, CTAs, trust line + dashboard mockup (prefix: hero)
   ========================================================================== */

/* Shell ------------------------------------------------------------------ */
.hero {
  padding-top: calc(var(--header-h) + var(--space-7));
  padding-bottom: var(--section-pad);
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
}

/* Background glows + grid ------------------------------------------------ */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
}

.hero__glow--primary {
  width: 460px;
  height: 460px;
  top: -160px;
  right: -180px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.4) 0%, rgba(124, 92, 255, 0) 65%);
}

.hero__glow--secondary {
  width: 400px;
  height: 400px;
  bottom: -160px;
  left: -180px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.24) 0%, rgba(34, 211, 238, 0) 65%);
}

.hero__grid {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 35%, black 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 60% at 50% 35%, black 20%, transparent 75%);
}

/* Layout ----------------------------------------------------------------- */
.hero__inner {
  display: grid;
  gap: var(--space-8);
  align-items: center;
}

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

/* Copy ------------------------------------------------------------------- */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 16px 6px 12px;
  margin-bottom: var(--space-5);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  background: var(--gradient-soft);
  border: 1px solid rgba(124, 92, 255, 0.35);
  border-radius: var(--radius-full);
  box-shadow: 0 0 24px rgba(124, 92, 255, 0.18);
}
.hero__badge-star { color: var(--secondary); }

.hero__title {
  margin-bottom: var(--space-5);
  font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero__subtitle {
  max-width: 560px;
  margin: 0 auto var(--space-6);
  font-size: var(--fs-lg);
  color: var(--text-muted);
}

/* Actions ---------------------------------------------------------------- */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

.hero__btn-icon {
  display: inline-flex;
  transition: transform 0.25s var(--ease);
}
.hero__btn-icon svg { width: 18px; height: 18px; }
.hero__actions .btn:hover .hero__btn-icon { transform: translateX(3px); }

@media (max-width: 480px) {
  .hero__actions .btn { flex: 1 1 100%; }
}

/* Trust line ------------------------------------------------------------- */
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.hero__avatars { display: flex; }

.hero__avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -10px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text);
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--gradient);
}
.hero__avatar:first-child { margin-left: 0; }
.hero__avatar--2 { background: linear-gradient(135deg, var(--accent), var(--primary)); }
.hero__avatar--3 { background: linear-gradient(135deg, var(--secondary), var(--success)); }
.hero__avatar--4 { background: linear-gradient(135deg, var(--warning), var(--accent)); }

.hero__rating { text-align: center; }

.hero__stars {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-bottom: 2px;
  color: var(--warning);
}
.hero__stars svg { width: 16px; height: 16px; }

.hero__trust-text {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.hero__trust-text strong { color: var(--text); font-weight: 600; }

/* Visual wrapper --------------------------------------------------------- */
.hero__visual {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  padding-block: 40px;
}

/* Dashboard card --------------------------------------------------------- */
.hero__dash {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-alt) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--glow);
  transition: transform 0.6s var(--ease);
}

.hero__chrome {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.hero__dots { display: flex; gap: 6px; flex-shrink: 0; }
.hero__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.hero__dots i:nth-child(2) { background: var(--warning); }
.hero__dots i:nth-child(3) { background: var(--success); }

.hero__url {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 4px 12px;
  overflow: hidden;
  font-size: 0.75rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}
.hero__url-icon { display: inline-flex; flex-shrink: 0; color: var(--success); }
.hero__url-icon svg { width: 12px; height: 12px; }

.hero__live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
}
.hero__live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: hero-blink 2s ease-in-out infinite;
}

.hero__dash-body { padding: var(--space-5); }

.hero__dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
}

.hero__dash-label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.hero__dash-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero__dash-range {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* Chart ------------------------------------------------------------------ */
.hero__chart { margin-top: var(--space-4); }

.hero__chart-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.hero__stop--primary { stop-color: var(--primary); }
.hero__stop--secondary { stop-color: var(--secondary); }
.hero__stop--area-top { stop-color: var(--primary); stop-opacity: 0.35; }
.hero__stop--area-bottom { stop-color: var(--secondary); stop-opacity: 0; }

.hero__chart-grid line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}

.hero__chart-prev {
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 2;
  stroke-dasharray: 3 6;
  stroke-linecap: round;
  opacity: 0.6;
}

.hero__chart-area {
  opacity: 0;
  animation: hero-fade 1.2s var(--ease) 1.1s forwards;
}

.hero__chart-line {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: hero-draw 1.8s var(--ease) 0.5s forwards;
}

.hero__chart-dot {
  fill: var(--secondary);
  stroke: var(--surface);
  stroke-width: 3;
}

.hero__chart-pulse {
  fill: var(--secondary);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: hero-pulse 2.4s ease-out 2.2s infinite;
}

.hero__chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-size: 0.6875rem;
  color: var(--text-dim);
}

/* KPI chips -------------------------------------------------------------- */
.hero__kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.hero__kpi {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hero__kpi-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
}
.hero__kpi-icon svg { width: 20px; height: 20px; }
.hero__kpi-icon--trend {
  color: var(--success);
  background: var(--surface-2);
  background: color-mix(in srgb, var(--success) 16%, transparent);
}

.hero__kpi-ring {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  transform: rotate(-90deg);
}
.hero__kpi-ring circle { fill: none; stroke-width: 3.5; }
.hero__kpi-ring-track { stroke: var(--border-strong); }
.hero__kpi-ring-value {
  stroke: var(--secondary);
  stroke-linecap: round;
  stroke-dasharray: 98 100;
}

.hero__kpi-text { min-width: 0; }

.hero__kpi-text strong {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 800;
  line-height: 1.15;
}
.hero__kpi-text em {
  font-style: normal;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-dim);
}
.hero__kpi-text small {
  display: block;
  font-size: var(--fs-xs);
  line-height: 1.3;
  color: var(--text-muted);
}

/* Floating glass cards --------------------------------------------------- */
.hero__float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: hero-float 6s ease-in-out infinite;
}

.hero__float-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.hero__float-icon svg { width: 17px; height: 17px; }

.hero__float-text strong {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.hero__float-text small {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.hero__float--launch { top: 0; left: -4px; }
.hero__float--launch .hero__float-icon {
  color: var(--success);
  background: var(--surface-2);
  background: color-mix(in srgb, var(--success) 18%, transparent);
}

.hero__float--leads { display: none; top: 0; right: -4px; animation-delay: -2s; }
.hero__float--leads .hero__float-icon { color: var(--accent); background: rgba(244, 114, 182, 0.16); }

.hero__float--content { bottom: 0; right: -4px; animation-delay: -4s; }
.hero__float--content .hero__float-icon { color: var(--secondary); background: rgba(34, 211, 238, 0.16); }

@media (max-width: 400px) {
  .hero__dash-body { padding: var(--space-4); }
  .hero__kpi { gap: var(--space-2); padding: 10px; }
  .hero__kpi-icon,
  .hero__kpi-ring { width: 32px; height: 32px; }
  .hero__kpi-text strong { font-size: var(--fs-base); }
}

/* Tablet ----------------------------------------------------------------- */
@media (min-width: 600px) {
  .hero__rating { text-align: left; }
  .hero__stars { justify-content: flex-start; }
  .hero__float--leads { display: flex; }
  .hero__float--launch { top: 46%; left: -24px; }
}

/* Desktop ---------------------------------------------------------------- */
@media (min-width: 960px) {
  .hero {
    display: flex;
    align-items: center;
    min-height: min(100vh, 940px);
    padding-top: calc(var(--header-h) + var(--space-8));
  }

  .hero__glow--primary { width: 640px; height: 640px; top: -220px; right: -160px; }
  .hero__glow--secondary { width: 540px; height: 540px; bottom: -220px; left: -200px; }

  .hero__inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: var(--space-8);
  }

  .hero__content { margin: 0; text-align: left; }
  .hero__subtitle { margin-left: 0; }
  .hero__actions,
  .hero__trust { justify-content: flex-start; }

  .hero__visual { max-width: none; padding-block: 48px; }

  .hero__dash { transform: perspective(1400px) rotateY(-7deg) rotateX(3deg); }
  .hero__visual:hover .hero__dash { transform: perspective(1400px) rotateY(0deg) rotateX(0deg); }

  .hero__float--launch { top: 50%; left: -48px; }
  .hero__float--leads { top: 8px; right: -16px; }
  .hero__float--content { bottom: 8px; right: 12%; }
}

/* Keyframes -------------------------------------------------------------- */
@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes hero-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes hero-fade {
  to { opacity: 1; }
}

@keyframes hero-pulse {
  0% { opacity: 0.5; transform: scale(1); }
  100% { opacity: 0; transform: scale(3); }
}

@keyframes hero-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__float,
  .hero__chart-pulse,
  .hero__live i { animation: none; }
  .hero__chart-line { animation: none; stroke-dashoffset: 0; }
  .hero__chart-area { animation: none; opacity: 1; }
  .hero__dash,
  .hero__visual:hover .hero__dash { transform: none; }
}
