/* TOP page (vertical scroll) */
/*
 * Z-INDEX階層構造（animations.cssとの連携）:
 * - panel-bg-image: auto (背景画像)
 * - animations.css疑似要素 (bg-aurora, bg-stars, particle-dots): z-index: 1
 * - panel-bg-overlay: z-index: 1 (オーバーレイは半透明なのでアニメーション効果も透過)
 * - panel-inner: z-index: 2 (コンテンツ)
 *
 * アニメーションシステム:
 * - CSS: top.css (パネルのフェードイン、中央からスケールアップ)
 * - CSS: animations.css (背景エフェクト、ホバー効果)
 * - JS: scroll-animations.js (IntersectionObserverでis-visible付与、パララックス)
 * - JS: top-hero.js (GSAP補助アニメーション)
 * - JS: top-cast-inertia.js (キャストカードのドラッグスクロール)
 *
 * レイアウト:
 * - concept/cast セクションは全て中央配置
 * - アニメーションは中央からスケールアップ（scale 0.85 → 1）
 */
:root {
  --header-h: 88px;
}

/* Ensure vertical flow */
main {
  display: block;
}

body {
  overflow-x: hidden;
}

/* JavaScript disabled/failed: keep every TOP section readable. */
html:not(.motion-ready) .page-top .panel,
html:not(.motion-ready) .page-top .panel-card,
html:not(.motion-ready) .page-top .panel-bg-image,
html:not(.motion-ready) .page-top .cast-intro-content,
html:not(.motion-ready) .page-top .cast-scroll-wrapper,
html:not(.motion-ready) .page-top .cast-card,
html:not(.motion-ready) .page-top .panel-content > * {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  clip-path: none !important;
  animation: none !important;
  transition: none !important;
}

/* Continuous effects only consume resources while their panel is visible. */
.page-top .panel:not(.is-motion-active),
.page-top .panel:not(.is-motion-active) *,
.page-top .panel:not(.is-motion-active)::before,
.page-top .panel:not(.is-motion-active)::after,
.page-top .panel:not(.is-motion-active) *::before,
.page-top .panel:not(.is-motion-active) *::after {
  animation-play-state: paused !important;
}

/* Promote animated layers only for the panel currently being rendered. */
.panel-hero.is-motion-active .hero-media {
  will-change: transform, filter;
}

.panel-hero.is-motion-active .hero-haze,
.panel-hero.is-motion-active .hero-light,
.panel-hero.is-motion-active .hero-dust {
  will-change: transform;
}

.panel-hero.is-motion-active .hero-copy,
.panel-cast.is-motion-active .cast-track,
.panel-cast.is-motion-active .cast-card {
  will-change: transform, opacity;
}

.panel-cast.is-motion-active .cast-list-hover-color-lines::before {
  will-change: background-position, transform;
}

.panel-cast.is-motion-active .cast-list-hover-color-lines::after,
.panel.is-motion-active .ambient-particles::before,
.panel.is-motion-active .ambient-particles::after {
  will-change: transform, opacity;
}

/* Panel animations - おしゃれなフェードイン */
.panel {
  opacity: 0;
}

.panel.is-visible {
  animation: panelFadeIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes panelFadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

/* Panel background animations */
.panel-bg-image {
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

.panel.is-visible .panel-bg-image {
  opacity: 1;
  transform: scale(1);
}

/* Panel card animations - 中央からスケールアップ */
.panel-card {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.panel.is-visible .panel-card {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.3s;
}

/* Cast intro content animation */
/* Cast intro animations - 中央からスケールアップ */
.panel-cast .cast-intro-content {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.panel-cast.is-visible .cast-intro-content {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.3s;
}

/* Cast scroll wrapper animation */
.cast-scroll-wrapper {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.panel.is-visible .cast-scroll-wrapper {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.6s;
}

/* Panel content children stagger */
/* Panel content children - 中央からフェードイン */
.panel-content>* {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.panel.is-visible .panel-content>*:nth-child(1) {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.5s;
}

.panel.is-visible .panel-content>*:nth-child(2) {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.7s;
}

.panel.is-visible .panel-content>*:nth-child(3) {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.9s;
}

/* Cast intro content children - 中央からフェードイン */
.panel-cast .cast-intro-content>* {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.panel-cast.is-visible .cast-intro-content>*:nth-child(1) {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.5s;
}

.panel-cast.is-visible .cast-intro-content>*:nth-child(2) {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.7s;
}

.panel-cast.is-visible .cast-intro-content>*:nth-child(3) {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.9s;
}

/* Hero Scene & Parallax Layers */
.hero-scene {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  overflow: hidden;
  z-index: 1;
  transform-style: preserve-3d;
  perspective: 1000px;
  /* Displacement maximum limit variables */
  --bg-shift: 30px;
  --haze-shift: 50px;
  --light-shift: 20px;
  --dust-shift: 70px;
  --copy-shift: -20px;
  --hero-intro-scale: 1;
  --hero-intro-blur: 0;
}

@media (max-width: 768px) {
  .hero-scene {
    /* Mobile shifts: weakened to about 25% of PC to reduce movement and improve rendering performance */
    --bg-shift: 8px;
    --haze-shift: 12px;
    --light-shift: 5px;
    --dust-shift: 18px;
    --copy-shift: -5px;
  }
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform: translate(calc(var(--mouse-x, 0) * 2px), calc(var(--hero-progress, 0) * var(--bg-shift) + var(--mouse-y, 0) * 2px)) scale(var(--hero-intro-scale, 1));
  filter: blur(calc(var(--hero-intro-blur, 0) * 1px));
}

.hero-media picture,
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .hero-media img {
    object-position: center 40%;
  }
}

.hero-haze {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(ellipse at 50% 50%, rgba(201, 53, 69, 0.15) 0%, transparent 80%);
  pointer-events: none;
  transform: translate(calc(var(--mouse-x, 0) * 6px), calc(var(--hero-progress, 0) * var(--haze-shift) + var(--mouse-y, 0) * 6px));
}

.hero-light {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(circle at 50% 20%, rgba(212, 175, 55, 0.15) 0%, transparent 60%);
  pointer-events: none;
  mix-blend-mode: screen;
  transform: translateY(calc(var(--hero-progress, 0) * var(--light-shift)));
}

.hero-dust {
  position: absolute;
  inset: 0;
  z-index: 4;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(212, 175, 55, 0.7) 100%, transparent 0),
    radial-gradient(2px 2px at 75% 40%, rgba(212, 175, 55, 0.8) 100%, transparent 0),
    radial-gradient(1.5px 1.5px at 50% 80%, rgba(212, 175, 55, 0.6) 100%, transparent 0),
    radial-gradient(2.5px 2.5px at 85% 20%, rgba(212, 175, 55, 0.5) 100%, transparent 0),
    radial-gradient(2px 2px at 15% 70%, rgba(212, 175, 55, 0.6) 100%, transparent 0);
  background-size: 100% 100%;
  pointer-events: none;
  transform: translate(calc(var(--mouse-x, 0) * 10px), calc(var(--hero-progress, 0) * var(--dust-shift) + var(--mouse-y, 0) * 10px));
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  background:
    radial-gradient(circle at 50% 50%, rgba(11, 11, 13, 0.25) 0%, rgba(11, 11, 13, 0.6) 70%, rgba(11, 11, 13, 0.95) 100%),
    linear-gradient(to bottom, transparent 60%, rgba(11, 11, 13, 0.98) 100%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 6;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transform: translate(calc(var(--mouse-x, 0) * 3px), calc(var(--hero-progress, 0) * var(--copy-shift) + var(--mouse-y, 0) * 3px));
  opacity: calc(1 - var(--hero-progress, 0) * 0.7);
  text-align: center;
}

/* Hero mark (logo) styling */
.hero-mark {
  width: 92px;
  height: 92px;
  margin: 0 auto 20px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 10px rgba(212, 175, 55, 0.15));
}

.hero-scroll-cue {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 7;
  text-decoration: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-scroll-cue.is-hidden {
  opacity: 0 !important;
  pointer-events: none;
  transform: translate(-50%, 10px) !important;
}

.hero-scroll-cue:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.9);
  outline-offset: 6px;
  border-radius: 4px;
}

.scroll-cue-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.scroll-text {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(212, 175, 55, 0.8);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.scroll-line {
  display: block;
  flex: 0 0 auto;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(212, 175, 55, 0.8), transparent);
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .scroll-line {
    height: 30px;
  }
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #FFF;
  animation: scrollLineAnim 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes scrollLineAnim {
  0% {
    transform: translateY(-100%);
  }
  80%, 100% {
    transform: translateY(100%);
  }
}

/* Hero CTA buttons */
.hero-cta {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-cta .btn {
  min-width: 160px;
}

/* Cast section - Rebuilt for reliability */
.panel-cast {
  position: relative;
  overflow: hidden;
}

/* Cast scroll container with frame - 中華高級スタイル */
.cast-scroll-wrapper {
  position: relative;
  z-index: 4;
  overflow: hidden;
  isolation: isolate;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(22px, 2.2vw, 32px);
  background: linear-gradient(135deg,
      rgba(74, 24, 32, 0.9) 0%,
      rgba(106, 36, 48, 0.92) 25%,
      rgba(139, 47, 62, 0.95) 50%,
      rgba(106, 36, 48, 0.92) 75%,
      rgba(74, 24, 32, 0.9) 100%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  box-shadow:
    0 16px 64px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(212, 175, 55, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 0 60px rgba(201, 53, 69, 0.2);
}

.cast-list-heading {
  position: absolute;
  top: clamp(13px, 1.8vh, 18px);
  left: 50%;
  z-index: 5;
  margin: 0;
  color: #f7e8c4;
  transform: translateX(-50%);
  font-family: 'Soukou Mincho', serif;
  font-size: clamp(15px, 1.35vw, 20px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.2em;
  white-space: nowrap;
  text-shadow:
    0 2px 5px rgba(0, 0, 0, 0.82),
    0 0 14px rgba(212, 175, 55, 0.25);
  pointer-events: none;
}

#castScroll {
  position: relative;
  z-index: 3;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
  contain: paint;
  padding: clamp(32px, 4.5vh, 44px) 0 clamp(28px, 4vh, 40px);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#castScroll.is-dragging {
  cursor: grabbing;
}

#castTrack {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 24px;
  padding: 0 clamp(32px, 4vw, 64px);
  transition: none;
}

/* The former dark edge fades looked like an extra black frame. */
.cast-scroll-wrapper::before,
.cast-scroll-wrapper::after {
  content: none;
  display: none;
}

/* Card styling - Rebuilt */
.cast-card {
  position: relative;
  display: block;
  width: 260px;
  aspect-ratio: 3 / 4;
  flex-shrink: 0;
  border-radius: 16px;
  overflow: visible;
  isolation: isolate;
  background: transparent;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease-out;
  text-decoration: none;
  /* 初期状態: scroll-animations.jsがis-animatedクラスを付与 */
  opacity: 0;
  transform: scale(0.9);
}

.cast-card::before {
  content: "CLICK TO VIEW MORE  →";
  position: absolute;
  top: auto;
  bottom: 18px;
  left: 50%;
  z-index: 5;
  width: max-content;
  padding: 5px 12px;
  border: 1px solid rgba(232, 197, 71, 0.58);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(139, 35, 50, 0.94), rgba(48, 15, 21, 0.94));
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--dragon-accent, #8b2332) 48%, rgba(139, 35, 50, 0.94)),
    color-mix(in srgb, var(--dragon-main, #d4af37) 30%, rgba(48, 15, 21, 0.94))
  );
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28);
  color: #f7e8c4;
  opacity: 0;
  transform: translate3d(-50%, 10px, 0);
  transition:
    opacity 0.25s ease,
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Cinzel', serif;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.16em;
  white-space: nowrap;
  pointer-events: none;
}

.cast-card-placeholder::before {
  display: none;
}

/* Cast card アニメーション完了状態 */
.cast-card.is-animated {
  opacity: 1;
  transform: scale(1);
}

.cast-card-frame {
  position: relative;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22);
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    filter 0.35s ease;
}

.cast-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.cast-list-hover-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cast-list-hover-color-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  opacity: 0;
  background:
    radial-gradient(
      circle at 76% 34%,
      color-mix(in srgb, var(--cast-hover-main, #d4af37) 32%, transparent) 0%,
      transparent 46%
    ),
    radial-gradient(
      circle at 18% 68%,
      color-mix(in srgb, var(--cast-hover-sub, #f5e8c8) 18%, transparent) 0%,
      transparent 42%
    ),
    linear-gradient(
      120deg,
      color-mix(in srgb, var(--cast-hover-accent, #8b2332) 16%, rgba(5, 4, 5, 0.94)),
      rgba(5, 4, 5, 0.86) 48%,
      color-mix(in srgb, var(--cast-hover-main, #d4af37) 14%, rgba(5, 4, 5, 0.94))
    );
  transition: opacity 0.4s ease;
}

.cast-list-hover-color-lines::before {
  content: '';
  position: absolute;
  inset: -25%;
  background-image: repeating-linear-gradient(
    112deg,
    transparent 0 72px,
    color-mix(in srgb, var(--cast-hover-accent, #8b2332) 46%, transparent) 73px 74px,
    transparent 75px 128px,
    color-mix(in srgb, var(--cast-hover-sub, #f5e8c8) 28%, transparent) 129px 130px
  );
  background-size: 260px 100%;
  opacity: 0.72;
  transform: translate3d(-12%, 0, 0);
  animation: castHoverLineFlow 6.5s linear infinite;
}

.cast-list-hover-color-lines::after {
  content: '';
  position: absolute;
  top: 24%;
  right: -18%;
  left: -18%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--cast-hover-main, #d4af37) 72%, transparent) 25%,
    color-mix(in srgb, var(--cast-hover-accent, #8b2332) 88%, white) 52%,
    color-mix(in srgb, var(--cast-hover-sub, #f5e8c8) 68%, transparent) 76%,
    transparent 100%
  );
  box-shadow:
    0 0 12px color-mix(in srgb, var(--cast-hover-accent, #8b2332) 52%, transparent),
    0 0 28px color-mix(in srgb, var(--cast-hover-main, #d4af37) 32%, transparent);
  opacity: 0.85;
  animation: castHoverScanLine 4.8s ease-in-out infinite;
}

@keyframes castHoverLineFlow {
  0% {
    background-position: 0 0;
    transform: translate3d(-12%, 2%, 0);
  }
  100% {
    background-position: 260px 0;
    transform: translate3d(8%, -2%, 0);
  }
}

@keyframes castHoverScanLine {
  0%,
  100% {
    top: 22%;
    transform: translate3d(-8%, 0, 0) scaleX(0.82);
    opacity: 0.35;
  }
  50% {
    top: 72%;
    transform: translate3d(8%, 0, 0) scaleX(1);
    opacity: 0.9;
  }
}

.cast-list-hover-picture {
  position: absolute;
  top: var(--header-h, 88px);
  right: clamp(-60px, -3vw, -28px);
  bottom: 0;
  width: min(47vw, 720px);
  height: auto;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(48px, 28px, 0) scale(0.96);
  transform-origin: right top;
  transition:
    opacity 0.35s ease,
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.68));
}

.cast-list-hover-portrait {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
}

.cast-list-hover-name {
  position: absolute;
  top: clamp(138px, 21vh, 210px);
  left: clamp(56px, 10vw, 160px);
  z-index: 2;
  display: flex;
  width: max-content;
  max-width: min(420px, 38vw);
  flex-direction: column;
  align-items: flex-start;
  color: #f7e8c4;
  opacity: 0;
  transform: translate3d(-24px, 16px, 0);
  transition:
    opacity 0.3s ease,
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  text-shadow:
    0 2px 5px rgba(0, 0, 0, 0.95),
    0 0 18px rgba(212, 175, 55, 0.38);
}

.cast-list-hover-title {
  margin-bottom: 8px;
  color: rgba(232, 197, 71, 0.9);
  font-family: 'Soukou Mincho', serif;
  font-size: clamp(13px, 1.2vw, 17px);
  letter-spacing: 0.22em;
}

.cast-list-hover-roman {
  font-family: 'Cinzel', serif;
  font-size: clamp(30px, 3.5vw, 52px);
  line-height: 1.1;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

#cast-list.is-cast-hover-active .cast-list-hover-stage {
  opacity: 1;
}

#cast-list.is-cast-hover-active .cast-list-hover-color-lines {
  opacity: 1;
}

#cast-list.is-cast-hover-active .cast-list-hover-stage.is-image-ready .cast-list-hover-picture {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

#cast-list.is-cast-hover-active .cast-list-hover-name {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.cast-list-cta {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  padding: clamp(8px, 1.5vh, 14px) 0 2px;
}

.cast-list-cta .btn {
  min-width: min(240px, 72vw);
  padding: 12px 28px;
}

@media (min-width: 769px) {
  #cast-list .panel-inner {
    justify-content: flex-end;
  }

  #cast-list .cast-scroll-wrapper {
    flex: 0 0 auto;
    width: calc(100% - clamp(48px, 6vw, 96px));
    margin: auto auto clamp(26px, 4.5vh, 48px);
  }

  #cast-list .panel-bg-image,
  #cast-list .panel-bg-overlay,
  #cast-list.bg-stars::before,
  #cast-list.floating-particles::before {
    transition:
      opacity 0.35s ease,
      filter 0.35s ease,
      background 0.35s ease;
  }

  #cast-list.is-cast-hover-active .panel-bg-image {
    opacity: 0.08;
    filter: brightness(0.28) saturate(0.45);
  }

  #cast-list.is-cast-hover-active .panel-bg-overlay {
    background: rgba(5, 4, 5, 0.9);
  }

  #cast-list.is-cast-hover-active.bg-stars::before,
  #cast-list.is-cast-hover-active.floating-particles::before {
    opacity: 0.16;
  }
}

/* Flash overlay for hover */
.cast-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
  background: radial-gradient(
    circle at 50% 50%,
    color-mix(in srgb, var(--dragon-accent, #ffffff) 58%, white) 0%,
    color-mix(in srgb, var(--dragon-main, #d4af37) 22%, transparent) 38%,
    transparent 72%
  );
  mix-blend-mode: overlay;
  transition: opacity 0.3s ease;
}

/* Hover effect - only on devices that support hover (not touch screens) */
@media (hover: hover) and (pointer: fine) {
  .cast-card:hover {
    z-index: 4;
    transform: translateY(-8px) scale(1.03);
  }

  .cast-card:hover::before {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
  }

  .cast-card:hover .cast-card-frame {
    border-color: color-mix(in srgb, var(--dragon-accent, #ffffff) 64%, white);
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.3),
      0 0 22px color-mix(in srgb, var(--dragon-main, #d4af37) 45%, transparent);
    filter: brightness(0.82) saturate(0.9);
  }

  .cast-card:hover .cast-flash {
    opacity: 1;
  }

  .cast-card-placeholder:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

.cast-card:focus-visible {
  z-index: 4;
  outline: 2px solid rgba(232, 197, 71, 0.95);
  outline-offset: 6px;
  transform: translateY(-8px) scale(1.03);
}

.cast-card:focus-visible::before {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.cast-card:focus-visible .cast-card-frame {
  border-color: color-mix(in srgb, var(--dragon-accent, #e8c547) 64%, white);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.3),
    0 0 22px color-mix(in srgb, var(--dragon-main, #d4af37) 45%, transparent);
  filter: brightness(0.82) saturate(0.9);
}

@media (prefers-reduced-motion: reduce) {
  .cast-card-frame,
  .cast-card::before,
  .cast-list-hover-stage,
  .cast-list-hover-picture,
  .cast-list-hover-name {
    transition: none;
  }

  .cast-list-hover-color-lines::before,
  .cast-list-hover-color-lines::after {
    animation: none !important;
  }
}

/* Placeholder cast card */
.cast-card-placeholder {
  background: linear-gradient(135deg, rgba(90, 43, 43, 0.3) 0%, rgba(139, 69, 19, 0.2) 100%);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  cursor: default;
}

.cast-placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 40px 20px;
}

.placeholder-icon {
  font-size: 80px;
  margin-bottom: 16px;
  opacity: 0.6;
  filter: grayscale(100%);
}

.placeholder-text {
  font-family: 'Harenosora', sans-serif;
  font-size: 24px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.1em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Hero section container */
.panel-hero {
  display: flex;
  align-items: center;
  justify-content: center;
}



/* Hero section title - 中華高級スタイル */
.hero-title {
  font-family: 'Soukou Mincho', serif;
  font-size: clamp(64px, 6vw, 88px);
  font-weight: bold;
  background: linear-gradient(135deg,
      #D4AF37 0%,
      #E8C547 25%,
      #D4AF37 50%,
      #AA7C11 75%,
      #D4AF37 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 16px auto 12px;
  letter-spacing: 0.15em;
  text-shadow: none;
  line-height: 1.2;
  position: relative;
  z-index: 2;
  text-align: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
  animation: none;
}

.hero-ready .hero-title {
  animation: heroTitleShimmer 3s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .hero-ready .hero-title {
    animation: none !important;
  }
}

@keyframes heroTitleShimmer {
  0% {
    background-position: 0% center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
  }
  100% {
    background-position: 100% center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 8px rgba(212, 175, 55, 0.35));
  }
}

/* Hero lead text */
.hero-lead {
  font-family: 'Harenosora', sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.08em;
  line-height: 1.8;
  margin: 20px auto;
  max-width: 700px;
  text-align: center;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8),
    0 4px 16px rgba(0, 0, 0, 0.6);
  padding: 0 20px;
}

.hero-next-opening {
  margin: 6px auto 18px;
  width: fit-content;
  max-width: calc(100% - 32px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 14px);
  color: rgba(255, 255, 255, 0.95);
  font-size: clamp(0.82rem, 1.4vw, 0.95rem);
  line-height: 1.7;
  letter-spacing: 0.08em;
  text-align: center;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.hero-next-opening::before,
.hero-next-opening::after {
  content: '';
  display: block;
  width: clamp(22px, 3vw, 42px);
  height: 1px;
  flex: 0 0 auto;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(232, 197, 71, 0.9));
  transform: scaleX(0);
}

.hero-next-opening::before {
  transform-origin: right center;
}

.hero-next-opening::after {
  background: linear-gradient(90deg, rgba(232, 197, 71, 0.9), transparent);
  transform-origin: left center;
}

.hero-ready .hero-next-opening::before,
.hero-ready .hero-next-opening::after {
  animation: topHeroOpeningLine 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.72s forwards;
}

@keyframes topHeroOpeningLine {
  to {
    opacity: 0.9;
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-next-opening::before,
  .hero-next-opening::after {
    opacity: 0.9;
    transform: none;
    animation: none !important;
  }
}

/* Desktop: Hide mobile footer info by default */
.mobile-footer-info {
  display: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  :root {
    --header-h: 72px;
  }

  .cast-card {
    width: 210px;
    border-radius: 16px;
  }

  #castScroll {
    padding-top: 72px;
    padding-bottom: 48px;
  }

  .cast-list-hover-stage {
    display: none;
  }

  .site-header {
    height: var(--header-h);
  }

  /* Reset padding for non-TOP pages */
  body:not(.page-top) {
    padding-top: var(--header-h);
  }

  /* TOPページのスマホ表示調整 */
  .page-top main {
    top: var(--header-h) !important;
    padding-top: 0 !important;
    height: calc(100vh - var(--header-h)) !important;
    height: calc(100dvh - var(--header-h)) !important;
  }

  .page-top .panel:not(.panel-stories):not(.panel-access) {
    min-height: calc(100vh - var(--header-h)) !important;
    min-height: calc(100dvh - var(--header-h)) !important;
    height: calc(100vh - var(--header-h)) !important;
    height: calc(100dvh - var(--header-h)) !important;
    padding: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Accessセクションは高さを自動調整してスクロール可能に */
  .page-top .panel-access {
    height: auto !important;
    min-height: calc(100vh - var(--header-h)) !important;
    min-height: calc(100dvh - var(--header-h)) !important;
  }

  /* Accessセクションの内部は上詰めで配置 */
  .page-top .panel-access .panel-inner {
    justify-content: flex-start !important;
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }

  /* Storiesセクションは高さを固定してスクロール可能に */
  .page-top .panel-stories {
    height: calc(100vh - var(--header-h)) !important;
    height: calc(100dvh - var(--header-h)) !important;
    min-height: calc(100vh - var(--header-h)) !important;
    min-height: calc(100dvh - var(--header-h)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Storiesセクションの内部は上詰めで配置 */
  .page-top .panel-stories .panel-inner {
    justify-content: flex-start !important;
    padding: 40px 20px 60px 20px !important;
    min-height: auto !important;
  }

  .page-top .panel-inner:not(.panel-stories .panel-inner):not(.panel-access .panel-inner) {
    padding: 20px !important;
    width: 100% !important;
  }

  /* Conceptセクションのパネル自体を中央配置 */
  .page-top .panel-with-bg {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Conceptセクションなどテキストセクションの調整 */
  .page-top .panel-text .panel-inner,
  .page-top .panel-with-bg:not(.panel-stories):not(.panel-access) .panel-inner {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    min-height: auto !important;
  }

  /* Conceptセクションのカードを中央配置 */
  .page-top .panel-with-bg .panel-card {
    width: 90% !important;
    max-width: 90% !important;
    margin: 0 auto !important;
    align-self: center !important;
  }

  .page-top .panel-hero {
    overflow: hidden !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .page-top .panel-hero .panel-inner {
    justify-content: center !important;
  }

  .page-top .panel-cast {
    height: calc(100vh - var(--header-h)) !important;
    height: calc(100dvh - var(--header-h)) !important;
    min-height: calc(100vh - var(--header-h));
    min-height: calc(100dvh - var(--header-h));
  }

  .page-top .panel-cast .panel-inner {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
  }

  /* Castセクションの上部コンテンツ調整（枠付き） */
  .page-top .cast-intro {
    flex: 0 0 auto !important;
    margin-bottom: 20px !important;
    width: 90% !important;
    background: linear-gradient(135deg,
        rgba(165, 42, 42, 0.3) 0%,
        rgba(139, 69, 19, 0.35) 50%,
        rgba(165, 42, 42, 0.3) 100%) !important;
    border: 2px solid rgba(244, 208, 63, 0.5) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(8px) !important;
    padding: 12px 16px !important;
  }

  .page-top .cast-intro-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
  }

  /* cast-intro-contentの疑似要素を非表示 */
  .page-top .cast-intro-content::before {
    display: none !important;
  }

  /* Castセクションのタイトル */
  .page-top .cast-intro-content .panel-title {
    display: block !important;
    font-family: 'Harenosora', sans-serif !important;
    font-size: 36px !important;
    font-weight: bold !important;
    color: #f4d03f !important;
    text-align: center !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7) !important;
    margin: 0 !important;
  }

  /* Cast説明文を表示 */
  .page-top .cast-intro-content .panel-desc {
    display: block !important;
    text-align: center !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 0 8px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  /* Castセクションのボタンを非表示 */
  .page-top .cast-intro-content .btn {
    display: none !important;
  }

  .page-top .cast-scroll-wrapper {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: visible !important;
    width: 90% !important;
    max-width: 90% !important;
    max-height: none !important;
    padding: 20px !important;
    background: linear-gradient(135deg,
        rgba(165, 42, 42, 0.25) 0%,
        rgba(139, 69, 19, 0.3) 25%,
        rgba(101, 67, 33, 0.35) 50%,
        rgba(139, 69, 19, 0.3) 75%,
        rgba(165, 42, 42, 0.25) 100%) !important;
    border: 2px solid rgba(244, 208, 63, 0.3) !important;
    border-radius: 24px !important;
    backdrop-filter: blur(15px) !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 0 40px rgba(165, 42, 42, 0.15) !important;
  }

  /* cast-scroll-wrapperの疑似要素を非表示 */
  .page-top .cast-scroll-wrapper::before,
  .page-top .cast-scroll-wrapper::after {
    display: none !important;
  }

  .page-top .cast-scroll {
    width: 100% !important;
    height: 100% !important;
    max-height: 380px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    scrollbar-width: none !important;
    /* Firefox */
    -ms-overflow-style: none !important;
    /* IE/Edge */
  }

  /* Chromeなどのスクロールバーを非表示 */
  .page-top .cast-scroll::-webkit-scrollbar {
    display: none !important;
  }

  .page-top .cast-track {
    display: flex !important;
    gap: 16px !important;
    padding: 10px !important;
    height: auto !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  .page-top .cast-card {
    flex-shrink: 0 !important;
    height: 340px !important;
    width: auto !important;
  }

  /* パネル内部のコンテンツ調整 */
  .page-top .panel-card {
    max-width: 100% !important;
    padding: 30px 20px !important;
  }

  /* Accessセクションのカードは高さを自動調整 */
  .page-top .panel-access .panel-card {
    height: auto !important;
    min-height: auto !important;
  }

  /* Conceptセクションのカード内要素を調整 */
  .page-top .panel-with-bg .panel-card .panel-title {
    font-size: 36px !important;
    margin-bottom: 16px !important;
  }

  .page-top .panel-with-bg .panel-card p {
    font-size: 14px !important;
    line-height: 1.7 !important;
    margin-bottom: 14px !important;
  }

  /* フッターをスマホでは非表示 */
  .page-top .site-footer {
    display: none !important;
  }

  /* モバイル用フッター情報（Accessセクション内） */
  .mobile-footer-info {
    display: block !important;
    margin-top: 40px !important;
    padding-top: 30px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  .mobile-footer-brand {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    opacity: 0.8 !important;
  }

  .mobile-footer-brand img {
    flex-shrink: 0 !important;
  }

  .mobile-footer-title {
    font-family: 'Harenosora', sans-serif !important;
    font-size: 14px !important;
    color: #f4d03f !important;
    margin-bottom: 8px !important;
  }

  .mobile-footer-note {
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    line-height: 1.5 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", sans-serif !important;
  }

  .hero-mark {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
  }

  .hero-title {
    font-size: 56px;
  }

  .hero-lead {
    font-size: 18px;
    letter-spacing: 0.06em;
    line-height: 1.7;
    padding: 0 16px;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 24px;
    width: min(280px, calc(100% - 32px));
  }

  .hero-cta .btn {
    width: 100%;
    min-width: 0;
  }

  .panel-card {
    padding: 40px 24px;
    border-radius: 20px;
  }

  .panel-card.with-image {
    flex-direction: column;
    padding: 32px 20px;
    gap: 24px;
  }

  .panel-card.with-image.reverse {
    flex-direction: column;
  }

  .panel-image-wrapper {
    flex: 0 0 auto;
    width: 100%;
  }

  .panel-content {
    align-items: center;
    text-align: center;
  }

  .panel-card.with-image .panel-title {
    text-align: center;
  }

  .panel-card.with-image .panel-desc {
    text-align: center;
  }

  .panel-title {
    font-size: 36px;
    margin-bottom: 16px;
  }

  .panel-desc {
    display: block !important;
    font-size: 16px;
    margin-bottom: 24px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 14px;
  }

  .sns-item {
    width: 48px;
    height: 48px;
    font-size: 16px;
  }

  .access-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .access-actions .btn {
    width: 100%;
    max-width: 300px;
  }

  .cast-intro {
    flex-direction: column;
    gap: 32px;
    margin-bottom: 60px;
    padding: 0 20px;
  }

  .cast-intro-image {
    flex: 0 0 auto;
    width: 100%;
  }

  .cast-intro-content {
    align-items: center;
    text-align: center;
  }

  .cast-intro-content .panel-title {
    text-align: center;
  }

  .cast-intro-content .panel-desc {
    text-align: center;
  }

  /* 背景画像版のモバイル調整 */
  .panel-with-bg .cast-intro-content {
    padding: 32px 24px;
  }

  .panel-with-bg .panel-card.with-image {
    padding: 32px 24px;
  }

  /* Cast scroll wrapper モバイル */
  .cast-scroll-wrapper {
    padding: 24px;
    margin: 0 16px;
  }

  .cast-scroll-wrapper::before,
  .cast-scroll-wrapper::after {
    top: 24px;
    bottom: 24px;
    width: 20%;
  }

  .cast-scroll-wrapper::before {
    left: 24px;
  }

  .cast-scroll-wrapper::after {
    right: 24px;
  }

  /* Cast panel のモバイル調整 */
  .page-top .panel-cast {
    height: auto;
    padding-bottom: 80px;
  }
}

/* TOP vertical sections */
.page-top main {
  display: block;
}

.page-top section {
  position: relative;
  width: 100%;
}

.page-top .top-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

/* Header and Footer fixed for TOP page */
.page-top .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

@media (min-width: 769px) {
  .page-top .site-header {
    background: linear-gradient(90deg,
        rgba(42, 14, 18, 0) 0%,
        rgba(201, 53, 69, 0.05) 50%,
        rgba(42, 14, 18, 0) 100%) !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0) !important;
    backdrop-filter: blur(0px) !important;
    box-shadow: none !important;
    transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease !important;
  }

  .page-top .site-header.header-scrolled {
    background: linear-gradient(90deg,
        rgba(42, 14, 18, 0.98) 0%,
        rgba(74, 24, 32, 0.95) 50%,
        rgba(42, 14, 18, 0.98) 100%) !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.4) !important;
    backdrop-filter: blur(16px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  }
}


/* Fullscreen section snap - 一気にスクロール版 */
.page-top html,
.page-top body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.page-top body {
  scroll-behavior: auto;
  /* JSで smooth に制御 */
  padding-top: 0 !important;
  /* Reset default body padding */
  display: block !important;
  /* Reset flex layout */
  min-height: 100vh;
  min-height: 100dvh;
}

.page-top main {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  /* Dynamic viewport height for mobile */
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: auto;
  /* JSで制御 */
  -webkit-overflow-scrolling: touch;
  /* スクロールバーを非表示 */
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

.page-top main::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

/* Panel - 完全中央配置 */
.page-top .panel {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: 100vh;
  min-height: 100dvh;
  /* Dynamic viewport height */
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.page-top .panel .panel-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Cast panelのみスクロール可能に */
.page-top .panel-cast {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 120px;
  /* フッター分の余白 */
}

/* Cast panel inner - 中央配置 */
.page-top .panel-cast .panel-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Smooth transitions between panels */
.page-top .panel::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent, rgba(11, 11, 13, 0.05));
  pointer-events: none;
  z-index: 1;
}

.page-top .panel-hero::before {
  display: none;
}

/* Panel background image styling */
.panel-with-bg {
  position: relative;
}

.panel-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  transition: transform 0.5s ease;
}

.page-top .panel-cast .panel-bg-image {
  display: block;
  background-image: url('../img/cast-1920w.webp');
}

.page-top .panel-cast .panel-bg-overlay {
  background: linear-gradient(135deg,
      rgba(11, 11, 13, 0.55) 0%,
      rgba(26, 15, 15, 0.5) 50%,
      rgba(11, 11, 13, 0.55) 100%);
  z-index: 0;
}

.page-top .panel-cast.bg-stars::before,
.page-top .panel-cast.floating-particles::before {
  z-index: 2;
  opacity: 0.95;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 6px rgba(244, 208, 63, 0.5));
}

.panel-with-bg:hover .panel-bg-image {
  transform: scale(1.05);
}

.panel-bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
      rgba(11, 11, 13, 0.85) 0%,
      rgba(26, 15, 15, 0.75) 50%,
      rgba(11, 11, 13, 0.85) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Panel with background - inner 中央配置 */
.panel-with-bg .panel-inner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Panel card styling */
.panel-card {
  max-width: 700px;
  margin: 0 auto;
  margin-left: auto;
  margin-right: auto;
  padding: 60px 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  text-align: center;
  align-self: center;
}

/* 背景画像付きパネルのカードスタイル - 中華高級版 */
.panel-with-bg .panel-card {
  background: linear-gradient(135deg,
      rgba(10, 5, 6, 0.85) 0%,
      rgba(18, 10, 11, 0.9) 25%,
      rgba(26, 15, 15, 0.92) 50%,
      rgba(18, 10, 11, 0.9) 75%,
      rgba(10, 5, 6, 0.85) 100%);
  border: 1px solid rgba(212, 175, 55, 0.25);
  backdrop-filter: blur(24px);
  box-shadow:
    0 16px 64px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(212, 175, 55, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 0 60px rgba(139, 35, 50, 0.15);
  position: relative;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* グロー効果 - 金の光沢 */
.panel-with-bg .panel-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle,
      rgba(212, 175, 55, 0.12) 0%,
      transparent 60%);
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.panel-with-bg .panel-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow:
    0 20px 80px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(212, 175, 55, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 0 80px rgba(212, 175, 55, 0.2);
  transform: translateY(-6px);
}

.panel-with-bg .panel-card:hover::before {
  opacity: 1;
}

.panel-card.wide {
  max-width: 900px;
}

/* Panel card with image */
.panel-card.with-image {
  max-width: 1000px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 40px;
  text-align: left;
}

.panel-card.with-image.reverse {
  flex-direction: row-reverse;
}

/* 背景画像版では画像ラッパーを非表示 */
.panel-with-bg .panel-image-wrapper {
  display: none;
}

.panel-image-wrapper {
  flex: 0 0 45%;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.panel-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.panel-card.with-image:hover .panel-image {
  transform: scale(1.05);
}

/* Panel content - 全て中央寄せ */
.panel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Panel card with image - 中央配置 */
.panel-card.with-image {
  justify-content: center;
  text-align: center;
}

.panel-card.with-image .panel-title {
  text-align: center;
  margin-bottom: 20px;
}

.panel-card.with-image .panel-desc {
  text-align: center;
  margin-bottom: 28px;
}

/* 背景画像版のコンテンツ */
.panel-with-bg .panel-content {
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* 背景画像版のカードを中央配置 */
.panel-with-bg .panel-card.with-image {
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.panel-title {
  font-family: 'Cinzel', 'Cormorant Garamond', serif;
  font-size: 52px;
  font-weight: 600;
  margin: 0 0 32px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  background: linear-gradient(135deg,
      #D4AF37 0%,
      #E8C547 30%,
      #D4AF37 50%,
      #B8962E 70%,
      #D4AF37 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  animation: panelTitleGlow 5s ease-in-out infinite;
}

@keyframes panelTitleGlow {

  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

.panel-desc {
  font-family: 'Soukou Mincho', serif;
  font-size: 18px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 32px;
  letter-spacing: 0.05em;
}

.panel-card .btn {
  margin-top: 8px;
}

/* Text panel styling */
.panel-text {
  background: linear-gradient(180deg,
      rgba(26, 15, 15, 0.6) 0%,
      rgba(42, 21, 21, 0.8) 50%,
      rgba(26, 15, 15, 0.6) 100%);
}

/* Cast section head */
.cast-head {
  text-align: center;
  margin-bottom: 48px;
  padding: 0 20px;
}

.cast-head .panel-title {
  margin-bottom: 16px;
}

.cast-head .panel-desc {
  margin-bottom: 24px;
}

/* Combined cast section */
.panel-combined {
  background: linear-gradient(180deg,
      rgba(26, 15, 15, 0.7) 0%,
      rgba(42, 21, 21, 0.85) 50%,
      rgba(26, 15, 15, 0.7) 100%);
}

/* Concept panel: responsive WebP background images */
#concept .panel-bg-image {
  background-image: url('../img/concept-480w.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

@media (min-width: 769px) {
  #concept .panel-bg-image {
    background-image: url('../img/concept-1024w.webp');
  }
}

@media (min-width: 1441px) {
  #concept .panel-bg-image {
    background-image: url('../img/concept-1920w.webp');
  }
}

/* Cast panel: responsive WebP background images */
#cast-list .panel-bg-image {
  background-image: url('../img/cast-480w.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

@media (min-width: 769px) {
  #cast-list .panel-bg-image {
    background-image: url('../img/cast-1024w.webp');
  }
}

@media (min-width: 1441px) {
  #cast-list .panel-bg-image {
    background-image: url('../img/cast-1920w.webp');
  }
}

/* Cast intro - 完全中央配置 */
.cast-intro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto 80px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 40px;
  width: 100%;
}

/* 背景画像版のCast intro - 画像要素を非表示 */
.panel-with-bg .cast-intro-image {
  display: none;
}

.cast-intro-image {
  flex: 0 0 50%;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.intro-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.cast-intro:hover .intro-image {
  transform: scale(1.05);
}

.cast-intro-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg,
      rgba(10, 5, 6, 0.88) 0%,
      rgba(18, 10, 11, 0.92) 25%,
      rgba(26, 15, 15, 0.94) 50%,
      rgba(18, 10, 11, 0.92) 75%,
      rgba(10, 5, 6, 0.88) 100%);
  padding: 56px;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  backdrop-filter: blur(24px);
  box-shadow:
    0 16px 64px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(212, 175, 55, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 0 60px rgba(139, 35, 50, 0.12);
  position: relative;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0 auto;
  align-self: center;
}

/* Cast intro グロー効果 - 金の光沢 */
.cast-intro-content::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle,
      rgba(212, 175, 55, 0.12) 0%,
      transparent 60%);
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 0;
}

.cast-intro-content:hover {
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow:
    0 20px 80px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(212, 175, 55, 0.15),
    0 0 80px rgba(212, 175, 55, 0.2);
  transform: translateY(-6px);
}

.cast-intro-content:hover::before {
  opacity: 1;
}

/* コンテンツを前面に */
.cast-intro-content>* {
  position: relative;
  z-index: 1;
}

/* 背景画像なしの場合は背景を透明に */
.panel-combined:not(.panel-with-bg) .cast-intro-content {
  background: transparent;
  padding: 0;
  border: none;
  backdrop-filter: none;
  box-shadow: none;
}

.cast-intro-content .panel-title {
  text-align: center;
  margin-bottom: 24px;
}

.cast-intro-content .panel-desc {
  text-align: center;
  margin-bottom: 32px;
}

/* Access section styling */
.panel-access {
  background: linear-gradient(135deg,
      rgba(165, 36, 36, 0.15) 0%,
      rgba(11, 11, 13, 0.8) 50%,
      rgba(165, 36, 36, 0.15) 100%);
}

.access-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.sns {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 32px;
}

.sns-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 18px;
  font-weight: bold;
  transition: transform 0.3s ease, background-color 0.3s ease,
    border-color 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(5px);
}

.sns-item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Button styles - 中華高級スタイル */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  font-family: 'Harenosora', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-decoration: none;
  border-radius: 4px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn:not(.hover-border-anim)::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.15);
  transform: translate(-50%, -50%);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:not(.hover-border-anim):hover::before {
  width: 400px;
  height: 400px;
}

.btn.primary {
  background: linear-gradient(135deg, #8B2332 0%, #A52A3A 50%, #6A1B29 100%);
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(212, 175, 55, 0.3);
  box-shadow:
    0 4px 20px rgba(139, 35, 50, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}

.btn.primary:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow:
    0 8px 32px rgba(139, 35, 50, 0.5),
    0 0 20px rgba(212, 175, 55, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn:not(.primary) {
  background: rgba(10, 5, 6, 0.6);
  border-color: rgba(212, 175, 55, 0.25);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
}

.btn:not(.primary):hover {
  background: rgba(18, 10, 11, 0.8);
  border-color: rgba(212, 175, 55, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Section Navigation Bar (右側固定) */
.section-nav {
  position: fixed;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-nav-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-end;
}

.section-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 8px 0;
}

/* ナビゲーションドット */
.section-nav-item::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.5);
  transition: width 0.3s ease, height 0.3s ease,
    background-color 0.3s ease, border-color 0.3s ease,
    box-shadow 0.3s ease;
  flex-shrink: 0;
}

/* ラベル */
.section-nav-label {
  font-family: 'Harenosora', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
}

/* ホバー時 */
.section-nav-item:hover::before {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.8);
  width: 12px;
  height: 12px;
}

.section-nav-item:hover .section-nav-label {
  opacity: 1;
  transform: translateX(0);
}

/* アクティブ状態 - 金の輝き */
.section-nav-item.active::before {
  background: linear-gradient(135deg, #D4AF37 0%, #8B2332 100%);
  border-color: #D4AF37;
  width: 12px;
  height: 12px;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.7);
}

.section-nav-item.active .section-nav-label {
  opacity: 1;
  transform: translateX(0);
  color: rgba(255, 255, 255, 0.95);
  font-weight: bold;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .section-nav {
    right: 16px;
    gap: 6px;
  }

  .section-nav-items {
    gap: 12px;
  }

  .section-nav-item::before {
    width: 6px;
    height: 6px;
  }

  .section-nav-item:hover::before,
  .section-nav-item.active::before {
    width: 10px;
    height: 10px;
  }

  .section-nav-label {
    font-size: 12px;
  }
}

/* タブレット以下ではラベルを常に非表示 */
@media (max-width: 1024px) {
  .section-nav-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-top body {
    scroll-behavior: auto;
  }

  .panel,
  .panel-card,
  .hero-copy>*,
  .panel-bg-image,
  .cast-intro-content,
  .cast-intro-content>*,
  .cast-scroll-wrapper,
  .panel-content>*,
  .cast-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  .hero-mark {
    animation: none !important;
  }

  .section-nav-item::before,
  .section-nav-label {
    transition: none !important;
  }

  /* Cast card はアニメーション無効時も表示 */
  .cast-card.is-animated {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Footer Fix for TOP Page Override */
.page-top .panel-access .site-footer {
  background: transparent;
  backdrop-filter: none;
  border-top: none;
  padding: 0;
  margin-top: 40px;
  width: 100%;
}

.page-top .panel-access .footer-inner {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 24px;
  margin-top: 24px;
  width: 100%;
}

/* モバイル表示時は専用フッターがあるのでデスクトップフッターを非表示にする調整 */
@media (max-width: 768px) {
  .page-top .panel-access .site-footer {
    display: none;
  }
}

/* ==========================================================================
   Section Title / Copy / Action Reveals (Preventing Double Text / Afterimage)
   ========================================================================== */

/* High-specificity rules to prevent overrides from existing panel-content > * animations */
.page-top .section-title-reveal,
.page-top .section-copy-reveal,
.page-top .section-actions-reveal,
.page-top .panel .panel-content > .section-title-reveal,
.page-top .panel-cast .cast-intro-content > .section-title-reveal,
.page-top .panel-stories .panel-inner > .section-title-reveal,
.page-top .panel-access .panel-card > .section-title-reveal,
.page-top .panel .panel-content > .section-copy-reveal,
.page-top .panel-cast .cast-intro-content > .section-copy-reveal,
.page-top .panel-access .panel-card > .section-copy-reveal,
.page-top .panel .panel-content > .section-actions-reveal,
.page-top .panel-cast .cast-intro-content > .section-actions-reveal,
.page-top .panel-access .panel-card > .section-actions-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-top .section-title-reveal {
  background: linear-gradient(
    135deg,
    #d4af37 0%,
    #e8c547 38%,
    #b66a3c 72%,
    #d4af37 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Explicitly disable title glow, shadow and animation to prevent double rendering */
.page-top .section-title-reveal {
  animation: none !important;
  filter: none !important;
  text-shadow: none !important;
}

/* Custom shadow exception for showcase title readability */
.page-top .cast-showcase-title.section-title-reveal {
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.9) !important;
}

/* Delay timings using important to override any nth-child delay specifications */
.page-top .section-title-reveal {
  transition-delay: 0s !important;
}
.page-top .section-copy-reveal {
  transition-delay: 0.12s !important;
}
.page-top .section-actions-reveal {
  transition-delay: 0.24s !important;
}

/* Make reveals visible on panel is-visible trigger */
.page-top .panel.is-visible .section-title-reveal,
.page-top .panel.is-visible .section-copy-reveal,
.page-top .panel.is-visible .section-actions-reveal,
.page-top .panel.is-visible .panel-content > .section-title-reveal,
.page-top .panel-cast.is-visible .cast-intro-content > .section-title-reveal,
.page-top .panel-stories.is-visible .panel-inner > .section-title-reveal,
.page-top .panel-access.is-visible .panel-card > .section-title-reveal,
.page-top .panel.is-visible .panel-content > .section-copy-reveal,
.page-top .panel-cast.is-visible .cast-intro-content > .section-copy-reveal,
.page-top .panel-access.is-visible .panel-card > .section-copy-reveal,
.page-top .panel.is-visible .panel-content > .section-actions-reveal,
.page-top .panel-cast.is-visible .cast-intro-content > .section-actions-reveal,
.page-top .panel-access.is-visible .panel-card > .section-actions-reveal {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ==========================================================================
   CAST Showcase Styling (Full-screen key visual character layering)
   ========================================================================== */

.panel-cast-showcase {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background-color: #0b0708;
  background-image: radial-gradient(circle at 50% 50%, #2a0e12 0%, #0b0708 85%);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Background opacity token — overridden per breakpoint */
  --cast-bg-opacity: 0.26;
}

/* Shared ambient particle layer for the CAST showcase, stories, and access. */
.ambient-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.68;
}

.panel-cast-showcase .ambient-particles {
  z-index: 3;
}

.ambient-particles::before,
.ambient-particles::after {
  content: '';
  position: absolute;
  inset: -18%;
  background-repeat: repeat;
}

.ambient-particles::before {
  background-image:
    radial-gradient(circle, rgba(232, 197, 71, 0.72) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(255, 244, 210, 0.42) 0 1.4px, transparent 2.2px),
    radial-gradient(circle, rgba(177, 49, 67, 0.55) 0 1px, transparent 1.9px);
  background-position: 20px 35px, 110px 160px, 190px 75px;
  background-size: 210px 230px, 290px 320px, 250px 280px;
  animation: ambientParticleDrift 19s linear infinite;
}

.ambient-particles::after {
  background-image:
    radial-gradient(circle, rgba(212, 175, 55, 0.42) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(139, 35, 50, 0.38) 0 1.5px, transparent 2.5px);
  background-position: 70px 110px, 175px 20px;
  background-size: 330px 360px, 280px 310px;
  opacity: 0.55;
  animation: ambientParticleSway 14s ease-in-out infinite alternate;
}

@keyframes ambientParticleDrift {
  0% {
    transform: translate3d(0, 8%, 0);
  }
  100% {
    transform: translate3d(3%, -12%, 0);
  }
}

@keyframes ambientParticleSway {
  0% {
    transform: translate3d(-3%, 4%, 0) scale(0.98);
    opacity: 0.35;
  }
  100% {
    transform: translate3d(4%, -5%, 0) scale(1.02);
    opacity: 0.72;
  }
}

.cast-showcase-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;

  background-image:
    linear-gradient(
      180deg,
      rgba(11, 7, 8, 0.3) 0%,
      rgba(11, 7, 8, 0.5) 55%,
      rgba(11, 7, 8, 0.9) 100%
    ),
    url('../img/cast-480w.webp');

  background-repeat: no-repeat;
  background-position: center 56%;
  background-size: min(92vw, 720px) auto;

  opacity: var(--cast-bg-opacity);
  filter:
    saturate(0.86)
    contrast(1.14)
    brightness(0.78);

  transform: translate3d(
    calc(var(--cast-pointer-x, 0) * -14px),
    calc(var(--cast-pointer-y, 0) * -9px),
    0
  );

  transition: opacity 700ms ease;
}

@media (min-width: 481px) {
  .panel-cast-showcase {
    --cast-bg-opacity: 0.29;
  }
  .cast-showcase-bg {
    background-image:
      linear-gradient(
        180deg,
        rgba(11, 7, 8, 0.3) 0%,
        rgba(11, 7, 8, 0.5) 55%,
        rgba(11, 7, 8, 0.9) 100%
      ),
      url('../img/cast-1024w.webp');
    background-size: min(84vw, 960px) auto;
  }
}

@media (min-width: 769px) {
  .panel-cast-showcase {
    --cast-bg-opacity: 0.32;
  }
}

@media (min-width: 1200px) {
  .cast-showcase-bg {
    background-image:
      linear-gradient(
        180deg,
        rgba(11, 7, 8, 0.3) 0%,
        rgba(11, 7, 8, 0.5) 55%,
        rgba(11, 7, 8, 0.9) 100%
      ),
      url('../img/cast-1920w.webp');
    background-size: min(76vw, 1280px) auto;
  }
}

.cast-showcase-haze {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 7, 8, 0.95) 0%, rgba(11, 7, 8, 0.05) 35%, rgba(11, 7, 8, 0.05) 65%, rgba(11, 7, 8, 0.95) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Huge background CAST text shadow - Static fade in */
.cast-showcase-word {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Cinzel', serif;
  font-size: clamp(120px, 24vw, 360px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(212, 175, 55, 0.08);
  text-stroke: 1px rgba(212, 175, 55, 0.08);
  z-index: 3;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-cast-showcase.is-visible .cast-showcase-word {
  opacity: 0.12 !important;
}

/* Stage containing 5 overlay figures */
.cast-showcase-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
}

@media (min-width: 769px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .cast-showcase-stage {
    transform:
      perspective(1200px)
      rotateX(calc(var(--cast-pointer-y, 0) * -2deg))
      rotateY(calc(var(--cast-pointer-x, 0) * 2.8deg));
    transform-origin: 50% 55%;
    will-change: transform;
  }
}

.cast-showcase-character {
  position: absolute;
  bottom: -5dvh;
  margin: 0;
  padding: 0;
  transform: translateX(-50%) translateY(60px) scale(1.05);
  opacity: 0;
  transform-origin: bottom center;
  transition:
    opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Tall enough to fill screen; feet extend below viewport (overflow: hidden clips them) */
  height: min(105dvh, 1020px);
  max-height: none;
}

.cast-showcase-character.is-entering {
  opacity: 0;
  transform: translateX(-50%) translateY(60px) scale(1.05);
}

.cast-showcase-character.is-active {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.cast-showcase-character.is-active.stagger-0 { transition-delay: 0ms; }
.cast-showcase-character.is-active.stagger-1 { transition-delay: 80ms; }
.cast-showcase-character.is-active.stagger-2 { transition-delay: 160ms; }
.cast-showcase-character.is-active.stagger-3 { transition-delay: 240ms; }

.cast-showcase-character.is-leaving {
  opacity: 0;
  transform: translateX(-50%) translateY(45px) scale(1.02);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 0ms !important;
}

.cast-showcase-character picture {
  display: block;
  width: 100%;
  height: 100%;
}

.cast-showcase-character-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform: translate3d(
    calc(var(--cast-pointer-x, 0) * var(--cast-depth-x, 0px)),
    calc(var(--cast-pointer-y, 0) * var(--cast-depth-y, 0px)),
    0
  );
}

.panel-cast-showcase.is-tracking .cast-showcase-character-image {
  will-change: transform;
}

/* Positioning, width, and per-character animation timing for Desktop */
/* --cast-intro-delay: stagger order for dedicated opening (picture castPortraitReveal) */
/* --cast-float-duration/delay: per-character idle float timing */

/* 4-person layout — inner characters first, outer last */
.cast-showcase-stage[data-group-size="4"] .cast-showcase-character--0 {
  left: 25%;
  width: clamp(270px, 26vw, 440px);
  z-index: 10;
  --cast-intro-delay: 1020ms;
  --cast-float-duration: 5.8s;
  --cast-float-delay: -1.2s;
}
.cast-showcase-stage[data-group-size="4"] .cast-showcase-character--1 {
  left: 42%;
  width: clamp(310px, 29vw, 500px);
  z-index: 12;
  --cast-intro-delay: 900ms;
  --cast-float-duration: 4.9s;
  --cast-float-delay: -2.4s;
}
.cast-showcase-stage[data-group-size="4"] .cast-showcase-character--2 {
  left: 58%;
  width: clamp(310px, 29vw, 500px);
  z-index: 12;
  --cast-intro-delay: 960ms;
  --cast-float-duration: 5.4s;
  --cast-float-delay: -0.8s;
}
.cast-showcase-stage[data-group-size="4"] .cast-showcase-character--3 {
  left: 75%;
  width: clamp(270px, 26vw, 440px);
  z-index: 10;
  --cast-intro-delay: 1080ms;
  --cast-float-duration: 6.2s;
  --cast-float-delay: -3.1s;
}

/* 3-person layout — center first */
.cast-showcase-stage[data-group-size="3"] .cast-showcase-character--0 {
  left: 32%;
  width: clamp(290px, 28vw, 460px);
  z-index: 10;
  --cast-intro-delay: 980ms;
  --cast-float-duration: 5.8s;
  --cast-float-delay: -1.2s;
}
.cast-showcase-stage[data-group-size="3"] .cast-showcase-character--1 {
  left: 50%;
  width: clamp(340px, 33vw, 540px);
  z-index: 15;
  --cast-intro-delay: 900ms;
  --cast-float-duration: 4.9s;
  --cast-float-delay: -2.4s;
}
.cast-showcase-stage[data-group-size="3"] .cast-showcase-character--2 {
  left: 68%;
  width: clamp(290px, 28vw, 460px);
  z-index: 10;
  --cast-intro-delay: 1060ms;
  --cast-float-duration: 6.2s;
  --cast-float-delay: -3.1s;
}

/* Showcase copy styles overlaying the key visual */
.cast-showcase-copy {
  position: absolute;
  top: clamp(96px, 12dvh, 132px);
  left: 50%;
  z-index: 5;
  width: min(100%, 600px);
  text-align: center;
  max-width: 600px;
  padding: 0 24px;
  margin-bottom: 0;
  translate: -50% 0;
  pointer-events: auto;
}

/* Soft radial vignette behind copy text for legibility against bright character art */
.cast-showcase-copy::before {
  content: '';
  position: absolute;
  inset: -48px -72px;
  background: radial-gradient(ellipse 85% 75% at center, rgba(11, 7, 8, 0.52) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

.cast-showcase-kicker {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: #d4af37;
  margin-bottom: 12px;
}

.cast-showcase-title {
  font-family: 'Cinzel', 'Cormorant Garamond', serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  color: #d4af37;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  background: linear-gradient(
    135deg,
    #d4af37 0%,
    #e8c547 30%,
    #8b2332 58%,
    #d4af37 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.65));
  animation: panelTitleGlow 5s ease-in-out infinite;
  margin-bottom: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .ambient-particles::before,
  .ambient-particles::after {
    animation: none !important;
  }

  .ambient-particles {
    opacity: 0.42;
  }
}

.cast-showcase-lead {
  font-size: clamp(14px, 1.5vw, 16px);
  color: rgba(245, 245, 247, 0.85);
  line-height: 1.8;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  margin-bottom: 24px;
}

/* Accessibility outline indicators */
.cast-showcase-copy .btn:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.9);
  outline-offset: 4px;
}

/* Scroll list indicator */
.cast-showcase-scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  z-index: 6;
  pointer-events: auto;
}

.cast-showcase-scroll:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.9);
  outline-offset: 6px;
  border-radius: 4px;
}

.cast-showcase-scroll span:first-child {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(212, 175, 55, 0.8);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  transition: color 0.3s ease;
}

.cast-showcase-scroll:hover span:first-child {
  color: rgba(232, 197, 71, 1);
}

.cast-showcase-scroll-line {
  display: block;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(212, 175, 55, 0.8), transparent);
  position: relative;
  overflow: hidden;
}

.cast-showcase-scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  animation: scrollLineAnim 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

/* iPad Air and similar portrait tablets: normalize source canvases by height.
   The desktop width-based sizing makes individual portraits appear uneven. */
@media (min-width: 769px) and (max-width: 1366px) and (orientation: portrait) {
  .cast-showcase-character {
    height: min(76dvh, 900px);
    max-height: none;
    bottom: -3dvh;
  }

  .cast-showcase-character picture {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
  }

  .cast-showcase-character-image {
    flex: 0 0 auto;
    width: auto;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center bottom;
    transform: none !important;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--0 {
    left: 12%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--1 {
    left: 37%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--2 {
    left: 63%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--3 {
    left: 88%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character {
    height: min(80dvh, 940px);
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--0 {
    left: 18%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--1 {
    left: 50%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--2 {
    left: 82%;
  }
}

/* Large portrait tablets (including 1287 x 1516): retain the normalized
   portrait scale while allowing a proportionate step up from iPad Air. */
@media (min-width: 1025px) and (max-width: 1366px) and (orientation: portrait) {
  .cast-showcase-character {
    height: min(72dvh, 1020px);
    bottom: -2dvh;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character {
    height: min(76dvh, 1080px);
  }
}

/* High-resolution landscape tablets and compact desktop windows. At these
   heights, width-based desktop sizing makes portrait scale change excessively. */
@media (min-width: 1100px) and (max-width: 1700px) and (min-height: 1000px) and (orientation: landscape) {
  .cast-showcase-character {
    height: min(78dvh, 960px);
    max-height: none;
    bottom: -3dvh;
  }

  .cast-showcase-character picture {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
  }

  .cast-showcase-character-image {
    flex: 0 0 auto;
    width: auto;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center bottom;
    transform: none !important;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--0 {
    left: 17%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--1 {
    left: 39%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--2 {
    left: 61%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--3 {
    left: 83%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character {
    height: min(82dvh, 1000px);
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--0 {
    left: 25%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--1 {
    left: 50%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--2 {
    left: 75%;
  }
}

/* ==========================================================================
   Mobile responsive media queries (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
  .page-top #hero.panel-hero {
    /* The generic mobile panel rule makes Hero a tiny nested scroller on iOS.
       Keep the visual crop with clip-path and pass vertical swipes to the page. */
    overflow: visible !important;
    clip-path: inset(0);
    overscroll-behavior-y: auto;
    touch-action: pan-y;
    -webkit-overflow-scrolling: auto !important;
  }

  .page-top #cast.panel-cast-showcase {
    min-height: 100vh;
    min-height: 100dvh;
    /* Do not create a nested scroll container on iOS. clip-path keeps the
       visual crop without intercepting vertical swipes. */
    overflow: visible !important;
    clip-path: inset(0);
    overscroll-behavior-y: auto;
    touch-action: pan-y;
    -webkit-overflow-scrolling: auto !important;
  }

  /* Mobile characters use a shared height so differently shaped source canvases
     remain visually consistent on narrow screens such as iPhone SE. */
  .cast-showcase-character {
    height: min(72dvh, 620px);
    max-height: none;
    bottom: -4dvh;
  }

  .cast-showcase-character picture {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
  }

  .cast-showcase-character-image {
    flex: 0 0 auto;
    width: auto;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center bottom;
    transform: none !important;
  }

  /* 4-person layout on Mobile */
  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--0 {
    left: 17%;
    width: clamp(130px, 26vw, 200px);
    z-index: 10;
  }
  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--1 {
    left: 39%;
    width: clamp(150px, 29vw, 220px);
    z-index: 12;
  }
  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--2 {
    left: 61%;
    width: clamp(150px, 29vw, 220px);
    z-index: 12;
  }
  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--3 {
    left: 83%;
    width: clamp(130px, 26vw, 200px);
    z-index: 10;
  }

  /* 3-person layout on Mobile */
  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--0 {
    left: 27%;
    width: clamp(145px, 30vw, 220px);
    z-index: 10;
  }
  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--1 {
    left: 50%;
    width: clamp(175px, 36vw, 260px);
    z-index: 15;
  }
  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--2 {
    left: 73%;
    width: clamp(145px, 30vw, 220px);
    z-index: 10;
  }

  .cast-showcase-copy {
    top: clamp(12px, 2.5dvh, 22px);
    z-index: 20;
    width: min(100%, 600px);
    margin-bottom: 0;
  }

  .cast-showcase-title {
    font-size: 26px;
  }

  .cast-showcase-lead {
    font-size: 13px;
    line-height: 1.6;
    padding: 0 8px;
  }

  .cast-showcase-scroll {
    bottom: 16px;
  }

  .cast-showcase-scroll-line {
    height: 30px;
  }
}

/* ==========================================================================
   Prefers-Reduced-Motion accessibility compliance
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .panel-cast-showcase *,
  .panel-cast-showcase *::before,
  .panel-cast-showcase *::after {
    animation: none !important;
    transition: none !important;
  }

  .section-title-reveal,
  .section-copy-reveal,
  .section-actions-reveal,
  .page-top .section-title-reveal,
  .page-top .section-copy-reveal,
  .page-top .section-actions-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .cast-showcase-character {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) scale(1) !important;
    transition: none !important;
  }

  .cast-showcase-character-image {
    transform: none !important;
  }

  .cast-showcase-character picture {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .cast-showcase-word {
    opacity: 0.12 !important;
    transform: translate(-50%, -50%) !important;
  }

  .cast-showcase-scroll-line::after {
    display: none !important;
  }
}

/* ==========================================================================
   Narrow Mobile Overrides (iPhone XR / SE and similar widths)
   ========================================================================== */
@media (max-width: 480px) {
  .cast-showcase-character {
    bottom: -5dvh;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character {
    height: min(56dvh, 104vw, 480px);
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--0 {
    left: 8%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--1 {
    left: 36%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--2 {
    left: 64%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--3 {
    left: 92%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character {
    height: min(62dvh, 124vw, 540px);
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--0 {
    left: 18%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--1 {
    left: 50%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--2 {
    left: 82%;
  }
}

/* Tall mobile screens (iPhone XR and similar): keep the portraits close to the
   intro while preventing four-character groups from overlapping too heavily. */
@media (max-width: 480px) and (min-height: 721px) {
  .cast-showcase-character {
    bottom: 5dvh;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character {
    height: min(53dvh, 112vw, 480px);
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--0 {
    left: 10%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--1 {
    left: 37%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--2 {
    left: 63%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--3 {
    left: 90%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character {
    height: min(58dvh, 125vw, 520px);
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--0 {
    left: 16%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--1 {
    left: 50%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--2 {
    left: 84%;
  }
}

@media (max-width: 480px) and (max-height: 720px) {
  .cast-showcase-character {
    bottom: -6dvh;
  }

  .cast-showcase-copy {
    width: 100%;
    max-width: 360px;
    padding: 0 12px;
    margin-bottom: 0;
    transform: scale(0.82);
    transform-origin: top center;
  }

  .cast-showcase-kicker {
    margin-bottom: 6px;
  }

  .cast-showcase-title {
    font-size: 23px;
    margin-bottom: 8px;
  }

  .cast-showcase-lead {
    font-size: 11px;
    line-height: 1.45;
    margin-bottom: 10px;
  }

  .cast-showcase-copy .btn {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 12px;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--0,
  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--3 {
    width: 130px;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--1,
  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--2 {
    width: 148px;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--0 {
    left: 8%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--1 {
    left: 36%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--2 {
    left: 64%;
  }

  .cast-showcase-stage[data-group-size="4"] .cast-showcase-character--3 {
    left: 92%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--0,
  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--2 {
    width: 145px;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--1 {
    width: 175px;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--0 {
    left: 18%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--1 {
    left: 50%;
  }

  .cast-showcase-stage[data-group-size="3"] .cast-showcase-character--2 {
    left: 82%;
  }
}

/* ==========================================================================
   CAST SHOWCASE Margin Ornaments and Particle Animations
   ========================================================================== */
.cast-showcase-haze::before {
  content: '';
  position: absolute;
  inset: clamp(18px, 3vw, 48px);
  pointer-events: none;
  z-index: 2;

  background:
    linear-gradient(90deg, rgba(212, 175, 55, 0.4), transparent 18%) top left / 38% 1px no-repeat,
    linear-gradient(-90deg, rgba(212, 175, 55, 0.4), transparent 18%) top right / 38% 1px no-repeat,
    linear-gradient(90deg, rgba(212, 175, 55, 0.2), transparent 16%) bottom left / 30% 1px no-repeat,
    linear-gradient(-90deg, rgba(212, 175, 55, 0.2), transparent 16%) bottom right / 30% 1px no-repeat;

  opacity: 0.5;
  animation: castOrnamentGlow 6s ease-in-out infinite;
}

.cast-showcase-haze::after {
  content: '';
  position: absolute;
  inset: -8%;
  pointer-events: none;
  z-index: 2;

  background-image:
    radial-gradient(2px 2px at 12% 20%, rgba(212, 175, 55, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 84% 28%, rgba(232, 197, 71, 0.45), transparent),
    radial-gradient(2px 2px at 18% 76%, rgba(201, 53, 69, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 88% 70%, rgba(212, 175, 55, 0.4), transparent);

  animation: castDustDrift 12s ease-in-out infinite alternate;
}

@keyframes castOrnamentGlow {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes castDustDrift {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-10px) translateX(5px) scale(1.05);
    opacity: 0.9;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
}

/* prefers-reduced-motion overrides to stop decorations */
@media (prefers-reduced-motion: reduce) {
  .cast-showcase-haze::before,
  .cast-showcase-haze::after {
    animation: none !important;
  }
}

/* ==========================================================================
   CAST Dedicated Section Opening Intro Styles
   @keyframes-based — no transition-delay conflicts
   ========================================================================== */

/* --- Keyframe Definitions --- */

/* Left panel: stays closed (0ms-450ms), slides left (450ms-1550ms) */
@keyframes castEntryPanelLeft {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Right panel: same timing, slides right */
@keyframes castEntryPanelRight {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* Vertical line: extends 0-200ms, fades out 450-550ms */
@keyframes castEntryLine {
  0%   { transform: translate(-50%, -50%) scaleY(0); opacity: 0.8; }
  11%  { transform: translate(-50%, -50%) scaleY(1); opacity: 0.8; }
  25%  { transform: translate(-50%, -50%) scaleY(1); opacity: 0.8; }
  30%  { transform: translate(-50%, -50%) scaleY(1); opacity: 0; }
  100% { transform: translate(-50%, -50%) scaleY(1); opacity: 0; }
}

/* CAST title: fades in 200-300ms, holds, fades out 450-550ms */
@keyframes castEntryTitle {
  0%   { opacity: 0; }
  11%  { opacity: 0; }
  17%  { opacity: 1; }
  25%  { opacity: 1; }
  30%  { opacity: 0; }
  100% { opacity: 0; }
}

/* Background: fades in from 850ms, target opacity var(--cast-bg-opacity) */
/* total duration 1800ms, 850ms = 47.2% */
@keyframes castEntryBackground {
  0%    { opacity: 0; }
  47.2% { opacity: 0; }
  100%  { opacity: var(--cast-bg-opacity); }
}

/* Foreground: fades in from 1000ms to 1700ms */
/* total duration 1800ms, 1000ms = 55.6%, 1700ms = 94.4% */
@keyframes castEntryForeground {
  0%    { opacity: 0; }
  55.6% { opacity: 0; }
  94.4% { opacity: 1; }
  100%  { opacity: 1; }
}

/* CAST Portrait Reveal: stagger entrance of individual characters */
@keyframes castPortraitReveal {
  0% {
    opacity: 0;
    transform: translate3d(0, 56px, 0) scale(1.06);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* Stage Gate: hides stage until 900ms */
@keyframes castEntryStageGate {
  0%,
  49.9% {
    opacity: 0;
  }
  50%,
  100% {
    opacity: 1;
  }
}

/* Scroll cue reveal: fades in from 1150ms to 1700ms */
@keyframes castEntryScroll {
  0%,
  63.9% {
    opacity: 0;
  }
  94.4%,
  100% {
    opacity: 1;
  }
}

/* Portrait Float: subtle hover floating for PC */
@keyframes castPortraitFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -4px, 0);
  }
}

/* Portrait Float: subtle hover floating for Mobile */
@keyframes castPortraitFloatMobile {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -2px, 0);
  }
}

/* --- Static Styles --- */

.cast-entry-intro {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
  display: block;
}

.cast-entry-panel {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background-color: #0b0708;
  background-image: radial-gradient(circle at center, #2a0e12 0%, #0b0708 100%);
  /* No transition: position controlled by @keyframes only */
}

.cast-entry-panel--left {
  left: 0;
}

.cast-entry-panel--right {
  right: 0;
}

.cast-entry-line {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scaleY(0);
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(212, 175, 55, 0.8), transparent);
  opacity: 0;
  /* No transition: controlled by @keyframes only */
}

.cast-entry-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Cinzel', serif;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 500;
  letter-spacing: 0.4em;
  color: #d4af37;
  opacity: 0;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
  /* No transition: controlled by @keyframes only */
}

/* ==========================================================================
   State: Pending — panels closed, foreground hidden, no animation running
   ========================================================================== */
.panel-cast-showcase.is-cast-entry-pending .cast-showcase-stage,
.panel-cast-showcase.is-cast-entry-pending .cast-showcase-copy,
.panel-cast-showcase.is-cast-entry-pending .cast-showcase-scroll {
  opacity: 0;
  transition: none;
}

.panel-cast-showcase.is-cast-entry-pending .cast-showcase-bg {
  opacity: 0;
  transition: none;
}

/* ==========================================================================
   State: Playing — all animation driven by @keyframes, NO transition-delay
   Each element is assigned exactly ONE animation — no opacity conflicts
   ========================================================================== */

/* Panels animate open: hold 0-450ms, slide out 450-1550ms of 1800ms total */
.panel-cast-showcase.is-cast-entry-playing .cast-entry-panel--left {
  animation: castEntryPanelLeft 1800ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-fill-mode: both;
}

.panel-cast-showcase.is-cast-entry-playing .cast-entry-panel--right {
  animation: castEntryPanelRight 1800ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-fill-mode: both;
}

/* Line: extends 0-200ms, holds, fades out at 450ms */
.panel-cast-showcase.is-cast-entry-playing .cast-entry-line {
  animation: castEntryLine 1800ms ease forwards;
  animation-fill-mode: both;
}

/* Title: fades in 200-300ms, holds, fades out at 450ms */
.panel-cast-showcase.is-cast-entry-playing .cast-entry-title {
  animation: castEntryTitle 1800ms ease forwards;
  animation-fill-mode: both;
}

/* Background: fades in from 850ms */
.panel-cast-showcase.is-cast-entry-playing .cast-showcase-bg {
  animation: castEntryBackground 1800ms ease forwards;
  animation-fill-mode: both;
}

/* Stage reveal timing: linear gate animation at 900ms */
.panel-cast-showcase.is-cast-entry-playing .cast-showcase-stage {
  animation: castEntryStageGate 1800ms linear both;
}

/* Individual character reveal: delay stagger order using --cast-intro-delay */
.panel-cast-showcase.is-cast-entry-playing .cast-showcase-character picture {
  animation:
    castPortraitReveal
    620ms
    cubic-bezier(0.16, 1, 0.3, 1)
    var(--cast-intro-delay)
    both;
}

/* Foreground copy text reveal: 1000ms-1700ms ease */
.panel-cast-showcase.is-cast-entry-playing .cast-showcase-copy {
  animation: castEntryForeground 1800ms ease both;
}

/* Scroll cue reveal: 1150ms-1700ms ease */
.panel-cast-showcase.is-cast-entry-playing .cast-showcase-scroll {
  animation: castEntryScroll 1800ms ease both;
}

/* ==========================================================================
   State: Complete — intro overlay hidden, all content visible, normal behavior
   ========================================================================== */
.panel-cast-showcase.is-cast-entry-complete .cast-entry-intro {
  display: none;
}

.panel-cast-showcase.is-cast-entry-complete .cast-showcase-stage,
.panel-cast-showcase.is-cast-entry-complete .cast-showcase-copy,
.panel-cast-showcase.is-cast-entry-complete .cast-showcase-scroll {
  opacity: 1;
  animation: none;
}

.panel-cast-showcase.is-cast-entry-complete .cast-showcase-character picture {
  animation-name: castPortraitFloat;
  animation-duration: var(--cast-float-duration);
  animation-timing-function: ease-in-out;
  animation-delay: var(--cast-float-delay);
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

@media (max-width: 768px) {
  .panel-cast-showcase.is-cast-entry-complete .cast-showcase-character picture {
    animation-name: castPortraitFloatMobile;
  }
}

.panel-cast-showcase.is-cast-entry-complete .cast-showcase-bg {
  opacity: var(--cast-bg-opacity);
  animation: none;
}

/* ==========================================================================
   prefers-reduced-motion — skip intro entirely, show everything immediately
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .cast-entry-intro {
    display: none;
  }

  .panel-cast-showcase .cast-showcase-stage,
  .panel-cast-showcase .cast-showcase-copy,
  .panel-cast-showcase .cast-showcase-scroll {
    opacity: 1;
    animation: none;
    transition: none;
  }

  .panel-cast-showcase .cast-showcase-bg {
    opacity: var(--cast-bg-opacity);
    animation: none;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   Birthday Festival Hero
   Enabled only when birthday-theme.js marks the next opening as a festival.
   ========================================================================== */
.birthday-festival,
.birthday-festival-portrait {
  display: none;
}

.has-birthday-festival .panel-hero {
  --festival-main: #e6e5ef;
  --festival-accent: #3e3a3a;
  --festival-sub: #ced7dc;
  --festival-decor: #e4d46f;
  --festival-highlight: #e4d46f;
}

.has-birthday-festival .panel-hero .hero-bg {
  z-index: 0;
  filter: saturate(0.72) contrast(1.04);
}

.has-birthday-festival .panel-hero .hero-overlay {
  z-index: 1;
  background:
    radial-gradient(circle at 78% 38%,
      color-mix(in srgb, var(--festival-main) 22%, transparent),
      transparent 34%),
    linear-gradient(90deg,
      rgba(5, 5, 7, 0.88) 0%,
      rgba(8, 8, 11, 0.72) 54%,
      color-mix(in srgb, var(--festival-accent) 32%, rgba(5, 5, 7, 0.72)) 100%);
}

.has-birthday-festival .hero-copy {
  z-index: 4;
  box-sizing: border-box;
  padding-right: min(38vw, 580px);
  padding-left: clamp(24px, 5vw, 80px);
}

.has-birthday-festival .birthday-festival {
  width: min(620px, calc(100% - 24px));
  min-height: 286px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  align-items: center;
  gap: 0;
  margin: 0 auto 8px;
  padding: 18px clamp(54px, 8vw, 88px) 16px;
  position: relative;
  z-index: 4;
  isolation: isolate;
  overflow: hidden;
  color: var(--festival-decor);
  background:
    radial-gradient(ellipse at 50% 48%,
      rgba(255, 255, 255, 0.97) 0 55%,
      color-mix(in srgb, var(--festival-decor) 20%, white) 55.5% 57.5%,
      rgba(250, 248, 252, 0.92) 58% 65%,
      color-mix(in srgb, var(--festival-decor) 86%, transparent) 65.5% 67.5%,
      transparent 68%),
    repeating-linear-gradient(90deg,
      transparent 0 19px,
      color-mix(in srgb, var(--festival-decor) 7%, transparent) 19px 20px),
    repeating-linear-gradient(0deg,
      transparent 0 19px,
      color-mix(in srgb, var(--festival-decor) 7%, transparent) 19px 20px),
    repeating-linear-gradient(135deg,
      rgba(255, 255, 255, 0.03) 0 12px,
      color-mix(in srgb, var(--festival-decor) 7%, transparent) 12px 13px);
  box-shadow:
    inset 0 0 34px color-mix(in srgb, var(--festival-decor) 14%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.34));
}

.has-birthday-festival .birthday-festival::before,
.has-birthday-festival .birthday-festival::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 120px;
  height: 54px;
  border: 8px solid var(--festival-highlight);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 7px 10px rgba(0, 0, 0, 0.22);
}

.has-birthday-festival .birthday-festival::before {
  top: -30px;
  left: -34px;
  border-radius: 0 0 54px 0;
  transform: rotate(-7deg);
}

.has-birthday-festival .birthday-festival::after {
  right: -34px;
  bottom: -30px;
  border-radius: 54px 0 0 0;
  transform: rotate(-7deg);
}

.birthday-festival-emblem {
  display: grid;
  place-items: center;
  align-self: center;
  position: relative;
  z-index: 2;
}

.birthday-festival-emblem::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: clamp(220px, 28vw, 282px);
  aspect-ratio: 1;
  border: 3px solid color-mix(in srgb, var(--festival-highlight) 78%, white);
  border-radius: 50%;
  background:
    radial-gradient(circle,
      rgba(255, 255, 255, 0.96) 0 58%,
      transparent 58.5%),
    conic-gradient(from 16deg,
      var(--festival-highlight),
      color-mix(in srgb, var(--festival-highlight) 20%, white),
      var(--festival-highlight));
  opacity: 0.72;
  transform: translate(-50%, -50%);
}

.birthday-festival-brand {
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 160px;
  min-height: 62px;
  margin-top: -2px;
  padding: 0 14px 5px;
  border-bottom: 3px double color-mix(in srgb, var(--festival-decor) 62%, white);
}

.birthday-festival-brand img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  filter:
    drop-shadow(0 4px 6px rgba(66, 39, 70, 0.28))
    drop-shadow(0 0 10px color-mix(in srgb, var(--festival-decor) 24%, transparent));
}

.birthday-festival-brand span {
  color: color-mix(in srgb, var(--festival-decor) 82%, #49324d);
  font-family: 'Harenosora', 'Yu Mincho', serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

@media (min-width: 769px), (hover: hover) and (pointer: fine) {
  .has-birthday-festival .birthday-festival {
    min-height: 330px;
  }

  .birthday-festival-brand {
    flex-direction: column;
    gap: 5px;
    min-width: 170px;
    min-height: 82px;
    margin-top: -4px;
    padding: 0 14px 7px;
  }

  .birthday-festival-brand img {
    width: 50px;
    height: 50px;
  }

  .birthday-festival-brand span {
    line-height: 1.1;
  }

  .has-birthday-festival .birthday-festival-emblem {
    row-gap: 8px;
  }

  .has-birthday-festival .birthday-festival-kicker {
    position: static;
    margin: 0;
  }

  .has-birthday-festival .birthday-festival-title {
    transform: rotate(-2deg);
  }
}

.birthday-festival-kicker {
  position: absolute;
  top: -32px;
  margin: 0;
  color: color-mix(in srgb, var(--festival-decor) 78%, #56385a);
  font-family: 'Cinzel', serif;
  font-size: clamp(0.66rem, 0.9vw, 0.78rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  white-space: nowrap;
}

.birthday-festival-title {
  display: grid;
  justify-items: center;
  row-gap: 12px;
  margin: 0;
  font-family: 'YDWaosagi', 'Harenosora', sans-serif;
  line-height: 1.04;
  letter-spacing: 0.06em;
  transform: translateY(-8px) rotate(-2deg);
}

.birthday-festival-dragon,
.birthday-festival-event {
  color: #fff;
  -webkit-text-stroke: 5px var(--festival-highlight);
  paint-order: stroke fill;
  text-shadow:
    0 6px 0 color-mix(in srgb, var(--festival-highlight) 74%, #765a78),
    0 10px 16px rgba(78, 47, 82, 0.24);
}

.birthday-festival-dragon {
  font-size: clamp(2.75rem, 4.8vw, 4rem);
}

.birthday-festival-event {
  margin-top: 0;
  font-size: clamp(2.05rem, 3.8vw, 3.1rem);
}

.birthday-festival-date {
  position: absolute;
  left: clamp(50px, 8%, 68px);
  bottom: 40px;
  z-index: 3;
  padding: 9px 11px 7px;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--festival-highlight);
  box-shadow:
    0 0 0 3px var(--festival-highlight),
    0 5px 12px rgba(77, 47, 80, 0.3);
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  transform: rotate(-9deg);
}

.birthday-festival-ruyi {
  position: absolute;
  z-index: 3;
  width: 150px;
  height: 78px;
  color: var(--festival-highlight);
  background: currentColor;
  -webkit-mask: url('../img/material/3-2@2x.webp') center / contain no-repeat;
  mask: url('../img/material/3-2@2x.webp') center / contain no-repeat;
  opacity: 0.84;
  filter: drop-shadow(0 0 8px color-mix(in srgb, currentColor 30%, transparent));
}

.birthday-festival-ruyi--right {
  top: 76px;
  right: 30px;
}

.birthday-festival-ruyi--left {
  left: 27px;
  bottom: 68px;
  color: var(--festival-highlight);
  -webkit-mask-image: url('../img/material/4-2@2x.webp');
  mask-image: url('../img/material/4-2@2x.webp');
  transform: scale(0.78) rotate(180deg);
}

.birthday-festival-material-frame {
  position: absolute;
  inset: 7px;
  z-index: 2;
  background: var(--festival-decor);
  -webkit-mask: url('../img/material/1-2@2x.webp') center / 100% 100% no-repeat;
  mask: url('../img/material/1-2@2x.webp') center / 100% 100% no-repeat;
  opacity: 0.68;
  pointer-events: none;
}

.birthday-festival-lanterns {
  position: absolute;
  top: 74px;
  left: 11%;
  z-index: 1;
  width: 174px;
  height: 112px;
  color: var(--festival-highlight);
  opacity: 0.28;
}

.birthday-festival-lanterns i {
  position: absolute;
  top: 0;
  width: 48px;
  height: 80px;
  background: currentColor;
  -webkit-mask: url('../img/material/chinese_17.webp') center / contain no-repeat;
  mask: url('../img/material/chinese_17.webp') center / contain no-repeat;
  transform-origin: 50% -22px;
}

.birthday-festival-lanterns i::before {
  content: none;
}

.birthday-festival-lanterns i::after {
  content: none;
}

.birthday-festival-lanterns i:nth-child(1) {
  left: 0;
  transform: scale(0.82) rotate(-4deg);
}

.birthday-festival-lanterns i:nth-child(2) {
  top: 12px;
  left: 63px;
}

.birthday-festival-lanterns i:nth-child(3) {
  left: 126px;
  transform: scale(0.82) rotate(4deg);
}

.birthday-festival-medallion {
  position: absolute;
  right: 48px;
  bottom: 58px;
  z-index: 3;
  width: 48px;
  aspect-ratio: 1;
  background: var(--festival-decor);
  -webkit-mask: url('../img/material/chinese_06.webp') center / contain no-repeat;
  mask: url('../img/material/chinese_06.webp') center / contain no-repeat;
  opacity: 0.76;
  filter: drop-shadow(0 3px 5px rgba(82, 45, 86, 0.22));
}

.birthday-festival-link {
  z-index: 4;
  align-self: end;
  margin-top: 10px;
  padding: 5px 19px 6px;
  border: 1px solid color-mix(in srgb, var(--festival-decor) 56%, white);
  border-radius: 999px;
  color: color-mix(in srgb, var(--festival-decor) 84%, #3a263c);
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.birthday-festival-link:hover,
.birthday-festival-link:focus-visible {
  color: #fff;
  background: var(--festival-decor);
  transform: translateY(-2px);
}

.has-birthday-festival .birthday-festival-portrait {
  --birthday-portrait-opacity: 1;
  --birthday-portrait-filter:
    drop-shadow(-18px 12px 26px rgba(0, 0, 0, 0.7))
    drop-shadow(0 0 26px color-mix(in srgb, var(--festival-main) 22%, transparent));
  display: block;
  position: absolute;
  right: clamp(-54px, -2vw, -16px);
  bottom: -5vh;
  z-index: 3;
  width: min(43vw, 620px);
  height: 92%;
  pointer-events: none;
  filter: var(--birthday-portrait-filter);
}

.birthday-festival-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.has-birthday-festival .hero-mark {
  display: none;
}

.has-birthday-festival .hero-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.has-birthday-festival .hero-next-opening {
  color: rgba(255, 255, 255, 0.95);
}

.has-birthday-festival .hero-next-opening::before,
.has-birthday-festival .hero-next-opening::after {
  background: linear-gradient(90deg, transparent, var(--festival-main));
}

.has-birthday-festival .hero-next-opening::after {
  background: linear-gradient(90deg, var(--festival-main), transparent);
}

@media (max-width: 900px) {
  .has-birthday-festival .hero-copy {
    padding-right: 34vw;
    padding-left: 18px;
  }

  .has-birthday-festival .birthday-festival-portrait {
    --birthday-portrait-opacity: 0.82;
    right: -13vw;
    width: 50vw;
    opacity: var(--birthday-portrait-opacity);
  }
}

@media (max-width: 768px) {
  .has-birthday-festival .panel-hero .hero-overlay {
    background:
      linear-gradient(180deg,
        rgba(5, 5, 7, 0.68) 0%,
        rgba(5, 5, 7, 0.83) 64%,
        rgba(5, 5, 7, 0.96) 100%),
      radial-gradient(circle at 70% 34%,
        color-mix(in srgb, var(--festival-main) 24%, transparent),
        transparent 44%);
  }

  .has-birthday-festival .hero-copy {
    padding: 12px 16px 22px;
    top: 18px;
  }

  .has-birthday-festival .birthday-festival {
    width: min(560px, calc(100% - 12px));
    margin-bottom: 10px;
    padding: 16px clamp(34px, 10vw, 58px) 14px;
  }

  .has-birthday-festival .birthday-festival-portrait {
    --birthday-portrait-opacity: 0.3;
    --birthday-portrait-filter:
      grayscale(0.16)
      drop-shadow(0 0 20px rgba(255, 255, 255, 0.14));
    right: -28vw;
    bottom: -7vh;
    z-index: 2;
    width: 88vw;
    height: 86%;
    opacity: var(--birthday-portrait-opacity);
    filter: var(--birthday-portrait-filter);
  }

  .has-birthday-festival .hero-mark {
    width: 64px;
    height: 64px;
    margin-bottom: 4px;
  }

  .has-birthday-festival .hero-title {
    margin: 4px auto 8px;
    font-size: clamp(2.8rem, 15vw, 3.6rem);
  }

  .has-birthday-festival .hero-lead {
    margin: 10px auto;
    font-size: clamp(0.92rem, 4vw, 1.08rem);
  }

  .has-birthday-festival .hero-next-opening {
    margin-bottom: 10px;
  }

  .has-birthday-festival .hero-cta {
    margin-top: 12px;
  }

  .birthday-festival-ruyi--right {
    right: 17px;
  }

  .birthday-festival-ruyi--left {
    left: 15px;
  }
}

@media (max-height: 700px) and (max-width: 768px) {
  .has-birthday-festival .hero-mark {
    width: 50px;
    height: 50px;
  }

  .has-birthday-festival .hero-title {
    font-size: 2.65rem;
  }

  .has-birthday-festival .birthday-festival {
    min-height: 230px;
    margin-block: -6px 6px;
  }

  .has-birthday-festival .birthday-festival-emblem::before {
    width: 210px;
  }

  .has-birthday-festival .birthday-festival-dragon {
    font-size: 2.35rem;
  }

  .has-birthday-festival .birthday-festival-event {
    font-size: 1.85rem;
  }

  .has-birthday-festival .hero-lead {
    margin-block: 6px;
    line-height: 1.5;
  }

  .has-birthday-festival .hero-cta {
    flex-direction: row;
    width: min(540px, calc(100% - 28px));
  }
}

/* 生誕祭Hero: narrow phones (320px–480px) */
@media (max-width: 480px) {
  .has-birthday-festival .hero-copy {
    padding: 8px 6px 18px;
  }

  .has-birthday-festival .birthday-festival {
    width: calc(100% - 4px);
    min-height: 258px;
    padding: 12px 26px;
    margin-bottom: 8px;
  }

  .birthday-festival-material-frame {
    inset: 5px;
  }

  .birthday-festival-brand {
    gap: 6px;
    min-width: 138px;
    min-height: 52px;
    padding: 0 10px 4px;
  }

  .birthday-festival-brand img {
    width: 52px;
    height: 52px;
  }

  .birthday-festival-brand span {
    font-size: 1.12rem;
    letter-spacing: 0.12em;
  }

  .has-birthday-festival .birthday-festival-emblem::before {
    width: 190px;
  }

  .birthday-festival-title {
    row-gap: 10px;
    transform: translateY(-5px) rotate(-2deg);
  }

  .has-birthday-festival .birthday-festival-dragon {
    font-size: clamp(2.25rem, 12vw, 3rem);
  }

  .has-birthday-festival .birthday-festival-event {
    margin-top: 0;
    font-size: clamp(1.7rem, 9vw, 2.25rem);
  }

  .birthday-festival-dragon,
  .birthday-festival-event {
    -webkit-text-stroke-width: 4px;
  }

  .birthday-festival-kicker {
    top: -26px;
    font-size: 0.58rem;
    letter-spacing: 0.18em;
  }

  .birthday-festival-ruyi {
    width: 104px;
    height: 58px;
    opacity: 0.62;
  }

  .birthday-festival-ruyi--right {
    top: 80px;
    right: 8px;
  }

  .birthday-festival-ruyi--left {
    left: 8px;
    bottom: 54px;
  }

  .birthday-festival-lanterns {
    top: 72px;
    left: 7%;
    width: 130px;
    height: 90px;
    opacity: 0.22;
  }

  .birthday-festival-lanterns i {
    width: 36px;
    height: 60px;
  }

  .birthday-festival-lanterns i:nth-child(2) {
    left: 47px;
  }

  .birthday-festival-lanterns i:nth-child(3) {
    left: 94px;
  }

  .birthday-festival-date {
    left: 28px;
    bottom: 36px;
    padding: 6px 8px 5px;
    font-size: 0.72rem;
  }

  .birthday-festival-medallion {
    right: 28px;
    bottom: 48px;
    width: 34px;
  }

  .birthday-festival-link {
    max-width: calc(100% - 96px);
    margin-top: 6px;
    padding: 4px 12px 5px;
    font-size: 0.68rem;
    text-align: center;
  }

  .has-birthday-festival .hero-lead {
    margin: 7px auto;
    padding-inline: 8px;
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .has-birthday-festival .hero-next-opening {
    max-width: calc(100% - 12px);
    margin: 2px auto 7px;
    gap: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  .has-birthday-festival .hero-cta {
    flex-direction: row;
    gap: 8px;
    width: min(292px, calc(100% - 20px));
    margin-top: 8px;
  }

  .has-birthday-festival .hero-cta .btn {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .has-birthday-festival .birthday-festival-portrait {
    --birthday-portrait-opacity: 0.22;
  }
}

@media (max-width: 360px) {
  .has-birthday-festival .birthday-festival {
    min-height: 244px;
    padding-inline: 21px;
  }

  .birthday-festival-brand {
    min-height: 48px;
  }

  .birthday-festival-brand img {
    width: 46px;
    height: 46px;
  }

  .birthday-festival-brand span {
    font-size: 1rem;
  }

  .has-birthday-festival .birthday-festival-emblem::before {
    width: 176px;
  }

  .has-birthday-festival .birthday-festival-dragon {
    font-size: 2.15rem;
  }

  .has-birthday-festival .birthday-festival-event {
    font-size: 1.65rem;
  }

  .birthday-festival-title {
    row-gap: 9px;
  }

  .birthday-festival-ruyi {
    width: 90px;
  }

  .birthday-festival-date {
    left: 20px;
  }

  .birthday-festival-medallion {
    right: 20px;
  }
}

@media (max-width: 480px) and (max-height: 700px) {
  .has-birthday-festival .hero-copy {
    top: 8px;
  }

  .has-birthday-festival .birthday-festival {
    min-height: 220px;
    padding: 9px 21px 10px;
    margin-block: -4px 8px;
  }

  .birthday-festival-brand {
    min-height: 44px;
  }

  .birthday-festival-brand img {
    width: 42px;
    height: 42px;
  }

  .has-birthday-festival .birthday-festival-emblem::before {
    width: 168px;
  }

  .has-birthday-festival .birthday-festival-dragon {
    font-size: 2rem;
  }

  .has-birthday-festival .birthday-festival-event {
    font-size: 1.52rem;
  }

  .birthday-festival-ruyi--left,
  .birthday-festival-medallion {
    display: none;
  }

  .birthday-festival-date {
    bottom: 26px;
  }

  .birthday-festival-link {
    margin-top: 3px;
  }

  .has-birthday-festival .hero-lead {
    margin-block: 4px;
    font-size: 0.82rem;
  }

  .has-birthday-festival .hero-next-opening {
    margin-bottom: 5px;
  }

  .has-birthday-festival .birthday-festival-portrait {
    --birthday-portrait-opacity: 0.18;
  }
}

/* 横向きスマホではHeroを画面高に押し込まず、内容分の高さを確保する。 */
@media (orientation: landscape) and (max-height: 500px) {
  .page-top #hero.panel-hero {
    height: auto !important;
    min-height: 540px !important;
    overflow: hidden !important;
    clip-path: none;
  }

  .page-top #hero .hero-scene {
    height: 540px;
    min-height: 540px;
  }

  .has-birthday-festival .hero-copy {
    height: 540px;
    top: 0;
    padding: 12px 16px 18px;
  }

  .has-birthday-festival .birthday-festival {
    width: min(720px, calc(100% - 16px));
    min-height: 244px;
    margin-bottom: 12px;
  }

  .has-birthday-festival .birthday-festival-portrait {
    --birthday-portrait-opacity: 0.16;
  }
}

/* 生誕祭専用の登場演出と、白銀の祝祭光。 */
@media (prefers-reduced-motion: no-preference) {
  .has-birthday-festival .birthday-festival-portrait {
    opacity: 0;
    transform: translate3d(72px, 28px, 0) scale(1.04);
  }

  .has-birthday-festival .panel-hero.hero-ready .birthday-festival-portrait {
    animation:
      birthdayPortraitReveal 1.35s cubic-bezier(0.16, 1, 0.3, 1) 0.18s forwards,
      birthdayPortraitFloat 6s ease-in-out 1.55s infinite;
  }

  .has-birthday-festival .panel-hero.hero-ready .birthday-festival::before,
  .has-birthday-festival .panel-hero.hero-ready .birthday-festival::after {
    animation: birthdayLineShimmer 2.8s ease-in-out 0.7s infinite;
  }

  .has-birthday-festival .panel-hero.hero-ready .birthday-festival-dragon,
  .has-birthday-festival .panel-hero.hero-ready .birthday-festival-event {
    animation: birthdayTitleGlow 3.6s ease-in-out 0.85s infinite;
  }

  .has-birthday-festival .panel-hero.hero-ready .birthday-festival-emblem::before {
    animation: birthdayEmblemTurn 12s linear infinite;
  }

  .has-birthday-festival .panel-hero.hero-ready .birthday-festival-ruyi--right {
    animation: birthdayCloudFloat 3.8s ease-in-out 0.5s infinite;
  }

  .has-birthday-festival .panel-hero.hero-ready .birthday-festival-ruyi--left {
    animation: birthdayCloudFloatSmall 4.4s ease-in-out 0.9s infinite;
  }

  .has-birthday-festival .panel-hero.hero-ready .birthday-festival-date {
    animation: birthdayDatePulse 3.2s ease-in-out 1s infinite;
  }

  .has-birthday-festival .panel-hero.hero-ready .birthday-festival-lanterns {
    animation: birthdayLanternDrift 4.8s ease-in-out 0.6s infinite;
  }

  .has-birthday-festival .panel-hero.hero-ready .birthday-festival-medallion {
    animation: birthdaySealGlow 3.6s ease-in-out 1.1s infinite;
  }

  .has-birthday-festival .panel-hero.hero-ready .birthday-festival-material-frame {
    animation: birthdayKeylineGlow 3s ease-in-out 0.8s infinite;
  }

  .has-birthday-festival .panel-hero .panel-inner::after {
    content: '';
    position: absolute;
    inset: 4% 2%;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    background-image:
      radial-gradient(2px 2px at 74% 18%, var(--festival-main), transparent),
      radial-gradient(1.5px 1.5px at 86% 31%, #fff, transparent),
      radial-gradient(2px 2px at 68% 48%, var(--festival-sub), transparent),
      radial-gradient(1px 1px at 91% 57%, #fff, transparent),
      radial-gradient(1.5px 1.5px at 77% 72%, var(--festival-main), transparent),
      radial-gradient(2px 2px at 61% 82%, var(--festival-sub), transparent);
    filter: drop-shadow(0 0 6px var(--festival-main));
  }

  .has-birthday-festival .panel-hero.hero-ready .panel-inner::after {
    animation: birthdaySparkleDrift 5.2s ease-in-out 0.45s infinite;
  }
}

@keyframes birthdayPortraitReveal {
  0% {
    opacity: 0;
    transform: translate3d(72px, 28px, 0) scale(1.04);
    filter:
      blur(8px)
      drop-shadow(-18px 12px 26px rgba(0, 0, 0, 0.7));
  }
  100% {
    opacity: var(--birthday-portrait-opacity, 1);
    transform: translate3d(0, 0, 0) scale(1);
    filter: var(--birthday-portrait-filter);
  }
}

@keyframes birthdayPortraitFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -8px, 0);
  }
}

@keyframes birthdayLineShimmer {
  0%,
  100% {
    opacity: 0.52;
    filter: brightness(0.9);
  }
  50% {
    opacity: 1;
    filter: brightness(1.45) drop-shadow(0 0 5px var(--festival-main));
  }
}

@keyframes birthdayTitleGlow {
  0%,
  100% {
    filter: brightness(0.96) drop-shadow(0 0 0 transparent);
  }
  50% {
    filter:
      brightness(1.12)
      drop-shadow(0 0 8px color-mix(in srgb, var(--festival-decor) 46%, transparent));
  }
}

@keyframes birthdayEmblemTurn {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes birthdayCloudFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-5px, -5px, 0);
  }
}

@keyframes birthdayCloudFloatSmall {
  0%,
  100% {
    transform: scale(0.78) rotate(180deg) translate3d(0, 0, 0);
  }
  50% {
    transform: scale(0.78) rotate(180deg) translate3d(6px, -5px, 0);
  }
}

@keyframes birthdayDatePulse {
  0%,
  100% {
    transform: rotate(-9deg) scale(1);
  }
  50% {
    transform: rotate(-6deg) scale(1.06);
  }
}

@keyframes birthdayLanternDrift {
  0%,
  100% {
    transform: rotate(-1deg) translateY(0);
  }
  50% {
    transform: rotate(1deg) translateY(3px);
  }
}

@keyframes birthdaySealGlow {
  0%,
  100% {
    filter: brightness(0.96);
    box-shadow: 0 4px 8px rgba(82, 45, 86, 0.2);
  }
  50% {
    filter: brightness(1.15);
    box-shadow:
      0 4px 8px rgba(82, 45, 86, 0.2),
      0 0 12px color-mix(in srgb, var(--festival-decor) 42%, transparent);
  }
}

@keyframes birthdayKeylineGlow {
  0%,
  100% {
    opacity: 0.56;
    filter: none;
  }
  50% {
    opacity: 0.92;
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--festival-decor) 50%, transparent));
  }
}

@keyframes birthdaySparkleDrift {
  0%,
  100% {
    opacity: 0.24;
    transform: translate3d(0, 12px, 0) scale(0.98);
  }
  50% {
    opacity: 0.82;
    transform: translate3d(-8px, -14px, 0) scale(1.03);
  }
}
