/* =========================================================
   共通（全ページで使う部品）
   色・動きの数値は s5-studios.com を読み解いた値そのまま
   ========================================================= */
:root {
  --cream: #efe8d7;
  --navy: #002a5a;
  --black: #000;

  /* 動きのゆるやかさ（元サイトで使われている回数の多い順） */
  --e-quart-out: cubic-bezier(.165, .84, .44, 1);   /* 速く出て長く止まる（いちばん多い） */
  --e-quint-out: cubic-bezier(.23, 1, .32, 1);
  --e-cubic-inout: cubic-bezier(.645, .045, .355, 1);
  --e-expo-out: cubic-bezier(.19, 1, .22, 1);
  --e-quart-inout: cubic-bezier(.77, 0, .175, 1);
  --e-cubic-out: cubic-bezier(.215, .61, .355, 1);
  --e-quad-out: cubic-bezier(.25, .46, .45, .94);
  --e-sine-inout: cubic-bezier(.445, .05, .55, .95);
  --e-quad-in: cubic-bezier(.55, .085, .68, .53);

  /* 書体（元は有料の Saol Display / canada-type-gibson。無料の近いもので代用） */
  --font-display: "Cormorant Garamond", "Shippori Mincho", serif;
  --font-body: "Jost", "Noto Sans JP", sans-serif;
  --font-logo: "League Spartan", "Jost", sans-serif;   /* サイト名（左上のロゴ・読み込み画面） */
}

/* ロゴ（League Spartan）とメニュー・本文の英字（Jost）はサイトの中に置いた書体を使う（SIL オープンフォントライセンス。assets/fonts/*_OFL.txt）。
   Google から読み直すと、ページが切り替わるたびに一瞬だけ別の書体で描かれてしまうため。各ページの頭で先に読み込んでいる */
@font-face { font-family: "League Spartan"; src: url("../fonts/LeagueSpartan-latin.woff2") format("woff2"); font-weight: 100 900; font-display: block; }
@font-face { font-family: "Jost"; src: url("../fonts/Jost-latin.woff2") format("woff2"); font-weight: 100 900; font-display: block; }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: #030712;
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--cream); outline-offset: 4px; }

/* ついてくるカーソル（色えらび帳と同じ。パソコンのマウスのときだけ common.js が付ける）
   小さな点＋0.6秒遅れてついてくる円、重なった所の色を反転。リンク・ボタンの上で円が60に */
html.has-cursor, html.has-cursor * { cursor: none !important; }
#mouse, #mouse-stalker { pointer-events: none; position: fixed; top: 0; left: 0; border-radius: 50%; background: #fff; mix-blend-mode: difference; z-index: 10000; opacity: 0; }
/* 位置は translate、拡大は scale で別々に動かす（transform で位置を動かすと、拡大が位置まで2倍にして円が飛んでいく） */
#mouse { width: 8px; height: 8px; margin: -4px 0 0 -4px; transition: translate .3s cubic-bezier(.2, 1.01, .6, 1), opacity .2s; }
#mouse-stalker { width: 30px; height: 30px; margin: -15px 0 0 -15px; scale: 1; transition: translate .6s cubic-bezier(.4, 1, .95, 1), scale .3s, opacity .2s; }
#mouse.on, #mouse-stalker.on { opacity: 1; }
#mouse-stalker.is_active { scale: 2; }   /* 30 → 60 */

.u-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- 背景（紺のグラデーション＋マウスを追う光＋光の粒） ---------- */
.p-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  /* 夜空：黒に近い紺を土台に、右上にだけ淡い青のにじみ、右下にほんのり紫 */
  background:
    radial-gradient(70% 60% at 78% 20%, rgba(28, 70, 140, .32), rgba(28, 70, 140, 0) 70%),
    radial-gradient(55% 50% at 100% 100%, rgba(42, 30, 78, .38), rgba(42, 30, 78, 0) 70%),
    radial-gradient(70% 60% at 0% 0%, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 70%),
    linear-gradient(168deg, #020409 0%, #050c1c 42%, #08172f 72%, #0a162b 100%);
}
.p-bg__light {
  position: absolute; left: 50%; top: 50%;
  width: 173vw; height: 173vh; margin: -86.5vh 0 0 -86.5vw;
  background: radial-gradient(closest-side, rgba(110, 150, 230, .13), rgba(110, 150, 230, .06) 60%, rgba(110, 150, 230, 0));
  mix-blend-mode: screen;
  will-change: transform;
}
.p-bg canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 1.5s var(--e-cubic-out);
}
.p-bg canvas.-show { opacity: 1; }

/* ---------- 読み込み画面 ---------- */
.p-loading { position: fixed; inset: 0; z-index: 100; }
.p-loading.-hide { opacity: 0; transform: scale(1.05); visibility: hidden; transition: all .5s var(--e-quad-in); }
/* 読み込み中は、ページの中身を隠しておく（スマホで題名などが読み込み画面の後ろに透けて見えないように） */
.l-scroll { transition: opacity .5s var(--e-quad-out); }
.p-loading:not(.-hide) ~ .l-scroll { opacity: 0; }
.p-loading__inner { position: absolute; inset: 0; margin: auto; width: 400px; height: 400px; }
.p-loading__arc { position: absolute; inset: 0; width: 100%; height: 100%; }
.p-loading__logo {
  /* 元サイトと同じ幅（パソコン 238px／スマホ 45.73vw）にそろえる：238 ÷ 6.71 ＝ 35.5px */
  position: absolute; left: 0; right: 0; top: 185px; margin: auto;
  text-align: center; font-family: var(--font-logo); font-weight: 600; font-size: 35.5px; line-height: 1; letter-spacing: 0;
  user-select: none; pointer-events: none;
}
@media (max-width: 899px) {
  .p-loading__inner { width: 61.73vw; height: 61.73vw; }
  .p-loading__logo { top: 28.1vw; font-size: 6.82vw; }
}

/* ---------- 文字を「生成りの帯が下から上へ通り抜けて」出す（ロゴ・メニュー共通） ---------- */
.c-wipe { position: relative; overflow: hidden; }
.c-wipe__body { visibility: hidden; }
.c-wipe::after {
  content: ""; position: absolute; inset: 0; background: var(--cream);
  transform: translate3d(0, calc(100% + 1px), 0); pointer-events: none;
}
.c-wipe.-show::after { transform: translate3d(0, calc(-100% - 1px), 0); transition: transform .75s var(--e-quart-inout); }
.c-wipe.-show .c-wipe__body { visibility: visible; transition: visibility 0s linear .35s; }
.c-wipe.-stable::after { transform: translate3d(0, calc(100% + 1px), 0); }
.c-wipe.-stable .c-wipe__body { visibility: visible; }

/* ---------- 下線の帯（ふだんは太い帯、マウスを乗せると1本の細線に） ---------- */
.underbar { position: absolute; bottom: 0; left: 0; width: 100%; overflow: hidden; }
.underbar::after {
  content: ""; position: absolute; inset: 0; background: var(--cream);
  transition: transform .8s var(--e-expo-out);
}
a:hover .underbar::after, .is-hover .underbar::after {
  transform: translate3d(0, calc(-100% + 1px), 0); transition: transform .4s var(--e-expo-out);
}

/* ---------- 頭の部分（ロゴ・メニュー・音） ----------
   --hd … ロゴ・メニュー・帯の色（ふだんは生成り。Works では分類の色に 0.8秒で染まる） */
@property --hd { syntax: "<color>"; inherits: true; initial-value: #efe8d7; }
.p-header { position: fixed; top: 0; left: 0; width: 100%; z-index: 10; visibility: hidden; font-size: 0; color: var(--hd); transition: --hd .8s ease-in-out; }
.p-header.-show { visibility: visible; }

/* サイト名：文字の高さを元サイトのロゴ（パソコン 27.3px／スマホ 7.86vw）とそろえる。
   League Spartan は文字の高さが大きさの 0.71 倍なので 27.3 ÷ 0.71 ＝ 38.5px。
   上の余白（0.05em）を詰めて、入れ物の上端＝文字の上端にする（元サイトと同じ） */
.p-header__logo { position: absolute; top: 60px; left: 60px; height: 27.3px; }
.p-header__logo .c-wipe__body { display: block; font-family: var(--font-logo); font-weight: 600; font-size: 38.5px; line-height: 1; margin-top: -.05em; letter-spacing: 0; white-space: nowrap; }
.p-header__logo a { position: absolute; inset: 0; z-index: 1; }

.p-header__nav { position: absolute; top: 120px; left: 60px; }
.p-header__nav li { position: relative; width: max-content; margin-bottom: 10px; }
.p-header__nav li:last-child { margin-bottom: 0; }
.p-header__nav li .c-wipe__body { display: block; font-size: 21px; line-height: 18px; height: 18px; letter-spacing: -.005em; white-space: nowrap; }
.p-header__nav li a { position: absolute; inset: 0; z-index: 1; visibility: hidden; opacity: 0; }
.p-header__nav li.-show a, .p-header__nav li.-stable a { visibility: visible; }
.p-header__nav li .bar {
  position: relative; width: 100%; height: 18px; overflow: hidden;
  transform-origin: 0 0; transform: translate3d(0, calc(100% + 1px), 0);
}
.p-header__nav li .bar::after { content: ""; display: block; width: 100%; height: 100%; background: var(--hd); }
.p-header__nav li.-show .bar { transform: none; transition: transform .4s var(--e-quart-out) .45s; }
.p-header__nav li.-stable .bar { transform: none; transition: transform .4s var(--e-expo-out); }
.p-header__nav li.-stable:hover .bar { transform: scaleY(.05); }

.p-header__sound {
  position: absolute; top: 60px; right: 60px; width: 26px; height: 26px;
  transform: scale(0); font-size: 0;
}
.p-header__sound.-show { transform: scale(1); transition: transform .7s var(--e-quart-out); }
.p-header__sound__label {
  position: absolute; top: 50%; right: 100%; margin-right: 12px; transform: translateY(-50%);
  font-size: .8125rem; font-weight: 400; letter-spacing: .1em; line-height: 1; white-space: nowrap; user-select: none; color: var(--hd-label, #fff);
}
.p-header__circle { display: block; width: 26px; height: 26px; }

.p-header__toggle { display: none; }

@media (max-width: 899px) {
  .p-header__logo { top: 11.47vw; left: 8.67vw; }
  .p-header__logo { height: 7.86vw; }
  .p-header__logo .c-wipe__body { font-size: 11.06vw; }
  .p-header__nav { top: 26.4vw; left: 8.67vw; }
  .p-header__nav li { position: absolute; left: 0; margin: 0; }
  .p-header__nav li:nth-child(1) { top: 0; }
  .p-header__nav li:nth-child(2) { display: none; } /* スマホのホームでは Works は真ん中のボタンで行く */
  .p-header__nav li:nth-child(3) { top: 9.87vw; }
  .p-header__nav li .c-wipe__body { font-size: 5.4vw; line-height: 4.6vw; height: 4.6vw; }
  .p-header__nav li .bar { height: 4.4vw; }
  .p-header__sound { display: none; }

  /* 三本線のボタン（ホーム以外で出す） */
  .p-header__toggle {
    display: block; position: absolute; top: 11.2vw; right: 8.8vw;
    width: 8.53vw; height: 8.53vw; pointer-events: none;
  }
  .p-header__toggle::after { content: ""; position: absolute; inset: -4vw; }
  .p-header__toggle .line { position: absolute; left: 0; width: 100%; height: 2.67vw; overflow: hidden; }
  .p-header__toggle .line span { position: absolute; inset: 0; background: var(--hd); transform: translate3d(0, calc(100% + 2px), 0); }
  .p-header__toggle .line:nth-child(1) { top: 0; }
  .p-header__toggle .line:nth-child(2) { top: 2.93vw; }
  .p-header__toggle .line:nth-child(2) span { transition-delay: .1s !important; }
  .p-header__toggle .line:nth-child(3) { top: 5.87vw; }
  .p-header__toggle .line:nth-child(3) span { transition-delay: .2s !important; }
  .p-header__toggle.-show { pointer-events: auto; }
  .p-header__toggle.-show .line span { transform: none; transition: transform .5s var(--e-quint-out); }
}

/* ---------- 短いロゴ（スマホのホーム以外）・スマホではホーム以外のメニューを三本線にしまう ---------- */
.p-header__logo .is-short { display: none; }
@media (max-width: 899px) {
  body:not([data-page="top"]) .p-header__logo .is-full { display: none; }
  body:not([data-page="top"]) .p-header__logo .is-short { display: block; }
  body:not([data-page="top"]) .p-header__nav { display: none; }
}

/* ---------- スクロールするページの入れ物 ---------- */
.l-scroll { position: relative; z-index: 1; }
.is-smooth .l-scroll { position: fixed; inset: 0; overflow: hidden; }
.is-smooth .js-scroll { will-change: transform; }
.is-native body { overflow-x: hidden; overflow-y: auto; }
.is-native.is-menu-open body { overflow: hidden; }

/* ---------- スマホのメニュー ---------- */
.p-menu { display: none; }
@media (max-width: 899px) {
  .p-menu { display: block; position: fixed; inset: 0; z-index: 30; font-size: 0; visibility: hidden; }
  .p-menu.-show { visibility: visible; }
  .p-menu__bg {
    position: absolute; inset: 0; opacity: 0; visibility: hidden;
    background:
      radial-gradient(80% 60% at 90% 10%, rgba(28, 70, 140, .25), rgba(28, 70, 140, 0) 70%),
      linear-gradient(170deg, rgba(2, 4, 10, .97), rgba(6, 14, 30, .97));
  }
  .p-menu__bg.-show { opacity: 1; visibility: visible; transition: all 1s var(--e-quart-out); }
  .p-menu__bg.-hide { opacity: 0; visibility: hidden; transition: all .8s var(--e-sine-inout); }

  .p-menu__nav { position: absolute; top: 26.4vw; left: 8.67vw; }
  .p-menu__nav li { position: absolute; left: 0; width: max-content; overflow: hidden; transform: translateY(200%); }
  .p-menu__nav li:nth-child(1) { top: 0; }
  .p-menu__nav li:nth-child(2) { top: 9.87vw; }
  .p-menu__nav li:nth-child(3) { top: 19.73vw; }
  .p-menu__nav li:nth-child(4) { top: 29.47vw; }
  .p-menu__nav li a { display: block; position: relative; }
  .p-menu__nav li a::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: calc(100% + 4.4vw); }
  .p-menu__nav li .label { display: block; font-size: 5.4vw; line-height: 4.6vw; height: 4.6vw; padding-top: .3vw; visibility: hidden; white-space: nowrap; }
  .p-menu__nav li::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--cream); transform: translateY(102%); }
  .p-menu__nav li::after { content: ""; display: block; width: 100%; height: 4.4vw; margin-top: .4vw; background: var(--cream); transform: translateY(102%); }
  .p-menu__nav li.-show { transform: translateY(0); transition: transform .75s var(--e-quart-out) .1s; }
  .p-menu__nav li.-show .label { visibility: visible; transition: visibility 0s linear 475ms; }
  .p-menu__nav li.-show::after { transform: translateY(0); transition: transform .75s var(--e-quart-out) .55s; }
  .p-menu__nav li.-show::before { transform: translateY(-102%); transition: transform .75s var(--e-quart-inout) .1s; }
  .p-menu.-hide .p-menu__nav, .p-menu.-hide .p-menu__sound, .p-menu.-hide .c-btn-close { opacity: 0; transition: opacity .3s var(--e-quint-out); }

  .p-menu__sound {
    position: absolute; bottom: 8.67vw; left: 8.67vw; width: 26.67vw; height: 7.2vw;
    visibility: hidden; clip-path: inset(100% 0 0 0);
  }
  .p-menu__sound .circle { position: absolute; bottom: 0; left: 0; width: 7.2vw; height: 7.2vw; border: 1px solid var(--cream); border-radius: 50%; transition: background-color 1s var(--e-quart-out); }
  .p-menu__sound .txt { position: absolute; bottom: -.93vw; left: 9.6vw; font-size: 3.2vw; line-height: 1.375; text-align: left; color: var(--cream); }
  .p-menu__sound.-on .circle { background: var(--cream); }
  .p-menu__sound.-show { visibility: visible; clip-path: inset(0 0 0 0); transition: all .7s cubic-bezier(.86, 0, .07, 1); }

  /* 右半分：Works の5分類の帯（右から 0.2秒ずつ入る。絵は大きく傾いた所から落ち着き、文字がせり上がる） */
  .p-menu__R { position: absolute; top: 0; right: 0; width: 50%; height: 100%; }
  .p-menu__cat { position: relative; display: block; height: 20%; overflow: hidden; }
  .p-menu__cat .mask { position: absolute; inset: 0; overflow: hidden; background: var(--bg); transform: translateX(100%); }
  .p-menu__cat .zoom { position: absolute; inset: 0; background-repeat: no-repeat; background-size: 400% auto; transform: translate(40vw, 15vh) rotate(30deg) scale(3); }
  .p-menu__cat .word { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; white-space: nowrap; font-family: var(--font-display); font-weight: 400; font-size: 9.6vw; line-height: 1; color: var(--base); }
  .p-menu__cat .ch { display: inline-block; overflow: hidden; padding: .1em 0 .14em; margin: -.1em 0 -.14em; vertical-align: top; }
  .p-menu__cat .ch > span { display: inline-block; transform: translateY(200%); }
  .p-menu.-cats .p-menu__cat .mask { transform: none; transition: transform 1s cubic-bezier(.86, 0, .07, 1); }
  .p-menu.-cats .p-menu__cat .zoom { transform: none; transition: transform 1s var(--e-quad-out); }
  .p-menu.-cats .p-menu__cat .ch > span { transform: none; transition: transform .9s var(--e-expo-out); }
  /* 閉じるとき：帯は右へ抜ける（0.5秒、ずらしなし）。絵と文字はそのまま。消えきってから元に戻す */
  .p-menu.-cats.-cats-out .p-menu__cat .mask { transform: translateX(100%); transition: transform .5s var(--e-expo-out); transition-delay: 0s !important; }
  .p-menu:not(.-cats) .p-menu__cat .mask, .p-menu:not(.-cats) .p-menu__cat .zoom, .p-menu:not(.-cats) .p-menu__cat .ch > span { transition: none; transition-delay: 0s !important; }

  .c-btn-close { position: fixed; top: 10vw; left: 7.33vw; width: 11.47vw; height: 11.47vw; z-index: 2; }
  .c-btn-close .close-sp { position: absolute; inset: 0; }
  .c-btn-close .close-sp::after { content: ""; position: absolute; inset: -3.33vw; }
  .c-btn-close .close-sp__line { position: absolute; top: 0; bottom: 0; left: 0; margin: auto; width: 100%; height: .53vw; max-height: 2px; }
  .c-btn-close .close-sp__line::after { content: ""; position: absolute; inset: 0; background: var(--cream); transform: scaleX(0); transform-origin: 0 0; }
  .c-btn-close .close-sp__line:nth-child(1) { transform: rotate(45deg); }
  .c-btn-close .close-sp__line:nth-child(2) { transform: rotate(-45deg); }
  .c-btn-close.-show .close-sp__line::after { transform: scaleX(1); }
  .c-btn-close.-show .close-sp__line:nth-child(1)::after { transition: transform .8s var(--e-quint-out) 0s; }
  .c-btn-close.-show .close-sp__line:nth-child(2)::after { transition: transform .8s var(--e-quint-out) .2s; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01s !important; transition-delay: 0s !important; animation-duration: .01s !important; }
}
