@charset "UTF-8";

/* ================================
 * ビューポートと基本設定
 * ================================ */
html, body {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* ================================
 * メインスクロールコンテナ
 * ================================ */
.main-container {
  height: calc(var(--vh, 1vh) * 100);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.main-container::-webkit-scrollbar {
  display: none;
}

/* ================================
 * 共通セクション（1セクション = 1画面）
 * ================================ */
.snap-screen {
  height: calc(var(--vh, 1vh) * 100);
  flex-shrink: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.snap-screen::after {
  /*
  content: '';
  display: block;
  height: 1px;
  flex-shrink: 0;
  */
  height: 0 !important;
  display: block;
  background: transparent !important;
  content: '';
}
/* ================================
 * third-screen
 * ================================ */
#third-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  
  background: white;
  transform: translateZ(0);
  contain: paint;
  isolation: isolate;
  will-change: transform;
}

.third-screen-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

/* 🧩 iOSキーボード対策 */
body.keyboard-fix,
body.keyboard-fix .snap-screen,
body.keyboard-fix #third-screen,
body.keyboard-fix .third-screen-inner {
  height: auto !important;
  min-height: 100vh !important;
  overflow: visible !important;
}

body.keyboard-fix .main-container {
  overflow-y: auto !important;
  scroll-snap-type: y mandatory !important;
  -webkit-overflow-scrolling: touch !important;
}

body.keyboard-fix #third-screen {
  justify-content: flex-start !important;
}

/* newsletter */
.newsletter-wrapper {
  position: static;
  margin-top: auto;
  padding: 1.5rem 1rem; /* 余白をここでしっかりと取る */
  width: 100%;
  background: white;
  box-sizing: border-box;
  z-index: 10;
  max-height: 100%;
  overflow: hidden;
}

body.keyboard-fix .newsletter-wrapper {
  position: static !important;
  padding-bottom: calc(env(safe-area-inset-bottom, 2.5rem) + 1.5rem);
  z-index: 10;
}

/* ================================
 * sentence
 * ================================ */
#third-screen #sentence {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 58px;
  line-height: 88px;
  font-weight: 700;
  margin-top: 3.5rem;
  margin-right: 3rem;
  margin-left: 3rem;
}
#third-screen #sentence .original-font {
  font-family: neue-haas-grotesk-display, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 100px;
  line-height: 92px;
  font-weight: 700;
}

/* ================================
 * 動画/画像セクション共通
 * ================================ */
 
.video-wrapper {
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

.video-frame{
  display: block;
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100);
  object-fit: cover;
  border: none;
  pointer-events: none !important;
  user-select: none;
  touch-action: none;
  transform: scale(1.13);
  transform-origin: center;
  opacity: 0.9999; /* ← 描画順の安定化用トリック */
  /*
  transform: none;
  */
}

.image-frame {
  display: block;
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100);
  object-fit: cover;
  border: none;
  pointer-events: none !important;
  user-select: none;
  touch-action: none;
}

/* ================================
 * インジケーター（ナビゲーション）
 * ================================ */
.screen-indicator {
  visibility: visible;
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #fff;
  z-index: 1000;
  text-align: center;
  pointer-events: auto;
}
.arrow {
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 0.9rem;
  margin: 8px 0;
  visibility: hidden;
}
.arrow-up {
  visibility: hidden;
}
.screen-indicator:hover .arrow {
  opacity: 1;
  visibility: visible;
  cursor: grab;
}
#diagonal {
  padding: 0 .15rem !important;
}

/* ================================
 * モバイル・タブレット対応
 * ================================ */
@media (max-width: 1023px) {
  #third-screen #sentence {
    font-size: 20px;
    line-height: 30px;
    margin: 0 1rem 1rem;
  }

  #third-screen #sentence .original-font {
    font-size: 32px;
    line-height: 36px;
  }

  .third-screen-inner {
    padding-top: 1.5rem;
    padding-bottom: calc(env(safe-area-inset-bottom, 2.5rem) + 1.5rem);
  }

  .screen-indicator {
    display: none;
  }

  /* newsletter */
  .newsletter-wrapper {
    padding: 0 1.0rem;
  }

}

/* スマホ＆タブレット縦向きの動画拡大対応 */
@media screen and (max-width: 1024px) and (orientation: portrait) {
  .video-frame {
    transform: scale(3.85);
  }
}

/* タブレット〜iPad Pro横向き */
@media screen and (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
  .video-frame {
    transform: scale(1.4);
  }
}
