.map-gesture { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; border-radius: inherit; container-type: inline-size; }
.gesture-guide {
  position: absolute; inset: auto 3% 5%; display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  --drag-middle: -22px; --drag-end: -48px;
}
.gesture-guide svg { display: block; flex: 0 1 202px; min-width: 0; width: 202px; height: auto; overflow: visible; filter: drop-shadow(0 2px 3px #0c211a88); }
.gesture-guide span {
  flex: none; padding: 3px 9px; border-radius: 12px; border: 1px solid #d9f3e478;
  background: #152e28e8; color: #f3fcf6; font: 600 clamp(11px,.92vw,13px)/1.45 var(--sans);
  white-space: nowrap; box-shadow: 0 1px 4px #13231c38;
}
.contact-ring { fill: #b3ead44d; stroke: #2b7569; stroke-width: 1.6; transform-box: fill-box; transform-origin: center; }
.drag-trail { fill: none; stroke: #2a8174; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 1; }
.drag-hand { fill: #f3fff5; fill-opacity: .83; stroke: #204f44; stroke-width: 1.45; stroke-linejoin: round; stroke-linecap: round; }
.drag-hand path { transform: scale(1.5); }

@container (max-width: 245px) {
  .gesture-guide { inset: 0; display: block; --drag-middle: -12px; --drag-end: -26px; }
  .gesture-guide svg { position: absolute; left: -14%; bottom: 0; width: 70%; height: 96%; }
  .gesture-guide span { position: absolute; right: 3%; bottom: 5%; max-width: min(66px, 39%); padding: 3px 5px; text-align: center; text-wrap: balance; white-space: normal; line-height: 1.2; }
  .drag-hand path { transform: scale(1.7); }
  .drag-trail { transform-origin: 82px 22px; transform: scaleX(.54); }
}

@media screen and (prefers-reduced-motion: no-preference) {
  [data-reveal] { --reveal-travel: 48px; }
  [data-reveal="detail"] { --reveal-delay: 100ms; }
  [data-reveal-state="waiting"] { opacity: 0; }
  [data-reveal-state="entering"] { animation: section-enter 1.1s cubic-bezier(.22,.52,.27,1) var(--reveal-delay,0s) both; }
  @keyframes section-enter { from { opacity: 0; transform: translateY(var(--reveal-travel)); } to { opacity: 1; transform: translateY(0); } }
  .map-gesture { --gesture-period: 3.6s; animation: map-rim 1.45s ease-out both; }
  @keyframes map-rim { 0%,100% { box-shadow: inset 0 0 0 1px transparent; } 32% { box-shadow: inset 0 0 0 2px #69bba7c9, inset 0 0 14px #9ce0c03d; } }
  .contact-ring { animation: finger-contact var(--gesture-period) ease infinite; }
  .drag-trail { animation: finger-trail var(--gesture-period) ease infinite; }
  .drag-hand { animation: finger-drag var(--gesture-period) cubic-bezier(.36,.08,.28,1) infinite; }
  @keyframes finger-contact {
    0%,12% { opacity: 0; transform: scale(.55); } 24% { opacity: 1; transform: scale(.92); } 44%,100% { opacity: 0; transform: scale(1.5); }
  }
  @keyframes finger-trail {
    0%,24% { stroke-dashoffset: 1; opacity: .8; } 67% { stroke-dashoffset: 0; opacity: .82; } 85%,100% { stroke-dashoffset: 0; opacity: 0; }
  }
  @keyframes finger-drag {
    0%,100% { transform: translate(2px,-6px) rotate(-5deg); opacity: .85; }
    19%,26% { transform: translate(0,0) rotate(-7deg) scale(.94); opacity: 1; }
    47% { transform: translate(var(--drag-middle),-5px) rotate(-10deg) scale(.94); }
    68%,75% { transform: translate(var(--drag-end),-2px) rotate(-13deg) scale(.94); opacity: 1; }
    86% { transform: translate(var(--drag-end),-7px) rotate(-9deg); opacity: 0; }
    88% { transform: translate(2px,-7px) rotate(-5deg); opacity: 0; }
  }
}
@media screen and (max-width: 760px) { [data-reveal] { --reveal-travel: 32px; } }
