/* ページの基本設定 */
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: sans-serif;
  background-color: #000;
  color: #fff;
  overflow: hidden;
}

#opening-curtain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 1.5s ease;
}
body.loaded #opening-curtain {
  opacity: 0;
}

.scroll-container {
  scroll-snap-type: y mandatory;
  height: 100vh;
  overflow-y: scroll;
}

.page {
  scroll-snap-align: start;
  height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden; 
}

/* --- スクロール矢印のスタイル --- */
.scroll-arrow {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  animation: fade-in 1s ease 2s forwards, arrow-bounce 2s infinite 2s;
}

.scroll-arrow span {
  display: block;
  width: 20px;
  height: 20px;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  transform: rotate(45deg);
  margin: 0 auto;
}

/* 1セクション目(Hero)の矢印だけ黒にする */
#hero-page .scroll-arrow span {
  border-color: #000;
}

@keyframes arrow-bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* 1ページ目の背景マーキー */
.bg-marquee {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background-color: #f0f0f0;
  opacity: 0;
}
.marquee-wrapper {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  transform: rotate(-20deg) translateY(-50%);
  transform-origin: center;
}
.marquee-line {
  display: flex; 
  white-space: nowrap; 
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: bold;
  color: rgba(0, 0, 0, 0.1);
  margin-bottom: 20px; 
  animation: marquee-animation 30s linear infinite;
}
@keyframes marquee-animation {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-line:nth-child(even) {
   animation-direction: reverse;
}

/* 1ページ目：ヒーロー */
.hero {
  text-align: left;
}
.hero h1 {
  font-size: clamp(3.5rem, 12vw, 10rem);
  margin: 0;
  line-height: 1.2;
}
.hero h2 {
  font-size: clamp(1.2rem, 5vw, 2.5rem);
  margin: 0;
  margin-top: 0.5rem;
  font-weight: normal;
}
.hero h1 span,
.hero h2 span {
  color: black;
}
.hero-footer {
  position: absolute;
  bottom: 30px;
  right: 30px;
  text-align: right;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: black;
}

/* 2ページ目：説明文 */
#description-page {
  background-color: #000;
}
.description-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 1000px; 
  width: 95%;
  margin-top: -30px; 
}

/* --- ★修正: 見出しスタイル (根本修正) --- */
/* モバイル・デフォルト設定 */
/* ↓ h3 を h1 に変更 */
h1.animate-words-heading {
  font-size: clamp(3.5rem, 12vw, 7rem); /* モバイルでも十分大きく */
  margin-bottom: 40px;
  line-height: 1.1;
  white-space: normal; /* 折り返し許可 */
  width: 100%;
  text-align: center;
  
}
/* ↓ h3 を h1 に変更 */
h1.animate-words-heading span {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px);
}

/* ★PCサイズ（1024px以上）での特別指定 */
@media (min-width: 1024px) {
  /* ↓ h3 を h1 に変更 */
  h1.animate-words-heading {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.0;
    white-space: nowrap; /* 1行を強制 */
    margin-bottom: 60px;
    text-align: center;
    width: auto;
  }
  
  /* PCでは改行タグを無効化して1行にする */
  /* ↓ h3 を h1 に変更 */
  h1.animate-words-heading br {
    display: none;
  }

}

/* 本文スタイル */
.description-main-text {
  max-width: 900px;
  width: 100%;
  margin-top: 30px;
}
.description-main-text p {
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  line-height: 2;
  display: flex;
  flex-direction: column;
  gap: 1.2em; 
}
.animate-sentences span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
}

/* フッタースタイル */
.description-footer {
  margin-top: 80px;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: bold;
}
.animate-footer-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
}

/* --- アニメーションキーフレーム --- */
@keyframes slide-up {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.animate-up-main, .animate-up-sub, .animate-fade-in { opacity: 0; }
.animate-words span { display: inline-block; opacity: 0; transform: translateY(20px); }

/* 1ページ目 アニメーション */
.bg-marquee.is-visible { animation: fade-in 2s ease 0.5s forwards; }
#hero-page.is-visible .animate-up-main { animation: slide-up 1s ease 1.0s forwards; }
#hero-page.is-visible .animate-words span:nth-child(1) { animation: slide-up 0.8s ease 1.2s forwards; }
#hero-page.is-visible .animate-words span:nth-child(2) { animation: slide-up 0.8s ease 1.3s forwards; }
#hero-page.is-visible .animate-words span:nth-child(3) { animation: slide-up 0.8s ease 1.4s forwards; }
#hero-page.is-visible .animate-words span:nth-child(4) { animation: slide-up 0.8s ease 1.5s forwards; }
#hero-page.is-visible .animate-fade-in { animation: fade-in 1.5s ease 2.0s forwards; }

/* 2ページ目 アニメーション（タイミング調整） */
/* 見出し */
#description-page.is-visible h1.animate-words-heading span:nth-child(1) { animation: slide-up 1s ease 0.5s forwards; }
#description-page.is-visible h1.animate-words-heading span:nth-child(3) { animation: slide-up 1s ease 0.8s forwards; }

/* 本文 */
#description-page.is-visible .animate-sentences span:nth-child(1) { animation: slide-up 1s ease 1.5s forwards; }
#description-page.is-visible .animate-sentences span:nth-child(2) { animation: slide-up 1s ease 1.8s forwards; }
#description-page.is-visible .animate-sentences span:nth-child(3) { animation: slide-up 1s ease 2.1s forwards; }
#description-page.is-visible .animate-sentences span:nth-child(4) { animation: slide-up 1s ease 2.4s forwards; }
#description-page.is-visible .animate-sentences span:nth-child(5) { animation: slide-up 1s ease 2.7s forwards; }

/* フッター */
#description-page.is-visible .animate-footer-text span {
  animation: slide-up 1.2s ease 4.0s forwards;
}

/* 3ページ目（ホログラム）専用スタイル */
#products-page {
  position: relative;
  background-color: #000;
  overflow: hidden;
  padding: 0 !important;
  display: block !important;
  width: 100vw;
  height: 100vh;
}
#products-title {
  position: absolute;
  top: 10%;
  width: 100%;
  text-align: center;
  color: #ffffff;
  font-size: clamp(3rem, 8vw, 6rem);
  font-family: sans-serif;
  font-weight: bold;
  letter-spacing: 5px;
  pointer-events: none;
  z-index: 10;
  margin: 0;
  text-transform: uppercase;
}
#products-title span {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px);
}
#products-page.is-visible #products-title span {
    animation: slide-up 1.0s ease 0.2s forwards;
}
#hologram-instruction {
  position: absolute;
  top: auto;
  bottom: 15%;
  width: 100%;
  text-align: center;
  color: #ffffff;
  font-family: sans-serif;
  pointer-events: none;
  opacity: 0;
  letter-spacing: 2px;
  z-index: 10;
  transition: opacity 1.5s ease;
  transition-delay: 1.2s;
}
#hologram-instruction.is-visible { opacity: 0.7; }

#products-page canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  opacity: 0;
  transition: opacity 2s ease;
  transition-delay: 1.2s;
}
#products-page.is-visible canvas { opacity: 1; }

/* モーダル */
#product-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%) scale(0.9);
  opacity: 0;
  pointer-events: none; 
  width: 300px;
  max-width: 80%;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #ffffff;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
  padding: 30px;
  color: #fff;
  font-family: sans-serif;
  text-align: center;
  border-radius: 4px;
  backdrop-filter: blur(5px);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 100;
}
#product-modal.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
#product-modal h2 {
  margin-top: 0;
  color: #ffffff;
  font-size: 1.2em;
  letter-spacing: 3px;
  border-bottom: 1px solid rgba(255,255,255,0.5);
  padding-bottom: 15px;
  margin-bottom: 20px;
  text-transform: uppercase;
}
#product-modal p {
  font-size: 0.95em;
  line-height: 1.8;
  color: #cccccc;
}
#close-btn {
  margin-top: 25px;
  padding: 10px 40px;
  background: transparent;
  border: 1px solid #ffffff;
  color: #ffffff;
  cursor: pointer;
  transition: 0.3s;
  font-weight: bold;
  letter-spacing: 2px;
}
#close-btn:hover {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}
#modal-link-btn {
  display: inline-block;
  margin-top: 25px;
  margin-bottom: 15px;
  padding: 12px 35px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid #ffffff;
  color: #ffffff;
  text-decoration: none;
  font-family: sans-serif;
  font-weight: bold;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}
#modal-link-btn:hover {
  background-color: #ffffff;
  color: #000000;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.7);
}