@charset "UTF-8";
/* ===========================================================================
   トップページ冒頭（B案：医療用語の潜在空間を飛ぶ）
   ---------------------------------------------------------------------------
   既定は静止画の版。index.html の <head> の判定で html に fx が付いたときだけ、
   高さ 600vh のスクロール演出にする。JS が動かない、WebGL が無い、
   動きを減らす設定、通信を節約する設定のときは静止画の版のまま。
   演出の途中で描画が遅いと分かったときも、js/hero-b.js が fx を外して戻す。

   home.css と一緒に読み込む。クラス名は home.css とぶつからないよう j- で始める。
   =========================================================================== */

.journey {
  --j-bg: #020812;
  --j-ink: #eaf6fb;
  --j-sub: #b4cfde;
  --j-cyan: #5fd9ec;
  --j-pad: clamp(20px, 7vw, 110px);
  --j-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  position: relative;
  background: var(--j-bg);
  color: var(--j-ink);
}
.journey :where(a, button):focus-visible { outline-color: var(--j-cyan); }

/* ── 上の帯（両方の版で共通） ─────────────────────────────────── */
.j-bar {
  position: absolute; inset: 0 0 auto 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--j-pad); font-size: 13px;
}
.j-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.j-brand img { width: 36px; height: 36px; flex: none; }
.j-brand span { display: grid; line-height: 1.35; }
.j-brand small { font-size: 10.5px; color: var(--j-sub); letter-spacing: .04em; }
.j-brand b { font-size: 15px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.j-bar nav { display: flex; align-items: center; gap: 22px; white-space: nowrap; }
.j-bar nav a:not(.j-login) { color: var(--j-sub); border-bottom: 1px solid rgba(255, 255, 255, .3); padding-bottom: 2px; }
.j-bar nav a:not(.j-login):hover { color: #fff; border-color: #fff; }
.j-login {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px;
  border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px; color: #fff; font-weight: 700;
  transition: background .2s, color .2s;
}
.j-login:hover { background: #fff; color: #0a2c52; }
.j-skip { display: none; }

/* ── 静止画の版（既定） ───────────────────────────────────────── */
.j-stage {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: min(860px, 100vh); min-height: min(860px, 100svh);
  display: flex; flex-direction: column; justify-content: center; gap: 36px;
  padding: 132px var(--j-pad) 80px;
}
/* 静止画（演出の p=0.3 の場面）。演出の版では要らないので、fx が無いときだけ読み込ませる。
   星雲が見出しの裏に来ないよう、画面の右 2/3 に置いて左端を背景に溶かす */
.j-still {
  position: absolute; inset: 0 0 0 auto; z-index: -1; width: 66%;
  background: no-repeat 50% 50% / cover;
  -webkit-mask-image: linear-gradient(90deg, transparent 18%, #000 54%);
  mask-image: linear-gradient(90deg, transparent 18%, #000 54%);
}
html:not(.fx) .j-still { background-image: url(../assets/home/journey-still.jpg); }
#gl { display: none; }
.j-hint, .j-caps, .j-rail, .j-tip, .j-finale { display: none; }

.j-hero { max-width: 1100px; }
.j-hero h1 {
  font-size: clamp(30px, 5vw, 76px); line-height: 1.3; letter-spacing: .02em; font-weight: 700;
  word-break: keep-all; overflow-wrap: anywhere;
}
.j-eyebrow { display: block; margin-bottom: 14px; font-size: 12px; font-weight: 500; letter-spacing: .2em; color: var(--j-cyan); }
.j-lead { margin-top: 18px; font-size: clamp(14px, 1.25vw, 17px); color: var(--j-sub); max-width: 35em; }

.j-notice { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--j-sub); }
.j-notice p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.j-notice b {
  padding: 1px 9px; border: 1px solid var(--j-cyan); color: var(--j-cyan);
  font: 700 11.5px/1.6 var(--j-mono); letter-spacing: .08em;
}
.j-notice p span { color: #fff; }
.j-notice a { color: #fff; font-weight: 700; border-bottom: 1px solid rgba(255, 255, 255, .45); padding-bottom: 2px; white-space: nowrap; }
.j-notice a:hover { border-color: #fff; }

/* ── 演出の版（html.fx） ──────────────────────────────────────────
   描き始めるまで（three.js の読み込み中）は1画面ぶんの高さにしておき、
   最初のコマを描いたとき（fx-ready）に 600vh に伸ばす。回線が遅いときに、
   何も描かれていない長い区間をスクロールさせないため。 */
html.fx .journey { height: 100vh; height: 100svh; }
html.fx.fx-ready .journey { height: 600vh; }
html.fx .j-stage {
  position: sticky; top: 0; display: block;
  height: 100vh; height: 100svh; min-height: 0; padding: 0;
}
html.fx .j-still { display: none; }
html.fx #gl {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  touch-action: pan-y; cursor: grab;
  opacity: 0; transition: opacity .8s;
}
html.fx.fx-ready #gl { opacity: 1; }
html.fx #gl.dragging { cursor: grabbing; }
html.fx .j-stage::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 44%; z-index: 1;
  pointer-events: none; opacity: var(--shade, 0);
  background: linear-gradient(to top, rgba(2, 8, 18, .88), rgba(2, 8, 18, 0));
}
html.fx .j-skip { display: inline; }

html.fx .j-hero {
  position: absolute; z-index: 2; left: var(--j-pad); top: clamp(104px, 17vh, 190px);
  width: min(1100px, 88vw); max-width: none; pointer-events: none; will-change: opacity, transform;
  animation: j-rise 1.1s cubic-bezier(.22, 1, .36, 1) both;
}
html.fx .j-hero h1 { font-size: clamp(29px, 5.2vw, 80px); line-height: 1.28; }
html.fx .j-notice {
  position: absolute; z-index: 2; left: var(--j-pad); bottom: clamp(24px, 5vh, 48px);
  will-change: opacity, transform;
  animation: j-rise 1.1s .25s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes j-rise { from { opacity: 0; transform: translateY(18px); } }

html.fx .j-hint {
  position: absolute; z-index: 2; left: 50%; bottom: 22px; transform: translateX(-50%); display: block;
  font-size: 11px; letter-spacing: .2em; color: var(--j-sub); transition: opacity .4s; pointer-events: none;
}
html.fx .j-hint::after {
  content: ""; display: block; width: 1px; height: 30px; margin: 8px auto 0;
  background: linear-gradient(var(--j-cyan), transparent);
  transform-origin: top; animation: j-drip 1.9s ease-in-out infinite;
}
/* 幅が狭いと、左下のお知らせと重なるので出さない */
@media (max-width: 1000px) { html.fx .j-hint { display: none; } }
@keyframes j-drip { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

html.fx .j-caps {
  position: absolute; z-index: 2; left: var(--j-pad); bottom: clamp(28px, 8vh, 90px); display: block;
  width: min(33em, 84vw); pointer-events: none;
}
.j-caps article {
  position: absolute; left: 0; bottom: 0; width: 100%;
  opacity: 0; transform: translateY(14px);
  transition: opacity .45s, transform .45s cubic-bezier(.22, 1, .36, 1);
}
.j-caps article.on { opacity: 1; transform: none; }
.j-cap-no { display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .12em; color: var(--c, var(--j-cyan)); }
.j-cap-no b { padding: 3px 8px; border: 1px solid currentColor; font: 700 12px/1.4 var(--j-mono); letter-spacing: .06em; }
.j-caps h2 { margin: 12px 0 8px; font-size: clamp(24px, 2.9vw, 42px); line-height: 1.4; letter-spacing: .01em; }
.j-caps article p:last-child { font-size: 14.5px; line-height: 1.9; color: var(--j-sub); }

html.fx .j-rail {
  position: absolute; z-index: 3; right: clamp(8px, 2vw, 30px); top: 50%;
  transform: translateY(-50%); display: grid; gap: 4px;
}
.j-rail button {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  min-height: 32px; padding: 4px; background: none; border: 0; color: #7fa3b8;
  font-size: 11px; letter-spacing: .08em;
}
.j-rail button::after {
  content: ""; width: 9px; height: 9px; border: 1px solid currentColor; border-radius: 50%;
  transition: background .3s, box-shadow .3s;
}
.j-rail button span { opacity: 0; transition: opacity .2s; }
.j-rail button:hover span, .j-rail button:focus-visible span { opacity: 1; }
.j-rail button.on { color: #fff; }
.j-rail button.on::after { background: var(--c, var(--j-cyan)); border-color: var(--c, var(--j-cyan)); box-shadow: 0 0 12px var(--c, var(--j-cyan)); }

html.fx .j-tip {
  position: absolute; z-index: 2; right: clamp(52px, 7vw, 110px); bottom: clamp(28px, 8vh, 90px); display: block;
  font-size: 11px; letter-spacing: .14em; color: #7fa3b8;
  opacity: 0; transition: opacity .5s; pointer-events: none;
}
.j-tip.on { opacity: 1; }

html.fx .j-finale {
  position: absolute; z-index: 2; left: var(--j-pad); top: 50%; display: block; width: min(40em, 44vw);
  transform: translateY(-42%); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .6s, transform .6s cubic-bezier(.22, 1, .36, 1), visibility 0s .6s;
}
html.fx .j-finale.on { opacity: 1; visibility: visible; transform: translateY(-50%); pointer-events: auto; transition-delay: 0s; }
.j-finale .j-eyebrow { font-family: var(--j-mono); }
.j-finale h2 { margin: 12px 0 14px; font-size: clamp(26px, 3.4vw, 52px); line-height: 1.38; }
.j-finale p { color: var(--j-sub); font-size: 14.5px; }
.j-finale .acts { margin-top: 24px; }

/* ── 文字サイズ切替の zoom は、演出の舞台には掛けない ──────────────
   舞台は画面ぴったりの大きさで描くため。home.css の body への zoom を打ち消す。 */
body[data-fontsize="s"] .journey { zoom: 1.0869565; } /* 1 / .92 */
body[data-fontsize="l"] .journey { zoom: .8928571; }  /* 1 / 1.12 */

/* ── スマホ ───────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .j-bar { padding: 12px 16px; font-size: 12px; }
  .j-brand img { width: 30px; height: 30px; }
  .j-brand small { display: none; }
  .j-brand b { font-size: 12px; line-height: 1.35; white-space: normal; word-break: keep-all; }
  .j-bar nav { gap: 14px; }
  .j-bar nav .j-wide { display: none; }
  .j-login { padding: 7px 14px; }
  /* 静止画の版は画面いっぱいの高さにして、星雲を上、文字を下に置く */
  .j-stage { padding: 112px 22px 48px; gap: 24px; justify-content: flex-end; min-height: 100vh; min-height: 100svh; }
  .j-still { inset: 0; width: auto; -webkit-mask-image: none; mask-image: none; background-position: 50% 0; }
  html:not(.fx) .j-still { background-image: url(../assets/home/journey-still-sp.jpg); }
  .j-still::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(2, 8, 18, .97) 0%, rgba(2, 8, 18, .9) 40%, rgba(2, 8, 18, 0) 64%);
  }

  html.fx .j-hero { top: 84px; }
  html.fx .j-notice { right: 22px; bottom: 24px; }
  html.fx .j-hint, html.fx .j-tip { display: none; }
  html.fx .j-caps { bottom: 22px; }
  html.fx .j-rail { right: 2px; }
  .j-rail button { min-height: 40px; padding: 4px 8px; }
  .j-rail span { display: none; }
  html.fx .j-finale { top: auto; bottom: 26px; width: auto; right: 20px; transform: translateY(14px); }
  html.fx .j-finale.on { transform: none; }
  .j-finale .acts { margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html.fx .j-hero, html.fx .j-notice { animation: none; }
}
