/* Hero split mobile-first. La geometría permanece ortogonal y usa tokens. */
.fx-hero {
  padding-block: var(--fx-space-3) var(--fx-space-4);
}

.fx-hero__intro {
  display: grid;
  gap: var(--fx-space-1);
  margin-bottom: var(--fx-space-2);
}

.fx-hero__intro .fx-section-heading__eyebrow {
  margin-bottom: var(--fx-space-2);
}

.fx-hero__title,
.fx-hero__description,
.fx-hero__hint {
  margin: 0;
}

.fx-hero__description {
  color: var(--fx-color-text-secondary);
}

.fx-hero__title {
  max-width: 22rem;
  font-size: var(--fx-text-h3);
  line-height: var(--fx-leading-h3);
}

.fx-hero__stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--fx-space-2);
  min-height: 28.75rem;
  overflow: visible;
  background: transparent;
  transition: grid-template-columns 420ms var(--fx-ease-standard);
}

.fx-hero-path {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--fx-color-line-strong);
  background: var(--fx-color-carbon);
  color: var(--fx-color-text-inverse);
}

.fx-hero-path__media,
.fx-hero-path__media img,
.fx-hero-path__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Slideshow por camino: crossfade sobrio (900ms, opacity pura). Todas las
   capas ocupan exactamente la misma caja → sin CLS al rotar. */
.fx-hero-path__slides {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fx-hero-path__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms var(--fx-ease-standard);
}

.fx-hero-path__slide.is-active {
  opacity: 1;
}

.fx-hero-path__slide picture,
.fx-hero-path__slide img {
  display: block;
  width: 100%;
  height: 100%;
}

.fx-hero-path__media img {
  max-width: none;
  object-fit: cover;
  transition:
    transform 500ms var(--fx-ease-standard),
    filter var(--fx-duration-base) var(--fx-ease-standard);
}

.fx-hero-path__overlay {
  transition: opacity 420ms var(--fx-ease-standard);
}

/* Overlays de marca (derivados de los tokens oficiales):
   Empresa  → azul navy Falexom (primary/primary-deep).
   Persona  → grafito/plomo (carbon/slate).
   Ambos más ligeros arriba (la fotografía se reconoce) y más intensos
   abajo (protegen el área de copy). */
.fx-hero-path.is-company .fx-hero-path__overlay {
  background: linear-gradient(
    to top,
    rgba(0, 40, 142, 0.92),
    rgba(30, 64, 175, 0.42) 66%,
    rgba(30, 64, 175, 0.16)
  );
}

.fx-hero-path.is-person .fx-hero-path__overlay {
  background: linear-gradient(
    to top,
    rgba(17, 19, 21, 0.9),
    rgba(94, 100, 110, 0.44) 66%,
    rgba(94, 100, 110, 0.18)
  );
}

.fx-hero-path__content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--fx-space-4);
  padding: var(--fx-space-3);
}

.fx-hero-path__select {
  display: none;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: var(--fx-space-2);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fx-color-text-inverse);
  cursor: pointer;
  text-align: left;
}

.falexom-js .fx-hero-path__select {
  display: flex;
}

.fx-hero-path__eyebrow {
  color: var(--fx-color-text-inverse);
  font-weight: 600;
  transition: opacity 420ms var(--fx-ease-standard);
}

.fx-hero-path__select-label {
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Affordance del selector: glifo + dentro de un control circular de 44px,
   esquina superior derecha de cada panel (el botón ancla left/right). */
.fx-hero-path__select::after {
  display: grid;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid var(--fx-color-text-inverse);
  border-radius: 50%;
  background: rgba(17, 19, 21, 0.38);
  content: "+";
  font-family: var(--fx-font-mono);
  font-size: 1.5rem;
  line-height: 1;
  transition:
    filter var(--fx-duration-base) var(--fx-ease-standard),
    border-color var(--fx-duration-base) var(--fx-ease-standard);
}

/* Respiración continua del + solo en estado neutral: una invitación callada,
   no un parpadeo. Ciclo lento de 2.6s (sube ~0.5s, vuelve ~0.7s, sostiene
   ~1.4s); opacidad entre 0.8 y 1 (el control nunca desaparece). Al
   seleccionar, [data-state] deja de coincidir y el pulso se detiene en
   ambos paneles; "Ver ambos caminos" restaura neutral y lo reanuda. */
.falexom-js .fx-hero__stage[data-state="neutral"] .fx-hero-path__select::after {
  animation: fx-hero-select-pulse 2600ms var(--fx-ease-standard) infinite;
}

@keyframes fx-hero-select-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  20% {
    transform: scale(1.08);
    opacity: 0.8;
  }

  45%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.fx-hero-path__select:hover::after {
  animation-play-state: paused;
  border-color: var(--fx-color-primary-soft);
  filter: brightness(1.12);
}

.fx-hero-path__select:focus-visible {
  outline: 2px solid var(--fx-focus-color);
  outline-offset: var(--fx-focus-offset);
}

.fx-hero-path__select:focus-visible::after {
  animation-play-state: paused;
  border-color: var(--fx-color-primary-soft);
  filter: brightness(1.12);
}

.fx-hero-path__select[aria-pressed="true"]::after {
  content: "−";
}

.fx-hero-path__copy {
  display: grid;
  gap: var(--fx-space-1);
  align-content: end;
  transition: opacity 420ms var(--fx-ease-standard);
}

.fx-hero-path__profile,
.fx-hero-path__title,
.fx-hero-path__description {
  margin: 0;
  color: inherit;
}

.fx-hero-path__profile {
  color: var(--fx-color-text-inverse);
  font-size: var(--fx-text-h4);
  line-height: var(--fx-leading-h4);
}

.fx-hero-path__title {
  color: var(--fx-color-text-inverse);
  opacity: 0.88;
}

.fx-hero-path__description {
  max-width: 22rem;
  opacity: 0.93;
}

.fx-hero-path__action {
  width: 100%;
  margin-top: var(--fx-space-2);
  padding-inline: var(--fx-space-2);
  background: var(--fx-color-surface-high);
  color: var(--fx-color-carbon);
}

.fx-hero-path.is-company .fx-hero-path__action {
  background: var(--fx-color-primary);
  color: #fff;
}

.fx-hero-path__action .fx-button__icon {
  display: inline-block;
  transition: transform var(--fx-duration-fast) var(--fx-ease-standard);
}

.fx-hero-path__action:hover .fx-button__icon,
.fx-hero-path__action:focus-visible .fx-button__icon {
  transform: translateX(var(--fx-space-1));
}

.fx-hero-path:hover .fx-hero-path__media img {
  filter: saturate(1.04) contrast(1.02);
}

.fx-hero__reset {
  position: absolute;
  z-index: 3;
  top: var(--fx-space-3);
  left: 50%;
  min-height: 44px;
  transform: translateX(-50%);
  border: 1px solid var(--fx-color-text-inverse);
  background: var(--fx-color-carbon);
  color: var(--fx-color-text-inverse);
  padding: var(--fx-space-2) var(--fx-space-3);
  font-family: var(--fx-font-mono);
  font-size: var(--fx-text-label-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.falexom-js .fx-hero__stage[data-state="company"] {
  grid-template-columns: minmax(0, 1fr) 3.5rem;
}

.falexom-js .fx-hero__stage[data-state="person"] {
  grid-template-columns: 3.5rem minmax(0, 1fr);
}

.falexom-js .fx-hero__stage[data-state="company"] .fx-hero-path.is-person .fx-hero-path__copy,
.falexom-js .fx-hero__stage[data-state="person"] .fx-hero-path.is-company .fx-hero-path__copy,
.falexom-js .fx-hero__stage[data-state="company"] .fx-hero-path.is-person .fx-hero-path__eyebrow,
.falexom-js .fx-hero__stage[data-state="person"] .fx-hero-path.is-company .fx-hero-path__eyebrow {
  opacity: 0;
  pointer-events: none;
}

.falexom-js .fx-hero__stage[data-state="company"] .fx-hero-path.is-person .fx-hero-path__content,
.falexom-js .fx-hero__stage[data-state="person"] .fx-hero-path.is-company .fx-hero-path__content {
  padding-inline: var(--fx-space-1);
}

.falexom-js .fx-hero__stage[data-state="company"] .fx-hero-path.is-company .fx-hero-path__media img,
.falexom-js .fx-hero__stage[data-state="person"] .fx-hero-path.is-person .fx-hero-path__media img {
  transform: scale(1.025);
}

/* Panel activo: overlay más liviano para mostrar la imagen con más vida. */
.falexom-js .fx-hero__stage[data-state="company"] .fx-hero-path.is-company .fx-hero-path__overlay,
.falexom-js .fx-hero__stage[data-state="person"] .fx-hero-path.is-person .fx-hero-path__overlay {
  opacity: 0.82;
}

/* Panel secundario: se oscurece levemente, sigue siendo reconocible. */
.falexom-js .fx-hero__stage[data-state="company"] .fx-hero-path.is-person .fx-hero-path__media img,
.falexom-js .fx-hero__stage[data-state="person"] .fx-hero-path.is-company .fx-hero-path__media img {
  filter: brightness(0.85);
}

@media (min-width: 768px) {
  .fx-hero {
    padding-block: var(--fx-space-8) var(--fx-space-12);
  }

  .fx-hero__intro {
    grid-template-columns: minmax(0, 1.4fr) minmax(17rem, 0.6fr);
    align-items: end;
    gap: var(--fx-space-8);
    margin-bottom: var(--fx-space-6);
  }

  .fx-hero__title {
    max-width: none;
    font-size: var(--fx-text-h1);
    line-height: var(--fx-leading-h1);
  }

  .fx-hero__stage {
    min-height: clamp(27rem, 62dvh, 38rem);
  }

  .fx-hero-path__content {
    padding: var(--fx-space-6);
  }

  .fx-hero-path__profile {
    font-size: var(--fx-text-h2);
    line-height: var(--fx-leading-h2);
  }

  /* Desktop: la decisión es menos extrema que en mobile (≈70/30). */
  .falexom-js .fx-hero__stage[data-state="company"] {
    grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  }

  .falexom-js .fx-hero__stage[data-state="person"] {
    grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
  }

  /* El camino secundario conserva su eyebrow para seguir siendo legible. */
  .falexom-js .fx-hero__stage[data-state="company"] .fx-hero-path.is-person .fx-hero-path__eyebrow,
  .falexom-js .fx-hero__stage[data-state="person"] .fx-hero-path.is-company .fx-hero-path__eyebrow {
    opacity: 1;
  }
}

/* El CTA Empresa hace scroll a Arquitectura sin que el header sticky oculte
   el título (header ≈ 80px; 6rem = 96px de tope + respiro). */
#como-trabajamos {
  scroll-margin-top: 6rem;
}

@media (min-width: 1200px) {
  .fx-hero__stage {
    min-height: min(64dvh, 40rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx-hero__stage,
  .fx-hero-path__media img,
  .fx-hero-path__overlay,
  .fx-hero-path__copy,
  .fx-hero-path__eyebrow {
    transition: none;
  }

  .fx-hero-path__slide {
    transition: none;
  }

  .fx-hero-path__select::after {
    animation: none;
  }
}
