/* ローディング専用：中心から段階的に拡大して登場する */
.loading__ultraman {
  transform-origin: center center;
  animation: ultraman-entrance 2.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes ultraman-entrance {
  0% { opacity: 0; transform: scale(0); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  30% { opacity: 1; transform: scale(0.1667); animation-timing-function: linear; }
  31.7% { transform: scale(0.1667); animation-timing-function: cubic-bezier(0.25, 0.8, 0.3, 1); }
  63% { transform: scale(0.5); animation-timing-function: linear; }
  64.7% { transform: scale(0.5); animation-timing-function: cubic-bezier(0.25, 0.8, 0.3, 1); }
  100% { opacity: 1; transform: scale(2); }
}


/* ページ操作をロックするローディング画面 */
html.is-loading,
html.is-loading body {
  height: 100%;
  overflow: hidden;
}

.loading {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--red);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.loading::before {
  display: none;
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: #fff;
  opacity: 0;
  animation: loading-flash 2.35s steps(1, end) both;
}

.loading__ultraman {
  position: relative;
  z-index: 1;
}

.loading.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.loading__ultraman {
  width: 63vw;
  max-width: 63rem;
  transform-origin: center;
}


@keyframes loading-flash {
  0%, 12% { opacity: 0; }
  13.5%, 18% { opacity: 0.48; }
  16.5%, 21%, 40% { opacity: 0; }
  41.5%, 46% { opacity: 0.48; }
  44.5%, 49%, 77.76% { opacity: 0; }
  77.76% { opacity: 0.48; }
  83.76%, 100% { opacity: 0; }
}


@media (prefers-reduced-motion: reduce) {
  .loading__ultraman,
  .loading::before { animation: none; }
}


/* intro内コンテンツのスクロール出現演出 */
.intro .reveal.is-pending {
  opacity: 0;
}

.intro .reveal {
  transition: opacity 0.7s ease;
  will-change: opacity;
}

.intro .reveal.is-visible {
  opacity: 1;
}

.intro h1.reveal { transition-delay: 0.05s; }
.intro > p.reveal { transition-delay: 0.15s; }
.intro .new-open.reveal { transition-delay: 0.25s; }
.intro .shop.reveal:nth-of-type(1) { transition-delay: 0.35s; }
.intro .shop.reveal:nth-of-type(2) { transition-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
  .intro .reveal { transition: none; }
}


/* introの赤背景を左から展開 */
.intro::before {
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.intro.is-background-pending::before {
  transform: scaleX(0);
}

.intro.is-background-visible::before {
  transform: scaleX(1);
}

.intro h1.reveal { transition-delay: 0.2s; }
.intro > p.reveal { transition-delay: 0.3s; }
.intro .new-open.reveal { transition-delay: 0.45s; }
.intro .shop.reveal:nth-of-type(1) { transition-delay: 0.55s; }
.intro .shop.reveal:nth-of-type(2) { transition-delay: 0.7s; }

@media (prefers-reduced-motion: reduce) {
  .intro::before { transition: none; }
}


/* 最背面でシームレスに漂う水玉 */
.hero,
.footer {
  background: transparent;
}

.background-bubbles {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: #f0eced;
  isolation: auto;
}

.background-bubble {
  position: absolute;
  display: block;
  width: var(--bubble-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bubble-color);
  filter: blur(var(--bubble-blur));
  opacity: var(--bubble-opacity);
  mix-blend-mode: overlay;
  /* 基点から少し離して回転させることで、円を描くように移動させる */
  transform-origin: calc(50% - var(--bubble-x)) calc(50% - var(--bubble-y));
  animation: background-bubble-orbit var(--bubble-duration) linear var(--bubble-delay) infinite;
  will-change: transform;
}

/* 固定背景の中で、それぞれの水玉が別の中心をゆっくり周回する */
@keyframes background-bubble-orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 回る向きを交互にして、同じリズムに見えないようにする */
.background-bubble:nth-child(even) {
  animation-direction: reverse;
}

.background-bubble.bubble--blue { --bubble-color: #9ffff0; }
.background-bubble.bubble--yellow { --bubble-color: #ffeaa2; }
/* 1個目（左上）：黄色 #ffeaa2 */
.background-bubble:nth-child(1) { --bubble-size: 18rem; --bubble-blur: 0.42rem; --bubble-opacity: 0.72; --bubble-duration: 44s; --bubble-delay: -8s; --bubble-x: 5rem; --bubble-y: 3rem; top: 5%; left: -3%; }
/* 2個目（左中央）：青 #9ffff0 */
.background-bubble:nth-child(2) { --bubble-size: 5rem; --bubble-blur: 0.25rem; --bubble-opacity: 0.88; --bubble-duration: 30s; --bubble-delay: -3s; --bubble-x: -3rem; --bubble-y: 4rem; top: 29%; left: 18%; }
/* 3個目（上部中央）：黄色 #ffeaa2 */
.background-bubble:nth-child(3) { --bubble-size: 10rem; --bubble-blur: 0.5rem; --bubble-opacity: 0.64; --bubble-duration: 40s; --bubble-delay: -12s; --bubble-x: 3rem; --bubble-y: -2rem; top: -5%; left: 35%; }
/* 4個目（右中央）：青 #9ffff0 */
.background-bubble:nth-child(4) { --bubble-size: 9rem; --bubble-blur: 0.3rem; --bubble-opacity: 1; --bubble-duration: 38s; --bubble-delay: -6s; --bubble-x: -4rem; --bubble-y: 3rem; top: 18%; right: 12%; }

/* 5個目（フッター左端）：黄色 #ffeaa2 */
.background-bubble:nth-child(5) { --bubble-size: 16rem; --bubble-blur: 0.5rem; --bubble-opacity: 0.4; --bubble-duration: 50s; --bubble-delay: -9s; --bubble-x: 4rem; --bubble-y: -2rem; top: 74%; left: 4%; }
/* 一時非表示：6個目（フッター左）：黄色 #ffeaa2 */
/* .background-bubble:nth-child(6) { --bubble-size: 11rem; --bubble-blur: 0.42rem; --bubble-opacity: 0.75; --bubble-duration: 40s; --bubble-delay: -4s; --bubble-x: -3rem; --bubble-y: 3rem; top: 78%; left: 12%; } */
/* 一時非表示：7個目（フッター左上）：黄色 #ffeaa2 */
/* .background-bubble:nth-child(7) { --bubble-size: 9rem; --bubble-blur: 0.56rem; --bubble-opacity: 0.67; --bubble-duration: 46s; --bubble-delay: -11s; --bubble-x: 3rem; --bubble-y: -3rem; top: 64%; left: 27%; } */
/* 一時非表示：8個目（フッター左中央）：青 #9ffff0 */
/* .background-bubble:nth-child(8) { --bubble-size: 5rem; --bubble-blur: 0.28rem; --bubble-opacity: 0.9; --bubble-duration: 34s; --bubble-delay: -6s; --bubble-x: -2rem; --bubble-y: 2rem; top: 76%; left: 34%; } */
/* 一時非表示：9個目（フッター中央右）：黄色 #ffeaa2 */
/* .background-bubble:nth-child(9) { --bubble-size: 10rem; --bubble-blur: 0.5rem; --bubble-opacity: 0.7; --bubble-duration: 42s; --bubble-delay: -14s; --bubble-x: 3rem; --bubble-y: 2rem; top: 70%; left: 61%; } */
/* 10個目（フッター右）：青 #9ffff0 */
.background-bubble:nth-child(10) { --bubble-size: 10rem; --bubble-blur: 0.34rem; --bubble-opacity: 0.9; --bubble-duration: 38s; --bubble-delay: -7s; --bubble-x: -3rem; --bubble-y: -2rem; top: 80%; right: 14%; }
/* 11個目（フッター右端）：黄色 #ffeaa2 */
.background-bubble:nth-child(11) { --bubble-size: 16rem; --bubble-blur: 0.6rem; --bubble-opacity: 0.74; --bubble-duration: 48s; --bubble-delay: -12s; --bubble-x: 3rem; --bubble-y: 2rem; top: 66%; right: -2%; }

/* 12個目（左下）：黄色 #ffeaa2 */
.background-bubble:nth-child(12) { --bubble-size: 13rem; --bubble-blur: 0.48rem; --bubble-opacity: 0.78; --bubble-duration: 46s; --bubble-delay: -5s; --bubble-x: 4rem; --bubble-y: 2rem; top: 45%; left: 9%; }
/* 13個目（ヘッダー右下）：黄色 #ffeaa2 */
/* .background-bubble:nth-child(13) { --bubble-size: 18rem; --bubble-blur: 0.54rem; --bubble-opacity: 0.72; --bubble-duration: 52s; --bubble-delay: -10s; --bubble-x: -4rem; --bubble-y: 3rem; top: 42%; right: 7%; } */


/* 14個目（ヘッダー右上・4個目に重なる）：黄色 #ffeaa2 */
.background-bubble:nth-child(14) { --bubble-size: 16rem; --bubble-blur: 0.54rem; --bubble-opacity: 0.72; --bubble-duration: 52s; --bubble-delay: -10s; --bubble-x: -4rem; --bubble-y: 3rem; top: 1%; right: 1%; }


/* スマホでは水玉のサイズと座標を再配置 */
@media (max-width: 40.625rem) {
  .background-bubble { scale: 0.5; }
  .background-bubble:nth-child(1) { top: 5%; left: -10%; }
  .background-bubble:nth-child(2) { top: 31%; left: 20%; }
  .background-bubble:nth-child(3) { top: -6%; left: 34%; }
  .background-bubble:nth-child(4) { top: 24%; right: -8%; }
  .background-bubble:nth-child(5) { top: 76%; left: -10%; }
  .background-bubble:nth-child(6) { top: 84%; left: 8%; }
  .background-bubble:nth-child(7) { top: 60%; left: 29%; }
  .background-bubble:nth-child(8) { top: 77%; left: 41%; }
  .background-bubble:nth-child(9) { top: 70%; left: 62%; }
  .background-bubble:nth-child(10) { top: 83%; right: 10%; }
  .background-bubble:nth-child(11) { top: 62%; right: -10%; }
  .background-bubble:nth-child(12) { top: 42%; left: -5%; }
  .background-bubble:nth-child(13) { top: 46%; right: -17%; }
  .background-bubble:nth-child(14) { top: -4%; right: -7%; }
}
