/* Experiencia interactiva de la portada: movimiento local, breve y opcional. */
.hero-pointer-light {
  position: absolute;
  z-index: 0;
  top: var(--cursor-y, 42%);
  left: var(--cursor-x, 50%);
  width: clamp(170px, 20vw, 250px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 202, 0, .12), rgba(255, 202, 0, .045) 38%, transparent 72%);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity .28s ease;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hero.has-pointer .hero-pointer-light { opacity: 1; }

  .hero-art {
    z-index: 1;
    transform-style: preserve-3d;
  }

  .art-window {
    transform: rotateY(calc(-7deg + var(--tilt-y, 0deg)))
      rotateX(calc(2deg + var(--tilt-x, 0deg)))
      translate3d(var(--window-x, 0px), var(--window-y, 0px), 0);
    transition: transform .48s cubic-bezier(.2, .7, .25, 1);
  }

  .floating-note {
    transform: translate3d(var(--note-x, 0px), var(--note-y, 0px), 0);
    transition: transform .56s cubic-bezier(.2, .7, .25, 1);
  }

  .orbit-one {
    transform: translate3d(var(--orbit-one-x, 0px), var(--orbit-one-y, 0px), 0) scaleY(.65) rotate(-25deg);
    transition: transform .65s cubic-bezier(.2, .7, .25, 1);
  }

  .orbit-two {
    transform: translate3d(var(--orbit-two-x, 0px), var(--orbit-two-y, 0px), 0) scaleY(.65) rotate(27deg);
    transition: transform .72s cubic-bezier(.2, .7, .25, 1);
  }

  .service-feature {
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  }

  .service-feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 48px rgba(16, 18, 20, .13);
  }

  .feature-image::after,
  .software-art::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(ellipse 170px 150px at var(--service-x, 50%) var(--service-y, 50%), rgba(255, 202, 0, .2), transparent 72%);
    mix-blend-mode: screen;
    transition: opacity .2s ease;
  }

  .feature-image:hover::after,
  .software-art:hover::after,
  .service-feature:focus-visible .feature-image::after,
  .service-feature:focus-visible .software-art::after { opacity: .9; }

  .service-mini:hover {
    border-color: rgba(255, 202, 0, .72);
    box-shadow: 0 16px 36px rgba(16, 18, 20, .12);
  }

  .project-visual {
    transition: transform .25s ease, box-shadow .25s ease;
  }

  .project-visual::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(ellipse 230px 190px at var(--project-x, 50%) var(--project-y, 50%), rgba(255, 202, 0, .16), transparent 74%);
    transition: opacity .22s ease;
  }

  .project-visual:hover::after,
  .project-card:focus-visible .project-visual::after { opacity: 1; }

  .project-card:hover .project-visual {
    box-shadow: 0 22px 50px rgba(16, 18, 20, .16);
  }

  .project-orb {
    transition: transform .45s cubic-bezier(.2, .7, .25, 1), box-shadow .45s ease;
  }

  .project-card:hover .project-orb {
    transform: scale(1.045);
    box-shadow: 0 0 0 38px rgba(255, 255, 255, .055), 0 0 0 78px rgba(255, 255, 255, .035);
  }
}

.app-heading small,
.date-chip,
.metric-card>span,
.metric-card small,
.activity-head,
.activity-line small { font-size: 9px; }

.activity-line b { font-size: 10px; }
.flow-label { font-size: 10px; }
.flow-node small { font-size: 9px; }
.project-visit { font-size: 12px; }

.hero :is(a, button):focus-visible {
  outline-color: var(--yellow);
}

.service-feature:focus-visible,
.service-mini:focus-visible,
.project-card:focus-visible {
  outline: 3px solid #8b6c00;
  outline-offset: 4px;
}

.project-charly .project-visual img { filter: none; }

.flow-connector i { opacity: .3; }

@media (prefers-reduced-motion: no-preference) {
  .flow-section.is-inview .connector-one i {
    animation: flow-dot-forward .8s cubic-bezier(.2, .7, .25, 1) .12s both;
  }

  .flow-section.is-inview .connector-two i {
    animation: flow-dot-forward .8s cubic-bezier(.2, .7, .25, 1) .82s both;
  }

  @keyframes flow-dot-forward {
    0% { left: 15%; opacity: .25; }
    14% { opacity: 1; }
    100% { left: calc(100% - 6px); opacity: .72; }
  }
}

@media (max-width: 599px) {
  .hero-pointer-light { display: none; }

  .window-bar { font-size: 10px; }
  .app-heading small,
  .date-chip,
  .metric-card>span,
  .metric-card small,
  .activity-head,
  .activity-line small { font-size: 9px; }

  .metric-card strong { font-size: 14px; }
  .activity-line b { font-size: 10px; }
  .floating-note b { font-size: 9px; }
  .floating-note small { font-size: 9px; }
  .art-caption { font-size: 9px; }
  .flow-label { font-size: 9px; }
  .flow-node small { font-size: 9px; }
  .flow-node b { font-size: 12px; }

  .flow-connector i { left: -3px; top: -3px; }
}

@media (max-width: 390px) {
  .hero-art .app-heading small,
  .hero-art .date-chip,
  .hero-art .metric-card small,
  .hero-art .activity-head,
  .hero-art .activity-line small,
  .hero-art .floating-note small,
  .hero-art .art-caption span:last-child { display: none; }

  .hero-art .floating-note b,
  .hero-art .art-caption { font-size: 10px; }
}

@media (max-width: 599px) and (prefers-reduced-motion: no-preference) {
  .flow-section.is-inview .connector-one i {
    animation-name: flow-dot-down;
  }

  .flow-section.is-inview .connector-two i {
    animation-name: flow-dot-down;
  }

  @keyframes flow-dot-down {
    0% { top: -3px; opacity: .25; }
    14% { opacity: 1; }
    100% { top: calc(100% - 3px); opacity: .72; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-pointer-light { display: none; }
  .flow-connector i { animation: none !important; opacity: .55; }
}
