:root {
  --bg-color: #FFFFFF;
  --text-black: #1A1A1A;
  --brand-gold: #C5A059;

  /* Typography Scale */
  --fs-large: clamp(5rem, 22vw, 14rem);
  --fs-medium: clamp(1.25rem, 5vw, 2.5rem);
  --fs-small: 0.875rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-black);
  font-family: 'Bangers', 'Rampart One', sans-serif;
  overflow-x: hidden;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* 固定背景（スマホ対応） */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../img/top_bg.png') center center / cover no-repeat;
  background: -webkit-image-set(url('../img/top_bg.webp') type('image/webp'), url('../img/top_bg.png') type('image/png')) center center / cover no-repeat;
  background: image-set(url('../img/top_bg.webp') type('image/webp'), url('../img/top_bg.png') type('image/png')) center center / cover no-repeat;
  opacity: 0.1;
  z-index: -2;
}

section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 2rem;
  position: relative;
}

/* ローディング画面 */
#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #FFFFFF;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 1.5s ease, visibility 1.5s ease;
}

#loading.hide {
  opacity: 0;
  visibility: hidden;
}

#loading-wrap {
  transition: transform 1.5s ease, opacity 1.5s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

#loading.hide #loading-wrap {
  transform: scale(4); /* ゆっくり、より大きく拡大 */
  opacity: 0; /* フワッと消える */
}

#loading img {
  width: clamp(200px, 40vw, 400px); /* 画像をもっと大きく */
  height: auto;
  transform-origin: bottom center; /* ボヨンとした動きの起点 */
  animation: loading-bounce 1.5s forwards; /* 1回のみ実行して状態を維持 */
}

@keyframes loading-bounce {
  0% { transform: translateY(0) scale(1, 1); }
  15% { transform: translateY(0) scale(1.15, 0.85); } /* 着地で潰れる */
  40% { transform: translateY(-40px) scale(0.9, 1.1); } /* 飛び上がって伸びる */
  55% { transform: translateY(0) scale(1.1, 0.9); } /* 落ちてきて潰れる */
  70% { transform: translateY(-20px) scale(0.95, 1.05); } /* 小バウンド */
  85% { transform: translateY(0) scale(1.05, 0.95); } /* 小バウンド着地 */
  100% { transform: translateY(0) scale(1, 1); }
}

/* アニメーション */
@keyframes subtle-shake {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }

  25% {
    transform: translate(8px, -6px) rotate(-1deg);
  }

  50% {
    transform: translate(-8px, 6px) rotate(1deg);
  }

  75% {
    transform: translate(6px, 8px) rotate(-0.5deg);
  }

  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fade-in 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 文字サイズ定義 */
.txt-large {
  font-size: var(--fs-large);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.txt-medium {
  font-size: var(--fs-medium);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.txt-small {
  font-size: var(--fs-small);
  opacity: 0.5;
  letter-spacing: 0.1em;
}

/* SECTION 1: SIGNAL */
#signal .main-word {
  animation: subtle-shake 5s infinite ease-in-out;
}

#signal .main-word img {
  max-width: min(90vw, 900px);
  height: auto;
  display: block;
}

#signal .sub-text {
  text-align: center;
}

/* SECTION 2: FACTS */
#facts {
  align-items: flex-start;
  max-width: 900px;
  margin: 0 auto;
  padding-top: 15rem;
  padding-bottom: 15rem;
}

.facts-header {
  width: 100%;
  margin-bottom: 3rem;
  text-align: center;
}

.fact-table-group {
  width: 100%;
  border-top: 1px solid rgba(26, 26, 26, 0.1);
  /* 上の区切り線 */
}

.fact-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(26, 26, 26, 0.1);
  /* 下の区切り線 */
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.fact-plain-list {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
  align-items: center;
  width: 100%;
}

.fact-note {
  margin-top: 6rem;
  text-align: center;
  width: 100%;
}

/* SECTION 3: MARKET */
#market {
  text-align: center;
}

#market .percentage {
  color: var(--brand-gold);
  margin-bottom: 2rem;
  letter-spacing: 5px;
}

/* SECTION 4: ENTRY */
#entry nav {
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  margin-bottom: 6rem;
  width: 100%;
}

#entry a {
  text-decoration: none;
  transition: opacity 0.3s;
  display: block;
  width: clamp(100px, 28vw, 300px);
}

#entry a img {
  width: 100%;
  height: auto;
  display: block;
}

#entry a:hover {
  opacity: 0.7;
}

@media (max-width: 768px) {
  .fact-item {
    flex-direction: row;
    /* スマホでも横並びを維持 */
    padding: 1rem 0;
  }
}

/* スクロール連動型フワッとアニメーション */
.scroll-fade-in {
  opacity: 0;
  transform: translateY(80px) scale(0.95);
  transition-property: opacity, transform;
  transition-duration: 1.5s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--delay, 0s);
}

.scroll-fade-in.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 800px) {
  #entry nav {
    flex-direction: column; /* 縦並びに変更 */
    gap: 1.5rem; /* 縦の余白を少し調整 */
  }

  #entry a {
    width: clamp(200px, 80vw, 400px); /* 縦並びの際に画像が適切に大きく表示されるように幅を上書き */
  }
}
