/* 📖 sections/hero.css — Seção hero com animação em 5 fases
   ⚠️  Alterar? Depende de hero.js para controle das fases */

/* ─── Wrapper principal ─── */

.hero {
  position: relative;
  min-height: 100vh;
  padding-top: calc(var(--nav-height) + var(--space-16));
  padding-bottom: var(--space-24);
  background: var(--gradient-hero);
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* Glow de fundo centrado */
.hero::before {
  content: '';
  position: absolute;
  top: 20%;
  right: 5%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(125,169,212,0.08) 0%, transparent 65%);
  pointer-events: none;
}

/* ─── Layout split ─── */

.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-16);
  align-items: center;
  position: relative;
  z-index: var(--z-raised);
}

@media (min-width: 1024px) {
  .hero__inner {
    grid-template-columns: 5fr 7fr;
    gap: var(--space-12);
    min-height: calc(100vh - var(--nav-height) - var(--space-24));
  }
}

/* ─── Cópia (lado esquerdo) ─── */

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent-subtle);
  border: var(--border-accent);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-accent);
  width: fit-content;
  animation: fadeInDown 0.8s var(--ease-out) 0.2s both;
}

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

.hero__title {
  font-size: var(--text-4xl);
  font-weight: var(--font-black);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  animation: fadeInUp 0.8s var(--ease-out) 0.3s both;
}

@media (min-width: 768px) {
  .hero__title { font-size: var(--text-5xl); }
}

@media (min-width: 1280px) {
  .hero__title { font-size: var(--text-6xl); }
}

.hero__title mark {
  background: none;
  color: var(--color-accent);
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 480px;
  animation: fadeInUp 0.8s var(--ease-out) 0.4s both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  animation: fadeInUp 0.8s var(--ease-out) 0.5s both;
}

.hero__social-proof {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: fadeInUp 0.8s var(--ease-out) 0.6s both;
}

.hero__avatars {
  display: flex;
}

.hero__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-bg-overlay);
  border: 2px solid var(--color-bg-base);
  overflow: hidden;
  margin-left: -8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__avatar:first-child { margin-left: 0; }

.hero__social-text {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.hero__social-text strong {
  display: block;
  color: var(--color-text-primary);
}

/* ─── Stage de animação (lado direito) ─── */

.hero__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-2xl);
  background: var(--color-bg-raised);
  border: var(--border-muted);
  overflow: hidden;
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  animation: fadeIn 1s var(--ease-out) 0.4s both;
}

@media (min-width: 1024px) {
  .hero__stage {
    aspect-ratio: 16/11;
  }
}

/* Barra de "janela" no topo do stage */
.hero__stage::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: var(--color-bg-overlay);
  border-bottom: var(--border-muted);
  z-index: 2;
}

/* Pontos de semáforo */
.hero__stage::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 16px;
  width: 36px;
  height: 12px;
  background:
    radial-gradient(circle at 6px 6px, #ff5f57 6px, transparent 6px),
    radial-gradient(circle at 24px 6px, #febc2e 6px, transparent 6px),
    radial-gradient(circle at 42px 6px, #28c840 6px, transparent 6px);
  z-index: 3;
}

/* ─── Layers de animação dentro do stage ─── */

.hero__layer {
  position: absolute;
  inset: 36px 0 0;          /* abaixo da barra de janela */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s var(--ease-out);
  pointer-events: none;
}

.hero__layer[data-layer] {
  opacity: 0;
}

.hero__layer.is-active {
  opacity: 1;
}

/* ─── FASE 1: Caos ─── */

.chaos-layer {
  position: relative;
}

.chaos-card {
  position: absolute;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-overlay);
  border: var(--border-muted);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  /* Posições e rotações via JS: --float-x, --float-y, --float-r, --drift-x, --drift-y */
  transform: translate(var(--float-x, 0), var(--float-y, 0)) rotate(var(--float-r, 0deg));
}

.chaos-card.is-animating {
  animation: float var(--float-dur, 6s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

.chaos-card--red    { border-color: rgba(248, 81, 73, 0.30); color: #f85149; }
.chaos-card--yellow { border-color: rgba(210, 153, 34, 0.30); color: #d29922; }
.chaos-card--blue   { border-color: rgba(125, 169, 212, 0.30); color: var(--color-accent); }

/* ─── FASE 2: Sistemas isolados ─── */

.systems-layer {
  position: relative;
  width: 100%;
  height: 100%;
}

.sys-node {
  position: absolute;
  transform: translate(-50%, -50%);
  /* --x e --y definidos em JS */
  left: var(--x, 50%);
  top: var(--y, 50%);
  transition: opacity 0.6s var(--ease-out);
}

/* ─── FASE 3: Linhas de conexão ─── */

.connections-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.connection-line {
  stroke: var(--color-primary-300);
  stroke-width: 1.5;
  stroke-opacity: 0.4;
  fill: none;
  stroke-dasharray: var(--line-length, 200);
  stroke-dashoffset: var(--line-length, 200);
}

.connection-line.is-drawing {
  animation: drawLine 0.8s var(--ease-out) forwards;
  animation-delay: var(--draw-delay, 0s);
}

/* ─── FASE 4: Hub central ─── */

.hub-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(125, 169, 212, 0.35);
  transition: transform 0.8s var(--ease-spring), opacity 0.5s var(--ease-out);
  opacity: 0;
  z-index: 2;
}

.hub-core.is-active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  animation: signalPulse 2.5s ease-in-out infinite;
}

.hub-core svg {
  width: 36px;
  height: 36px;
  color: var(--color-bg-base);
}

/* ─── FASE 5: Kanban mini ─── */

.kanban-layer {
  width: calc(100% - var(--space-8));
  padding: var(--space-4);
}

.kanban-mini {
  display: flex;
  gap: var(--space-3);
  width: 100%;
  overflow: hidden;
}

.kanban-col {
  flex: 1;
  min-width: 0;
}

.kanban-col__header {
  font-size: 10px;
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: var(--border-muted);
}

.kanban-col__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-full);
  font-size: 9px;
  color: var(--color-text-muted);
  margin-left: var(--space-1);
}

.kanban-col__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 80px;
}

/* Card viajante — controlado por hero.js */
.kanban-traveling-card {
  position: absolute;
  z-index: 5;
  transition: transform 0.9s var(--ease-smooth), opacity 0.3s;
}

/* ─── Indicador de fase (pontos na parte inferior do stage) ─── */

.hero__phase-dots {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-2);
  z-index: 10;
}

.hero__phase-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-bg-muted);
  transition: background 0.3s, transform 0.3s;
}

.hero__phase-dot.is-active {
  background: var(--color-accent);
  transform: scale(1.4);
}
