/* 3D Klik characters (Ville 24.11.2026): a chrome Klik cursor floats in the hero and a melted smiley sits by the
   USP statement. Renders: tyokalut/3d-hahmot/renderoi.py. Decorative only, so hidden from assistive tech. */
.opening, .agency-intro {position: relative;}
.agency-intro {overflow: clip;}
.hahmo-3d {position: absolute; z-index: 1; height: auto; pointer-events: none; user-select: none;}
.opening .hahmo-3d {
  /* Ville 24.11.2026: centred in the hero's lower-right quadrant (75 % across, 75 % down). */
  /* Size as approved earlier (46vw); the centre moves only as far from 75 % as needed to stay inside the hero. */
  --koko: clamp(240px, 46vw, 820px);
  left: calc(min(75%, 100% - var(--koko) / 2) - var(--koko) / 2);
  top: calc(min(75%, 100% - var(--koko) / 2) - var(--koko) / 2 - 7.5%); right: auto;  /* Ville: raise 5-10 % */
  width: var(--koko);
  animation: hahmo-leijuu 7s cubic-bezier(.45, 0, .55, 1) infinite;
}
.agency-intro img.hahmo-3d {
  display: block; right: calc(-1 * clamp(20px, 3vw, 60px)); bottom: calc(-1 * clamp(20px, 4vw, 70px));
  width: clamp(130px, 17vw, 300px); max-width: none;
  animation: hahmo-keinuu 9s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes hahmo-leijuu {
  0%, 100% {transform: translate3d(0, 0, 0) rotate(0deg);}
  50% {transform: translate3d(-6px, -18px, 0) rotate(-5deg);}
}
@keyframes hahmo-keinuu {
  0%, 100% {transform: translate3d(0, 0, 0) rotate(-4deg);}
  50% {transform: translate3d(0, 12px, 0) rotate(5deg);}
}
@media (max-width: 700px) {
  .opening .hahmo-3d {top: auto; left: auto; bottom: clamp(52px, 7svh, 84px); right: -10px; width: 215px;}
  .agency-intro img.hahmo-3d {bottom: -30px; right: -24px; width: 124px;}
}
@media (prefers-reduced-motion: reduce) {.hahmo-3d {animation: none;}}
/* Live 3D cursor (vaikutus/kursori-3d.js) takes the still's place once WebGL has drawn it. */
.opening .hahmo-3d-canvas {aspect-ratio: 1; height: auto; animation: none; z-index: 0;} /* stickers (z 1) stay above until they merge in */
.opening img.hahmo-3d-korvattu {display: none;}
@media (max-width: 700px) {.opening {overflow-x: clip;}}  /* the 3D cursor reaches 10px past the edge */
/* The still waits while the live 3D cursor loads (Ville 30.11.2026: "kun etusivun lataa edessä käy hetken isompi
   huonolaatuisempi kursori"). It appears only if the 3D has not replaced it within 4 s, e.g. without WebGL. */
@media (prefers-reduced-motion: no-preference) {
  .opening img.hahmo-3d {opacity: 0; animation: hahmo-leijuu 7s cubic-bezier(.45, 0, .55, 1) infinite, hahmo-esiin .3s 4s forwards;}
}
@keyframes hahmo-esiin {to {opacity: 1;}}
