/* 流れるライン×黒 の FV（案1＝決定内容 / 案2＝ゆらぎ背景＋フェードイン演出） */

/* ---- 共通（決定）：英字ロゴを大きく、キャッチは小さく ---- */
.hero-brand {
  margin: 0;
  /* 元ロゴに最も近い丸ゴシック（Fredoka Bold）。「North Tech」の文字だけ読み込む（約数KB） */
  font-family: 'Fredoka', var(--wp--preset--font-family--display);
  font-size: 132px; font-weight: 700; line-height: 1; letter-spacing: 0.01em;
  color: #ffffff;
  background-image: linear-gradient(90deg, #ffffff 0%, #e4f7d2 45%, #7fe8a5 80%, #2bd96b 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
/* ロゴ画像版（hero-brand の代わり）。SVG なので拡大してもにじまない */
.hero-brand-logo { margin: 0; width: 640px; max-width: 100%; }
.hero-brand-logo img { display: block; width: 100% !important; height: auto; filter: drop-shadow(0 0 28px rgba(79, 220, 133, 0.22)); }
.fv-flow .hero-title { font-size: 34px; line-height: 1.5; letter-spacing: 0.04em; }
.fv-flow .hero-lead { max-width: 700px; } /* PC では1文1行に収まる幅 */
@media (max-width: 1024px) {
  .hero-brand { font-size: 96px; }
  .hero-brand-logo { width: 500px; }
  .fv-flow .hero-title { font-size: 30px; }
}
@media (max-width: 768px) {
  .hero-brand { font-size: 54px; }
  .hero-brand-logo { width: 280px; }
  .fv-flow .hero-title { font-size: 24px; }
}

:root { --fv-k: 1; } /* 演出の長さの倍率（1＝合計1.0秒）。比較ページのバーで 0〜3 に変えられる */
/* ---- 案2：フェードイン演出（合計 1.0秒 → 最後にヘッダー） ----
   0.0s 背景・ライン  →  0.05s 社名  →  0.2s キャッチ  →  0.3s 本文  →  0.4s ボタン  →  0.75s ヘッダー（1.0s 完了） */
/* 開始の不透明度は 0 ではなく 0.01：0 だと Chrome が「まだ表示されていない」と扱い、
   PSI の表示速度（FCP/LCP）が演出の終わりまで遅れて判定される。0.01 は見た目では透明と同じ */
@keyframes fv-fade { from { opacity: 0.01; } to { opacity: 1; } }
@keyframes fv-up { from { opacity: 0.01; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fv-brand-in {
  0% { opacity: 0.01; filter: blur(20px); letter-spacing: 0.32em; transform: translateY(10px); }
  55% { opacity: 1; }
  100% { opacity: 1; filter: blur(0); letter-spacing: 0.01em; transform: none; }
}
@keyframes fv-logo-in {
  0% { opacity: 0.01; filter: blur(18px); transform: scale(1.08); }
  55% { opacity: 1; }
  100% { opacity: 1; filter: blur(0); transform: none; }
}
@keyframes fv-header-in { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: none; } }

.fv-intro .fv3d-canvas { animation: fv-fade calc(0.5s * var(--fv-k)) ease-out both; }
.fv-intro .hero-brand { animation: fv-brand-in calc(0.45s * var(--fv-k)) cubic-bezier(.2, .7, .2, 1) calc(0.05s * var(--fv-k)) both; }
.fv-intro .hero-brand-logo { transform-origin: left center; animation: fv-logo-in calc(0.45s * var(--fv-k)) cubic-bezier(.2, .7, .2, 1) calc(0.05s * var(--fv-k)) both; }
.fv-intro .hero-title { animation: fv-up calc(0.3s * var(--fv-k)) cubic-bezier(.2, .7, .2, 1) calc(0.2s * var(--fv-k)) both; }
.fv-intro .hero-lead { animation: fv-up calc(0.3s * var(--fv-k)) cubic-bezier(.2, .7, .2, 1) calc(0.3s * var(--fv-k)) both; }
.fv-intro .hero-text .wp-block-buttons { animation: fv-up calc(0.3s * var(--fv-k)) cubic-bezier(.2, .7, .2, 1) calc(0.4s * var(--fv-k)) both; }

/* ヘッダー：スクロール不要。文字が出そろったら上からスッと出る（以後は常に表示） */
body.fv-intro .site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  animation: fv-header-in calc(0.25s * var(--fv-k)) cubic-bezier(.2, .7, .2, 1) calc(0.75s * var(--fv-k)) both;
  animation-timeline: auto;
}

/* ---- 社名の見せ方 比較（A 社名なし / B 英字ラベル / C カタカナ / D 英字大）。どれも合計1.0秒の演出 ---- */
/* A・B：キャッチコピーを主役に戻す（大きく） */
.fv-brand-a .fv-flow .hero-title, .fv-brand-b .fv-flow .hero-title { font-size: 54px; line-height: 1.35; letter-spacing: 0.03em; }
/* B：見出しの上の小さな英字ラベル（左に短い線） */
.hero-eyebrow {
  margin: 0; display: flex; align-items: center; gap: 14px;
  font-family: var(--wp--preset--font-family--display); font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: 0.32em;
  color: #7fe8a5;
}
.hero-eyebrow::before { content: ""; width: 40px; height: 1px; background-color: currentColor; }
/* C：カタカナ社名（標準の太さ・字間を広く、白〜緑のグラデ） */
.hero-brand-kana {
  margin: 0;
  font-family: var(--wp--preset--font-family--sans); font-size: 64px; font-weight: 500; line-height: 1.15; letter-spacing: 0.22em;
  background-image: linear-gradient(90deg, #ffffff 0%, #e4f7d2 45%, #7fe8a5 80%, #2bd96b 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
@media (max-width: 1024px) {
  .fv-brand-a .fv-flow .hero-title, .fv-brand-b .fv-flow .hero-title { font-size: 44px; }
  .hero-brand-kana { font-size: 52px; }
}
@media (max-width: 768px) {
  .fv-brand-a .fv-flow .hero-title, .fv-brand-b .fv-flow .hero-title { font-size: 26px; letter-spacing: 0.02em; } /* 375幅で「現場のシステムを動かす。」が1行に収まる大きさ */
  .hero-eyebrow { font-size: 12px; gap: 10px; }
  .hero-eyebrow::before { width: 28px; }
  .hero-brand-kana { font-size: 34px; letter-spacing: 0.16em; }
}
/* D：英字の社名を大きく。Fredoka（丸ゴシック）ではなく、サイトの英字書体 Outfit でシャープに */
.hero-brand.hero-brand-sharp { font-family: var(--wp--preset--font-family--display); font-weight: 600; }
/* スマホ：3D を「文字の後ろの背景」にする（上に絵だけの区画を作らない）。
   読みやすさは薄い幕（::after）で確保。3Dを完全に無くす場合は .fv-flow .hero-stage { display: none; } の1行で済む */
@media (max-width: 768px) {
  .fv-flow .hero-stage { position: absolute; inset: 0; height: auto; }
  .fv-flow .hero-copy { position: relative; z-index: 2; padding: 48px 16px 48px; }
  body.fv-intro .fv-flow .hero-copy { padding-top: 112px; } /* 案2系はヘッダーが上に重なるので、その分あける */
  .fv-flow.hero::after { display: block; z-index: 1; background-image: linear-gradient(180deg, rgba(4, 8, 6, 0.30) 0%, rgba(4, 8, 6, 0.62) 100%); }
  .fv-flow.fv-light.hero::after { background-image: linear-gradient(180deg, rgba(247, 251, 242, 0.45) 0%, rgba(247, 251, 242, 0.78) 100%); }
}
/* 比較用：FV の高さ（--fv-h＝今の高さを 1 とした倍率。パネルのバーで 0.5〜1）。PC・タブレットのみ。
   3D は区画いっぱいの背景にし、文字は下寄せで流れに置く（低くしても文字がはみ出さず、区画が文字に合わせて伸びる）。
   body.fv-cmp（比較ページだけ）に限定＝本番トップには効かない */
:root { --fv-h: 1; --fv-hdr: 72px; } /* --fv-hdr＝ヘッダーの高さ（スマホ 72px / PC 80px） */
/* ヘッダーは常に上に固定（スクロールしても残る）。FV に重ねず、FV はヘッダーの真下から始める */
/* 演出中も最初から表示（後から出す動きはしない＝ヘッダー分の白い帯が出ない） */
body.fv-cmp .site-header { position: sticky; top: 0; left: auto; right: auto; z-index: 100; animation: none; }
@media (min-width: 769px) {
  :root { --fv-hdr: 80px; }
  /* ヘッダー＋FV の合計が今の FV の高さ（× --fv-h）になるよう、ヘッダーの分だけ FV を低くする */
  /* 文字のまとまり（社名〜ボタン）は FV の高さ方向の真ん中に置く（どの高さでも上下の余白が同じ） */
  .fv-cmp .fv-flow.hero { min-height: calc(max(560px, 100vw * 20 / 39) * var(--fv-h) - var(--fv-hdr)); display: flex; flex-direction: column; justify-content: center; }
  .fv-cmp .fv-flow .hero-stage { position: absolute; inset: 0; height: auto; aspect-ratio: auto; min-height: 0; }
  .fv-cmp .fv-flow .hero-copy { position: relative; bottom: auto; padding-top: 40px; padding-bottom: 40px; }
}
@media (max-width: 768px) {
  body.fv-cmp.fv-intro .fv-flow .hero-copy { padding-top: 48px; } /* ヘッダーが重ならなくなったので、ヘッダー分の余白は不要 */
}

/* 本番トップ（11/19 決定：D案・高さ 60%・フェード 1秒）。比較ページの「高さ」バーを 60% にしたときと同じ配置。
   body.fv-top は本番トップだけ（assemble.mjs の @fv3d と WP の mu-plugin が付ける）。フェードは --fv-k の既定 1（＝1.0秒） */
body.fv-top { --fv-h: 0.6; }
body.fv-top .site-header { position: sticky; top: 0; left: auto; right: auto; z-index: 100; animation: none; }
@media (min-width: 769px) {
  .fv-top .fv-flow.hero { min-height: calc(max(560px, 100vw * 20 / 39) * var(--fv-h) - var(--fv-hdr)); display: flex; flex-direction: column; justify-content: center; }
  .fv-top .fv-flow .hero-stage { position: absolute; inset: 0; height: auto; aspect-ratio: auto; min-height: 0; }
  .fv-top .fv-flow .hero-copy { position: relative; bottom: auto; padding-top: 40px; padding-bottom: 40px; }
}
@media (max-width: 768px) {
  body.fv-top.fv-intro .fv-flow .hero-copy { padding-top: 48px; }
}

/* 明るい版：白地で読めるよう、ラベル・社名を深緑系に */
.fv-light .hero-eyebrow { color: var(--wp--preset--color--primary); }
.fv-light .hero-brand, .fv-light .hero-brand-kana { background-image: linear-gradient(90deg, #2e5f0e 0%, #418315 50%, #3aa89f 100%); }
.fv-flow-panel .fv-theme-link { border-color: #2b2f2b; font-weight: 700; }
/* 演出の順番（合計1.0秒）。A：キャッチから / B：ラベル→キャッチ / C：カタカナ→キャッチ */
@keyframes fv-kana-in {
  0% { opacity: 0.01; filter: blur(16px); letter-spacing: 0.5em; }
  55% { opacity: 1; }
  100% { opacity: 1; filter: blur(0); letter-spacing: 0.22em; }
}
@keyframes fv-line-in { from { opacity: 0.01; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
.fv-intro.fv-brand-a .hero-title { animation: fv-up calc(0.4s * var(--fv-k)) cubic-bezier(.2, .7, .2, 1) calc(0.05s * var(--fv-k)) both; }
.fv-intro .hero-eyebrow { animation: fv-line-in calc(0.3s * var(--fv-k)) cubic-bezier(.2, .7, .2, 1) calc(0.05s * var(--fv-k)) both; }
.fv-intro.fv-brand-b .hero-title { animation: fv-up calc(0.35s * var(--fv-k)) cubic-bezier(.2, .7, .2, 1) calc(0.15s * var(--fv-k)) both; }
.fv-intro .hero-brand-kana { animation: fv-kana-in calc(0.45s * var(--fv-k)) cubic-bezier(.2, .7, .2, 1) calc(0.05s * var(--fv-k)) both; }
@media (max-width: 768px) {
  @keyframes fv-kana-in-sp { 0% { opacity: 0.01; filter: blur(12px); letter-spacing: 0.4em; } 55% { opacity: 1; } 100% { opacity: 1; filter: blur(0); letter-spacing: 0.16em; } }
  .fv-intro .hero-brand-kana { animation-name: fv-kana-in-sp; }
}

@media (prefers-reduced-motion: reduce) {
  .fv-intro .fv3d-canvas, .fv-intro .hero-brand, .fv-intro .hero-brand-logo, .fv-intro .hero-title, .fv-intro .hero-lead,
  .fv-intro .hero-text .wp-block-buttons, body.fv-intro .site-header,
  .fv-intro .hero-eyebrow, .fv-intro .hero-brand-kana, .fv-intro.fv-brand-a .hero-title, .fv-intro.fv-brand-b .hero-title { animation: none; }
}

/* プレビュー用の小パネル */
.fv-flow-panel { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: flex; gap: 6px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.94); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18); font: 12px/1.4 'Noto Sans JP', sans-serif; }
.fv-flow-panel a, .fv-flow-panel button { padding: 6px 10px; border: 1px solid #e3eadc; border-radius: 6px; background: #fff; color: #2b2f2b; text-decoration: none; font: inherit; cursor: pointer; }
.fv-flow-panel [aria-current="page"] { background: #418315; border-color: #418315; color: #fff; }
.fv-flow-panel a, .fv-flow-panel button { white-space: nowrap; }
.fv-flow-panel .fv-dur { display: flex; align-items: center; gap: 6px; padding: 0 6px; white-space: nowrap; }
.fv-flow-panel { flex-wrap: wrap; justify-content: flex-end; align-items: center; max-width: calc(100vw - 32px); }
.fv-flow-panel .fv-bg[aria-pressed="false"] { color: #8a918a; }
.fv-flow-panel .fv-dur input { width: 120px; accent-color: #418315; }
.fv-flow-panel .fv-dur output { min-width: 3.2em; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 768px) {
  .fv-flow-panel { left: 8px; right: 8px; bottom: 8px; gap: 4px; padding: 6px; justify-content: center; flex-wrap: wrap; font-size: 11px; }
  .fv-flow-panel a, .fv-flow-panel button { padding: 6px 7px; }
}
