/* 全体 */
body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #fff;
  color: #333;
  scroll-behavior: smooth;
}

/* ヘッダー */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: transparent; /* 完全透明 */
  text-align: center;
  padding: 1.5rem 1rem;
  border-bottom: none; /* 境界線も消す場合 */
  z-index: 1000;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: normal;
}

header p {
  margin: 0.2rem 0 0;
  color: #666;
}

/* フォント集 */
.rocknroll-one-regular {
  font-family: "RocknRoll One", sans-serif;
  font-weight: 400;
  font-style: normal;
}
.sansation-regular {
  font-family: "Sansation", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.sansation-light {
  font-family: "Sansation", sans-serif;
  font-weight: 300;
  font-style: normal;
}

/* プロフィール欄 */
.top-section {
  position: relative;
  width: 100%;       /* 画面幅に合わせる */
  max-width: 900px;  /* PCは最大900pxに */
  height: 100px;          /* 高さ固定 */
  margin: 0rem auto 10rem auto;      /* 上下余白＋中央寄せ */

  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
 }

/* 名前 */
.top-name {
  display: inline-block;
  position: relative;
  font-size: 2.2rem;
  z-index: 1;
   /* フォント変更 */
   
   font-weight: bold;
  
  }

.top-name a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* 名前下のグラデーションバー */
.top-name::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transition: width 0.5s ease;
}

.top-name:hover::after {
  width: 100%; /* ホバーで左から右に伸びる */
}

/* 職業タイトル */
.top-title {
  font-size: 1.2rem;
  margin: 0.5rem 0 0;
  position: relative;
  z-index: 1;
  /* フォント変更 */
  font-family: "RocknRoll One", sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* ナビゲーション */
.nav-links {
  flex-direction: column;
  position: fixed;
  top: 60px;
  right: 10px;
  background: rgba(255,255,255,0.95);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1000;
  width:20%;
  max-width: 80vw;
  box-sizing: border-box;

  transform: translateX(120%);
  transition: transform 0.3s ease;
  display: flex;

  font-family: "Sansation", sans-serif;
  font-weight: 400; 
}

.nav-links a {
  text-decoration: none;
  color: #333; 

  font-family: "Sansation", sans-serif  !important;
  font-weight: 400; 
}

.nav-links a:hover {
  color: #00bcd4;

}

/* メニューボタン */
.menu-toggle {
  font-family: "Sansation", sans-serif !important;
  font-weight: 400; 
  position: fixed;
  top: 15px;
  right: 30px;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  z-index: 1001;
  transition: background 0.3s ease;

  color: #333;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

/* ホバー時に暗くする */
.menu-toggle:hover {
  filter: brightness(0.9); /* 数値小さいほど暗くなる */
}

/* メニュー表示時 */
.nav-links.show {
  transform: translateX(0); /* 表示時は元の位置にスライド */
}

/* リンクのスタイル */
.nav-links a {
  text-decoration: none;
  color: #333;
  font-size: 1.4rem;    /* 文字サイズ */
  line-height: 2rem;    /* 行間 */
  margin: 0.8rem 0;     /* リンク間の余白 */
  transition: color 0.3s ease;
  font-family: "Sansation", sans-serif;
  font-weight: 400; 

}

/* スマホ用メニュー幅（幅を広く） */
@media (max-width: 768px) {
  .nav-links {
    width: 60%;         /* スマホでは70%幅に */
    right: 0;           /* 右端に合わせる */
    padding: 2rem 1.5rem; /* 内側の余白も少し増やす */
  }
}

/* メイン */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 130px 1rem 2rem; /* ヘッダー分余白確保 */
}

.work-main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 10px 1rem 2rem; /* WORK専用の上余白 */
}


/* -------------------------
   WORKメニュー共通
   ------------------------- */
.workmenu {
  display: flex;
  flex-wrap: wrap;          /* 複数行でも崩れにくく */
  justify-content: center;  /* 横中央揃え */
  gap: 12px;                /* ボタン間の余白 */
  padding: 0.5rem 0;        /* 上下余白 */
  position: relative;  /* z-index を有効にするため */
  z-index: 10;         /* ヘッダーより大きめ */
  margin-top: 120px;   /* ヘッダーの高さ分だけ下げる */
}

.workmenu a {
  display: inline-flex;      /* ブロック化＋文字中央配置 */
  align-items: center;       /* 文字を縦中央に */
  justify-content: center;   /* 横中央揃え */
  text-decoration: none;
  color: #555;               /* 文字色 */
  font-weight: 500;
  font-size: 1rem;
  padding: 6px 16px;         /* 上下6px、左右16pxで文字に沿う */
  border: 1px solid #555;    /* 枠線 */
  border-radius: 20px;
  background: transparent;
  text-align: center;
  transition: all 0.3s ease;
  white-space: nowrap;       /* 折り返さない */
  cursor: pointer;           /* タップ可能 */
  box-sizing: border-box;    /* 枠線・padding込みでサイズ計算 */
}

/* 現在ページ */
.workmenu a.active {
  background-color: #E8E8E8;
  color: #333;
  border-color: #333;
  pointer-events: none;
}

/* ホバー時 */
.workmenu a:hover {
  background-color: #E8E8E8;
  color: #222;
  border-color: #222;
}

/* -------------------------
   スマホ用（幅768px以下）
   ------------------------- */
@media (max-width: 768px) {
  .workmenu {
    gap: 10px;              /* スマホでは少し狭め */
    justify-content: center;
    flex-wrap: wrap;
  }

  .workmenu a {
    flex: 0 0 45%;          /* 2列風に配置 */
    max-width: 140px;       /* 最大幅 */
    padding: 6px 12px;      /* スマホでも文字に沿った余白 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ギャラリー */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(300px, 1fr));
  gap: 20px;
  justify-items: center;
}


.gallery a {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item {
  width: 200px;       /* 横幅統一 */
  height: 300px;      /* 縦長長方形統一 */
  object-fit: cover;  /* 画像の中央切り取りで縦横比調整 */
  cursor: pointer;
  transition: transform 0.3s, filter 0.3s;
  
}

.gallery-item:hover {
  transform: scale(1.05);      /* 少し拡大 */
  filter: brightness(0.8);     /* 暗くする */
}

.gallery-item:active {
  transform: scale(0.98);      /* クリック時少し縮む */
  filter: brightness(0.9);     /* クリック時も暗め */
}
.gallery a:hover img{
  transform: translateY(4px);
  box-shadow: 0 1px 10px rgba(0,0,0,0.2);
  transform: scale(1.05);  /* 同じく拡大 */
filter: brightness(0.8);     /* 暗くする */
}

.gallery a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s ease;
}

.gallery a:hover img {
  transform: scale(1.05);
}

/* INDEXページのPortfolio画像をスマホで2列に */
@media (max-width: 768px) {
  #portfolio .gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2列に変更 */
    gap: 10px;                             /* 画像間の隙間 */
    justify-items: center;
    width: 100%;
  }

  #portfolio .gallery a {
    width: 100%;
    aspect-ratio: 1 / 1;  /* 枠の縦横比を固定 */
    overflow: hidden;
    display: block;
  }

  #portfolio .gallery a img {
    width: 100%;
    height: 100%;
    object-fit: cover;       /* 枠いっぱいに収めて切り取る */
    object-position: center; /* 中央を基準に切り取り */
    display: block;
  }
}


/* WORKギャラリー一覧 - 3列中央寄せ */
.gallery.grid {
   display: grid;
  grid-template-columns: repeat(3, 200px); /* 横幅200pxで3列固定 */
  gap: 15px;                               /* 画像同士の間隔 */
  justify-content: center;                  /* グリッド全体を中央に寄せる */
}

/* WORKギャラリー - スマホ用 */
@media (max-width: 768px) {
  .gallery.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2列 */
    gap: 10px;                             /* 画像間の隙間 */
    padding: 0 2px;                        /* 画面端の余白 */
    justify-items: center;                  /* 各セル中央揃え */
  }

  .gallery-item {
    width: 100%;       /* 枠いっぱいに広げる */
    aspect-ratio: 3/4; /* 縦長比率に統一 */
    object-fit: cover; /* 中央トリミングで縦横比揃える */
  }
}

/* モーダル全体 */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* トラックは横並びにするけど、幅を可変に */
.modal-track {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}

/* 画像1枚ごとに画面いっぱいの枠を確保 */
.modal-track img {
  flex: 0 0 100%;        /* 1枚＝100%幅 → 常に1枚だけ表示 */
  width: 80%;            /* 画像自体のサイズ（ここで調整） */
  max-height: 80%;
  margin: auto;          /* 中央寄せ */
  object-fit: contain;   /* 縦横比を保持して収める */
}

/* ナビゲーションボタン */
.prev, .next {
  color: white;
  font-size: 3em;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  user-select: none;
  z-index: 10000;
}
.prev { left: 20px; }
.next { right: 20px; }
.close {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 70px;
  color: white;      /* 文字色を指定 */
  cursor: pointer;
  z-index: 10000;    /* 他の要素より前面に表示 */
}
/* オーバーレイ */
.gallery .overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  font-size: 1.5rem;
  text-align: center;
  padding: 10px;
  transition: opacity 0.3s ease;
  /* フォント変更 */
  font-family: "RocknRoll One", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.gallery a:hover .overlay {
  opacity: 1;
}

@media (max-width: 768px) {
  .gallery .overlay {
    opacity: 1;
    background: rgba(0,0,0,0.3);
    font-size: 1rem;
  }
}

/* スマホ用（幅600px以下） */
@media (max-width: 600px) {
  .modal .close {
    font-size: 2rem;
  }

  /* ナビボタン非表示 */
  .modal .prev,
  .modal .next {
    display: none;
  }
}


#portfolio,
#works,
#contact {
  scroll-margin-top: 50px; /* 固定ヘッダーの高さに合わせて調整 */
}

.portfolio-title,
.works-title,
.contact-title {
  text-align: center;
  font-size: 2rem;
  margin: 0rem 0 2rem;
  font-weight: bold;
  color: #333;

  opacity: 0;
  transform: translateY(-30px); /* 落ちる高さを控えめに */
  animation: bounceDrop 1s forwards;
  animation-timing-function: ease-out; /* 固さを減らす */

 font-family: "Sansation", sans-serif;
  }

@keyframes bounceDrop {
  0% {
    opacity: 0;
    transform: translateY(-30px);
  }
  50% {
    opacity: 1;
    transform: translateY(10px); /* 少し下に落ちる */
  }
  70% {
    transform: translateY(-7px); /* 少し上に戻る */
  }
  85% {
    transform: translateY(3px);  /* 小さく上下 */
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}



/* Portfolioセクション */
.portfolio-section {
  max-width: 1200px;      /* 全体幅の上限 */
  margin: 20rem auto 4rem auto; /* 上下マージン */
  padding: 1rem;
  text-align: center;
}

/* タイトル */
.portfolio-section h1 {
  font-size: 2rem;
  margin: 0 0 2rem 0;
  font-weight: bold;
  color: #333;

  opacity: 0;
  transform: translateY(-30px);
  }


/* Worksセクション */
.works-section {
  max-width: 800px;
  margin: 20rem auto 4rem auto;
  padding: 1rem;
  text-align: center;
}

.works-section h1 {
  font-size: 2rem;
  margin: 0 0 2rem 0;
  font-weight: bold;
  color: #333;

  opacity: 0;
  transform: translateY(-30px);
  }

.works-list ul {
  list-style: none;
  padding: 0;
  margin: 2rem auto;
  max-width: 500px;
  text-align: left;
}

.works-list li {
  margin: 0.6rem 0;
  font-size: 1rem;
}

/* Contactセクション */
.contact-section {
  max-width: 800px;
  margin: 20rem auto 4rem auto;
  padding: 1rem;
  text-align: center;
}

.contact-section h1 {
   text-align: center;
  font-size: 2rem;
  margin: 2rem auto 2rem auto; 
  font-weight: bold;
  color: #333;
}

.contact-section::before {
  content: "";
  display: block;
}

/* Contactフォーム */
.form-wrapper {
  max-width: 600px;
  margin: 30px auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 10px rgba(0,0,0,0.2);
  text-align: left;
}

.form-wrapper h1,
.form-wrapper p {
  text-align: center;
  margin-bottom: 15px;
}

.form-wrapper label {
  display: block;
  margin-bottom: 15px;
  font-weight: bold;
  color: #333;
}

.form-wrapper input,
.form-wrapper textarea {
  width: 100%;
  padding: 12px 14px;
  margin-top: 5px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
  box-sizing: border-box;
}

.form-wrapper textarea {
  min-height: 120px;
  resize: vertical;
}

.required {
  color: red;
}

.form-wrapper button {
  width: 200px;
  padding: 10px 0;
  background-color: #333;
  color: #fff;
  font-size: 16px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  display: block;
  margin: 20px auto 0;
  transition: background-color 0.2s ease;
}

.form-wrapper button:hover {
  background-color: #555;
}

/* reCAPTCHA */
.g-recaptcha {
  margin: 20px 0;
  display: flex;
  justify-content: center;
}

/* スクロールトップ */
#scrollTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  opacity: 0;
  pointer-events: none;
  background-color: rgba(0, 188, 212, 1);
  color: white;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  text-decoration: none;
  transition: opacity 0.5s, transform 0.2s;
  z-index: 9988;
}

#scrollTop.show {
  opacity: 1;
  pointer-events: auto;
}

#scrollTop:hover {
  background-color: rgba(0, 188, 212, 0.6);
  transform: translateY(-2px);
}

/* スクロールトップスマホ */
@media (max-width: 640px) {
  #scrollTop {
    width: 50px;
    height: 50px;
    line-height: 50px;
    font-size: 1.5rem;
    bottom: 20px;
    right: 20px;
  }
}

/* レスポンシブフォーム */
@media (max-width: 640px) {
  .form-wrapper {
    margin: 20px;
    padding: 20px;
  }
  .form-wrapper input,
  .form-wrapper textarea,
  .form-wrapper button {
    font-size: 16px;
    padding: 10px 12px;
  }
}

/* :target::before を無効化 */
:target::before {
  content: none;
  display: none;
}

/* reCAPTCHA をスマホ幅に合わせる */
@media (max-width: 480px) {
  .g-recaptcha {
    transform: scale(0.75);  /* スケールで小さくする */
    transform-origin: topleft;   /* 左上基準で縮小 */
    width: 100% !important;  /* 親要素幅に合わせる */
  }
}

/* フッター */
footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid #eee;
  color: #999;
  font-size: 0.9rem;
}

/* モバイル用 */
@media (max-width: 768px) {
  html, body {
    touch-action: pan-x pan-y pinch-zoom; /* スクロールとピンチ両方OK */
    overscroll-behavior: contain;
  }

  .gallery-item {
    touch-action: pan-y pinch-zoom; /* 縦スクロールとピンチ拡大はOK */
  }
}

/* -------------------------
   絵本モーダル
------------------------- */
#ebook-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 9999;
}

#ebook-modal.show {
  opacity: 1;
}

.ebook-modal-content {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 2000px;
}

.page {
  width: 45%;
  max-height: 80%;
  object-fit: contain;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  transition: transform 0.8s ease, box-shadow 0.8s ease;
  backface-visibility: hidden;
  position: relative;
  z-index: 1;
  background-size: cover;
  background-position: center;
}

/* 左ページめくり */
.page.left.flip-left {
  transform-origin: right center;
  animation: flipLeftAnim 0.6s forwards;
  z-index: 2;
}

/* 右ページめくり */
.page.right.flip-right {
  transform-origin: left center;
  animation: flipRightAnim 0.6s forwards;
  z-index: 2;
}

/* 左ページアニメーション（右端固定、右に手前めくり） */
@keyframes flipLeftAnim {
  0% { transform: rotateY(0deg); box-shadow: 0 0 20px rgba(0,0,0,0.3);}
  50% { transform: rotateY(90deg); box-shadow: 10px 0 40px rgba(0,0,0,0.6);}
  100% { transform: rotateY(180deg); box-shadow: 20px 0 60px rgba(0,0,0,0.7);}
}

/* 右ページアニメーション（左端固定、左に手前めくり） */
@keyframes flipRightAnim {
  0% { transform: rotateY(0deg); box-shadow: 0 0 20px rgba(0,0,0,0.3);}
  50% { transform: rotateY(-90deg); box-shadow: -10px 0 40px rgba(0,0,0,0.6);}
  100% { transform: rotateY(-180deg); box-shadow: -20px 0 60px rgba(0,0,0,0.7);}
}

/* 裏側に次ページ表示 */
.page.left::after,
.page.right::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  backface-visibility: hidden;
  background-size: cover;
  background-position: center;
  transform: rotateY(180deg);
  z-index: -1;
}

/* 表紙 */
#ebook-cover {
  max-width: 60%;
  max-height: 80%;
  object-fit: contain;
  box-shadow: 0 0 25px rgba(0,0,0,0.4);
  z-index: 3;
}

/* ナビ矢印 */
.ebook-modal .prev,
.ebook-modal .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.2em 0.5em;
  user-select: none;
  transition: opacity 0.3s ease;
}

.ebook-modal .prev { left: 1%; }
.ebook-modal .next { right: 1%; }

.ebook-modal .close {
  position: absolute;
  top: 1%;
  right: 1%;
  font-size: 2.5rem;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
}

/* 矢印フェード用（JSで制御） */
.ebook-modal .prev.hidden,
.ebook-modal .next.hidden {
  opacity: 0;
  pointer-events: none;
}

/* スマホ対応 */
@media (max-width: 600px) {
  .ebook-modal .prev,
  .ebook-modal .next {
    display: none !important; /* ここで強制的に非表示 */
  }
  .ebook-modal .close { font-size: 2rem; }
}

/* 絵本サムネイル用 */
#ebook-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2%;
  max-width: 1200px;
  margin: 2rem auto;
}

#ebook-gallery a {
  display: block;
  width: 48%;          /* PCは2列 */
  aspect-ratio: 1/1;   /* 正方形 */
  overflow: hidden;
  margin-bottom: 2%;
}

#ebook-gallery a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease, filter 0.3s ease;
}

#ebook-gallery a:hover img {
  transform: scale(1.05);
  filter: brightness(0.8);
}

/* スマホ用：縦1列 */
@media (max-width: 768px) {
  #ebook-gallery a {
    width: 98%;
    margin: 1% 0;
  }
}

