/* ==========================================================================
   Block: Analytics Hero (stepica/analytics-hero)
   Dashboard graphic is pure HTML/CSS. Bars grow with transform: scaleY and
   the ring fills via stroke-dashoffset — compositor-friendly, no layout work.
   ========================================================================== */
.ahero {
  position: relative;
  padding: 150px 0 96px;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, #2f4d8f 100%);
  overflow: hidden;
  isolation: isolate;
  color: var(--white);
}
.ahero.has-bg-image { background: var(--navy); }
.ahero-pattern {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 85% 20%, rgba(69, 114, 183, 0.28), transparent 42%),
    radial-gradient(circle at 10% 90%, rgba(69, 114, 183, 0.14), transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
  mask-image: linear-gradient(180deg, #000 60%, transparent);
}

.ahero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

/* ---------- Copy ---------- */
.ahero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  padding: 8px 16px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 600;
}
.ahero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18);
}
.ahero-title {
  font-size: clamp(2.3rem, 4.2vw, 3.5rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}
.ahero-hl {
  background: linear-gradient(90deg, var(--teal-light), #eaf1fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ahero-desc {
  max-width: 540px;
  margin-bottom: 32px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 1.06rem;
  line-height: 1.75;
}
.ahero-desc strong { color: var(--teal-light); }
.ahero-desc a { color: var(--white); text-decoration: underline; }
.ahero-buttons { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }
.ahero-highlights { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.ahero-highlights li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 500;
}
.ahero-highlights i { color: var(--teal-light); }

/* ---------- Visual ---------- */
.ahero-visual { position: relative; isolation: isolate; padding: 64px 0 30px 28px; }
.ahero-dots { top: 30px; right: -18px; }

.adash {
  position: relative;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--text-dark);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
.adash-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.adash-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: var(--white);
  font-size: 0.95rem;
}
.adash-titles { display: flex; flex-direction: column; line-height: 1.3; }
.adash-titles strong { font-family: var(--font-display); font-size: 0.98rem; }
.adash-titles small { color: var(--dark-gray); font-size: 0.74rem; }
.adash-live {
  margin-left: auto;
  padding: 4px 10px 4px 20px;
  border-radius: 50px;
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  font-size: 0.7rem;
  font-weight: 700;
  position: relative;
}
.adash-live::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: #22c55e;
  animation: adashBlink 1.6s ease-in-out infinite;
}
@keyframes adashBlink { 50% { opacity: 0.3; } }

.adash-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.adash-kpi {
  display: flex;
  flex-direction: column;
  padding: 12px 12px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--off-white);
  min-width: 0;
}
.adash-kpi dt { color: var(--dark-gray); font-size: 0.7rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adash-kpi dd {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.adash-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 700;
  vertical-align: middle;
}
.adash-trend i { font-size: 0.6rem; }
.adash-trend.is-good { color: #15803d; }
.adash-trend.is-bad { color: #dc2626; }

.adash-chart figcaption { font-size: 0.78rem; font-weight: 700; color: var(--text-dark); margin-bottom: 12px; }
.adash-bars {
  display: grid;
  grid-template-columns: repeat(var(--n, 6), 1fr);
  gap: 10px;
  height: 150px;
  padding-top: 6px;
  background-image: linear-gradient(var(--border) 1px, transparent 1px);
  background-size: 100% 25%;
}
.adash-bars li { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.adash-bar {
  display: block;
  width: 100%;
  max-width: 34px;
  height: calc(var(--h, 0.5) * (100% - 20px));
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--teal), var(--primary));
  transform-origin: bottom;
  animation: adashGrow 0.9s var(--ease) both;
  animation-delay: calc(0.25s + var(--d, 0) * 0.08s);
}
.adash-bars li:last-child .adash-bar { background: linear-gradient(180deg, #fb923c, var(--orange)); }
.adash-bar-label { font-size: 0.66rem; color: var(--mid-gray); font-weight: 600; line-height: 1; }
@keyframes adashGrow { from { transform: scaleY(0); } }

/* Floating cards */
.ahero-float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--white);
  color: var(--text-dark);
  box-shadow: var(--shadow-lg);
  font-size: 0.8rem;
  font-weight: 700;
  animation: aheroFloat 6s ease-in-out infinite;
}
.ahero-float small { display: block; color: var(--dark-gray); font-size: 0.7rem; font-weight: 500; }
.ahero-float strong { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.1; }
.ahero-float--ring { top: 0; right: 26px; }
.ahero-float--alert { bottom: 0; left: 0; animation-delay: 2.5s; max-width: 260px; }
.ahero-float--alert i {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(249, 115, 22, 0.12);
  color: var(--orange);
}
@keyframes aheroFloat { 50% { transform: translateY(-8px); } }

.ahero-ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.ahero-ring circle { fill: none; stroke: var(--light-gray); stroke-width: 5; }
.ahero-ring .ahero-ring-fill {
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--p, 0));
  animation: aheroRing 1.4s var(--ease) 0.5s both;
}
@keyframes aheroRing { from { stroke-dashoffset: 100; } }

/* Photo variant */
.ahero-photo { aspect-ratio: 4 / 5; max-width: 480px; margin-left: auto; border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .ahero { padding: 130px 0 72px; }
  .ahero-grid { grid-template-columns: 1fr; gap: 48px; }
  .ahero-visual { max-width: 560px; }
  .ahero-photo { margin: 0; aspect-ratio: 4 / 3.4; }
}
@media (max-width: 560px) {
  .ahero { padding-top: 116px; }
  .ahero-buttons { flex-direction: column; align-items: stretch; }
  .ahero-visual { padding: 0; }
  .adash { padding: 18px; }
  .adash-kpis { gap: 6px; }
  .adash-kpi { padding: 10px 8px 8px; }
  .adash-kpi dd { font-size: 1rem; }
  .adash-trend { display: flex; margin: 0; }
  .adash-bars { height: 120px; gap: 6px; }
  .ahero-float { position: relative; inset: auto; display: inline-flex; margin: 14px 8px 0 0; animation: none; }
}
