/* トップページ。.is-armed は JS が付け、無ければ完成形のまま */

/* ===== HERO ===== */
/* 下端の線は段が立つ地面。次のセクションとの区切りも兼ねる */
.hero { position: relative; padding: calc(var(--header-h) + 24px) 0 0; overflow: hidden; border-bottom: 1px solid var(--fg); }
.hero__copy { display: grid; grid-template-columns: 1fr; align-items: start; gap: 40px; position: relative; z-index: 2; }
.hero__title { font-family: var(--font-en); font-weight: 300; font-size: clamp(52px, 8.4vw, 132px); line-height: .95; letter-spacing: -.035em; }
.hero__ja { display: block; font-family: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif; font-weight: 700; font-size: clamp(18px, 1.8vw, 26px); line-height: 1.5; letter-spacing: .02em; margin-top: 18px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
/* テーマの丸（ナビのテーマ切替で使う） */
.theme-switch__dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line); }
.theme-switch__dot--white { background: #FFFFFF; }
.theme-switch__dot--black { background: #0A0A0A; }

/* 階段：PC で JS 有効時だけ下端に重ね、高さは fv.js が決める */
.fv-steps { position: relative; height: clamp(300px, 46vh, 480px); margin-top: 40px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; max-width: 1600px; margin-inline: auto; } /* 大画面で見出しから離れすぎないよう 1600px で中央に寄せる */
@media (min-width: 1025px) {
  html.js .hero { height: var(--fv-h, max(100svh, 640px)); }
  html.js .fv-steps { position: absolute; left: max(0px, calc((100% - 1600px) / 2)); right: max(0px, calc((100% - 1600px) / 2)); bottom: 0; margin: 0; height: var(--fv-steps-h, 56%); }
}
/* both だと scaleY(1) が残り線が1px欠けるので backwards */
.fv-step { position: relative; transform-origin: bottom; animation: fv-rise 1s cubic-bezier(.2, .7, .1, 1) backwards; --ac: var(--fg); }
.fv-step:nth-child(1) { height: 38%; animation-delay: .15s; --pc: var(--p1); }
.fv-step:nth-child(2) { height: 66%; animation-delay: .35s; --pc: var(--p2); }
.fv-step:nth-child(3) { height: 100%; animation-delay: .55s; --pc: var(--p3); }
@keyframes fv-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.fv-face { position: absolute; inset: 0; overflow: hidden; background: var(--bg); border: 1px solid var(--fg); border-bottom: 0; transition: transform .12s ease-out; }
/* 線の二重を防ぐ。右の段の方が高いので、消すのは手前の段の右線 */
.fv-step:not(:last-child) .fv-face { border-right: 0; }
.fv-step.hit .fv-face { transform: translateY(3px); }
.fv-num { position: absolute; left: 20px; top: 22px; z-index: 1; font: 300 46px/1 var(--font-en); letter-spacing: -.04em; }
.fv-lbl { position: absolute; left: 22px; top: 76px; z-index: 1; font: 700 10px var(--font-en); letter-spacing: .26em; text-transform: uppercase; }
.fv-lbl__ja { display: block; margin-top: 6px; font: 400 15px "Zen Kaku Gothic New", sans-serif; letter-spacing: .06em; text-transform: none; }
/* 上端の帯：玉が着地すると担当色が左右へ広がる */
.fv-edge, .fv-edge-c { position: absolute; left: 0; right: 0; top: 0; z-index: 2; height: 4px; transition: height .16s ease-out, box-shadow .3s; }
.fv-edge { background: var(--fg); }
.fv-edge-c { background: var(--pc); transform: scaleX(0); transition: transform .7s cubic-bezier(.2, .8, .2, 1), height .16s ease-out, box-shadow .3s; }
.fv-step.lit { --ac: var(--pc); }
.fv-step.lit .fv-edge-c { transform: scaleX(1); }
.fv-step.hit .fv-edge, .fv-step.hit .fv-edge-c { height: 10px; }
.fv-step.lit.hit .fv-edge-c { box-shadow: 0 0 24px var(--pc); }

/* 段の中身（Web・グラフ・AI）。点灯すると担当色が入って動き出す */
.fv-viz { position: absolute; pointer-events: none; overflow: visible; color: var(--fg); }
.fv-v1 { left: 44%; top: 16%; width: 51%; height: 72%; }
.fv-v2 { left: 6%; top: max(36%, 120px); width: 88%; height: calc(94% - max(36%, 120px)); } /* 段が低いときもラベル（下端 約112px）の下から描く */
.fv-v3 { left: 6%; top: 20%; width: 88%; height: 76%; }
.fv-viz .hl, .fv-viz .hl-g > * { vector-effect: non-scaling-stroke; }
.fv-viz .bgf { fill: var(--bg); }
.fv-viz .bg2f { fill: var(--bg-2); }
.fv-viz .mute { fill: var(--fg-2); fill-opacity: .45; }
.fv-viz .mute-s { stroke: var(--fg-2); stroke-opacity: .45; }
.fv-viz .txt2 { fill: var(--fg-2); }
.fv-viz .accf { fill: var(--ac); transition: fill .5s; }
.fv-viz .accs { stroke: var(--ac); transition: stroke .5s; }
.fv-v1 .art-c { opacity: 0; transition: opacity 1s ease .1s; }
.fv-step.lit .fv-v1 .art-c { opacity: 1; }
.fv-v2 .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.fv-step.lit .fv-v2 .draw { animation: fv-draw .9s ease forwards .15s; }
@keyframes fv-draw { to { stroke-dashoffset: 0; } }
.fv-v2 .pop { transform-box: fill-box; transform-origin: center; transform: scale(0); }
.fv-step.lit .fv-v2 .pop { animation: fv-pop .35s cubic-bezier(.2, 1.6, .4, 1) forwards; animation-delay: calc(.25s + var(--i) * 120ms); }
@keyframes fv-pop { to { transform: scale(1); } }
.fv-v3 .spin { transform-box: view-box; transform-origin: 150px 150px; animation: fv-spin 60s linear infinite; }
@keyframes fv-spin { to { transform: rotate(360deg); } }
.fv-v3 .key { stroke: currentColor; stroke-opacity: .16; stroke-width: .7px; transition: stroke-opacity .6s, stroke-width .6s; }
.fv-step.lit .fv-v3 .key { stroke-opacity: .95; stroke-width: 1.4px; }
.fv-v3 .act { fill: var(--bg); transition: fill .5s; }
.fv-step.lit .fv-v3 .act { fill: var(--fg); }
.fv-v3 .sigs { opacity: 0; transition: opacity .5s; }
.fv-step.lit .fv-v3 .sigs { opacity: 1; }
.fv-v3 .pulse { transform-box: fill-box; transform-origin: center; opacity: 0; }
.fv-step.lit .fv-v3 .pulse { animation: fv-pulse 2s ease-out infinite .4s; }
@keyframes fv-pulse { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(3.6); } }

/* 3つの玉・影・着地の波紋（fv.js が作る） */
.fv-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.fv-ball { position: absolute; left: 0; top: 0; width: 16px; height: 16px; margin: -16px 0 0 -8px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(10, 10, 10, .22); transform-origin: 50% 100%; will-change: transform; opacity: 0; }
.fv-shadow { position: absolute; left: 0; top: 0; width: 30px; height: 7px; margin: -3.5px 0 0 -15px; border-radius: 50%; background: radial-gradient(closest-side, rgba(10, 10, 10, .6), rgba(10, 10, 10, 0)); opacity: 0; }
.fv-ripple { position: absolute; width: 8px; height: 3px; border: 1.5px solid var(--rc); border-radius: 50%; transform: translate(-50%, -50%); animation: fv-rip .6s ease-out forwards; }
@keyframes fv-rip { to { width: 96px; height: 22px; opacity: 0; } }
.fv-huh { position: absolute; left: 0; top: 0; font: 700 20px/1 var(--font-en); color: var(--fg); opacity: 0; transform-origin: 50% 100%; }

/* i の点だけ塗る（--i-cut は Outfit 300 実測、fv.js が上書き） */
.fv-i { --dot: var(--fg); background: linear-gradient(to bottom, var(--dot) 0 var(--i-cut, .4775em), var(--fg) var(--i-cut, .4775em)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fv-i.is-dotted { --dot: var(--p1); }
.fv-period.is-dotted { color: var(--p2); }
/* ボタンの丸：入るまで幅0にし、gap 8px も打ち消して形を保つ */
.btn__dot { flex: none; width: 0; height: 10px; margin-left: -8px; border-radius: 50%; background: var(--p3); box-shadow: inset 0 0 0 1px rgba(10, 10, 10, .22); transform: scale(0); transition: width .35s cubic-bezier(.2, .8, .2, 1), margin .35s cubic-bezier(.2, .8, .2, 1), transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.btn.has-dot { padding-right: 18px; transition: padding .35s cubic-bezier(.2, .8, .2, 1), transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease; }
.btn.has-dot .btn__dot { width: 10px; margin-left: 0; transform: scale(1); }

/* JS 無効時は玉が出ないので、最後の状態（3段とも点灯）で見せる */
html:not(.js) .fv-i { --dot: var(--p1); }
html:not(.js) .fv-period { color: var(--p2); }
html:not(.js) .hero__cta .btn__dot { width: 10px; margin-left: 0; transform: none; }
html:not(.js) .nav-cta .btn__dot { width: 10px; margin-left: 0; transform: none; }
html:not(.js) .nav-cta { padding-right: 14px; }
/* ナビの「お問い合わせ」へ跳ぶ玉（fv.js）。ヘッダーより手前に出す */
.fv-hop { position: fixed; left: 0; top: 0; z-index: 150; width: 10px; height: 10px; border-radius: 50%; background: var(--p3); box-shadow: inset 0 0 0 1px rgba(10, 10, 10, .22); pointer-events: none; }
.nav-cta.has-dot { padding-right: 14px; }
html:not(.js) .hero__cta .btn--primary { padding-right: 18px; }
html:not(.js) .fv-step { --ac: var(--pc); }
html:not(.js) .fv-edge-c { transform: scaleX(1); }
html:not(.js) .fv-v1 .art-c { opacity: 1; }
html:not(.js) .fv-v2 .draw { stroke-dashoffset: 0; }
html:not(.js) .fv-v2 .pop { transform: none; }
html:not(.js) .fv-v3 .key { stroke-opacity: .95; stroke-width: 1.4px; }
html:not(.js) .fv-v3 .act { fill: var(--fg); }
html:not(.js) .fv-v3 .sigs { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .fv-step { animation: none; }
  .fv-edge-c, .fv-v1 .art-c { transition: none; }
  .fv-v2 .draw, .fv-step.lit .fv-v2 .draw { animation: none; stroke-dashoffset: 0; }
  .fv-v2 .pop, .fv-step.lit .fv-v2 .pop { animation: none; transform: none; }
  .fv-v3 .spin, .fv-step.lit .fv-v3 .pulse { animation: none; }
  .fv-v3 .sigs { display: none; }
  .btn__dot, .btn.has-dot { transition: none; }
}
@media (max-width: 768px) {
  .hero__copy { grid-template-columns: 1fr; gap: 20px; }
  .fv-steps { height: clamp(260px, 42vh, 360px); margin-top: 32px; }
  .fv-num { font-size: 28px; left: 10px; top: 14px; }
  .fv-lbl { left: 11px; top: 46px; font-size: 8px; }
  /* 段の図と重ならないよう、日本語ラベルは数字の右に置く */
  .fv-lbl__ja { position: absolute; left: 36px; top: -25px; margin: 0; font-size: 11px; line-height: 16px; letter-spacing: 0; white-space: nowrap; }
  .fv-v1 { left: 8%; top: 52%; width: 84%; height: 40%; }
  .fv-v2 { left: 4%; top: 34%; width: 92%; height: 62%; }
  .fv-v3 { left: 4%; top: 22%; width: 92%; height: 74%; }
}

/* ナビのテーマ切替（aria-pressed は theme.js） */
.nav-theme { display: flex; align-items: center; gap: 2px; }
.nav-theme__btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid transparent; transition: border-color .2s; }
.nav-theme__btn:hover { border-color: var(--line); }
.nav-theme__btn[aria-pressed="true"] { border-color: currentColor; }
.nav-theme__btn .theme-switch__dot { width: 14px; height: 14px; border-color: currentColor; }

/* ===== STATEMENT ===== */
.statement { padding: 10vw 0; }
.statement__lead { font: 700 max(32px, min(6.4vw, 92px))/1.06 "Zen Kaku Gothic New", "Hiragino Sans", sans-serif; letter-spacing: -.03em; } /* 大画面で「作って終わりに／しない。」と割れないよう 92px で頭打ち */
.statement__body { margin-top: clamp(24px, 3.4vw, 48px); font: 700 32px/1.6 "Zen Kaku Gothic New", "Hiragino Sans", sans-serif; letter-spacing: .01em; word-break: auto-phrase; }
.statement__line { display: block; }
.statement mark { white-space: nowrap; color: inherit; padding: 0 .04em; background: linear-gradient(var(--c), var(--c)) no-repeat 0 90% / 100% .3em; }
/* グリッチ：statement.js が付けた data-t を重ねてずらす */
.statement__gl { position: relative; display: inline-block; }
.statement__gl::before, .statement__gl::after { content: attr(data-t); position: absolute; inset: 0; pointer-events: none; opacity: 0; } /* white-space: pre は付けない（スマホで横にはみ出す） */
.statement__gl::before { color: var(--p2); }
.statement__gl::after { color: var(--p1); }
.statement.is-armed .statement__gl { opacity: 0; }
.statement.is-armed mark { background-size: 0 .3em; }
.statement.is-armed .statement__line.is-in .statement__gl { animation: st-flick 1.1s steps(1) both; animation-delay: var(--d, 0ms); }
.statement.is-armed .statement__line.is-in .statement__gl::before { animation: st-gl1 1.1s steps(1) both; animation-delay: var(--d, 0ms); }
.statement.is-armed .statement__line.is-in .statement__gl::after { animation: st-gl2 1.1s steps(1) both; animation-delay: var(--d, 0ms); }
.statement.is-armed .statement__line.is-in mark { animation: st-zap .9s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(var(--d, 0ms) + 700ms); }
@keyframes st-flick { 0% { opacity: 0; } 8% { opacity: 1; transform: translate(-4px, 0) skewX(-8deg); } 16% { opacity: .2; } 24% { opacity: 1; transform: translate(3px, 0); } 36% { transform: translate(-2px, 1px) skewX(6deg); } 48% { opacity: .6; transform: none; } 60%, 100% { opacity: 1; transform: none; } }
@keyframes st-gl1 { 0%, 60%, 100% { opacity: 0; transform: none; clip-path: none; } 8% { opacity: .9; transform: translate(6px, -2px); clip-path: inset(10% 0 55% 0); } 24% { opacity: .9; transform: translate(-7px, 1px); clip-path: inset(60% 0 5% 0); } 40% { opacity: .9; transform: translate(4px, 0); clip-path: inset(30% 0 40% 0); } }
@keyframes st-gl2 { 0%, 60%, 100% { opacity: 0; transform: none; clip-path: none; } 12% { opacity: .9; transform: translate(-6px, 2px); clip-path: inset(50% 0 20% 0); } 28% { opacity: .9; transform: translate(5px, -1px); clip-path: inset(5% 0 70% 0); } 44% { opacity: .9; transform: translate(-3px, 0); clip-path: inset(70% 0 0 0); } }
@keyframes st-zap { 0% { background-size: 0 .3em; } 30% { background-size: 100% 1.2em; } 55% { background-size: 100% .15em; } 100% { background-size: 100% .3em; } }

@media (max-width: 768px) { .statement__body { font-size: 22px; } }  /* 32px だとスマホで1行10文字ほどになるため */

/* ===== SERVICES ===== */
.services { background: #ebebeb; }
:root[data-theme="black"] .services { background: #161616; }

.svc__stage { display: grid; grid-template-columns: 200px 1fr; gap: 40px; align-items: start; }
.svc__idx { position: sticky; top: calc(var(--header-h) + 40px); }
.svc__idx ol { position: relative; z-index: 1; list-style: none; padding: 0; }
.svc__idx a { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--fg-2); text-decoration: none; font: 700 13px var(--font-en); letter-spacing: .04em; transition: color .3s; }
.svc__idx a:hover, .svc__idx a.is-on { color: var(--fg); }
.svc__idx a i { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1px solid currentColor; background: var(--bg); transition: background .3s, border-color .3s, transform .3s; }
.svc__idx a.is-on i { background: var(--c); border-color: var(--c); transform: scale(1.4); }
/* 目次の縦線：読んだ分だけ伸びる（--prog は services.js） */
.svc__line { position: absolute; left: 4.5px; top: 22px; bottom: 22px; width: 1px; background: var(--line); }
.svc__line b { display: block; width: 100%; height: calc(var(--prog, 0) * 100%); background: var(--fg); }
.svc__area { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.svc__card { position: relative; overflow: hidden; padding: 34px 30px 28px; background: var(--bg); border: 1px solid var(--fg); border-radius: 16px; scroll-margin-top: 24px; } /* ヘッダー分は html の scroll-padding-top が持つ */
.svc__card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--c); transform-origin: left; }
.svc__num { font: 700 13px var(--font-en); letter-spacing: .2em; color: var(--fg-2); }
.svc__card h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin: 6px 0 10px; font-size: clamp(22px, 2.2vw, 26px); }
.svc__en { font: 400 12px var(--font-en); letter-spacing: .2em; text-transform: uppercase; color: var(--fg-2); }
.svc__card p { font-size: 14px; line-height: 1.75; }
.svc__card ul { display: grid; gap: 2px 24px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.svc__card li { position: relative; padding-left: 18px; font-size: 14px; line-height: 1.7; }
.svc__card li::before { content: ""; position: absolute; left: 0; top: .85em; width: 8px; height: 1.5px; background: var(--c); }

/* 現れ方（--d は Z の順にずらす遅延。services.js が付ける） */
.svc.is-armed .svc__card { clip-path: inset(100% 0 0 0 round 16px); transform: translateY(24px); transition: clip-path .8s cubic-bezier(.2, .8, .2, 1), transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0ms); }
.svc.is-armed .svc__card::before { transform: scaleX(0); transition: transform .6s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--d, 0ms) + 450ms); }
.svc.is-armed .svc__card.is-in { clip-path: inset(0 round 16px); transform: none; }
.svc.is-armed .svc__card.is-in::before { transform: scaleX(1); }

@media (max-width: 1024px) {
  .svc__stage { grid-template-columns: 1fr; }
  .svc__idx { display: none; }
}
@media (max-width: 768px) {
  .svc__area { grid-template-columns: 1fr; }
  .svc__card { padding: 30px 20px 22px; }
}

/* ===== WORKS（横スクロール） ===== */
.works { overflow: hidden; }
.works-viewport { position: relative; }
.works-track {
  display: flex; gap: 24px; padding: 0 24px 24px;
  overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 24px; /* スワイプで止まったカードの左に余白を残す */
}
.works-track::-webkit-scrollbar { height: 4px; }
.works-track::-webkit-scrollbar-thumb { background: var(--line); }
.is-pinned .works-track { overflow-x: visible; padding-left: max(24px, calc((100vw - 1200px) / 2 + 24px)); }
/* 固定表示中は1画面に収まるよう、余白を詰めてカード幅を画面の高さから決める */
.works.is-pinned { padding-top: calc(var(--header-h) + 16px); padding-bottom: 24px; }
.works.is-pinned .section-head { margin-bottom: 40px; }
.works.is-pinned .section-title__en { font-size: clamp(36px, 5vw, 64px); }
.is-pinned .works-card { flex-basis: max(300px, min(72vw, 640px, calc((100vh - 512px) * 1.6))); }
.works-card {
  flex: 0 0 min(72vw, 640px); scroll-snap-align: start; text-decoration: none;
  display: grid; gap: 16px; --c: var(--p1);
}
.works-card__fig { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); transition: border-color .3s; } /* 白っぽい画面の端が地に溶けないよう線を引く */
.works-card__fig img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s ease; }
.works-card:hover .works-card__fig img { transform: scale(1.03); }
/* 担当色：ホバー時の枠と送りのバーに 緑→桃→黄 の順で使う */
.works-card:nth-child(3n + 2) { --c: var(--p2); }
.works-card:nth-child(3n) { --c: var(--p3); }
.works-card__num { font-family: var(--font-en); font-weight: 700; font-size: 12px; letter-spacing: .2em; color: var(--fg-2); }
.works-card:hover .works-card__fig, .works-card:focus-visible .works-card__fig { border-color: var(--c); }
.works-card__title { font-size: 20px; margin-top: 4px; }
.works-card__type { font-size: 14px; margin: 4px 0 0; }
@media (max-width: 768px) { .works-card { flex-basis: 84vw; } }
/* 実績の送り（works-nav.js） */
.works-nav { display: flex; align-items: center; gap: 14px; max-width: 1200px; margin: -24px auto 20px; padding: 0 24px; font: 700 13px var(--font-en); }
.works-nav[hidden] { display: none; }
.works-nav__btn { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--fg); border-radius: 50%; font-size: 16px; transition: background-color .2s, color .2s, opacity .2s; }
.works-nav__btn:hover:not(:disabled) { background: var(--fg); color: var(--bg); }
.works-nav__btn:disabled { opacity: .3; cursor: default; }
.works-nav__count { min-width: 5em; letter-spacing: .12em; color: var(--fg-2); }
.works-nav__count b { color: var(--fg); }
.works-nav__bar { flex: 0 1 200px; height: 4px; border-radius: 2px; overflow: hidden; background: var(--line); }
.works-nav__bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--c, var(--fg)); transition: background-color .3s; } /* 今のカードの担当色（works-nav.js が --c を渡す） */
.works-nav__hint { margin-left: auto; font-family: "Zen Kaku Gothic New", sans-serif; font-size: 12px; font-weight: 400; color: var(--fg-2); }
.works-nav__hint-sp { display: none; }
/* スマホは固定表示せず指で送るので、案内をスワイプ用にして2行目へ */
@media (max-width: 768px) {
  .works-nav { flex-wrap: wrap; row-gap: 8px; }
  .works-nav__bar { flex: 1 1 auto; }
  .works-nav__hint { order: 5; width: 100%; margin-left: 0; }
  .works-nav__hint-pc { display: none; }
  .works-nav__hint-sp { display: inline; }
}

/* ===== PROCESS ===== */
.steps { display: grid; gap: 40px; list-style: none; }
.step { position: relative; padding-left: 40px; --c: var(--p1); }
.step:nth-child(2) { --c: var(--p2); }
.step:nth-child(3) { --c: var(--p3); }
.step:nth-child(4) { --c: var(--fg); }
.step:nth-child(5) { --c: var(--p1); } /* 改善からまた次の相談へ戻る、の意味で 01 と同じ色 */
.step::before { content: ""; position: absolute; left: 0; top: 8px; z-index: 1; width: 16px; height: 16px; border-radius: 50%; background: var(--c); }
.step:not(:last-child)::after { content: ""; position: absolute; left: 7px; top: 24px; width: 2px; height: calc(100% + 40px - 16px); background: var(--fg); transform-origin: top; }
.step__num { display: block; font-family: var(--font-en); font-weight: 700; font-size: 12px; letter-spacing: .2em; color: var(--fg-2); }
.step h3 { font-size: 22px; line-height: 1.4; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 4px 0 8px; }
.step__en { font-family: var(--font-en); font-weight: 400; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-2); }
.step p { max-width: 40em; color: var(--fg-2); }
@keyframes step-pop { 0% { scale: 0; box-shadow: 0 0 0 0 var(--c); } 55% { scale: 1.4; } 100% { scale: 1; box-shadow: 0 0 0 14px transparent; } }
.process.is-armed .step::before { scale: 0; }
.process.is-armed .step::after { scale: 1 0; }
.process.is-armed .step > * { opacity: 0; translate: 0 16px; }
.process.is-armed .step.is-on::before { animation: step-pop .5s cubic-bezier(.2, .8, .2, 1) var(--d, 0s) both; }
.process.is-armed .step:has(+ .step.is-on)::after { scale: 1 1; transition: scale .35s linear; }
.process.is-armed .step.is-on > * { opacity: 1; translate: none; transition: opacity .5s calc(var(--d, 0s) + .12s), translate .6s cubic-bezier(.2, .8, .2, 1) calc(var(--d, 0s) + .12s); }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(5, 1fr); gap: 28px; }
  .step { padding: 44px 0 0; }
  .step::before { top: 0; }
  .step:not(:last-child)::after { left: 16px; top: 7px; width: calc(100% + 28px - 16px); height: 2px; transform-origin: left; }
  .step h3 { font-size: 20px; }
  .step h3 .step__en { display: block; width: 100%; }
  .step p { font-size: 15px; line-height: 1.8; }
  .process.is-armed .step::after, .process.is-armed .step:has(+ .step.is-on)::after { scale: 0 1; transition: none; }
  .process.is-armed .step.is-on:not(:last-child)::after { scale: 1 1; transition: scale .35s linear calc(var(--d, 0s) + .1s); }
}

/* ===== PRICE ===== */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.plan { border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; background: var(--bg); }
.plan__name { font-weight: 700; font-size: 18px; line-height: 1.5; margin-bottom: 8px; }
/* プラン名は「・」の後で折り返し、4列では2行分とって金額の高さをそろえる */
.plan__name .ph { display: inline-block; }
@media (min-width: 1181px) { .plan__name { min-height: 3em; } }
.plan__price { font-family: var(--font-en); font-weight: 700; font-size: 36px; letter-spacing: -.02em; margin-bottom: 12px; }
.plan__price span { font-family: inherit; font-size: 14px; letter-spacing: 0; margin-left: 4px; }
.plan__desc { font-size: 14px; color: var(--fg-2); min-height: 4.5em; }
.plan ul { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; display: grid; gap: 6px; }
/* 「（例）」の注記があるときは、区切り線を注記の上に置く */
.plan__ex { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--fg-2); }
.plan__ex + ul { margin-top: 6px; padding-top: 0; border-top: 0; }
@media (max-width: 1180px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }

/* ===== PROFILE ===== */
/* 灰色の地では既定の補助色が 4.5:1 に届かないため濃くする */
.profile { background: #ebebeb; --fg-2: #555555; --line: rgba(0, 0, 0, .14); }
:root[data-theme="black"] .profile { background: #2a2a2a; --fg-2: #B5B5B5; --line: rgba(255, 255, 255, .18); }
.profile__grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 64px; align-items: center; }
/* 縁に白いにじみが出ないよう、丸く切り抜いて 1.02 倍にする */
.profile__media { max-width: 260px; aspect-ratio: 1; margin-inline: auto; overflow: hidden; border-radius: 50%; }
.profile__media img { display: block; width: 100%; scale: 1.02; }
.profile__body .section-title { margin-bottom: 20px; }
.profile__facts { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 16px; }
.profile__facts div { display: grid; grid-template-columns: 160px 1fr; gap: 16px; font-size: 14px; }
.profile__facts dt { color: var(--fg-2); }
.profile__facts dd { margin: 0; }
.profile__skills .ph { display: inline-block; } /* 項目の途中で折り返さない */
.profile__values { display: grid; gap: 4px; padding-left: 1.2em; list-style: disc; }
@media (max-width: 1024px) { .profile__grid { grid-template-columns: 1fr; gap: 32px; } .profile__media { max-width: 240px; margin-inline: 0; } }
@media (max-width: 768px) {
  .profile__facts div { grid-template-columns: 1fr; gap: 4px; }
  /* スマホは 見出し→似顔絵→本文 の順に並べ替える */
  .profile__grid { gap: 0; }
  .profile__body { display: contents; }
  .profile__body > * { order: 4; }
  .profile__body > .eyebrow { order: 1; }
  .profile__body > .section-title { order: 2; margin-bottom: 24px; }
  .profile__media { order: 3; width: 100%; max-width: 160px; margin: 0 auto 28px; }
}

/* ===== FAQ ===== */
.faq-list { max-width: 880px; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { list-style: none; cursor: pointer; padding: 22px 48px 22px 0; font-weight: 700; font-size: 17px; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-family: var(--font-en); font-size: 24px; font-weight: 400; color: var(--fg-2); transition: transform .25s ease; }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item__body { padding: 0 0 24px; max-width: 44em; color: var(--fg-2); }

/* ===== CONTACT ===== */
/* 青緑の地でも読めるよう補助色を濃く、入力欄の枠は 3:1 以上に */
.contact { background: #c5e8e7; --fg-2: #4A4A4A; --line: rgba(0, 0, 0, .45); }
:root[data-theme="black"] .contact { background: #12302f; --fg-2: #B5B5B5; --line: rgba(255, 255, 255, .35); }
.contact__grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.field { display: grid; gap: 6px; grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 700; }
.req { font-size: 11px; color: var(--danger); margin-left: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--accent); }
.field__error { margin: 0; font-size: 12px; color: var(--danger); min-height: 1em; }
.field__note { grid-column: 1 / -1; font-size: 12px; }
#contact-submit { grid-column: 1 / -1; justify-self: start; }
.contact-form__status { grid-column: 1 / -1; font-size: 14px; margin: 0; }
@media (max-width: 1024px) { .contact__grid { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 768px) { .contact-form { grid-template-columns: 1fr; } }

/* ===== HEADINGS（色の帯ワイプ） ===== */
/* .hd-* の要素は JS が見出しを包んで足す */
.hd-mask { display: block; }
.hd-ln { display: inline-block; position: relative; }
.hd-tx { display: inline-block; }
.hd-band { position: absolute; left: -.06em; right: -.06em; top: .04em; bottom: -.02em; background: var(--c, var(--p1)); transform: scaleX(0); pointer-events: none; }
.hero__ja .hd-band { top: .12em; bottom: .08em; }
@keyframes hd-sweep {
  0% { transform: scaleX(0); transform-origin: 0 50%; animation-timing-function: cubic-bezier(.7, 0, .3, 1); }
  46% { transform: scaleX(1); transform-origin: 0 50%; }
  46.1% { transform: scaleX(1); transform-origin: 100% 50%; animation-timing-function: cubic-bezier(.7, 0, .3, 1); }
  100% { transform: scaleX(0); transform-origin: 100% 50%; }
}
@keyframes hd-reveal {
  0%, 46.1% { clip-path: inset(-.5em 100% -.5em -.2em); animation-timing-function: cubic-bezier(.7, 0, .3, 1); }
  100% { clip-path: inset(-.5em -.2em -.5em -.2em); }
}
@keyframes hd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hd-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes hd-show { from { visibility: hidden; } to { visibility: visible; } }
/* FV：包む前の文字を隠す。JS が失敗しても 1.5 秒後には表示する */
@media (prefers-reduced-motion: no-preference) {
  html.js .hero:not(.hd-go):not(.hd-done) .hero__title,
  html.js .hero:not(.hd-go):not(.hd-done) .hero__cta { animation: hd-show 0s 1.5s both; }
}
.hero.hd-go .hd-band { animation: hd-sweep .62s both; animation-delay: calc(var(--n) * 100ms); }
.hero.hd-go .hd-tx { animation: hd-reveal .62s both; animation-delay: calc(var(--n) * 100ms); }
.hero.hd-go .hero__cta { animation: hd-up .45s cubic-bezier(.2, .8, .2, 1) .45s both; }
/* 各セクションの見出し：画面に入るまで最初の一コマで止める */
.hd-armed .eyebrow { animation: hd-fade .5s ease both; }
.hd-armed .hd-band { animation: hd-sweep .9s .05s both; }
.hd-armed .hd-tx { animation: hd-reveal .9s .05s both; }
.hd-armed .section-title__ja { display: inline-block; animation: hd-up .6s cubic-bezier(.2, .8, .2, 1) .5s both; }
.hd-armed .lead { animation: hd-up .6s cubic-bezier(.2, .8, .2, 1) .62s both; }
.hd-armed:not(.is-in) *, .hd-armed:not(.is-in) *::before, .hd-armed:not(.is-in) *::after { animation-play-state: paused !important; }

/* ===== 区切り線（白地が続く 実績例・進め方・料金目安 の間） ===== */
.process, .price { border-top: 1px solid var(--line); }

/* ===== TO TOP ===== */
/* 同じ色の面に重なっても丸の輪郭が分かるよう、地の色の縁を付ける */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 40; display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%; background: var(--fg); color: var(--bg);
  border: 1px solid var(--bg); box-shadow: 0 6px 20px rgba(0, 0, 0, .18); text-decoration: none;
  font: 700 20px/1 var(--font-en); transition: opacity .25s, transform .25s, visibility 0s linear 0s;
}
.to-top:hover { transform: translateY(-3px); }
.to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.to-top.is-armed:not(.is-shown) { opacity: 0; transform: translateY(12px); visibility: hidden; pointer-events: none; transition: opacity .25s, transform .25s, visibility 0s linear .25s; }
@media (max-width: 768px) { .to-top { right: 16px; bottom: 16px; width: 46px; height: 46px; } }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
