const { useState, useEffect, useRef } = React;

// ============ NAV ============
const Nav = ({ scrolled, isMobile, menuOpen, setMenuOpen }) => (
  <>
  <nav style={{
    position:'fixed', top: 0, left: 0, right: 0, zIndex: 100,
    padding: isMobile ? '14px 20px' : (scrolled ? '14px 40px' : '22px 40px'),
    transition:'all 0.35s ease',
    background: scrolled || (isMobile && menuOpen) ? 'rgba(255,255,255,0.94)' : 'transparent',
    backdropFilter: scrolled ? 'blur(14px)' : 'none',
    borderBottom: scrolled ? '1px solid var(--line)' : '1px solid transparent',
    display:'flex', alignItems:'center', justifyContent:'space-between'
  }}>
    <a href="#top" onClick={() => setMenuOpen(false)} style={{fontFamily:'var(--font-en)', fontSize: isMobile ? 22 : 30, letterSpacing:'0.14em', color:'var(--ink)', lineHeight: 1}}>HAYABUSA</a>
    {isMobile ? (
      <button onClick={() => setMenuOpen(!menuOpen)} style={{width: 36, height: 36, display:'flex', flexDirection:'column', justifyContent:'center', gap: 6, padding: 0, background:'transparent'}} aria-label="Menu">
        <span style={{width: 24, height: 2, background:'var(--ink)', transition:'transform 0.3s', transform: menuOpen ? 'rotate(45deg) translate(5px, 5px)' : 'none'}} />
        <span style={{width: 24, height: 2, background:'var(--ink)', opacity: menuOpen ? 0 : 1, transition:'opacity 0.3s'}} />
        <span style={{width: 24, height: 2, background:'var(--ink)', transition:'transform 0.3s', transform: menuOpen ? 'rotate(-45deg) translate(5px, -5px)' : 'none'}} />
      </button>
    ) : (
    <div style={{display:'flex', gap: 34, alignItems:'center'}}>
      {[
        {jp:'About', href:'#about'},
        {jp:'Service', href:'#service'},
        {jp:'Results', href:'#results'},
        {jp:'Contact', href:'#contact'}
      ].map(l => (
        <a key={l.jp} href={l.href} style={{fontFamily:'var(--font-en)', fontSize: 11, letterSpacing:'0.22em', color:'var(--ink-4)', textTransform:'uppercase', transition:'color 0.2s'}}
          onMouseEnter={e => e.currentTarget.style.color = 'var(--ink)'}
          onMouseLeave={e => e.currentTarget.style.color = 'var(--ink-4)'}>
          {l.jp}
        </a>
      ))}
      <a href="#contact" style={{
        fontFamily:'var(--font-en)', fontSize: 13, letterSpacing:'0.2em',
        padding:'11px 20px', background:'var(--ink)', color:'var(--white)',
        display:'inline-flex', gap: 10, alignItems:'center', transition:'all 0.3s'
      }}
      onMouseEnter={e => e.currentTarget.style.background = 'var(--gold)'}
      onMouseLeave={e => e.currentTarget.style.background = 'var(--ink)'}
      >CONTACT →</a>
    </div>
    )}
  </nav>
  {isMobile && menuOpen && (
    <div style={{
      position:'fixed', top: 64, left: 0, right: 0, bottom: 0, zIndex: 99,
      background:'var(--white)', padding:'40px 28px',
      display:'flex', flexDirection:'column', gap: 4
    }}>
      {[
        {jp:'About', en:'ABOUT', href:'#about'},
        {jp:'Service', en:'SERVICE', href:'#service'},
        {jp:'Results', en:'RESULTS', href:'#results'},
        {jp:'Contact', en:'CONTACT', href:'#contact'}
      ].map(l => (
        <a key={l.en} href={l.href} onClick={() => setMenuOpen(false)} style={{
          padding:'22px 4px', fontFamily:'var(--font-en)', fontSize: 28,
          letterSpacing:'0.18em', color:'var(--ink)', borderBottom:'1px solid var(--line)'
        }}>{l.en}</a>
      ))}
      <a href="#contact-form" onClick={() => setMenuOpen(false)} style={{
        marginTop: 32, padding:'20px', background:'var(--ink)', color:'var(--white)',
        textAlign:'center', fontFamily:'var(--font-en)', fontSize: 14, letterSpacing:'0.22em'
      }}>CONTACT US →</a>
    </div>
  )}
  </>
);

// ============ Diagonal Lines ============
const DiagonalLines = ({ tones = 'gold' }) => (
  <div style={{position:'absolute', inset: 0, zIndex: 2, pointerEvents:'none', overflow:'hidden'}}>
    {[
      {top:'20%', dur: 22, delay: 0, op: 0.10},
      {top:'52%', dur: 28, delay: 6, op: 0.06},
      {top:'80%', dur: 24, delay: 2, op: 0.09}
    ].map((l, i) => (
      <div key={i} style={{
        position:'absolute', top: l.top, left: 0, height: 90, width: '160%',
        background: tones === 'dark'
          ? `linear-gradient(90deg, transparent 0%, rgba(184,150,46,${l.op * 1.4}) 40%, rgba(224,120,48,${l.op * 1.4}) 60%, transparent 100%)`
          : `linear-gradient(90deg, transparent 0%, rgba(184,150,46,${l.op}) 40%, rgba(224,120,48,${l.op}) 60%, transparent 100%)`,
        transform:'skewX(-25deg)',
        animation:`diagSlide ${l.dur}s linear ${l.delay}s infinite`
      }} />
    ))}
  </div>
);

// ============ HERO ============
const Hero = ({ isMobile }) => (
  <section id="top" data-screen-label="01 Hero" style={{
    minHeight:'100vh', position:'relative', overflow:'hidden',
    background:'var(--white)', paddingTop: isMobile ? 100 : 120,
    display:'flex', alignItems:'center'
  }}>
    {/* BG Kanji — right, cream */}
    <div style={{
      position:'absolute', right:'-8%', top:'50%', transform:'translateY(-50%)',
      fontFamily:'var(--font-jp)', fontWeight: 900,
      fontSize: isMobile ? 'clamp(200px, 50vw, 400px)' : 'clamp(600px, 72vw, 1100px)',
      color:'var(--cream)',
      lineHeight: 0.8, letterSpacing:'-0.08em',
      pointerEvents:'none', userSelect:'none', zIndex: 1
    }}>隼</div>

    <DiagonalLines />

    <div style={{position:'relative', zIndex: 3, padding: isMobile ? '0 20px' : '0 60px', maxWidth: 1600, width: '100%'}}>
      {/* Label */}
      <div style={{animation:'fadeIn 0.9s 0.1s both', marginBottom: 40}}>
        <div className="grad-bar" style={{marginBottom: 20}} />
        <div style={{display:'flex', alignItems:'center', gap: 16}}>
          <span style={{width: 40, height: 1, background:'var(--gold)'}} />
          <span style={{fontFamily:'var(--font-en)', fontSize: 12, letterSpacing:'0.28em', color:'var(--ink-4)'}}>MISSION — 株式会社隼</span>
        </div>
      </div>

      <h1 style={{
        fontFamily:'var(--font-jp)', fontWeight: 900,
        fontSize:'clamp(36px, 9vw, 96px)',
        lineHeight: 1.08, letterSpacing:'-0.02em',
        color:'var(--ink)', maxWidth:'14em',
        animation:'heroSlam 0.8s cubic-bezier(0.2,0.8,0.2,1) both'
      }}>
        一度きりの人生に、<br/>
        <span className="grad-text">本気で羽ばたく</span>機会を。
      </h1>

      <p style={{
        marginTop: 44, fontSize: 16, lineHeight: 2, color:'var(--ink-3)',
        maxWidth: 520, animation:'fadeIn 0.9s 1s both'
      }}>
        株式会社隼は、YouTube・TikTok・LINEを横断する<br/>
        戦略型SNSプロデュースで、あなたの事業を加速させます。
      </p>

      <div style={{marginTop: 52, display:'flex', gap: 16, flexWrap:'wrap', flexDirection: isMobile ? 'column' : 'row', animation:'fadeIn 0.9s 1.2s both'}}>
        <a href="#service" style={{
          padding:'20px 36px', background:'var(--ink)', color:'var(--white)',
          fontFamily:'var(--font-en)', fontSize: 15, letterSpacing:'0.22em',
          display:'inline-flex', alignItems:'center', justifyContent: isMobile ? 'center' : 'flex-start', gap: 14, transition:'all 0.3s',
          width: isMobile ? '100%' : 'auto', boxSizing:'border-box'
        }}
        onMouseEnter={e => { e.currentTarget.style.background = 'var(--gold)'; e.currentTarget.style.transform = 'translateX(4px)'; }}
        onMouseLeave={e => { e.currentTarget.style.background = 'var(--ink)'; e.currentTarget.style.transform = 'translateX(0)'; }}
        >VIEW SERVICE <Arrow /></a>
        <a href="#results" style={{
          padding:'20px 28px', border:'1px solid var(--ink)', color:'var(--ink)',
          fontFamily:'var(--font-en)', fontSize: 15, letterSpacing:'0.22em', transition:'all 0.3s',
          width: isMobile ? '100%' : 'auto', textAlign:'center', boxSizing:'border-box'
        }}
        onMouseEnter={e => { e.currentTarget.style.background = 'var(--ink)'; e.currentTarget.style.color = 'var(--white)'; }}
        onMouseLeave={e => { e.currentTarget.style.background = 'transparent'; e.currentTarget.style.color = 'var(--ink)'; }}
        >RESULTS</a>
      </div>
    </div>

    {/* Right scroll indicator */}
    <div style={{
      position:'absolute', bottom: 40, right: 40, zIndex: 4,
      display:'flex', flexDirection:'column', alignItems:'center', gap: 16,
      animation:'fadeIn 1s 1.4s both'
    }}>
      <div style={{
        fontFamily:'var(--font-en)', fontSize: 12, letterSpacing:'0.35em',
        color:'var(--ink-3)', writingMode:'vertical-rl'
      }}>SCROLL</div>
      <div style={{position:'relative', width: 1, height: 60, background:'var(--cream)', overflow:'hidden'}}>
        <div style={{position:'absolute', top: 0, left: 0, width: 1, height: '50%', background:'var(--gold)', animation:'scrollLineMove 2s ease-in-out infinite'}} />
      </div>
    </div>
  </section>
);

const Arrow = () => (
  <svg width="16" height="10" viewBox="0 0 16 10" fill="none">
    <path d="M1 5H15M15 5L10 1M15 5L10 9" stroke="currentColor" strokeWidth="1.6" strokeLinecap="square"/>
  </svg>
);

// ============ MARQUEE ============
const Marquee = ({ items, background, color, speed = 18, isMobile }) => {
  const doubled = [...items, ...items, ...items, ...items];
  return (
    <div style={{background, overflow:'hidden', padding:'22px 0'}}>
      <div style={{display:'flex', gap: 56, animation:`marqueeX ${speed}s linear infinite`, whiteSpace:'nowrap', width:'max-content'}}>
        {doubled.map((t, i) => (
          <span key={i} style={{
            fontFamily:'var(--font-en)', fontSize: isMobile ? 12 : 26, letterSpacing:'0.28em', color,
            display:'inline-flex', alignItems:'center', gap: 56
          }}>
            {t}<span style={{fontSize: isMobile ? 8 : 14, opacity: 0.75}}>✦</span>
          </span>
        ))}
      </div>
    </div>
  );
};

// ============ VISION ============
const Vision = ({ isMobile }) => (
  <section data-screen-label="03 Vision" style={{background:'var(--off)', padding: isMobile ? '80px 20px' : '180px 60px'}}>
    <div style={{maxWidth: 1100, margin:'0 auto', textAlign:'center'}}>
      <div className="reveal" style={{display:'inline-flex', flexDirection:'column', alignItems:'center', gap: 14, marginBottom: 56}}>
        <div className="grad-bar" />
        <div style={{fontFamily:'var(--font-en)', fontSize: 14, letterSpacing:'0.3em', color:'var(--gold)'}}>VISION</div>
      </div>
      <h2 className="reveal" style={{
        fontFamily:'var(--font-jp)', fontWeight: 900,
        fontSize:'clamp(28px, 6vw, 62px)', lineHeight: 1.3, letterSpacing:'-0.02em',
        color:'var(--ink)', textWrap:'balance'
      }}>
        誰もが、<span className="grad-text">本気で羽ばたける場所</span><br/>
        であり続ける。
      </h2>
      <div className="reveal" style={{marginTop: 72, display:'flex', justifyContent:'center'}}>
        <div style={{width: 60, height: 4, background:'var(--grad)'}} />
      </div>
    </div>
  </section>
);

// ============ VALUES ============
const Values = ({ isMobile }) => {
  const values = [
    { num:'01', en:'OWN IT', jp:'自分の人生に、責任を持つ。', desc:'他人任せにしない。指示待ちにしない。自分の役割は自分で決める。相談する前に、まず考える。' },
    { num:'02', en:'SPEED IS RESPECT', jp:'速さは、誠意である。', desc:'判断・連携・実行のスピードこそ信頼の源泉。「明日やる」は、機会損失の言い換えである。' },
    { num:'03', en:'KEEP THE VIBE UP', jp:'場のエネルギーを、上げ続ける。', desc:'機嫌の管理は、リーダーの規律である。自分の機嫌は、自分で整える。' }
  ];
  return (
    <section data-screen-label="04 Values" style={{background:'var(--white)', padding: isMobile ? '80px 20px' : '180px 60px', position:'relative', overflow:'hidden'}}>
      {/* Background VALUES en */}
      <div style={{
        position:'absolute', right:'-4%', top:'38%',
        fontFamily:'var(--font-en)', fontSize:'clamp(300px, 34vw, 520px)',
        color:'var(--cream)', letterSpacing:'0.04em', lineHeight: 0.85,
        pointerEvents:'none', userSelect:'none', zIndex: 1
      }}>VALUES</div>

      <div style={{position:'relative', zIndex: 2, maxWidth: 1440, margin:'0 auto'}}>
        <div className="reveal" style={{marginBottom: 60}}>
          <div className="grad-bar" style={{marginBottom: 20}} />
          <div style={{fontFamily:'var(--font-en)', fontSize: 14, letterSpacing:'0.3em', color:'var(--ink-3)'}}>VALUES</div>
        </div>
        <h2 className="reveal" style={{
          fontFamily:'var(--font-jp)', fontWeight: 900,
          fontSize:'clamp(28px, 6vw, 62px)', lineHeight: 1.2, letterSpacing:'-0.02em',
          marginBottom: 80, textWrap:'balance'
        }}>
          行動指針 — <span className="grad-text">三つの原則</span>
        </h2>

        <div>
          {values.map(v => <ValueRow key={v.num} {...v} isMobile={isMobile} />)}
        </div>

        <div className="reveal" style={{marginTop: 72, paddingTop: 40, borderTop: '3px solid var(--ink)'}}>
          <p style={{
            fontFamily:'var(--font-jp)', fontWeight: 700,
            fontSize:'clamp(20px, 2.4vw, 30px)', lineHeight: 1.9,
            color:'var(--ink)', letterSpacing:'-0.01em', textWrap:'balance'
          }}>
            自分の人生は自分で背負う。
            <span style={{color:'var(--gold)', margin:'0 8px'}}>／</span>
            だから、誰よりも速く動く。
            <span style={{color:'var(--gold)', margin:'0 8px'}}>／</span>
            場のエネルギーは自分が作る。
          </p>
        </div>
      </div>
    </section>
  );
};

const ValueRow = ({ num, en, jp, desc, isMobile }) => {
  const [hover, setHover] = useState(false);
  return (
    <div
      className="reveal"
      onMouseEnter={() => setHover(true)}
      onMouseLeave={() => setHover(false)}
      style={{
        display:'grid', gridTemplateColumns: isMobile ? '1fr' : '180px 1fr 1.4fr', gap: isMobile ? 20 : 48,
        padding: isMobile ? '32px 0 32px 16px' : '48px 0 48px 24px',
        borderTop:'1px solid var(--line)',
        borderLeft:'3px solid ' + (hover ? 'var(--gold)' : 'transparent'),
        transform: hover ? 'translateX(8px)' : 'translateX(0)',
        transition:'transform 0.35s ease, border-left-color 0.35s ease',
        alignItems:'start'
      }}
    >
      <div style={{
        fontFamily:'var(--font-en)',
        fontSize: isMobile ? 'clamp(40px, 12vw, 64px)' : 'clamp(52px, 9vw, 96px)', lineHeight: 1,
        color: hover ? 'var(--gold)' : 'var(--cream)',
        transition:'color 0.35s ease'
      }}>{num}</div>
      <div>
        <div style={{fontFamily:'var(--font-en)', fontSize:'clamp(26px, 3.4vw, 42px)', letterSpacing:'0.04em', color:'var(--ink)', marginBottom: 16, lineHeight: 1.1}}>{en}</div>
        <div style={{fontFamily:'var(--font-jp)', fontWeight: 700, fontSize:'clamp(17px, 1.4vw, 20px)', color:'var(--ink-2)', letterSpacing:'-0.01em'}}>{jp}</div>
      </div>
      <div style={{fontSize: 15, lineHeight: 2, color:'var(--ink-3)', paddingTop: 6}}>{desc}</div>
    </div>
  );
};

// ============ SERVICE ============
const Service = ({ isMobile }) => {
  const items = [
    { num:'01', title:'YouTubeチャンネルプロデュース', desc:'戦略設計・SEO・サムネイル・台本・分析まで一気通貫' },
    { num:'02', title:'TikTok / Instagram運用', desc:'ショート動画を軸にした認知拡大と集客導線の設計' },
    { num:'03', title:'LINE公式アカウント設計', desc:'Lステップを活用したファネル構築、リピート率の最大化' },
    { num:'04', title:'動画制作・編集ディレクション', desc:'撮影から編集・納品まで専門チームが一括対応' }
  ];
  return (
    <section id="service" data-screen-label="05 Service" style={{background:'var(--off)', padding: isMobile ? '80px 20px' : '180px 60px'}}>
      <div style={{maxWidth: 1440, margin:'0 auto'}}>
        <div style={{display:'grid', gridTemplateColumns: isMobile ? '1fr' : '1fr 1fr', gap: isMobile ? 40 : 80, marginBottom: isMobile ? 60 : 100, alignItems: isMobile ? 'start' : 'end'}}>
          <div>
            <div className="reveal" style={{marginBottom: 56}}>
              <div className="grad-bar" style={{marginBottom: 20}} />
              <div style={{fontFamily:'var(--font-en)', fontSize: 14, letterSpacing:'0.3em', color:'var(--ink-3)'}}>SERVICE</div>
            </div>
            <h2 className="reveal" style={{
              fontFamily:'var(--font-en)',
              fontSize:'clamp(56px, 8vw, 124px)', lineHeight: 0.95,
              letterSpacing:'0.01em', color:'var(--ink)', marginBottom: 24
            }}>SNS<br/>PRODUCTION</h2>
            <div className="reveal" style={{fontFamily:'var(--font-jp)', fontWeight: 700, fontSize: 22, color:'var(--ink-2)', letterSpacing:'-0.01em'}}>
              戦略型SNSプロデュース
            </div>
          </div>
          <p className="reveal" style={{fontSize: 16, lineHeight: 2.1, color:'var(--ink-3)', maxWidth: 520, justifySelf: isMobile ? 'start' : 'end'}}>
            経験豊富なプロデューサー陣が、<br/>
            YouTube・TikTok・LINEを横断した戦略設計で、<br/>
            あなたの事業を加速させます。
          </p>
        </div>

        <div>
          {items.map((it, i) => <ServiceRow key={it.num} {...it} isMobile={isMobile} last={i === items.length - 1} />)}
        </div>
      </div>
    </section>
  );
};

const ServiceRow = ({ num, title, desc, last, isMobile }) => {
  const [hover, setHover] = useState(false);
  return (
    <div
      className="reveal"
      onMouseEnter={() => setHover(true)}
      onMouseLeave={() => setHover(false)}
      style={{
        display:'grid', gridTemplateColumns: isMobile ? '1fr' : '120px 1fr auto', gap: isMobile ? 12 : 40,
        padding: isMobile ? '28px 16px' : '40px 24px',
        borderTop:'1px solid var(--line-strong)',
        borderBottom: last ? '1px solid var(--line-strong)' : 'none',
        borderLeft: '3px solid ' + (hover ? 'var(--gold)' : 'transparent'),
        transform: hover ? 'translateX(8px)' : 'translateX(0)',
        transition:'transform 0.35s, border-left-color 0.35s, background 0.35s',
        background: hover ? 'var(--white)' : 'transparent',
        alignItems: isMobile ? 'start' : 'center'
      }}
    >
      <div style={{fontFamily:'var(--font-en)', fontSize: 36, color: hover ? 'var(--gold)' : 'var(--ink-4)', letterSpacing:'0.04em', transition:'color 0.3s'}}>{num}</div>
      <div>
        <div style={{fontFamily:'var(--font-jp)', fontWeight: 700, fontSize:'clamp(18px, 1.7vw, 24px)', color:'var(--ink)', letterSpacing:'-0.01em', marginBottom: 10}}>{title}</div>
        <div style={{fontSize: 14, lineHeight: 1.8, color:'var(--ink-3)'}}>{desc}</div>
      </div>
      <div style={{fontFamily:'var(--font-en)', fontSize: 15, letterSpacing:'0.22em', color: hover ? 'var(--gold)' : 'var(--ink-4)', transition:'color 0.3s', display:'flex', alignItems:'center', gap: 8}}>
        <span>DETAIL</span>
        <Arrow />
      </div>
    </div>
  );
};

// ============ ENTERTAINMENT ============
const Entertainment = ({ isMobile }) => (
  <section data-screen-label="06 Entertainment" style={{
    background:'var(--black)', padding: isMobile ? '80px 20px' : '200px 60px', position:'relative', overflow:'hidden'
  }}>
    {/* Diagonal gold lines (45deg, thin, subtle) */}
    <div style={{position:'absolute', inset: 0, zIndex: 1, pointerEvents:'none', overflow:'hidden'}}>
      {[
        {top:'8%', left:'-10%', w:'130%', op: 0.10},
        {top:'30%', left:'-5%', w:'120%', op: 0.06},
        {top:'58%', left:'-12%', w:'135%', op: 0.09},
        {top:'82%', left:'-8%', w:'125%', op: 0.05}
      ].map((l, i) => (
        <div key={i} style={{
          position:'absolute', top: l.top, left: l.left, width: l.w, height: 1,
          background:`linear-gradient(90deg, transparent 0%, rgba(184,150,46,${l.op}) 40%, rgba(224,120,48,${l.op}) 60%, transparent 100%)`,
          transform:'rotate(45deg)', transformOrigin:'left center'
        }} />
      ))}
    </div>

    {/* Watermark ENTERTAINMENT */}
    <div style={{
      position:'absolute', left:'50%', top:'50%', transform:'translate(-50%, -50%)',
      fontFamily:'var(--font-en)',
      fontSize:'clamp(200px, 24vw, 360px)',
      letterSpacing:'0.04em', lineHeight: 1, whiteSpace:'nowrap',
      color:'rgba(255,255,255,0.05)',
      pointerEvents:'none', userSelect:'none', zIndex: 1,
      display: isMobile ? 'none' : 'block'
    }}>ENTERTAINMENT</div>

    <div style={{position:'relative', zIndex: 3, maxWidth: 1440, margin:'0 auto'}}>
      <div className="reveal" style={{marginBottom: 100}}>
        <div style={{display:'flex', alignItems:'center', gap: 16}}>
          <span style={{width: 40, height: 1, background:'var(--gold)'}} />
          <span style={{fontFamily:'var(--font-en)', fontSize: 13, letterSpacing:'0.4em', color:'var(--gold)'}}>COMING SOON</span>
        </div>
      </div>

      <div style={{textAlign:'center'}}>
        <h2 className="reveal" style={{
          fontFamily:'var(--font-en)',
          fontSize: isMobile ? 'clamp(40px, 10vw, 80px)' : 'clamp(68px, 12vw, 200px)', lineHeight: 0.92,
          letterSpacing:'0.02em', color:'var(--white)', marginBottom: 56
        }}>ENTERTAINMENT</h2>

        <p className="reveal" style={{
          fontFamily:'var(--font-jp)', fontWeight: 700,
          fontSize:'clamp(20px, 2.4vw, 30px)', lineHeight: 1.7,
          color:'var(--white)', letterSpacing:'-0.01em', marginBottom: 28, textWrap:'balance'
        }}>
          アイドル・タレント・エンタメコンテンツ事業、始動。
        </p>

        <p className="reveal" style={{
          fontFamily:'var(--font-jp)', fontWeight: 400,
          fontSize: 15, lineHeight: 2,
          color:'rgba(255,255,255,0.55)', letterSpacing:'0.02em'
        }}>
          SNSで培った影響力と熱量を、次のステージへ。
        </p>

        <div className="reveal" style={{marginTop: 72, display:'flex', justifyContent:'center'}}>
          <div style={{width: 60, height: 4, background:'var(--grad)'}} />
        </div>
      </div>
    </div>
  </section>
);

// ============ RESULTS ============
const Results = ({ isMobile }) => {
  const cards = [
    {
      channel:'YOUTUBE',
      client:'資産運用チャンネル',
      big:'500人 → 32,000人',
      sub:'登録者数 64倍成長（1年間）',
      notes:['月20〜30件のアポイント獲得', '最高30万回再生'],
      graphType:'growth'
    },
    {
      channel:'YOUTUBE',
      client:'保険営業チャンネル',
      big:'最短6ヶ月',
      sub:'YouTube収益化達成（23本）',
      notes:['保険営業という高難度ジャンル', '短期での収益化を実現'],
      graphType:'monetize'
    },
    {
      channel:'YOUTUBE',
      client:'医療キャリア支援チャンネル',
      big:'月5件',
      sub:'月間面談実施数を確立（1年半）',
      notes:['看護師向けキャリア支援チャンネル', 'YouTube → LINE → 相談の導線設計'],
      graphType:'consultation'
    },
    {
      channel:'TIKTOK / INSTAGRAM',
      client:'ヘルスケア店舗アカウント',
      big:'最高763万回再生',
      sub:'累計再生回数（2年間）',
      notes:['100万回超バズ動画 5本以上', 'ローカルビジネスSNS成功モデル'],
      graphType:'viral'
    }
  ];
  return (
    <section id="results" data-screen-label="06 Results" style={{background:'var(--white)', padding: isMobile ? '80px 20px' : '180px 60px'}}>
      <div style={{maxWidth: 1440, margin:'0 auto'}}>
        <div className="reveal" style={{marginBottom: 56}}>
          <div className="grad-bar" style={{marginBottom: 20}} />
          <div style={{fontFamily:'var(--font-en)', fontSize: 14, letterSpacing:'0.3em', color:'var(--ink-3)'}}>RESULTS</div>
        </div>
        <h2 className="reveal" style={{
          fontFamily:'var(--font-jp)', fontWeight: 900,
          fontSize:'clamp(28px, 6vw, 62px)', lineHeight: 1.2, letterSpacing:'-0.02em',
          color:'var(--ink)', marginBottom: 80, textWrap:'balance'
        }}>
          数字が、<span className="grad-text">実力</span>を証明する。
        </h2>

        <div style={{display:'grid', gridTemplateColumns: isMobile ? '1fr' : '1fr 1fr', gap: isMobile ? 16 : 24}}>
          {cards.map((c, i) => <ResultCard key={i} {...c} isMobile={isMobile} />)}
        </div>
      </div>
    </section>
  );
};

// ---- graph helpers ----
const useAnimated = () => {
  const [anim, setAnim] = useState(false);
  const ref = useRef(null);
  useEffect(() => {
    const el = ref.current;
    if (!el) return;
    const obs = new IntersectionObserver(([e]) => { if (e.isIntersecting) setAnim(true); }, { threshold: 0.3 });
    obs.observe(el);
    return () => obs.disconnect();
  }, []);
  return [ref, anim];
};

const GrowthGraph = () => {
  const [ref, anim] = useAnimated();
  return (
    <div ref={ref} style={{marginTop: 28, paddingTop: 20, borderTop:'1px solid var(--line)'}}>
      <div style={{display:'flex', alignItems:'flex-end', gap: 14, height: 72}}>
        <div style={{display:'flex', flexDirection:'column', alignItems:'center', gap: 5, flex: 1}}>
          <div style={{
            width:'100%', background:'var(--cream)', borderRadius: 2,
            height: anim ? 6 : 0, transition:'height 0.5s ease'
          }} />
          <span style={{fontFamily:'var(--font-jp)', fontSize: 9, color:'var(--ink-4)'}}>開始</span>
          <span style={{fontFamily:'var(--font-jp)', fontSize: 10, color:'var(--ink-4)', fontWeight: 500}}>500人</span>
        </div>
        <div style={{fontFamily:'var(--font-en)', fontSize: 16, color:'var(--ink-4)', paddingBottom: 28}}>→</div>
        <div style={{display:'flex', flexDirection:'column', alignItems:'center', gap: 5, flex: 5}}>
          <div style={{
            width:'100%', background:'var(--grad)', borderRadius: 2,
            height: anim ? 52 : 0, transition:'height 0.8s 0.15s cubic-bezier(0.34,1.56,0.64,1)'
          }} />
          <span style={{fontFamily:'var(--font-jp)', fontSize: 9, color:'var(--gold)'}}>1年後</span>
          <span style={{fontFamily:'var(--font-jp)', fontSize: 10, color:'var(--ink-2)', fontWeight: 700}}>32,000人</span>
        </div>
      </div>
      <div style={{marginTop: 8, display:'flex', justifyContent:'flex-end'}}>
        <span style={{fontFamily:'var(--font-en)', fontSize: 9, letterSpacing:'0.22em', color:'var(--gold)'}}>64× GROWTH</span>
      </div>
    </div>
  );
};

const MonetizeGraph = () => {
  const [ref, anim] = useAnimated();
  const months = [
    {label:'M1', h:22, count:'3本'},
    {label:'M2', h:28, count:'4本'},
    {label:'M3', h:28, count:'4本'},
    {label:'M4', h:28, count:'4本'},
    {label:'M5', h:28, count:'4本'},
    {label:'M6', h:34, count:'4本', final:true},
  ];
  return (
    <div ref={ref} style={{marginTop: 28, paddingTop: 20, borderTop:'1px solid var(--line)'}}>
      <div style={{display:'flex', alignItems:'flex-end', gap: 6, height: 72}}>
        {months.map((m, i) => (
          <div key={i} style={{display:'flex', flexDirection:'column', alignItems:'center', gap: 4, flex: 1}}>
            {m.final && (
              <span style={{fontFamily:'var(--font-jp)', fontSize: 8, color:'var(--gold)', fontWeight: 700, marginBottom: 2, whiteSpace:'nowrap'}}>達成！</span>
            )}
            <div style={{
              width:'100%', borderRadius: 2,
              background: m.final ? 'var(--grad)' : 'rgba(184,150,46,0.32)',
              height: anim ? m.h : 0,
              transition: `height 0.5s ${i * 0.08}s ease`
            }} />
            <span style={{fontFamily:'var(--font-en)', fontSize: 8, color: m.final ? 'var(--gold)' : 'var(--ink-4)', letterSpacing:'0.1em'}}>{m.label}</span>
          </div>
        ))}
      </div>
      <div style={{marginTop: 8, display:'flex', justifyContent:'space-between', alignItems:'center'}}>
        <span style={{fontFamily:'var(--font-jp)', fontSize: 10, color:'var(--ink-4)'}}>月1〜4本ペースで投稿</span>
        <span style={{fontFamily:'var(--font-en)', fontSize: 9, letterSpacing:'0.18em', color:'var(--gold)'}}>23 VIDEOS TOTAL</span>
      </div>
    </div>
  );
};

const ConsultationGraph = () => {
  const [ref, anim] = useAnimated();
  return (
    <div ref={ref} style={{marginTop: 28, paddingTop: 20, borderTop:'1px solid var(--line)'}}>
      <div style={{display:'flex', gap: 24, alignItems:'flex-end', height: 72}}>
        <div style={{flex: 1}}>
          <div style={{fontFamily:'var(--font-en)', fontSize: 9, letterSpacing:'0.18em', color:'var(--ink-4)', marginBottom: 6}}>BEFORE</div>
          <div style={{
            width:'100%', background:'var(--cream)', borderRadius: 2,
            height: anim ? 8 : 0, transition:'height 0.5s ease'
          }} />
          <div style={{fontFamily:'var(--font-jp)', fontSize: 11, color:'var(--ink-4)', marginTop: 6}}>月0〜1件</div>
        </div>
        <div style={{flex: 1}}>
          <div style={{fontFamily:'var(--font-en)', fontSize: 9, letterSpacing:'0.18em', color:'var(--gold)', marginBottom: 6}}>AFTER</div>
          <div style={{
            width:'100%', background:'var(--grad)', borderRadius: 2,
            height: anim ? 52 : 0, transition:'height 0.75s 0.2s cubic-bezier(0.34,1.56,0.64,1)'
          }} />
          <div style={{fontFamily:'var(--font-jp)', fontSize: 11, color:'var(--ink-2)', fontWeight: 700, marginTop: 6}}>月5件</div>
        </div>
      </div>
      <div style={{marginTop: 8, display:'flex', justifyContent:'flex-end'}}>
        <span style={{fontFamily:'var(--font-en)', fontSize: 9, letterSpacing:'0.2em', color:'var(--gold)'}}>5× INCREASE</span>
      </div>
    </div>
  );
};

const ViralGraph = () => {
  const [ref, anim] = useAnimated();
  const videos = [
    {h:56, label:'763万', top:true},
    {h:30, label:'312万', top:false},
    {h:24, label:'245万', top:false},
    {h:19, label:'198万', top:false},
    {h:14, label:'145万', top:false},
  ];
  return (
    <div ref={ref} style={{marginTop: 28, paddingTop: 20, borderTop:'1px solid var(--line)'}}>
      <div style={{display:'flex', alignItems:'flex-end', gap: 8, height: 72}}>
        {videos.map((v, i) => (
          <div key={i} style={{display:'flex', flexDirection:'column', alignItems:'center', gap: 4, flex: 1}}>
            <div style={{
              width:'100%', borderRadius: 2,
              background: v.top ? 'var(--grad)' : 'rgba(184,150,46,0.38)',
              height: anim ? v.h : 0,
              transition: `height 0.6s ${i * 0.08}s cubic-bezier(0.34,1.56,0.64,1)`
            }} />
            <span style={{fontFamily:'var(--font-jp)', fontSize: 9, color: v.top ? 'var(--gold)' : 'var(--ink-4)', fontWeight: v.top ? 700 : 400}}>{v.label}</span>
          </div>
        ))}
      </div>
      <div style={{marginTop: 8, display:'flex', justifyContent:'space-between', alignItems:'center'}}>
        <span style={{fontFamily:'var(--font-jp)', fontSize: 10, color:'var(--ink-4)'}}>バズ動画 トップ5</span>
        <span style={{fontFamily:'var(--font-en)', fontSize: 9, letterSpacing:'0.18em', color:'var(--gold)'}}>VIRAL HITS</span>
      </div>
    </div>
  );
};

const GRAPHS = { growth: GrowthGraph, monetize: MonetizeGraph, consultation: ConsultationGraph, viral: ViralGraph };

const ResultCard = ({ channel, client, big, sub, notes, graphType, isMobile }) => {
  const [hover, setHover] = useState(false);
  const Graph = graphType ? GRAPHS[graphType] : null;
  return (
    <div
      className="reveal"
      onMouseEnter={() => setHover(true)}
      onMouseLeave={() => setHover(false)}
      style={{
        background:'var(--white)', border:'1px solid var(--line)',
        padding:'44px 44px 40px', position:'relative', overflow:'hidden',
        transform: hover ? 'translateY(-4px)' : 'translateY(0)',
        transition:'transform 0.35s ease, box-shadow 0.35s ease',
        boxShadow: hover ? '0 20px 40px rgba(17,17,17,0.06)' : '0 0 0 rgba(0,0,0,0)'
      }}
    >
      <div style={{
        position:'absolute', bottom: 0, left: 0, height: 3,
        width: hover ? '100%' : '0%',
        background:'var(--grad)', transition:'width 0.5s ease'
      }} />

      <div style={{display:'flex', justifyContent:'space-between', alignItems:'center', marginBottom: 48}}>
        <div style={{fontFamily:'var(--font-en)', fontSize: 13, letterSpacing:'0.3em', color:'var(--ink-4)'}}>{channel}</div>
        <div style={{fontFamily:'var(--font-jp)', fontWeight: 500, fontSize: 13, color:'var(--ink-3)'}}>{client}</div>
      </div>

      <div style={{
        fontFamily:'var(--font-en)',
        fontSize: isMobile ? 'clamp(24px, 6vw, 32px)' : 'clamp(28px, 4vw, 40px)', lineHeight: 1,
        background:'var(--grad)', WebkitBackgroundClip:'text', backgroundClip:'text',
        WebkitTextFillColor:'transparent', color:'transparent',
        letterSpacing:'0.01em', marginBottom: 16
      }}>{big}</div>

      <div style={{fontFamily:'var(--font-jp)', fontWeight: 700, fontSize: 18, color:'var(--ink)', letterSpacing:'-0.01em', marginBottom: 24}}>{sub}</div>

      <div style={{paddingTop: 24, borderTop:'1px solid var(--line)'}}>
        {notes.map((n, i) => (
          <div key={i} style={{fontSize: 13, lineHeight: 2, color:'var(--ink-3)', display:'flex', gap: 10, alignItems:'baseline'}}>
            <span style={{width: 4, height: 4, background:'var(--gold)', borderRadius: '50%', flexShrink: 0, transform:'translateY(-2px)'}} />
            {n}
          </div>
        ))}
      </div>

      {Graph && <Graph />}
    </div>
  );
};

// ============ ABOUT ============
const About = ({ isMobile }) => {
  const rows = [
    ['COMPANY', '会社名', '株式会社隼（HAYABUSA Inc.）'],
    ['CEO', '代表取締役', '副島 大典 / 岩下 和也'],
    ['OFFICE', '所在地', '福岡県福岡市'],
    ['CAPITAL', '資本金', '100万円'],
    ['BUSINESS', '事業内容', 'SNSプロデュース事業 / エンタテインメント事業（準備中）']
  ];
  return (
    <section id="about" data-screen-label="08 About" style={{background:'var(--white)', padding: isMobile ? '80px 20px' : '180px 60px'}}>
      <div style={{maxWidth: 1200, margin:'0 auto', display:'grid', gridTemplateColumns: isMobile ? '1fr' : '1fr 1.4fr', gap: isMobile ? 48 : 100, alignItems:'start'}}>
        <div>
          <div className="reveal" style={{marginBottom: 56}}>
            <div className="grad-bar" style={{marginBottom: 20}} />
            <div style={{fontFamily:'var(--font-en)', fontSize: 14, letterSpacing:'0.3em', color:'var(--ink-3)'}}>ABOUT</div>
          </div>
          <h2 className="reveal" style={{
            fontFamily:'var(--font-jp)', fontWeight: 900,
            fontSize:'clamp(28px, 5vw, 52px)', lineHeight: 1.2, letterSpacing:'-0.02em',
            color:'var(--ink)', marginBottom: 32
          }}>
            株式会社隼<br/>について
          </h2>
          <p className="reveal" style={{fontSize: 15, lineHeight: 2, color:'var(--ink-3)', maxWidth: 360}}>
            株式会社隼は、SNSプロデュースの力で、夢を追うすべての人に「本気で羽ばたく機会」を届ける会社です。4年間のSNS運用で磨き上げたマーケティング力で、他の誰にも真似できない価値を創造します。
          </p>
        </div>

        <div className="reveal">
          {rows.map(([en, jp, v], i) => (
            <div key={en} style={{
              display:'grid', gridTemplateColumns: isMobile ? '1fr' : '140px 120px 1fr', gap: isMobile ? 6 : 32,
              padding: isMobile ? '20px 0' : '26px 0',
              borderTop:'1px solid var(--line-strong)',
              borderBottom: i === rows.length - 1 ? '1px solid var(--line-strong)' : 'none',
              alignItems:'baseline'
            }}>
              <div style={{fontFamily:'var(--font-en)', fontSize: 13, letterSpacing:'0.25em', color:'var(--gold)'}}>{en}</div>
              <div style={{fontSize: 12, color:'var(--ink-4)'}}>{jp}</div>
              <div style={{fontSize: 16, color:'var(--ink)', fontWeight: 500, letterSpacing:'-0.005em'}}>{v}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
};

// ============ CTA ============
const CTA = ({ isMobile }) => {
  const [hover, setHover] = useState(false);
  return (
    <section id="contact" data-screen-label="09 CTA" style={{
      background:'var(--black)', padding: isMobile ? '80px 20px' : '180px 60px', position:'relative', overflow:'hidden'
    }}>
      <DiagonalLines tones="dark" />

      <div style={{maxWidth: 1200, margin:'0 auto', position:'relative', zIndex: 3}}>
        <div className="reveal" style={{marginBottom: 56}}>
          <div className="grad-bar" style={{marginBottom: 20}} />
          <div style={{fontFamily:'var(--font-en)', fontSize: 14, letterSpacing:'0.3em', color:'var(--gold)'}}>CONTACT</div>
        </div>
        <h2 className="reveal" style={{
          fontFamily:'var(--font-jp)', fontWeight: 900,
          fontSize:'clamp(32px, 7vw, 84px)', lineHeight: 1.15, letterSpacing:'-0.03em',
          color:'var(--white)', marginBottom: 72, textWrap:'balance', maxWidth:'14em'
        }}>
          あなたの事業を、<br/>
          <span className="grad-text">加速させませんか。</span>
        </h2>

        <div className="reveal" style={{display:'flex', flexWrap:'wrap', gap: 28, alignItems:'center'}}>
          <a
            href="#contact-form"
            onMouseEnter={() => setHover(true)}
            onMouseLeave={() => setHover(false)}
            style={{
              position:'relative', overflow:'hidden',
              padding:'24px 48px', border: '1px solid var(--white)',
              fontFamily:'var(--font-en)', fontSize: 18, letterSpacing:'0.24em',
              color:'var(--white)', display:'inline-flex', alignItems:'center', justifyContent:'center', gap: 16,
              transition:'color 0.3s, border-color 0.3s',
              borderColor: hover ? 'transparent' : 'var(--white)',
              width: isMobile ? '100%' : 'auto', boxSizing:'border-box'
            }}>
            {/* gradient rising from bottom */}
            <span style={{
              position:'absolute', left: 0, right: 0, bottom: 0,
              height: hover ? '100%' : '0%',
              background:'var(--grad)',
              transition:'height 0.45s cubic-bezier(0.2,0.8,0.2,1)',
              zIndex: 0
            }} />
            <span style={{position:'relative', zIndex: 1, display:'inline-flex', alignItems:'center', gap: 16}}>
              CONTACT US <Arrow />
            </span>
          </a>
        </div>
      </div>
    </section>
  );
};

// ============ CONTACT FORM ============
const ContactForm = ({ isMobile }) => {
  const [kind, setKind] = useState('SNSプロデュースのご相談');
  const [company, setCompany] = useState('');
  const [name, setName] = useState('');
  const [email, setEmail] = useState('');
  const [phone, setPhone] = useState('');
  const [message, setMessage] = useState('');
  const [agree, setAgree] = useState(false);
  const [hover, setHover] = useState(false);
  const [sent, setSent] = useState(false);

  const kinds = ['SNSプロデュースのご相談','お見積り・料金について','その他・取材・採用'];

  const onSubmit = (e) => {
    e.preventDefault();
    if (!agree) return;
    console.log('[HAYABUSA Contact]', { kind, company, name, email, phone, message });
    setSent(true);
  };

  const inputStyle = {
    width:'100%', padding:'14px 16px', fontFamily:'var(--font-jp)', fontSize: 15,
    background:'var(--white)', border:'1px solid var(--line)',
    color:'var(--ink)', outline:'none', transition:'border-color 0.25s',
    borderRadius: 0
  };
  const labelStyle = {
    display:'flex', alignItems:'baseline', gap: 6,
    fontFamily:'var(--font-jp)', fontWeight: 700, fontSize: 13,
    color:'var(--ink-2)', marginBottom: 10, letterSpacing:'0.02em'
  };
  const req = <span style={{color:'#E0302E', fontSize: 13}}>*</span>;
  const opt = <span style={{fontFamily:'var(--font-en)', fontSize: 11, color:'var(--ink-4)', letterSpacing:'0.18em'}}>OPTIONAL</span>;

  return (
    <section id="contact-form" data-screen-label="10 Form" style={{background:'var(--white)', padding: isMobile ? '80px 20px' : '140px 60px'}}>
      <div style={{maxWidth: isMobile ? '100%' : 700, margin:'0 auto'}}>
        <div className="reveal" style={{marginBottom: 32}}>
          <div className="grad-bar" style={{marginBottom: 20}} />
          <div style={{fontFamily:'var(--font-en)', fontSize: 14, letterSpacing:'0.3em', color:'var(--ink-3)'}}>CONTACT</div>
        </div>

        {sent ? (
          <div className="reveal in" style={{padding:'80px 0', textAlign:'center'}}>
            <div style={{
              fontFamily:'var(--font-en)', fontSize:'clamp(56px, 9vw, 120px)',
              lineHeight: 0.95, letterSpacing:'0.02em',
              background:'var(--grad)', WebkitBackgroundClip:'text', backgroundClip:'text',
              WebkitTextFillColor:'transparent', color:'transparent', marginBottom: 40
            }}>THANK YOU</div>
            <div style={{fontFamily:'var(--font-jp)', fontWeight: 700, fontSize: 20, color:'var(--ink)', marginBottom: 16, letterSpacing:'-0.01em'}}>
              お問い合わせありがとうございます。
            </div>
            <div style={{fontSize: 13, color:'var(--ink-3)', lineHeight: 2}}>
              内容を確認の上、担当者より折り返しご連絡いたします。
            </div>
          </div>
        ) : (
          <>
            <h2 className="reveal" style={{
              fontFamily:'var(--font-jp)', fontWeight: 900,
              fontSize:'clamp(28px, 4vw, 42px)', lineHeight: 1.25, letterSpacing:'-0.02em',
              color:'var(--ink)', marginBottom: 20
            }}>お問い合わせ</h2>
            <p className="reveal" style={{fontSize: 13, lineHeight: 2, color:'var(--ink-3)', marginBottom: 56}}>
              SNSプロデュースに関するご相談・お問い合わせはこちらからお願いいたします。
            </p>

            <form className="reveal" onSubmit={onSubmit} style={{display:'grid', gap: 32}}>
              {/* Kind selector */}
              <div>
                <div style={labelStyle}>お問い合わせ種類 {req}</div>
                <div style={{display:'grid', gridTemplateColumns: isMobile ? '1fr' : 'repeat(3, 1fr)', gap: 10}}>
                  {kinds.map(k => {
                    const active = kind === k;
                    return (
                      <button type="button" key={k} onClick={() => setKind(k)}
                        style={{
                          padding:'14px 12px', fontSize: 12, lineHeight: 1.5,
                          fontFamily:'var(--font-jp)', fontWeight: 500,
                          background: active ? 'var(--ink)' : 'var(--white)',
                          color: active ? 'var(--white)' : 'var(--ink-2)',
                          border:'1px solid ' + (active ? 'var(--ink)' : 'var(--line)'),
                          transition:'all 0.25s', textAlign:'center'
                        }}
                        onMouseEnter={e => { if (!active) e.currentTarget.style.borderColor = 'var(--gold)'; }}
                        onMouseLeave={e => { if (!active) e.currentTarget.style.borderColor = 'var(--line)'; }}>
                        {k}
                      </button>
                    );
                  })}
                </div>
              </div>

              <div>
                <div style={labelStyle}>会社名 {opt}</div>
                <input type="text" value={company} onChange={e => setCompany(e.target.value)}
                  style={inputStyle}
                  onFocus={e => e.currentTarget.style.borderColor = 'var(--gold)'}
                  onBlur={e => e.currentTarget.style.borderColor = 'var(--line)'} />
              </div>

              <div>
                <div style={labelStyle}>お名前 {req}</div>
                <input type="text" required value={name} onChange={e => setName(e.target.value)}
                  style={inputStyle}
                  onFocus={e => e.currentTarget.style.borderColor = 'var(--gold)'}
                  onBlur={e => e.currentTarget.style.borderColor = 'var(--line)'} />
              </div>

              <div>
                <div style={labelStyle}>メールアドレス {req}</div>
                <input type="email" required value={email} onChange={e => setEmail(e.target.value)}
                  style={inputStyle}
                  onFocus={e => e.currentTarget.style.borderColor = 'var(--gold)'}
                  onBlur={e => e.currentTarget.style.borderColor = 'var(--line)'} />
              </div>

              <div>
                <div style={labelStyle}>電話番号 {opt}</div>
                <input type="tel" value={phone} onChange={e => setPhone(e.target.value)}
                  style={inputStyle}
                  onFocus={e => e.currentTarget.style.borderColor = 'var(--gold)'}
                  onBlur={e => e.currentTarget.style.borderColor = 'var(--line)'} />
              </div>

              <div>
                <div style={labelStyle}>お問い合わせ内容 {req}</div>
                <textarea required rows={6} value={message} onChange={e => setMessage(e.target.value)}
                  style={{...inputStyle, resize:'vertical', fontFamily:'var(--font-jp)', lineHeight: 1.8}}
                  onFocus={e => e.currentTarget.style.borderColor = 'var(--gold)'}
                  onBlur={e => e.currentTarget.style.borderColor = 'var(--line)'} />
              </div>

              {/* Agreement */}
              <label style={{display:'flex', alignItems:'flex-start', gap: 12, fontSize: 13, color:'var(--ink-2)', cursor:'pointer', lineHeight: 1.8}}>
                <input type="checkbox" checked={agree} onChange={e => setAgree(e.target.checked)}
                  style={{marginTop: 4, width: 16, height: 16, accentColor:'#111', flexShrink: 0}} />
                <span>
                  <a href="#privacy" style={{color:'var(--gold)', textDecoration:'underline', textUnderlineOffset: 3}}>プライバシーポリシー</a>
                  に同意します。
                </span>
              </label>

              <div style={{marginTop: 8}}>
                <button type="submit" disabled={!agree}
                  onMouseEnter={() => setHover(true)}
                  onMouseLeave={() => setHover(false)}
                  style={{
                    position:'relative', overflow:'hidden',
                    padding:'22px 48px',
                    background:'var(--ink)', color:'var(--white)',
                    fontFamily:'var(--font-en)', fontSize: 16, letterSpacing:'0.28em',
                    display:'inline-flex', alignItems:'center', gap: 14,
                    opacity: agree ? 1 : 0.4,
                    cursor: agree ? 'pointer' : 'not-allowed',
                    transition:'opacity 0.3s', border:'none'
                  }}>
                  <span style={{
                    position:'absolute', left: 0, right: 0, bottom: 0,
                    height: (agree && hover) ? '100%' : '0%',
                    background:'var(--grad)',
                    transition:'height 0.45s cubic-bezier(0.2,0.8,0.2,1)',
                    zIndex: 0
                  }} />
                  <span style={{position:'relative', zIndex: 1, display:'inline-flex', alignItems:'center', gap: 14}}>
                    送信する <Arrow />
                  </span>
                </button>
              </div>
            </form>
          </>
        )}
      </div>
    </section>
  );
};

// ============ PRIVACY ============
const Privacy = ({ isMobile }) => {
  const sections = [
    ['個人情報の取得', '当社は、お問い合わせフォーム等を通じて、お名前、メールアドレス、電話番号等の個人情報を取得することがあります。'],
    ['利用目的', '取得した個人情報は、以下の目的で利用いたします。\n・お問い合わせへの回答およびご連絡\n・当社サービスに関する情報提供\n・業務上必要な連絡'],
    ['第三者提供', '当社は、法令に基づく場合を除き、お客様の同意なく個人情報を第三者に提供することはありません。'],
    ['安全管理', '当社は、個人情報の漏洩、滅失または毀損の防止のため、適切な安全管理措置を講じます。'],
    ['お問い合わせ', '個人情報の取り扱いに関するお問い合わせは、当サイトのお問い合わせフォームよりご連絡ください。']
  ];
  return (
    <section id="privacy" data-screen-label="11 Privacy" style={{background:'var(--off)', padding: isMobile ? '80px 20px' : '120px 60px'}}>
      <div style={{maxWidth: 800, margin:'0 auto'}}>
        <div className="reveal" style={{marginBottom: 40}}>
          <div className="grad-bar" style={{marginBottom: 20}} />
          <div style={{fontFamily:'var(--font-en)', fontSize: 14, letterSpacing:'0.3em', color:'var(--ink-3)'}}>PRIVACY POLICY</div>
        </div>
        <h2 className="reveal" style={{fontFamily:'var(--font-jp)', fontWeight: 700, fontSize: 24, color:'var(--ink)', letterSpacing:'-0.01em', marginBottom: 40}}>
          プライバシーポリシー
        </h2>
        <p className="reveal" style={{fontFamily:'var(--font-jp)', fontWeight: 400, fontSize: 14, color:'var(--ink-3)', lineHeight: 2.2, marginBottom: 40}}>
          株式会社隼（以下「当社」）は、お客様の個人情報の保護に関し、以下のとおりプライバシーポリシーを定めます。
        </p>
        {sections.map(([h, body]) => (
          <div key={h} className="reveal" style={{marginBottom: 36}}>
            <div style={{fontFamily:'var(--font-jp)', fontWeight: 700, fontSize: 14, color:'var(--ink-2)', marginBottom: 10, letterSpacing:'0.01em'}}>
              <span style={{color:'var(--gold)', marginRight: 8}}>■</span>{h}
            </div>
            <div style={{fontFamily:'var(--font-jp)', fontWeight: 400, fontSize: 14, color:'var(--ink-3)', lineHeight: 2.2, whiteSpace:'pre-line'}}>
              {body}
            </div>
          </div>
        ))}
        <div className="reveal" style={{marginTop: 48, paddingTop: 24, borderTop:'1px solid var(--line)', fontFamily:'var(--font-jp)', fontSize: 13, color:'var(--ink-4)'}}>
          制定日: 2026年4月
        </div>
      </div>
    </section>
  );
};

// ============ FOOTER ============
const Footer = ({ isMobile }) => (
  <footer style={{background:'var(--footer)', padding: isMobile ? '40px 20px' : '56px 60px 40px'}}>
    <div style={{maxWidth: 1440, margin:'0 auto', display:'flex', justifyContent:'space-between', alignItems: isMobile ? 'flex-start' : 'center', flexWrap:'wrap', flexDirection: isMobile ? 'column' : 'row', gap: isMobile ? 16 : 32}}>
      <div style={{display:'flex', alignItems:'baseline', gap: 20}}>
        <span style={{fontFamily:'var(--font-en)', fontSize: 32, letterSpacing:'0.14em', color:'var(--gold)'}}>HAYABUSA</span>
        <span style={{fontSize: 12, color:'rgba(255,255,255,0.55)', letterSpacing:'0.05em'}}>株式会社隼 / 福岡県福岡市</span>
      </div>
      <div style={{display:'flex', alignItems:'center', gap: 28}}>
        <a href="#privacy" style={{fontFamily:'var(--font-en)', fontSize: 11, letterSpacing:'0.22em', color:'#666', transition:'color 0.2s'}}
          onMouseEnter={e => e.currentTarget.style.color = 'var(--gold)'}
          onMouseLeave={e => e.currentTarget.style.color = '#666'}>
          PRIVACY POLICY
        </a>
        <div style={{fontFamily:'var(--font-en)', fontSize: 12, letterSpacing:'0.22em', color:'rgba(255,255,255,0.45)'}}>
          © 2026 HAYABUSA INC.
        </div>
      </div>
    </div>
  </footer>
);

// ============ APP ============
const App = () => {
  const [scrolled, setScrolled] = useState(false);
  const [isMobile, setIsMobile] = useState(false);
  const [menuOpen, setMenuOpen] = useState(false);

  useEffect(() => {
    const check = () => setIsMobile(window.innerWidth < 768);
    check();
    window.addEventListener('resize', check);
    return () => window.removeEventListener('resize', check);
  }, []);

  useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 40);
    window.addEventListener('scroll', onScroll, { passive: true });
    return () => window.removeEventListener('scroll', onScroll);
  }, []);

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

  return (
    <>
      <Nav scrolled={scrolled} isMobile={isMobile} menuOpen={menuOpen} setMenuOpen={setMenuOpen} />
      <Hero isMobile={isMobile} />
      <Marquee items={['OWN IT','SPEED IS RESPECT','KEEP THE VIBE UP']} background="var(--ink)" color="var(--white)" speed={18} isMobile={isMobile} />
      <Vision isMobile={isMobile} />
      <Values isMobile={isMobile} />
      <Service isMobile={isMobile} />
      <Entertainment isMobile={isMobile} />
      <Results isMobile={isMobile} />
      <Marquee items={['YOUTUBE','TIKTOK','LINE','INSTAGRAM','SNS PRODUCTION','STRATEGY']} background="var(--grad)" color="var(--white)" speed={22} isMobile={isMobile} />
      <About isMobile={isMobile} />
      <CTA isMobile={isMobile} />
      <ContactForm isMobile={isMobile} />
      <Privacy isMobile={isMobile} />
      <Footer isMobile={isMobile} />
    </>
  );
};

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