/* Hero product-flow animation (landing-bot) */

.hero-flow {
  flex: 0 0 auto;
  width: clamp(300px, 38vw, 460px);
  max-width: 48%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  z-index: 1;
}

.hero-flow__stage {
  position: relative;
  width: 100%;
  min-height: clamp(380px, 38vw, 500px);
  aspect-ratio: 10 / 13;
}

.hero-flow__glow {
  position: absolute;
  inset: -8%;
  background: radial-gradient(circle at 50% 55%, rgba(255, 83, 0, 0.24), transparent 65%);
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}

/* Phone mockup — WhatsApp scene only */
.hero-flow__phone {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 28px;
  padding: 10px;
  margin-top: 10px;
  background: linear-gradient(145deg, #2a2f38 0%, #111318 100%);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform-origin: center center;
}

.hero-flow__phone::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 3;
}

.hero-flow__phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #0b141a;
}

.hero-flow__panel--whatsapp {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #075e54 0%, #0b141a 28%);
  display: flex;
  flex-direction: column;
}

.hero-flow__wa-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 0.75rem 0.65rem;
  background: #1f2c34;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-flow__wa-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25d366, #128c7e);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
}

.hero-flow__wa-meta strong {
  display: block;
  font-size: 0.62rem;
  color: #e9edef;
  line-height: 1.2;
}

.hero-flow__wa-meta span {
  font-size: 0.58rem;
  color: #8696a0;
}

.hero-flow__wa-chat {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-flow__bubble {
  align-self: flex-end;
  max-width: 88%;
  padding: 0.55rem 0.7rem;
  border-radius: 12px 12px 2px 12px;
  background: #005c4b;
  color: #e9edef;
  font-size: 0.68rem;
  line-height: 1.45;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transform-origin: bottom right;
}

.hero-flow__bubble-time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.52rem;
  color: rgba(233, 237, 239, 0.65);
  text-align: right;
}

/* Floating layer — scenes after WhatsApp */
.hero-flow__float-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-flow__float-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 94%;
  opacity: 0;
  visibility: hidden;
  border-radius: 18px;
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.hero-flow__float-card.is-active {
  visibility: visible;
}

/* Observation card */
.hero-flow__obs-card {
  background: #fff;
  overflow: hidden;
  transform-origin: center center;
}

.hero-flow__obs-thumb {
  height: 80px;
  background:
    linear-gradient(135deg, rgba(255, 83, 0, 0.12), rgba(255, 83, 0, 0.35)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='80' viewBox='0 0 120 80'%3E%3Crect fill='%23dfe3ea' width='120' height='80'/%3E%3Crect x='20' y='48' width='80' height='14' fill='%23b8c0cc'/%3E%3Crect x='36' y='22' width='20' height='38' fill='%23c9d1db'/%3E%3C/svg%3E")
    center/cover;
}

.hero-flow__obs-body {
  padding: 0.7rem 0.8rem 0.85rem;
}

.hero-flow__obs-label {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--landing-brand);
}

.hero-flow__obs-body p {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--landing-ink);
  font-weight: 600;
}

/* AI classification panel */
.hero-flow__ai-panel {
  background: linear-gradient(160deg, #141a24 0%, #0b1018 100%);
  padding: 0.85rem;
  border: 1px solid rgba(255, 83, 0, 0.25);
}

.hero-flow__ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-flow__ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 83, 0, 0.35), rgba(255, 83, 0, 0.15));
  border: 1px solid rgba(255, 83, 0, 0.45);
  color: #ffb27f;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.hero-flow__ai-scan {
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.55);
  animation: hero-flow-pulse 1.6s ease-in-out infinite;
}

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

.hero-flow__ai-chips {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hero-flow__ai-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 0.62rem;
  transform: translateY(14px);
  opacity: 0;
}

.hero-flow__ai-chip-label {
  color: var(--landing-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.5rem;
  flex-shrink: 0;
}

.hero-flow__ai-chip-value {
  color: var(--landing-ink);
  font-weight: 700;
  text-align: right;
  font-size: 0.6rem;
}

.hero-flow__ai-chip--severity .hero-flow__ai-chip-value {
  color: #c62828;
}

/* Database panel */
.hero-flow__database-panel {
  background: #f4f6f8;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.hero-flow__db-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.hero-flow__db-header strong {
  font-size: 0.72rem;
  color: var(--landing-ink);
}

.hero-flow__db-header span {
  font-size: 0.55rem;
  color: var(--landing-muted);
}

.hero-flow__db-table {
  flex: 1;
  border-radius: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid var(--landing-line);
  font-size: 0.5rem;
  max-height: 280px;
}

.hero-flow__db-row {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 0.65fr;
  gap: 0.3rem;
  padding: 0.38rem 0.45rem;
  border-bottom: 1px solid var(--landing-line);
  color: var(--landing-ink-soft);
}

.hero-flow__db-row--head {
  position: sticky;
  top: 0;
  background: #eef1f5;
  font-weight: 700;
  color: var(--landing-ink);
  z-index: 1;
}

.hero-flow__db-row--new {
  background: rgba(255, 83, 0, 0.1);
  color: var(--landing-ink);
  font-weight: 600;
}

/* Metrics panel */
.hero-flow__metrics-panel {
  background: linear-gradient(160deg, #10151c 0%, #0b141a 100%);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-flow__metrics-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
}

.hero-flow__metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.hero-flow__metric-card {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 72px;
}

.hero-flow__metric-card > span {
  font-size: 0.48rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
}

.hero-flow__bars {
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  height: 48px;
  flex: 1;
}

.hero-flow__bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #ff7c33, var(--landing-brand));
  transform-origin: bottom center;
  transform: scaleY(0);
}

.hero-flow__donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.hero-flow__donut {
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
}

.hero-flow__donut circle {
  fill: none;
  stroke-width: 8;
}

.hero-flow__donut-track {
  stroke: rgba(255, 255, 255, 0.12);
}

.hero-flow__donut-value {
  stroke: var(--landing-brand);
  stroke-dasharray: 0 100;
}

.hero-flow__h-bars {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  flex: 1;
  justify-content: center;
}

.hero-flow__h-bar {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--landing-brand), #ff7c33);
  width: 0;
  max-width: var(--bar-width, 70%);
}

.hero-flow__sparkline {
  width: 100%;
  height: 40px;
  flex: 1;
}

.hero-flow__sparkline-line {
  fill: none;
  stroke: var(--landing-brand);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 0 100;
}

.hero-flow__stat-pill {
  align-self: flex-start;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 83, 0, 0.18);
  color: #ffb27f;
  font-size: 0.55rem;
  font-weight: 700;
  opacity: 0;
}

/* BIM model panel */
.hero-flow__bim-panel {
  background: linear-gradient(165deg, #0d1219 0%, #151c26 100%);
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hero-flow__bim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.hero-flow__bim-header strong {
  font-size: 0.72rem;
  color: #fff;
}

.hero-flow__bim-header span {
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.55);
}

.hero-flow__bim-viewport {
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 70%, rgba(255, 83, 0, 0.08), transparent 55%),
    linear-gradient(180deg, #1a2330 0%, #0f141c 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.35rem;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-flow__bim-svg {
  width: 100%;
  height: auto;
  max-height: 155px;
  display: block;
}

.hero-flow__bim-zone {
  transform-box: fill-box;
  transform-origin: center center;
}

.hero-flow__bim-zone--primary {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 0.6;
}

.hero-flow__bim-pin {
  transform-box: fill-box;
  transform-origin: center bottom;
}

.hero-flow__bim-legend {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.hero-flow__bim-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.52rem;
  color: rgba(255, 255, 255, 0.72);
  opacity: 0;
}

.hero-flow__bim-legend-item::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef5350;
  flex-shrink: 0;
}

.hero-flow__bim-legend-item--primary {
  color: #fff;
  font-weight: 700;
}

.hero-flow__bim-legend-item--primary::before {
  background: #ff1744;
  box-shadow: 0 0 6px rgba(255, 23, 68, 0.6);
}

.hero-flow__steps {
  display: flex;
  gap: 0.35rem;
}

.hero-flow__steps span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  transition: background 0.3s ease, transform 0.3s ease;
}

.hero-flow__steps span.is-active {
  background: var(--landing-brand);
  transform: scale(1.25);
}

.hero-flow__caption {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  min-height: 1.1rem;
}

.hero-flow--static .hero-flow__phone {
  display: none;
}

.hero-flow--static .hero-flow__bim-panel {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 980px) {
  .hero-flow {
    width: min(340px, 90vw);
    max-width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 720px) {
  .landing-shell.hero-section__content {
    flex-direction: column;
  }

  .hero-flow {
    order: -1;
    width: min(300px, 82vw);
    margin-bottom: 0.5rem;
  }

  .hero-flow__stage {
    min-height: 360px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-flow__ai-scan {
    animation: none;
  }

  .hero-flow__glow,
  .hero-flow__bubble,
  .hero-flow__ai-chip,
  .hero-flow__bar,
  .hero-flow__donut-value,
  .hero-flow__sparkline-line {
    transition: none !important;
    animation: none !important;
  }
}
