@charset "utf-8";
/* トップのヒーロー（4場面・index.html のみ）
   - ふつうの1画面。場面は js/hero.js が時間で自動に進め（.hx[data-scene]）、見た目の変化は CSS の時間で完結させる
     （2026-10-01 にスクロールで場面を進める張りつけをやめた＝スクロールするとページがそのまま動く）
   - 奥行き: 背景 → 光 → 手前（しずく・吹き出し・道具）を層に分け、マウス位置 --mx/--my（-1..1）で手前ほど大きくずらす
   - 動きを減らす設定では、ずらし・浮遊・波紋・流れを止め、切り替えは不透明度だけにする */

.hx {
  --mx: 0; --my: 0;
  --hx-top: 76px;
  --hx-h: calc(100svh - var(--hx-top));
  position: relative;
  background: var(--paper);
}
.hx__stage {
  position: relative;
  height: var(--hx-h); min-height: 560px;
  overflow: hidden; isolation: isolate;
  perspective: 1200px;
}

/* ---------- 背景・光・文字の下地 ---------- */
.hx__bg {
  position: absolute; inset: -5%; z-index: -3;
  background: #bfe6f0 url("../assets/hero/bg.webp") center 60% / cover no-repeat;
  transform: translate3d(calc(var(--mx) * -10px), calc(var(--my) * -6px), 0) scale(var(--zoom, 1.04));
  transition: transform 1.6s cubic-bezier(.22, .61, .36, 1);
}
.hx[data-scene="1"] { --zoom: 1.07; }
.hx[data-scene="2"] { --zoom: 1.11; }
.hx[data-scene="3"] { --zoom: 1.06; }
.hx__rays {
  position: absolute; inset: 0; z-index: -2; pointer-events: none; mix-blend-mode: screen; opacity: .55;
  background:
    linear-gradient(115deg, transparent 38%, rgba(255,255,255,.35) 45%, transparent 52%),
    linear-gradient(110deg, transparent 55%, rgba(255,255,255,.25) 60%, transparent 66%),
    radial-gradient(ellipse at 78% 8%, rgba(255,255,240,.55), transparent 55%);
  transform: translate3d(calc(var(--mx) * -4px), 0, 0);
}
.hx__veil {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(245,251,253,.94) 0%, rgba(245,251,253,.82) 30%, rgba(245,251,253,.35) 50%, rgba(245,251,253,0) 62%);
}

/* ---------- 手前の世界（しずく・吹き出し・道具・封筒） ---------- */
.hx__world { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }

.hx__actor {
  position: absolute; right: 18%; bottom: 13%;
  width: clamp(190px, 21vw, 310px); aspect-ratio: 451 / 486;
  transform: translate3d(calc(var(--mx) * 22px), calc(var(--my) * 12px), 60px);
  transition: transform .9s cubic-bezier(.22, .61, .36, 1);
}
.hx__float { position: absolute; inset: 0; animation: hx-bob 3.4s ease-in-out infinite; }
.hx__pose {
  position: absolute; left: 50%; bottom: 0; width: 100%; height: auto;
  transform: translateX(-50%) scale(.92); transform-origin: 50% 100%;
  opacity: 0;
  transition: opacity .55s ease, transform .75s cubic-bezier(.34, 1.4, .64, 1);
  /* 水面への映り込み（対応ブラウザのみ） */
  -webkit-box-reflect: below -6px linear-gradient(transparent 62%, rgba(255,255,255,.28));
  filter: drop-shadow(0 18px 22px rgba(20, 80, 110, .22));
}
.hx[data-scene="0"] .hx__pose--0,
.hx[data-scene="1"] .hx__pose--1,
.hx[data-scene="2"] .hx__pose--2,
.hx[data-scene="3"] .hx__pose--3 { opacity: 1; transform: translateX(-50%) scale(1); }
/* ひらめき・拍手: ぴょんと跳ねる（2026-10-01 しずくをポーズ集に差し替え・旧3枚目の飛び込みはやめた） */
.hx[data-scene="2"] .hx__float { animation: hx-hop .9s cubic-bezier(.34, 1.56, .64, 1) both, hx-bob 3.4s .9s ease-in-out infinite; }
.hx[data-scene="3"] .hx__float { animation: hx-hop .9s cubic-bezier(.34, 1.56, .64, 1) both, hx-bob 3.4s .9s ease-in-out infinite; }

/* 水面の波紋: 水平に寝かせた輪を広げる（斜めから見た楕円＝奥行き） */
.hx__ripples { position: absolute; left: 50%; bottom: -4%; width: 180%; aspect-ratio: 1; transform: translate(-50%, 50%) rotateX(76deg); transform-style: preserve-3d; }
.hx__ripples i {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.75); box-shadow: 0 0 18px rgba(255,255,255,.5);
  opacity: 0; transform: scale(.15);
  animation: hx-ring 3.6s ease-out infinite;
}
.hx__ripples i:nth-child(2) { animation-delay: 1.2s; }
.hx__ripples i:nth-child(3) { animation-delay: 2.4s; }
.hx[data-scene="2"] .hx__ripples i { animation-duration: 1.8s; border-width: 4px; }
.hx[data-scene="2"] .hx__ripples i:nth-child(1) { animation-delay: .75s; }
.hx[data-scene="2"] .hx__ripples i:nth-child(2) { animation-delay: 1.35s; }
.hx[data-scene="2"] .hx__ripples i:nth-child(3) { animation-delay: 1.95s; }

/* 吹き出し → 道具（同じ場所で入れ替わる） */
.hx__thing {
  position: absolute; width: clamp(96px, 10.5vw, 150px); aspect-ratio: 1;
  transform: translate3d(calc(var(--mx) * var(--d, 30px)), calc(var(--my) * var(--d, 30px) * .6), 90px);
  transition: transform .9s cubic-bezier(.22, .61, .36, 1);
}
.hx__thing--a { right: 36%; top: 24%; --d: 34px; }
.hx__thing--b { right: 11%; top: 16%; --d: 26px; }
.hx__thing--c { right: 34%; bottom: 14%; --d: 40px; }
.hx__bubble {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  padding: 11px 18px; border-radius: 22px; white-space: nowrap;
  color: var(--ink); background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: 0 12px 30px rgba(20, 80, 110, .18), inset 0 1px 0 rgba(255,255,255,.9);
  font-family: var(--font-hand); font-weight: 600; font-size: clamp(14px, 1.25vw, 17px);
  opacity: 0; transform: translate(-50%, -30%) scale(.7) rotateY(calc(var(--mx) * 10deg));
  transition: opacity .45s ease, transform .6s cubic-bezier(.34, 1.56, .64, 1);
}
.hx__bubble::after {
  content: ""; position: absolute; bottom: -9px; left: 26px;
  border: 9px solid transparent; border-top-color: rgba(255,255,255,.8); border-bottom: 0;
}
.hx__item {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transform: scale(.4) rotate(-14deg);
  filter: drop-shadow(0 16px 20px rgba(20, 80, 110, .25));
  transition: opacity .5s ease, transform .8s cubic-bezier(.34, 1.56, .64, 1);
}
.hx[data-scene="1"] .hx__bubble { opacity: 1; transform: translate(-50%, -50%) scale(1) rotateY(calc(var(--mx) * 10deg)); }
.hx[data-scene="1"] .hx__thing--b .hx__bubble { transition-delay: .12s; }
.hx[data-scene="1"] .hx__thing--c .hx__bubble { transition-delay: .24s; }
.hx[data-scene="2"] .hx__item { opacity: 1; transform: scale(1) rotate(var(--r, -6deg)); animation: hx-drift 4s ease-in-out 1s infinite alternate; }
.hx[data-scene="2"] .hx__thing--a .hx__item { transition-delay: .5s; --r: -8deg; }
.hx[data-scene="2"] .hx__thing--b .hx__item { transition-delay: .62s; --r: 6deg; }
.hx[data-scene="2"] .hx__thing--c .hx__item { transition-delay: .74s; --r: -4deg; }

/* 依頼の封筒が水路を流れてくる（場面4） */
.hx__flow { position: absolute; left: 0; right: 0; bottom: 8%; height: 30%; }
.hx__env {
  position: absolute; left: 0; bottom: 0; width: clamp(70px, 7vw, 110px); height: auto;
  opacity: 0; filter: drop-shadow(0 12px 16px rgba(20, 80, 110, .22));
}
.hx[data-scene="3"] .hx__env { animation: hx-flow 5.4s cubic-bezier(.3, .1, .3, 1) infinite; }
.hx[data-scene="3"] .hx__env--2 { animation-delay: 1.8s; bottom: 26%; width: clamp(56px, 5.5vw, 86px); }
.hx[data-scene="3"] .hx__env--3 { animation-delay: 3.6s; bottom: 10%; width: clamp(62px, 6vw, 96px); }

/* ---------- 文字（場面ごとに入れ替え） ---------- */
.hx__copy { position: absolute; inset: 0; display: grid; align-items: center; pointer-events: none; }
.hx__panel {
  grid-area: 1 / 1; max-width: min(560px, 48%);
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity .5s ease, transform .6s cubic-bezier(.22, .61, .36, 1), visibility 0s linear .6s;
}
.hx__panel.is-on {
  opacity: 1; visibility: visible; transform: none; pointer-events: auto;
  transition: opacity .6s ease .15s, transform .7s cubic-bezier(.22, .61, .36, 1) .15s, visibility 0s;
}
.hx__hello { margin: 0 0 12px; color: var(--accent); font-family: var(--font-hand); font-weight: 600; font-size: clamp(16px, 1.5vw, 20px); }
.hx h1, .hx h2 { margin: 0 0 20px; font-size: clamp(32px, 4.3vw, 58px); line-height: 1.35; letter-spacing: -.02em; }
/* 1行目が10文字ある見出し（2026-10-01「お店のネットのこと、」）は少し小さく＝枠 560px に収める */
.hx h1.hx__h1-long { font-size: clamp(30px, 3.6vw, 50px); }
.hx__lead { margin: 0 0 26px; color: var(--ink-2); font-size: clamp(15px, 1.3vw, 18px); line-height: 1.95; }
.hx__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hx__note { margin: 18px 0 0; color: var(--ink-2); font-size: 12px; }

/* ---------- 場面の点・とばす ---------- */
.hx__dots {
  position: absolute; right: clamp(12px, 2.4vw, 32px); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 6px;
}
.hx__dots button {
  width: 44px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.hx__dots button::before {
  content: ""; width: 10px; height: 10px; border-radius: 99px;
  background: rgba(35,64,90,.25); box-shadow: 0 0 0 2px rgba(255,255,255,.8);
  transition: height .35s ease, background .35s ease;
}
.hx__dots button[aria-current="step"]::before { height: 26px; background: rgba(23,130,122,.3); }
/* 今の場面の点：次の場面へ進むまでの残り時間で満ちていく（--hx-dur は js/hero.js が場面ごとに入れる） */
.hx__dots button::before, .hx__dots button::after { grid-area: 1 / 1; }
.hx__dots button[aria-current="step"]::after {
  content: ""; width: 10px; height: 26px; border-radius: 99px; background: var(--accent);
  transform-origin: 50% 0; animation: hx-fill var(--hx-dur, 4200ms) linear both;
}
.hx.is-paused .hx__dots button[aria-current="step"]::after { animation-play-state: paused; }
@keyframes hx-fill { from { transform: scaleY(.38); } to { transform: scaleY(1); } }
.hx__dots button:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 2px; border-radius: 8px; }

/* ---------- アニメーション ---------- */
@keyframes hx-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes hx-hop { 0% { transform: translateY(8%); } 45% { transform: translateY(-16%); } 100% { transform: translateY(0); } }
@keyframes hx-ring { 0% { opacity: .9; transform: scale(.12); } 100% { opacity: 0; transform: scale(1); } }
@keyframes hx-drift { from { translate: 0 -5px; } to { translate: 0 6px; } }
@keyframes hx-flow {
  0% { opacity: 0; transform: translate3d(-10vw, 0, 0) rotate(-10deg); }
  12% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(62vw, -4vh, 0) rotate(8deg) scale(.8); }
}

/* ---------- 狭い画面 ---------- */
@media (max-width: 860px) {
  /* スマホも同じく自動で進む1画面（2026-09-29 の iPhone のカクつき対策が先。2026-10-01 に PC も同じにした） */
  .hx { --hx-top: 68px; }
  .hx__stage { min-height: 600px; perspective: none; }
  /* iPhone の Safari で重い効果は外す（映り込み・背景ぼかし・光の重ね塗り・3D の文脈） */
  .hx__world { transform-style: flat; }
  .hx__pose { -webkit-box-reflect: unset; filter: none; }
  .hx__item, .hx__env { filter: none; }
  .hx__rays { display: none; }
  .hx__bubble { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255,255,255,.92); }
  .hx__ripples i { box-shadow: none; }
  .hx__bg { background-image: url("../assets/hero/bg-sm.webp"); background-position: 62% 60%; }
  .hx__veil { background: linear-gradient(180deg, rgba(245,251,253,.95) 0%, rgba(245,251,253,.88) 42%, rgba(245,251,253,.2) 62%, rgba(245,251,253,0) 75%); }
  .hx__copy { align-items: start; padding-top: 26px; }
  .hx__panel { max-width: 100%; }
  .hx h1, .hx h2 { font-size: clamp(28px, 7.6vw, 40px); margin-bottom: 12px; }
  .hx__lead { margin-bottom: 16px; font-size: 14px; line-height: 1.85; }
  .hx__lead br { display: none; }
  .hx__cta .btn { flex: 1 1 auto; min-height: 48px; }
  .hx__note { display: none; }
  .hx__actor { right: auto; left: 50%; bottom: 11%; width: clamp(140px, 38vw, 215px); margin-left: calc(clamp(140px, 38vw, 215px) / -2); }
  /* 吹き出しは画面の端で切れないよう、左右どちらかの端に寄せて置く（中央基準にしない） */
  .hx__thing { width: clamp(70px, 21vw, 110px); }
  .hx__thing--a { right: auto; left: 5%; top: auto; bottom: 44%; }
  .hx__thing--b { right: 5%; top: auto; bottom: 35%; }
  .hx__thing--c { right: auto; left: 7%; bottom: 26%; }
  .hx__bubble { font-size: 13px; padding: 8px 12px; left: 0; transform: translate(0, -30%) scale(.7); transform-origin: 0 50%; }
  .hx__thing--b .hx__bubble { left: auto; right: 0; transform-origin: 100% 50%; }
  .hx__thing--b .hx__bubble::after { left: auto; right: 22px; }
  .hx[data-scene="1"] .hx__bubble { transform: translate(0, -50%) scale(1); }
  .hx__dots { top: auto; bottom: 64px; transform: none; right: 6px; }
}
@media (max-width: 860px) and (max-height: 700px) {
  .hx__lead { display: none; }
}

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  .hx { --mx: 0 !important; --my: 0 !important; }
  .hx__bg, .hx__actor, .hx__thing { transition: none; }
  .hx__float, .hx[data-scene] .hx__float, .hx__item, .hx[data-scene="2"] .hx__item { animation: none !important; }
  .hx__ripples { display: none; }
  .hx__pose, .hx__bubble, .hx__item, .hx__panel, .hx__panel.is-on { transition: opacity .3s ease, visibility 0s; transform: none !important; }
  .hx__pose { transform: translateX(-50%) !important; }
  .hx__bubble { transform: translate(-50%, -50%) !important; }
  .hx[data-scene="3"] .hx__env { animation: none; opacity: 1; }
  .hx__env--1 { left: 30%; } .hx__env--2 { left: 45%; bottom: 26%; } .hx__env--3 { left: 58%; bottom: 10%; }
}

/* 画面外では常時アニメを止める（js/hero.js が付ける） */
.hx.is-off * { animation-play-state: paused !important; }
