/* ============================================================
 * decor.css — 装飾（紅葉・バラ・立体フィギュア）と文字の登場演出
 *
 * 仕組み
 *  - HTML の <span data-decor="pumpkin|candle|ghost"> に、js/decor.js が
 *    assets/decor/*.svg をインライン展開する。見た目は ::after の立体フィギュア
 *    （*-figure.webp）で描き、SVG は透明にしてクリック範囲としてだけ使う。
 *  - 状態クラス（JS が付ける）
 *      pumpkin : .is-lit      … 明るくなる（hover / focus / tap）
 *      candle  : .is-flicker  … 光が強くなる（hover / focus / tap）
 *      ghost   : .is-visible  … 画面内に入ったらふわっと出現
 *  - SVG 内のクラス名 .pumpkin-eye .pumpkin-mouth .candle-flame .candle-glow .ghost-body は変更しない
 *
 * 守ること
 *  - 装飾は本文・ボタンに重ねない。pointer-events は装飾自身にのみ持たせる
 *  - reduced-motion 時は動かさない（base.css でも一括停止）
 * ============================================================ */

.decor {
  display: inline-block;
  position: relative;
  line-height: 0;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.decor > svg,
.decor > img {
  width: 100%;
  height: 100%;
  opacity: 0;
}

.decor::after {
  content: "";
  position: absolute;
  inset: 0;
  background: center / contain no-repeat;
  pointer-events: none;
  transition: filter 600ms ease, transform 600ms var(--ease);
}

.decor[role="button"] {
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
}

/* ---------- パンプキン ---------- */
.decor--pumpkin::after {
  background-image: url("../assets/decor/pumpkin-figure.webp");
}

.decor--pumpkin.is-lit::after {
  filter: brightness(1.12) drop-shadow(0 0 14px rgba(230, 140, 60, 0.45));
  transform: rotate(-4deg) scale(1.04);
}

/* ---------- ろうそく ---------- */
.decor--candle::after {
  background-image: url("../assets/decor/candle-single-figure.webp");
}

.decor--candle.is-flicker::after {
  filter: brightness(1.08) drop-shadow(0 0 18px rgba(232, 197, 125, 0.45));
}

.dusk__candle {
  width: clamp(150px, 20vw, 210px);
  height: clamp(150px, 20vw, 210px);
}

.dusk__candle::after {
  background-image: url("../assets/decor/candle-trio-figure.webp");
  filter: drop-shadow(0 10px 24px rgba(86, 16, 34, 0.3));
}

/* ---------- お化け（夜の部では魔女） ---------- */
.decor--ghost {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  pointer-events: none;
}

.decor--ghost::after {
  background-image: url("../assets/decor/ghost-figure.webp");
}

.part--night .decor--ghost::after {
  background-image: url("../assets/decor/witch-figure.webp");
}

.decor--ghost.is-visible {
  opacity: 1;
  transform: none;
  animation: ghost-float 8s ease-in-out infinite;
}

@keyframes ghost-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* セクションの見出し脇に置くフィギュア */
.part__decor {
  position: absolute;
  z-index: 2;
  top: calc(var(--section-pad) - 0.5rem);
  width: clamp(68px, 9vw, 110px);
  height: clamp(68px, 9vw, 110px);
}

.part__decor--pumpkin {
  left: max(var(--gutter), calc(50% - 22rem));
}

.part__decor--ghost {
  right: max(var(--gutter), calc(50% - 22rem));
  height: clamp(84px, 11vw, 136px);
}

@media (max-width: 39.999em) {
  .part__decor {
    top: calc(var(--section-pad) - 2.5rem);
    width: 60px;
    height: 60px;
  }
  .part__decor--ghost {
    height: 76px;
  }
}

/* ---------- 紅葉（セクションの角） ---------- */
.part::before,
.photo::before,
.foodtrucks::before,
.info::before,
.shop-detail::before,
.part::after,
.foodtrucks::after,
.info::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: clamp(110px, 16vw, 200px);
  aspect-ratio: 1;
  background: url("../assets/decor/leaves-corner.svg") center / contain no-repeat;
  pointer-events: none;
  opacity: 0.9;
}

.part::before,
.photo::before,
.foodtrucks::before,
.info::before,
.shop-detail::before {
  top: -0.5rem;
  right: -1.5rem;
  transform: rotate(8deg);
}

.part::after,
.foodtrucks::after,
.info::after {
  bottom: -0.5rem;
  left: -1.5rem;
  transform: rotate(190deg);
}

.photo::before {
  right: auto;
  left: -1.5rem;
  transform: rotate(-80deg);
}

.part--night::before,
.part--night::after {
  opacity: 0.55;
}

@media (max-width: 39.999em) {
  .part::before,
  .photo::before,
  .foodtrucks::before,
  .info::before,
  .shop-detail::before,
  .part::after,
  .foodtrucks::after,
  .info::after {
    width: 96px;
    opacity: 0.75;
  }
}

/* ---------- トップ：紅葉とフィギュア ---------- */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: clamp(130px, 22vw, 280px);
  aspect-ratio: 1;
  background: url("../assets/decor/leaves-corner.svg") center / contain no-repeat;
  pointer-events: none;
}

.hero::before {
  top: -1rem;
  left: -2rem;
  transform: rotate(-95deg);
}

.hero::after {
  top: -1rem;
  right: -2rem;
  transform: rotate(10deg);
}

.hero__decor {
  position: absolute;
  z-index: 2;
  bottom: calc(var(--section-pad) - 2.5rem);
}

.hero__decor--candle {
  left: max(0.5rem, calc(50% - 30rem));
  width: clamp(80px, 11vw, 140px);
  height: clamp(80px, 11vw, 140px);
}

.hero__decor--candle::after {
  background-image: url("../assets/decor/candle-trio-figure.webp");
}

.hero__decor--ghost {
  right: max(0.5rem, calc(50% - 30rem));
  width: clamp(76px, 10vw, 130px);
  height: clamp(84px, 11vw, 144px);
}

.hero__decor--ghost::after {
  filter: drop-shadow(0 8px 18px rgba(86, 16, 34, 0.18));
}

@media (max-width: 47.999em) {
  .hero__decor {
    bottom: calc(var(--section-pad) - 3.25rem);
  }
}

/* ---------- 夜の部：コンテンツ枠の右下にキャンドル ---------- */
.part--night .part__contents::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  bottom: -1.75rem;
  width: clamp(80px, 10vw, 120px);
  height: clamp(90px, 11vw, 136px);
  background: url("../assets/decor/candle-pair-figure.webp") center / contain no-repeat;
  pointer-events: none;
}

/* ---------- フッター：キャンドル ---------- */
.site-footer::before {
  content: "";
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-4);
  background: url("../assets/decor/candle-pair-figure.webp") center / contain no-repeat;
  pointer-events: none;
}

/* ---------- 左右から、一文字ずつゆっくり入る ---------- */
.text-motion { position: relative; }
.text-motion__visual { position: relative; z-index: 1; }
.text-motion__word { display: inline-block; white-space: nowrap; }
.text-motion__glyph { display: inline-block; }

@keyframes letter-cut-in {
  from { opacity: 0; transform: translateX(var(--letter-x)); clip-path: var(--letter-mask); }
  45% { opacity: 1; }
  to { opacity: 1; transform: translateX(0); clip-path: inset(-0.2em); }
}

@media (prefers-reduced-motion: no-preference) {
  .text-motion:not(.text-motion--entered) .text-motion__glyph { opacity: 0; }
  .text-motion--entered .text-motion__glyph {
    animation: letter-cut-in 1400ms cubic-bezier(0.16, 0.7, 0.25, 1) var(--letter-delay) backwards;
  }
}

@media (prefers-reduced-motion: reduce) {
  .decor--ghost,
  .decor--ghost.is-visible {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .decor::after {
    transition: none;
  }
  .decor--pumpkin.is-lit::after {
    transform: none;
  }
  .text-motion__glyph {
    opacity: 1;
    transform: none;
    clip-path: none;
    animation: none;
  }
}

/* バラと紅葉の外周。中央の情報面と操作領域は空ける。 */
.hero::before, .hero::after {
  background-image: url("../assets/decor/rose-maple-corner.svg");
  width: clamp(190px, 32vw, 440px);
  top: -1rem;
  z-index: 2;
}
.hero::before { left: -4rem; transform: scaleX(-1); }
.hero::after { right: -4rem; transform: none; }
.hero__panel::before, .hero__panel::after {
  content: ""; position: absolute; pointer-events: none;
  width: clamp(110px, 18vw, 215px); aspect-ratio: 1;
  background: url("../assets/decor/rose-maple-corner.svg") center / contain no-repeat;
  bottom: -2.75rem; z-index: -1;
}
.hero__panel::before { left: -5rem; transform: rotate(180deg); }
.hero__panel::after { right: -5rem; transform: rotate(90deg); }
.part::before, .photo::before, .foodtrucks::before, .info::before,
.part::after, .foodtrucks::after, .info::after {
  background-image: url("../assets/decor/rose-maple-corner.svg");
  width: clamp(130px, 21vw, 285px);
  opacity: 1;
}
.part::before, .foodtrucks::before, .info::before { transform: none; right: -3rem; }
.photo::before { transform: scaleX(-1); left: -3rem; }
.part::after, .foodtrucks::after, .info::after { transform: rotate(180deg); left: -3rem; }
.part--night::before, .part--night::after { opacity: .8; }
.photo::after {
  content: ""; position: absolute; width: 110px; height: 150px;
  right: -1rem; top: 3rem; pointer-events: none;
  background: url("../assets/decor/antique-cards.svg") center / contain no-repeat;
}
@media (max-width: 63.999em) {
  .hero::before, .hero::after { width: 230px; top: -2rem; }
  .hero::before { left: -6rem; }
  .hero::after { right: -6rem; }
}
@media (max-width: 39.999em) {
  .hero::before, .hero::after { width: 170px; top: -1.5rem; }
  .hero::before { left: -4.5rem; }
  .hero::after { right: -4.5rem; }
  .hero__panel::before { left: -3rem; }
  .hero__panel::after { right: -3rem; }
  .part::before, .photo::before, .foodtrucks::before, .info::before,
  .part::after, .foodtrucks::after, .info::after { width: 115px; }
  .photo::after { width: 65px; height: 90px; top: .5rem; }
}

/* 角のバラは、セクションの境目に接する側をぼかし、境目でまっすぐ切れて見えないようにする。
   ::after は 180 度回転しているので、同じマスクで画面上の下側が消える。 */
.part::before, .photo::before, .foodtrucks::before, .info::before,
.part::after, .foodtrucks::after, .info::after {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 38%);
  mask-image: linear-gradient(180deg, transparent 0, #000 38%);
}

/* 昼の部の左下とフォトスポットの左上のバラが境目で鏡写しに並ぶので、昼の部側は出さない */
.part--day::after {
  content: none;
}

/* Decorative bands: preserve every source image's intrinsic proportions. */
.hero, .part, .photo, .dusk, .foodtrucks, .info, .site-footer {
  overflow: hidden;
}
.hero { padding-top: 110px; padding-bottom: 36px; }
.hero__decor { bottom: 8px; width: 64px; height: 72px; }
/* One garland between the title card and Day; characters now live at cards. */
.part--day > .container::before {
  content: "";
  display: block;
  height: clamp(60px, 10vw, 110px);
  max-width: 700px;
  margin: -32px auto 24px;
  background: url("../assets/decor/halloween-garland.svg") center / contain no-repeat;
  pointer-events: none;
}
.part__decor { top: 24px; left: 28px; right: auto; width: 64px; height: 76px; }
.part__decor--ghost { left: auto; right: 28px; }
.part > .container::after,
.photo > .container::after,
.foodtrucks > .container::after,
.info > .container::after {
  content: ""; display: block; height: 100px;
  margin: 32px auto -24px; max-width: 520px; pointer-events: none;
  background: var(--closing-object) center / auto 90px no-repeat,
    url("../assets/decor/halloween-confetti.svg") center / contain no-repeat;
}
.part--day { --closing-object: url("../assets/decor/candy-swirl.webp"); }
.photo { --closing-object: url("../assets/decor/masquerade-mask.webp"); }
.part--night { --closing-object: url("../assets/decor/friendly-bat.webp"); }
.foodtrucks { --closing-object: url("../assets/decor/magic-cauldron.webp"); }
.info { --closing-object: url("../assets/decor/treat-bucket.webp"); }
.dusk__inner::before {
  content: ""; display: block; width: min(100%, 620px); height: 100px;
  background: url("../assets/decor/friendly-bat.webp") left center / 100px auto no-repeat,
    url("../assets/decor/gold-lantern.webp") right center / auto 90px no-repeat,
    url("../assets/decor/halloween-confetti.svg") center / contain no-repeat;
  pointer-events: none;
}
.site-footer::before {
  width: min(100% - 32px, 600px); height: 130px;
  background: url("../assets/decor/masquerade-mask.webp") left center / 125px auto no-repeat,
    url("../assets/decor/candle-pair-figure.webp") center / 100px auto no-repeat,
    url("../assets/decor/gold-lantern.webp") right center / auto 115px no-repeat,
    url("../assets/decor/halloween-confetti.svg") center / contain no-repeat;
}

/* Six peeking positions. The opaque ::after duplicates the card surface in
   front of the figure; negative z-index alone would paint over its background.
   Content stays above both layers, including future shop photos and links. */
.hero__panel { --peek-image: url("../assets/decor/witch-costume.webp"); --peek-size: 190px; }
.part--day .shop-card:first-child { --peek-image: url("../assets/decor/cat-costume.webp"); }
.part--night .shop-card:first-child { --peek-image: url("../assets/decor/vampire-costume.webp"); }
.photo-card:first-child { --peek-image: url("../assets/decor/ghost-figure.webp"); }
.photo-card:nth-child(2) { --peek-image: url("../assets/decor/pumpkin-figure.webp"); }
.dj-intro { --peek-image: url("../assets/decor/vampire-costume.webp"); }
:is(.hero__panel, .part .shop-card:first-child, .photo-card, .dj-intro) {
  position: relative;
  isolation: isolate;
  overflow: visible;
}
:is(.hero__panel, .part .shop-card:first-child, .photo-card, .dj-intro)::before {
  content: "";
  position: absolute;
  inset: auto 8% calc(100% - var(--peek-size, 150px) * .52) auto;
  width: var(--peek-size, 150px);
  height: var(--peek-size, 150px);
  aspect-ratio: 1;
  background: var(--peek-image) center / contain no-repeat;
  transform: none;
  z-index: -2;
  pointer-events: none;
}
:is(.hero__panel, .part .shop-card:first-child, .photo-card, .dj-intro)::after {
  content: "";
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  background: inherit;
  border-radius: inherit;
  box-shadow: inherit;
  transform: none;
  z-index: -1;
  pointer-events: none;
}
.photo .photo-card:nth-child(2)::before { bottom: calc(100% - 52px); }
/* Reserve space above the first row, independent of card content height. */
.part .shop-grid, .photo__grid, .music-program__grid { margin-top: 100px; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    :is(.hero__panel, .part .shop-card:first-child, .photo-card, .dj-intro)::before {
      animation: card-peek linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }
  }
}
@keyframes card-peek {
  from { transform: translateY(24px); }
  to { transform: translateY(0); }
}
@media (max-width: 39.999em) {
  .hero { padding-top: 82px; padding-bottom: 36px; }
  .hero__panel { --peek-size: 140px; }
  .hero__decor { width: 44px; height: 48px; bottom: 0; }
  .part__decor { top: 4px; width: 42px; height: 48px; }
  .part--day > .container::before { margin-top: -20px; margin-bottom: 20px; }
  .part .shop-card:first-child::before, .photo .photo-card:nth-child(2)::before { content: none; }
  .part .shop-grid { margin-top: var(--space-6); }
  .photo-card, .dj-intro { --peek-size: 120px; }
  .photo__grid, .music-program__grid { margin-top: 80px; }
  .part > .container::after, .photo > .container::after,
  .foodtrucks > .container::after, .info > .container::after {
    height: 68px; margin-top: 24px; background-size: auto 62px, contain;
  }
  .dusk__inner::before { height: 70px; background-size: 70px auto, auto 65px, contain; }
  .site-footer::before { height: 95px; background-size: 86px auto, 74px auto, auto 88px, contain; }
}

/* Photographic props: contained in reserved margins, no peeking over content. */
.hero { padding-top: 100px; padding-bottom: 240px; }
.hero::before, .hero::after,
.part--day::before {
  background: url("../assets/decor/photo-rose-corner.webp") center / contain no-repeat;
  aspect-ratio: 1376 / 1152;
  height: auto;
  width: clamp(180px, 27vw, 390px);
  opacity: 1;
  z-index: 0;
  mask-image: none;
  -webkit-mask-image: none;
}
.hero::before { top: 0; left: -30px; transform: none; }
.hero::after { top: 0; right: -30px; transform: scaleX(-1); }
.hero__panel::before, .hero__panel::after,
.part--day .shop-card:first-child::before,
.part--day .shop-card:first-child::after { content: none; }
.hero .hero__decor--ghost { display: none; }
.hero .hero__decor--candle {
  left: 50%; bottom: 12px; width: 330px; height: 220px;
  transform: translateX(-50%);
}
.hero .hero__decor--candle::after,
.part--day .part__decor--pumpkin::after {
  background: url("../assets/decor/photo-autumn-still-life.webp") center / contain no-repeat;
}
.part--day::before { top: 32px; right: -90px; transform: scaleX(-1); width: 240px; }
.part--day::after { content: none; }
.part--day > .container::before {
  height: clamp(60px, 10vw, 100px);
  max-width: 700px;
  margin: -32px auto 24px;
  background: url("../assets/decor/photo-garland-lights.webp") center top / contain no-repeat;
}
.part--day .part__decor--pumpkin { display: none; }
.part--day > .container::after {
  height: 200px; max-width: 300px; margin: 40px auto 0;
  background: url("../assets/decor/photo-autumn-still-life.webp") center / contain no-repeat;
}
@media (max-width: 63.999em) {
  .hero::before, .hero::after { width: 230px; }
  .hero::before { left: -60px; }
  .hero::after { right: -60px; }
  .part--day::before { width: 160px; right: -70px; top: 0; }
}
@media (max-width: 39.999em) {
  .hero { padding-top: 72px; padding-bottom: 162px; }
  .hero::before, .hero::after { width: 145px; top: 0; }
  .hero::before { left: -35px; }
  .hero::after { right: -35px; }
  .hero .hero__decor--candle { width: 225px; height: 150px; bottom: 4px; }
  .part--day::before { width: 110px; right: -48px; }
  .part--day > .container::before { margin: -20px auto 16px; height: 58px; }
  .part--day > .container::after { height: 140px; max-width: 210px; margin-top: 28px; }
}
/* The original :is() peek rule has card-level specificity. Hide its layers explicitly. */
.hero .hero__panel::before, .hero .hero__panel::after,
.part--day .shop-card:first-child::before, .part--day .shop-card:first-child::after { display: none; }
.hero .hero__crown {
  background: none; height: 1px; width: 100px;
  border-top: 1px solid var(--ornament); margin-bottom: 2rem;
}
.part--day .part__title::after {
  background: none; height: 1px; width: 100px;
  border-top: 1px solid var(--ornament); margin-block: 1.25rem;
}

/* Photographic continuation. Props occupy their own flow space, never cards. */
.part--night .shop-card:first-child::before,
.part--night .shop-card:first-child::after,
.photo .photo-card::before, .photo .photo-card::after,
.part--night .dj-intro::before, .part--night .dj-intro::after,
.part--night .part__contents::after, .dusk__inner::before,
.photo::after, .part--night::after, .foodtrucks::after, .info::after {
  content: none; display: none;
}
.part--night .part__decor--ghost { display: none; }
.photo::before, .part--night::before, .foodtrucks::before,
.info::before, .shop-detail::before {
  background: url("../assets/decor/photo-rose-corner.webp") center / contain no-repeat;
  aspect-ratio: 1376 / 1152;
  height: auto; width: clamp(120px, 18vw, 230px);
  top: 20px; right: -80px; left: auto; transform: scaleX(-1);
  opacity: .8; z-index: 0;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 35%, #000 80%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 35%, #000 80%, transparent);
}
.photo::before { left: -80px; right: auto; transform: none; }
.foodtrucks::before { top: 170px; }
.part--night::before { opacity: .45; }
.part--day > .container::after,
.photo > .container::after, .part--night > .container::after,
.foodtrucks > .container::after, .info > .container::after,
.shop-detail > .container::after {
  content: ""; display: block; position: relative;
  width: min(100%, 330px); max-width: 330px; height: 220px;
  margin: 40px auto 0;
  background: var(--still-life) center / contain no-repeat;
  pointer-events: none;
}
.part--day { --still-life: url("../assets/decor/photo-tea-still-life.webp"); }
.photo { --still-life: url("../assets/decor/photo-books-clock.webp"); }
.part--night { --still-life: url("../assets/decor/photo-garland-lights.webp"); }
.part--night > .container::after { width: min(100%, 520px); max-width: 520px; height: 100px; }
.foodtrucks { --still-life: url("../assets/decor/photo-lantern-candy.webp"); }
.info { --still-life: url("../assets/decor/photo-books-clock.webp"); }
.shop-detail { --still-life: url("../assets/decor/photo-tea-still-life.webp"); }
.dusk__candle { width: min(100%, 380px); height: 270px; }
.dusk__candle::after {
  background: url("../assets/decor/photo-night-candles.webp") center / contain no-repeat;
}
.site-footer::before {
  width: min(100% - 32px, 280px); height: 190px;
  background: url("../assets/decor/photo-night-candles.webp") center / contain no-repeat;
  margin-bottom: 24px;
}
@media (max-width: 39.999em) {
  .photo::before, .part--night::before, .foodtrucks::before,
  .info::before, .shop-detail::before { width: 100px; right: -55px; opacity: .55; }
  .photo::before { left: -55px; right: auto; }
  .part--day > .container::after, .photo > .container::after,
  .foodtrucks > .container::after, .info > .container::after,
  .shop-detail > .container::after { width: 230px; height: 155px; margin-top: 28px; }
  .part--night > .container::after { height: 70px; }
  .dusk__candle { width: 280px; height: 200px; }
  .site-footer::before { width: 230px; height: 155px; }
}
