/* B2 Sistemas — Hero "Ember Grid"
   Tech-industrial premium dark: grid técnico, energia laranja contida,
   painel de gestão 100% CSS/SVG. Animações disparam via .is-visible (js/main.js). */

/* ---------- Section ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding-top: var(--nav-h, 76px);
  overflow: clip;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0) 52%);
}

.hero .bg-grid { z-index: 0; }

.hero-glow-a {
  top: 4%;
  right: -170px;
  opacity: 0.3;
  z-index: 0;
}

.hero-glow-b {
  bottom: -280px;
  left: -240px;
  width: 480px;
  height: 480px;
  opacity: 0.14;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  align-items: center;
  gap: clamp(44px, 6vw, 88px);
  /* padding inferior maior: conteúdo assenta levemente acima do centro */
  padding-block: clamp(36px, 6vh, 68px) clamp(76px, 11vh, 128px);
}

/* ---------- Coluna de texto ---------- */

.hero-copy {
  min-width: 0;
  max-width: 640px;
}

.hero-copy h1 {
  margin-top: 26px;
  font-size: clamp(2.75rem, 7.2vw, 6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-sub {
  margin-top: 26px;
  max-width: 52ch;
  color: var(--ink-2);
  font-size: clamp(1.02rem, 0.35vw + 0.95rem, 1.14rem);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

.hero-proof {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.hero-proof::before {
  content: "";
  flex: none;
  width: 26px;
  height: 1px;
  background: var(--line-strong);
}

/* ---------- Coluna visual: painel de gestão ---------- */

.hero-visual {
  position: relative;
  min-width: 0;
}

.hero-panel {
  position: relative;
  z-index: 2;
  width: min(480px, 100%);
  margin-left: auto;
  background:
    linear-gradient(180deg, rgba(247, 242, 231, 0.03), transparent 32%),
    var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-pop);
}

/* Fio ember no topo do painel */
.hero-panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14%;
  right: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(252, 157, 19, 0.6), transparent);
}

/* Barra de título */
.panel-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(247, 242, 231, 0.14);
}

.panel-title {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.live-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  animation: hero-live 2.6s ease-out infinite;
}

@keyframes hero-live {
  0% { box-shadow: 0 0 0 0 rgba(252, 157, 19, 0.5); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(252, 157, 19, 0); }
}

/* Corpo */
.panel-body {
  display: grid;
  gap: 16px;
  padding: 18px 18px 20px;
}

/* Stat chips */
.panel-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-chip {
  min-width: 0;
  padding: 13px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.stat-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink-1);
}

.stat-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--brand-2);
}

.stat-delta svg { width: 8px; height: 8px; flex: none; }

/* Gráfico de barras */
.panel-chart { min-width: 0; }

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.chart-head strong {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand-2);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  height: 108px;
  margin-top: 12px;
  border-bottom: 1px solid var(--line-strong);
}

.chart-bars span {
  flex: 1 1 0;
  height: var(--h, 40%);
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, rgba(252, 157, 19, 0.3), rgba(252, 157, 19, 0.05));
  transform-origin: bottom;
}

/* A última barra (maior) é a destacada */
.chart-bars span:last-child {
  background: var(--grad-brand);
  box-shadow: 0 0 26px -6px rgba(252, 157, 19, 0.55);
}

/* Crescimento das barras quando o reveal dispara */
.hero-visual.is-visible .chart-bars span {
  animation: hero-bar 0.8s var(--ease-out) backwards;
}
.hero-visual.is-visible .chart-bars span:nth-child(1) { animation-delay: 0.45s; }
.hero-visual.is-visible .chart-bars span:nth-child(2) { animation-delay: 0.52s; }
.hero-visual.is-visible .chart-bars span:nth-child(3) { animation-delay: 0.59s; }
.hero-visual.is-visible .chart-bars span:nth-child(4) { animation-delay: 0.66s; }
.hero-visual.is-visible .chart-bars span:nth-child(5) { animation-delay: 0.73s; }
.hero-visual.is-visible .chart-bars span:nth-child(6) { animation-delay: 0.8s; }
.hero-visual.is-visible .chart-bars span:nth-child(7) { animation-delay: 0.87s; }

@keyframes hero-bar {
  from { transform: scaleY(0); }
}

/* Sparkline */
.panel-spark {
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.spark-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}

.spark-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.64rem;
  color: var(--brand-2);
}

.spark-delta svg { width: 8px; height: 8px; flex: none; }

.spark-svg {
  width: 100%;
  height: 52px;
  margin-top: 10px;
  color: var(--brand);
  overflow: visible;
}

.spark-area { fill: currentColor; opacity: 0.1; }

.spark-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark-dot { fill: var(--brand-2); }

/* Desenho da linha quando o reveal dispara.
   435 = comprimento real do path (unidades do viewBox) — sem pathLength/vector-effect,
   que quebram o cálculo de dash no Chromium. */
.hero-visual.is-visible .spark-line {
  stroke-dasharray: 435;
  stroke-dashoffset: 435;
  animation: hero-draw 1.3s var(--ease-out) 0.85s forwards;
}

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

/* Card satélite (notificação atrás do painel) */
.hero-sat {
  position: absolute;
  z-index: 1;
  inset-inline-start: -26px;
  bottom: -58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px 16px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), var(--shadow-pop);
  transform: rotate(-1.4deg);
}

.sat-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(252, 157, 19, 0.14);
  border: 1px solid var(--line-brand);
  color: var(--brand-2);
}

.sat-icon svg { width: 16px; height: 16px; }

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

.sat-title {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-1);
  white-space: nowrap;
}

.sat-sub {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ---------- Indicador de scroll ---------- */

.hero-scroll {
  position: absolute;
  z-index: 2;
  inset-inline-end: max(var(--gutter), calc((100% - var(--container)) / 2));
  bottom: 116px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero-scroll-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-3);
  writing-mode: vertical-rl;
}

.hero-scroll-line {
  position: relative;
  width: 1px;
  height: 40px;
  background: var(--line-strong);
  overflow: hidden;
  /* Fade nas pontas: o pingo entra e sai suave, sem deixar remanescente rígido */
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}

.hero-scroll-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 16px;
  background: var(--grad-brand);
  animation: hero-drip 2.6s cubic-bezier(0.4, 0, 0.4, 1) infinite;
}

@keyframes hero-drip {
  0% { transform: translateY(-16px); }
  60%, 100% { transform: translateY(40px); }
}

/* ---------- Marquee de segmentos ---------- */

.hero-marquee {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding-block: 17px;
}

.hero-marquee .marquee-track { align-items: center; }

.hero-marquee .mq-item {
  flex: none;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--ink-3);
}

.hero-marquee .mq-dot {
  flex: none;
  width: 5px;
  height: 5px;
  margin-inline: clamp(28px, 4vw, 48px);
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.7;
  box-shadow: 0 0 8px rgba(252, 157, 19, 0.5);
}

/* ---------- Responsivo ---------- */

@media (max-width: 1080px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    gap: 40px;
  }

  .stat-value { font-size: 1.15rem; }
}

@media (max-width: 760px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 60px;
    padding-block: clamp(24px, 4vh, 44px) 88px;
  }

  /* Se quebrar em 2 linhas, o dot acompanha a primeira */
  .hero .eyebrow {
    font-size: 0.66rem;
    align-items: baseline;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-ctas .btn { width: 100%; }

  .hero-visual { margin-bottom: 64px; }

  .hero-panel { margin-inline: auto; }

  .hero-sat {
    inset-inline-start: 0;
    bottom: -56px;
    transform: rotate(-1deg);
  }

  .hero-scroll { display: none; }

  .hero-glow-a {
    top: 34%;
    right: -240px;
  }
}
