/* ==========================================================================
   雄喜晃株式会社 — Stage Layer（演出）v2  2026-09-04
   --------------------------------------------------------------------------
   A-1 中央寄せヒーロー（TOP・LP）／ B-1+C-6 ヴェール（オープニング＋ページ遷移）
   ／ C-1 慣性 ／ C-4 スクロールテリング をまとめたレイヤー。
   ★ style.css と motion.css は触らない。読み込みは必ず motion.css より後ろ。
   ★ オープニングとカーテンは「CSSアニメだけで必ず終わる」設計。
      JSが落ちても画面が開かなくなることはない。
   ========================================================================== */

/* ---------- B-1 + C-6 ヴェール（オープニングとページ遷移を1つにした） ------
   状態は3つ。html に付くクラスで切り替わる。
     html.yk-first       … セッション最初のTOP直接来訪。ロゴを1本ずつ描く長い版（約2.90秒）
     html.yk-arrive      … 内部リンクで到着した直後。ロゴが見えた状態から面が開く（約1.02秒）
     .yk-veil.is-leaving … リンクを踏んだ瞬間。面が閉じてロゴが浮かぶ（約0.90秒）
   離脱 → 到着 がつながって「面が閉じる → ロゴ → 面が開く」に見える。
   ★長さを変えるのはここの数値と stage.js の GO_MS（離脱の長さ）だけ。
   ★CSSアニメだけで必ず終わる。JSが落ちても画面が閉じたままにはならない。
   ★広告の着地ページを待たせないため、初回の長い版は index.html だけ。
   -------------------------------------------------------------------------- */
.yk-veil{position:fixed;inset:0;z-index:9999;pointer-events:none;display:none}
html.yk-first .yk-veil,
html.yk-arrive .yk-veil,
.yk-veil.is-leaving{display:block}

.yk-veil-p{position:absolute;left:0;right:0;height:50.2%;background:#0a2540;display:block}
.yk-veil-p1{top:0}
.yk-veil-p2{bottom:0}
@keyframes yk-open-up{to{transform:translateY(-101%)}}
@keyframes yk-open-down{to{transform:translateY(101%)}}
@keyframes yk-close-down{from{transform:translateY(-101%)}to{transform:translateY(0)}}
@keyframes yk-close-up{from{transform:translateY(101%)}to{transform:translateY(0)}}
/* visibility だけだと Chrome で最終値が残らないので opacity も一緒に落とす */
@keyframes yk-veil-gone{to{opacity:0;visibility:hidden}}

.yk-veil-core{position:absolute;inset:0;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:20px}
@keyframes yk-core-out{to{opacity:0}}
@keyframes yk-core-in{from{opacity:0;transform:scale(.94)}to{opacity:1;transform:none}}
.yk-veil-mark{width:clamp(84px,11vw,124px);height:auto}
.yk-veil-mark path{stroke-dasharray:100;stroke-dashoffset:0}
@keyframes yk-draw{from{stroke-dashoffset:100}to{stroke-dashoffset:0}}
@keyframes yk-mark-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}
.yk-veil-name{font-family:'Noto Serif JP',serif;font-weight:600;color:#fff;
  font-size:.86rem;letter-spacing:.34em;text-indent:.34em;opacity:.9}
@keyframes yk-name-in{from{opacity:0}to{opacity:.9}}

/* ① 初回（TOPのみ）0.00 描き始め → 1.35 社名 → 1.90 回転おわり → 2.05 面が開く → 2.90 終了 */
html.yk-first .yk-veil-mark path{animation:yk-draw .62s cubic-bezier(.4,0,.2,1) both}
html.yk-first .yk-veil-mark path:nth-child(2){animation-delay:.24s}
html.yk-first .yk-veil-mark path:nth-child(3){animation-delay:.48s}
html.yk-first .yk-veil-name{animation:yk-name-in .50s ease .85s both}
html.yk-first .yk-veil-mark{animation:yk-mark-spin .70s cubic-bezier(.6,0,.2,1) 1.20s both}
html.yk-first .yk-veil-core{animation:yk-core-out .25s ease 1.95s forwards}
html.yk-first .yk-veil-p1{animation:yk-open-up .80s cubic-bezier(.76,0,.24,1) 2.05s forwards}
html.yk-first .yk-veil-p2{animation:yk-open-down .80s cubic-bezier(.76,0,.24,1) 2.05s forwards}
html.yk-first .yk-veil{animation:yk-veil-gone .01s linear 2.88s forwards}

/* ② 到着（全ページ）ロゴが見えている状態から面が開く */
html.yk-arrive .yk-veil-core{animation:yk-core-out .22s ease .10s forwards}
html.yk-arrive .yk-veil-p1{animation:yk-open-up .80s cubic-bezier(.76,0,.24,1) .20s forwards}
html.yk-arrive .yk-veil-p2{animation:yk-open-down .80s cubic-bezier(.76,0,.24,1) .20s forwards}
html.yk-arrive .yk-veil{animation:yk-veil-gone .01s linear 1.02s forwards}

/* ③ 離脱（全ページ）面が閉じて、ロゴが浮かぶ。
   ★①②のセレクタに必ず勝たせること。初回演出の途中でリンクを踏まれても
     「終わったら消す」指定が残っていると閉じる面が見えなくなる。 */
html .yk-veil.is-leaving{animation:none!important;opacity:1!important;visibility:visible!important}
.yk-veil.is-leaving .yk-veil-p1{animation:yk-close-down .60s cubic-bezier(.76,0,.24,1) both}
.yk-veil.is-leaving .yk-veil-p2{animation:yk-close-up .60s cubic-bezier(.76,0,.24,1) both}
.yk-veil.is-leaving .yk-veil-core{animation:yk-core-in .30s ease .34s both}
.yk-veil.is-leaving .yk-veil-mark{animation:none}
.yk-veil.is-leaving .yk-veil-mark path{animation:none;stroke-dashoffset:0}
.yk-veil.is-leaving .yk-veil-name{animation:none;opacity:.9}

/* ---------- A-1 中央寄せ・超特大タイポのヒーロー ---------- */
.hero-center{padding:104px 0 116px}
.hero-center .hero-inner{max-width:none;text-align:center;
  display:flex;flex-direction:column;align-items:center}
.hero-center .hero-tagline{margin-bottom:30px}
.hero-center .hero-title{font-size:clamp(2.5rem,8.4vw,5.9rem);line-height:1.14;
  letter-spacing:-.03em;margin-bottom:24px}
.hero-center .hero-title .mo-underline::after{height:.055em;bottom:0;
  background:rgba(217,120,67,.65)}
.hero-center .hero-sub{max-width:38ch;margin-bottom:0;
  font-size:clamp(.95rem,1.5vw,1.08rem);line-height:1.95;
  text-wrap:balance}  /* 「です。」だけが次行に落ちるのを防ぐ */
.hero-center .hero-title{text-wrap:balance}

.hero-facts{display:flex;margin:38px 0 34px;
  border-top:1px solid rgba(255,255,255,.2);border-bottom:1px solid rgba(255,255,255,.2)}
.hero-facts > div{padding:14px 26px;border-right:1px solid rgba(255,255,255,.15);
  font-size:.76rem;letter-spacing:.06em;color:rgba(255,255,255,.72);text-align:center}
.hero-facts > div:last-child{border-right:0}
.hero-facts b{display:block;font-family:'Noto Serif JP',serif;font-weight:700;
  font-size:1.15rem;color:var(--color-accent,#d97843);letter-spacing:0;margin-top:2px}

@media(max-width:760px){
  .hero-center{padding:64px 0 76px}
  .hero-center .hero-title{font-size:clamp(2.1rem,11vw,3.4rem);letter-spacing:-.02em}
  .hero-facts{flex-direction:column;width:100%;max-width:340px;margin:30px 0 28px}
  .hero-facts > div{border-right:0;border-bottom:1px solid rgba(255,255,255,.15);
    display:flex;align-items:baseline;justify-content:space-between;gap:14px;text-align:left}
  .hero-facts > div:last-child{border-bottom:0}
  .hero-facts b{margin-top:0}
}

/* ---------- A-1 を /web-design にも。中央寄せ・超特大タイポ ----------------
   ★ web-design.html は <style> をページ内に持っていて、その <style> は
     stage.css より後ろに書かれている。同じ強さだと必ず向こうが勝つので、
     ここのセレクタは .hero.hero-center-lp のように必ず1つ強くしておく。 */
.hero.hero-center-lp{padding:98px 0 76px}
.hero.hero-center-lp .hero-grid{grid-template-columns:1fr;gap:0;position:relative;z-index:2}
.hero.hero-center-lp .hero-copy{max-width:880px;width:100%;margin:0 auto;text-align:center}
.hero.hero-center-lp h1{font-size:clamp(2.3rem,7.2vw,4.6rem);line-height:1.26;
  letter-spacing:-.025em;margin-bottom:14px;text-wrap:balance}
.hero.hero-center-lp .price-hero{margin:16px 0 26px}
.hero.hero-center-lp .ph-main{justify-content:center}
.hero.hero-center-lp p.lead{max-width:60ch;margin-left:auto;margin-right:auto;
  text-wrap:balance}
.hero.hero-center-lp .hero-actions{justify-content:center}
.hero.hero-center-lp .hero-trust{justify-content:center;gap:14px 26px}
.hero.hero-center-lp .hero-visual{width:100%;max-width:700px;min-height:440px;margin:34px auto 0}
.hero.hero-center-lp .mock-browser{max-width:560px}
.hero.hero-center-lp .mock-phone{width:186px;bottom:6px}

/* ★PCのヒーローはモックを置かず、文字だけにする。
   ・文章の下に積む → ヒーローが1400px超になって1画面に収まらない
   ・背景に透かしで敷く → 半透明の板が見出しを横切るうえ、
     元のふわふわ動くアニメが乗って気持ち悪くなる（2026-09-04 実機で判明）
   すぐ下の PORTFOLIO に本物の実績サムネがあるので、
   ここで作り物のモックを見せる必要はない。
   スマホは文章の下に普通に並ぶだけで悪さをしないので、そのまま残す。 */
@media(min-width:861px){
  .hero.hero-center-lp{padding:112px 0 104px}
  .hero.hero-center-lp .hero-visual{display:none}
}

@media(max-width:860px){
  .hero.hero-center-lp{padding:60px 0 52px}
  /* ★スマホの見出しは 8.2vw まで。9vw を超えると「作ってお見せします。」の
     10文字が1行に収まらず「お見／せ」で割れる（390px 実機で確認） */
  .hero.hero-center-lp h1{font-size:clamp(1.72rem,8.2vw,3.1rem);line-height:1.38}
  .hero.hero-center-lp .hero-visual{max-width:440px;min-height:330px}
  .hero.hero-center-lp .mock-browser{max-width:336px}
  .hero.hero-center-lp .mock-phone{width:126px;bottom:4px}
  .hero.hero-center-lp .hero-trust{gap:10px 18px;font-size:.79rem}
  .hero.hero-center-lp .hero-actions .btn{width:100%;justify-content:center}
}
@media(max-width:640px){
  /* 「気に入ったら月額」と金額を1行に押し込むと（税別）だけ落ちて不格好。
     ラベルを上の行に逃がす。 */
  .hero.hero-center-lp .ph-main{flex-wrap:wrap;gap:2px 8px}
  .hero.hero-center-lp .ph-lbl{width:100%;font-size:.94rem}
}

/* ---------- C-4 スクロールテリング：手描きのラフ → 完成デザイン（案2） -----
   step1 方眼紙に骨組みの線が引かれる／step2 中身の枠とCTAが足される
   step3 紙が退いて、本物のデザインがブラウザ枠で立ち上がる
   ★線は stroke-dashoffset の transition。data-step が変わるだけで進む。
   ★動き低減設定のときは stage.js が最初から step3 にするので、
     いきなり完成形が出る。ここに専用の指定は要らない。 */
.build{padding-bottom:0}
.build-scene{position:relative;height:250vh}
.build-sticky{position:sticky;top:92px;height:calc(100vh - 92px);min-height:460px;
  display:flex;align-items:center}
.build-grid{display:grid;grid-template-columns:1.05fr .95fr;gap:48px;align-items:center;width:100%}

.bp-stage{position:relative;width:100%;max-width:540px;margin:0 auto;aspect-ratio:400/268}
.bp-sheet,.bp-screen{position:absolute;inset:0}

/* 方眼紙。ほんの少し傾けて置く（きっちり水平だと機械が引いた線に見える） */
.bp-sheet{background:#fdfcf7;
  background-image:linear-gradient(#e7e3d6 1px,transparent 1px),
                   linear-gradient(90deg,#e7e3d6 1px,transparent 1px);
  background-size:18px 18px;border-radius:3px;
  box-shadow:0 18px 44px rgba(10,37,64,.17),0 1px 0 rgba(0,0,0,.05);
  transform:rotate(-1.1deg);transform-origin:50% 60%;
  transition:opacity .5s ease .05s,transform .6s cubic-bezier(.4,0,.2,1)}
.build-scene[data-step="3"] .bp-sheet{opacity:0;transform:rotate(-3.6deg) translateY(-16px) scale(.975)}

/* マスキングテープ。手で貼った感じを出すための1枚 */
.bp-tape{position:absolute;top:-11px;left:12%;width:74px;height:22px;
  background:rgba(232,214,164,.72);transform:rotate(-4deg);
  box-shadow:0 1px 3px rgba(0,0,0,.09);z-index:3;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 3px,#000 calc(100% - 3px),transparent 100%);
          mask-image:linear-gradient(90deg,transparent 0,#000 3px,#000 calc(100% - 3px),transparent 100%);
  transition:opacity .4s ease}
.build-scene[data-step="3"] .bp-tape{opacity:0}

.bp-sk{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.bp-sk path,.bp-sk line{fill:none;stroke:#42505f;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round;
  stroke-dasharray:1400;stroke-dashoffset:1400;
  transition:stroke-dashoffset 1.05s cubic-bezier(.45,0,.25,1)}
/* ★太さを全部そろえると定規の線に見える。細い線を混ぜて手で引いた感じにする */
.bp-sk .g1 *:nth-child(3),.bp-sk .g1 *:nth-child(4),
.bp-sk .g2 *:nth-child(5){stroke-width:1.45}
.bp-sk .g1 *:nth-child(2){transition-delay:.16s}
.bp-sk .g1 *:nth-child(3){transition-delay:.30s}
.bp-sk .g1 *:nth-child(4){transition-delay:.42s}
.bp-sk .g2 *:nth-child(2){transition-delay:.14s}
.bp-sk .g2 *:nth-child(3){transition-delay:.28s}
.bp-sk .g2 *:nth-child(4){transition-delay:.42s}
.build-scene[data-step="1"] .bp-sk .g1 *,
.build-scene[data-step="2"] .bp-sk .g1 *,
.build-scene[data-step="2"] .bp-sk .g2 *,
.build-scene[data-step="3"] .bp-sk *{stroke-dashoffset:0}
/* 手書きの書き込み。Yuji Syuku はページで既に読み込んでいるフォント */
.bp-hand{font-family:'Yuji Syuku',serif;fill:#42505f;font-size:11px;letter-spacing:.06em;
  opacity:0;transition:opacity .5s ease .5s}
.build-scene[data-step="2"] .bp-hand,
.build-scene[data-step="3"] .bp-hand{opacity:.85}
.bp-note{position:absolute;top:9px;right:14px;font-family:'Yuji Syuku',serif;
  font-size:.72rem;color:#8b8371;letter-spacing:.08em;z-index:2;
  transition:opacity .4s ease}
.build-scene[data-step="3"] .bp-note{opacity:0}

/* 完成した画面。紙が退くのと入れ替わりで立ち上がる */
.bp-screen{background:#fff;border-radius:11px;overflow:hidden;display:flex;flex-direction:column;
  border:1px solid var(--color-border,#e5e7eb);
  box-shadow:0 28px 62px rgba(10,37,64,.22);
  opacity:0;transform:scale(.962) translateY(8px);
  transition:opacity .5s ease .14s,transform .62s cubic-bezier(.4,0,.2,1) .14s}
.build-scene[data-step="3"] .bp-screen{opacity:1;transform:none}
.bp-bar{height:26px;background:linear-gradient(#f5f7f9,#e8edf2);display:flex;align-items:center;
  gap:5px;padding:0 11px;border-bottom:1px solid rgba(10,37,64,.09)}
.bp-bar i{width:7px;height:7px;border-radius:50%;background:#d7dce3}
.bp-bar i:nth-child(1){background:#ff5f57}.bp-bar i:nth-child(2){background:#febc2e}
.bp-bar i:nth-child(3){background:#28c840}
.bp-body{flex:1;padding:14px;display:flex;flex-direction:column;gap:9px}
.bp-nav{flex:0 0 8.5%;min-height:19px;border-radius:5px;background:var(--color-primary,#0a2540);
  display:flex;align-items:center;gap:7px;padding:0 11px}
.bp-nav i{height:4px;border-radius:2px;background:rgba(255,255,255,.42)}
.bp-nav i:first-child{width:36px;background:#fff}
.bp-nav i:not(:first-child){width:20px}
.bp-hero{flex:1 1 auto;min-height:80px;border-radius:7px;
  background:linear-gradient(135deg,#13395e,#2f9e8f);
  display:flex;flex-direction:column;justify-content:center;gap:7px;padding:0 16px}
.bp-hero b{color:#fff;font-size:.8rem;font-weight:600;letter-spacing:.01em}
.bp-hero i{display:block;height:5px;width:54%;background:rgba(255,255,255,.5);border-radius:3px}
.bp-cards{flex:0 0 21%;min-height:40px;display:flex;gap:9px}
.bp-cards i{flex:1;border-radius:6px;background:#eef1f5}
.bp-cards i:nth-child(2){background:linear-gradient(135deg,#fdece1,#f5cfb6)}
.bp-btn{align-self:flex-start;flex:0 0 auto;height:27px;padding:0 18px;border-radius:50px;
  background:var(--color-accent,#d97843);color:#fff;font-size:.68rem;font-weight:700;
  display:flex;align-items:center}

.build-steps{counter-reset:bs;display:flex;flex-direction:column;gap:14px;margin:0;padding:0}
.build-steps li{list-style:none;position:relative;padding:16px 20px 16px 58px;border-radius:12px;
  border:1px solid transparent;transition:.4s ease;opacity:.4}
.build-steps li::before{counter-increment:bs;content:"0" counter(bs);position:absolute;left:20px;top:16px;
  font-size:.76rem;font-weight:700;letter-spacing:.06em;color:var(--color-accent,#d97843)}
.build-steps b{display:block;font-size:1.02rem;color:var(--color-primary,#0a2540);margin-bottom:4px}
.build-steps span{display:block;font-size:.86rem;line-height:1.9;color:var(--color-text-muted,#5a6070)}
.build-scene[data-step="1"] .build-steps li[data-s="1"],
.build-scene[data-step="2"] .build-steps li[data-s="2"],
.build-scene[data-step="3"] .build-steps li[data-s="3"]{opacity:1;background:#fff;
  border-color:var(--color-border,#e5e7eb);box-shadow:0 10px 30px rgba(10,37,64,.07)}

@media(max-width:860px){
  .build-scene{height:240vh}
  .build-sticky{top:70px;height:calc(100vh - 70px);min-height:0}
  .build-grid{grid-template-columns:1fr;gap:22px}
  .bp-stage{max-width:400px}
  .bp-tape{width:58px;height:18px;top:-9px}
  .bp-sk path,.bp-sk line{stroke-width:2.1}
  .bp-hand{font-size:13px}
  /* ★スマホでは紙が小さく、右上の書き込みがヘッダーの枠線に重なる。消す。 */
  .bp-note{display:none}
  .bp-body{padding:11px;gap:8px}
  .bp-hero{min-height:70px}
  .bp-hero b{font-size:.7rem}
  .bp-cards i{height:34px}
  .build-steps li{padding:12px 14px 12px 48px}
  .build-steps li::before{left:14px;top:13px}
  .build-steps b{font-size:.94rem}
  .build-steps span{font-size:.8rem;line-height:1.8}
}

/* ---------- C-1 慣性（PCのみ・JSがtransformを入れる。ここは受け皿だけ） ---- */
.yk-lag{will-change:transform}

@media(prefers-reduced-motion:reduce){
  .yk-veil{display:none!important}
  .build-scene{height:auto}
  .build-sticky{position:static;height:auto}
  .build-steps li{opacity:1}
}
