/* Harukaze-inspired motion for the Toyama home page only. */
:root { --hm-ease: cubic-bezier(.16, 1, .3, 1); }

/* The unenhanced page stays readable. JS adds .hm-ready before animation. */
.hero__title .hm-line { display: block; }
.hero__title .hm-line + .hm-line { margin-top: 0; }
.hero__photo picture, .hero__photo-sub picture { display: block; width: 100%; height: 100%; }

html.hm-ready .hero__title .hm-line {
  animation: hm-rise 1.2s var(--hm-ease) both;
}
html.hm-ready .hero__title .hm-line:nth-child(2) { animation-delay: .2s; }
html.hm-ready .hero__sub { animation: hm-rise 1.05s var(--hm-ease) .4s both; }
html.hm-ready .hero__lead { animation: hm-rise 1.05s var(--hm-ease) .55s both; }
html.hm-ready .hero__actions { animation: hm-rise 1.05s var(--hm-ease) .7s both; }
html.hm-ready .hero__photo { animation: hm-photo 1.3s var(--hm-ease) .2s both; }
html.hm-ready .hero__photo img { animation: hm-photo-scale 1.8s var(--hm-ease) .2s both; }
html.hm-ready .hero__photo-sub { animation: hm-rise 1.2s var(--hm-ease) .7s both; }
html.hm-ready .hero__ridge path {
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: hm-route 2.4s var(--hm-ease) .3s forwards;
}

@keyframes hm-rise {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes hm-photo {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes hm-photo-scale {
  from { transform: scale(1.055); }
  to { transform: none; }
}
@keyframes hm-route { to { stroke-dashoffset: 0; } }

/* Entrance cards appear in a gentle sequence; the existing hover remains intact. */
html.hm-ready .entrances .entrance.reveal {
  transition-duration: .95s, .95s;
  transition-timing-function: var(--hm-ease), var(--hm-ease);
}
html.hm-ready .entrances .entrance:nth-child(2) { transition-delay: .1s; }
html.hm-ready .entrances .entrance:nth-child(3) { transition-delay: .2s; }
html.hm-ready .entrances .entrance:nth-child(4) { transition-delay: .3s; }
html.hm-ready .entrances .entrance:nth-child(5) { transition-delay: .4s; }
html.hm-ready .entrances .entrance:nth-child(6) { transition-delay: .5s; }
html.hm-ready .entrances .entrance:nth-child(7) { transition-delay: .6s; }
html.hm-ready .entrances .entrance.hm-settled {
  transition-delay: 0s;
  transition-duration: .18s, .18s;
  transition-timing-function: ease, ease;
}

/* A climbing route connects the four steps at desktop widths. */
@media (min-width: 1000px) {
  .steps.hm-steps::before {
    content: '';
    position: absolute;
    left: 9%;
    right: 9%;
    top: 5px;
    height: 2px;
    background: #00A0DE;
    opacity: .65;
    transform: scaleX(0);
    transform-origin: left center;
  }
  .steps.hm-steps { position: relative; }
  html.hm-ready .steps.hm-steps.hm-in::before {
    transition: transform 1.5s var(--hm-ease);
    transform: scaleX(1);
  }
  .steps.hm-steps .step { z-index: 1; }
}

/* Only the visual inside a button moves; its hit area and focus ring stay put. */
@media (hover: hover) and (pointer: fine) {
  .hero__actions .sv2-btn .arrow { display: inline-block; transition: transform .3s var(--hm-ease); }
  .hero__actions .sv2-btn:hover .arrow { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  html.hm-ready .hero__title .hm-line,
  html.hm-ready .hero__sub,
  html.hm-ready .hero__lead,
  html.hm-ready .hero__actions,
  html.hm-ready .hero__photo,
  html.hm-ready .hero__photo img,
  html.hm-ready .hero__photo-sub,
  html.hm-ready .hero__ridge path { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0; }
  html.hm-ready .entrances .entrance.reveal { transition-delay: 0s; }
  html.hm-ready .steps.hm-steps.hm-in::before { transition: none; transform: none; }
  .hero__actions .sv2-btn .arrow { transition: none; }
}

/* Add ?motion=off to compare with the original static presentation. */
html.hm-off .hero__title .hm-line,
html.hm-off .hero__sub,
html.hm-off .hero__lead,
html.hm-off .hero__actions,
html.hm-off .hero__photo,
html.hm-off .hero__photo img,
html.hm-off .hero__photo-sub,
html.hm-off .hero__ridge path { animation: none !important; opacity: 1; transform: none; stroke-dashoffset: 0; }
html.hm-off .reveal { opacity: 1; transform: none; transition: none; }
html.hm-off .steps.hm-steps::before { display: none; }
