*{
  box-sizing: border-box;
}
html,body{
  margin: 0;
  padding: 0;
}
body{
  font-family: "Zen Old Mincho", serif;
  background: #fff;
}

/* ===== ヒーロー全体 ===== */
.hero{
  /* どのくらいスクロールで進行させるか */
  height: 420vh;
}

.hero-pin{
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: #fff;
}

/* ===== レイヤー共通（全部同じ場所＆画面いっぱい） ===== */
.layer{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  will-change: transform, opacity, filter;
}

/* ===== 重なり順 ===== */
.bg{         z-index: 1; }
.mori-close{ z-index: 2; }
.mori-smile{ z-index: 3; }
.frame2{     z-index: 4; }  /* 背景の額縁 */
.frame-main{ z-index: 5; }  /* 手前のフレーム */
.title{      z-index: 8; }
.bubbles{    z-index: 9; }

/* ぼかすのは中身だけ（背景＋森さん） */
.blur-target{
  filter: blur(0px) brightness(1);
}

/* ===== 導入文 ===== */
.intro{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
}

.intro-text{
  margin: 0;
  color: rgba(114, 89, 50, 0.95);
  line-height: 2.8;
  font-size: clamp(14px, 1.4vw, 18px);
   text-shadow:
    -1px -1px 0 rgba(255,255,255,0.8),
     1px -1px 0 rgba(255,255,255,0.8),
    -1px  1px 0 rgba(255,255,255,0.8),
     1px  1px 0 rgba(255,255,255,0.8);
}

/* 1行ずつふわっと出す用 */
.intro-line{
  display: block;
  opacity: 0;
  transform: translateY(12px);
}


/* ===== プロフィール全体 ===== */
.profile {
  height: 340vh; /* スクロール量（足りなかったら増やす） */
}

.profile-pin {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: #fff8e9; /* フレームと近い色 */
}

/* 画像レイヤー共通（heroの .layer と同じなら省略OK） */
.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: translateZ(0);
  will-change: transform, opacity, filter;
}

/* z-index 調整（前後関係） */
.pf-bg         { z-index: 1; 
                 transform: rotateY(-6vh);} /* 本棚背景 */
.pf-lamp-off   { z-index: 2; } /* ライトOFF */
.pf-lamp-on    { z-index: 3; } /* ライトON */
.profile-title { z-index: 4; } /* タイトル */
.profile-content { z-index: 5; } /* 森さん＋文章 */

/* ===== PROFILE タイトル ===== */
.profile-title {
  font-family: "Jost", sans-serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: italic;
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translateX(-50%);
  font-family: "Zen Old Mincho", serif;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: 0.25em;
  color: #5c4a30;
  opacity: 0;
}

/* 左から書いていくマスク */
.write-mask {
  display: inline-block;
  white-space: nowrap;
  clip-path: inset(0 100% 0 0); /* 最初は全部クリップ */
}

/* ===== 森さん＋自己紹介文 ===== */
.profile-content {
  position: absolute;
   transform: translateY(15vh) !important;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 6vw, 96px);
  padding-inline: clamp(32px, 10vw, 180px);
  opacity: 0;
  transform: translateY(20px +  4vh );
}

.profile-mori {
    transform: scale(1.3) translateY(50px);
    transform-origin: center bottom;
  max-width: min(38%, 420px);
  height: auto;
}

.profile-text {
    transform: translateY(-35px);
  max-width: min(46%, 520px);
  font-size: 15px;
  line-height: 2.0;
  color: #46392a;
}

/* ちょっと読みやすくするための行間だけ微調整したい時はここをいじる
.profile-text {
  line-height: 2.1;
}
*/

/* ===== 章セクション全体 ===== */
.chapters{
  height: 260vh; /* スクロール量。足りなかったら増やしてOK */
}

.chapters-pin{
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* 背景の机 */
.chapters-bg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
}

/* 本3冊の共通スタイル */
.book{
  position: absolute;
  left: 50%;
  top: 10%;
  width: 60vw;
  transform: translate(-50%, -50%);  /* 最初は全部ど真ん中に重なる */
  width: min(56vw, 600px);           /* 本の大きさ（イラストに合わせて調整してOK） */
  text-decoration: none;
  color: inherit;
  z-index: 2;
  cursor: pointer;
  filter:
    drop-shadow(0 8px 16px rgba(0,0,0,0.15))
    drop-shadow(0 2px 4px rgba(0,0,0,0.12));
}

/* 本の画像（閉じ／開き）を重ねる */
.book-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

/* デフォルトでは閉じた本だけ見える */
.book-closed{ opacity: 1; }
.book-open{   opacity: 0; }

/* ホバーで「開いた」イラストに切り替え */
.book:hover .book-closed{
  opacity: 0;
}
.book:hover .book-open{
  opacity: 1;
}

/* ついでにちょっと持ち上がる感じに */
.book:hover{
  transform: translate(-50%, -52%);
}

/* 本の下に影（ふわっと乗ってる感） */
.book::before{
  content: "";
  position: absolute;
  inset: 60% 8% 0 8%;
  background: radial-gradient(ellipse at center,
              rgba(0,0,0,0.24) 0%,
              rgba(0,0,0,0.05) 55%,
              transparent 70%);
  z-index: -1;
}

/* 本の上に乗せるラベル（PROFILEのときみたいな感じ） */
.book-label{
  font-family: "Shippori Mincho B1", serif;
  font-weight: 400;
  font-style: normal;
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
  font-family: "Zen Old Mincho", serif;
  font-size: clamp(12px, 1.3vw, 15px);
  letter-spacing: 0.12em;
  color: #3d2f1e;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
  pointer-events: none; /* クリックは a 全体に通す */
}

/* スマホとかで本が大きすぎたらここで調整 */
@media (max-width: 768px){
  .book{
    width: min(42vw, 420px);
  }
}


/* ===== スクロール後の余白 ===== */
.after{
  height: 140vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.go-next{
  font-size: 18px;
  text-decoration: none;
  color: #333;
  padding: 12px 18px;
  border: 1px solid #ccc;
  border-radius: 999px;
}

@media screen and (max-width: 768px) {

  body {
    font-size: 14px;
  }

  .container {
    width: 90%;
    margin: 0 auto;
  }

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

}