/* ==========================================================================
   Hero Avatar Component & Visual Scene — SVG + CSS Animado (v2)
   1. Componente reutilizable del personaje (.avatar-viewport / #character-svg)
   2. Escena visual del Hero (.hero-scene: fondo orgánico, decorativos y globo)
   ========================================================================== */

.avatar-viewport {
  /* Paleta Base del Avatar (Rasgos anatómicos intactos) */
  --skin-base: #dfa882;
  --skin-mid-shadow: #c58860;
  --skin-deep-shadow: #9e633f;
  --skin-highlight: #f0c8aa;
  --skin-line: #945b39;

  /* Cabello Castaño */
  --hair-base: #453022;
  --hair-front: #543b2b;
  --hair-dark: #2d1e15;
  --hair-highlight: #755540;

  /* Vello Facial: Ligero, translúcido y unificado */
  --beard-jaw: rgb(58 39 28 / 0.42);
  --beard-dense: rgb(58 39 28 / 0.5);
  --beard-mustache: rgb(58 39 28 / 0.46);

  /* Remera informal de cuello circular en blanco cálido */
  --shirt-base: #f4f2ed;
  --shirt-highlight: #ffffff;
  --shirt-shadow: #d9dce0;
  --shirt-collar: #e6e8ec;
  --shirt-deep-shadow: #bcc3ca;
  --shirt-crease: #aeb7bf;

  /* Escenario integrado transparentemente */
  --halo-outer: transparent;
  --halo-inner: transparent;

  /* Seguimiento ocular/cabeza 2.5D */
  --look-x: 0;
  --look-y: 0;

  position: relative;
  inline-size: 100%;
  max-inline-size: 35rem;
  aspect-ratio: 600 / 680;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  user-select: none;
  touch-action: pan-y;
  cursor: pointer;
  margin-bottom: 0;
}

.avatar-viewport:focus-visible {
  outline: 2.5px solid var(--blue-800, #1e3a6d);
  outline-offset: 4px;
  border-radius: 24px;
}

.avatar-svg {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  overflow: visible;
  margin-bottom: 0;
}

/* =====================================================
   ACABADO V2 SEMI-REALISTA vs V1 FLAT
   ===================================================== */
.bg-halo { fill: var(--halo-outer); }
.bg-halo-inner { fill: var(--halo-inner); }

.skin-face { fill: url(#skin-face-grad); }
.skin-neck { fill: url(#skin-neck-grad); }
.skin-limb { fill: url(#skin-limb-grad); }
.skin-mid-shadow { fill: var(--skin-mid-shadow); stroke: var(--skin-mid-shadow); }
.skin-deep-shadow { fill: var(--skin-deep-shadow); stroke: var(--skin-deep-shadow); }
.skin-line { stroke: var(--skin-line); }

.shirt-torso,
.shirt-limb {
  fill: url(#shirt-vol-grad);
  transition: fill 0.25s ease;
}
.shirt-shadow { fill: var(--shirt-shadow); transition: fill 0.25s ease; }
.shirt-collar { fill: var(--shirt-collar); stroke: var(--shirt-crease); stroke-width: 1.1; transition: fill 0.25s ease, stroke 0.25s ease; }
.shirt-outline { stroke: var(--shirt-crease); stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; opacity: 0.72; }
.shirt-crease { stroke: var(--shirt-deep-shadow); transition: stroke 0.25s ease; }

.hair-vol { fill: url(#hair-vol-grad); }
.hair-front-waves { fill: var(--hair-front); }
.hair-dark { fill: var(--hair-dark); }

.beard-jaw-layer { fill: url(#beard-soft-grad); }
.beard-goatee-dense { fill: var(--beard-dense); }
.beard-mustache { fill: var(--beard-mustache); }

/* Modo Flat (Activo por defecto en el avatar) */
.avatar-viewport[data-render-mode="flat"] {
  & .skin-face,
  & .skin-neck,
  & .skin-limb {
    fill: var(--skin-base);
  }

  & .shirt-torso,
  & .shirt-limb {
    fill: var(--shirt-base);
  }

  & .hair-vol {
    fill: var(--hair-base);
  }

  & .beard-jaw-layer {
    fill: var(--beard-jaw);
  }

  & .semi-real-only {
    opacity: 0;
  }
}

/* =====================================================
   DETALLES FLAT: sombras, vello y pliegues suavizados
   ===================================================== */
.neck-shadow { opacity: 0.2; stroke: none; }
.face-shadow { opacity: 0.12; stroke: none; }
.rig-nose > .skin-mid-shadow { opacity: 0.3; stroke: none; }
.rig-nose ellipse { opacity: 0.5; }
.rig-eyes .skin-mid-shadow { opacity: 0.2; stroke: none; }
.rig-eyes path[stroke="#8c583a"] { opacity: 0.3; stroke-width: 1.1; }
.rig-eyes path[stroke="#241811"] { stroke-width: 1.6; }
.brow-left > path,
.brow-right > path { opacity: 0.75; }
.beard-jaw-layer { opacity: 0.8; }
.beard-goatee-dense { opacity: 0.3; }
.beard-mustache { opacity: 0.8; }
.beard-strands { opacity: 0.45; }
.shirt-crease { opacity: 0.52; stroke-width: 1.25; }
/* Sombra textil suave de la remera blanco cálido */
.shirt-shadow { opacity: 0.58; }
.joint-shoulder-left > .shirt-crease,
.joint-shoulder-right > .shirt-crease { opacity: 0.45; }
.joint-elbow-left > .skin-mid-shadow,
.joint-elbow-right > .skin-mid-shadow { opacity: 0.14; stroke: none; }

/* =====================================================
   RIG: articulaciones con coordenadas exactas del viewBox (600x680)
   ===================================================== */
.joint-shoulder-left {
  transform-box: view-box;
  transform-origin: 202px 424px;
  rotate: 0deg;
}

.joint-elbow-left {
  transform-box: view-box;
  transform-origin: 180px 524px;
  rotate: 0deg;
}

.joint-wrist-left {
  transform-box: view-box;
  transform-origin: 188px 612px;
}

.joint-shoulder-right {
  transform-box: view-box;
  transform-origin: 398px 424px;
  rotate: 0deg;
  translate: 0 0;
}

.joint-elbow-right {
  transform-box: view-box;
  transform-origin: 420px 524px;
  rotate: 0deg;
}

.joint-wrist-right {
  transform-box: view-box;
  transform-origin: 412px 612px;
  rotate: 0deg;
}

.hand-open {
  opacity: 1;
}

.hand-wave {
  opacity: 0;
}

/* =====================================================
   RIG: cuerpo, cabeza y rostro
   ===================================================== */
.rig-body-group,
.rig-torso,
.rig-head,
.rig-ears,
.rig-pupil,
.rig-brows,
.brow-left,
.brow-right,
.eyelid-hood,
.eyelid-smile-lower,
.smile-line,
.rig-mouth {
  transform-box: fill-box;
  transform-origin: center;
}

.rig-body-group {
  transform-box: view-box;
  transform-origin: 300px 660px;
  rotate: -0.6deg;
  animation: settled-breath 5.6s ease-in-out infinite;
}

.rig-head {
  transform-box: view-box;
  transform-origin: 300px 335px;
  translate: var(--head-dx, 0px) var(--head-dy, 0px);
  rotate: calc(0.6deg + var(--look-x) * 0.45deg);
  transition: rotate 0.65s ease, translate 0.65s ease;
  animation: head-follow 5.6s ease-in-out 0.35s infinite;
}

.rig-ears {
  translate: 0 0;
}

.rig-pupil {
  translate: calc(var(--look-x) * 7px) calc(var(--look-y) * 4px);
  transition: translate 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.rig-brows {
  translate: calc(var(--look-x) * 1px) calc(var(--look-y) * 0.8px);
  transition: translate 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.brow-left,
.brow-right {
  transition: translate 0.28s ease, rotate 0.28s ease;
}

.eyelid-hood {
  transform-origin: top center;
  animation: natural-blink 4.6s ease-in-out infinite;
}

.eyelid-smile-lower {
  translate: 0 7px;
  transition: translate 0.28s ease;
}

.smile-line {
  opacity: 0.1;
  stroke-width: 1.1;
  transition: opacity 0.28s ease;
}

.mouth-shape {
  opacity: 0;
  transition: opacity 0.22s ease;
}

.mouth-smile {
  transform-box: fill-box;
  transform-origin: 50% 18%;
}

.cheek-blush {
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.bg-halo,
.bg-halo-inner {
  transform-box: fill-box;
  transform-origin: center;
  animation: halo-breathe 7s ease-in-out infinite;
}

.bg-halo-inner { animation-delay: -2.3s; }

/* =====================================================
   ESTADOS DEL AVATAR (el JS solo cambia data-state)
   ===================================================== */

/* 1. Reposo */
.avatar-viewport[data-state="idle"] .mouth-idle {
  opacity: 1;
}

/* 2. Sonriendo */
.avatar-viewport[data-state="smiling"] {
  & .mouth-smile { opacity: 1; }
  & .eyelid-smile-lower { translate: 0 1.5px; }
  & .brow-left { translate: 0 -2px; rotate: -2deg; }
  & .brow-right { translate: 0 -2px; rotate: 2deg; }
  & .rig-head { rotate: 1.5deg; }
}

/* 3. Pensando */
.avatar-viewport[data-state="thinking"] {
  --head-dx: 1px;
  --head-dy: 2px;

  & .mouth-think { opacity: 1; }
  & .rig-head { rotate: -3.5deg; }
  & .rig-pupil { translate: 2.2px -1.6px; }
  & .brow-left { translate: 0 1px; rotate: 2deg; }
  & .brow-right { translate: 0 -3.5px; rotate: 3.5deg; }
}

/* 4. Saludando (coreografía continua de 3.6s con velocidad suave por tramo) */
.avatar-viewport[data-state="greeting"] {
  & .mouth-smile {
    opacity: 1;
    animation: mouth-talk 0.95s ease-in-out 0.45s 3;
  }
  & .eyelid-smile-lower { translate: 0 1.8px; }
  & .brow-left,
  & .brow-right { translate: 0 -2.5px; }
  & .joint-shoulder-right { animation: greet-shoulder 3.6s ease-in-out forwards; }
  & .joint-elbow-right { animation: greet-elbow 3.6s ease-in-out forwards; }
  & .joint-wrist-right { animation: greet-wrist 3.6s ease-in-out forwards; }
  & .hand-open { animation: greet-hand-open 3.6s ease-in-out forwards; }
  & .hand-wave { animation: greet-hand-wave 3.6s ease-in-out forwards; }
  & .rig-head { rotate: -1.2deg; }
}

.avatar-viewport:is([data-state="smiling"], [data-state="greeting"]) {
  & .smile-line { opacity: 0.22; }
  & .cheek-blush { opacity: 0.22; }
}

/* =====================================================
   PAUSA EXPLÍCITA DEL USUARIO
   ===================================================== */
.avatar-viewport[data-motion-paused="true"] * {
  animation-play-state: paused !important;
  transition: none !important;
}

/* =====================================================
   KEYFRAMES DEL AVATAR
   ===================================================== */
@keyframes settled-breath {
  0%, 100% { translate: 0 0; scale: 1 1; }
  45% { translate: 0 -1.5px; scale: 1.003 1.003; }
}

@keyframes head-follow {
  0%, 100% { translate: var(--head-dx, 0px) var(--head-dy, 0px); }
  45% { translate: var(--head-dx, 0px) calc(var(--head-dy, 0px) - 2.2px); }
}

@keyframes halo-breathe {
  0%, 100% { scale: 1; }
  50% { scale: 1.03; }
}

@keyframes natural-blink {
  0%, 44%, 48%, 94%, 98%, 100% {
    scale: 1 1;
  }
  46%, 96% {
    scale: 1 2.4;
  }
}

@keyframes mouth-talk {
  0%, 100% { scale: 1 1; }
  18% { scale: 1.02 0.7; }
  36% { scale: 1 1.05; }
  55% { scale: 1.03 0.82; }
  75% { scale: 1 0.62; }
}

@keyframes greet-shoulder {
  0% { rotate: 0deg; animation-timing-function: cubic-bezier(0.38, 0, 0.22, 1); }
  21% { rotate: -14deg; animation-timing-function: ease-in-out; }
  38% { rotate: -15deg; animation-timing-function: ease-in-out; }
  56% { rotate: -13.8deg; animation-timing-function: ease-in-out; }
  74% { rotate: -14deg; animation-timing-function: cubic-bezier(0.4, 0, 0.22, 1); }
  100% { rotate: 0deg; }
}

@keyframes greet-elbow {
  0% { rotate: 0deg; animation-timing-function: cubic-bezier(0.36, 0, 0.2, 1); }
  20% { rotate: -145deg; animation-timing-function: ease-in-out; }
  34% { rotate: -150deg; animation-timing-function: ease-in-out; }
  48% { rotate: -142deg; animation-timing-function: ease-in-out; }
  62% { rotate: -149deg; animation-timing-function: ease-in-out; }
  74% { rotate: -145deg; animation-timing-function: cubic-bezier(0.42, 0, 0.22, 1); }
  100% { rotate: 0deg; }
}

@keyframes greet-wrist {
  0% { rotate: 0deg; animation-timing-function: ease-out; }
  9% { rotate: -12deg; animation-timing-function: ease-in-out; }
  20% { rotate: -3deg; animation-timing-function: ease-in-out; }
  34% { rotate: -11deg; animation-timing-function: ease-in-out; }
  48% { rotate: 9deg; animation-timing-function: ease-in-out; }
  62% { rotate: -10deg; animation-timing-function: ease-in-out; }
  74% { rotate: -2deg; animation-timing-function: ease-in-out; }
  87% { rotate: -10deg; animation-timing-function: ease-in-out; }
  100% { rotate: 0deg; }
}

@keyframes greet-hand-wave {
  0%, 3%, 92%, 100% { opacity: 0; }
  12%, 82% { opacity: 1; }
}

@keyframes greet-hand-open {
  0%, 3%, 92%, 100% { opacity: 1; }
  12%, 82% { opacity: 0; }
}

@keyframes hero-bubble-enter {
  0% {
    opacity: 0;
    translate: 0 8px;
    scale: 0.94;
  }
  100% {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
}

/* ==========================================================================
   ESCENA VISUAL DEL HERO (.hero-scene)
   Coordina las 4 capas:
   1. Fondo orgánico (.hero-scene__backdrop)
   2. Elementos tecnológicos decorativos (.hero-scene__decor)
   3. Avatar animado (.hero-scene__avatar-wrap)
   4. Globo de diálogo estable (.hero-scene__bubble)
   ========================================================================== */

.hero-scene {
  position: relative;
  inline-size: 100%;
  max-inline-size: 38rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 2rem;
  margin-bottom: 0;
}

/* Capa 1: Fondo orgánico arena/dorado suave */
.hero-scene__backdrop {
  position: absolute;
  inset: 0 -4% 0 -4%;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.hero-scene__backdrop-svg {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: bottom center;
}

/* Capa 2: Elementos tecnológicos decorativos */
.hero-scene__decor {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Capa 3: Contenedor del Avatar (anclado al límite inferior sin margen transparente) */
.hero-scene__avatar-wrap {
  position: relative;
  z-index: 3;
  inline-size: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0;
}

/* Escala aumentada (~28% más presencia visual que el contenedor original)
   y apoyo exacto de la camisa sobre el borde inferior del Hero (2.941% * 1.18 = 3.47%). */
.hero-scene__avatar-wrap .avatar-viewport {
  inline-size: 118%;
  max-inline-size: none;
  flex: 0 0 auto;
  margin-top: -15%;
  margin-bottom: -3.47%;
  translate: -3.5% 0;
}

/* Capa 4: Globo de diálogo estable asociado al saludo */
.hero-scene__bubble {
  position: absolute;
  top: 13.5%;
  left: 54.8%;
  z-index: 4;
  background: #ffffff;
  border: 1px solid rgba(227, 199, 154, 0.72);
  border-radius: 16px;
  padding: 0.62rem 1.05rem;
  box-shadow: 0 12px 28px rgba(19, 42, 79, 0.09);
  pointer-events: none;
  transform-origin: bottom left;
  opacity: 0;
  translate: 0 8px;
  scale: 0.94;
  visibility: hidden;
  transition:
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    translate 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    scale 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.32s;
}

.hero-scene__bubble.is-visible {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  visibility: visible;
}

/* Pico inferior izquierdo apuntando hacia la cabeza del avatar sin costura interna */
.hero-scene__bubble::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 16px;
  inline-size: 16px;
  block-size: 16px;
  background: #ffffff;
  border-bottom: 1px solid rgba(227, 199, 154, 0.72);
  border-left: 1px solid rgba(227, 199, 154, 0.72);
  transform: skewX(-18deg) rotate(-38deg);
  border-bottom-left-radius: 3px;
  clip-path: polygon(0 0, 0 100%, 100% 100%);
}

.hero-scene__bubble-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--blue-950, #132a4f);
  font-family: var(--font-sans, "Plus Jakarta Sans", system-ui, sans-serif);
  font-size: clamp(0.92rem, 1.15vw, 1.08rem);
  font-weight: 750;
  line-height: 1.28;
  letter-spacing: -0.015em;
  text-align: center;
  white-space: nowrap;
}

.hero-scene__bubble-text span {
  display: block;
}

/* Destellos dorados exteriores del globo */
.hero-scene__bubble-rays {
  position: absolute;
  top: -17px;
  right: -22px;
  inline-size: 25px;
  block-size: 25px;
}

/* ==========================================================================
   RESPONSIVE DESIGN DE LA ESCENA (.hero-scene)
   ========================================================================== */

/* Laptop (992px – 1199px) */
@media (max-width: 74.99rem) and (min-width: 62rem) {
  .hero-scene {
    max-inline-size: 34rem;
  }
  .hero-scene__bubble {
    top: 12.5%;
    left: 53.5%;
    padding: 0.58rem 0.98rem;
  }
}

/* Tablet (720px – 991px) */
@media (max-width: 61.99rem) and (min-width: 45rem) {
  .hero-scene {
    max-inline-size: 29rem;
    padding-top: 2.25rem;
  }
  .hero-scene__avatar-wrap .avatar-viewport {
    inline-size: 112%;
    margin-top: -12%;
    margin-bottom: -3.3%;
    translate: -2.5% 0;
  }
  .hero-scene__bubble {
    top: 11.5%;
    left: 52.5%;
    padding: 0.52rem 0.88rem;
    border-radius: 15px;
  }
  .hero-scene__bubble-text {
    font-size: 0.85rem;
  }
}

/* Mobile (< 720px / 45rem) */
@media (max-width: 44.99rem) {
  .home-hero__inner {
    gap: var(--space-2);
  }
  .home-hero__content {
    padding-bottom: 0;
  }
  .hero-scene {
    max-inline-size: 18.25rem;
    margin-inline: auto;
    padding-top: 0.25rem;
  }
  .hero-scene__avatar-wrap .avatar-viewport {
    inline-size: 107%;
    margin-top: -18.8%;
    margin-bottom: -3.15%;
    translate: -4% 0;
  }
  .hero-scene__bubble {
    top: 8.5%;
    left: 55.5%;
    right: auto;
    padding: 0.44rem 0.74rem;
    border-radius: 13px;
  }
  .hero-scene__bubble::after {
    bottom: -7px;
    left: 13px;
    inline-size: 13px;
    block-size: 13px;
  }
  .hero-scene__bubble-text {
    font-size: 0.79rem;
  }
  .hero-scene__bubble-rays {
    top: -11px;
    right: -13px;
    inline-size: 17px;
    block-size: 17px;
  }
}

@media (max-width: 23.5rem) {
  .hero-scene {
    max-inline-size: 17.5rem;
  }
  .hero-scene__bubble {
    top: 8.2%;
    left: 55%;
    padding: 0.4rem 0.68rem;
  }
  .hero-scene__bubble-text {
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   ACCESIBILIDAD: MOVIMIENTO REDUCIDO (prefers-reduced-motion: reduce)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .avatar-viewport *,
  .hero-scene__bubble {
    animation: none !important;
    transition: none !important;
  }

  .avatar-viewport[data-state="greeting"] {
    & .joint-shoulder-right { rotate: -14deg; }
    & .joint-elbow-right { rotate: -146deg; }
    & .joint-wrist-right { rotate: 0deg; }
    & .hand-open { opacity: 0; }
    & .hand-wave { opacity: 1; }
  }
}

/* Fondo B2: amplitud aprobada, sin alterar el rig ni la escala del avatar. */
.home-hero h1 {
  font-size: clamp(2rem, 3.7vw, 3.35rem);
  line-height: 1.12;
  max-width: 25ch;
}

.hero-scene__bubble {
  top: 4%;
  left: 55%;
  max-inline-size: 45%;
}

.hero-scene__bubble-text { white-space: normal; }

.home-hero__intro { color: var(--blue-700); }
.home-hero__eyebrow {
  color: var(--blue-700);
  font-size: 17.5px;
  font-weight: 400;
  line-height: 1.6;
  margin-top: 0.75rem;
  max-width: 50ch;
}
.home-hero__eyebrow strong { color: var(--color-primary); font-weight: 700; }
.home-hero .button--secondary {
  color: var(--button-secondary-text);
  border-color: var(--gold-500);
  background: rgba(255, 255, 255, 0.5);
}
.home-hero .button--secondary:hover {
  color: var(--button-secondary-text);
  border-color: var(--gold-700);
  background: var(--color-surface);
}
@media (min-width: 45rem) {
  .home-hero__content {
    align-self: center;
    padding-block: var(--space-8);
    /* Equilibra también los 24px de padding superior del Hero. */
    translate: 0 -0.75rem;
  }
  .home-hero__inner {
    gap: var(--space-4);
    grid-template-columns: minmax(0, 1.12fr) minmax(20rem, 1fr);
  }
}

@media (min-width: 70rem) {
  .home-hero h1 {
    font-size: clamp(2.5rem, 3.1vw, 2.85rem);
    line-height: 1.16;
    max-width: 27ch;
  }
  /* Compensa el espacio transparente superior del SVG sin alterar el rig. */
  .home-hero__visual-slot { margin-top: -3rem; }
  .hero-scene__bubble { top: 8.5%; left: 62%; max-inline-size: 38%; }
}

.home-hero__content > .cluster { margin-top: 0.75rem; }

@media (max-width: 44.99rem) {
  .hero-scene { padding-top: 2rem; }
  .hero-scene__bubble { top: 0; }
}

@media (min-width: 62rem) and (max-width: 69.99rem) {
  .home-hero__visual-slot { margin-top: -1.5rem; }
  .hero-scene__bubble { top: 6%; left: 62%; max-inline-size: 38%; }
}

.hero-flow {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  overflow: visible;
}

.hero-flow--mobile { display: none; }

.hero-flow__ribbons,
.hero-flow__node,
.hero-flow__signal {
  animation-play-state: paused;
}

/* La geometría de filamentos, señales y nodos se ondula de forma conjunta
   mediante hero-flow.js; no se superpone una traslación independiente. */

.hero-flow__node {
  animation: hero-flow-sample 8s ease-in-out infinite paused;
}

.hero-flow__node:nth-of-type(even) { animation-delay: -4s; }

/* Muestras que recorren dos curvas existentes: el flujo se percibe sin
   desplazar toda la ilustración ni incorporar un segundo lenguaje gráfico. */
.hero-flow__signal {
  opacity: 0;
  animation: hero-flow-travel 8s linear infinite paused;
}

.hero-scene[data-flow-running] .hero-flow__signal { opacity: 0.65; }

/* Fondo continuo durante el saludo; respeta pausa manual y visibilidad. */
.hero-scene[data-flow-running="true"]:not(:has(.avatar-viewport[data-motion-paused="true"])) :is(.hero-flow__ribbons, .hero-flow__node, .hero-flow__signal) {
  animation-play-state: running;
}

.hero-flow-toggle {
  position: absolute;
  z-index: 5;
  right: 16%;
  bottom: 0.5rem;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-background);
  color: var(--color-primary);
  cursor: pointer;
}

.hero-flow-toggle::before {
  content: attr(aria-label);
  position: absolute;
  right: calc(100% + 0.5rem);
  padding: 0.4rem 0.6rem;
  inline-size: max-content;
  max-inline-size: 11rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-background);
  color: var(--color-primary);
  font: 0.75rem/1.4 var(--font-sans);
  text-align: center;
  opacity: 0;
  pointer-events: none;
}
.hero-flow-toggle:is(:focus-visible, :hover)::before { opacity: 1; }

.hero-flow-toggle[hidden],
.hero-flow-toggle__play { display: none; }
.hero-flow-toggle[aria-pressed="true"] .hero-flow-toggle__pause { display: none; }
.hero-flow-toggle[aria-pressed="true"] .hero-flow-toggle__play { display: block; }

@keyframes hero-flow-sample {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.95; }
}

@keyframes hero-flow-travel {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -192; }
}

@media (max-width: 44.99rem) {
  .hero-flow--desktop { display: none; }
  .hero-flow--mobile { display: block; }
  /* Ondulación de menor amplitud en JS y recorrido más lento en móvil. */
  .hero-flow--mobile .hero-flow__signal { animation-duration: 12s; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-flow__ribbons,
  .hero-flow__node,
  .hero-flow__signal { animation: none !important; }
  .hero-scene .hero-flow__signal { display: none; }
  .hero-flow-toggle { display: none; }
}
