/* Motion is progressive enhancement. Content stays visible without this layer. */
.hero-flow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: .65;
}
.craft-label > .craft-default, .craft-label > .motion-hint { font-size: inherit; color: inherit; }
.craft-label > span:first-child { font-size: 1.15rem; line-height: 1; }
.motion-hint { display: none; }
@media (hover: hover) and (pointer: fine) {
  [data-motion='on'] .craft-default { display: none; }
  [data-motion='on'] .motion-hint { display: inline; }
}

.motion-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #c6dadd;
  border-radius: 5px;
  background: #ffffff70;
  color: #42666e;
  font-size: .8125rem;
  line-height: 1.4;
  white-space: nowrap;
}
.motion-toggle:hover { background: white; border-color: #89b3b8; }
.motion-toggle:disabled { cursor: default; opacity: 1; }
.motion-toggle-icon { display: inline-block; width: 12px; height: 12px; position: relative; }
.motion-toggle-icon::before, .motion-toggle-icon::after {
  content: '';
  position: absolute;
  top: 0;
  width: 3px;
  height: 12px;
  border-radius: 1px;
  background: currentColor;
}
.motion-toggle-icon::before { left: 1px; }
.motion-toggle-icon::after { right: 1px; }
[data-motion='off'] .motion-toggle-icon::before {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
  background: none;
}
[data-motion='off'] .motion-toggle-icon::after { display: none; }
.motion-toggle:disabled .motion-toggle-icon::before { width: 10px; height: 2px; top: 5px; border: 0; background: currentColor; }
.motion-toggle:disabled .motion-toggle-icon::after { display: none; }

.scroll-progress { position: absolute; height: 2px; bottom: -1px; inset-inline: 0; overflow: hidden; pointer-events: none; }
.scroll-progress > span { display: block; height: 100%; background: linear-gradient(90deg, #00c3c0, #00a0d6); transform: scaleX(0); transform-origin: left center; }

[data-motion='on'] .hero-art .showcase-main,
[data-motion='on'] .hero-art .showcase-photo,
[data-motion='on'] .hero-art .code-card {
  backface-visibility: hidden;
  transition: transform .3s ease-out, box-shadow .3s ease-out;
  animation: chase-float 7s ease-in-out infinite;
}
[data-motion='on'] .hero-art .showcase-main,
[data-motion='on'] .hero-art .showcase-main:hover {
  transform: perspective(900px) rotateX(var(--motion-rx, 0deg)) rotateY(var(--motion-ry, 0deg)) rotate(-5deg);
}
[data-motion='on'] .hero-art .showcase-photo {
  transform: perspective(900px) rotateX(var(--motion-rx, 0deg)) rotateY(var(--motion-ry, 0deg)) rotate(7deg);
  animation-duration: 6s;
  animation-delay: -2s;
}
[data-motion='on'] .hero-art .code-card {
  transform: perspective(900px) rotateX(var(--motion-rx, 0deg)) rotateY(var(--motion-ry, 0deg)) rotate(4deg);
  animation-duration: 8s;
  animation-delay: -4s;
}
[data-motion='on'] .art-cross { animation: chase-turn 32s linear infinite; }
[data-motion='on'] .orbit-one { animation: chase-orbit 24s linear infinite; }
[data-motion='on'] .orbit-one::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  top: -4px;
  left: calc(50% - 3px);
  background: #00a7ac;
  box-shadow: 0 0 0 5px #00a7ac12;
}
[data-motion='on'] .code-dot { animation: chase-glow 3.6s ease-in-out infinite; }
[data-motion='on'] .small-spark { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
[data-motion='on'] .button:hover .small-spark,
[data-motion='on'] .button:focus-visible .small-spark { transform: rotate(90deg); }
[data-motion='on'] .service-icon svg,
[data-motion='on'] .process-symbol { transition: transform .45s cubic-bezier(.2,.8,.2,1), color .3s; }
[data-motion='on'] .service-card:hover .service-icon svg,
[data-motion='on'] .service-card:focus-within .service-icon svg { transform: translateY(-4px) rotate(-6deg); color: #007f85; }
[data-motion='on'] .process-grid article:hover .process-symbol { transform: rotate(12deg) scale(1.08); }
[data-motion='on'] .project-view { transition: translate .35s ease, box-shadow .35s ease; }
[data-motion='on'] .project-image:hover .project-view,
[data-motion='on'] .project-image:focus-visible .project-view { translate: 0 -4px; box-shadow: 0 6px 15px #112e3610; }

/* Stop offscreen work and hidden-tab motion. JS also suspends the canvas loop. */
[data-hero-active='false'] .hero-art *,
[data-page-hidden='true'] .hero-art * { animation-play-state: paused !important; }
[data-motion='off'] *, [data-motion='off'] *::before, [data-motion='off'] *::after {
  animation: none !important;
  transition: none !important;
}
html[data-motion='off'] { scroll-behavior: auto; }
[data-motion='off'] .hero-art .showcase-main,
[data-motion='off'] .hero-art .showcase-photo,
[data-motion='off'] .hero-art .code-card { translate: none; }

@keyframes chase-float {
  0%, 100% { translate: var(--motion-x, 0px) var(--motion-y, 0px); }
  50% { translate: var(--motion-x, 0px) calc(var(--motion-y, 0px) - 9px); }
}
@keyframes chase-turn { from { transform: rotate(12deg); } to { transform: rotate(372deg); } }
@keyframes chase-orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes chase-glow { 0%, 100% { box-shadow: 0 0 0 0 #00c3c000; } 50% { box-shadow: 0 0 0 4px #00c3c020; } }

@media (max-width: 960px) {
  .hero-bottom { flex-wrap: wrap; gap: 13px 20px; padding-top: 18px; padding-bottom: 18px; }
  .hero-bottom > a { margin-left: auto; }
}
@media (max-width: 760px) {
  .hero-flow { opacity: .5; }
  .hero-bottom > a { width: auto; margin: 0; }
  .motion-toggle { font-size: .8125rem; min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-flow { opacity: .35; }
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
