/* ===== リセット & 基本 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange:  #FF8C42;
  --yellow:  #FFD166;
  --pink:    #FF6B9D;
  --blue:    #87CEEB;
  --cream:   #FFF9F0;
  --white:   #FFFFFF;
  --text:    #3D2B1F;
  --text-light: #7A5C4F;
  --radius:  20px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Zen Maru Gothic', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.8;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ===== ヘッダー ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--orange);
  letter-spacing: .05em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: .95rem;
  transition: color .2s;
}

nav a:hover { color: var(--orange); }

.nav-btn {
  background: var(--orange);
  color: var(--white) !important;
  padding: 8px 20px;
  border-radius: 50px;
  transition: background .2s !important;
}

.nav-btn:hover { background: #e07030 !important; }

/* ===== ヒーロー（全画面動画） ===== */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 動画本体 */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* 動画がない間のフォールバック背景 */
.hero-fallback {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #3D2B1F 0%, #7A3B5A 50%, #2B3D5F 100%);
  z-index: 1;
}

/* 動画読み込み後は fallback を非表示 */
.hero-video:not([src=""]) ~ .hero-fallback { display: none; }

/* 暗いオーバーレイ */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 2;
}

/* テキストコンテンツ */
.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 24px;
  animation: fadeUp .9s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-catch {
  font-size: 1.1rem;
  color: var(--yellow);
  font-weight: 700;
  letter-spacing: .2em;
  margin-bottom: 16px;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  transform: translateX(-220px);
}

.hero-cat {
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  margin-left: -20px;
}

.hero-cat img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.4));
}

.hero-title {
  margin: 0;
}

.hero-title img {
  width: min(380px, 55vw);
  height: auto;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.5));
  animation: leafFloat 2.8s ease-out both;
  animation-delay: 0.2s;
}

@keyframes leafFloat {
  0% {
    opacity: 0;
    transform: scale(0.12) rotate(-70deg) translate(-500px, -600px);
  }
  10% { opacity: 1; }
  28% {
    transform: scale(0.4) rotate(35deg) translate(160px, -220px);
  }
  46% {
    transform: scale(0.62) rotate(-22deg) translate(-100px, -60px);
  }
  63% {
    transform: scale(0.8) rotate(14deg) translate(60px, 30px);
  }
  78% {
    transform: scale(0.93) rotate(-6deg) translate(-18px, 8px);
  }
  90% {
    transform: scale(0.99) rotate(2deg) translate(4px, -2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg) translate(0, 0);
  }
}

.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,.85);
  margin-bottom: 44px;
  line-height: 2;
}

.btn-primary {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 900;
  padding: 16px 48px;
  border-radius: 50px;
  box-shadow: 0 8px 28px rgba(255,140,66,.45);
  transition: transform .2s, box-shadow .2s;
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(255,140,66,.55);
}

/* スクロール誘導矢印 */
.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  animation: bounce 2s ease-in-out infinite;
}

.scroll-arrow {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 3px solid rgba(255,255,255,.7);
  border-bottom: 3px solid rgba(255,255,255,.7);
  transform: rotate(45deg);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(10px); }
}

/* ===== セクション共通 ===== */
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900;
  text-align: center;
  margin-bottom: 56px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 5px;
  background: var(--orange);
  border-radius: 4px;
  margin: 12px auto 0;
}

/* ===== あらすじ ===== */
.story { background: var(--white); }

.story-content {
  display: flex;
  gap: 56px;
  align-items: center;
}

.story-image {
  flex: 0 0 360px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.1);
  height: 260px;
}

.story-text { flex: 1; }

.story-text p { margin-bottom: 20px; font-size: 1.05rem; }

.story-sound {
  font-size: 1.5rem;
  color: #FF0000;
  font-weight: 900;
}

.story-note {
  background: #FFF0D6;
  border-left: 5px solid var(--orange);
  padding: 14px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 700;
  color: var(--orange);
  margin-top: 28px !important;
}

/* ===== キャラクター ===== */
.characters {
  background: linear-gradient(180deg, #FFF4E6 0%, #FFE9F5 100%);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.character-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,.07);
  transition: transform .25s;
}

.character-card:hover { transform: translateY(-8px); }

.char-img-wrap {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 20px;
  border: 5px solid var(--yellow);
}

.char-img-wrap img.contain {
  object-fit: contain;
  background: var(--cream);
}

.character-card h3 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--orange);
  margin-bottom: 10px;
}

.character-card p {
  font-size: .95rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* ===== 書籍情報 ===== */
.book-info { background: var(--white); }

.book-detail {
  display: flex;
  gap: 64px;
  align-items: flex-start;
  justify-content: center;
}

.book-cover {
  position: relative;
  flex: 0 0 220px;
  height: 290px;
  border-radius: 6px 16px 16px 6px;
  overflow: hidden;
  box-shadow: -6px 6px 24px rgba(0,0,0,.18);
}

.book-meta { flex: 1; max-width: 480px; }

.book-meta table { width: 100%; border-collapse: collapse; }

.book-meta th, .book-meta td {
  padding: 14px 16px;
  border-bottom: 1px dashed #E8D8CC;
  font-size: 1rem;
  vertical-align: top;
}

.book-meta th {
  width: 110px;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
}

/* ===== 購入 ===== */
.buy {
  background: linear-gradient(135deg, #FFE4D6, #FFD6EC);
  text-align: center;
}

.buy-sub {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 40px;
  margin-top: -36px;
}

.buy-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-shop {
  display: inline-block;
  text-decoration: none;
  color: var(--white);
  font-weight: 900;
  font-size: 1rem;
  padding: 16px 32px;
  border-radius: 50px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
}

.btn-shop:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,.2);
}

.amazon  { background: #FF9900; }
.rakuten { background: #BF0000; }
.yahoo   { background: #FF0033; }

/* ===== フッター ===== */
.site-footer {
  background: var(--text);
  color: var(--white);
  padding: 48px 24px;
  text-align: center;
}

.footer-logo {
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 20px;
  color: var(--yellow);
}

.footer-nav {
  margin-bottom: 24px;
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-nav a {
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .9rem;
  transition: color .2s;
}

.footer-nav a:hover { color: var(--white); }

.footer-copy {
  font-size: .8rem;
  color: rgba(255,255,255,.4);
}

/* ===== ハンバーガーメニュー（共通） ===== */
.nav-toggle   { display: none; }
.nav-hamburger { display: none; }

/* ===== タブレット (〜860px) ===== */
@media (max-width: 860px) {
  .story-content  { flex-direction: column; }
  .story-image    { flex: none; width: 100%; height: 220px; }
  .character-grid { grid-template-columns: repeat(2, 1fr); }
  .book-detail    { flex-direction: column; align-items: center; }
  .section-inner  { padding: 60px 20px; }
}

/* ===== スマートフォン (〜560px) ===== */
@media (max-width: 560px) {

  /* --- ヘッダー --- */
  .header-inner {
    position: relative;
    justify-content: center;
    height: 56px;
  }

  .logo {
    font-size: 1.4rem;
  }

  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 200;
    padding: 4px;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
  }

  .nav-hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
  }

  /* チェック時：× に変形 */
  .nav-toggle:checked ~ .nav-hamburger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-hamburger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-hamburger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  /* --- モバイルナビ --- */
  .site-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,249,240,.97);
    z-index: 150;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .nav-toggle:checked ~ .site-nav { display: flex; }

  .site-nav ul {
    flex-direction: column;
    gap: 32px;
    text-align: center;
  }

  .site-nav a {
    font-size: 1.3rem;
  }

  .site-nav .nav-btn {
    padding: 14px 40px;
    font-size: 1.2rem;
  }

  /* --- ヒーロー --- */
  .hero          { min-height: 100svh; }
  .hero-visual   {
    flex-direction: column;
    gap: 12px;
    transform: translateX(0);
  }
  .hero-title img  { width: min(280px, 82vw); }
  .hero-catch      { font-size: .95rem; letter-spacing: .1em; }
  .hero-sub        { font-size: .95rem; margin-bottom: 32px; }
  .btn-primary     { font-size: 1rem; padding: 14px 36px; }

  /* --- あらすじ --- */
  .section-inner  { padding: 48px 16px; }
  .section-title  { font-size: 1.5rem; margin-bottom: 36px; }
  .story-image    { height: 180px; }
  .story-text p   { font-size: 1rem; }
  .story-sound    { font-size: 1.35rem; }

  /* --- キャラクター --- */
  .character-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .character-card { padding: 20px 12px; }
  .char-img-wrap  { width: 120px; height: 120px; }
  .character-card h3 { font-size: 1.1rem; }
  .character-card p  { font-size: .85rem; }

  /* --- 書籍情報 --- */
  .book-cover   { flex: none; width: 160px; height: 210px; }
  .book-meta th,
  .book-meta td { font-size: .9rem; padding: 10px 12px; }

  /* --- 購入 --- */
  .buy-buttons  { flex-direction: column; align-items: center; }
  .btn-shop     { width: 240px; text-align: center; }

  /* --- フッター --- */
  .footer-nav   { gap: 16px; }
}
