/* ===== リセット & 基本 ===== */
*, *::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-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;
}

/* ===== キャラクター演出 ===== */
/* 画面の下を歩くキャラ */
.chara-layer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  z-index: 90;
  pointer-events: none;
}

.chara-walker {
  position: absolute;
  left: 0;
  bottom: 4px;
  width: 96px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
}

.chara-walker:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; border-radius: 12px; }

.chara-body { display: block; }

.chara-body img {
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.25));
  transform-origin: 50% 100%;
}

.chara-walker.is-walking .chara-body img { animation: charaBob .5s ease-in-out infinite alternate; }
.chara-walker.is-jumping .chara-body img { animation: charaJump .6s ease-out; }

@keyframes charaBob {
  from { transform: translateY(0) rotate(-3deg); }
  to   { transform: translateY(-6px) rotate(3deg); }
}

@keyframes charaJump {
  0%   { transform: translateY(0) scale(1, 1); }
  20%  { transform: translateY(0) scale(1.1, .9); }
  50%  { transform: translateY(-40px) scale(.95, 1.05); }
  100% { transform: translateY(0) scale(1, 1); }
}

/* ふきだし */
.chara-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, 6px);
  margin-bottom: 6px;
  white-space: nowrap;
  background: var(--white);
  color: var(--text);
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  border: 3px solid var(--yellow);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 1;
}

.chara-walker.is-talking .chara-bubble { opacity: 1; transform: translate(-50%, 0); }

.chara-walker.is-edge-left .chara-bubble  { left: 0; transform: translate(0, 6px); }
.chara-walker.is-edge-right .chara-bubble { left: auto; right: 0; transform: translate(0, 6px); }
.chara-walker.is-edge-left.is-talking .chara-bubble,
.chara-walker.is-edge-right.is-talking .chara-bubble { transform: translate(0, 0); }

@media (prefers-reduced-motion: reduce) {
  .chara-body img { animation: none !important; }
}

/* ===== レスポンシブ ===== */
@media (max-width: 860px) {
  .story-content  { flex-direction: column; }
  .story-image    { flex: none; width: 100%; }
}

@media (max-width: 560px) {
  nav ul            { gap: 12px; }
  .hero             { min-height: 100svh; }
  .hero-visual      { flex-direction: column; gap: 12px; }
  .hero-cat         { width: 120px; height: 120px; }
  .hero-title img   { width: min(300px, 85vw); }
  .chara-walker     { width: 68px; }
}
