/* Kame family motion. Quiet, one-time, and only when the visitor hasn't asked for reduced motion.
   Without JS (no .km on <html>) everything is simply visible. */
@media (prefers-reduced-motion: no-preference){
  /* 1. Hex shell assembles: centre first, then the six cells around it */
  .km .mark polygon{transform-box:fill-box;transform-origin:center}
  .km .mark.km-build polygon{animation:km-hx .55s cubic-bezier(.2,.9,.25,1.25) both}
  .km .mark.km-build polygon:nth-child(1){animation-delay:.05s}
  .km .mark.km-build polygon:nth-child(2){animation-delay:.18s}
  .km .mark.km-build polygon:nth-child(3){animation-delay:.24s}
  .km .mark.km-build polygon:nth-child(4){animation-delay:.30s}
  .km .mark.km-build polygon:nth-child(5){animation-delay:.36s}
  .km .mark.km-build polygon:nth-child(6){animation-delay:.42s}
  .km .mark.km-build polygon:nth-child(7){animation-delay:.48s}
  @keyframes km-hx{from{opacity:0;transform:scale(.2) rotate(-30deg)}}
  /* the centre cell is "the one Kame is watching": a slow, faint breath on the big mark */
  .km .intro .mark.km-build polygon:nth-child(1){animation:km-hx .55s cubic-bezier(.2,.9,.25,1.25) .05s both,km-breathe 5s ease-in-out 1.4s infinite}
  @keyframes km-breathe{50%{opacity:.55}}

  /* 1b. Every ~9 s the big logo sends a soft wave out from the centre cell */
  .km .mark.km-wave polygon{animation:km-wave .9s ease-in-out both}
  .km .mark.km-wave polygon:nth-child(1){animation-delay:0s}
  .km .mark.km-wave polygon:nth-child(2){animation-delay:.12s}
  .km .mark.km-wave polygon:nth-child(3){animation-delay:.18s}
  .km .mark.km-wave polygon:nth-child(4){animation-delay:.24s}
  .km .mark.km-wave polygon:nth-child(5){animation-delay:.30s}
  .km .mark.km-wave polygon:nth-child(6){animation-delay:.36s}
  .km .mark.km-wave polygon:nth-child(7){animation-delay:.42s}
  @keyframes km-wave{0%,100%{transform:none;opacity:1}35%{transform:scale(.72) rotate(-12deg);opacity:.7}}
  /* hovering the logo ripples the shell outward */
  .brand:hover .mark polygon,.product:hover .mark polygon{animation:km-pop .5s ease both}
  .brand:hover .mark polygon:nth-child(n+2),.product:hover .mark polygon:nth-child(n+2){animation-delay:.08s}
  @keyframes km-pop{40%{transform:scale(.82)}}

  /* 2. Sections rise gently into place as they scroll into view */
  .km .km-reveal{opacity:0;transform:translateY(16px);transition:opacity .8s cubic-bezier(.2,.7,.2,1),transform .8s cubic-bezier(.2,.7,.2,1);transition-delay:var(--km-d,0s)}
  .km .km-reveal.km-in{opacity:1;transform:none}

  /* 3. List rules draw across, one after another */
  .km .lines li{border-bottom-color:transparent;background:linear-gradient(var(--line),var(--line)) left bottom/0 1px no-repeat;transition:background-size 1s cubic-bezier(.6,0,.2,1);transition-delay:calc(.25s + var(--km-i,0) * .12s)}
  .km .km-in .lines li{background-size:100% 1px}
  .km .plain .wrap{border-top-color:transparent;background:linear-gradient(var(--line),var(--line)) left top/0 1px no-repeat;transition:background-size 1.1s cubic-bezier(.6,0,.2,1)}
  .km .plain.km-in .wrap{background-size:100% 1px}

  /* 4. Text links: underline grows from the left */
  .more a,.plain p a{border-bottom:0;background:linear-gradient(currentColor,currentColor) left 100%/0 1px no-repeat;transition:background-size .3s ease}
  .more a:hover,.plain p a:hover{background-size:100% 1px}
  .more a::after{content:"";display:inline-block}
  .go,.more a{transition:letter-spacing .2s}
  .product .go{display:inline-block;transition:transform .25s ease}
  .product:hover .go{transform:translateX(4px)}

  /* buttons lift a hair */
  .btn{transition:transform .15s ease,background .15s,border-color .15s}
  .btn:hover{transform:translateY(-1px)}
  .btn:active{transform:none}

  /* 5. Small signs of life */
  /* the big logo drifts very slightly, like breathing */
  .km .intro .mark{animation:km-float 7s ease-in-out 1.2s infinite}
  @keyframes km-float{50%{transform:translateY(-4px)}}
  /* status dots ("In private pilot", contact hint) send out a slow ring, like an online light */
  .badge .dot,.hint .dot{position:relative}
  .km .badge .dot::after,.km .hint .dot::after{content:"";position:absolute;inset:0;border-radius:50%;background:inherit;animation:km-ring 2.8s ease-out infinite}
  @keyframes km-ring{0%{transform:scale(1);opacity:.55}70%,100%{transform:scale(2.8);opacity:0}}
  /* moon/sun turns when the theme switches */
  .km .theme-toggle svg{animation:km-spin .6s cubic-bezier(.2,.8,.2,1)}
  @keyframes km-spin{from{transform:rotate(-120deg) scale(.6);opacity:0}}
}
