/* CSS Variables */
:root {
  --color-main: #00bfff;
  --color-accent: #ff4081;
  --color-dark: #1a1a2e;
  --color-text-dark: #333;
  --color-text-light: #fff;
  --font-main: 'Zen Maru Gothic', sans-serif;
  --corridor-width: 480px; /* PCでもSPと同じレイアウト比率を維持するための最大固定幅 */
}

/* Reset */
html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100vh;
  overflow: hidden; /* ネイティブなスクロールを完全に無効化 */
  font-family: var(--font-main);
  color: var(--color-text-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout */
.site-container {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden; /* GSAP Observerのみで制御するためスクロールバーは出さない */
}

.bg-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
}
.bg-lazy {
  background: url("../images/first_background.png") center/cover no-repeat;
}
.bg-positive {
  background: url("../images/480_F_221334800_GgZ5cryuzlq5s7DS0cERlOndQpKXk2ur.jpg") center/cover no-repeat;
  opacity: 0;
  visibility: hidden;
}

.main-corridor {
  max-width: var(--corridor-width);
  width: 100%;
  height: 100vh;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  container-type: inline-size; /* 子要素がcqwでコンテナ幅を参照できるようにする */
}

/* === 各セクションをすべて同じ位置に重ねる === */
.section-slide {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  height: 100vh;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 3cqw, 40px); /* コンテナ幅基準でPC/SP同一 */
  opacity: 0;
  visibility: hidden;
  z-index: 10;
  overflow: hidden;
}

/* === Loading Screen === */
#loader {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--color-dark); /* 深みのあるネイビー */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.loader-logo {
  width: 200px;
  height: auto;
  animation: loaderPulse 2s ease-in-out infinite alternate;
}

.loader-text {
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(2rem, 5vw, 4rem);
  color: #fff;
  letter-spacing: 0.2em;
  opacity: 0;
  transform: scale(0.95);
  animation: loaderPulse 2s ease-in-out infinite alternate;
}

@keyframes loaderPulse {
  0% { opacity: 0.4; letter-spacing: 0.15em; transform: scale(0.98); }
  100% { opacity: 1; letter-spacing: 0.3em; transform: scale(1.02); }
}

/* 新規追加：画像とテキストを並べるブロック */
@keyframes floatY {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -8px, 0) rotate(0.5deg); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

.slide-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  position: relative;
  width: 100%;
  height: clamp(200px, 28vh, 320px);
  padding: 0 5%;
  box-sizing: border-box;
  z-index: 5;
  will-change: transform; /* パフォーマンス向上のため追加 */
  
  /* 常にフワフワゆれる生命感のあるアニメーション */
  animation: floatY 6s ease-in-out infinite;
}
/* 2ブロック目（ポジティブ）のslide-rowはやや小さめ */
.section-positive .slide-row {
  height: clamp(160px, 22vh, 260px);
}

.slide-row.reverse {
  flex-direction: row-reverse;
}

.slide-row:nth-child(even) {
  animation-duration: 7s;
  animation-delay: 1.5s;
}
.slide-row:nth-child(3) {
  animation-duration: 8s;
  animation-delay: 3s;
}
.slide-row:nth-child(4) {
  animation-duration: 6.5s;
  animation-delay: 2s;
}

/* 今見えているセクションのクラス */
.section-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 20;
}

/* Typography Helpers */
.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 1.4rem;
  line-height: 1.8;
  letter-spacing: 0.1em;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  position: absolute;
}

.highlight {
  color: var(--color-accent);
  font-weight: 700;
}

/* === Section 1: Lazy === */
.section-lazy {
  color: #111;
}
.fv-img {
  position: relative;
  width: 45%;
  max-width: 240px;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  border: 2px solid #fff;
  box-shadow: 6px 6px 0px rgba(0,0,0,0.1);
  z-index: 5;
  flex-shrink: 0;
}

/* 巨大引用符はカプセルの中に合わないため非表示へ */
.bg-quote::before {
  display: none;
}

/* === Section 2: Positive === */
.section-positive {
  color: #111;
}
.pos-img {
  position: relative;
  width: 45%;
  max-width: 240px;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  border: 2px solid #fff;
  box-shadow: 6px 6px 0px rgba(0,0,0,0.1);
  z-index: 5;
  flex-shrink: 0;
}

/* === 縦書きカプセル（HARUTA風のキャッチコピー領域） === */
.lazy-copy, .pos-copy, .pos-copy-main {
  position: relative; 
  writing-mode: vertical-rl; 
  text-orientation: mixed;
  font-family: serif;
  background: rgba(255, 255, 255, 0.95); 
  color: #222;
  border: 1px solid #111; 
  border-radius: 30px; 
  padding: 12px 10px; 
  font-size: clamp(0.85rem, 3.8vw, 1.1rem); /* コンテナ幅基準から画面幅基準へ変更し安定化 */
  letter-spacing: 0.20em; 
  line-height: 1.8;
  box-shadow: 4px 4px 0px rgba(0,0,0,0.1);
  text-shadow: none; 
  white-space: nowrap; 
  z-index: 20; 
  flex-shrink: 0;
}

/* === アシンメトリー配置（被らないよう左右にマージンと回転で散らす） === */
.slide-row:nth-child(1) .fv-img, .slide-row:nth-child(1) .pos-img {
  transform: rotate(3deg); margin-bottom: 15px;
}
.slide-row:nth-child(1) .lazy-copy, .slide-row:nth-child(1) .pos-copy {
  transform: rotate(-2deg); margin-top: 20px;
}

.slide-row:nth-child(2) .fv-img, .slide-row:nth-child(2) .pos-img {
  transform: rotate(-4deg); margin-top: 15px;
}
.slide-row:nth-child(2) .lazy-copy, .slide-row:nth-child(2) .pos-copy {
  transform: rotate(1deg); margin-bottom: 20px;
}

.slide-row:nth-child(3) .fv-img, .slide-row:nth-child(3) .pos-img {
  transform: rotate(2deg); margin-bottom: 10px;
}
.slide-row:nth-child(3) .lazy-copy, .slide-row:nth-child(3) .pos-copy {
  transform: rotate(-1deg); margin-top: 15px;
}

.slide-row:nth-child(4) .pos-img {
  transform: rotate(-3deg); margin-top: 10px;
}
.slide-row:nth-child(4) .pos-copy-main {
  transform: rotate(2deg); margin-bottom: 10px;
}

/* === スクロールコンテナ（3ブロック目以降） === */
.scroll-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  z-index: 10;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroll-container::-webkit-scrollbar {
  display: none;
}

/* スクロールセクション共通 */
.scroll-container .scroll-section {
  position: relative;
  height: auto;
  min-height: auto;
  padding: 40px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.scroll-container .section-conclusion {
  gap: 20px;
}

.scroll-container .footer {
  padding: 30px 0;
  text-align: center;
  align-items: stretch;
  background: transparent;
}

.scroll-container .footer .footer-inner {
  border-radius: 20px;
}

/* スクロールコンテナ内の子要素幅 */
.scroll-container .empathy-bubbles,
.scroll-container .reasons-container,
.scroll-container .letter-box,
.scroll-container .cta-area {
  width: 100%;
}

/* === CSSアニメーション（.active時にトリガー） === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* 初期状態：非表示 */
.scroll-container .bubble,
.scroll-container .empathy-solution,
.scroll-container .section-title,
.scroll-container .reason-card,
.scroll-container .letter-box,
.scroll-container .cta-area,
.scroll-container .footer-inner {
  opacity: 0;
}

/* active時にアニメーション実行 */
.scroll-container.active .section-title {
  animation: fadeInUp 0.6s ease forwards;
}

.scroll-container.active .bubble:nth-child(odd) {
  animation: slideInLeft 0.5s ease forwards;
}
.scroll-container.active .bubble:nth-child(even) {
  animation: slideInRight 0.5s ease forwards;
}
.scroll-container.active .bubble:nth-child(1) { animation-delay: 0.1s; }
.scroll-container.active .bubble:nth-child(2) { animation-delay: 0.2s; }
.scroll-container.active .bubble:nth-child(3) { animation-delay: 0.3s; }
.scroll-container.active .bubble:nth-child(4) { animation-delay: 0.4s; }

.scroll-container.active .empathy-solution {
  animation: scaleIn 0.6s ease 0.5s forwards;
}

.scroll-container.active .reason-card {
  animation: fadeInUp 0.6s ease forwards;
}
.scroll-container.active .reason-card:nth-child(1) { animation-delay: 0.1s; }
.scroll-container.active .reason-card:nth-child(2) { animation-delay: 0.25s; }
.scroll-container.active .reason-card:nth-child(3) { animation-delay: 0.4s; }

.scroll-container.active .letter-box {
  animation: fadeInUp 0.6s ease 0.1s forwards;
}
.scroll-container.active .cta-area {
  animation: fadeInUp 0.6s ease 0.3s forwards;
}
.scroll-container.active .footer-inner {
  animation: fadeInUp 0.6s ease 0.1s forwards;
}

/* === Section 3: Empathy === */
.section-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--color-main);
  background: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  display: inline-block;
  align-self: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.empathy-bubbles {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 10px;
}

.bubble {
  background: #fff;
  padding: 15px 20px;
  border-radius: 20px;
  border-bottom-left-radius: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  display: inline-block;
  max-width: 80%;
  align-self: flex-start;
  font-weight: 500;
}

.bubble:nth-child(even) {
  align-self: flex-end;
  border-radius: 20px;
  border-bottom-right-radius: 0;
  background: #e6f7ff;
}

.empathy-solution {
  margin-top: 30px;
  text-align: center;
  background: var(--color-accent);
  color: #fff;
  padding: 20px;
  border-radius: 15px;
  font-size: 1.3rem;
  box-shadow: 0 10px 20px rgba(255,105,180,0.3);
}

/* === Section 4: Reasons === */
.section-reasons .section-title {
  margin-bottom: 0;
}

.reasons-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.reason-card {
  background: #fff;
  border-radius: 15px;
  padding: 20px 15px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  text-align: center;
}

.reason-num {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 35px;
  height: 35px;
  background: var(--color-main);
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
}

.reason-card h3 {
  color: var(--color-main);
  margin-bottom: 5px;
  margin-top: 10px;
  font-size: 1.1rem;
}
.reason-card p {
  font-size: 0.9rem;
  line-height: 1.4;
}

/* === Section 5: Conclusion & CTA === */
.section-conclusion {
  justify-content: space-evenly;
}

.letter-box {
  background: #fff;
  border: 2px dashed var(--color-main);
  padding: 25px;
  border-radius: 10px;
  font-size: 1rem;
}
.letter-box h3 {
  color: var(--color-main);
  margin-bottom: 15px;
}
.letter-box p {
  margin-bottom: 10px;
}
.signature {
  text-align: center;
  font-weight: bold;
}

.owner-photo {
  text-align: center;
}

.owner-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-main);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  margin: 0 auto;
}

.cta-area {
  text-align: center;
  background: linear-gradient(135deg, var(--color-main), var(--color-accent));
  padding: 30px 20px;
  border-radius: 20px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.cta-text {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 15px;
}

.btn-line {
  display: inline-block;
  background: #06C755;
  color: #fff;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: bold;
  padding: 12px 30px;
  border-radius: 40px;
  box-shadow: 0 5px 15px rgba(6, 199, 85, 0.4);
}

/* === PC用：左サイドロゴ === */
.side-logo {
  display: none;
}

@media (min-width: 768px) {
  .side-logo {
    display: block;
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 100;
  }
  .side-logo img {
    width: 80px;
    height: auto;
  }
}

/* === PC用：右サイド固定LINEボタン === */
.side-line-btn {
  display: none;
}

@media (min-width: 768px) {
  .side-line-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    z-index: 100;
    background: #06C755;
    color: #fff;
    text-decoration: none;
    padding: 18px 14px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(6, 199, 85, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .side-line-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 8px 25px rgba(6, 199, 85, 0.5);
  }
  .side-line-icon {
    width: 32px;
    height: 32px;
  }
  .side-line-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.15em;
  }
}

/* === フッターロゴ === */
.footer-logo {
  width: 150px;
  height: auto;
  margin: 0 auto 10px;
}

/* Footer */
.footer {
  justify-content: center;
  align-items: center;
  text-align: center;
  background: transparent;
  color: #fff;
}
.footer-inner {
  background: rgba(0, 0, 0, 0.75); /* blur削除に伴い少し暗く */
  border-radius: 20px;
  padding: 30px 25px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.footer h2 {
  color: var(--color-main);
  margin-bottom: 10px;
}
.copyright {
  font-size: 0.8rem;
  margin-top: 20px;
  opacity: 0.7;
}
