/* itamago · Goban — motion : transitions between pages, sections that rise, images that settle, the seal stamped, the goban
   in 3D at the top of the page. Loaded after site.css ; nothing moves when the visitor asks for less motion. */

/* Between two pages of the site (and between the languages) : a short cross-fade, the header kept in place */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.35s; animation-timing-function: ease; }
.site-header { view-transition-name: site-header; }

/* The top of the page : its words rise as it opens, the seal is stamped (CSS only : no flash before the script) */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.4) rotate(-5deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
.hero-copy .seal-hero { animation: stamp 0.55s cubic-bezier(0.3, 1.5, 0.5, 1) 0.15s both; }
.hero-copy h1, .hero-copy .hero-sub { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s both; }
.hero-copy .hero-lead { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.4s both; }
.hero-copy .hero-actions, .hero-copy .hero-meta { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.55s both; }
.board3d { animation: appear 1.4s ease 0.3s both; }

/* Further down : what enters the window rises a little (site.js marks it), one after another in its group */
.motion .will-reveal { opacity: 0; transform: translateY(22px); }
.motion .will-reveal.is-revealed { opacity: 1; transform: none; transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
                                   transition-delay: calc(var(--reveal-order, 0) * 80ms); }
/* The captures settle on the paper : out of focus, then sharp */
.motion .will-reveal-image { opacity: 0; filter: blur(12px) saturate(0.7); transform: scale(1.015); }
.motion .will-reveal-image.is-revealed { opacity: 1; filter: none; transform: none; transition: opacity 1s ease, filter 1.3s ease, transform 1.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.motion .will-stamp { opacity: 0; transform: scale(1.4) rotate(-5deg); }
.motion .will-stamp.is-revealed { opacity: 1; transform: none; transition: opacity 0.25s ease, transform 0.5s cubic-bezier(0.3, 1.5, 0.5, 1); }

/* The banner : each shot drifts back a little while it shows */
.reel-img { transform: scale(1.045); transition: opacity 1.8s ease, transform 9s linear; }
.reel-img.is-current { transform: scale(1); }

/* Analysis : the capture stays in place while its points are read */
@media (min-width: 961px) {
  .split-analysis { align-items: flex-start; }
  .split-analysis .split-figure { position: sticky; top: 120px; }
}

/* Cards and buttons : a soft lift under the pointer */
.card, .button, .store, .moment { transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.2s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(36, 33, 29, 0.12); }
.button-primary:hover { transform: translateY(-1px); }

/* The goban in 3D beside the title ; the still image while WebGL 2 is missing */
.hero-stage { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: center; gap: 24px 48px; }
.hero-copy .hero-name { margin-bottom: 30px; }
.hero-copy .hero-lead { max-width: 440px; }
.board3d { position: relative; margin: 0; }
.board3d canvas { display: none; width: 100%; aspect-ratio: 5 / 4; cursor: default; }
.board3d.is-live canvas { display: block; }
.board3d-still { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; border-radius: 14px; box-shadow: var(--shadow-plate); }
.board3d.is-live .board3d-still { display: none; }
@media (max-width: 860px) { .hero-stage { grid-template-columns: minmax(0, 1fr); } .board3d { max-width: 560px; margin-inline: auto; } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .hero-copy .seal-hero, .hero-copy h1, .hero-copy .hero-sub, .hero-copy .hero-lead, .hero-copy .hero-actions, .hero-copy .hero-meta, .board3d { animation: none; }
  .motion .will-reveal, .motion .will-reveal-image, .motion .will-stamp { opacity: 1; transform: none; filter: none; transition: none; }
  .reel-img, .reel-img.is-current { transform: none; }
  .card:hover, .button-primary:hover { transform: none; }
}
