// Top page sections for kashinoya

const { useState, useEffect, useRef } = React;

// ============ Split Hero (Tech × Touch) ============
function SplitHero() {
  const [hovered, setHovered] = useState(null); // 'tech' | 'touch' | null
  const [isWide, setIsWide] = useState(window.innerWidth >= 980);
  useEffect(() => {
    const onResize = () => setIsWide(window.innerWidth >= 980);
    window.addEventListener("resize", onResize);
    return () => window.removeEventListener("resize", onResize);
  }, []);

  // Use flex-grow instead of explicit widths so flex: 1 1 0 works
  const techFlex = !isWide ? "1 1 100%" : hovered === "tech" ? "1.16 1 0" : hovered === "touch" ? "0.84 1 0" : "1 1 0";
  const touchFlex = !isWide ? "1 1 100%" : hovered === "touch" ? "1.16 1 0" : hovered === "tech" ? "0.84 1 0" : "1 1 0";

  return (
    <section className="split-hero" data-screen-label="01 Hero">
      {/* SVG clip-path definitions — used to curve the touch (right) side's left edge */}
      <svg className="sh-clip-defs" aria-hidden="true">
        <defs>
          <clipPath id="sh-curve-clip" clipPathUnits="objectBoundingBox">
            {/* Two gentle waves — smaller amplitude so content has more room */}
            <path d="M 0.06 0
                     C 0.12 0.20, -0.02 0.40, 0.06 0.50
                     C 0.14 0.60, 0.00 0.80, 0.06 1
                     L 1 1 L 1 0 Z" />
          </clipPath>
        </defs>
      </svg>
      <div
        className={`sh-side sh-tech ${hovered === "tech" ? "is-hover" : ""} ${hovered === "touch" ? "is-dim" : ""}`}
        style={{ flex: techFlex }}
        onMouseEnter={() => setHovered("tech")}
        onMouseLeave={() => setHovered(null)}
      >
        <div className="sh-tech-grid" />
        <div className="sh-tech-glow" />
        <div className="sh-tech-orb sh-tech-orb-1" />
        <div className="sh-tech-orb sh-tech-orb-2" />
        <div className="sh-content sh-content-left">
          <div className="sh-eyebrow sh-eyebrow-tech">
            <span className="sh-eb-dot" />
            <svg width="14" height="14" viewBox="0 0 24 24" fill="none">
              <path d="M12 3l2 5 5 2-5 2-2 5-2-5-5-2 5-2zM19 15l1 2 2 1-2 1-1 2-1-2-2-1 2-1z" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round" />
            </svg>
            <span>AI &amp; DX SOLUTIONS</span>
          </div>
          <h1 className="sh-title">
            テクノロジーで、<br />
            <span className="sh-title-grad">組織の限界を<br />突破する。</span>
          </h1>
          <p className="sh-desc">
            生成AI導入コンサルティングから、IT・DXシステムの開発・実装まで。
            最先端の技術で、企業の生産性を劇的に向上させます。
          </p>
          <div className="sh-actions">
            <a href="#ai" className="sh-btn sh-btn-tech">
              <svg width="18" height="18" viewBox="0 0 24 24" fill="none">
                <rect x="4" y="6" width="16" height="14" rx="2" stroke="currentColor" strokeWidth="1.6"/>
                <circle cx="9" cy="13" r="1.5" fill="currentColor"/>
                <circle cx="15" cy="13" r="1.5" fill="currentColor"/>
                <path d="M12 6V3M9 3h6" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
              </svg>
              AI導入コンサルティング
              <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
                <path d="M3 7h8M7 3l4 4-4 4" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/>
              </svg>
            </a>
            <a href="#dx" className="sh-btn sh-btn-tech-ghost">
              <svg width="18" height="18" viewBox="0 0 24 24" fill="none">
                <rect x="4" y="4" width="16" height="16" rx="2" stroke="currentColor" strokeWidth="1.6"/>
                <rect x="9" y="9" width="6" height="6" stroke="currentColor" strokeWidth="1.6"/>
                <path d="M9 1v3M15 1v3M9 20v3M15 20v3M1 9h3M1 15h3M20 9h3M20 15h3" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
              </svg>
              IT・DX支援について
            </a>
          </div>
          <div className="sh-tech-bottom">
            <div className="shtb-stat">
              <div className="shtb-num">200<span>+</span></div>
              <div className="shtb-lbl">AI/DX導入支援</div>
            </div>
            <div className="shtb-stat">
              <div className="shtb-num">85<span>%</span></div>
              <div className="shtb-lbl">業務効率改善</div>
            </div>
          </div>
        </div>
      </div>

      <div
        className={`sh-side sh-touch ${hovered === "touch" ? "is-hover" : ""} ${hovered === "tech" ? "is-dim" : ""}`}
        style={{ flex: touchFlex }}
        onMouseEnter={() => setHovered("touch")}
        onMouseLeave={() => setHovered(null)}
      >
        <div className="sh-touch-blob" />
        <div className="sh-touch-blob sh-touch-blob-2" />
        <div className="sh-content sh-content-right">
          <div className="sh-eyebrow sh-eyebrow-touch">
            <svg width="14" height="14" viewBox="0 0 24 24" fill="none">
              <path d="M9 11l-2 9 5-3 5 3-2-9M12 3l3 6 6 1-4 4 1 6-6-3-6 3 1-6-4-4 6-1z" stroke="currentColor" strokeWidth="1.5" strokeLinejoin="round"/>
            </svg>
            <span>PROFESSIONAL SUPPORT</span>
          </div>
          <h2 className="sh-title sh-title-serif">
            プロフェッショナルが、<br/>
            <span className="sh-title-grad-warm">事業の成長を<br/>伴走する。</span>
          </h2>
          <p className="sh-desc sh-desc-touch">
            補助金、経営支援、そして行政との連携。
            「人」による手厚いサポートで、持続可能な成長を実現します。
          </p>
          <div className="sh-pillars">
            <a href="#subsidy" className="shp shp-amber">
              <svg width="22" height="22" viewBox="0 0 24 24" fill="none">
                <rect x="5" y="3" width="14" height="18" rx="2" stroke="currentColor" strokeWidth="1.6"/>
                <path d="M9 8h6M9 12h6M9 16h4" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
              </svg>
              <div className="shp-text">
                <div className="shp-jp">補助金・<br/>資金調達</div>
              </div>
            </a>
            <a href="#biz" className="shp shp-amber">
              <svg width="22" height="22" viewBox="0 0 24 24" fill="none">
                <path d="M3 17l6-6 4 4 8-9" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
                <path d="M14 6h7v7" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
              </svg>
              <div className="shp-text">
                <div className="shp-jp">経営・<br/>ビジネス支援</div>
              </div>
            </a>
            <a href="#gov" className="shp shp-emerald">
              <svg width="22" height="22" viewBox="0 0 24 24" fill="none">
                <path d="M3 21h18M5 21V11M19 21V11M9 21V11M15 21V11M2 11h20L12 3z" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/>
              </svg>
              <div className="shp-text">
                <div className="shp-jp">自治体・<br/>官公庁支援</div>
              </div>
            </a>
          </div>
          <a href="#support" className="sh-btn sh-btn-touch">
            サポート内容を見る
            <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
              <path d="M3 7h8M7 3l4 4-4 4" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/>
            </svg>
          </a>
        </div>
      </div>

      {isWide && (
        <div className="sh-curve-overlay" aria-hidden="true">
          <svg viewBox="0 0 200 1000" preserveAspectRatio="none">
            <defs>
              <linearGradient id="curveStroke" x1="0" y1="0" x2="0" y2="1">
                <stop offset="0%" stopColor="rgba(6,182,212,0.4)"/>
                <stop offset="50%" stopColor="rgba(255,255,255,0.5)"/>
                <stop offset="100%" stopColor="rgba(217,119,6,0.4)"/>
              </linearGradient>
            </defs>
            <path
              d="M 80 0
                 C 160 200, -24 400, 80 500
                 C 184 600, 0 800, 80 1000"
              stroke="url(#curveStroke)" strokeWidth="1.5" fill="none"
            />
          </svg>
        </div>
      )}



      <div className="sh-scroll-cue">
        <span>SCROLL</span>
        <div className="shsc-line" />
      </div>
    </section>
  );
}

// ============ Concept Bridge ============
function ConceptBridge() {
  return (
    <section className="concept" data-screen-label="02 Concept">
      {/* decorative bg */}
      <div className="concept-bg-grid" aria-hidden="true" />
      <div className="concept-bg-blob concept-bg-blob-tech" aria-hidden="true" />
      <div className="concept-bg-blob concept-bg-blob-touch" aria-hidden="true" />

      <div className="concept-inner">
        <div className="concept-eyebrow">
          <span className="line-deco" />
          OUR CONCEPT
          <span className="line-deco" />
        </div>
        <h2 className="concept-title">
          <span className="ct-tech">Tech</span>
          <span className="ct-x" aria-hidden="true">
            <svg viewBox="0 0 60 60" width="56" height="56">
              <defs>
                <linearGradient id="ctxGrad" x1="0" y1="0" x2="1" y2="1">
                  <stop offset="0%" stopColor="#06b6d4"/>
                  <stop offset="100%" stopColor="#d97706"/>
                </linearGradient>
              </defs>
              <circle cx="30" cy="30" r="22" fill="none" stroke="url(#ctxGrad)" strokeWidth="1.2" opacity="0.5"/>
              <circle cx="30" cy="30" r="14" fill="none" stroke="url(#ctxGrad)" strokeWidth="1.2"/>
              <path d="M22 22 L38 38 M38 22 L22 38" stroke="url(#ctxGrad)" strokeWidth="2" strokeLinecap="round"/>
            </svg>
          </span>
          <span className="ct-touch">Touch</span>
        </h2>
        <p className="concept-jp">技術と、人の支援を、ひとつに。</p>
        <p className="concept-lead">
          樫乃屋は、AI・DXの「技術」と、補助金・経営コンサルの「人による支援」、
          その<em>両方</em>を一社で提供できる稀有な存在です。
          技術を導入したいが資金が足りない、補助金を取ったが活用しきれない――
          そんな分断を、シームレスに繋ぎます。
        </p>

        <div className="concept-flow">
          {/* TECH side */}
          <div className="cf-card cf-tech">
            <div className="cf-card-header">
              <div className="cf-icon cf-icon-tech">
                <svg width="26" height="26" viewBox="0 0 24 24" fill="none">
                  <path d="M12 3l2 5 5 2-5 2-2 5-2-5-5-2 5-2z" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round"/>
                </svg>
              </div>
              <div>
                <div className="cf-label">TECH</div>
                <div className="cf-jp">技術</div>
              </div>
            </div>
            <div className="cf-tagline">先端技術で、業務を変える</div>
            <ul className="cf-list">
              <li>
                <span className="cf-li-icon">
                  <svg width="14" height="14" viewBox="0 0 24 24" fill="none">
                    <rect x="4" y="6" width="16" height="14" rx="2" stroke="currentColor" strokeWidth="1.6"/>
                    <circle cx="9" cy="13" r="1.5" fill="currentColor"/>
                    <circle cx="15" cy="13" r="1.5" fill="currentColor"/>
                  </svg>
                </span>
                <span>生成AI導入・プロンプト設計</span>
              </li>
              <li>
                <span className="cf-li-icon">
                  <svg width="14" height="14" viewBox="0 0 24 24" fill="none">
                    <rect x="4" y="4" width="16" height="16" rx="2" stroke="currentColor" strokeWidth="1.6"/>
                    <rect x="9" y="9" width="6" height="6" stroke="currentColor" strokeWidth="1.6"/>
                  </svg>
                </span>
                <span>DXシステム開発・実装</span>
              </li>
              <li>
                <span className="cf-li-icon">
                  <svg width="14" height="14" viewBox="0 0 24 24" fill="none">
                    <path d="M4 12a8 8 0 0 1 16 0M20 12a8 8 0 0 1-16 0" stroke="currentColor" strokeWidth="1.6"/>
                    <path d="M12 8v4l3 2" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
                  </svg>
                </span>
                <span>業務自動化・RPA</span>
              </li>
            </ul>
            <div className="cf-stat">
              <div className="cf-stat-num">200<span>+</span></div>
              <div className="cf-stat-lbl">導入支援実績</div>
            </div>
          </div>

          {/* CENTER fusion */}
          <div className="cf-fusion" aria-hidden="true">
            <div className="cff-rings">
              <div className="cff-ring cff-ring-1" />
              <div className="cff-ring cff-ring-2" />
              <div className="cff-ring cff-ring-3" />
            </div>
            <div className="cff-core">
              <span className="cff-x">×</span>
            </div>
            <svg className="cff-arrow cff-arrow-l" viewBox="0 0 80 24" preserveAspectRatio="none">
              <defs>
                <linearGradient id="arrowL" x1="0" y1="0" x2="1" y2="0">
                  <stop offset="0%" stopColor="#06b6d4" stopOpacity="0.1"/>
                  <stop offset="100%" stopColor="#06b6d4" stopOpacity="0.9"/>
                </linearGradient>
              </defs>
              <path d="M0 12 L70 12 M62 6 L72 12 L62 18" stroke="url(#arrowL)" strokeWidth="1.8" fill="none" strokeLinecap="round" strokeLinejoin="round"/>
            </svg>
            <svg className="cff-arrow cff-arrow-r" viewBox="0 0 80 24" preserveAspectRatio="none">
              <defs>
                <linearGradient id="arrowR" x1="1" y1="0" x2="0" y2="0">
                  <stop offset="0%" stopColor="#d97706" stopOpacity="0.1"/>
                  <stop offset="100%" stopColor="#d97706" stopOpacity="0.9"/>
                </linearGradient>
              </defs>
              <path d="M80 12 L10 12 M18 6 L8 12 L18 18" stroke="url(#arrowR)" strokeWidth="1.8" fill="none" strokeLinecap="round" strokeLinejoin="round"/>
            </svg>
            <div className="cff-label">
              <span className="cff-en">SYNERGY</span>
              <span className="cff-jp">融合</span>
            </div>
          </div>

          {/* TOUCH side */}
          <div className="cf-card cf-touch">
            <div className="cf-card-header">
              <div className="cf-icon cf-icon-touch">
                <svg width="26" height="26" viewBox="0 0 24 24" fill="none">
                  <path d="M9 11l-2 9 5-3 5 3-2-9M12 3l3 6 6 1-4 4 1 6-6-3-6 3 1-6-4-4 6-1z" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round"/>
                </svg>
              </div>
              <div>
                <div className="cf-label">TOUCH</div>
                <div className="cf-jp">支援</div>
              </div>
            </div>
            <div className="cf-tagline">人の力で、事業を伸ばす</div>
            <ul className="cf-list">
              <li>
                <span className="cf-li-icon">
                  <svg width="14" height="14" viewBox="0 0 24 24" fill="none">
                    <rect x="5" y="3" width="14" height="18" rx="2" stroke="currentColor" strokeWidth="1.6"/>
                    <path d="M9 8h6M9 12h6M9 16h4" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
                  </svg>
                </span>
                <span>補助金・資金調達支援</span>
              </li>
              <li>
                <span className="cf-li-icon">
                  <svg width="14" height="14" viewBox="0 0 24 24" fill="none">
                    <path d="M3 17l6-6 4 4 8-9M14 6h7v7" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
                  </svg>
                </span>
                <span>経営戦略・ビジネス支援</span>
              </li>
              <li>
                <span className="cf-li-icon">
                  <svg width="14" height="14" viewBox="0 0 24 24" fill="none">
                    <path d="M3 21h18M5 21V11M19 21V11M9 21V11M15 21V11M2 11h20L12 3z" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round"/>
                  </svg>
                </span>
                <span>自治体・官公庁連携</span>
              </li>
            </ul>
            <div className="cf-stat">
              <div className="cf-stat-num">3.2<span>億円+</span></div>
              <div className="cf-stat-lbl">補助金採択総額</div>
            </div>
          </div>
        </div>

        {/* Outcome row */}
        <div className="concept-outcomes">
          <div className="co-item">
            <div className="co-num">01</div>
            <div className="co-text">
              <div className="co-jp">技術導入のコスト課題を解決</div>
              <div className="co-en">Cost barriers, removed.</div>
            </div>
          </div>
          <div className="co-divider" />
          <div className="co-item">
            <div className="co-num">02</div>
            <div className="co-text">
              <div className="co-jp">補助金を「取って終わり」にしない</div>
              <div className="co-en">Beyond approval — to outcome.</div>
            </div>
          </div>
          <div className="co-divider" />
          <div className="co-item">
            <div className="co-num">03</div>
            <div className="co-text">
              <div className="co-jp">一社完結で、対応スピードが速い</div>
              <div className="co-en">One partner, full velocity.</div>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

// ============ Solutions Detail ============
function SolutionsDetail() {
  return (
    <section className="solutions" id="support" data-screen-label="03 Solutions">
      <div className="solutions-bg-deco" aria-hidden="true">
        <div className="sbd-blob sbd-blob-1" />
        <div className="sbd-blob sbd-blob-2" />
      </div>
      <div className="solutions-inner">
        <div className="sol-head">
          <div className="sol-eyebrow">
            <span className="line-deco" />SOLUTIONS<span className="line-deco" />
          </div>
          <h2 className="sol-title">Total Business Solutions</h2>
          <p className="sol-lead">
            技術（Tech）と支援（Touch）の融合により、
            企業のフェーズに合わせた最適な解決策を提供します。
          </p>
          <div className="sol-stats">
            <div className="sol-stat">
              <div className="sol-stat-num">5<span>領域</span></div>
              <div className="sol-stat-lbl">提供ソリューション</div>
            </div>
            <div className="sol-stat-divider" />
            <div className="sol-stat">
              <div className="sol-stat-num">200<span>+</span></div>
              <div className="sol-stat-lbl">支援実績</div>
            </div>
            <div className="sol-stat-divider" />
            <div className="sol-stat">
              <div className="sol-stat-num">1<span>社で完結</span></div>
              <div className="sol-stat-lbl">ワンストップ</div>
            </div>
          </div>
        </div>

        <div className="sol-grid">
          {/* Tech Column */}
          <div className="sol-col sol-col-tech">
            <div className="sol-col-head">
              <div className="sch-badge sch-badge-tech">
                <div className="sch-icon sch-icon-tech">
                  <svg width="22" height="22" viewBox="0 0 24 24" fill="none">
                    <path d="M12 3l2 5 5 2-5 2-2 5-2-5-5-2 5-2z" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round"/>
                  </svg>
                </div>
                <div>
                  <div className="sch-en">AI &amp; DX Solutions</div>
                  <div className="sch-jp">技術で、業務を変える。</div>
                </div>
              </div>
              <div className="sch-rule sch-rule-tech" />
            </div>
            <SolCard
              theme="cyan"
              num="01"
              icon={
                <svg width="22" height="22" viewBox="0 0 24 24" fill="none">
                  <rect x="4" y="6" width="16" height="14" rx="2" stroke="currentColor" strokeWidth="1.6"/>
                  <circle cx="9" cy="13" r="1.5" fill="currentColor"/>
                  <circle cx="15" cy="13" r="1.5" fill="currentColor"/>
                  <path d="M12 6V3M9 3h6" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
                </svg>
              }
              title="生成AI導入コンサルティング"
              desc="ChatGPT連携、社内bot構築により、問い合わせ対応や資料作成業務を自動化。即効性のある業務効率化を実現します。"
              tags={["ChatGPT連携", "社内bot構築", "プロンプト設計"]}
              metric={{ value: "70%", label: "業務時間削減" }}
            />
            <SolCard
              theme="blue"
              num="02"
              icon={
                <svg width="22" height="22" viewBox="0 0 24 24" fill="none">
                  <rect x="4" y="4" width="16" height="16" rx="2" stroke="currentColor" strokeWidth="1.6"/>
                  <rect x="9" y="9" width="6" height="6" stroke="currentColor" strokeWidth="1.6"/>
                  <path d="M9 1v3M15 1v3M9 20v3M15 20v3M1 9h3M1 15h3M20 9h3M20 15h3" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
                </svg>
              }
              title="IT・DX支援・システム開発"
              desc="業務フローの課題を分析し、最適なITツールの選定やカスタムシステム開発を実施。現場で「使える」DXを推進します。"
              tags={["業務分析", "ツール選定", "カスタム開発"]}
              metric={{ value: "現場導入率", label: "92%" }}
            />
          </div>

          {/* Support Column */}
          <div className="sol-col sol-col-touch">
            <div className="sol-col-head">
              <div className="sch-badge sch-badge-touch">
                <div className="sch-icon sch-icon-touch">
                  <svg width="22" height="22" viewBox="0 0 24 24" fill="none">
                    <path d="M9 11l-2 9 5-3 5 3-2-9M12 3l3 6 6 1-4 4 1 6-6-3-6 3 1-6-4-4 6-1z" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round"/>
                  </svg>
                </div>
                <div>
                  <div className="sch-en">Professional Support</div>
                  <div className="sch-jp">人で、事業を伸ばす。</div>
                </div>
              </div>
              <div className="sch-rule sch-rule-touch" />
            </div>
            <SolCard
              theme="amber"
              num="03"
              icon={
                <svg width="22" height="22" viewBox="0 0 24 24" fill="none">
                  <rect x="5" y="3" width="14" height="18" rx="2" stroke="currentColor" strokeWidth="1.6"/>
                  <path d="M9 8h6M9 12h6M9 16h4" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
                </svg>
              }
              title="補助金・資金調達"
              desc="事業再構築、ものづくり補助金等の申請を支援。単なる代行ではなく、採択後の事業化成功を見据えた計画策定を行います。"
              tags={["採択実績多数", "成果報酬型プランあり"]}
              metric={{ value: "3.2億円+", label: "採択総額" }}
            />
            <SolCard
              theme="amber"
              num="04"
              icon={
                <svg width="22" height="22" viewBox="0 0 24 24" fill="none">
                  <path d="M3 17l6-6 4 4 8-9" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
                  <path d="M14 6h7v7" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
                </svg>
              }
              title="経営・ビジネス支援"
              desc="中小企業診断士による経営診断、マーケティング戦略の立案、販路拡大支援。DX導入とセットで企業の成長を加速させます。"
              tags={["顧問契約対応", "経営革新計画策定"]}
              metric={{ value: "中小企業診断士", label: "在籍" }}
            />
            <SolCard
              theme="emerald"
              num="05"
              icon={
                <svg width="22" height="22" viewBox="0 0 24 24" fill="none">
                  <path d="M3 21h18M5 21V11M19 21V11M9 21V11M15 21V11M2 11h20L12 3z" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/>
                </svg>
              }
              title="自治体・官公庁支援"
              desc="地域企業向けDX支援プロジェクトの受託、行政事務のBPO・効率化支援。技術力のあるパートナーとして地域課題を解決します。"
              tags={["支援施策受託", "専門家派遣"]}
              metric={{ value: "自治体連携", label: "実績多数" }}
            />
          </div>
        </div>
      </div>
    </section>
  );
}

function SolCard({ theme, icon, title, desc, tags, num, metric }) {
  return (
    <a className={`sol-card sol-card-${theme}`} href="#">
      {num && <div className="solc-num">{num}</div>}
      <div className="solc-top">
        <div className="solc-icon">{icon}</div>
        <div className="solc-arrow">
          <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
            <path d="M5 10h10M10 5l5 5-5 5" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/>
          </svg>
        </div>
      </div>
      <h4 className="solc-title">{title}</h4>
      <p className="solc-desc">{desc}</p>
      {metric && (
        <div className="solc-metric">
          <span className="solc-metric-val">{metric.value}</span>
          <span className="solc-metric-lbl">{metric.label}</span>
        </div>
      )}
      <div className="solc-tags">
        {tags.map((t, i) => (
          <span key={i} className="solc-tag">
            <svg width="11" height="11" viewBox="0 0 12 12" fill="none">
              <circle cx="6" cy="6" r="5.5" stroke="currentColor" strokeOpacity="0.5"/>
              <path d="M3.5 6l1.8 1.8L8.5 4.5" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round"/>
            </svg>
            {t}
          </span>
        ))}
      </div>
    </a>
  );
}

// ============ Cross-Sell Section ============
function CrossSell() {
  return (
    <section className="cross-sell" data-screen-label="04 CrossSell">
      <div className="cs-grid-bg" />
      <div className="cs-glow" />
      <div className="cs-inner">
        <div className="cs-left">
          <div className="cs-eyebrow">
            <span className="cs-eb-dot"/> THE KASHINOYA EDGE
          </div>
          <h2 className="cs-title">
            AI導入のコスト課題を、<br/>
            <span className="cs-amber">補助金活用</span>で解決しませんか？
          </h2>
          <p className="cs-lead">
            「技術」と「資金調達」の両方に精通した樫乃屋だからこそできる提案があります。
            IT導入補助金を活用し、実質負担を抑えて AI を導入可能です。
          </p>
          <div className="cs-actions">
            <a href="#contact" className="cs-btn-primary">
              補助金×DX導入について相談する
              <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
                <path d="M3 7h8M7 3l4 4-4 4" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/>
              </svg>
            </a>
            <a href="#" className="cs-btn-ghost">資料ダウンロード</a>
          </div>
        </div>
        <div className="cs-right">
          <div className="synergy-orbit">
            <div className="so-ring so-ring-1" />
            <div className="so-ring so-ring-2" />
            <div className="so-orb so-orb-tech">
              <span className="so-orb-en">TECH</span>
              <span className="so-orb-jp">技術</span>
            </div>
            <div className="so-orb so-orb-touch">
              <span className="so-orb-en">SUPPORT</span>
              <span className="so-orb-jp">支援</span>
            </div>
            <div className="so-center">
              <div className="so-x">×</div>
            </div>
            <div className="so-particle so-particle-1" />
            <div className="so-particle so-particle-2" />
            <div className="so-particle so-particle-3" />
          </div>
        </div>
      </div>
    </section>
  );
}

// ============ Cases ============
function Cases() {
  const cases = [
    {
      tag: "製造業 / 金属加工",
      title: "ものづくり補助金 + AI検査システム導入で不良率を52%削減",
      amount: "1,500",
      subsidy: "ものづくり補助金",
      tech: "AI画像検査",
      kind: 1,
    },
    {
      tag: "卸売業 / 食品",
      title: "ChatGPT社内bot構築で問い合わせ対応工数を月140h削減",
      amount: "450",
      subsidy: "IT導入補助金",
      tech: "生成AI活用",
      kind: 2,
    },
    {
      tag: "自治体 / DX推進",
      title: "市内中小企業向けDX支援プログラムを受託、80社を支援",
      amount: "—",
      subsidy: "自治体委託事業",
      tech: "プロジェクト運営",
      kind: 3,
    },
  ];
  return (
    <section className="cases-sec" id="cases" data-screen-label="05 Cases">
      <div className="cases-inner">
        <div className="cases-head">
          <div>
            <div className="sol-eyebrow" style={{ color: "var(--ink-mute)" }}>CASE STUDIES</div>
            <h2 className="cases-title">
              技術と支援が、<em>結果</em>を生む。
            </h2>
          </div>
          <a href="#" className="link-arrow">
            すべての事例を見る
            <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
              <path d="M3 7h8M7 3l4 4-4 4" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round"/>
            </svg>
          </a>
        </div>
        <div className="cases-grid">
          {cases.map((c, i) => (
            <CaseCard key={i} {...c} />
          ))}
        </div>
      </div>
    </section>
  );
}

function CaseCard({ tag, title, amount, subsidy, tech, kind }) {
  const palettes = {
    1: { bg: "linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0891b2 100%)", accent: "#06b6d4" },
    2: { bg: "linear-gradient(135deg, #1e293b 0%, #334155 50%, #0891b2 100%)", accent: "#22d3ee" },
    3: { bg: "linear-gradient(135deg, #064e3b 0%, #065f46 60%, #047857 100%)", accent: "#34d399" },
  };
  const p = palettes[kind];
  return (
    <a className="case-card" href="#">
      <div className="cc-visual" style={{ background: p.bg }}>
        <div className="cc-visual-grid" />
        <div className="cc-visual-circle" style={{ background: p.accent }} />
        <div className="cc-visual-circle cc-vc-2" style={{ borderColor: p.accent }} />
        <div className="cc-visual-tags">
          <span className="cc-vtag" style={{ background: p.accent }}>{tech}</span>
        </div>
        {amount !== "—" && (
          <div className="cc-amount">
            <div className="cc-am-label">受給額</div>
            <div className="cc-am-value">¥{amount}<span>万円</span></div>
          </div>
        )}
      </div>
      <div className="cc-body">
        <div className="cc-tag">{tag}</div>
        <h3 className="cc-title">{title}</h3>
        <div className="cc-meta">
          <span className="cc-mt-tag">{subsidy}</span>
          <span className="cc-arrow">
            <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
              <path d="M3 7h8M7 3l4 4-4 4" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/>
            </svg>
          </span>
        </div>
      </div>
    </a>
  );
}

// ============ News + Contact CTA ============
function NewsAndCTA() {
  const items = [
    { date: "2026.04.18", tag: "コラム", title: "Geminiで散らばった情報を「A4一枚」にまとめる" },
    { date: "2026.04.02", tag: "補助金", title: "2026年度 IT導入補助金 公募開始のお知らせ" },
    { date: "2026.03.24", tag: "セミナー", title: "中小企業のための生成AI活用入門セミナー報告" },
    { date: "2026.03.10", tag: "お知らせ", title: "横浜市内に新オフィスを開設いたしました" },
  ];
  return (
    <section className="news-cta" data-screen-label="06 News">
      <div className="nc-inner">
        <div className="nc-news">
          <div className="nc-head">
            <div>
              <div className="sol-eyebrow" style={{ color: "var(--ink-mute)" }}>NEWS &amp; INSIGHTS</div>
              <h2 className="nc-title">最新の知見を、お届け。</h2>
            </div>
            <a href="#" className="link-arrow">一覧を見る
              <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
                <path d="M3 7h8M7 3l4 4-4 4" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round"/>
              </svg>
            </a>
          </div>
          <div className="nc-list">
            {items.map((n, i) => (
              <a className="nc-item" key={i} href="#">
                <div className="nci-date">{n.date}</div>
                <div className="nci-tag">{n.tag}</div>
                <div className="nci-title">{n.title}</div>
                <div className="nci-arrow">
                  <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
                    <path d="M3 7h8M7 3l4 4-4 4" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round"/>
                  </svg>
                </div>
              </a>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
}

// ============ Contact Block ============
function ContactBlock() {
  return (
    <section className="contact-sec" id="contact" data-screen-label="07 Contact">
      <div className="contact-card">
        <div className="contact-bg" />
        <div className="contact-grid-bg" />
        <div className="contact-glow" />
        <div className="contact-inner">
          <div className="contact-en">CONTACT</div>
          <h2 className="contact-title">
            まずは、<em>無料相談</em>から。
          </h2>
          <p className="contact-lead">
            技術の話も、補助金の話も、まずは現状をお聞かせください。<br/>
            樫乃屋がフィットするかどうか、一緒に確かめましょう。
          </p>
          <div className="contact-actions">
            <a href="tel:045-000-0000" className="contact-tel">
              <div className="ct-label">電話で相談</div>
              <div className="ct-num">045-000-0000</div>
              <div className="ct-hours">平日 9:00 〜 18:00</div>
            </a>
            <a href="#" className="contact-form-btn">
              フォームから相談する
              <svg width="16" height="16" viewBox="0 0 16 16" fill="none">
                <path d="M3 8h10M8 3l5 5-5 5" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"/>
              </svg>
            </a>
          </div>
          <div className="contact-bullets">
            <span>初回相談無料</span>
            <span className="bullet-sep">·</span>
            <span>守秘義務契約対応</span>
            <span className="bullet-sep">·</span>
            <span>全国オンライン対応</span>
          </div>
        </div>
      </div>
    </section>
  );
}

Object.assign(window, {
  SplitHero, ConceptBridge, SolutionsDetail, CrossSell, Cases, NewsAndCTA, ContactBlock
});
