:root {
  --pink: #FDF6EC;
  --text: rgba(0, 0, 0, 0.85);

  --stageW: min(100vmin, 600px);
  --stageH: min(160vmin, 1000px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
    font-family:"Noto Serif JP",
    serif;
  background: var(--pink);
}

.opening {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.stage {
  width: var(--stageW);
  height: var(--stageH);
  background: var(--pink);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .opening { place-items: stretch; }
  .stage {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}

/* ロゴ外枠（位置決めだけ） */
.logoWrap {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: min(80vmin, 380px);
  aspect-ratio: 1 / 1;
  opacity: 0;
  transform: translateY(12px) scale(0.92);
  filter: blur(5px);
  z-index: 1;
}

/* 丸本体（ここが鼓動する） */
.logoCircle {
  position: absolute;
  inset: 0;
  border-radius: 0;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: visible;
  transform: scale(1);
  /* will-change: transform は合成レイヤー昇格でz-indexを無視するため削除 */
}

.logoImg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (min-width: 768px) {
  .logoWrap {
    width: min(46vmin, 420px);
  }
}

/* テキスト */
.copy {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  margin: 0;
  color: var(--text);
  width: min(88vw, 32ch);
  font-size: clamp(14px, 4vw, 18px);
  line-height: 1.8;
  letter-spacing: 0.12em;
  white-space: normal;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  filter: blur(5px);
  transition:
    opacity 1320ms cubic-bezier(.22,.61,.36,1),
    transform 1470ms cubic-bezier(.22,.61,.36,1),
    filter 1470ms cubic-bezier(.22,.61,.36,1);
  z-index: 10;
}

.copy--pc { display: none; }
.copy--sp { display: block; }

.copy--top { top: 15vh; }
.copy--bottom { bottom: 14vh; }

@media (min-width: 768px) {
  .copy {
    width: auto;
    max-width: min(80vw, 34ch);
    font-size: clamp(26px, 2.2vw, 38px);
    line-height: 1.55;
    letter-spacing: 0.16em;
    white-space: nowrap;
  }

  .copy--pc { display: block; }
  .copy--sp { display: none; }

  .copy--top { top: 12vh; }
  .copy--bottom { bottom: 12vh; }
}

@media (max-height: 700px) {
  .copy {
    font-size: clamp(18px, 4.8vw, 22px);
  }

  .copy--top { top: 14vh; }
  .copy--bottom { bottom: 13vh; }
}

/* 状態：ロゴは常時表示（登場後は残る） */
.is-show-logo .logoWrap {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition:
    opacity 1320ms cubic-bezier(.22,.61,.36,1),
    transform 1470ms cubic-bezier(.22,.61,.36,1),
    filter 1470ms cubic-bezier(.22,.61,.36,1);
}

/* 飛行アニメ用（JSで座標を決めて transform を設定します） */
.logoWrap.fly {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  margin: 0;
  transition: transform 1500ms cubic-bezier(.22,.61,.36,1), opacity 300ms ease;
}

/* テキスト段階表示 */
.is-step1 .copy--top,
.is-step2 .copy--top {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.is-step2 .copy--bottom {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* ドクン = 1秒（heart.mp3 1秒に合わせる） */
.beat1s {
  animation: beat1s 1000ms cubic-bezier(.2,.9,.2,1) 1;
}

/* 1秒の中で “膨らむ→戻る” を収める */
@keyframes beat1s {
  0%   { transform: scale(1); }
  12%  { transform: scale(1.24); } /* ドクン */
  30%  { transform: scale(0.97); } /* 戻り */
  48%  { transform: scale(1.05); } /* 余韻 */
  100% { transform: scale(1); }
}

/* 音案内 */
.soundHint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  translate: -50% 0;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.78);
  color: #fff;
  font-size: 13px;
  z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
  .beat1s { animation: none; }
  .copy { transition: none; }
}