/* K-Bench hero animation: load after the site stylesheet. */

.hero-art {
  position: absolute;
  inset: 0;
  touch-action: pan-y;                       /* vertical scrolling still works over the drawing */
  -webkit-tap-highlight-color: transparent;
  /* Fade the whole artwork at the fixed frame edge, including its moving effects. */
  -webkit-mask-image: linear-gradient(to bottom, #000 75%, rgba(0, 0, 0, .85) 82%, rgba(0, 0, 0, .35) 92%, transparent 99%);
          mask-image: linear-gradient(to bottom, #000 75%, rgba(0, 0, 0, .85) 82%, rgba(0, 0, 0, .35) 92%, transparent 99%);
}
.hero-art canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* The mobile composition fades above the text, keeping the figure visible. */
.hero-art.is-cropped {
  -webkit-mask-image: linear-gradient(#000 calc(var(--fy) - 50px), transparent calc(var(--fy) + 45px));
          mask-image: linear-gradient(#000 calc(var(--fy) - 50px), transparent calc(var(--fy) + 45px));
}
/* Poster stays visible until the first complete canvas frame is ready. */
.hero-art-fallback[hidden] { display: none; }
.hero-art-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 20%;
}
.hero-text { z-index: 2; }
.footer-credit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.footer .footer-links { flex-wrap: wrap; }
.hero-motion-setting {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 12px;
  cursor: pointer;
}
.hero-motion-setting input { accent-color: #675df4; }
.hero-motion-setting[hidden] { display: none; }

/* Reserve the drawing and text space before JavaScript or textures arrive. */
.hero-section { min-height: 520px; }
@media (min-width: 768px) {
  .hero-section { min-height: max(520px, calc(100dvh - 4rem)); }
}
@media (max-width: 640px), (min-width: 641px) and (orientation: portrait) {
  .hero-section { display: grid; grid-template-rows: minmax(520px, 1fr) auto; }
  .hero-text { position: relative; grid-row: 2; bottom: auto; margin-bottom: 40px; }
}
@media (max-width: 640px) {
  .hero-section { min-height: 100svh; grid-template-rows: minmax(250px, 1fr) auto; }
  .hero-text { left: auto !important; right: auto; max-width: none; margin: 0 16px 24px; }
  .hero-art:not(.is-cropped) .hero-art-fallback {
    inset: 56px 0 auto;
    height: auto;
    -webkit-mask-image: linear-gradient(#000 75%, transparent 99%);
            mask-image: linear-gradient(#000 75%, transparent 99%);
  }
}

/* Hero text entrance (CSS only, so it never depends on the script). */
@media (prefers-reduced-motion: no-preference) {
  .hero-text > * { animation: hero-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-text > :nth-child(2) { animation-delay: .12s; }
  .hero-text > :nth-child(3) { animation-delay: .24s; }
  .hero-text > :nth-child(4) { animation-delay: .36s; }
}
@keyframes hero-rise { from { opacity: 0; transform: translateY(10px); } }
