/* トップ（実装正本「01 番組トップ｜PC」109:2938）
   最初の画面の展示室は試作 v8.3 の CSS をそのまま使い（下の「展示室」以降）、上の帯の高さと見出しの書体と文だけを 109:2943 に合わせた。
   その下の 5 つの欄は 109:3013〜110:2991 の値。 */

/* ---------- 上の帯（109:2946：展示室の上では高さ 60、半透明の灰。展示室を抜けたらチャコール） ---------- */
.site-bar.is-hero { position: fixed; top: 0; left: 0; right: 0; background: rgba(91, 90, 82, .5); transition: background-color .3s; }
.site-bar.is-hero.solid { background: var(--charcoal); }
.site-bar.is-hero .bar { height: 60px; padding: 0 38px 0 58px; }
/* ログインしている人：管理画面の黒い帯がヘッダーの上半分を隠さないよう、帯の下に置く（2026-11-28） */
.admin-bar .site-bar.is-hero { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-bar.is-hero { top: 46px; } }
.site-bar.is-hero .bar-logo-mark { width: 108px; height: 29.4px; }

/* 見出しは BIZ UDPMincho 45px（109:2945）。試作の UD 明朝から替えた */
.gallery-hero .display { font-family: var(--ud-pmincho) !important; }

/* ---------- 展示室：ページを下へ送るあいだ画面に留まり、その間に廊下を歩く ---------- */
.gallery-hero { position: relative; height: 100vh; height: 100svh; background: var(--wall); }   /* 画面 1 枚分。縦のスクロールでは廊下を進まず、そのままページが流れる（2026-11-26） */
.gallery-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
#gl.dragging { cursor: grabbing; }
#gl.over { cursor: pointer; }
.veil { position: absolute; inset: 0; background: var(--wall); pointer-events: none; transition: opacity .9s ease-out; }
.veil.off { opacity: 0; }
.gallery-fallback { display: none; }
/* 写真らしさ：薄い粒子と、四隅を少し落とす陰り。リストの間は、額に陰りがかからないように消す */
.gallery-sticky::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .45) 100%); transition: opacity .4s; }
.gallery-sticky::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: url(../../img/grain.png); opacity: .08; mix-blend-mode: overlay; transition: opacity .4s; }
.gallery-hero.is-list .gallery-sticky::before, .gallery-hero.is-list .gallery-sticky::after { opacity: 0; }

.gui { position: absolute; inset: 0; z-index: 2; pointer-events: none; color: #fff; }

/* ギャラリーの文字（Frame 1：左 58、下 54） */
.hero-caption { position: absolute; left: 58px; right: 300px; bottom: 54px; transition: opacity .3s; }
.gallery-hero.is-list .hero-caption { opacity: 0; }
.gallery-hero .display { margin: 0; font: 400 clamp(30px, 3.125vw, 52px)/1.65 var(--ud-mincho); letter-spacing: .02em; color: #fff; text-shadow: 0 4px 4px rgba(0, 0, 0, .25); }
.gallery-hero .display > .mask { display: block; }
.gallery-hero .lead { max-width: 820px; margin: 16px 0 0; font: 500 16px/1.85 var(--sans); letter-spacing: .02em; color: #fff; }
.gallery-hero .lead > .mask { display: block; }
.lead-sp { display: none; }

/* 右下の操作（Frame 1：幅 214、右 38、下 54） */
.ctrl { position: absolute; right: 38px; bottom: 54px; display: flex; flex-direction: column; align-items: flex-end; }
.ctrl > * { pointer-events: auto; }
.hint { margin: 0; text-align: right; font: 500 14px/1.65 var(--sans); letter-spacing: .02em; color: #fff; pointer-events: none; }
.hint .mask { display: block; }
.toggle { position: relative; display: flex; gap: 8px; margin-top: 16px; padding: 2px; border-radius: 60px; background: var(--stone); }
.toggle button { position: relative; z-index: 1; padding: 2px 24px; border: 0; border-radius: 60px; background: none; color: #fff; font: 400 14px/1.65 var(--sans); letter-spacing: .02em; cursor: pointer; transition: background-color .25s, color .25s; }
.toggle .is-on { background: #fff; color: var(--stone); }
/* 白い丸が、押した側へ滑って移る（2026-11-26 の社長の指示「スイッチは、アニメーションをつけて欲しい」）。丸の位置と幅は gallery.js が押された側のボタンを測って入れる */
.toggle.has-pill::before { content: ""; position: absolute; top: 2px; bottom: 2px; left: 0; width: var(--pill-w, 0); transform: translateX(var(--pill-x, 0)); border-radius: 60px; background: #fff; }
.toggle.has-pill .is-on { background: none; }
.toggle.pill-anim::before { transition: transform .45s cubic-bezier(.2, .7, .2, 1), width .45s cubic-bezier(.2, .7, .2, 1); }
.toggle.pill-anim button { transition: color .3s .08s; }
.focus-close { display: none; }
.arrows { display: flex; gap: 32px; margin: 24px 18px 0 0; }
.arrow { display: grid; place-items: center; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; background: var(--stone); box-shadow: 0 0 0 1px #fff; color: #fff; cursor: pointer; transition: background-color .25s, color .25s, opacity .25s; }
.arrow svg { display: block; width: 64px; height: 64px; }
.arrow-prev svg { transform: rotate(180deg); }
.arrow:hover { background: #fff; color: var(--stone); }
.arrow[aria-disabled="true"] { opacity: .35; cursor: default; }
.arrow[aria-disabled="true"]:hover { background: var(--stone); color: #fff; }
.to-list { margin-top: 24px; font: 500 14px/1.65 var(--sans); letter-spacing: .02em; color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- リスト（額を押した後。82:2901） ----------
   額は 3D のまま、左の枠（.focus-slot）にぴったり重なる位置までカメラを動かす（gallery.js が枠の位置から計算する）。
   黒い幕（50%）は 3D の中に描き、額だけを幕の前に描くので、額は暗くならない */
.focus {
  --sw: min(40.49vw, 64.8svh);                 /* 額の幅：1440×900 で 583px */
  --sh: calc(var(--sw) * 9 / 16);
  --st: calc(43.67% - var(--sh) / 2);          /* 額の上端：1440×900 で 229px */
  --sl: 7.92vw;                                /* 額の左端：114px */
  position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s;
}
.gallery-hero.is-list .focus { opacity: 1; visibility: visible; transition: opacity .45s .2s, visibility 0s; }
.focus-slot { position: absolute; left: var(--sl); top: var(--st); width: var(--sw); height: var(--sh); pointer-events: none; }
.focus-who { position: absolute; left: calc(var(--sl) - 2px); top: calc(var(--st) + var(--sh) + 14px); opacity: 0; }
/* 名前と社名は、額が左の枠に着いたときに出す（gallery.js が who-on を付ける）。動いている間は、壁の札（3D）が白くなりながら同じ位置へ来るので、
   入れ替えは一瞬で行う（重ねてぼかすと、途中で字が薄く見える） */
.focus.who-on .focus-who { opacity: 1; }
.focus.who-debug .focus-who { opacity: 0; }
/* 札を作るために白い文字を測る、見えない写し */
.who-probe { position: absolute !important; left: 0 !important; top: 0 !important; margin: 0 !important; visibility: hidden !important; pointer-events: none !important; }
.focus-name { font: 400 clamp(24px, 2.22vw, 40px)/1.65 var(--ud-pmincho); letter-spacing: .02em; }
.focus-company { margin-top: 3px; font: 400 clamp(15px, 1.25vw, 22px)/1.65 var(--ud-pmincho); letter-spacing: .02em; }
.focus-text { position: absolute; left: calc(var(--sl) + var(--sw) + 3.82vw); top: calc(var(--st) - 12px); width: min(40vw, 100% - var(--sl) - var(--sw) - 3.82vw - 3vw); transition: opacity .2s; }
.focus-title { font: 400 clamp(24px, 2.22vw, 40px)/1.65 var(--ud-pmincho); letter-spacing: .02em; text-wrap: pretty; }
.focus-title-link { color: inherit; text-decoration: none; transition: opacity .25s; }
.focus-title-link:hover { opacity: .7; }
.focus-summary { margin-top: 32px; font: 400 16px/1.65 var(--sans); letter-spacing: .02em; }
.focus-summary:empty { display: none; }
.focus-summary p { margin: 0; }
.focus-btn { display: inline-flex; align-items: center; height: 49px; margin-top: 40px; padding: 0 32px; border: 2px solid #fff; border-radius: 40px; background: var(--stone); color: #fff; font: 700 17px/24px var(--sans); text-decoration: none; transition: background-color .25s, color .25s; }
.focus-btn:hover { background: #fff; color: var(--stone); }
.gallery-hero.is-list .focus-who, .gallery-hero.is-list .focus-text { pointer-events: auto; }
.focus.is-changing .focus-text { opacity: 0; }

/* 文字を 1 行ずつ下からせり上げる（来たときに一度だけ） */
.mask { display: inline-block; overflow: hidden; vertical-align: bottom; }
.mask > span { display: inline-block; }
.gallery-hero.intro .mask > span { transform: translateY(105%); }
.gallery-hero.ready .mask > span { transform: none; transition: transform 1s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }

/* WebGL が使えない端末：手帳の写真を置き、廊下を歩く部品は出さない */
.no-webgl .gallery-hero { height: 100vh; height: 100svh; }
.no-webgl #gl, .no-webgl .arrows, .no-webgl .hint, .no-webgl .toggle, .no-webgl .veil, .no-webgl .focus { display: none; }
.no-webgl .gallery-fallback { display: block; position: absolute; left: 50%; top: 16%; width: min(64vw, 720px); transform: translateX(-50%) rotate(-3deg); box-shadow: 0 40px 70px -30px rgba(43, 26, 15, .5); }

/* 高さの低い PC（16:9 の 1366×768 など）：概要の行が右下の操作に重ならないように、右の文字の欄を操作の列の手前で止める。
   1440×900 と 1536×864 以上では、社長の設計の幅（576px）のまま */
@media (min-width: 861px) and (max-height: 800px) {
  .focus-text { width: min(40vw, 100% - var(--sl) - var(--sw) - 3.82vw - 252px - 32px); }
}

/* ---------- スマートフォン（社長の設計は PC だけ。以下は Claude が PC の設計から割り付けた） ---------- */
@media (max-width: 860px) {

  .hero-caption { left: 16px; right: 16px; bottom: 150px; }
  .gallery-hero .display { font-size: clamp(22px, 6.4vw, 30px); line-height: 1.55; }
  .gallery-hero .lead { display: none; }
  .lead-sp { display: block; margin: 0 0 56px; font-size: 15px; line-height: 1.9; letter-spacing: .02em; color: rgba(30, 31, 27, .82); text-wrap: pretty; word-break: auto-phrase; line-break: strict; }

  .ctrl { left: 16px; right: 16px; bottom: 20px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "hint link" "arrows toggle"; align-items: end; row-gap: 14px; }
  .hint { grid-area: hint; text-align: left; font-size: 12px; }
  .to-list { grid-area: link; margin: 0; font-size: 13px; }
  .arrows { grid-area: arrows; gap: 14px; margin: 0; }
  .arrow, .arrow svg { width: 48px; height: 48px; }
  .toggle { grid-area: toggle; margin: 0 0 8px; }
  .toggle button { padding: 2px 16px; font-size: 13px; }
}
/* リストの割り付けは、gallery.js がカメラを縦長の向きに切り替える幅と同じ条件で切り替える */
@media (max-width: 860px), (orientation: portrait) and (max-width: 1100px) {
  .focus { --sw: calc(100vw - 32px); --sh: calc(var(--sw) * 9 / 16); top: 72px; bottom: 150px; left: 16px; right: 16px; inset-inline: 16px; display: flex; flex-direction: column; }
  /* ギャラリーへ戻る × 。額の画像の右上に、画像の端から 8px 内側へ重ねる（2026-11-26 の社長の指示「右上のヘッダー下に×ボタンをつけて」、続けて「×ボタンを画像に被らせるようにしてください」） */
  .focus-close { display: grid; place-items: center; position: absolute; top: 8px; right: 8px; z-index: 1; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--stone); box-shadow: 0 0 0 1px #fff; color: #fff; cursor: pointer; pointer-events: auto; transition: background-color .25s, color .25s; }
  .focus-close svg { display: block; width: 22px; height: 22px; }
  .focus-close:hover { background: #fff; color: var(--stone); }
  .focus-slot { position: static; flex: none; width: 100%; height: var(--sh); }
  .focus-who { position: static; flex: none; margin-top: 10px; display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 12px; }
  .focus-name { font-size: 22px; }
  .focus-company { margin: 0; font-size: 14px; }
  .focus-text { position: static; flex: 0 1 auto; min-height: 0; width: auto; margin-top: 10px; display: flex; flex-direction: column; align-items: flex-start; overflow-y: auto; overscroll-behavior: contain; }   /* 文字の下の空きは背景として押せる */
  .focus-title { flex: none; font-size: 19px; line-height: 1.6; }
  /* 欄が足りないときは概要だけを欄の中で送り、「エピソードの詳細」のボタンを欄の下に残す（2026-11-26、× の分だけ額を下げたため）。
     概要を 3 行も出せない小さな画面では、これまでどおり文字の欄全体を送る */
  .focus-summary { flex: 0 1 auto; min-height: 5.25em; margin-top: 12px; overflow-y: auto; overscroll-behavior: contain; font-size: 13.5px; line-height: 1.75; }
  .focus-btn { flex: none; height: 42px; margin-top: 16px; padding: 0 22px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-hero.intro .mask > span { transform: none; }
  .veil, .arrow, .site-bar.is-hero, .site-bar.is-hero .bar, .focus, .focus-who, .focus-text, .hero-caption, .toggle button, .toggle.pill-anim::before, .toggle.pill-anim button { transition: none; }
}

/* =====================================================================
   展示室の下の 5 つの欄
   ===================================================================== */
.br-pc { display: inline; }
.front .ccx-label { letter-spacing: .06em; }

/* 見出しと本文（109:3015、109:3088） */
.f-words { display: flex; flex-direction: column; align-items: flex-start; gap: 26px; }
.f-statement { font: 400 54px/1.4 var(--ud-pmincho); letter-spacing: -.02em; color: var(--sumi); }
.f-body { max-width: 660px; font: 400 16px/1.9 var(--sans); letter-spacing: .02em; color: var(--sumi); }

/* CREDOCRUX（109:3013） */
.f-intro { display: flex; flex-direction: column; gap: 30px; padding: 88px var(--gutter); }

/* METHOD（109:3019） */
.f-method { display: flex; flex-direction: column; gap: 28px; padding: 0 var(--gutter) 92px; }
.f-method-grid { display: flex; align-items: center; gap: 48px; }
.f-stage { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.f-stage-box { position: relative; height: 640px; border-radius: 6px; overflow: hidden; background: var(--marble); display: grid; place-items: center; }
.f-object { width: 600px; max-width: 72%; height: auto; transform: rotate(-3deg); box-shadow: 0 3px 8px rgba(43, 26, 15, .18), 0 40px 70px -30px rgba(43, 26, 15, .5); }
.f-caption { font: 400 11px/normal var(--sans); letter-spacing: .04em; color: var(--ink-900); }
.f-rows { flex: 0 0 460px; width: 460px; border-top: 1px dashed var(--ink-900); }
.f-row { display: flex; flex-direction: column; gap: 12px; padding: 26px 0 28px; border-bottom: 1px dashed var(--ink-900); }
.f-row .ccx-label { letter-spacing: .06em; }
.f-row-words { font: 400 24px/1.65 var(--ud-pmincho); color: var(--ink-900); }
.f-row-body { font: 400 14px/1.85 var(--sans); letter-spacing: .02em; color: var(--ink-900); }
.f-langs { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font: 400 12px/normal var(--sans); color: var(--ink-600); }

/* エピソード（109:3064） */
.f-episodes { display: flex; flex-direction: column; gap: 20px; padding: 56px 24px 66px; background: var(--gallery); color: var(--white); }
.f-episodes-head { display: flex; justify-content: space-between; align-items: center; }
.f-episodes-head h2 { font: 400 34px/1.4 var(--ud-pmincho); }
.f-episodes-head a { font: 400 14px/normal var(--sans); letter-spacing: .04em; color: var(--white); text-decoration: none; }
.f-episodes-head a:hover { text-decoration: underline; text-underline-offset: 4px; }
.f-cards { display: flex; gap: 20px; min-height: 292px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.f-cards::-webkit-scrollbar { display: none; }
.f-card { flex: 0 0 333px; display: flex; flex-direction: column; gap: 12px; scroll-snap-align: start; color: inherit; text-decoration: none; }
.f-card-thumb { width: 333px; height: 187.3px; object-fit: cover; border-radius: 5px; transition: opacity .2s; }
.f-card:hover .f-card-thumb { opacity: .85; }
.f-card-info { display: flex; flex-direction: column; gap: 5px; line-height: 1.5; }
.f-card-title { font: 500 17px/1.5 var(--sans); color: var(--paper-50); }
.f-card-guest { font: 400 13px/1.5 var(--sans); color: var(--paper-100); }
.f-cards-nav { display: flex; justify-content: flex-end; gap: 10px; }
.f-cards-nav .ccx-pill[disabled] { opacity: .35; cursor: default; }
.f-cards-nav .ccx-pill[disabled]:hover { background: none; color: var(--paper-50); }

/* CREDO（109:3085） */
.f-credo { display: flex; flex-direction: column; gap: 28px; padding: 64px var(--gutter) 72px; }

/* SUPPORT（110:2991） */
.f-support { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 52px var(--gutter) 60px; background: var(--gray-bg); }
.f-support-title { font: 400 20px/1.7 var(--sans); color: var(--ink-900); }
.f-support-body { max-width: 640px; font: 400 15px/1.85 var(--sans); letter-spacing: .02em; color: var(--ink-900); }

/* ---------- スマートフォン（Claude の割り付け） ---------- */
@media (max-width: 860px) {
  .site-bar.is-hero .bar { padding: 0 16px; }
  .site-bar.is-hero .bar-logo-mark { width: 96px; height: 26px; }
  .br-pc { display: none; }
  .f-statement { font-size: 30px; line-height: 1.45; }
  .f-body { font-size: 15px; }
  .f-intro { padding: 64px var(--gutter); gap: 20px; }
  .f-method { padding-bottom: 64px; gap: 20px; }
  .f-method-grid { flex-direction: column; align-items: stretch; gap: 24px; }
  .f-stage-box { height: auto; aspect-ratio: 4 / 3; }
  .f-object { max-width: 78%; }
  .f-rows { flex-basis: auto; width: 100%; }
  .f-row-words { font-size: 20px; }
  .f-episodes { padding: 40px 20px 48px; }
  .f-episodes-head h2 { font-size: 28px; }
  .f-cards { min-height: 0; }
  .f-card { flex-basis: 78vw; }
  .f-card-thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .f-card-title { font-size: 15px; }
  .f-credo { padding: 48px var(--gutter) 56px; gap: 20px; }
  .f-support { padding: 40px var(--gutter) 48px; }
  .f-support-body { font-size: 14px; }
}
