const { useState, useEffect } = React;

const useReveal = () => {
  useEffect(() => {
    const els = document.querySelectorAll('.reveal');
    const io = new IntersectionObserver((entries) => entries.forEach((e) => {
      if (e.isIntersecting) { e.target.classList.add('in'); io.unobserve(e.target); }
    }), { threshold: 0.12 });
    els.forEach(el => io.observe(el));
    return () => io.disconnect();
  }, []);
};

// ============ NAV ============
const Nav = ({ scrolled, isMobile, menuOpen, setMenuOpen, current }) => {
  const links = [
    ['HOME', '#top'], ['SERVICE', '#service'],
    ['MISSION', '#mission'], ['VISION', '#vision'],
    ['VALUES', '#values'], ['RESULTS', '#results'], ['COMPANY', '#company'],
  ];
  return (
    <>
      <nav style={{
        position: 'fixed', top: 0, left: 0, right: 0, zIndex: 100,
        padding: isMobile ? '12px 20px' : (scrolled ? '12px 32px' : '18px 40px'),
        transition: 'all 0.35s ease',
        background: scrolled || (isMobile && menuOpen) ? 'rgba(255,255,255,0.92)' : 'transparent',
        backdropFilter: scrolled ? 'blur(14px) saturate(140%)' : 'none',
        borderBottom: scrolled ? '1px solid var(--line)' : '1px solid transparent',
        display: 'flex', alignItems: 'center', justifyContent: 'space-between',
      }}>
        <a href="#top" onClick={() => setMenuOpen(false)}
          style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
          <img src="assets/hayabusa_logo_transparent.png?v=6" alt="HAYABUSA Inc."
            style={{ height: isMobile ? 28 : 36 }} />
          <span style={{
            fontFamily: 'var(--font-en)', fontSize: isMobile ? 16 : 22,
            letterSpacing: '0.16em', color: 'var(--ink)', lineHeight: 1, fontWeight: 700,
          }}>HAYABUSA Inc.</span>
        </a>
        {isMobile ? (
          <button onClick={() => setMenuOpen(!menuOpen)}
            style={{ width: 32, height: 32, display: 'flex', flexDirection: 'column', justifyContent: 'center', gap: 5 }} aria-label="Menu">
            <span style={{ width: 22, height: 2, background: 'var(--ink)', transition: 'transform 0.3s', transform: menuOpen ? 'rotate(45deg) translate(5px, 5px)' : 'none' }} />
            <span style={{ width: 22, height: 2, background: 'var(--ink)', opacity: menuOpen ? 0 : 1, transition: 'opacity 0.3s' }} />
            <span style={{ width: 22, height: 2, background: 'var(--ink)', transition: 'transform 0.3s', transform: menuOpen ? 'rotate(-45deg) translate(5px, -5px)' : 'none' }} />
          </button>
        ) : (
          <div style={{ display: 'flex', gap: 26, alignItems: 'center' }}>
            {links.map(([label, href]) => {
              const isActive = current === href;
              return (
                <a key={label} href={href} style={{
                  fontFamily: 'var(--font-en)', fontSize: 13, letterSpacing: '0.22em',
                  color: isActive ? 'var(--blue)' : 'var(--ink-2)',
                  fontWeight: isActive ? 700 : 500,
                  padding: '6px 0', position: 'relative', transition: 'color 0.2s',
                }}
                  onMouseEnter={e => { if (!isActive) e.currentTarget.style.color = 'var(--blue)'; }}
                  onMouseLeave={e => { if (!isActive) e.currentTarget.style.color = 'var(--ink-2)'; }}>
                  {label}
                  {isActive && <span style={{ position: 'absolute', left: 0, right: 0, bottom: -4, height: 2, background: 'var(--blue)' }} />}
                </a>
              );
            })}
            <a href="#contact" style={{
              fontFamily: 'var(--font-en)', fontSize: 13, letterSpacing: '0.22em',
              padding: '10px 22px', border: '1.5px solid var(--blue)', color: 'var(--blue)',
              borderRadius: 999, transition: 'all 0.3s', marginLeft: 6,
              display: 'inline-flex', gap: 8, alignItems: 'center', fontWeight: 700,
            }}
              onMouseEnter={e => { e.currentTarget.style.background = 'var(--blue)'; e.currentTarget.style.color = 'var(--white)'; }}
              onMouseLeave={e => { e.currentTarget.style.background = 'transparent'; e.currentTarget.style.color = 'var(--blue)'; }}
            >CONTACT <span>→</span></a>
          </div>
        )}
      </nav>
      {isMobile && menuOpen && (
        <div style={{
          position: 'fixed', top: 56, left: 0, right: 0, bottom: 0, zIndex: 99,
          background: 'var(--white)', padding: '32px 28px',
          display: 'flex', flexDirection: 'column', gap: 4,
        }}>
          {links.map(([label, href]) => (
            <a key={label} href={href} onClick={() => setMenuOpen(false)} style={{
              padding: '20px 4px', fontFamily: 'var(--font-en)', fontSize: 26,
              letterSpacing: '0.18em', borderBottom: '1px solid var(--line)',
            }}>{label}</a>
          ))}
          <a href="#contact" onClick={() => setMenuOpen(false)} style={{
            marginTop: 28, padding: 18, background: 'var(--blue)', color: 'var(--white)',
            textAlign: 'center', fontFamily: 'var(--font-en)', fontSize: 14,
            letterSpacing: '0.22em', borderRadius: 999,
          }}>CONTACT US →</a>
        </div>
      )}
    </>
  );
};

// ============ HERO ============
const Hero = ({ isMobile }) => (
  <section id="top" style={{
    minHeight: '100vh', position: 'relative', overflow: 'hidden',
    paddingTop: isMobile ? 100 : 120, paddingBottom: 60,
    display: 'flex', alignItems: 'center',
    background: 'linear-gradient(180deg, #FFFFFF 0%, #E8F1FA 100%)',
  }}>
    <div style={{
      position: 'absolute', inset: 0, zIndex: 0,
      backgroundImage: 'url(mockups/bg_01_hero.png)',
      backgroundSize: 'cover', backgroundPosition: 'center right',
    }} />
    <div aria-hidden="true" style={{
      position: 'absolute', zIndex: 2, pointerEvents: 'none',
      top: '50%', right: isMobile ? '-18%' : '-3%',
      transform: 'translateY(-50%)',
      fontFamily: 'var(--font-jp-serif)',
      fontWeight: 900,
      fontSize: isMobile ? 'clamp(280px, 75vw, 440px)' : 'clamp(560px, 52vw, 880px)',
      lineHeight: 0.85,
      letterSpacing: '-0.04em',
      color: 'rgba(27, 93, 230, 0.05)',
      userSelect: 'none',
      animation: 'fadeIn 1.6s ease 0.4s both',
    }}>隼</div>
    {!isMobile && <CircuitTrace style={{ top: '14%', left: '4%', width: '38%', height: 70 }} variant="a" />}
    {!isMobile && <CircuitTrace style={{ top: '70%', right: '3%', width: '34%', height: 50 }} variant="b" />}
    {!isMobile && <CircuitTrace style={{ top: '32%', right: '8%', width: '20%', height: 40, transform: 'scaleX(-1)' }} variant="b" />}
    <div className="container" style={{ position: 'relative', zIndex: 3 }}>
      <div style={{ maxWidth: isMobile ? '100%' : '64%' }}>
        <h1 className="h-jp-bold" style={{
          fontSize: isMobile ? 'clamp(26px, 7.5vw, 36px)' : 'clamp(36px, 3.6vw, 56px)',
          marginBottom: isMobile ? 24 : 30,
          animation: 'heroSlam 1s cubic-bezier(0.16,1,0.3,1) both',
          lineHeight: 1.5,
          whiteSpace: isMobile ? 'normal' : 'nowrap',
        }}>
          <span style={{ display: 'block' }}>
            <span style={{ fontSize: '1.05em' }}>一度</span>
            <span style={{ fontSize: '0.78em' }}>きりの</span>
            <span style={{ fontSize: '1.05em' }}>人生</span>
            <span style={{ fontSize: '0.78em' }}>に</span>
            <span style={{ fontSize: '0.55em', verticalAlign: '0.1em' }}>、</span>
          </span>
          <span style={{ display: 'block' }}>
            <span style={{ fontSize: '0.92em' }}>本気</span>
            <span style={{ fontSize: '0.7em' }}>で</span>
            <span className="h-blue" style={{ fontSize: '1.12em' }}>羽ばたく</span>
            <span style={{ fontSize: '0.92em' }}>機会</span>
            <span style={{ fontSize: '0.7em' }}>を</span>
            <span style={{ fontSize: '0.55em', verticalAlign: '0.1em' }}>。</span>
          </span>
        </h1>
        <div style={{ marginBottom: 22, animation: 'fadeIn 1.2s ease 0.5s both' }}>
          <p style={{ fontSize: isMobile ? 14 : 16, fontWeight: 500, color: 'var(--ink-2)', marginBottom: 4 }}>株式会社隼 / HAYABUSA Inc.</p>
          <p style={{ fontFamily: 'var(--font-en)', fontSize: isMobile ? 13 : 15, letterSpacing: '0.28em', color: 'var(--blue)', fontWeight: 700 }}>SNS PRODUCTION</p>
        </div>
        <p style={{
          fontSize: isMobile ? 13 : 14, color: 'var(--ink-3)',
          lineHeight: 1.95, marginBottom: 36, maxWidth: 480,
          animation: 'fadeIn 1.2s ease 0.7s both',
        }}>
          株式会社隼は、YouTube・TikTok・LINEを横断する戦略型SNSプロデュースで、あなたの事業を加速させます。
        </p>
        <div style={{ display: 'flex', gap: 12, flexWrap: 'wrap', animation: 'fadeIn 1.2s ease 0.9s both' }}>
          <a href="#contact" style={{
            padding: '14px 28px', background: 'var(--blue)', color: 'var(--white)',
            fontWeight: 700, fontSize: 14, borderRadius: 999,
            display: 'inline-flex', alignItems: 'center', gap: 12,
            boxShadow: '0 10px 26px rgba(27,93,230,0.30)',
            transition: 'all 0.3s',
          }}
            onMouseEnter={e => { e.currentTarget.style.transform = 'translateY(-2px)'; e.currentTarget.style.boxShadow = '0 16px 36px rgba(27,93,230,0.42)'; }}
            onMouseLeave={e => { e.currentTarget.style.transform = 'translateY(0)'; e.currentTarget.style.boxShadow = '0 10px 26px rgba(27,93,230,0.30)'; }}
          >お問い合わせ <span style={{ fontFamily: 'var(--font-en)' }}>→</span></a>
          <a href="#service" style={{
            padding: '14px 28px', background: 'var(--white)', color: 'var(--ink)',
            fontWeight: 700, fontSize: 14, borderRadius: 999,
            border: '1.5px solid var(--ink)',
            display: 'inline-flex', alignItems: 'center', gap: 12,
            transition: 'all 0.3s',
          }}
            onMouseEnter={e => { e.currentTarget.style.background = 'var(--ink)'; e.currentTarget.style.color = 'var(--white)'; }}
            onMouseLeave={e => { e.currentTarget.style.background = 'var(--white)'; e.currentTarget.style.color = 'var(--ink)'; }}
          >事業を見る <span style={{ fontFamily: 'var(--font-en)' }}>→</span></a>
        </div>
      </div>
    </div>
    {!isMobile && (
      <div style={{
        position: 'absolute', bottom: 36, left: '50%', transform: 'translateX(-50%)',
        zIndex: 3, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 6,
      }}>
        <span style={{
          fontFamily: 'var(--font-en)', fontSize: 11, letterSpacing: '0.32em',
          color: 'var(--ink-4)', fontWeight: 700,
        }}>SCROLL ↓</span>
        <div style={{
          width: 1, height: 32, background: 'var(--line)',
          position: 'relative', overflow: 'hidden',
        }}>
          <span style={{
            position: 'absolute', top: 0, left: 0, width: '100%', height: 8,
            background: 'var(--blue)', animation: 'scrollDot 1.6s ease-in-out infinite',
          }} />
        </div>
      </div>
    )}
  </section>
);

// ============ SERVICE ============
const ServiceCard = ({ icon, en, jp, body, delay }) => (
  <div className="reveal" style={{
    background: 'var(--white)', borderRadius: 14,
    padding: '32px 24px',
    boxShadow: '0 4px 20px rgba(14,27,44,0.05), 0 1px 3px rgba(14,27,44,0.04)',
    border: '1px solid var(--line)',
    display: 'flex', flexDirection: 'column', gap: 16,
    transition: 'transform 0.3s, box-shadow 0.3s',
    cursor: 'pointer', transitionDelay: delay, textAlign: 'center',
  }}
    onMouseEnter={e => { e.currentTarget.style.transform = 'translateY(-6px)'; e.currentTarget.style.boxShadow = '0 14px 40px rgba(27,93,230,0.16)'; }}
    onMouseLeave={e => { e.currentTarget.style.transform = 'translateY(0)'; e.currentTarget.style.boxShadow = '0 4px 20px rgba(14,27,44,0.05), 0 1px 3px rgba(14,27,44,0.04)'; }}
  >
    <div style={{ width: 48, height: 48, color: 'var(--blue)', alignSelf: 'center' }}>{icon}</div>
    <div>
      <h3 style={{
        fontFamily: 'var(--font-en-2)', fontSize: 19, fontWeight: 700,
        color: 'var(--ink)', marginBottom: 6, lineHeight: 1.3,
      }}>{en}</h3>
      <p style={{ fontSize: 12, color: 'var(--blue)', fontWeight: 700 }}>{jp}</p>
    </div>
    <p style={{ fontSize: 12, color: 'var(--ink-3)', lineHeight: 1.95, flex: 1 }}>{body}</p>
    <div style={{ color: 'var(--blue)', fontSize: 18, fontFamily: 'var(--font-en)' }}>→</div>
  </div>
);

const IconTarget = () => (
  <svg viewBox="0 0 48 48" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
    <circle cx="24" cy="24" r="18" /><circle cx="24" cy="24" r="11" /><circle cx="24" cy="24" r="3.5" fill="currentColor" />
    <line x1="24" y1="2" x2="24" y2="9" /><line x1="24" y1="39" x2="24" y2="46" />
    <line x1="2" y1="24" x2="9" y2="24" /><line x1="39" y1="24" x2="46" y2="24" />
  </svg>
);
const IconPen = () => (
  <svg viewBox="0 0 48 48" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
    <rect x="8" y="6" width="26" height="36" rx="2" />
    <line x1="14" y1="16" x2="28" y2="16" /><line x1="14" y1="22" x2="28" y2="22" /><line x1="14" y1="28" x2="22" y2="28" />
    <path d="M30 30 L40 20 L36 16 L26 26 L24 32 Z" fill="white" stroke="currentColor" />
  </svg>
);
const IconPlay = () => (
  <svg viewBox="0 0 48 48" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
    <circle cx="24" cy="24" r="20" />
    <polygon points="20,16 20,32 34,24" fill="currentColor" stroke="none" />
  </svg>
);
const IconChat = () => (
  <svg viewBox="0 0 48 48" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
    <path d="M6 10 L30 10 L30 28 L18 28 L12 34 L12 28 L6 28 Z" />
    <path d="M18 18 L42 18 L42 36 L38 36 L32 42 L32 36 L24 36 L24 30" />
    <circle cx="34" cy="27" r="1.5" fill="currentColor" />
    <circle cx="38" cy="27" r="1.5" fill="currentColor" />
  </svg>
);

const Service = ({ isMobile }) => (
  <section id="service" style={{
    padding: isMobile ? '90px 0' : '140px 0', position: 'relative', overflow: 'hidden',
    background: 'linear-gradient(180deg, #E8F1FA 0%, #FFFFFF 50%, #F4F8FD 100%)',
  }}>
    <div style={{
      position: 'absolute', top: 0, right: 0, width: '45%', height: 320,
      backgroundImage: 'url(mockups/bg_05_company.png)',
      backgroundSize: 'cover', backgroundPosition: 'right top',
      opacity: 0.5, zIndex: 0, pointerEvents: 'none',
    }} />
    {!isMobile && (
      <div style={{
        position: 'absolute', top: 24, left: 32, zIndex: 2,
        display: 'flex', alignItems: 'center', gap: 10,
      }}>
        <img src="assets/hayabusa_logo_transparent.png?v=6" alt="" style={{ height: 30 }} />
        <span style={{ fontFamily: 'var(--font-en)', fontSize: 18, letterSpacing: '0.16em', color: 'var(--ink)', fontWeight: 700 }}>HAYABUSA Inc.</span>
      </div>
    )}
    <div className="container" style={{ position: 'relative', zIndex: 3, paddingTop: 40 }}>
      <div className="reveal" style={{ marginBottom: 56 }}>
        <span className="label-line">SERVICE</span>
        <h2 className="h-en-display" style={{
          fontSize: isMobile ? 'clamp(60px, 16vw, 100px)' : 'clamp(120px, 12vw, 160px)',
          marginBottom: 16,
        }}>SERVICE</h2>
        <p style={{ fontSize: isMobile ? 14 : 16, color: 'var(--ink-3)' }}>SNSの力で、ブランドと人をつなぐ。</p>
      </div>
      <div style={{
        display: 'grid',
        gridTemplateColumns: isMobile ? '1fr' : 'repeat(4, 1fr)',
        gap: 18,
      }}>
        <ServiceCard icon={<IconTarget />} en="SNS Strategy" jp="SNS戦略設計" delay="0.05s"
          body="データ分析と戦略設計で、成果直結するSNS戦略を構築します。" />
        <ServiceCard icon={<IconPen />} en="Creative Production" jp="クリエイティブ制作" delay="0.15s"
          body="ファンの心を動かす、クリエイティブの企画と制作力を発揮します。" />
        <ServiceCard icon={<IconPlay />} en="Video / Short-form Content" jp="動画 / ショートコンテンツ制作" delay="0.25s"
          body="短尺動画を中心に、拡散力のあるコンテンツを制作します。" />
        <ServiceCard icon={<IconChat />} en="Brand Communication" jp="ブランドコミュニケーション" delay="0.35s"
          body="ファンとの接点を生み、ブランド価値を最大化します。" />
      </div>
    </div>
  </section>
);

// ============ MISSION + VISION ============
const MissionVision = ({ isMobile }) => (
  <section style={{
    padding: isMobile ? '90px 0' : '140px 0', position: 'relative', overflow: 'hidden',
    background: 'linear-gradient(180deg, #F4F8FD 0%, #FFFFFF 100%)',
  }}>
    {!isMobile && (
      <div style={{
        position: 'absolute', top: 0, right: 0, width: '40%', height: 280,
        backgroundImage: 'url(mockups/bg_03_vision_mission.png)',
        backgroundSize: 'cover', backgroundPosition: 'top right',
        opacity: 0.6, zIndex: 0, pointerEvents: 'none',
      }} />
    )}
    <div className="container" style={{ position: 'relative', zIndex: 3 }}>
      <div style={{
        display: 'grid', gridTemplateColumns: isMobile ? '1fr' : '1fr 1fr',
        gap: isMobile ? 70 : 80, alignItems: 'start', position: 'relative',
      }}>
        {!isMobile && (
          <div aria-hidden="true" style={{
            position: 'absolute', left: '50%', top: -20, bottom: -20,
            width: 1, background: 'var(--blue-light)', opacity: 0.4,
            transform: 'translateX(-0.5px)',
          }}>
            <span style={{
              position: 'absolute', top: 0, left: '50%', transform: 'translateX(-50%)',
              width: 8, height: 8, borderRadius: 999, background: 'var(--blue)',
            }} />
            <span style={{
              position: 'absolute', bottom: 0, left: '50%', transform: 'translateX(-50%)',
              width: 8, height: 8, borderRadius: 999, background: 'var(--blue)',
            }} />
          </div>
        )}

        {/* MISSION */}
        <div id="mission" className="reveal">
          <span className="label-line">MISSION</span>
          <h2 className="h-jp-bold" style={{
            fontSize: isMobile ? 'clamp(22px, 5.6vw, 30px)' : 'clamp(34px, 3.6vw, 52px)',
            marginBottom: 18, lineHeight: isMobile ? 1.45 : 1.18,
          }}>
            <span style={{ display: 'block' }}>
              <span style={{ fontSize: '1.05em' }}>一度</span>
              <span style={{ fontSize: '0.78em' }}>きりの</span>
              <span style={{ fontSize: '1.05em' }}>人生</span>
              <span style={{ fontSize: '0.78em' }}>に</span>
              <span style={{ fontSize: '0.55em', verticalAlign: '0.1em' }}>、</span>
            </span>
            <span style={{ display: 'block' }}>
              <span style={{ fontSize: '0.92em' }}>本気</span>
              <span style={{ fontSize: '0.7em' }}>で</span>
              <span className="h-blue" style={{ fontSize: '1.12em' }}>羽ばたく</span>
            </span>
            <span style={{ display: 'block' }}>
              <span style={{ fontSize: '1.05em' }}>機会</span>
              <span style={{ fontSize: '0.7em' }}>を</span>
              <span style={{ fontSize: '0.55em', verticalAlign: '0.1em' }}>。</span>
            </span>
          </h2>
          <div style={{ height: 3, width: 80, background: 'var(--blue)', marginBottom: 22 }} />
          <p style={{ fontSize: isMobile ? 13 : 14, color: 'var(--ink-3)', lineHeight: 2 }}>
            株式会社隼は、YouTube・TikTok・LINEを横断する戦略型SNSプロデュースで、挑戦するすべての人の事業を加速させます。
          </p>
        </div>

        {/* VISION */}
        <div id="vision" className="reveal" style={{ transitionDelay: '0.15s' }}>
          <span className="label-line">VISION</span>
          <h2 className="h-jp-bold" style={{
            fontSize: isMobile ? 'clamp(22px, 5.6vw, 30px)' : 'clamp(34px, 3.6vw, 52px)',
            marginBottom: 18, lineHeight: isMobile ? 1.45 : 1.18,
          }}>
            <span style={{ display: 'block' }}>
              <span style={{ fontSize: '1.05em' }}>誰</span>
              <span style={{ fontSize: '0.78em' }}>もが</span>
              <span style={{ fontSize: '0.55em', verticalAlign: '0.1em' }}>、</span>
            </span>
            <span style={{ display: 'block' }}>
              <span style={{ fontSize: '0.92em' }}>本気</span>
              <span style={{ fontSize: '0.7em' }}>で</span>
              <span className="h-blue" style={{ fontSize: '1.12em' }}>羽ばたける</span>
            </span>
            <span style={{ display: 'block' }}>
              <span style={{ fontSize: '1.05em' }}>場所</span>
              <span style={{ fontSize: '0.78em' }}>であり</span>
              <span style={{ fontSize: '1.0em' }}>続ける</span>
              <span style={{ fontSize: '0.55em', verticalAlign: '0.1em' }}>。</span>
            </span>
          </h2>
          <div style={{ height: 3, width: 80, background: 'var(--blue)', marginBottom: 22 }} />
          <p style={{ fontSize: isMobile ? 13 : 14, color: 'var(--ink-3)', lineHeight: 2 }}>
            関わるすべての人が、本気を出せる環境を。隼という場所そのものが、人を羽ばたかせる存在であり続けます。
          </p>
        </div>
      </div>
    </div>
  </section>
);

// ============ VALUES ============
const ValueRow = ({ num, en, jpHtml, body, delay, isMobile }) => {
  const [hover, setHover] = useState(false);
  return (
    <div className="reveal"
      onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)}
      style={{
        display: 'grid',
        gridTemplateColumns: isMobile ? '1fr' : '110px 240px 1fr 1.4fr',
        gap: isMobile ? 12 : 32,
        padding: isMobile ? '28px 8px' : '36px 16px',
        borderTop: '1px solid var(--line)',
        alignItems: 'center',
        transition: 'transform 0.35s ease',
        transform: hover ? 'translateX(6px)' : 'translateX(0)',
        transitionDelay: delay,
      }}>
      {/* Number - skewed Bebas */}
      <div style={{
        fontFamily: 'var(--font-en)', fontWeight: 700,
        fontSize: isMobile ? 56 : 86, lineHeight: 1,
        color: hover ? 'var(--blue)' : 'rgba(91,163,212,0.45)',
        transition: 'color 0.35s ease', letterSpacing: '0.02em',
        transform: 'skewX(-10deg)', transformOrigin: 'center',
      }}>{num}</div>
      {/* English title - italic + skew for speed */}
      <div style={{
        fontFamily: 'var(--font-en)', fontWeight: 700,
        fontSize: isMobile ? 24 : 34, color: 'var(--ink)',
        letterSpacing: '0.02em', lineHeight: 1,
        fontStyle: 'italic',
        transform: 'skewX(-10deg)', transformOrigin: 'left center',
        whiteSpace: 'nowrap',
        paddingRight: '0.4em',
      }}>{en}</div>
      {/* Japanese subtitle with blue underlined keywords */}
      <div style={{
        fontFamily: 'var(--font-jp-serif)', fontWeight: 900,
        fontSize: isMobile ? 16 : 19, color: 'var(--ink-2)',
        letterSpacing: '-0.01em', lineHeight: 1.5,
      }} dangerouslySetInnerHTML={{ __html: jpHtml }} />
      {/* Body */}
      <div style={{
        fontSize: isMobile ? 12 : 13, lineHeight: 1.95, color: 'var(--ink-3)',
      }}>{body}</div>
    </div>
  );
};

const SpeedLines = ({ style, density = 'med', angle = -8 }) => {
  const lines = density === 'high' ? 14 : density === 'low' ? 6 : 9;
  const arr = Array.from({ length: lines });
  return (
    <div aria-hidden="true" style={{
      position: 'absolute', pointerEvents: 'none', overflow: 'hidden',
      transform: `rotate(${angle}deg)`, transformOrigin: 'center',
      ...style,
    }}>
      {arr.map((_, i) => {
        const top = (i / lines) * 100;
        const opacity = 0.08 + Math.random() * 0.10;
        const width = 40 + Math.random() * 55;
        const offset = Math.random() * 30;
        const thickness = i % 3 === 0 ? 1.4 : 0.8;
        return (
          <div key={i} style={{
            position: 'absolute',
            top: `${top}%`, left: `${offset}%`,
            width: `${width}%`, height: thickness,
            background: `linear-gradient(90deg, transparent 0%, rgba(27,93,230,${opacity}) 30%, rgba(91,163,212,${opacity * 1.2}) 70%, transparent 100%)`,
          }} />
        );
      })}
    </div>
  );
};

const CircuitTrace = ({ style, variant = 'a' }) => {
  const paths = {
    a: (
      <g stroke="#1B5DE6" strokeWidth="1" fill="none" strokeLinecap="round">
        <path d="M0 30 L80 30 L100 18 L200 18 L220 30 L340 30 L360 14 L500 14 L520 24 L640 24" />
        <path d="M0 56 L60 56 L80 44 L180 44 L200 56 L300 56" strokeOpacity="0.6" />
        <circle cx="80" cy="30" r="2.4" fill="#1B5DE6" />
        <circle cx="220" cy="30" r="2.4" fill="#1B5DE6" />
        <circle cx="360" cy="14" r="2.4" fill="#1B5DE6" />
        <circle cx="520" cy="24" r="2.4" fill="#1B5DE6" />
        <circle cx="640" cy="24" r="3" fill="#fff" stroke="#1B5DE6" strokeWidth="1.5" />
        <circle cx="200" cy="56" r="2.2" fill="#1B5DE6" opacity="0.6" />
      </g>
    ),
    b: (
      <g stroke="#1B5DE6" strokeWidth="1" fill="none" strokeLinecap="round" opacity="0.5">
        <path d="M0 20 L120 20 L140 8 L260 8 L280 20 L420 20" />
        <circle cx="140" cy="8" r="2" fill="#1B5DE6" />
        <circle cx="280" cy="20" r="2" fill="#1B5DE6" />
        <circle cx="420" cy="20" r="2.6" fill="#fff" stroke="#1B5DE6" strokeWidth="1.4" />
      </g>
    ),
  };
  return (
    <svg className="circuit-trace" style={style} viewBox="0 0 640 70" preserveAspectRatio="none" aria-hidden="true">
      {paths[variant]}
    </svg>
  );
};

const Values = ({ isMobile }) => (
  <section id="values" style={{
    padding: isMobile ? '90px 0' : '140px 0', position: 'relative', overflow: 'hidden',
  }}>
    {!isMobile && (
      <>
        <span aria-hidden="true" className="mega-en" style={{
          right: '-3%', top: '14%',
          fontSize: 'clamp(280px, 30vw, 460px)',
        }}>VALUES</span>
        <CircuitTrace style={{ top: 40, left: '32%', width: '46%', height: 70 }} variant="a" />
        <CircuitTrace style={{ top: 110, right: '4%', width: '28%', height: 50 }} variant="b" />
        <CircuitTrace style={{ bottom: 80, left: '6%', width: '24%', height: 40, transform: 'scaleX(-1)' }} variant="b" />
        <div style={{
          position: 'absolute', right: 0, bottom: 0, width: '50%', height: 280,
          backgroundImage: 'url(mockups/bg_05_company.png)',
          backgroundSize: 'cover', backgroundPosition: 'right bottom',
          opacity: 0.4, zIndex: 1, pointerEvents: 'none',
        }} />
      </>
    )}
    <div className="container" style={{ position: 'relative', zIndex: 3 }}>
      <div className="reveal" style={{ marginBottom: 48 }}>
        <span className="label-line">VALUES</span>
        <h2 className="h-jp-bold" style={{
          fontSize: isMobile ? 'clamp(26px, 6.2vw, 34px)' : 'clamp(40px, 4.4vw, 64px)',
          marginBottom: 14, lineHeight: isMobile ? 1.5 : 1.18,
        }}>
          <span style={{ fontSize: '1.05em' }}>行動</span>
          <span style={{ fontSize: '0.9em' }}>指針</span>
          <span style={{ color: 'var(--blue)', fontSize: '0.7em', margin: '0 0.15em' }}>─</span>
          <span className="h-blue">
            <span style={{ fontSize: '1.0em' }}>三つ</span>
            <span style={{ fontSize: '0.78em' }}>の</span>
            <span style={{ fontSize: '1.1em' }}>原則</span>
          </span>
        </h2>
        <p style={{ fontSize: isMobile ? 14 : 15, color: 'var(--ink-3)' }}>私たちが大切にする3つの原則。</p>
      </div>
      <div>
        <ValueRow num="01" en="OWN IT"
          jpHtml='自分の人生に、<span class="h-blue">責任</span>を持つ。'
          delay="0.05s" isMobile={isMobile}
          body="他人任せにしない。指示待ちにしない。自分の役割は自分で決める。相談する前に、まず考える。" />
        <ValueRow num="02" en="SPEED IS RESPECT"
          jpHtml='速さは、<span class="h-blue">誠意</span>である。'
          delay="0.15s" isMobile={isMobile}
          body='判断・連携・実行のスピードこそ信頼の源泉。「明日やる」は、機会損失の言い換えである。' />
        <ValueRow num="03" en="KEEP THE VIBE UP"
          jpHtml='場のエネルギーを、<span class="h-blue">上げ続ける</span>。'
          delay="0.25s" isMobile={isMobile}
          body="機嫌の管理は、リーダーの規律である。自分の機嫌は、自分で整える。" />
      </div>
      <div className="reveal" style={{
        marginTop: 48, paddingTop: 32, borderTop: '3px solid var(--ink)',
      }}>
        <p style={{
          fontFamily: 'var(--font-jp-serif)', fontWeight: 900, fontStyle: 'italic',
          fontSize: isMobile ? 15 : 22, lineHeight: isMobile ? 1.9 : 1.85,
          color: 'var(--ink)', letterSpacing: '-0.01em', textAlign: 'center',
        }}>
          {isMobile ? (
            <>
              <span style={{ display: 'block' }}>自分の人生は自分で背負う。</span>
              <span style={{ display: 'block' }}>だから、誰よりも速く動く。</span>
              <span style={{ display: 'block' }}>場のエネルギーは自分が作る。</span>
            </>
          ) : (
            <>
              <span style={{ display: 'inline-block' }}>自分の人生は自分で背負う。</span>
              <span style={{ color: 'var(--blue)', margin: '0 12px', fontStyle: 'normal' }}>／</span>
              <span style={{ display: 'inline-block' }}>だから、誰よりも速く動く。</span>
              <span style={{ color: 'var(--blue)', margin: '0 12px', fontStyle: 'normal' }}>／</span>
              <span style={{ display: 'inline-block' }}>場のエネルギーは自分が作る。</span>
            </>
          )}
        </p>
      </div>
    </div>
  </section>
);

// ============ ENTERTAINMENT (COMING SOON) ============
const Entertainment = ({ isMobile }) => (
  <section id="entertainment" style={{
    position: 'relative',
    padding: isMobile ? '90px 0' : '140px 0',
    background: 'linear-gradient(180deg, #FFFFFF 0%, #E8F1FA 60%, #DCE9F6 100%)',
    overflow: 'hidden',
  }}>
    <div aria-hidden="true" style={{
      position: 'absolute', top: '50%', right: '-4%',
      transform: 'translateY(-50%)',
      fontFamily: 'var(--font-jp-serif)', fontWeight: 900,
      fontSize: isMobile ? 'clamp(280px, 80vw, 460px)' : 'clamp(480px, 44vw, 760px)',
      lineHeight: 0.85, letterSpacing: '-0.04em',
      color: 'rgba(27, 93, 230, 0.05)',
      userSelect: 'none', pointerEvents: 'none',
    }}>隼</div>
    <div aria-hidden="true" style={{
      position: 'absolute', inset: 0,
      backgroundImage: 'linear-gradient(rgba(27,93,230,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(27,93,230,0.04) 1px, transparent 1px)',
      backgroundSize: '64px 64px', pointerEvents: 'none',
    }} />
    <div className="container" style={{ position: 'relative', zIndex: 2 }}>
      <div className="reveal" style={{ maxWidth: isMobile ? '100%' : '78%' }}>
        <div style={{
          fontFamily: 'var(--font-en)', fontSize: isMobile ? 'clamp(80px, 22vw, 130px)' : 'clamp(140px, 16vw, 240px)',
          fontWeight: 700, lineHeight: 0.85,
          color: 'rgba(27, 93, 230, 0.10)',
          letterSpacing: '0.01em',
          marginBottom: isMobile ? -20 : -40,
        }}>ENTERTAINMENT</div>
        <div className="label-line" style={{ marginTop: 0 }}>COMING SOON</div>
        <h2 className="h-en-display" style={{
          fontSize: isMobile ? 'clamp(48px, 13vw, 88px)' : 'clamp(96px, 11vw, 168px)',
          fontStyle: 'italic',
          letterSpacing: '0.005em',
          marginBottom: 28,
          color: 'var(--ink)',
        }}>ENTERTAINMENT</h2>
        <div style={{
          width: isMobile ? 80 : 120, height: 3, background: 'var(--blue)',
          marginBottom: 30,
        }} />
        <h3 className="h-jp-bold" style={{
          fontSize: isMobile ? 'clamp(20px, 5vw, 26px)' : 'clamp(28px, 2.6vw, 40px)',
          marginBottom: 22, lineHeight: isMobile ? 1.55 : 1.4,
        }}>
          <span style={{ fontSize: '1.05em' }}>アイドル</span>
          <span style={{ fontSize: '0.7em' }}>・</span>
          <span style={{ fontSize: '1.05em' }}>タレント</span>
          <span style={{ fontSize: '0.7em' }}>・</span>
          <span style={{ fontSize: '0.95em' }}>エンタメ</span>
          <span style={{ fontSize: '0.85em' }}>コンテンツ</span>
          <span style={{ fontSize: '1.0em' }}>事業</span>
          <span style={{ fontSize: '0.55em', verticalAlign: '0.1em' }}>、</span>
          <span className="h-blue" style={{ fontSize: '1.15em' }}>始動</span>
          <span style={{ fontSize: '0.55em', verticalAlign: '0.1em' }}>。</span>
        </h3>
        <p style={{
          fontSize: isMobile ? 14 : 16, color: 'var(--ink-3)',
          lineHeight: 1.95, maxWidth: 620,
        }}>
          SNSで培った影響力と熱量を、次のステージへ。
        </p>
      </div>
    </div>
  </section>
);

// ============ RESULTS ============
const ResultCard = ({ tag, channel, headline, sub, points, chart, delay }) => (
  <div className="reveal" style={{
    background: 'var(--white)', borderRadius: 14,
    padding: '32px 28px',
    boxShadow: '0 6px 28px rgba(14,27,44,0.06), 0 1px 3px rgba(14,27,44,0.04)',
    border: '1px solid var(--line)',
    display: 'flex', flexDirection: 'column', gap: 18,
    transitionDelay: delay,
  }}>
    <div style={{
      display: 'flex', justifyContent: 'space-between', alignItems: 'baseline',
    }}>
      <span style={{
        fontFamily: 'var(--font-en)', fontSize: 12, letterSpacing: '0.22em',
        color: 'var(--ink-3)', fontWeight: 700,
      }}>{tag}</span>
      <span style={{ fontSize: 12, color: 'var(--ink-4)' }}>{channel}</span>
    </div>
    <div style={{
      fontFamily: 'var(--font-jp-serif)', fontWeight: 900,
      fontSize: 30, color: 'var(--blue)', letterSpacing: '-0.01em', lineHeight: 1.2,
    }} dangerouslySetInnerHTML={{ __html: headline }} />
    <div style={{
      fontSize: 14, color: 'var(--ink-2)', fontWeight: 700, marginTop: -6,
    }}>{sub}</div>
    <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 6 }}>
      {points.map((p, i) => (
        <li key={i} style={{
          fontSize: 13, color: 'var(--ink-3)', display: 'flex', gap: 8, alignItems: 'flex-start',
        }}>
          <span style={{ color: 'var(--blue)', fontWeight: 700 }}>●</span>
          <span>{p}</span>
        </li>
      ))}
    </ul>
    <div style={{ marginTop: 'auto' }}>{chart}</div>
  </div>
);

// Chart 1: Before / After Growth Bar
const ChartGrowth = ({ before, after, beforeLabel, afterLabel }) => {
  const beforePct = 5;
  const afterPct = 100;
  return (
    <div style={{ display: 'flex', alignItems: 'center', gap: 12, paddingTop: 8 }}>
      <div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: 6 }}>
        <div style={{
          height: 14, background: 'var(--line)', borderRadius: 999,
          position: 'relative', overflow: 'hidden',
        }}>
          <span style={{
            position: 'absolute', left: 0, top: 0, height: '100%',
            width: beforePct + '%',
            background: 'var(--ink-5)', borderRadius: 999,
          }} />
        </div>
        <div style={{ display: 'flex', justifyContent: 'space-between' }}>
          <span style={{ fontSize: 11, color: 'var(--ink-4)' }}>開始</span>
          <span style={{ fontSize: 11, color: 'var(--ink-2)', fontWeight: 700 }}>{beforeLabel}</span>
        </div>
      </div>
      <span style={{ color: 'var(--blue)', fontSize: 18 }}>→</span>
      <div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: 6 }}>
        <div style={{
          height: 14, background: 'var(--line)', borderRadius: 999,
          position: 'relative', overflow: 'hidden',
        }}>
          <span style={{
            position: 'absolute', left: 0, top: 0, height: '100%',
            width: afterPct + '%',
            background: 'linear-gradient(90deg, #5BA3D4, #1B5DE6)', borderRadius: 999,
          }} />
        </div>
        <div style={{ display: 'flex', justifyContent: 'space-between' }}>
          <span style={{ fontSize: 11, color: 'var(--ink-4)' }}>1年後</span>
          <span style={{ fontSize: 11, color: 'var(--blue)', fontWeight: 700 }}>{afterLabel}</span>
        </div>
      </div>
    </div>
  );
};

// Chart 2: Progression dots / steps
const ChartProgression = ({ steps, finalLabel, footnote }) => (
  <div style={{ paddingTop: 8 }}>
    <div style={{ display: 'flex', alignItems: 'center', gap: 6, justifyContent: 'space-between' }}>
      {steps.map((s, i) => (
        <React.Fragment key={i}>
          <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4 }}>
            <span style={{
              width: 10, height: 10, borderRadius: 999,
              background: s.active ? 'var(--blue)' : 'var(--line-strong)',
            }} />
            <span style={{
              fontSize: 10, fontWeight: s.active ? 700 : 400,
              color: s.active ? 'var(--blue)' : 'var(--ink-4)',
            }}>{s.label}</span>
          </div>
          {i < steps.length - 1 && (
            <span style={{
              flex: 1, height: 1, background: i < steps.findIndex(x => x.active && x === steps[steps.length - 1])
                ? 'var(--blue)' : 'var(--line)',
              borderTop: '1px dashed var(--line-strong)', borderTopColor: 'var(--line-strong)',
            }} />
          )}
        </React.Fragment>
      ))}
    </div>
    <div style={{
      display: 'flex', justifyContent: 'space-between', marginTop: 14,
      fontSize: 11, color: 'var(--ink-4)',
    }}>
      <span>{footnote}</span>
      <span style={{ color: 'var(--blue)', fontWeight: 700 }}>{finalLabel}</span>
    </div>
  </div>
);

// Chart 3: Top 5 vertical bars
const ChartTop5 = ({ values }) => {
  const max = Math.max(...values.map(v => v.num));
  return (
    <div style={{ paddingTop: 8 }}>
      <div style={{
        display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 6,
        alignItems: 'flex-end', height: 100,
      }}>
        {values.map((v, i) => (
          <div key={i} style={{
            display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4,
            height: '100%', justifyContent: 'flex-end',
          }}>
            <div style={{
              width: '100%', height: ((v.num / max) * 80) + '%',
              background: i === 0 ? 'var(--blue)' : 'rgba(27,93,230,0.20 + ' + (0.5 - i * 0.08) + ')',
              borderRadius: 4,
              backgroundColor: i === 0 ? 'var(--blue)'
                : i === 1 ? 'rgba(27,93,230,0.45)'
                : i === 2 ? 'rgba(27,93,230,0.32)'
                : i === 3 ? 'rgba(27,93,230,0.22)'
                : 'rgba(27,93,230,0.14)',
            }} />
            <span style={{
              fontSize: 11, fontWeight: 700,
              color: i === 0 ? 'var(--blue)' : 'var(--ink-3)',
            }}>{v.label}</span>
          </div>
        ))}
      </div>
      <div style={{
        marginTop: 10, display: 'flex', justifyContent: 'space-between',
        fontSize: 10, color: 'var(--ink-4)', letterSpacing: '0.06em',
      }}>
        <span>バズ動画トップ5</span>
        <span style={{ fontFamily: 'var(--font-en)', fontWeight: 700 }}>TOTAL HITS</span>
      </div>
    </div>
  );
};

const Results = ({ isMobile }) => (
  <section id="results" style={{
    padding: isMobile ? '90px 0' : '140px 0', position: 'relative', overflow: 'hidden',
    background: 'linear-gradient(180deg, #FFFFFF 0%, #F4F8FD 100%)',
  }}>
    <div style={{
      position: 'absolute', top: 0, right: 0, width: '50%', height: 360,
      backgroundImage: 'url(mockups/bg_05_company.png)',
      backgroundSize: 'cover', backgroundPosition: 'right top',
      opacity: 0.45, zIndex: 0, pointerEvents: 'none',
    }} />
    <div className="container" style={{ position: 'relative', zIndex: 3 }}>
      <div className="reveal" style={{ marginBottom: 56 }}>
        <span className="label-line">RESULTS</span>
        <h2 className="h-jp-bold" style={{
          fontSize: isMobile ? 'clamp(26px, 6.4vw, 36px)' : 'clamp(48px, 5.4vw, 84px)',
          marginBottom: 14, lineHeight: isMobile ? 1.5 : 1.2,
        }}>
          <span style={{ fontSize: '1.05em' }}>数字</span>
          <span style={{ fontSize: '0.7em' }}>が</span>
          <span style={{ fontSize: '0.55em', verticalAlign: '0.1em' }}>、</span>
          <span className="h-blue" style={{ fontSize: '1.15em' }}>実力</span>
          <span style={{ fontSize: '0.7em' }}>を</span>
          <span style={{ fontSize: '1.0em' }}>証明</span>
          <span style={{ fontSize: '0.78em' }}>する</span>
          <span style={{ fontSize: '0.55em', verticalAlign: '0.1em' }}>。</span>
        </h2>
      </div>
      <div style={{
        display: 'grid', gridTemplateColumns: isMobile ? '1fr' : 'repeat(2, 1fr)',
        gap: 22,
      }}>
        <ResultCard
          tag="YOUTUBE" channel="資産運用チャンネル"
          headline='500人  <span style="color:var(--ink-4)">→</span>  32,000人'
          sub="登録者数 64倍成長（1年間）"
          points={['月20〜30件のアポイント獲得', '最高30万回再生']}
          chart={<ChartGrowth beforeLabel="500人" afterLabel="32,000人" />}
          delay="0.05s"
        />
        <ResultCard
          tag="YOUTUBE" channel="保険営業チャンネル"
          headline="最短6ヶ月"
          sub="YouTube収益化達成（23本）"
          points={['保険営業という高難度ジャンル', '短期での収益化を実現']}
          chart={<ChartProgression
            steps={[
              { label: '1本', active: true },
              { label: '5本', active: true },
              { label: '10本', active: true },
              { label: '15本', active: true },
              { label: '20本', active: true },
              { label: '23本', active: true },
            ]}
            finalLabel="23本達成！"
            footnote="月1〜本ペースで投稿"
          />}
          delay="0.15s"
        />
        <ResultCard
          tag="YOUTUBE" channel="医療キャリア支援チャンネル"
          headline="月5件"
          sub="月間面談実施数を確立（1年半）"
          points={['看護師向けキャリア支援チャンネル', 'YouTube → LINE → 相談の導線設計']}
          chart={<ChartGrowth beforeLabel="月0〜1件" afterLabel="月5件" />}
          delay="0.25s"
        />
        <ResultCard
          tag="TIKTOK / INSTAGRAM" channel="ヘルスケア店舗アカウント"
          headline="最高763万回再生"
          sub="累計再生回数（2年間）"
          points={['100万回超バズ動画 5本以上', 'ローカルビジネスSNS成功モデル']}
          chart={<ChartTop5 values={[
            { num: 763, label: '763万' },
            { num: 312, label: '312万' },
            { num: 245, label: '245万' },
            { num: 196, label: '196万' },
            { num: 145, label: '145万' },
          ]} />}
          delay="0.35s"
        />
      </div>
    </div>
  </section>
);

// ============ COMPANY ============
const Company = ({ isMobile }) => (
  <section id="company" style={{
    padding: isMobile ? '90px 0' : '140px 0', position: 'relative', overflow: 'hidden',
    background: 'linear-gradient(180deg, #FFFFFF 0%, #F4F8FD 100%)',
  }}>
    <div style={{
      position: 'absolute', right: 0, top: 0, bottom: 0, width: '55%',
      backgroundImage: 'url(mockups/bg_05_company.png)',
      backgroundSize: 'cover', backgroundPosition: 'center right',
      opacity: 0.7, zIndex: 0, pointerEvents: 'none',
    }} />
    <div className="container" style={{ position: 'relative', zIndex: 3 }}>
      <div className="reveal" style={{ marginBottom: 32 }}>
        <span className="label-line">COMPANY</span>
        <h2 className="h-en-display" style={{
          fontSize: isMobile ? 'clamp(60px, 16vw, 100px)' : 'clamp(120px, 12vw, 160px)',
          marginBottom: 12,
        }}>COMPANY</h2>
        <p style={{ fontSize: isMobile ? 14 : 16, color: 'var(--ink-3)' }}>会社情報</p>
      </div>
      <div className="reveal" style={{
        maxWidth: 720,
        background: 'rgba(255,255,255,0.7)', backdropFilter: 'blur(8px)',
        borderRadius: 12, padding: isMobile ? '24px 16px' : '8px',
      }}>
        {[
          ['会社名', '株式会社隼（HAYABUSA Inc.）'],
          ['代表取締役', '副島 大典 / 岩下 和也'],
          ['設立', '2026年4月'],
          ['所在地', '福岡県福岡市'],
          ['資本金', '100万円'],
          ['事業内容', 'SNSプロデュース事業 / エンタテインメント事業（準備中）'],
        ].map(([k, v], i, arr) => (
          <div key={k} style={{
            display: 'grid',
            gridTemplateColumns: isMobile ? '92px 1fr' : '160px 1fr',
            padding: isMobile ? '12px 8px' : '18px 24px',
            borderBottom: i < arr.length - 1 ? '1px solid var(--line)' : 'none',
            alignItems: 'baseline',
          }}>
            <span style={{
              fontFamily: 'var(--font-jp)', fontSize: isMobile ? 12 : 13,
              color: 'var(--ink-2)', fontWeight: 700, letterSpacing: '0.05em',
            }}>{k}</span>
            <span style={{
              fontFamily: 'var(--font-jp)', fontSize: isMobile ? 13 : 15,
              color: 'var(--ink)', fontWeight: 500,
            }}>{v}</span>
          </div>
        ))}
      </div>
    </div>
  </section>
);

// ============ CONTACT FORM ============
const CONTACT_EMAIL = 'contact@hayabusa-inc.com';
const ContactForm = ({ isMobile }) => {
  const [form, setForm] = useState({ name: '', company: '', email: '', subject: '一般お問い合わせ', message: '' });
  const update = (k) => (e) => setForm({ ...form, [k]: e.target.value });
  const onSubmit = (e) => {
    e.preventDefault();
    const subject = `【お問い合わせ】${form.subject}${form.company ? ` / ${form.company}` : ''}`;
    const body = [
      `お名前: ${form.name}`,
      `会社名: ${form.company}`,
      `メール: ${form.email}`,
      `お問い合わせ種別: ${form.subject}`,
      ``,
      `--- ご相談内容 ---`,
      form.message,
    ].join('\n');
    window.location.href = `mailto:${CONTACT_EMAIL}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
  };
  const inputStyle = {
    width: '100%', padding: '14px 16px', fontSize: 14,
    fontFamily: 'inherit', color: 'var(--ink)',
    background: 'rgba(255,255,255,0.92)',
    border: '1px solid var(--line)', borderRadius: 10,
    transition: 'border-color 0.2s, box-shadow 0.2s',
    outline: 'none',
  };
  const labelStyle = {
    display: 'block', textAlign: 'left',
    fontSize: 12, fontWeight: 700, color: 'var(--ink-2)',
    marginBottom: 6, letterSpacing: '0.05em',
  };
  const onFocus = (e) => { e.currentTarget.style.borderColor = 'var(--blue)'; e.currentTarget.style.boxShadow = '0 0 0 3px rgba(27,93,230,0.12)'; };
  const onBlur = (e) => { e.currentTarget.style.borderColor = 'var(--line)'; e.currentTarget.style.boxShadow = 'none'; };
  return (
    <form onSubmit={onSubmit} style={{
      maxWidth: 640, margin: '0 auto', textAlign: 'left',
      display: 'grid', gap: 16,
    }}>
      <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : '1fr 1fr', gap: 16 }}>
        <div>
          <label style={labelStyle}>お名前 <span style={{ color: 'var(--blue)' }}>*</span></label>
          <input required type="text" value={form.name} onChange={update('name')} style={inputStyle} onFocus={onFocus} onBlur={onBlur} placeholder="山田 太郎" />
        </div>
        <div>
          <label style={labelStyle}>会社名</label>
          <input type="text" value={form.company} onChange={update('company')} style={inputStyle} onFocus={onFocus} onBlur={onBlur} placeholder="株式会社○○" />
        </div>
      </div>
      <div>
        <label style={labelStyle}>メールアドレス <span style={{ color: 'var(--blue)' }}>*</span></label>
        <input required type="email" value={form.email} onChange={update('email')} style={inputStyle} onFocus={onFocus} onBlur={onBlur} placeholder="example@hayabusa-inc.com" />
      </div>
      <div>
        <label style={labelStyle}>お問い合わせ種別</label>
        <select value={form.subject} onChange={update('subject')} style={{ ...inputStyle, appearance: 'none', backgroundImage: 'linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%)', backgroundPosition: 'calc(100% - 20px) 50%, calc(100% - 14px) 50%', backgroundSize: '6px 6px, 6px 6px', backgroundRepeat: 'no-repeat' }} onFocus={onFocus} onBlur={onBlur}>
          <option>一般お問い合わせ</option>
          <option>SNSプロデュースのご相談</option>
          <option>YouTube運用のご相談</option>
          <option>TikTok運用のご相談</option>
          <option>LINE構築のご相談</option>
          <option>採用・パートナーシップ</option>
          <option>取材・メディアの方</option>
          <option>その他</option>
        </select>
      </div>
      <div>
        <label style={labelStyle}>ご相談内容 <span style={{ color: 'var(--blue)' }}>*</span></label>
        <textarea required value={form.message} onChange={update('message')} rows={5} style={{ ...inputStyle, resize: 'vertical', minHeight: 120 }} onFocus={onFocus} onBlur={onBlur} placeholder="お気軽にご記入ください" />
      </div>
      <button type="button" disabled style={{
        marginTop: 8, padding: '18px 40px',
        background: 'var(--ink-4)', color: 'var(--white)',
        fontWeight: 700, fontSize: 15, borderRadius: 999,
        boxShadow: '0 8px 20px rgba(14,27,44,0.18)',
        cursor: 'not-allowed', opacity: 0.85,
        fontFamily: 'var(--font-en)', letterSpacing: '0.18em',
      }}>COMING SOON</button>
      <p style={{ fontSize: 11, color: 'var(--ink-4)', textAlign: 'center', marginTop: 4 }}>
        お問い合わせフォームは現在準備中です。近日中に公開予定です。
      </p>
    </form>
  );
};

// ============ PRIVACY POLICY MODAL ============
const PrivacyModal = ({ open, onClose }) => {
  useEffect(() => {
    if (open) {
      document.body.style.overflow = 'hidden';
      const onKey = (e) => { if (e.key === 'Escape') onClose(); };
      window.addEventListener('keydown', onKey);
      return () => {
        document.body.style.overflow = '';
        window.removeEventListener('keydown', onKey);
      };
    }
  }, [open, onClose]);
  if (!open) return null;
  const sectionStyle = { marginBottom: 22 };
  const h3Style = { fontSize: 15, fontWeight: 700, color: 'var(--ink)', marginBottom: 8 };
  const pStyle = { fontSize: 13, color: 'var(--ink-3)', lineHeight: 1.85 };
  return (
    <div role="dialog" aria-modal="true" aria-labelledby="privacy-title"
      onClick={onClose}
      style={{
        position: 'fixed', inset: 0, zIndex: 9999,
        background: 'rgba(14,27,44,0.55)',
        backdropFilter: 'blur(4px)',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        padding: 20, animation: 'fadeIn 0.2s ease',
      }}>
      <div onClick={(e) => e.stopPropagation()} style={{
        background: 'var(--white)', borderRadius: 14,
        maxWidth: 720, width: '100%', maxHeight: '85vh',
        overflowY: 'auto', position: 'relative',
        boxShadow: '0 32px 80px rgba(14,27,44,0.30)',
      }}>
        <div style={{
          position: 'sticky', top: 0, background: 'var(--white)',
          padding: '24px 28px 16px', borderBottom: '1px solid var(--line)',
          display: 'flex', justifyContent: 'space-between', alignItems: 'center',
        }}>
          <h2 id="privacy-title" style={{
            fontFamily: 'var(--font-jp)', fontSize: 18, fontWeight: 700, color: 'var(--ink)',
          }}>プライバシーポリシー</h2>
          <button onClick={onClose} aria-label="閉じる" style={{
            width: 32, height: 32, borderRadius: 999,
            background: 'var(--blue-soft)', color: 'var(--ink-2)',
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            fontSize: 16, fontWeight: 700,
          }}>×</button>
        </div>
        <div style={{ padding: '20px 28px 28px' }}>
          <p style={{ ...pStyle, marginBottom: 22 }}>
            株式会社隼（以下「当社」といいます）は、お客様の個人情報の取扱いについて、以下のとおりプライバシーポリシーを定めます。
          </p>
          <div style={sectionStyle}>
            <h3 style={h3Style}>1. 収集する情報</h3>
            <p style={pStyle}>
              当社は、お問い合わせフォーム等を通じて、お名前、会社名、メールアドレス、お問い合わせ内容等の情報を取得することがあります。
            </p>
          </div>
          <div style={sectionStyle}>
            <h3 style={h3Style}>2. 利用目的</h3>
            <p style={pStyle}>
              取得した個人情報は、お問い合わせへの回答、サービスのご案内、契約の履行、その他正当な業務遂行のために利用します。
            </p>
          </div>
          <div style={sectionStyle}>
            <h3 style={h3Style}>3. 第三者提供</h3>
            <p style={pStyle}>
              法令に基づく場合またはお客様の同意がある場合を除き、個人情報を第三者に提供することはありません。
            </p>
          </div>
          <div style={sectionStyle}>
            <h3 style={h3Style}>4. 安全管理</h3>
            <p style={pStyle}>
              個人情報の漏えい・滅失・毀損を防止するため、適切な安全管理措置を講じます。
            </p>
          </div>
          <div style={sectionStyle}>
            <h3 style={h3Style}>5. 開示・訂正・削除</h3>
            <p style={pStyle}>
              ご本人からの個人情報の開示、訂正、削除等のご請求があった場合、合理的な範囲で速やかに対応します。
            </p>
          </div>
          <div style={sectionStyle}>
            <h3 style={h3Style}>6. お問い合わせ窓口</h3>
            <p style={pStyle}>
              本ポリシーに関するお問い合わせは、当社お問い合わせフォームよりご連絡ください。
            </p>
          </div>
          <div style={sectionStyle}>
            <h3 style={h3Style}>7. 改定</h3>
            <p style={pStyle}>
              本ポリシーの内容は、必要に応じて改定する場合があります。改定後の内容は本サイトに掲載した時点で効力を生じます。
            </p>
          </div>
          <p style={{ ...pStyle, marginTop: 22, color: 'var(--ink-4)', fontSize: 12 }}>
            制定日: 2026年4月<br />
            株式会社隼（HAYABUSA Inc.）
          </p>
        </div>
      </div>
    </div>
  );
};

// ============ CONTACT + FOOTER (combined like mockup) ============
const ContactFooter = ({ isMobile, onOpenPrivacy }) => (
  <section id="contact" style={{ position: 'relative', overflow: 'hidden' }}>
    <div style={{
      position: 'absolute', inset: 0, zIndex: 0,
      backgroundImage: 'url(mockups/bg_06_contact_footer.png)',
      backgroundSize: 'cover', backgroundPosition: 'center',
    }} />
    <div className="container" style={{
      position: 'relative', zIndex: 2,
      padding: isMobile ? '70px 20px 32px' : '100px 32px 48px',
    }}>
      {/* Top: Brand + SNS */}
      <div style={{
        display: 'grid', gridTemplateColumns: isMobile ? '1fr' : '1fr auto',
        gap: 24, marginBottom: isMobile ? 56 : 80, alignItems: 'center',
      }}>
        <div>
          <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 8 }}>
            <img src="assets/hayabusa_logo_transparent.png?v=6" alt="HAYABUSA" style={{ height: 40 }} />
            <span style={{
              fontFamily: 'var(--font-en)', fontSize: 24, letterSpacing: '0.18em',
              color: 'var(--ink)', lineHeight: 1, fontWeight: 700,
            }}>HAYABUSA Inc.</span>
          </div>
          <p style={{ fontFamily: 'var(--font-en)', fontSize: 12, letterSpacing: '0.28em', color: 'var(--blue)', fontWeight: 700 }}>SNS PRODUCTION</p>
        </div>
        <div style={{ display: 'flex', gap: 12, justifyContent: isMobile ? 'flex-start' : 'flex-end' }}>
          {[['Instagram', 'IG'], ['X', 'X'], ['YouTube', 'YT'], ['TikTok', 'TT']].map(([name, label]) => (
            <a key={name} href="#" aria-label={name} style={{
              width: 38, height: 38, borderRadius: 999,
              border: '1px solid var(--line-strong)',
              display: 'flex', alignItems: 'center', justifyContent: 'center',
              color: 'var(--ink-3)', fontSize: 11, fontWeight: 700,
              transition: 'all 0.2s',
            }}
              onMouseEnter={e => { e.currentTarget.style.background = 'var(--blue)'; e.currentTarget.style.color = 'var(--white)'; e.currentTarget.style.borderColor = 'var(--blue)'; }}
              onMouseLeave={e => { e.currentTarget.style.background = 'transparent'; e.currentTarget.style.color = 'var(--ink-3)'; e.currentTarget.style.borderColor = 'var(--line-strong)'; }}
            >{label}</a>
          ))}
        </div>
      </div>

      {/* Middle: CTA + Form */}
      <div className="reveal" style={{ textAlign: 'center', marginBottom: isMobile ? 48 : 80 }}>
        <h2 className="h-jp-bold" style={{
          fontSize: isMobile ? 'clamp(24px, 6vw, 32px)' : 'clamp(40px, 4.4vw, 64px)',
          marginBottom: 18,
        }}>
          <span style={{ fontSize: '1.05em' }}>共</span>
          <span style={{ fontSize: '0.78em' }}>に</span>
          <span style={{ fontSize: '0.55em', verticalAlign: '0.1em' }}>、</span>
          <span className="h-blue">
            <span style={{ fontSize: '1.0em' }}>本気</span>
            <span style={{ fontSize: '0.7em' }}>で</span>
            <span style={{ fontSize: '1.15em' }}>羽ばたく</span>
          </span>
          <span style={{ fontSize: '0.55em', verticalAlign: '0.1em' }}>。</span>
        </h2>
        <p style={{
          fontSize: isMobile ? 13 : 15, color: 'var(--ink-3)',
          marginBottom: 32, lineHeight: 1.95,
        }}>
          ご相談・ご質問・お見積りなど、お気軽にお問い合わせください。
        </p>
        <ContactForm isMobile={isMobile} />
      </div>

      {/* Bottom: Legal + copyright */}
      <div style={{
        display: 'flex', justifyContent: 'space-between',
        alignItems: 'center', paddingTop: 24,
        borderTop: '1px solid var(--line)',
        flexDirection: isMobile ? 'column' : 'row', gap: 12,
      }}>
        <div style={{ display: 'flex', gap: 16, fontSize: 12, color: 'var(--ink-4)' }}>
          <button type="button" onClick={onOpenPrivacy}
            onMouseEnter={e => e.currentTarget.style.color = 'var(--blue)'}
            onMouseLeave={e => e.currentTarget.style.color = 'var(--ink-4)'}
            style={{ fontSize: 12, color: 'var(--ink-4)', cursor: 'pointer', padding: 0 }}>
            プライバシーポリシー
          </button>
        </div>
        <p style={{ fontSize: 11, color: 'var(--ink-5)', letterSpacing: '0.04em' }}>
          © {new Date().getFullYear()} HAYABUSA Inc. All Rights Reserved.
        </p>
      </div>
    </div>
  </section>
);

// ============ APP ============
const App = () => {
  const [scrolled, setScrolled] = useState(false);
  const [isMobile, setIsMobile] = useState(false);
  const [menuOpen, setMenuOpen] = useState(false);
  const [current, setCurrent] = useState('#top');
  const [privacyOpen, setPrivacyOpen] = useState(false);
  useReveal();

  useEffect(() => {
    const checkMobile = () => setIsMobile(window.innerWidth < 820);
    const onScroll = () => {
      setScrolled(window.scrollY > 40);
      const sections = ['top', 'service', 'mission', 'vision', 'values', 'results', 'company', 'contact'];
      const offset = 200;
      let active = '#top';
      for (const id of sections) {
        const el = document.getElementById(id);
        if (el && el.getBoundingClientRect().top <= offset) active = '#' + id;
      }
      setCurrent(active);
    };
    checkMobile();
    onScroll();
    window.addEventListener('resize', checkMobile);
    window.addEventListener('scroll', onScroll, { passive: true });
    return () => {
      window.removeEventListener('resize', checkMobile);
      window.removeEventListener('scroll', onScroll);
    };
  }, []);

  return (
    <>
      <Nav scrolled={scrolled} isMobile={isMobile} menuOpen={menuOpen} setMenuOpen={setMenuOpen} current={current} />
      <Hero isMobile={isMobile} />
      <Service isMobile={isMobile} />
      <MissionVision isMobile={isMobile} />
      <Values isMobile={isMobile} />
      {/* <Entertainment isMobile={isMobile} /> */}
      <Results isMobile={isMobile} />
      <Company isMobile={isMobile} />
      <ContactFooter isMobile={isMobile} onOpenPrivacy={() => setPrivacyOpen(true)} />
      <PrivacyModal open={privacyOpen} onClose={() => setPrivacyOpen(false)} />
    </>
  );
};

ReactDOM.createRoot(document.getElementById('root')).render(<App />);
