/* =========================================================
   ぐるぐる2 から移植した部分（なかまたち・動画・書籍情報・購入・フッター）
   背景・動画・草むら・紙は Higgsfield で生成した素材です。
   ========================================================= */

:root {
  /* --- Higgsfield 生成素材 --- */
  --img-paper:  url("https://d2ol7oe51mr4n9.cloudfront.net/user_3KXjd93xVGUjcQ960cc0xMpzkMt/958679a8-8e69-4713-ab14-ed5c9fef9e24.webp");
  --img-grass:  url("https://d2ol7oe51mr4n9.cloudfront.net/user_3KXjd93xVGUjcQ960cc0xMpzkMt/37cd8c3c-2449-42ef-8bf3-d76a6be4a946.webp");
  --img-kitchen: url("https://d2ol7oe51mr4n9.cloudfront.net/user_3KXjd93xVGUjcQ960cc0xMpzkMt/efec63e2-d2da-4d43-a23d-b319e096726a.webp");

  /* --- 色（水彩のパレット） --- */
  --paper:   #fbf6ea;
  --ink:     #4a3b2f;
  --ink-soft:#7a6656;
  --leaf:    #6f9a4a;
  --leaf-dk: #557a36;
  --sky:     #9cc7e0;
  --roof:    #c8553d;
  --honey:   #e9b25c;
  --night:   #1d2350;

  --font-title: "Kaisei Decol", "Zen Maru Gothic", serif;
  --font-hand:  "Yomogi", "Zen Maru Gothic", cursive;
  --font-body:  "Zen Maru Gothic", sans-serif;

  --radius-paper: 18px 26px 20px 30px / 26px 18px 30px 20px;
  --shadow-soft: 0 10px 30px rgba(74, 59, 47, .12);
}

/* ===== ものがたり（あらすじ） ===== */
.story-catch {
  max-width: 820px;
  margin: -24px auto 48px;
  text-align: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  line-height: 1.7;
  letter-spacing: .06em;
  color: var(--leaf-dk);
}
.story-text p { line-height: 2; }
.story-question {
  font-family: var(--font-hand);
  font-size: 1.15rem !important;
  color: var(--roof);
}

/* 移植部分の画像は、style.css の img（全面カバー）の設定を打ち消す */
.friends img, .book img, .buy img { width: auto; height: auto; object-fit: contain; }

/* あらすじの下に草むらがかかるので、少し余白をあける */
.story { padding-bottom: 60px; }

/* ===== 草むら（Higgsfield 生成） ===== */
.grass {
  position: absolute;
  left: 0; right: 0;
  height: 140px;
  background: var(--img-grass) center bottom / auto 100% repeat-x;
  pointer-events: none;
  z-index: 2;
}
.grass--top { top: -110px; }

/* ===== 見出し ===== */
.section-head { text-align: center; margin-bottom: 56px; position: relative; z-index: 3; }
.section-head__en {
  font-family: var(--font-hand);
  color: var(--leaf);
  letter-spacing: .3em;
  font-size: .95rem;
}
.section-head__title {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  letter-spacing: .15em;
  line-height: 1.4;
}
.section-head__title::after {
  content: "";
  display: block;
  width: 120px;
  height: 14px;
  margin: 10px auto 0;
  background:
    radial-gradient(circle at 10px 7px, var(--leaf) 4px, transparent 5px) 0 0 / 30px 14px repeat-x;
  opacity: .6;
}
/* 「えをタップすると…」は吹き出し風 */
.section-head__hint {
  position: relative;
  display: inline-block;
  margin-top: 14px;
  padding: .45em 1.3em;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  animation: hintBob 2.6s ease-in-out infinite;
}
.section-head__hint::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -9px;
  width: 14px; height: 14px;
  background: #fff;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}
@keyframes hintBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .section-head__hint,
  .buy__bubble { animation: none; }
}
.section-head--light .section-head__en { color: #ffe6a6; }
.section-head--light .section-head__title { color: #fff8e6; text-shadow: 0 2px 16px rgba(0, 0, 0, .35); }
.section-head--light .section-head__title::after {
  background: radial-gradient(circle at 10px 7px, #ffe6a6 4px, transparent 5px) 0 0 / 30px 14px repeat-x;
}

/* ===== なかまたち ===== */
.friends {
  position: relative;
  padding: 80px 20px 160px;
  background: linear-gradient(#eaf3dc, #f4f8ea);
}
.friends__list {
  list-style: none;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.friend:nth-child(2) { transition-delay: .1s; }
.friend:nth-child(3) { transition-delay: .2s; }
.friend:nth-child(4) { transition-delay: .3s; }

.friend__card {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 18px 28px;
  border: none;
  cursor: pointer;
  background: #fffdf6;
  border-radius: var(--radius-paper);
  box-shadow: var(--shadow-soft);
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1), box-shadow .35s;
}
.friend:nth-child(odd) .friend__card { transform: rotate(-1.2deg); }
.friend:nth-child(even) .friend__card { transform: rotate(1.2deg); }
.friend__card:hover,
.friend__card:focus-visible { transform: translateY(-8px) rotate(0); box-shadow: 0 18px 36px rgba(74, 59, 47, .18); }
.friend__card:focus-visible { outline: 3px solid var(--leaf); outline-offset: 4px; }

.friend__art {
  width: 100%;
  height: 260px;
  display: grid;
  place-items: center;
  border-radius: 14px 20px 16px 22px;
  margin-bottom: 16px;
  overflow: hidden;
}
.friend__art img { max-height: 240px; width: auto; transition: transform .5s; }
.friend__card:hover .friend__art img { transform: rotate(-3deg) scale(1.05); }
.friend__art--sky  { background: radial-gradient(circle at 50% 60%, #ffffff, #d6e9f3); }
.friend__art--rose { background: radial-gradient(circle at 50% 60%, #ffffff, #f6e1e4); }
.friend__art--mint { background: radial-gradient(circle at 50% 60%, #ffffff, #dcefe2); }
.friend__art--photo img { max-height: none; width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%; }

.friend__name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: .1em;
  margin-bottom: .4em;
}
.friend__text { font-size: .93rem; line-height: 1.85; color: var(--ink-soft); }

.friend__bubble {
  position: absolute;
  top: -14px;
  left: 50%;
  z-index: 2;
  padding: .45em 1em;
  white-space: nowrap;
  font-family: var(--font-hand);
  font-size: 1.05rem;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 20px;
  transform: translate(-50%, 8px) scale(.6);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), opacity .2s;
}
.friend__bubble::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -9px;
  width: 14px; height: 14px;
  background: #fff;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}
.friend__card.is-talking .friend__bubble { opacity: 1; transform: translate(-50%, 0) scale(1); }
.friend__card.is-talking .friend__art img { animation: hop .5s ease; }
@keyframes hop {
  0%, 100% { transform: none; }
  40% { transform: translateY(-14px); }
}

/* ===== どうが ===== */
.movie {
  position: relative;
  padding: 120px 20px;
  background: var(--img-kitchen) center / cover;
}
.movie::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(60, 40, 20, .45);
}
.movie__inner { position: relative; max-width: 900px; margin: 0 auto; }
.movie__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  padding: 14px;
  background: #8a5a36;
  border-radius: 18px;
  box-shadow: 0 0 0 6px #6b4226, 0 24px 50px rgba(0, 0, 0, .4);
}
.movie__frame iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; display: block; background: #000; }

/* ===== ほんのこと（夜） ===== */
.book {
  position: relative;
  padding: 130px 20px 140px;
  overflow: hidden;
  isolation: isolate;
  background: var(--night);
}
.book__video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}
.book__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(rgba(29, 35, 80, .35), rgba(29, 35, 80, .55));
}
.book__inner { max-width: 960px; margin: 0 auto; }
.book__card {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: center;
  padding: 36px 40px;
  background: rgba(255, 253, 246, .95);
  border-radius: var(--radius-paper);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .35);
}
.book__cover {
  position: relative;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f7ecd2, #eedcb4);
  border-radius: 6px 14px 14px 6px;
  box-shadow: inset 10px 0 0 #d9b98a, 6px 8px 18px rgba(0, 0, 0, .2);
}
.book__cover img { width: 100%; mix-blend-mode: multiply; }
.book__meta div {
  display: grid;
  grid-template-columns: 7em 1fr;
  padding: .6em 0;
  border-bottom: 1px dashed rgba(74, 59, 47, .25);
}
.book__meta dt { font-weight: 700; color: var(--leaf-dk); }

/* ===== えほんを買う ===== */
.buy { background: var(--paper) var(--img-paper) center / cover; font-family: var(--font-body); padding: 120px 20px 200px; text-align: center; position: relative; }
.buy__shops {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto 60px;
}
.shop {
  flex: 1 1 220px;
  max-width: 280px;
  padding: 1em 1.2em;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  color: #fff;
  transition: transform .25s, box-shadow .25s;
}
.shop:hover { transform: translateY(-3px); }
.shop--amazon  { background: #e8902f; box-shadow: 0 6px 0 #b86d1c; }
.shop--rakuten { background: #c8553d; box-shadow: 0 6px 0 #993c29; }
.shop--yahoo   { background: #8a6bb0; box-shadow: 0 6px 0 #674f86; }

.buy__soon {
  display: block;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 0 auto 60px;
  padding: .8em 2em;
  font-family: var(--font-hand);
  font-size: 1.25rem;
  letter-spacing: .1em;
  line-height: 1.7;
  text-align: center;
  color: var(--ink);
  background: #fffdf6;
  border: 2px dashed var(--leaf);
  border-radius: var(--radius-paper);
  box-shadow: var(--shadow-soft);
}
.buy__thanks { display: inline-flex; flex-direction: column; align-items: center; }
.buy__thanks img { width: 180px; }
.buy__bubble {
  position: relative;
  margin-bottom: 14px;
  padding: .5em 1.3em;
  font-family: var(--font-hand);
  font-size: 1.2rem;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 24px;
  animation: hintBob 2.6s ease-in-out infinite;
}
.buy__bubble::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -9px;
  width: 14px; height: 14px;
  background: #fff;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}
.reveal.is-visible .buy__thanks img { animation: bow 2.4s ease-in-out .6s infinite; transform-origin: 50% 90%; }
@keyframes bow {
  0%, 60%, 100% { transform: none; }
  20%, 40% { transform: rotate(8deg) translateY(4px); }
}

/* ===== フッター ===== */
.footer {
  position: relative;
  padding: 60px 20px 40px;
  background: #6f9a4a;
  color: #fff;
  text-align: center;
}
.footer .grass--top { top: -120px; }
.footer__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 26px; margin-bottom: 16px; }
.footer__nav a { text-decoration: none; font-weight: 700; color: #fff; }
.footer__nav a:hover { text-decoration: underline; }
.footer__copy { font-size: .85rem; opacity: .85; }

/* ===== スクロールでふわっと ===== */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ===== タブレット ===== */
@media (max-width: 960px) {
  .friends__list { grid-template-columns: repeat(2, 1fr); }
  .book__card { grid-template-columns: 1fr; }
  .book__cover { max-width: 260px; margin: 0 auto; }
}

/* ===== スマホ ===== */
@media (max-width: 720px) {
  .grass { height: 100px; }
  .grass--top { top: -80px; }
  .friends__list { grid-template-columns: 1fr; max-width: 380px; }
  .book__card { padding: 26px 20px; }
  .book__meta div { grid-template-columns: 6em 1fr; font-size: .95rem; }
}

/* ===== 動きを減らす設定 ===== */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .friend__card, .friend__bubble, .friend__art img { transition: none; }
  .friend__card.is-talking .friend__art img, .reveal.is-visible .buy__thanks img { animation: none; }
}

/* ===== 題字（動画の下） ===== */
.title-logo {
  background: var(--white);
  padding: 56px 20px 0;
  text-align: center;
}
.title-logo__inner { margin: 0; }
.title-logo__inner img {
  display: block;
  width: min(640px, 88vw);
  height: auto;
  margin: 0 auto;
}

/* ===== 文章の改行を言葉の切れ目でそろえる ===== */
.wb { display: inline-block; }
.story-text p,
.story-catch,
.friend__text { text-wrap: pretty; word-break: auto-phrase; }

/* ===== ヘッダー（いちばん上のバー）を絵本らしく ===== */
.site-header {
  background: rgba(251, 246, 234, .94);
  backdrop-filter: blur(6px);
  border-bottom: 2px dashed rgba(111, 154, 74, .45);
  box-shadow: 0 4px 18px rgba(74, 59, 47, .08);
}
.header-inner { height: 68px; gap: 20px; }
.logo { display: block; flex-shrink: 0; line-height: 0; }
.logo img {
  width: auto;
  height: 34px;
  object-fit: contain;
  transition: transform .3s;
}
.logo:hover img { transform: rotate(-3deg) scale(1.04); }
.site-header nav ul { gap: 6px; }
.site-header nav a {
  display: block;
  padding: .35em .9em;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .08em;
  white-space: nowrap;
  color: var(--ink);
  border-radius: 999px;
  transition: background .2s, color .2s;
}
.site-header nav a:hover,
.site-header nav a:focus-visible {
  color: var(--leaf-dk);
  background: rgba(111, 154, 74, .14);
}

@media (max-width: 640px) {
  .header-inner {
    height: auto;
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px 6px;
  }
  .logo img { height: 26px; }
  .site-header nav ul { gap: 2px; }
  .site-header nav a { font-size: .85rem; padding: .3em .7em; letter-spacing: .04em; }
}
