/* アニマルシネマ図鑑 共通スタイル（TOP の Figma「Desktop - 1」準拠）。各ページはこのファイルを読み込み、ページ固有の指定だけを追加する */
/* Figma「Desktop - 1」（幅1366px）準拠。--u は Figma の 1px を画面幅に合わせて伸縮させる単位 */
/* --su：縦長画面（スマホ）で、文字の大きさを画面幅に合わせて伸縮させる単位。幅 375px のとき 1px */
:root { --su: calc(100cqw / 375); }
:root {
  --lime: #80ff00;
  --black: #000;
  --white: #fff;
  /* 文字・ボタン・アイコンなどに使う黒。透けさせず、濃度 80% の黒（白 20%）にする。SVG のアイコンも同じ #333 */
  --ink: #333;
  --f-mincho: "Shippori Mincho B1", "Hiragino Mincho ProN", serif;
  --f-gothic: "Noto Sans JP", "Hiragino Sans", sans-serif;
  --f-metropolis: "Metropolis", "Helvetica Neue", Arial, sans-serif;
  --u: calc(100cqw / 1366);
  /* ヒーローの拡縮単位。横幅基準の --u と高さ基準の小さい方（縦長画面は下の @media で上書き）。
     下矢印など、ヒーロー以外の全画面でもヒーローと同じ大きさにしたいものもこれを使う */
  --hu-hero: min(var(--u), calc(100svh / 768));
  /* ドットの切り替えにかけるスクロールの距離（半画面分） */
  --dots: 50svh;
  color-scheme: light;
}
@media (orientation: portrait) {
  /* 縦長：縦組みロゴ（幅 568）の左右に 48 ずつ空ける */
  :root { --hu-hero: min(calc(100cqw / (569.4359 + 48 * 2)), calc(100svh / 950)); }
}
* { box-sizing: border-box; }
/* ページは html・body ではなく .scroller の中でスクロールする。SP のアドレスバーなどは、ページ全体がスクロールしたときだけ
   引っ込むので、全体を動かさずに最大表示のまま保つ。地は黒 */
html, body { height: 100%; overflow: hidden; }
body { margin: 0; background: var(--black); }
.scroll { height: 100%; }
.scroller { height: 100%; overflow-x: hidden; overflow-y: auto; }
/* キー操作の行き先としてフォーカスを移す（assets/js/scroll.js）が、枠は出さない */
.scroller:focus { outline: none; }
/* 画面に固定する層（ヒーロー・.reveal・動物・フッター）はスクロールの箱の外にあり、そのままでは層の上でスクロールできない。
   層そのものは触れても素通しにして下の箱で受け、ボタン・リンクだけ押せるようにする */
.hero, .reveal, .animal, .footer { pointer-events: none; }
:is(.hero, .reveal, .animal, .footer) :is(a, button) { pointer-events: auto; }
img { display: block; max-width: none; }
/* 文字の選択：読み物の本文と、Chapter の見出し・このサイトについての見出し（小見出しも）だけ選べるようにし、
   ボタン・バッジ・動物名などの装飾の文字は選べないようにする。
   選んだ部分は、サイトの色（ライム）に黒の文字で見せる */
body { -webkit-user-select: none; user-select: none; }
:is(.species__lead, .profile__text, .facts dd, .scene-card h3, .scene-card p, .site-about__title, .site-about__lead, .site-about__heading, .site-about__section p, .site-about__links) {
  -webkit-user-select: text; user-select: text;
}
::selection { background: var(--lime); color: var(--ink); }
/* ライムの地の上の本文（下層ページの PROFILE）は、ライムだと選んだ部分が見えないので、黒の地に白の文字にする。
   分布の地図（画像）は選べないようにする */
.profile ::selection { background: var(--ink); color: #fff; }
.facts__map-img { -webkit-user-select: none; user-select: none; }
a, button { color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.trim { text-box: trim-both cap alphabetic; }
.palt { font-feature-settings: "palt" 1; }

/* 画面に固定する全画面の層（ヒーロー・.reveal・動物・フッター）は inset: 0 ではなく、高さを画面の最小の高さ（100svh）で固定する。
   アドレスバーなどは出したままにしているが、ブラウザ側で引っ込んだ場合でも高さが変わらないように。伸びた分の下端には body の黒が見える */
/* 画面に固定する層の重なり：ヒーロー（0）→ main の地をドットで見せる .reveal（1）→ TOP の動物 .animal（2）
   → 本文 .page（3）→ フッター（40）→ ヘッダー（50）→ MENU を開いたときの INDEX（60）。.page は地を持たず、冒頭の .intro の間はヒーローが透けて見える。
   .page の箱がヒーローのクリックをふさがないよう、.page 自身はクリックを素通しにする。
   overflow: hidden だと下層ページの sticky（映像の貼り付け）が効かなくなるため clip を使う */
.page { position: relative; z-index: 3; container-type: inline-size; overflow: clip; pointer-events: none; }
.page > :not(.intro) { pointer-events: auto; }

/* ---------- ヒーロー（全画面・固定） ----------
   Figma の 1366×768 を基準に、ロゴ・リードは画面中央、縦書き英字は左右端、矢印は下端からの距離で配置。
   --hu は横幅基準の --u と高さ基準の小さい方（横長で背の低い画面でもはみ出さない）。
   .page の外に置くので、中の --u の基準になるようヒーロー自身をコンテナにする */
.hero {
  --hu: var(--hu-hero);
  position: fixed; top: 0; left: 0; right: 0; height: 100svh; z-index: 0; container-type: inline-size;
  overflow: hidden; background: var(--black);
}
/* 映像を枠いっぱいに切り抜くとき、左右のどこを残すかは映像ごとの --focus（data/animals/*.json の video.focus。build.js が付ける。
   省くと中央）。切り抜きを自分で計算している JS も同じ値を読む（assets/js/media.js の zukanMedia.focus） */
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50%) 50%; }
/* 映像に重ねる暗い膜。main への切り替えの後半で、--shade（既定 40%）から 45% 分暗くなる（--dim は assets/js/pixel.js が書き換える）。
   下層ページは映像の上に何も載せないので --shade: 0 */
.hero__shade { position: absolute; inset: 0; background: var(--black); opacity: calc(var(--shade, .4) + .45 * var(--dim, 0)); }
.abs { position: absolute; }
.hero__vr { right: calc(var(--hu) * 32.5468); top: calc(50% - var(--hu) * 152); width: calc(var(--hu) * 8.4532); height: calc(var(--hu) * 303.871); }
.hero__vl { left: calc(var(--hu) * 40.4532); top: calc(50% - var(--hu) * 141.7499); width: calc(var(--hu) * 8.4532); height: calc(var(--hu) * 303.871); }
/* 左右の縦書きの装飾は今は出さない。戻すときはこの1行を消す（HTML と位置の指定は残してある） */
.hero__vr, .hero__vl { display: none; }
.hero__title { margin: 0; }
/* ロゴは日本語・英語をまとめた1ファイル（assets/img/logo.svg、Figma の logo-main。書体の製品版でアウトライン化したもの）。縦長画面は縦組みの logo-stack.svg */
.hero__logo { left: calc(50% - var(--hu) * 515.9482); top: calc(50% - var(--hu) * 84.5167); width: calc(var(--hu) * 1031.8963); height: auto; }
.hero__stack { display: none; }
.hero__lead {
  position: absolute; left: 0; right: 0; top: calc(50% + var(--hu) * 165); margin: 0;
  /* 文字の大きさ・字間は、TOP の動物名の上のキャッチコピー（.animal__copy）とそろえる */
  font-family: var(--f-mincho); font-weight: 700; font-size: max(18px, calc(var(--hu) * 32));
  line-height: 1.8; letter-spacing: .05em; color: var(--white);
  text-align: center; white-space: nowrap;
}
/* 下矢印。TOP・下層ページとも、ヘッダーの層に1つだけ置き、画面の下中央に出す（.cue-arrow。src/partials/cue.html） */
.cue-arrow { left: calc(50% - var(--hu-hero) * 24); bottom: calc(var(--hu-hero) * 24); width: calc(var(--hu-hero) * 48); height: calc(var(--hu-hero) * 48); }
.cue-arrow img { width: 100%; height: 100%; }
.cue-arrow { padding: 0; border: 0; background: none; cursor: pointer; }
/* 下矢印：ホバーで少し下がり、押すと下へ抜けて消え、上から新しい矢印が下りてくる（.is-drop は assets/js/header.js が付ける）。
   ヘッダーの下矢印は黒い版の複製（押せない）にも .is-hover・.is-drop を写す */
.cue-arrow img { transition: translate .25s cubic-bezier(.2, .8, .3, 1); }
@media (hover: hover) {
  .cue-arrow:is(:hover, .is-hover) img { translate: 0 12%; }
}
.cue-arrow.is-drop img { animation: arrow-drop .6s; }
@keyframes arrow-drop {
  0% { transform: none; opacity: 1; animation-timing-function: cubic-bezier(.5, 0, .9, .5); }
  40% { transform: translateY(45%); opacity: 0; }
  41% { transform: translateY(-45%); opacity: 0; animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
  100% { transform: none; opacity: 1; }
}

.br-portrait { display: none; }
/* 横長だけで改行する（縦長では改行しない）。.br-portrait と組み合わせて、横長と縦長で別の位置で改行する */
@media (orientation: portrait) { .br-landscape { display: none; } }

/* 縦長画面：縦組みのロゴ（Figma の logo-sp。569×295）に切り替え、縦書き英字は非表示、リードは横長と同じ2行。
   いちばん幅の広いロゴ＋左右24を基準に拡縮する。
   横長と同じく、ロゴは画面の上下中央に置き、リードはロゴの下端から 80 あけて置く。
   画面の背が低く、リードと下矢印（下から 24＋48）の間に 40 が取れないときだけ、ロゴとリードをまとめて上へずらす。
   --lead-h はリード2行の高さ（上下の余白を切り詰めた高さ） */
@media (orientation: portrait) {
  .hero__logo, .hero__vl, .hero__vr { display: none; }
  .hero {
    --lead-h: calc(var(--hu) * 72);
    --logo-top: min(calc(50% - var(--hu) * 147.7299), calc(100% - var(--hu) * (72 + 40 + 80 + 295.4597) - var(--lead-h)));
  }
  .hero__stack { display: block; left: calc(50% - var(--hu) * 284.718); top: var(--logo-top); width: calc(var(--hu) * 569.4359); height: auto; }
  .hero__lead {
    top: calc(var(--logo-top) + var(--hu) * (295.4597 + 80));
    font-size: calc(var(--hu) * 28); letter-spacing: calc(var(--hu) * 1.4);
  }
  .br-portrait { display: inline; }
}

/* MV 下端のグリーンライン。MV が全画面なので、どの画面サイズでもファーストビューに入る。
   TOP の about・動物の全画面の下端にも同じものを置く（.cue-line。about はライムの上なので黒） */
.hero__line, .cue-line { position: absolute; left: 0; right: 0; bottom: 0; height: max(6px, calc(var(--u) * 6)); background: var(--lime); }
.cue-line--ink { background: var(--ink); }

/* ---------- ヒーローから main へ ----------
   .intro はページ冒頭のスクロール距離（1.5画面分）。最初の半画面分のスクロールで、ヒーローの上に重ねた
   main の地（.reveal：ライム＋網点15%、画面固定）がドットの形で全面まで広がる（#revealClip）。
   main はスクロール開始と同時に（残り50svh＝ドットの区間すべて）重なってせり上がり、ドットが広がる途中でリード文が見え始める。
   これより重ねるとファーストビューの下端に main がかかるので、ここが上限。
   main 自体も同じマスで切り抜く（assets/js/pixel.js が clip-path を書き換え、全面になったら外す）ので、
   リード文などはマスの中にだけ見え、ヒーローの上には乗らない */
/* margin-top はドットが始まるまでの遊び。この分だけスクロールしてもヒーローはそのままで、そのあとドットが動き出す */
.intro { height: 150svh; margin-top: 5svh; margin-bottom: -50svh; }
.reveal { position: fixed; top: 0; left: 0; right: 0; height: 100svh; z-index: 1; container-type: inline-size; background: var(--lime); clip-path: url(#revealClip); }

/* ---------- 画面に固定するヘッダー ----------
   .page はコンテナ（レイアウト封じ込め）なので、fixed 要素はその外の .chrome に置く */
.chrome { position: fixed; inset: 0; z-index: 50; pointer-events: none; container-type: inline-size; }
.chrome > * { pointer-events: auto; }

/* ヘッダーの部品は --cu で拡縮する。Figma の 1px（--u）と同じだが、狭い画面で小さくなりすぎないよう 0.75px を下限にする */
.menu, .brand-link, .play { --cu: max(var(--u), .75px); }
.menu {
  left: calc(var(--cu) * 24); top: calc(var(--cu) * 24); height: calc(var(--cu) * 48);
  display: flex; align-items: center; gap: calc(var(--cu) * 12);
  padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--f-metropolis); font-weight: 700; font-size: calc(var(--cu) * 20);
  line-height: 1; letter-spacing: calc(var(--cu) * 1); color: var(--white);
}
.menu img { width: calc(var(--cu) * 48); height: calc(var(--cu) * 48); }
/* MENU の丸・映像の停止ボタン・生態をのぞく：ホバーで少し大きく、押すと縮んで押し込んだように見せる。
   ヘッダーのロゴ・フッターのロゴ：ホバーで大きくする（押したときは縮めない）。
   ヘッダーの MENU・ロゴは黒い版の複製（押せない）にも .is-hover・.is-press を写す（assets/js/header.js）。
   ヘッダーの部品は塗り分けの切り抜き（clip-path）を部品の箱にかけているので、箱ではなく中の画像を拡大する。
   拡大率（--hover-scale）は、どれも同じくらい広がって見えるよう、大きさに合わせて変える（幅 1366 での幅と高さの広がりの平均）：
   MENU の丸（48×48）1.12 で約 5.8px・映像の停止（144×44）1.06 で約 5.6px・ヘッダーのロゴ（304×50）1.04 で約 7.1px・
   フッターのロゴ（640×105）1.03 で約 11px。生態をのぞく（約 222×63）は 1.06 で約 8.6px。
   数値は見た目で調整したもの（2026-11-16） */
.menu img, .play, .brand-logo, .footer__logo-img { transition: scale .25s cubic-bezier(.2, .8, .3, 1); }
.menu img { --hover-scale: 1.12; }
.play { --hover-scale: 1.06; }
.animal__more { --hover-scale: 1.06; }
.brand-logo { --hover-scale: 1.04; }
.footer__logo-img { --hover-scale: 1.03; }
@media (hover: hover) {
  .menu:is(:hover, .is-hover) img, .play:hover, .animal__more:hover,
  .brand-link:is(:hover, .is-hover) .brand-logo, .footer__logo:hover .footer__logo-img { scale: var(--hover-scale); }
}
.menu:is(:active, .is-press) img, .play:active, .animal__more:active { scale: .94; transition-duration: .08s; }
/* ほかに動きを付けていないリンク（フッターの「このサイトについて」・本文のリンク）：
   ホバーで半透明にする。動物のカードはホバーで映像が流れ、下矢印は下がり、ロゴは大きくなるので対象外 */
.footer__about, .site-about__section a { transition: opacity .25s; }
@media (hover: hover) {
  .footer__about:hover,
  .site-about__section a:hover { opacity: .6; }
}

/* main（ライム）の上で使う黒い版。assets/js/header.js が MENU とロゴを複製して .chrome--ink に入れ、
   data-tone="light" を付けて重ねる。白い版・黒い版ともドットのマスで切り抜いて塗り分ける。
   フッターの上では白い版のロゴをくり抜いて消す（大きなロゴと重なるため） */
.chrome--ink, .chrome--ink > * { pointer-events: none; }
/* 黒い版は、作った直後（塗り分けを決める前）は何も見せない。ページを移った直後に header.js が作り直すとき、
   切り抜きがないまま 1 コマだけ丸ごと見えて、ヘッダーがちらつくのを防ぐ */
.chrome--ink > * { clip-path: path("M0 0Z"); }
.menu__icon-ink { display: none; }
.menu[data-tone="light"] { color: var(--ink); }
.menu[data-tone="light"] .menu__icon { display: none; }
.menu[data-tone="light"] .menu__icon-ink { display: block; }
.brand-link[data-tone="light"] img { filter: brightness(0) invert(.2); }   /* ロゴを --ink（#333）の色にする */
.brand-link { position: absolute; left: calc(50% - var(--cu) * 304 / 2); top: calc(var(--cu) * 24); width: calc(var(--cu) * 304); }
.brand-face, .brand-logo { display: block; width: 100%; height: auto; }
.play {
  right: calc(var(--cu) * 24); top: calc(var(--cu) * 24); width: calc(var(--cu) * 144); height: calc(var(--cu) * 44);
  display: flex; align-items: center; gap: calc(var(--cu) * 5); padding: 0 0 0 calc(var(--cu) * 16);
  border: 0; border-radius: calc(var(--cu) * 44); background: var(--ink); cursor: pointer;
  font-family: var(--f-gothic); font-weight: 700; font-size: calc(var(--cu) * 16);
  line-height: 1; letter-spacing: calc(var(--cu) * .8); color: var(--white);
}
.play img { width: calc(var(--cu) * 24); height: calc(var(--cu) * 24); }
/* スマホ幅：MENU と再生ボタンは文字を隠してアイコンだけにし、ロゴを中央に置く（文字は読み上げ用に残す） */
@media (max-width: 767px) {
  .menu { left: 16px; top: 16px; height: 40px; gap: 0; font-size: 0; }
  .menu img { width: 40px; height: 40px; }
  .brand-link { top: 24px; left: calc(50% - 160px / 2); width: 160px; }
  .play { right: 16px; top: 16px; width: 40px; height: 40px; padding: 0; gap: 0; justify-content: center; font-size: 0; }
  .play img { width: 20px; height: 20px; }
  /* 隠した文字（.trim の詰め）が幅を取ってアイコンが左に寄らないよう、文字は流れから外す */
  .play span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* ---------- 網点パターン（紹介・フッター共通） ----------
   Figma の「白黒の網点画像をプラス（比較・明るく）で地色に重ねる」（ライムの地は 25%、黒の地は 15%）を、ブラウザで合成せず、
   地色ごと合成済みの画像にしている（ブラウザの合成は端末によってうまく描かれないことがあるため）。
   ・pattern-lime.webp：ライムの地（main・MENU・ページ移動の覆い） ・pattern-black.webp：黒の地（フッター）
   作り直すとき（元画像 tools/pattern-halftone.png。ImageMagick と cwebp）：
     convert tools/pattern-halftone.png -colorspace sRGB -type TrueColor -evaluate multiply 0.25 \( -size 2732x1822 xc:'#80ff00' \) -compose plus -composite lime.png
     cwebp -lossless -z 9 lime.png -o html/assets/img/pattern-lime.webp（黒は 0.15・xc:'#000000'）
   画像は画面に固定（cover で中央合わせにすると、1366×768 で Figma と同じく上に71はみ出す位置になる） */
.pattern {
  position: absolute; inset: 0; pointer-events: none;
  background: url(../img/pattern-lime.webp) center / cover;
}
.pattern--footer { background-image: url(../img/pattern-black.webp); }

/* 紹介〜INDEX〜ドットは1つの地（main）にまとめ、15%の網点を一続きで敷く。
   isolation で合成を main の中に閉じ、パターンは z-index:-1 で文字・カード・ドットの下に置く */
.main { position: relative; isolation: isolate; background: var(--lime); }
/* main は縦に長いので、網点は main の先頭に画面の高さで sticky に貼り付けて、画面に固定したのと同じに見せる
   （iOS は background-attachment: fixed が効かないため） */
.main > .pattern { z-index: -1; position: sticky; inset: auto; top: 0; height: 100svh; margin-bottom: -100svh; }

/* ---------- 紹介 ----------
   リード文はヒーローの上に重ねた固定の層（.reveal）の画面中央にあり、ドットのマスの中から現れて、そのまま動かない。
   .about（透明・1画面分）のスクロールで先頭から文字を黒に塗る（assets/js/about.js）。
   続く動物の区間で、1種類目の動物がドットのマスの形でリード文の上に現れる */
.reveal { display: flex; align-items: center; justify-content: center; }
.about { height: 100svh; }
/* TOP の main は地を持たない透明なスクロール距離。見た目はすべて画面に固定した層（.reveal・.animal）が受け持ち、
   クリックも下の層へ素通しにする */
.main:has(> .about) { background: none; pointer-events: none; }
/* タッチ端末では、本文（.page）が常に指を受ける。古い iOS（17 など）は、箱の外にある固定の層の上から指を動かしても
   箱（#scroller）をスクロールしないため。下の層のボタン・リンクへのタップは assets/js/scroll.js が受け渡す。
   cursor: pointer は iOS で本文のタップにも click を出させるため（タップしたときの灰色は消す） */
@media (pointer: coarse) {
  .page, .page .intro, .page .main { pointer-events: auto; }
  .page { cursor: pointer; -webkit-tap-highlight-color: transparent; }
}

/* ---------- 動物（TOP） ----------
   動物ごとに全画面の固定の層（映像・動物名・詳しく見るボタン）を重ねる。最初はマスがなく見えない
   （clip-path は assets/js/pixel.js が書き換える）。.animal-step 1つ（1.5画面分、下を半画面重ねる）につき、
   前半の半画面分でドットのマスの形に現れ、後半の半画面分はそのまま見せる */
.animal {
  --hu: min(var(--u), calc(100svh / 768));
  position: fixed; top: 0; left: 0; right: 0; height: 100svh; z-index: 2; container-type: inline-size;
  overflow: hidden; background: var(--black); clip-path: path("M0 0Z");
}
@media (orientation: portrait) {
  /* いちばん長い「ケープペンギン」（7字）が画面幅に収まる大きさ */
  .animal { --hu: calc(100cqw / 1250); }
}
.animal__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50%) 50%; }
/* 映像に重ねる暗い膜。現れ始め・消える間際（--dim 1）は85%、全面に出ている間（--dim 0）は40%。
   --dim は assets/js/animals.js が書き換える */
.animal__shade { position: absolute; inset: 0; background: var(--black); opacity: calc(.4 + .45 * var(--dim, 0)); }
.animal__body {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--white); text-align: center;
}
/* 「No. 0X」「NEXT」は下層の「SCENE 0X」（.scene-card__no）と同じ大きさ */
.animal__count {
  margin: 0 0 calc(var(--hu) * 40);
  font-family: var(--f-metropolis); font-weight: 700; font-size: max(16px, calc(var(--u) * 24));
  line-height: 1; letter-spacing: .05em; color: var(--lime);
}
.animal__name { margin: 0; display: flex; flex-direction: column; align-items: center; font-weight: 400; white-space: nowrap; }
.animal__ja { font-size: calc(var(--hu) * 144); }
.animal__en { margin-top: calc(var(--hu) * 32); font-size: calc(var(--hu) * 32); --ls: calc(var(--hu) * 6.4); }
/* 動物ごとのキャッチコピー（下層ページの動物名の下のリード文と同じ明朝体）。縦長画面でも読める大きさを保つ */
.animal__copy {
  margin: 0 0 calc(var(--hu) * 32);
  font-family: var(--f-mincho); font-weight: 700; font-size: max(18px, calc(var(--hu) * 32));
  line-height: 1; letter-spacing: .05em;
}
/* 余白・高さは文字の大きさに対する比率（文字 16 のとき上 64・高さ 56・左右 48）。文字に合わせて一緒に伸縮する */
.animal__more {
  margin-top: 4em;
  display: inline-flex; align-items: center; justify-content: center;
  height: 3.5em; padding: 0 3em;
  border-radius: 999px; background: var(--lime); color: var(--ink); text-decoration: none;
  font-family: var(--f-gothic); font-weight: 700; font-size: max(15px, calc(var(--hu) * 18)); letter-spacing: .05em;
}
.animal__more--soon { background: rgba(255, 255, 255, .2); color: var(--white); }
/* ドットの切り替えがほぼ終わっている間（.is-ready は assets/js/animals.js が付ける）だけ表示する */
.animal__more { opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s, scale .25s cubic-bezier(.2, .8, .3, 1); }
.animal.is-ready .animal__more { opacity: 1; visibility: visible; }
/* クレジットと読み込み中のサークルは、画面の左下・右下の同じ高さに置く。狭い画面でも下端の 6px のバーに
   近づきすぎないよう、端からの距離は 16px（下は 20px）を下限にする */
.animal__credit, .video-loader { --edge-x: max(16px, calc(var(--u) * 24)); --edge-y: max(20px, calc(var(--u) * 24)); }
/* クレジットは中央の下矢印（幅 48）にかからないよう、左端から矢印の手前 12px までの幅に収め、長いときは折り返す */
.animal__credit {
  position: absolute; left: var(--edge-x); bottom: var(--edge-y); margin: 0;
  max-width: calc(50% - var(--hu-hero) * 24 - 12px - var(--edge-x)); line-height: 1.4;
  font-family: var(--f-metropolis); font-weight: 400; font-size: max(11px, calc(var(--u) * 12));
  letter-spacing: .05em; color: rgba(255, 255, 255, .7);
}
.animal__credit span { display: inline-block; }
/* 読み込み中のサークル（assets/js/video-state.js）。映像を待っている間だけ右下に出す */
.video-loader {
  position: absolute; right: var(--edge-x); bottom: var(--edge-y); z-index: 2;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .7); border-top-color: transparent;
  opacity: 0; transition: opacity .2s; pointer-events: none;
  animation: video-loader .8s linear infinite;
}
.video-loader.is-on { opacity: 1; }
@keyframes video-loader { to { transform: rotate(360deg); } }
/* 映像の上に重ねる静止画。再生が始まったらフェードで消す（assets/js/video-state.js） */
.video-cover { position: absolute; inset: 0; background: center / cover no-repeat; transition: opacity .6s; pointer-events: none; }
.video-cover.is-gone { opacity: 0; }
.animal-step { height: 150svh; margin-bottom: -50svh; }
/* 最後の動物も半画面分そのまま見せてから、フッターのドットに移る */
.animal-steps + .pixel { margin-top: 0; }

/* 塗る前は黒15%、塗り終わると本文と同じ黒80%。--fill（0〜1）は1文字ずつ about.js が書き換える */
.about__char { color: rgba(51, 51, 51, calc(.15 + .85 * var(--fill, 0))); }   /* 色づき終わると --ink（#333）と同じ */
/* リード文は大きめに。いちばん長い行（14字＋字間）が画面幅の88%に、
   全行（行送り2）が画面の高さの70%に収まる大きさのうち小さいほうの、横長は75%、縦長は85%にする。
   今の文章は横長・縦長とも4行（行ごとの改行位置を変えたいときは .br-portrait・.br-landscape を使う） */
.about__text {
  position: relative; margin: 0;
  font-family: var(--f-mincho); font-weight: 700;
  font-size: calc(min(100cqw * .88 / 15, 100svh * .7 / 8) * .75);
  line-height: 2; letter-spacing: .05em; color: var(--ink);
  text-align: center; white-space: nowrap;
}
@media (orientation: portrait) {
  .about__text { font-size: min(100cqw * .9 / 15, 100svh * .75 / 12); }
}

/* ---------- MENU を開いたときの INDEX（assets/js/menu.js が作る） ----------
   全画面のライム＋網点の上に一覧を出し、一覧が長いときはこの中だけスクロールする。
   開閉の途中で後ろのページのスクロールバーが出入りしてパネルの幅が変わっても中身が動かないよう、
   大きさ（--u）・一覧の左位置・網点は、開いた時点の画面幅 --menu-w（menu.js が設定）を基準にする */
.menu-panel {
  --u: calc(var(--menu-w, 100cqw) / 1366);
  position: fixed; inset: 0; z-index: 60; container-type: inline-size; isolation: isolate;
  overflow-y: auto; overscroll-behavior: contain; background: var(--lime);
  /* 上はヘッダーのロゴにかからないよう 108、下は下層ページと違って下矢印がないので 36（.menu-panel .index の --fit-h と同じ） */
  padding: calc(var(--u) * 108) 0 calc(var(--u) * 36);
}
.menu-panel[hidden] { display: none; }
/* 開閉のモーション中はパネル自身のスクロールバーを隠す */
.menu-panel.is-moving { scrollbar-width: none; }
.menu-panel.is-moving::-webkit-scrollbar { display: none; }
/* PC では一覧が OverlayScrollbars の viewport に包まれる（assets/js/scroll.js）ので、子孫で指定する */
.menu-panel .index { margin: 0 0 0 calc((var(--menu-w, 100cqw) - var(--u) * (1366 - var(--pad-x) * 2)) / 2); }
/* 一覧が画面に収まるとき（スクロールしないとき）は、上下の余白（上 108・下 36）の内側の上下中央に置く */
.menu-panel .index { --fit-h: calc(100svh - var(--u) * (108 + 36)); min-height: var(--fit-h); justify-content: center; }
/* 網点はページと同じ「画面に cover・中央」の大きさと位置を、--menu-w の幅で固定して再現する
   （画像の縦横比 2732×1822） */
.menu-panel > .pattern {
  --pw: max(var(--menu-w, 100vw), 100vh * 2732 / 1822);
  position: fixed; z-index: -1;
  background-size: var(--pw) auto;
  background-position: calc((var(--menu-w, 100vw) - var(--pw)) / 2) center;
}
/* CLOSE とロゴは一覧をスクロールしても固定（位置はヘッダーの .menu・.brand-link と同じ。ロゴはライムの地なので --ink の色） */
.menu-panel__close, .menu-panel__brand { position: fixed; z-index: 1; }
/* 下層ページへ移る間（assets/js/page-transition.js）は、ページのスクロールを止める。
   映像以外をまとめてドットで消す・出すための全面の箱 */
.is-leaving .scroller { overflow-y: hidden; }
.animal__over, .hero__over { position: absolute; inset: 0; }
/* ページ間を移るときに画面を覆う面。MENU と同じライム＋網点で、ヘッダー・MENU より上に重ねる */
/* 初回の表示の黒い画面（ページ先頭の script が html に .is-intro を付ける）。最初の描画から覆っておき、
   assets/js/page-transition.js が同じ黒の面（.intro-cover）に置き換えて、ドットで消す */
html.is-intro body::after, .intro-cover { content: ""; position: fixed; inset: 0; z-index: 80; background: var(--black); }
/* 初回の表示の待ちが長引いたときの、読み込み中の輪（映像と同じ .video-loader を、黒い画面の右下に出す） */
.intro-loader { position: fixed; inset: 0; z-index: 82; pointer-events: none; }
/* マウスで操作しない端末だけ、初回の表示の前に出す案内（assets/js/page-transition.js の notice）。
   初回の黒い画面の上に白い文字で置き、OK を押すとフェードで消えて、いつもの初回の表示が始まる */
.intro-notice {
  position: fixed; inset: 0; z-index: 83; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--black); color: var(--white); text-align: center; touch-action: none;
  opacity: 0; transition: opacity .3s;
}
.intro-notice.is-shown { opacity: 1; }
.intro-notice:focus { outline: none; }   /* 案内そのものに移したフォーカスの枠は出さない（OK の枠はそのまま） */
.intro-notice__text { font-family: var(--f-gothic); font-weight: 700; font-size: 14px; line-height: 2; letter-spacing: .05em; }
.intro-notice__text p { margin: 0; }
.intro-notice__text p + p { margin-top: 1em; }
/* OK は「生態をのぞく」と同じボタン（.animal__more）。最初から見せ、上の余白だけ変える */
.intro-notice__ok.animal__more { margin-top: 32px; border: 0; cursor: pointer; opacity: 1; visibility: visible; }
/* TOP の初回だけ、黒い画面の上にロゴを先にドットで出す（MV のロゴの複製。assets/js/page-transition.js の dotsIn）。出している間は MV のロゴを隠す */
.intro-logo { position: fixed; z-index: 81; opacity: 0; pointer-events: none; }
html.is-intro-logo :is(.hero__logo, .hero__stack) { visibility: hidden; }
.page-cover { position: fixed; inset: 0; z-index: 70; isolation: isolate; background: var(--lime); clip-path: path("M0 0Z"); }
.page-cover > .pattern { z-index: -1; }

/* 開いている間はページのスクロールを止める（スクロールバーはパネル自身の1本だけになる） */
.is-menu-open .scroller { overflow-y: hidden; }

/* ---------- INDEX（MENU の一覧・下層ページの ANIMALS 共通。Figma の TOP 1536〜2447） ----------
   見出し「ANIMALS」は見せない（読み上げ用に残す。src/partials/index.html の .sr-only）。
   スマホ幅以外は、カードが画面に収まってスクロールしないよう、カードの大きさ（--card）を
   「一覧の幅（1366 - 左右の余白 --pad-x（36）× 2）を列の数で割った大きさ」と「使える高さ（--fit-h。上 108・下は下矢印の上端まで（--more-b ＝ 32 ＋ 下矢印の高さ。.cue-arrow と同じ単位）の内側。上はヘッダーのロゴにかからないように。MENU は下に矢印がないので下 36）を段の数で割った大きさ」の小さい方にする。
   一覧は余白の内側の上下中央に置く。
   横長は 4 列 × 2 段、縦長（タブレットなど）は 3 列 × 3 段。カードの間は 8。MENU と下層ページの ANIMALS で同じ大きさになる */
.index {
  --cols: 4; --rows: 2; --pad-x: 36;
  --more-b: calc(var(--hu-hero) * (32 + 48));
  --fit-h: calc(100svh - var(--u) * 108 - var(--more-b));
  --card: min(calc((var(--u) * (1366 - var(--pad-x) * 2) - var(--u) * 8 * (var(--cols) - 1)) / var(--cols)),
              calc((var(--fit-h) - var(--u) * 8 * (var(--rows) - 1)) / var(--rows)));
  width: calc(var(--u) * (1366 - var(--pad-x) * 2)); margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
}
.index__list {
  margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(var(--cols), var(--card));
  gap: calc(var(--u) * 8);
}
/* 動物名は写真の枠の中、下寄せ（Figma の Card：下から 24）。写真には全体 20% と、下 4 割に黒のグラデーションを重ねる */
/* カードの中の文字と余白は、カードの幅に合わせて伸縮する（cqw。幅 299.5 のカード＝ 1366px の画面で 4 列のときに Figma の値） */
/* 地の --ink は、写真の読み込みが遅れても、ライムの地が透けず黒い枠に見えるように。写真（.card__img）の裏に敷く
   （.card__img に敷くと、PC の白黒のフィルターで明るくなってしまう） */
.card { position: relative; display: block; text-decoration: none; container-type: inline-size; background: var(--ink); }
/* 今開いている動物のカード（.is-current・aria-current は build.js の card() が付ける。ほかと同じく押せる）。
   見た目は今はほかのカードと同じにしている。変えるときは下のコメントを外す
   （写真を白黒にして暗くする例。透かすと地の網点が見えるので、不透明のまま ::after の膜で暗くする） */
/*
.card.is-current .card__img img { filter: grayscale(1); }
.card.is-current .card__img::after { background: rgba(0, 0, 0, .6); }
.card.is-current .card__name { color: rgba(0, 0, 0, .35); }
*/
.card__img {
  /* 幅は一覧の列（--card）いっぱい。--card をここで使うと、カード（.card）が大きさの基準になり 100cqw がカードの幅になってしまう */
  position: relative; display: block; width: 100%; aspect-ratio: 1; overflow: hidden;
}
.card__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50%) 50%; }
/* ホバーで再生する映像（assets/js/card-video.js）。再生が始まったら静止画の上に出す */
.card__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50%) 50%; opacity: 0; transition: opacity .3s; }
.card__video.is-playing { opacity: 1; }
/* PC（マウス操作の端末。card-video.js と同じ判定）だけ、写真を白黒にして明るくし、ホバーしたカードだけ色を戻す。
   キーボードで選んだとき（:focus-visible）も戻す */
@media (hover: hover) and (pointer: fine) {
  .card__img { filter: brightness(125%) grayscale(100%); transition: filter .3s; }
  .card:is(:hover, :focus-visible) .card__img { filter: none; }
}
.card__img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .4)), rgba(0, 0, 0, .2);
}
.card__name {
  position: absolute; left: 0; right: 0; bottom: calc(100cqw * 24 / 299.5); pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: calc(100cqw * 12 / 299.5);
  color: var(--white);
}
.card__ja { font-size: calc(100cqw * 36 / 299.5); }
.card__en { font-size: calc(100cqw * 16 / 299.5); --ls: calc(100cqw * 3.2 / 299.5); }
/* スマホ幅：一覧は2列で画面幅いっぱい（左右16） */
@media (max-width: 767px) {
  /* 上はヘッダー（閉じるボタンの下端 56）より少し下まで空ける */
  .menu-panel { padding: 72px 0 16px; }
  .menu-panel .index { margin: 0 16px; min-height: calc(100svh - 72px * 2); }
  .index { width: auto; gap: 32px; }
  .index__list { width: 100%; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  /* スマホ幅の文字はカードではなく画面の幅（--su）に合わせるので、カードを大きさの基準にしない */
  .card { container-type: normal; }
  .card__img { width: 100%; height: auto; aspect-ratio: 1; }
  .card__name { bottom: 12px; gap: 8px; }
  .card__ja { font-size: calc(var(--su) * 22); }
  .card__en { font-size: calc(var(--su) * 10); --ls: calc(var(--su) * 1.5); }
}
/* スマホより広い縦長の画面（タブレットなど）：一覧は 3 列 × 3 段（MENU・下層ページの ANIMALS 共通） */
@media (min-width: 768px) and (orientation: portrait) {
  .index { --cols: 3; --rows: 3; }
}

/* ---------- ドットとフッター ----------
   フッターは画面全体に固定した層で、ドットのマス（#pixelClip）で切り抜いて見せる。
   .pixel はページ末尾のスクロール距離。上端が画面上端に来てから半画面分のスクロールで、
   マスが全面に広がってフッターが全部見えた状態でページが終わる。マスの形は assets/js/pixel.js が書き換える。
   上端は半画面ぶん上に重ね、直前の内容（INDEX など）の160下が画面の中ほどまで上がった時点でマスが出始めるようにする
   （緑だけの画面は半画面ぶんで済む） */
.pixel { margin-top: calc(var(--u) * 160 - 50svh); height: 150svh; }
/* .page はコンテナ（レイアウト封じ込め）なので、固定するフッターはヘッダーと同じくその外に置く */
.footer {
  position: fixed; top: 0; left: 0; right: 0; height: 100svh; z-index: 40; container-type: inline-size;
  clip-path: url(#pixelClip); background: var(--black);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
/* ロゴは画面の上下中央。「このサイトについて」とコピーライトは下端に置く（Figma の Footer：下から 84・40 の位置） */
.footer__logo { position: relative; display: block; width: max(calc(var(--u) * 640), min(280px, 80cqw)); }
.footer__logo-img { display: block; width: 100%; height: auto; }
.footer__about {
  position: absolute; bottom: max(52px, calc(var(--u) * 66));
  font-family: var(--f-gothic); font-weight: 700; font-size: max(12px, calc(var(--u) * 14));
  line-height: 1; letter-spacing: .1em; color: var(--white);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em;
}
.footer__copy {
  position: absolute; bottom: max(22px, calc(var(--u) * 28)); margin: 0;
  font-family: var(--f-metropolis); font-weight: 500; font-size: max(9px, calc(var(--u) * 12));
  line-height: 1; letter-spacing: .1em; color: var(--white);
}
/* このサイトについて（src/about.html）：フッターと同じ黒＋網点の地に、文章を1列で置く。最後はドットでフッターに切り替わる */
.site-about { position: relative; isolation: isolate; background: var(--black); pointer-events: auto; }
.site-about > .pattern { z-index: -1; position: sticky; inset: auto; top: 0; height: 100svh; margin-bottom: -100svh; }
/* 本文の幅は 760（Figma の単位）。狭い画面で余白が広くなりすぎないよう、640px までは幅を保ち、左右は最低 24px */
.site-about__body {
  width: min(calc(100% - 48px), max(640px, calc(var(--u) * 760))); margin: 0 auto; padding: max(120px, calc(var(--u) * 200)) 0 max(64px, calc(var(--u) * 96));
  color: var(--white);
}
.site-about__title {
  margin: 0 0 max(40px, calc(var(--u) * 72)); font-family: var(--f-mincho); font-weight: 700;
  font-size: max(28px, calc(var(--u) * 48)); line-height: 1; letter-spacing: .08em; text-align: left;
}
.site-about__lead {
  margin: 0 0 max(48px, calc(var(--u) * 80)); font-family: var(--f-mincho); font-weight: 700;
  font-size: max(17px, calc(var(--u) * 22)); line-height: 2; letter-spacing: .05em;
}
.site-about__section + .site-about__section { margin-top: max(40px, calc(var(--u) * 56)); }
.site-about__heading {
  margin: 0 0 max(12px, calc(var(--u) * 16)); display: flex; align-items: center; gap: .6em;
  font-family: var(--f-gothic); font-weight: 700; font-size: max(15px, calc(var(--u) * 18)); line-height: 1.4; letter-spacing: .05em;
}
/* 縦長画面（スマホ）の左右の余白は、下層ページの SCENE の解説と同じ（32。幅 375px で 32px） */
@media (orientation: portrait) {
  .site-about__body { width: calc(100% - var(--su) * 32 * 2); }
}
/* フッターへのドットは、本文の最後が画面の下から 3 割ほどの位置まで上がったところで始める（ほかのページより早め） */
.site-about .pixel { margin-top: -70svh; }
.site-about__section p + p, .site-about__section p + .site-about__links { margin-top: 1em; }
.site-about__section a { color: var(--white); text-decoration: underline; text-underline-offset: .2em; }
.site-about__links {
  margin: 0; padding: 0 0 0 1.2em;
  font-family: var(--f-gothic); font-weight: 400; font-size: max(14px, calc(var(--u) * 15)); line-height: 2; letter-spacing: .05em; color: rgba(255, 255, 255, .8);
}
/* 見つからないページ（404。src/404.html）：中身を画面の上下中央に、トップページへのボタンを添える */
.site-about__body--center { min-height: 100svh; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; padding-top: max(96px, calc(var(--u) * 120)); }
.site-about__body--center, .site-about__body--center .site-about__title { text-align: center; }
/* 縦長画面（スマホ）では見出しと文章は左揃え、ボタンは中央 */
@media (orientation: portrait) {
  .site-about__body--center, .site-about__body--center .site-about__title { text-align: left; }
  .site-about__body--center .site-about__back { text-align: center; }
}
.site-about__back { margin: 0; }
.site-about__back .animal__more { margin-top: 0; opacity: 1; visibility: visible; }
/* 小見出しの先頭の目印：ライムの正方形 */
.site-about__heading::before { content: ""; flex: none; width: .6em; height: .6em; background: var(--lime); }
.site-about__section p {
  /* 本文は細めの字（Noto Sans JP の 400。src/partials/head.html で 700 と一緒に読み込む） */
  margin: 0; font-family: var(--f-gothic); font-weight: 400; font-size: max(14px, calc(var(--u) * 15));
  line-height: 2; letter-spacing: .05em; color: rgba(255, 255, 255, .8);
}
/* 映像の画面がないので、ページ冒頭の映像用の余白（.intro）と「映像を停止」は使わない */
.intro:has(+ .site-about) { display: none; }
body[data-tone="dark"] .play { display: none; }
/* ヘッダーはどのページでも同じものを使い続けるので、ページごとの違いは body の data-chrome で切り替える（build.js）。
   arrow：下矢印を出す（TOP・下層ページ）。line：画面の下端のバーをヘッダーに出す（下層ページ。TOP は各画面にバーがある） */
body:not([data-chrome~="arrow"]) .chrome .cue-arrow, body:not([data-chrome~="line"]) .chrome .cue-line { display: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* 動物名（見出しの書体 CHI CatClawB）は Web フォントを使わず SVG で見せる（build.js の nameJa・nameEn、tools/names.py）。
   箱の高さは大文字の高さ（文字の大きさの 0.8。文字の上下の余白を削った .trim と同じ）で、幅は文字の大きさ（em）で決まる。
   色は文字の色（color）をそのまま使う。英名は 1 文字ずつ並べ、字間は --ls で空ける（今までの letter-spacing と同じく最後の文字のあとにも付く）。
   和名は Figma の 1 語の形のままで、字間も Figma のまま */
.name { display: flex; height: .8em; }
.name > svg { display: block; flex: none; height: 100%; overflow: visible; fill: currentColor; }
.name--en > svg { margin-right: var(--ls, 0); }

/* 縦長画面（スマホ）では、PC で下限（px）を決めていた文字も、画面幅に合わせて伸縮させる（幅 375px で下限と同じ大きさ） */
@media (orientation: portrait) {
  .animal__copy { font-size: calc(var(--su) * 18); }
  .animal__more { font-size: calc(var(--su) * 15); }
  .animal__credit { font-size: 9px; line-height: 1.5; }
  .footer__copy { font-size: calc(var(--su) * 9); }
  .footer__about { font-size: calc(var(--su) * 12); }
}

/* 縦長画面（スマホ）の TOP の動物・NEXT：横幅基準の --hu だと小さくなりすぎる文字と間隔を、スマホ用の単位（--su）で決める */
@media (orientation: portrait) {
  .animal__count { margin-bottom: calc(var(--su) * 20); font-size: calc(var(--su) * 18); }
  .animal__copy { margin-bottom: calc(var(--su) * 16); font-size: calc(var(--su) * 16); }
  .animal__en { margin-top: calc(var(--su) * 12); font-size: calc(var(--su) * 14); --ls: calc(var(--su) * 2.8); }
  /* 動物名（日本語＋英語）を画面の上下中央に置く。動物名の上（番号・キャッチコピー：約 60）より下（ボタン：112）が
     長いので、その差の分だけ上に余白を足して、塊の中央を動物名に合わせる（下層ページの NEXT も同じ層なので同じ配置になる） */
  .animal__body { padding-top: calc(var(--su) * 52); }
}

/* ---------- マウスカーソル ----------
   通常は矢印（文字の上でも変えない）、押せるもの（リンク・ボタンなど）の上は、ブラウザ標準の指さしにそろえる。
   独自のカーソルは使わない（ドット絵の試作は git の履歴にある：tools/cursors.js） */
@media (hover: hover) and (pointer: fine) {
  /* 文字の上でも I の字（テキストの選択）に変えず、矢印のままにする */
  html { cursor: default; }
  :is(a[href], button:not(:disabled), label, summary, [role="button"]) { cursor: pointer; }
}

/* ---------- マウスについてくるファインダー（assets/js/finder.js） ----------
   ビデオカメラのファインダーのような、黄金比（横 1.618：縦 1）の枠の四隅のかぎ括弧と、中央の十字。
   マウスの位置を中心に、ゆっくり遅れてついてくる。
   色は少し透ける白（75%）で固定（影などは付けず、くっきりした線のまま）。
   リンク・ボタンの上では、ピントを合わせるように四隅が内側へ縮む */
.finder {
  /* --k：画面の大きさに合わせた倍率（幅 1366px で 1。assets/js/finder.js が書き込む）。線の太さ（2px）は変えない。
     --w・--h：枠の横・縦の半分の大きさ（倍率 1 で横 160 × 縦 100 の黄金比） */
  --k: 1; --w: calc(80px * var(--k)); --h: calc(50px * var(--k));
  position: fixed; left: 0; top: 0; z-index: 95; width: 0; height: 0; pointer-events: none;
  /* <html> の直下にあり body の「選べない」設定が届かないので、ここでも文字を選べないようにする */
  -webkit-user-select: none; user-select: none;
  opacity: 0; transition: opacity .2s;
}
.finder.is-shown { opacity: 1; }
/* 初回の表示（黒い画面〜ドットが開き終わるまで。assets/js/page-transition.js）の間は隠し、開いたらフェードで出す */
html:is(.is-intro, .is-intro-running) .finder { opacity: 0; }
.finder { transition: opacity .2s; }
.finder__frame { position: absolute; left: 0; top: 0; opacity: .75; }
.finder__corner {
  position: absolute; width: calc(20px * var(--k)); height: calc(15px * var(--k)); border: 0 solid #fff;
  transition: translate .3s cubic-bezier(.2, .8, .3, 1);
}
.finder__corner:nth-child(1) { left: calc(-1 * var(--w)); top: calc(-1 * var(--h)); border-width: 2px 0 0 2px; }
.finder__corner:nth-child(2) { right: calc(-1 * var(--w)); top: calc(-1 * var(--h)); border-width: 2px 2px 0 0; }
.finder__corner:nth-child(3) { left: calc(-1 * var(--w)); bottom: calc(-1 * var(--h)); border-width: 0 0 2px 2px; }
.finder__corner:nth-child(4) { right: calc(-1 * var(--w)); bottom: calc(-1 * var(--h)); border-width: 0 2px 2px 0; }
/* リンク・ボタンの上に来たら、ピントを合わせるように四隅が内側へ縮む（横 124 × 縦 78 まで） */
.finder.is-focus .finder__corner:nth-child(1) { translate: calc(18px * var(--k)) calc(11px * var(--k)); }
.finder.is-focus .finder__corner:nth-child(2) { translate: calc(-18px * var(--k)) calc(11px * var(--k)); }
.finder.is-focus .finder__corner:nth-child(3) { translate: calc(18px * var(--k)) calc(-11px * var(--k)); }
.finder.is-focus .finder__corner:nth-child(4) { translate: calc(-18px * var(--k)) calc(-11px * var(--k)); }
/* 中央の十字（長さ 24 の細い線 2 本を、疑似要素で描く） */
.finder__center { position: absolute; left: 0; top: 0; }
.finder__center::before, .finder__center::after { content: ""; position: absolute; background: #fff; }
.finder__center::before { left: calc(-12px * var(--k)); top: -1px; width: calc(24px * var(--k)); height: 2px; }
.finder__center::after { left: -1px; top: calc(-12px * var(--k)); width: 2px; height: calc(24px * var(--k)); }
/* 枠の外側の小さな数値：左上に今見えている映像の残り時間（-分:秒:コマ、1 秒 24 コマ）、右上に番号、
   左下に合焦マークと AF、右下にカーソルの座標。
   中身は assets/js/finder.js が書き込む。数字・記号・空白まですべて同じ幅の等幅の書体（端末に入っているもの）にして、
   数値が変わっても文字が揺れず、X・Y などの位置もそろうようにする。
   文字の上下の余白は削り（.trim と同じ）、枠の角からの 6px を文字までの見た目の距離にする */
.finder__data, .finder__data--mode::before { text-box: trim-both cap alphabetic; }
.finder__data {
  position: absolute; font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 500; font-size: 9px; line-height: 1; letter-spacing: .04em; color: #fff; white-space: nowrap;
}
/* 数値を書き換えても、ページのほかの部分の並びを計算し直させない（ファインダーの中だけで済ませる） */
.finder { contain: layout style size; }
.finder__data--tc { left: calc(-1 * var(--w)); bottom: calc(var(--h) + 6px); }
/* 右上：番号（例：No. 01） */
.finder__data--name { right: calc(-1 * var(--w)); bottom: calc(var(--h) + 6px); white-space: pre; }
.finder__data--xy { right: calc(-1 * var(--w)); top: calc(var(--h) + 6px); white-space: pre; }
/* 左下：合焦マークとピントの合わせ方（● AF。丸は枠の外側の端＝左端に置く）。マークは文字ではなく図形（直径 6px の丸）で描く。
   ふだんは白抜きの丸、リンク・ボタンの上でピントが合ったら塗りつぶす（一眼レフなどのファインダーの合焦マークと同じ）。
   丸は大文字の高さの中央にそろえる（AF の文字は上下の余白を削っているので、並べて上下中央にすればそろう） */
.finder__data--mode { left: calc(-1 * var(--w)); top: calc(var(--h) + 6px); display: flex; align-items: center; gap: 4px; }
.finder__data--mode::before { content: "AF"; }
.finder__data--mode::after {
  content: ""; width: 6px; height: 6px; box-sizing: border-box; border: 1px solid #fff; border-radius: 50%;
  order: -1; transition: background-color .15s;
}
.finder.is-focus .finder__data--mode::after { background: #fff; }

/* 初回の表示で、TOP の MV の部品を順に出す（assets/js/page-transition.js の stage）。出すまでは隠し、
   下のラインが出きるまではスクロールを止める（PC は zukanScroll.lock、タッチ端末はここの overflow） */
html.is-intro-stage :is(.hero__lead, .chrome, .hero__line, .hero__vl, .hero__vr) { visibility: hidden; }
html.is-intro-lock .scroller { overflow-y: hidden; }
