:root {
  color-scheme: light;
  --ink: #222222;
  --ink-soft: #707070;
  --paper: #f3f7fa;
  --white: #ffffff;
  --primary: #1061a7;
  --sky: #5cb7e3;
  --navy: #396595;
  --accent-yellow: #f4ca56;
  --line: #daeaf5;
  --cta-a: #f2994a;
  --cta-b: #e9612d;
  --progress: 0;
  font-family: "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", "Yu Gothic", "游ゴシック体", Meiryo, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--cta-b);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 999px;
  color: var(--white);
  background: var(--primary);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}
.skip-link:focus { transform: translateY(0); }

.wip-ribbon {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 29px;
  margin: 0;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.92);
  background: var(--navy);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}
.wip-ribbon span {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-yellow);
  color: #222222;
  flex: none;
}
.wip-ribbon em { font-style: normal; }
.wip-ribbon__short { display: none; }

.site-header {
  position: fixed;
  inset: 29px 0 auto 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 72px;
  padding: 0 clamp(16px, 4vw, 72px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(243, 247, 250, 0.94);
}

.brand { display: inline-flex; align-items: center; min-height: 44px; flex: none; }
.brand img { display: block; width: clamp(120px, 12vw, 164px); height: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
}
.site-nav a { text-decoration: none; white-space: nowrap; }
.site-nav__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  color: var(--white);
  background: var(--primary);
  font-size: 14px;
}

/* ============ シネマ本体 ============ */

.scroll-cinema {
  position: relative;
  height: 880vh;
  height: 880svh;
  min-height: 4400px;
  background: var(--paper);
}

.scroll-cinema__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
  background: var(--paper);
}

.leg {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease, visibility 0s linear 240ms;
}
.leg.is-active,
.leg.is-neighbor {
  visibility: visible;
  transition: opacity 240ms ease;
}
.leg.is-active { opacity: 1; z-index: 2; }
.leg.is-neighbor { opacity: 0; z-index: 1; }

.leg__poster,
.leg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}
.leg video { opacity: 0; }
.leg video.is-ready { opacity: 1; }

/* コピー下の白グロー＝キャラより下の独立レイヤー（キャラの頭を消さない） */
.leg__glow {
  position: absolute;
  left: clamp(-40px, calc(5vw - 80px), 20px);
  bottom: 4vh;
  bottom: 4svh;
  width: min(700px, 58vw);
  height: 52vh;
  height: 52svh;
  z-index: 1;
  background: radial-gradient(closest-side, rgba(243, 247, 250, 0.9) 45%, rgba(243, 247, 250, 0));
  pointer-events: none;
}

.leg__chars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.char {
  position: absolute;
  bottom: 9vh;
  bottom: 9svh;
  height: 30vh;
  height: 30svh;
  width: auto;
  filter: drop-shadow(0 14px 18px rgba(16, 40, 70, 0.22));
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  will-change: transform, opacity;
  z-index: 2;
  /* 待機モーション（呼吸）: JSのtransformと独立して合成される translate プロパティで下方向±3px。
     顔は上へ動かさない＝本文・UIとのクリアランス検査値を侵さない */
  animation: char-idle 3.2s ease-in-out infinite;
}
@keyframes char-idle {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 3px; }
}
.char--l { animation-duration: 3.8s; animation-delay: 0.6s; }
.char--r { animation-duration: 3.5s; animation-delay: 1.1s; }
@media (prefers-reduced-motion: reduce) { .char { animation: none; } }
.is-static .char { animation: none; }
.char--c { left: 50%; margin-left: -9vh; margin-left: -9svh; height: 33vh; height: 33svh; z-index: 3; }
.char--l { left: 16%; height: 25vh; height: 25svh; }
.char--r { right: 14%; height: 26vh; height: 26svh; }

.leg__copy {
  position: absolute;
  left: clamp(24px, 5vw, 84px);
  bottom: clamp(88px, 15vh, 170px);
  bottom: clamp(88px, 15svh, 170px);
  z-index: 4;
  max-width: min(560px, 62vw);
  opacity: 0;
  transform: translateY(18px);
  will-change: transform, opacity;
}

.leg__index {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--primary);
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.95), 0 0 16px rgba(255, 255, 255, 0.85);
}
.leg__eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.95), 0 0 16px rgba(255, 255, 255, 0.85);
}
.leg__copy h1,
.leg__copy h2 {
  margin: 0 0 16px;
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1.3;
  color: var(--ink);
  text-wrap: balance;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.7);
}
.leg__copy h1 strong,
.leg__copy h2 strong {
  display: block;
  font-weight: 600;
  color: var(--primary);
}
.leg__lead {
  margin: 0;
  font-size: clamp(14px, 1.35vw, 17px);
  line-height: 1.85;
  color: #333333;
  max-width: 36em;
  text-wrap: pretty;
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.85);
}
.br-wide { display: none; }
@media (min-width: 901px) { .br-wide { display: inline; } }

.leg__note {
  font-size: 0.8em;
  text-decoration: none;
  color: var(--primary);
}
.tap-target {
  position: relative;
  display: inline-block;
  padding: 14px 18px;
  margin: -14px -18px;
}

.leg__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 24px;
}

/* PC(1121px〜)のみ: 左キャラをコピー欄（見出し・リードの実行末＋余白）の外へ出す。
   本文の行末がキャラの目・口に乗る構造問題の恒久対策（SPの配置には触れない） */
@media (min-width: 1121px) {
  .char--l { left: 36%; height: 22vh; height: 22svh; }
  .leg[data-leg="4"] .char--l { left: 62%; }
}

/* 中間幅(901-1120px): コピーとキャラ頭部の交差を緩和 */
@media (min-width: 901px) and (max-width: 1120px) {
  .leg__copy { max-width: min(520px, 54vw); }
  .char { bottom: 5vh; bottom: 5svh; }
  /* 左キャラはコピー欄と交差しない右側クラスタへ（中央キャラとの間隔は維持） */
  .char--l { left: auto; right: 22%; height: 16vh; height: 16svh; }
  .char--c { height: 30vh; height: 30svh; }
  .char--r { right: 6%; height: 21vh; height: 21svh; }
  .leg[data-leg="4"] .char--l { right: 30%; height: 14vh; height: 14svh; }
}


.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 32px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}
.button--primary {
  color: var(--white);
  background: linear-gradient(135deg, var(--cta-a), var(--cta-b));
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
.text-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 2px solid var(--sky);
  padding-bottom: 2px;
}

.cinema-status {
  position: absolute;
  right: clamp(20px, 3.4vw, 56px);
  bottom: clamp(20px, 4.6vh, 44px);
  bottom: clamp(20px, 4.6svh, 44px);
  z-index: 6;
  width: min(240px, 56vw);
  text-align: right;
}
.cinema-status__step {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}
.cinema-status__step span {
  font-size: 21px;
  color: var(--primary);
}
.cinema-status__label {
  margin: 2px 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--ink);
}
.cinema-status__track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.cinema-status__track i {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--paper);
  z-index: 2;
}
.cinema-status__track i:nth-child(1) { left: 20%; }
.cinema-status__track i:nth-child(2) { left: 40%; }
.cinema-status__track i:nth-child(3) { left: 60%; }
.cinema-status__track i:nth-child(4) { left: 80%; }
.cinema-status__track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--progress) * 100%);
  background: var(--primary);
}

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.motion-toggle__icon {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.is-motion-paused .motion-toggle__icon { background: var(--cta-b); }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 6;
  margin: 0;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}
.scroll-cue span {
  display: block;
  width: 2px;
  height: 30px;
  border-radius: 2px;
  background: var(--sky);
  animation: cue 2s ease-in-out infinite;
}
@keyframes cue {
  0% { transform: scaleY(0.2); transform-origin: top; opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0.2); transform-origin: bottom; opacity: 0; }
}

.noscript-note {
  position: relative;
  z-index: 7;
  margin: 0;
  padding: 12px 20px;
  background: #f0faff;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

/* ============ 静的モード（no-js / 停止 / reduced-motion / sticky非対応） ============ */

.no-js .scroll-cinema,
.is-static .scroll-cinema {
  height: auto;
  min-height: 0;
}
.no-js .scroll-cinema__sticky,
.is-static .scroll-cinema__sticky {
  position: static;
  height: auto;
  min-height: 0;
  overflow: visible;
}
.no-js .leg,
.is-static .leg {
  position: relative;
  inset: auto;
  opacity: 1;
  visibility: visible;
  min-height: 78vh;
  min-height: 78svh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.no-js .leg__poster,
.is-static .leg__poster { position: absolute; }
.no-js .leg video,
.is-static .leg video { display: none; }
.no-js .leg__glow,
.is-static .leg__glow { display: none; }
.no-js .leg__copy,
.is-static .leg__copy {
  position: relative;
  left: auto; bottom: auto;
  margin: 0 auto;
  padding: clamp(140px, 24vh, 240px) clamp(24px, 5vw, 84px) 56px;
  padding: clamp(140px, 24svh, 240px) clamp(24px, 5vw, 84px) 56px;
  max-width: 1120px;
  width: 100%;
  opacity: 1;
  transform: none;
}
.no-js .char,
.is-static .char {
  opacity: 1;
  transform: none;
}
/* 静的モードでは幕番号・ラベル・バーは嘘になるので隠し、再開ボタンだけ残す */
.is-static .cinema-status {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: auto;
}
.is-static .cinema-status__step,
.is-static .cinema-status__label,
.is-static .cinema-status__track { display: none; }
.no-js .cinema-status { display: none; }
.no-js .scroll-cue,
.is-static .scroll-cue { display: none; }

/* ============ 下部セクション ============ */

.about-section {
  position: relative;
  z-index: 5;
  background: var(--white);
  border-top: 1px solid var(--line);
}
.about-section__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) clamp(24px, 5vw, 72px);
}
.section-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}
.about-section h2 {
  margin: 0 0 18px;
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1.3;
  color: var(--primary);
}
.about-section__lead {
  margin: 0 0 48px;
  max-width: 44em;
  color: #333333;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.about-grid article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(16, 97, 167, 0.08);
}
.about-grid__number {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--sky);
}
.about-grid h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.about-grid p { margin: 0; font-size: 14px; color: #333333; }

.about-footnote {
  margin: 40px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.about-note {
  margin-top: 24px;
  padding: 24px;
  background: #f0faff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
}
.about-note p { margin: 0 0 12px; }
.about-note a {
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px 64px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  text-align: center;
}
.site-footer p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ============ レスポンシブ ============ */

@media (max-width: 900px) {
  .site-nav a:not(.site-nav__cta) { display: none; }

  .leg__copy {
    left: 20px;
    right: 20px;
    bottom: clamp(120px, 20vh, 200px);
    bottom: clamp(120px, 20svh, 200px);
    max-width: none;
  }
  .leg__copy h1,
  .leg__copy h2 { font-size: clamp(20px, 6.6vw, 30px); }
  .leg__lead { font-size: 14px; }

  .leg__glow {
    left: -10vw;
    width: 120vw;
    height: 44vh;
    height: 44svh;
    bottom: 0;
  }

  /* スマホは3体が同時に見える右寄せ・小さめ配置。
     顔がリード本文の帯より下に出る高さに抑える（本文×顔の交差防止） */
  .char { bottom: 20px; }
  .char--c { left: auto; right: 30%; margin-left: 0; height: 17vh; height: 17svh; }
  .char--l { left: auto; right: 62%; height: 13vh; height: 13svh; }
  .char--r { right: 4%; height: 14vh; height: 14svh; }

  /* 最終幕はCTA・リンクとキャラの衝突を断つ（小さく右下へ退避） */
  .leg[data-leg="4"] .char { bottom: 2vh; bottom: 2svh; }
  .leg[data-leg="4"] .char--c { right: 24%; height: 17vh; height: 17svh; }
  .leg[data-leg="4"] .char--l { right: 44%; bottom: 0; height: 12vh; height: 12svh; }
  .leg[data-leg="4"] .char--r { right: 3%; height: 15vh; height: 15svh; }

  /* HUDのコンパクト白ピル化は「1120px以下」ブロックが担う */
  .scroll-cue { display: none; }

  .text-link {
    background: rgba(255, 255, 255, 0.85);
    padding: 8px 12px;
    border-radius: 10px;
  }
  .button { min-height: 52px; padding: 0 26px; font-size: 18px; }

  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .wip-ribbon { gap: 6px; padding: 0 8px; letter-spacing: 0.06em; }
  .wip-ribbon__long { display: none; }
  .wip-ribbon__short { display: inline; }
  .site-header { padding: 0 14px; }
  .site-nav__cta { padding: 0 16px; font-size: 13px; }
  .leg__copy { bottom: 128px; }
  /* HUDピルを1行に保つ（トグルはアイコンのみ・aria-labelで名前は維持） */
  .motion-toggle [data-motion-label] { display: none; }
  .motion-toggle { padding: 0 10px; }
  /* 568px級の低い画面でステージがビューポート下へはみ出さないように */
  .scroll-cinema__sticky { min-height: 0; }
  /* 右キャラの顔をHUDピル上端より確実に上へ（呼吸モーション+3pxぶんの余白込み） */
  .char--r { bottom: 32px; }
  /* 320px級でも最終幕の3体の「顔」がHUD白ピルに沈まず、CTA・リンクにも刺さらない帯へ */
  .leg[data-leg="4"] .char { bottom: 24px; }
  .leg[data-leg="4"] .char--c { height: 15vh; height: 15svh; }
  .leg[data-leg="4"] .char--l { right: 66%; height: 10vh; height: 10svh; }
  .leg[data-leg="4"] .char--r { height: 13vh; height: 13svh; }
}

/* 1120px以下: HUDはコンパクトな白ピル（キャラ・数値表示の衝突を断つ） */
@media (max-width: 1120px) {
  .cinema-status {
    right: 12px;
    bottom: 12px;
    width: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 6px 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(16, 97, 167, 0.08);
  }
  .cinema-status__label,
  .cinema-status__track { display: none; }
  .cinema-status__step { letter-spacing: 0.08em; line-height: 1.3; }
  .cinema-status__step span { font-size: 17px; }
  .motion-toggle { margin-top: 0; border: 0; background: none; padding: 0 8px; }
  .is-static .cinema-status { padding: 6px 8px; }
}
