/* v29 motion — polish sin ocultar textos (iOS-safe) */
@media (prefers-reduced-motion: no-preference) {
  .showcase-cta,
  .pill-btn,
  .lang-toggle,
  .theme-toggle,
  .site-nav__burger,
  .homelab-map__zoom-btn,
  .recruiter-bar__item,
  .ha-card,
  .hl-node {
    transition:
      transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
      border-color 0.2s,
      background 0.2s,
      box-shadow 0.25s,
      color 0.2s;
  }

  .showcase-cta:active,
  .pill-btn:active,
  .lang-toggle:active,
  .theme-toggle:active,
  .site-nav__burger:active,
  .homelab-map__zoom-btn:active,
  .recruiter-bar__item:active {
    transform: scale(0.96);
  }

  .hl-node:active {
    transform: translate(-50%, -50%) scale(0.94);
  }

  .hl-node.is-active {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent),
      0 10px 28px rgba(0, 0, 0, 0.28);
  }

  .ha-card:active {
    transform: scale(0.985);
  }

  .ha-card.is-on .ha-card__icon,
  .ha-entity.is-on .ha-card__icon {
    animation: haPulse 1.8s ease-in-out infinite;
  }

  @keyframes haPulse {
    0%,
    100% {
      transform: scale(1);
      filter: brightness(1);
    }
    50% {
      transform: scale(1.06);
      filter: brightness(1.15);
    }
  }

  .nav-drawer:not([hidden]) {
    animation: drawerIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  @keyframes drawerIn {
    from {
      opacity: 0.85;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .homelab-map__viewport {
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
  }

  .homelab-map__viewport.is-dragging {
    cursor: grabbing;
  }

  .homelab-map__stage {
    will-change: transform;
    transform-origin: 0 0;
  }

  .homelab-map__wires .wire {
    stroke-dasharray: 6 10;
    animation: wireDash 3.2s linear infinite;
  }

  @keyframes wireDash {
    to {
      stroke-dashoffset: -64;
    }
  }

  .journey-hero__ctas .showcase-cta--primary {
    box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 28%, transparent);
  }

  .journey-hero__ctas .showcase-cta--primary:hover {
    transform: translateY(-2px);
  }

  .sector__intro,
  .showcase-block__copy,
  .homelab-map__panel {
    animation: softRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  @keyframes softRise {
    from {
      opacity: 0.92;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .lang-toggle {
    animation: langNudge 4.5s ease-in-out 1.2s 1;
  }

  @keyframes langNudge {
    0%,
    100% {
      box-shadow: 0 0 0 0 transparent;
    }
    20%,
    40% {
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
    }
  }

  .ha-toast.is-visible {
    animation: toastPop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }

  @keyframes toastPop {
    from {
      opacity: 0;
      transform: translate(-50%, 8px) scale(0.96);
    }
    to {
      opacity: 1;
      transform: translate(-50%, 0) scale(1);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .lang-toggle,
  .sector__intro,
  .showcase-block__copy,
  .homelab-map__panel,
  .nav-drawer:not([hidden]),
  .homelab-map__wires .wire,
  .ha-card.is-on .ha-card__icon {
    animation: none !important;
  }
}


/* ===== Bazil-inspired visible motion ===== */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  /* CTA / buttons: lift claro */
  .showcase-cta,
  .pill-btn,
  .btn-primary,
  .btn-ghost,
  .contact-compose__submit,
  .recruiter-bar__item {
    transition:
      transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      background 0.2s,
      border-color 0.2s,
      color 0.2s;
  }

  .showcase-cta:hover,
  .pill-btn:hover,
  .btn-primary:hover,
  .contact-compose__submit:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  }

  .showcase-cta--primary:hover,
  .btn-primary:hover,
  .contact-compose__submit:hover {
    box-shadow: 0 14px 32px color-mix(in srgb, var(--accent, #c4f542) 35%, transparent);
  }

  /* Imágenes showcase: zoom al hover (se nota) */
  .showcase-visual__frame,
  .showcase-visual__thumb {
    overflow: hidden;
  }

  .showcase-visual__img,
  .showcase-visual__thumb img,
  .showcase-visual__frame img {
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
    transform: scale(1);
  }

  .showcase-visual__frame:hover .showcase-visual__img,
  .showcase-visual__frame:hover img,
  .showcase-visual__thumb:hover img {
    transform: scale(1.06);
    filter: brightness(1.06);
  }

  /* Facts del hero: entrada escalonada */
  .journey-hero__facts li {
    opacity: 0;
    transform: translateY(14px);
    animation: bazilFactIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  .journey-hero__facts li:nth-child(1) { animation-delay: 0.15s; }
  .journey-hero__facts li:nth-child(2) { animation-delay: 0.28s; }
  .journey-hero__facts li:nth-child(3) { animation-delay: 0.41s; }
  .journey-hero__facts li:nth-child(4) { animation-delay: 0.54s; }

  @keyframes bazilFactIn {
    to { opacity: 1; transform: translateY(0); }
  }

  /* Soft-in blocks (motion.js) */
  .sector__intro,
  .showcase-block,
  .homelab-map,
  .ha-sim-stage {
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .sector__intro:not(.is-soft-in),
  .showcase-block:not(.is-soft-in),
  .homelab-map:not(.is-soft-in),
  .ha-sim-stage:not(.is-soft-in) {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
  }
  .sector__intro.is-soft-in,
  .showcase-block.is-soft-in,
  .homelab-map.is-soft-in,
  .ha-sim-stage.is-soft-in {
    opacity: 1;
    transform: none;
  }
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .journey-hero__facts li {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .sector__intro,
  .showcase-block,
  .homelab-map,
  .ha-sim-stage {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== Bazil-inspired #1: custom cursor (v40 visible) ===== */
@media (hover: hover) and (pointer: fine) {
  html.has-bazil-cursor,
  html.has-bazil-cursor * {
    cursor: none !important;
  }

  .bazil-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 2147483000;
  }

  .bazil-cursor__dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    border: 2px solid #c4f542;
    background: rgba(196, 245, 66, 0.35);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 18px rgba(196, 245, 66, 0.45);
    transform: translate3d(-120px, -120px, 0);
    opacity: 0;
    transition:
      width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      margin 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      background 0.28s,
      border-width 0.28s,
      opacity 0.15s;
    will-change: transform;
  }

  html.has-bazil-cursor .bazil-cursor__dot.is-on {
    opacity: 1;
  }

  .bazil-cursor.is-hover .bazil-cursor__dot {
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    background: rgba(196, 245, 66, 0.12);
    border-width: 2.5px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 28px rgba(196, 245, 66, 0.55);
  }

  .bazil-cursor.is-press .bazil-cursor__dot {
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    background: rgba(196, 245, 66, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.has-bazil-cursor,
  html.has-bazil-cursor * {
    cursor: auto !important;
  }
  .bazil-cursor { display: none !important; }
}
