/* ==========================================================================
   HERO FLOW — animación combinada en el hero (sustituye al vídeo demo)
   Agentic Search → clic en resultado → Company Intelligence → Contact Info.
   Reutiliza los estilos de los mockups de css/capabilities.css; este fichero
   aporta el marco (mismas dimensiones que el vídeo: 1920/1026, esquinas del
   .hero-app), el mapeo de variables fuera de .caps y el flujo combinado.
   ========================================================================== */

.hero-flow {
  /* Variables que capabilities.css espera de la sección .caps */
  --purple: var(--grape);
  --purple-soft: var(--mauve);
  --ink: var(--obsidian);
  --text: var(--lead);
  --muted: var(--steel);
  --line: #e7e3eb;
  --success: #0a9b68;
  --shadow: none;

  position: relative;
  /* Misma proporción que los mockups individuales de Capabilities (23/17) */
  aspect-ratio: 23 / 17;
}

/* El marco lo pone .hero-app (borde, radio 16, sombra): el browser interior
   va a sangre, sin su propio marco ni su reveal de capabilities */
.hero-flow .browser {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  opacity: 1;
  transform: none;
  transition: none;
}

/* Escalado: una sola escala para TODO el interior (chrome, barra de búsqueda,
   lienzo y pantalla de compañía) para que la tipografía guarde una única
   proporción en toda la animación */
/* 1.349 = 920 / 682: deja el lienzo con el MISMO ancho natural que los mockups
   individuales de Capabilities (stage de 600px a zoom .88), de modo que los
   layouts interiores rompen igual en ambos sitios. En alto sobra: 385px de
   contenido × 1.35 = 520px sobre ~580px de lienzo (marco 23/17) */
.hero-flow { --hf-zoom: 1.349; --hf-fill: 74.129%; /* 100 / 1.349 */ }

.hero-flow .browser-chrome,
.hero-flow .app-topbar { zoom: var(--hf-zoom); }

/* Barra morada más discreta: menos alto y campo de búsqueda más bajo */
.hero-flow .app-topbar { min-height: 38px; padding: 5px 14px; }
.hero-flow .app-search { min-height: 26px; padding: 0 11px; }
.hero-flow .search-icon { width: 12px; height: 12px; margin-right: 7px; }
.hero-flow .avatar { width: 22px; height: 22px; }

.hero-flow .concept-canvas {
  flex: 1;
  height: auto;
  min-height: 0;
  overflow: hidden;
  zoom: var(--hf-zoom);
}

.hero-flow .combined-company-screen > .company-concept {
  zoom: var(--hf-zoom);
  min-height: 0;
  height: var(--hf-fill);
}

/* El menú lateral no desplaza el elemento activo: las casillas quedan
   alineadas en una sola columna */
.hero-flow .nav-pill.active { transform: none; }

/* Todo el contenido del lienzo de búsqueda comparte un mismo ancho y márgenes */
.hero-flow .search-canvas { padding: 16px 22px 18px; }
.hero-flow .search-query-card,
.hero-flow .ai-search-loader,
.hero-flow .result-stack { max-width: none; margin-left: 0; margin-right: 0; }
.hero-flow .search-query-card { margin-bottom: 12px; }
.hero-flow .ai-search-loader { margin-bottom: 12px; }
.hero-flow .search-orbit { display: none; }

/* Etiqueta del menú lateral: una sola línea */
.hero-flow .nav-pill__label { font-size: .7rem; white-space: nowrap; color: #6B6478; font-weight: 620; }

/* Texto de la barra morada: lavanda, un paso por detrás del contenido */
.hero-flow .app-topbar .typing-text { color: #C4A9FF; }
.hero-flow .app-topbar .caret { background: #C4A9FF; }

/* El momento de escribir la consulta se lee como un zoom sobre la caja:
   mientras se teclea está acercada y al lanzar la búsqueda se asienta */
.hero-flow .query-line { color: #6B6478; font-weight: 560; }

.hero-flow .search-query-card {
  transform-origin: 50% 40%;
  transition: transform 640ms cubic-bezier(.22, 1, .36, 1), width 640ms cubic-bezier(.22, 1, .36, 1);
  width: 100%;
}
/* Al acercarse, la caja estrecha lo mismo que crece con el scale, de modo que
   nunca invade los márgenes laterales del lienzo */
.hero-flow .search-canvas:not(.searching) .search-query-card {
  transform: scale(1.06);
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  align-self: center;
}

/* Rótulo de marca fijo en la barra del navegador: α + wording */
.hero-flow .secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-flow .secure svg {
  width: 11px;
  height: auto;
  color: var(--grape);
}

/* El hero centra su texto; el mockup debe alinear a la izquierda o el tipeo
   parece crecer de derecha a izquierda al saltar de línea */
.hero-flow .browser { text-align: left; }

/* Ajuste fino del mock de Agentic Search (mismos valores que en la página
   de la animación original) */
.hero-flow .search-orbit .scan-line,
.hero-flow .search-orbit .scan-dot { display: none; }
.hero-flow .search-query-card { margin: 2px auto 8px; padding: 11px 15px; }
.hero-flow .query-line { min-height: 40px; }
.hero-flow .search-orbit { height: 14px; margin: 0 auto 4px; }
.hero-flow .ai-search-loader { min-height: 38px; margin-bottom: 8px; }
.hero-flow .result-stack { gap: 6px; }
.hero-flow .concept-result { min-height: 44px; padding: 6px 12px; }
.hero-flow .company-main,
.hero-flow .market-main { padding-bottom: 10px; }

@media (max-width: 900px) {
  /* Mini proporcional: mismo marco 23/17; el zoom lo fija js/hero-flow.js
     en función del ancho real del marco (ancho/682) */
  .hero-flow .search-canvas:not(.searching) .search-query-card { transform: none; width: 100%; }
}

/* ─────────────────────────────────────────
   COMBINED CAPABILITY FLOW
   Agentic Search results → click → Company Intelligence → Contact Info
───────────────────────────────────────── */
.combined-flow-browser { position: relative; }
.combined-flow-browser .combined-search-layer {
  transition: opacity 420ms cubic-bezier(.22, 1, .36, 1),
              transform 520ms cubic-bezier(.22, 1, .36, 1),
              filter 420ms ease;
  transform-origin: 50% 46%;
}
.combined-flow-browser .combined-company-screen {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  opacity: 0;
  visibility: hidden;
  transform: translateX(22px) scale(.985);
  transition: opacity 420ms cubic-bezier(.22, 1, .36, 1),
              transform 520ms cubic-bezier(.22, 1, .36, 1),
              visibility 0s linear 520ms;
  background: #fff;
  overflow: hidden;
  pointer-events: none;
}
.combined-flow-browser .combined-company-screen > .company-concept {
  width: 100%;
  height: 100%;
}
/* Contact Info es una sección más de Company Intelligence: el sidebar y la
   cabecera quedan fijos y People Connect ocupa solo el panel derecho */
.combined-flow-browser .combined-contact-view {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
/* Solo el concept se estira al ancho; stage y view conservan la altura fija
   del mockup original (como en la animación individual) para que nada quede
   pegado al borde inferior */
.combined-flow-browser .combined-contact-view .people-concept {
  width: 100%;
  min-height: 0;
}
.combined-flow-browser .combined-contact-view .people-concept {
  position: relative;
  overflow: hidden;
  /* El mockup de People está diseñado más alto que el panel de Contact Info:
     este zoom interior le devuelve el lienzo natural (≈620px de ancho, como
     la animación individual) y la altura pasa a ser la del contenido */
  zoom: .75;
  height: auto;
}

/* Franja reservada bajo la tarjeta para los puntos de navegación: en la
   animación individual quedan bajo el contenido, nunca encima */
.combined-flow-browser .combined-contact-view .people-view-stage {
  margin-bottom: 34px;
}
/* Altura natural, como en la animación individual: si se estiran al 100%, el
   pie del compositor queda pegado al borde y pisa los puntos de navegación */
.combined-flow-browser .combined-contact-view .people-layout,
.combined-flow-browser .combined-contact-view .pc-outreach-view {
  height: auto;
  min-height: 0;
}
.combined-flow-browser .combined-contact-view .people-view-dots { z-index: 5; }
.combined-flow-browser.combined-show-company .combined-search-layer {
  opacity: 0;
  transform: translateX(-22px) scale(.985);
  filter: blur(1px);
  pointer-events: none;
}
.combined-flow-browser.combined-show-company .combined-company-screen {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 70ms, 70ms, 0s;
  pointer-events: auto;
}
.combined-flow-browser .concept-result:first-child {
  position: relative;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(.22, 1, .36, 1),
              box-shadow 180ms ease,
              border-color 180ms ease;
}
.combined-flow-browser .concept-result:first-child.combined-result-hover {
  transform: translateY(-2px);
  border-color: rgba(78, 0, 235, .48);
  box-shadow: 0 10px 26px rgba(51, 0, 153, .14);
}
.combined-flow-browser .concept-result:first-child.combined-result-click {
  transform: translateY(0) scale(.992);
  box-shadow: 0 0 0 3px rgba(78, 0, 235, .16), 0 8px 20px rgba(51, 0, 153, .12);
}
.combined-flow-cursor {
  position: absolute;
  z-index: 20;
  width: 22px;
  height: 28px;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .24));
  transition: left 720ms cubic-bezier(.22, 1, .36, 1),
              top 720ms cubic-bezier(.22, 1, .36, 1),
              opacity 150ms ease,
              transform 120ms ease;
}
.combined-flow-cursor::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #191817;
  clip-path: polygon(0 0, 0 82%, 21% 63%, 36% 100%, 53% 92%, 39% 57%, 67% 57%);
}
.combined-flow-cursor::after {
  content: '';
  position: absolute;
  inset: 2px 3px 3px 2px;
  background: #fff;
  clip-path: polygon(0 0, 0 75%, 22% 56%, 38% 93%, 45% 89%, 29% 51%, 58% 51%);
}
.combined-flow-cursor.is-visible { opacity: 1; }
.combined-flow-cursor.is-clicking { transform: scale(.82); }
.combined-click-ripple {
  position: absolute;
  z-index: 19;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(78, 0, 235, .7);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.combined-click-ripple.is-active {
  animation: combined-ripple 480ms cubic-bezier(.22, 1, .36, 1) forwards;
}
@keyframes combined-ripple {
  0% { opacity: .75; transform: scale(.45); }
  100% { opacity: 0; transform: scale(2.7); }
}

/* ── Strategic assessment: escritura línea a línea (vista 4 del clon) ── */
.hero-flow .company-view[data-company-view="4"] .factor-lines .skeleton,
.hero-flow .company-view[data-company-view="4"] .swot-head .skeleton,
.hero-flow .company-view[data-company-view="4"] .swot-entry .skeleton {
  transform-origin: left center;
}
.hero-flow .company-view[data-company-view="4"].active .factor-lines .skeleton,
.hero-flow .company-view[data-company-view="4"].active .swot-head .skeleton,
.hero-flow .company-view[data-company-view="4"].active .swot-entry .skeleton {
  animation: saLineWrite .3s cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: calc(var(--sa-d, 0ms) + var(--sa-l, 0ms));
}
.hero-flow .company-view[data-company-view="4"].active .factor-icon {
  animation: saIconIn .24s cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: var(--sa-d, 0ms);
}
@keyframes saLineWrite {
  0% { transform: scaleX(0); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: scaleX(1); opacity: 1; }
}
@keyframes saIconIn {
  from { transform: scale(.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.hero-flow .company-view[data-company-view="4"] .factor-row:nth-child(1) { --sa-d: 40ms; }
.hero-flow .company-view[data-company-view="4"] .factor-row:nth-child(2) { --sa-d: 150ms; }
.hero-flow .company-view[data-company-view="4"] .factor-row:nth-child(3) { --sa-d: 260ms; }
.hero-flow .company-view[data-company-view="4"] .factor-row:nth-child(4) { --sa-d: 370ms; }
.hero-flow .company-view[data-company-view="4"] .factor-row:nth-child(5) { --sa-d: 480ms; }
.hero-flow .company-view[data-company-view="4"] .factor-row:nth-child(6) { --sa-d: 590ms; }
.hero-flow .company-view[data-company-view="4"] .factor-lines .skeleton:first-child { --sa-l: 0ms; }
.hero-flow .company-view[data-company-view="4"] .factor-lines .skeleton:last-child { --sa-l: 90ms; }
.hero-flow .company-view[data-company-view="4"] .swot-column:nth-child(1) { --sa-c: 160ms; }
.hero-flow .company-view[data-company-view="4"] .swot-column:nth-child(2) { --sa-c: 280ms; }
.hero-flow .company-view[data-company-view="4"] .swot-column:nth-child(3) { --sa-c: 400ms; }
.hero-flow .company-view[data-company-view="4"] .swot-column:nth-child(4) { --sa-c: 520ms; }
.hero-flow .company-view[data-company-view="4"] .swot-head { --sa-d: var(--sa-c, 0ms); }
.hero-flow .company-view[data-company-view="4"] .swot-head + .swot-entry { --sa-d: calc(var(--sa-c, 0ms) + 70ms); }
.hero-flow .company-view[data-company-view="4"] .swot-entry + .swot-entry { --sa-d: calc(var(--sa-c, 0ms) + 310ms); }
.hero-flow .company-view[data-company-view="4"] .swot-entry .skeleton:nth-child(1) { --sa-l: 0ms; }
.hero-flow .company-view[data-company-view="4"] .swot-entry .skeleton:nth-child(2) { --sa-l: 80ms; }
.hero-flow .company-view[data-company-view="4"] .swot-entry .skeleton:nth-child(3) { --sa-l: 160ms; }

@media (prefers-reduced-motion: reduce) {
  .combined-flow-cursor,
  .combined-click-ripple { display: none; }
  .combined-flow-browser .combined-search-layer,
  .combined-flow-browser .combined-company-screen { transition: none; }
  .hero-flow .company-view[data-company-view="4"].active .factor-lines .skeleton,
  .hero-flow .company-view[data-company-view="4"].active .swot-head .skeleton,
  .hero-flow .company-view[data-company-view="4"].active .swot-entry .skeleton,
  .hero-flow .company-view[data-company-view="4"].active .factor-icon { animation: none; }
}

/* Un único ancho y un único margen para todo el lienzo de búsqueda:
   la caja de la consulta, el loader y las filas de empresas comparten
   exactamente la misma caja horizontal */
.hero-flow .search-canvas { padding: 16px 18px 18px; }
.hero-flow .search-canvas > .search-query-card,
.hero-flow .search-canvas > .ai-search-loader,
.hero-flow .search-canvas > .result-stack {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
.hero-flow .search-canvas > .search-query-card { margin-top: 0; margin-bottom: 10px; padding: 12px 14px; }
.hero-flow .search-canvas > .ai-search-loader { margin-bottom: 10px; padding: 8px 14px; }
.hero-flow .result-stack { gap: 8px; }
.hero-flow .concept-result { padding: 8px 14px; }
.hero-flow .query-line { min-height: 34px; }

/* La caja de la consulta no se mueve: sin zoom ni cambio de ancho entre
   estados, y con alto reservado para dos líneas, de modo que el salto de
   línea al teclear no desplaza nada de lo que hay debajo */
.hero-flow .search-query-card,
.hero-flow .search-canvas:not(.searching) .search-query-card {
  transform: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  align-self: stretch;
  transition: box-shadow 320ms ease, border-color 320ms ease;
}
.hero-flow .query-line { min-height: 2.9em; align-items: flex-start; }
