/* ==========================================================================
   ほぼチカ オープニングのローディング（js/loading.js とセット・いずれ外す予定）
   6つの図形が順にぽんっと出て、ぴょこぴょこ跳ねる → 読み込みが終わったら幕ごと消える
   図形の下に「loading...」（Tsubuten AP）
   ========================================================================== */

/* 幕：body ができる前から中身を隠す */
html.is-loading::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: #fff;
}
html.is-loading body {
  overflow: hidden;
}

.hc-loading {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background-color: #fff;
}
.is-loaded .hc-loading {
  animation: hc-loading-out 0.5s ease 0.15s both;
  pointer-events: none;
}

.hc-loading-objects {
  --scale: 0.82;  /* 図形の大きさ（SVG の元の大きさに対する倍率） */
  display: flex;
  align-items: center;
  gap: 22px;
}
.hc-loading-objects img {
  width: calc(var(--w) * var(--scale));
  height: auto;
  transform-origin: 50% 100%;
  animation:
    hc-loading-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--i) * 0.1s) both,
    hc-loading-hop 1.2s ease-in-out calc(0.6s + var(--i) * 0.1s) infinite;
}
/* 消えるときは、跳ねるのをやめて小さくなる */
.is-loaded .hc-loading-objects img {
  animation: hc-loading-pop 0.3s ease-in calc(var(--i) * 0.03s) both;
}
.hc-loading-text {
  margin: 0;
  color: #322f2f;
  font-family: "Tsubuten AP", sans-serif;
  font-weight: normal;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.3s;
}
.is-font-ready .hc-loading-text {
  opacity: 1;
}
.is-loaded .hc-loading-text {
  opacity: 0;
}
@media (min-width: 769px) {
  .hc-loading {
    gap: 26px;
  }
  .hc-loading-objects {
    --scale: 1;
    gap: 28px;
  }
  .hc-loading-text {
    font-size: 17px;
  }
}

@keyframes hc-loading-in {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes hc-loading-hop {
  0%, 40%, 100% { transform: translateY(0); }
  20% { transform: translateY(-40%); }
}
@keyframes hc-loading-pop {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0); opacity: 0; }
}
@keyframes hc-loading-out {
  to { opacity: 0; visibility: hidden; }
}

/* 動きを減らす設定：動かさずに並べるだけ（js/loading.js で表示時間も短くする） */
@media (prefers-reduced-motion: reduce) {
  .hc-loading-objects img,
  .is-loaded .hc-loading-objects img,
  .is-loaded .hc-loading {
    animation: none;
  }
}
