/* ============================================================
   612 Room Sandal — LP Styles
   Mobile First / Scroll Snap / 390px base
   Theme: Cream #fff3e8 / Black / Accent #ee7b4f / Teal #00a2a6
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg: #fff3e8;
  --text: #000000;
  --accent: #ee7b4f;
  --teal: #00a2a6;
  --font: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans',
    'Yu Gothic', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  height: 100%;
  font-family: var(--font);
  font-weight: 700;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

img {
  display: block;
}

button {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── App wrapper ────────────────────────────────────────────── */
#app {
  position: relative;
  width: 100%;
  height: 100svh;
  margin: 0 auto;
}

@supports (height: 100dvh) {
  #app {
    height: 100dvh;
  }
}

/* PC: center at mobile width */
@media (min-width: 540px) {
  body {
    display: flex;
    justify-content: center;
    align-items: stretch;
    background: var(--bg);
  }

  /* 左右にイラストを装飾として配置 */
  body::before,
  body::after {
    content: '';
    flex: 1;
    min-width: 0;
    background-size: auto 60%;
    background-repeat: no-repeat;
    background-color: var(--bg);
    background-blend-mode: multiply;
    /* 白背景を透過させクリームに馴染む */
    pointer-events: none;
  }

  body::after {
    /* background-image: url('../images/1-2.png');
    background-position: left 16px center; */
  }

  #app {
    width: 430px;
    flex-shrink: 0;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.10);
  }
}

/* ── Slides Container ───────────────────────────────────────── */
#slides-container {
  position: absolute;
  inset: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#slides-container::-webkit-scrollbar {
  display: none;
}

/* ── Progress Indicator ─────────────────────────────────────── */
#progress {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  right: 20px;
  z-index: 20;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(0, 0, 0, 0.35);
  pointer-events: none;
  user-select: none;
}

/* ── Back Link（2話以降・左上）───────────────────────── */
#back-link {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  left: 20px;
  z-index: 20;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(0, 0, 0, 0.35);
}

/* ── Slide ──────────────────────────────────────────────────── */
.slide {
  position: relative;
  width: 100%;
  height: 100svh;
  scroll-snap-align: start;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

@supports (height: 100dvh) {
  .slide {
    height: 100dvh;
  }
}

/* ── Slide Inner (content flow) ─────────────────────────────── */
.slide__inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-left: 28px;
  padding-right: 28px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 40px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 68px);
}

.slide--cta .slide__inner {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 32px);
}

/* ── Animation Base ─────────────────────────────────────────── */
.anim-item {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.slide.is-active .anim-item {
  opacity: 1;
  transform: translateY(0);
}

/* transition-delay は JS で inline 設定 */

/* ── Series Title ────────────────────────────────────────────── */
/* 表示：スライド1・5のLP全体タイトル */
.slide__series-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.65;
  text-align: center;
  color: var(--text);
}

.slide__series-title small {
  display: block;
  font-size: 0.64em;
  color: var(--text);
  margin-top: 3px;
}

/* スライド1: タイトルのみのヒーロー表示。画像とのバランスを取るため拡大 */
.slide__series-title--lg {
  font-size: 34px;
  line-height: 1.5;
}

/* ── Chapter label ──────────────────────────────────────────── */
.slide__chapter {
  font-size: 26px;
  letter-spacing: 0.1em;
  text-align: center;
  margin-top: 40px;
  color: var(--text);
}

/* ── Main Headline ──────────────────────────────────────────── */
.slide__headline {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  margin-top: 16px;
}

/* 1行に収まる範囲で少し大きく表示する見出し（例：index.html「もしかして、私の膝も？」） */
.slide__headline--lg {
  font-size: 28px;
}

/* ── Image ──────────────────────────────────────────────────── */
.slide__image {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

.slide__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/*
  白背景イラストを乗算で合成する図版。
  <img>+mix-blend-mode はアニメ中の opacity/transform が
  スタッキングコンテキストを作り効かないため、
  background-image + background-blend-mode で実装する。
*/
.slide__image--multiply {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: var(--bg);
  /* クリーム色と乗算合成 */
  background-blend-mode: multiply;
}

/* ── Body Text ──────────────────────────────────────────────── */
.slide__body {
  font-size: 20px;
  line-height: 2;
  color: var(--text);
  margin-top: 16px;
}

/* 画像より前のbody（slide3・4）は margin-top 不要 */
.slide__body:first-child {
  margin-top: 0;
}

.slide__body--center {
  text-align: center;
}

/* em = accent color, no italic（slide内全要素に適用） */
.slide__inner em {
  color: var(--accent);
  font-style: normal;
}

/* ── CTA Question (slide 5) ─────────────────────────────────── */
/* 左：イラスト（next.png） / 右：NEXTバッジ＋テキスト */
.slide__cta-q {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  transform: scale(1.15);
}

.slide.is-active .slide__cta-q {
  transform: scale(1);
}

.slide__cta-q-image {
  flex: 0 0 38%;
  aspect-ratio: 784 / 876;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: var(--bg);
  /* クリーム色と乗算合成 */
  background-blend-mode: multiply;
}

.slide__cta-q-content {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.slide__cta-q-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 4px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.slide__cta-q-text {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

/* ── CTA Button Group (slide 5) ─────────────────────────────── */
.slide__btn-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 50px;
}

.slide__btn {
  display: block;
  text-align: center;
  padding: 20px 20px;
  border-radius: 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: opacity 0.2s;
  line-height: 1.4;
}

.slide__btn:hover,
.slide__btn:focus-visible {
  opacity: 0.82;
}

.slide__btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.slide__btn--next {
  background: var(--accent);
  color: #fff;
}

.slide__btn--detail {
  background: var(--teal);
  color: #fff;
  font-size: 18px;
}

.slide__btn-todo-note {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.38);
  text-align: center;
  margin-top: -4px;
}

/* ── NEXT Button ─────────────────────────────────────────────── */
.slide__next {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;

  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  transition: opacity 0.5s ease, background 0.2s;
}

.slide.is-active .slide__next {
  opacity: 1;
  /* delay set to appear after content animation */
}

.slide__next:hover,
.slide__next:focus-visible {
  background: #d66a3c;
}

.slide__next:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Animated chevron icon */
.slide__next-icon {
  animation: chevron-bounce 1.8s ease-in-out infinite;
}

@keyframes chevron-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(4px);
  }
}

/* ── Reduced Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .anim-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .slide__next {
    opacity: 1 !important;
    transition: none !important;
  }

  .slide__next-icon {
    animation: none;
  }
}

/* ── Narrow screens (≤374px) ────────────────────────────────── */
@media (max-width: 374px) {
  .slide__inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  .slide__series-title {
    font-size: 18px;
  }

  .slide__series-title--lg {
    font-size: 22px;
  }

  .slide__chapter {
    font-size: 18px;
  }

  .slide__headline {
    font-size: 19px;
  }

  .slide__headline--lg {
    font-size: 22px;
  }

  .slide__body {
    font-size: 16px;
  }

  .slide__cta-q-text {
    font-size: 15px;
  }

  .slide__btn {
    font-size: 16px;
  }

  .slide__btn--detail {
    font-size: 14px;
  }
}

/* ── Rotate Overlay（横長・ランドスケープ時に回転を促す）───── */
#rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
}

.rotate-overlay__icon {
  width: 44px;
  height: 74px;
  box-sizing: border-box;
  border: 3px solid var(--text);
  border-radius: 8px;
  position: relative;
  animation: rotate-overlay-hint 2.4s ease-in-out infinite;
}

.rotate-overlay__icon::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
  transform: translateX(-50%);
}

@keyframes rotate-overlay-hint {

  0%,
  20% {
    transform: rotate(-90deg);
  }

  55%,
  85% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(-90deg);
  }
}

.rotate-overlay__text {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--text);
}

@media (orientation: landscape) and (max-height: 500px) {
  #rotate-overlay {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rotate-overlay__icon {
    animation: none;
    transform: rotate(-90deg);
  }
}