/* Rep by Rep — Marketing UI Kit components.
   All-in-one JSX module. Loaded via Babel in index.html. */

const Icon = ({ name, size = 20, color, style }) => (
  <img
    src={`./assets/icons/${name}.svg`}
    width={size}
    height={size}
    style={{ filter: color === 'white' ? 'invert(100%)' : 'none', verticalAlign: 'middle', ...style }}
    alt=""
  />
);

// ---------- Nav ----------
const Nav = () => {
  const [scrolled, setScrolled] = React.useState(false);
  React.useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 24);
    window.addEventListener('scroll', onScroll);
    return () => window.removeEventListener('scroll', onScroll);
  }, []);
  return (
    <nav style={{
      position: 'sticky', top: 0, zIndex: 50,
      background: scrolled ? 'rgba(255,255,255,0.96)' : '#fff',
      borderBottom: scrolled ? '1px solid var(--border)' : '1px solid transparent',
      transition: 'all 200ms cubic-bezier(.16,1,.3,1)',
    }}>
      <div className="wrap" style={{
        display: 'flex', alignItems: 'center', justifyContent: 'space-between',
        height: scrolled ? 60 : 76,
        transition: 'height 200ms cubic-bezier(.16,1,.3,1)',
      }}>
        <a href="#" style={{ display: 'flex', alignItems: 'center', gap: 14, textDecoration: 'none' }}>
          <img src="./assets/logo-icon.svg" width="36" height="36" alt="Rep by Rep" />
          <div>
            <div style={{ fontFamily: 'var(--font-display)', fontSize: 18, color: 'var(--fg)', lineHeight: 1, letterSpacing: '0.02em' }}>REP BY REP</div>
            <div style={{ fontSize: 8, color: 'var(--accent)', letterSpacing: '0.3em', fontWeight: 600, marginTop: 2, whiteSpace: 'nowrap' }}>EARNED EVERY DAY</div>
          </div>
        </a>
        <div style={{ display: 'flex', alignItems: 'center', gap: 36 }}>
          <span className="nav-desktop-links" style={{ display: 'inline-flex', alignItems: 'center', gap: 36 }}>
          {['Method', 'Services', 'Pricing'].map((l) => (
            <a key={l} href={`#${l.toLowerCase()}`} style={{
              fontSize: 11, fontWeight: 600, textTransform: 'uppercase', letterSpacing: '0.18em',
              color: 'var(--fg)', textDecoration: 'none', transition: 'color 200ms',
            }} onMouseEnter={e => e.target.style.color = 'var(--accent)'}
               onMouseLeave={e => e.target.style.color = 'var(--fg)'}>{l}</a>
          ))}
          </span>
          <a href="#apply" className="btn btn-primary" style={{ padding: '11px 20px', fontSize: 12 }}>
            Apply <Icon name="arrow-right" size={14} color="white" />
          </a>
        </div>
      </div>
    </nav>
  );
};

// ---------- Hero ----------
const Hero = () => (
  <section style={{
    background: 'var(--accent)', color: '#fff', padding: '120px 0 96px',
    position: 'relative', overflow: 'hidden',
  }}>
    {/* subtle grid */}
    <svg style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', opacity: 0.07 }} xmlns="http://www.w3.org/2000/svg">
      <defs>
        <pattern id="g" width="48" height="48" patternUnits="userSpaceOnUse">
          <path d="M48 0H0V48" fill="none" stroke="#fff" strokeWidth="0.5" />
        </pattern>
      </defs>
      <rect width="100%" height="100%" fill="url(#g)" />
    </svg>
    <div className="wrap" style={{ position: 'relative' }}>
      <div className="eyebrow" style={{ color: 'rgba(255,255,255,0.7)', marginBottom: 28 }}>
        Physique Coaching for Men 30+
      </div>
      <h1 className="h-display" style={{ color: '#fff', maxWidth: 1000 }}>
        The Work<br />Is the Reward.
      </h1>
      <div style={{ width: 64, height: 2, background: 'rgba(255,255,255,0.5)', margin: '36px 0 28px' }} />
      <p style={{ fontSize: 20, lineHeight: 1.5, maxWidth: '52ch', color: 'rgba(255,255,255,0.85)', margin: 0 }}>
        Custom training and nutrition for guys 30 and up, whether you&apos;re chasing your first real physique or your first stage win.
        You bring the work. We build the plan around the life you actually have.
      </p>
      <div style={{ display: 'flex', gap: 14, marginTop: 44 }} className="hero-cta">
        <a href="#apply" className="btn btn-onDark">Apply for Coaching <Icon name="arrow-right" size={14} /></a>
        <a href="#process" className="btn btn-ghostDark">How It Works</a>
      </div>
        <div style={{ display: 'flex', alignItems: 'center', gap: 56, marginTop: 88, paddingTop: 32, borderTop: '1px solid rgba(255,255,255,0.18)' }} className="hero-stats">
        {[
          ['15+', 'Years in the game'],
          ['110+', 'Clients coached'],
          ['35+', 'The age we build for'],
        ].map(([n, l]) => (
          <div key={l}>
            <div style={{ fontFamily: 'var(--font-display)', fontSize: 36, lineHeight: 1, letterSpacing: '-0.01em' }}>{n}</div>
            <div style={{ fontSize: 11, letterSpacing: '0.22em', textTransform: 'uppercase', color: 'rgba(255,255,255,0.6)', marginTop: 8, fontWeight: 600 }}>{l}</div>
          </div>
        ))}
      </div>
    </div>
  </section>
);

// ---------- Process ----------
const Process = () => {
  const steps = [
    { num: '01', title: 'The Assessment', body: 'You apply. We talk for about 30 minutes about your training history, your schedule, what you\'ve tried, what\'s on the table. No generic intake form.' },
    { num: '02', title: 'The Framework', body: 'You get a program built around your equipment, your week, your sleep, your stress. Macros are a number, not a meal plan. Built to scale with your life.' },
    { num: '03', title: 'The Process', body: 'Weekly check-ins. Honest feedback. Course corrections when the trend asks for it. We\'re in this for years, not weeks.' },
  ];
  return (
    <section id="process" className="bg-wash">
      <div className="wrap">
        <div className="eyebrow">The Method</div>
        <h2 className="h-section" style={{ marginTop: 12, maxWidth: 800 }}>Three steps. No shortcuts.</h2>
        <div className="rule" />
        <div className="m-1 m-gap" style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 28, marginTop: 56 }}>
          {steps.map(s => (
            <div key={s.num} style={{ background: '#fff', border: '1px solid var(--border)', padding: 36, borderRadius: 6 }}>
              <div style={{ fontFamily: 'var(--font-display)', fontSize: 56, lineHeight: 1, color: 'var(--accent)' }}>{s.num}</div>
              <h3 className="h-sub" style={{ marginTop: 18 }}>{s.title}</h3>
              <p style={{ fontSize: 15, color: 'var(--fg-2)', marginTop: 12, marginBottom: 0, lineHeight: 1.6 }}>{s.body}</p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
};

// ---------- Services ----------
const Services = () => {
  const services = [
    {
      n: '01', icon: 'dumbbell', title: 'Training',
      body: 'Custom programming built around your schedule, equipment, and injury history. Adjusted every 8 weeks.',
      bullets: ['Periodized hypertrophy & strength blocks', 'Form video review', 'Substitution library for travel'],
    },
    {
      n: '02', icon: 'utensils', title: 'Nutrition',
      body: 'Macros, not meal plans. A framework you can run yourself for life.',
      bullets: ['Bodyweight + photo trend tracking', 'Refeed & diet break protocols', 'Restaurant strategy'],
    },
    {
      n: '03', icon: 'award', title: 'Contest Prep',
      body: 'For men eyeing the Men\u2019s Physique competitive stage. Training, nutrition, and weekly check-in video replies, with optional posing add-ons.',
      bullets: ['Bulking / cutting plans', 'Tailored weekly macro discussion', 'Peak week & rebound guidance', 'Posing guidance (add-on)'],
    },
  ];
  return (
    <section id="services">
      <div className="wrap">
        <div className="eyebrow">Services</div>
        <h2 className="h-section" style={{ marginTop: 12 }}>What we coach.</h2>
        <div className="rule" />
        <div className="m-1 m-gap" style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 28, marginTop: 56 }}>
          {services.map(s => (
            <article key={s.n} style={{
              background: '#fff', border: '1px solid var(--border)', borderRadius: 6, overflow: 'hidden',
              transition: 'all 200ms cubic-bezier(.16,1,.3,1)',
            }}
              onMouseEnter={e => { e.currentTarget.style.transform = 'translateY(-3px)'; e.currentTarget.style.boxShadow = '0 8px 24px rgba(17,20,24,0.08)'; }}
              onMouseLeave={e => { e.currentTarget.style.transform = 'translateY(0)'; e.currentTarget.style.boxShadow = 'none'; }}>
              <div style={{ background: 'var(--accent-wash)', padding: '40px 28px', borderBottom: '1px solid var(--border)' }}>
                <Icon name={s.icon} size={36} style={{ color: 'var(--accent)' }} />
                <div style={{ fontSize: 11, fontWeight: 600, letterSpacing: '0.22em', color: 'var(--accent)', textTransform: 'uppercase', marginTop: 18 }}>{s.n} · {s.title}</div>
              </div>
              <div style={{ padding: 28 }}>
                <p style={{ fontSize: 15, color: 'var(--fg)', marginTop: 0, marginBottom: 18, lineHeight: 1.55 }}>{s.body}</p>
                <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 10 }}>
                  {s.bullets.map(b => (
                    <li key={b} style={{ fontSize: 13, color: 'var(--fg-2)', display: 'flex', gap: 10, alignItems: 'flex-start' }}>
                      <span style={{ color: 'var(--accent)', marginTop: 2 }}>—</span>{b}
                    </li>
                  ))}
                </ul>
                <a href="#apply" style={{
                  marginTop: 22, fontSize: 12, fontWeight: 600, color: 'var(--accent)',
                  textTransform: 'uppercase', letterSpacing: '0.18em', display: 'inline-flex', alignItems: 'center', gap: 8, textDecoration: 'none', whiteSpace: 'nowrap'
                }}>Learn more <Icon name="arrow-right" size={14} style={{ color: 'var(--accent)' }} /></a>
              </div>
            </article>
          ))}
        </div>
      </div>
    </section>
  );
};

// ---------- Coach bio ----------
//
// Body copy is JP's real story, delivered by Content 2026-05-22.
// Source: /RxR/Content/Coach Bio - Final Copy
//
// Two photos are NOT YET available — placeholder treatment in use until JP
// uploads. See Design Inbox: 2026-05-21 — [CONTENT→DESIGN] — Coach Bio photos
// The placeholder is designed to carry the narrative on its own (date stamps
// + caption strips do the storytelling) so the section reads as intentional,
// not broken, until the real photos drop in.

const bioBodyStyle = {
  fontSize: 17,
  lineHeight: 1.7,
  color: 'rgba(255,255,255,0.82)',
  marginBottom: 22,
  maxWidth: '62ch',
};

const bioPullStyle = {
  fontFamily: 'var(--font-headline)',
  fontWeight: 600,
  fontSize: 30,
  lineHeight: 1.15,
  letterSpacing: '0.005em',
  textTransform: 'uppercase',
  color: '#fff',
  margin: '40px 0',
  padding: '4px 0 4px 22px',
  borderLeft: '2px solid var(--accent)',
  maxWidth: '62ch',
};

// Single before/after photo frame. Accepts an optional `src` — when provided
// the real image renders and the placeholder content drops out. Until then
// the date + label IS the visual.
const BeforeAfterPhoto = ({ eyebrow, dateLarge, captionDate, captionContext, placeholderSub, src }) => {
  const hatchId = `hatch-${eyebrow.replace(/\s+/g, '')}`;
  return (
    <div>
      <div style={{
        position: 'relative',
        aspectRatio: '4 / 5',
        background: 'rgba(255,255,255,0.02)',
        border: '1px solid rgba(255,255,255,0.12)',
        overflow: 'hidden',
      }}>
        {src ? (
          <img src={src} alt={`Jason ${eyebrow}`} style={{ width: '100%', height: '100%', objectFit: 'cover' }} />
        ) : (
          <React.Fragment>
            {/* Faint diagonal hatch — texture, never noise */}
            <svg style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', opacity: 0.05 }}>
              <defs>
                <pattern id={hatchId} patternUnits="userSpaceOnUse" width="10" height="10" patternTransform="rotate(45)">
                  <line x1="0" y1="0" x2="0" y2="10" stroke="#fff" strokeWidth="1" />
                </pattern>
              </defs>
              <rect width="100%" height="100%" fill={`url(#${hatchId})`} />
            </svg>

            {/* Corner brackets — top-left + bottom-right, reads as "frame" */}
            <div style={{
              position: 'absolute', top: 16, left: 16, width: 18, height: 18,
              borderTop: '1px solid rgba(255,255,255,0.35)',
              borderLeft: '1px solid rgba(255,255,255,0.35)',
            }} />
            <div style={{
              position: 'absolute', bottom: 16, right: 16, width: 18, height: 18,
              borderBottom: '1px solid rgba(255,255,255,0.35)',
              borderRight: '1px solid rgba(255,255,255,0.35)',
            }} />

            {/* Centered date stamp — the storytelling element */}
            <div style={{
              position: 'absolute', inset: 0,
              display: 'flex', flexDirection: 'column',
              alignItems: 'center', justifyContent: 'center',
              padding: 24, textAlign: 'center',
            }}>
              <div style={{
                fontSize: 10, fontWeight: 700,
                letterSpacing: '0.32em', textTransform: 'uppercase',
                color: 'var(--rxr-sapphire-tint)', marginBottom: 16,
              }}>{eyebrow}</div>
              <div style={{
                fontFamily: 'var(--font-display)',
                fontSize: 'clamp(56px, 7vw, 84px)',
                lineHeight: 0.92, color: '#fff',
                letterSpacing: '-0.01em',
              }}>{dateLarge}</div>
              <div style={{
                fontSize: 11, color: 'rgba(255,255,255,0.45)',
                marginTop: 20, letterSpacing: '0.04em',
              }}>{placeholderSub}</div>
            </div>
          </React.Fragment>
        )}
      </div>
      {/* Caption strip — uppercase, wide tracking, date in white */}
      <div style={{
        marginTop: 14,
        fontSize: 10, fontWeight: 600,
        letterSpacing: '0.22em', textTransform: 'uppercase',
        color: 'rgba(255,255,255,0.5)',
        display: 'flex', gap: 8, flexWrap: 'wrap',
      }}>
        <span style={{ color: '#fff' }}>{captionDate}</span>
        {captionContext && <span>·</span>}
        {captionContext && <span>{captionContext}</span>}
      </div>
    </div>
  );
};

const CoachBio = () => (
  <section id="coach" className="bg-dark" style={{ paddingTop: 112, paddingBottom: 120 }}>
    <div className="wrap">
      {/* Header — centered, sets the section */}
      <div style={{ textAlign: 'center', maxWidth: 760, margin: '0 auto 64px' }}>
        <div className="eyebrow" style={{ color: 'var(--rxr-sapphire-tint)' }}>The Coach</div>
        <h2 className="h-section" style={{ marginTop: 14 }}>
          I became the coach I couldn't find.
        </h2>
        <div className="rule" style={{ margin: '36px auto 0' }} />
      </div>

      {/* 2×2 photo grid — left col: before / right col: current prep */}
      <div className="m-1 m-gap" style={{
        display: 'grid',
        gridTemplateColumns: '1fr 1fr',
        gap: 20,
        maxWidth: 880,
        margin: '0 auto 80px',
      }}>
        <BeforeAfterPhoto
          eyebrow="Before"
          dateLarge="2023"
          captionDate="October 2023"
          captionContext="The Before"
          src="./assets/coach/coach-before-1.jpg"
        />
        <BeforeAfterPhoto
          eyebrow="Week 44"
          dateLarge="Jun '26"
          captionDate="June 2026"
          captionContext="The After"
          src="./assets/coach/coach-current-1.jpg"
        />
        <BeforeAfterPhoto
          eyebrow="Before"
          dateLarge="2023"
          captionDate="October 2023"
          captionContext="The Before"
          src="./assets/coach/coach-before-2.jpg"
        />
        <BeforeAfterPhoto
          eyebrow="Week 44"
          dateLarge="Jun '26"
          captionDate="June 2026"
          captionContext="The After"
          src="./assets/coach/coach-current-2.jpg"
        />
      </div>

      {/* Body — single column, essay pacing */}
      <div style={{ maxWidth: '62ch', margin: '0 auto' }}>
        <p style={bioBodyStyle}>
          I spent my 20s and 30s doing what most guys do in the gym. Show up for a few months. Get frustrated. Fall off. Start over.
        </p>
        <p style={bioBodyStyle}>
          I was skinny fat. Soft in the middle, not much elsewhere. A photo from a friend's birthday party in 2023 made it undeniable. I didn't like what I saw. So I stopped repeating the cycle and started doing the actual work.
        </p>
        <p style={bioBodyStyle}>
          I built my own program. Tracked my macros. Stayed consistent with my nutrition. Not for a week. Not for a month. For 18 months. The results came slowly, then undeniably. Muscle. Structure. A physique I didn't recognize from the one in that photo.
        </p>
        <p style={bioBodyStyle}>
          Then I found a YouTube video of a 23-year-old prepping for a men's physique show. I watched it. Then watched another. And came out the other side thinking: there's no reason I can't do that too.
        </p>

        {/* Pull moment — the age reveal */}
        <p style={bioPullStyle}>I was 43.</p>

        <p style={bioBodyStyle}>
          I reached out to 8 coaches over 2.5 months. All of them had polished websites. Solid social followings. Respectable physiques. Not one of them called me back. I noticed something in that silence.
        </p>
        <p style={bioBodyStyle}>
          Everyone wants to coach people who are already sold on the idea. Nobody wants to work with the guy who's starting from zero. The guy with a job and a life and zero guarantee he'll stick with it. That's where the real work is.
        </p>

        {/* Pull moment — the pivot */}
        <p style={bioPullStyle}>So I became that coach.</p>

        <p style={bioBodyStyle}>
          Rep by Rep is built on the actual experience of being a 40-something guy buried under work and life, who knows the gym matters but can't figure out how to make it work. Who's tired of starting over. Who needs to know someone's been here before and knows exactly what to do.
        </p>
        <p style={bioBodyStyle}>
          I'm not a 25-year-old influencer with perfect genetics. I'm not selling you a secret. I'm selling you the thing that actually works: a framework, consistency, and a coach who actually shows up when you message him.
        </p>
        <p style={bioBodyStyle}>
          I'm currently in contest prep for my first show, July 2026. Not because I'm chasing wins. Because I needed to prove it to myself, and to <strong>every client I coach</strong>. That the process works. That it scales. That a guy in his 40s with a full life can build a competitive physique in less than 18 months.
        </p>
        <p style={{ ...bioBodyStyle, marginBottom: 0 }}>
          That's the proof. Everything else is just details.
        </p>
      </div>

      {/* Stats row — bookend dates from the photo placeholders */}
      <div style={{
        display: 'flex', gap: 64, justifyContent: 'center',
        marginTop: 80, paddingTop: 36,
        borderTop: '1px solid rgba(255,255,255,0.18)',
        flexWrap: 'wrap',
      }}>
        {[
          ['2023', 'The photo that started it'],
          ['WK 44', 'Current stage prep'],
          ['Jul 2026', 'First competition'],
        ].map(([n, l]) => (
          <div key={l} style={{ textAlign: 'center' }}>
            <div style={{ fontFamily: 'var(--font-display)', fontSize: 40, color: '#fff', lineHeight: 1, letterSpacing: '-0.005em' }}>{n}</div>
            <div style={{ fontSize: 10, letterSpacing: '0.22em', textTransform: 'uppercase', color: 'rgba(255,255,255,0.55)', marginTop: 12, fontWeight: 600 }}>{l}</div>
          </div>
        ))}
      </div>
    </div>
  </section>
);

// ---------- Results / Testimonial ----------
// ---------- Results / Testimonials (auto-cycling) ----------
// Quotes are placeholder until Content/JP supply real ones (with permission).
// To add more: drop entries into TESTIMONIALS. The carousel handles any count.
const TESTIMONIALS = [
  {
    quote: ['I hopped around from one workout plan to another and barely tracked what I ate. Coach Jason put me on a plan that fit my lifestyle and the equipment I had access to, and kept me consistent in the kitchen and on the road. ', 'Down 23 lbs', ' and finally seeing the muscle tone and definition I\'ve been after.'],
    name: 'John', meta: '48 \u00b7 Training + Nutrition',
  },
  {
    quote: ['With 2 kids and an MBA in progress, the gym was always an afterthought — something I\'d get to eventually. That eventually never came. Coach Jason got my diet in check, helped me set PRs on lifts consistently, and gave me more confidence than I\'ve had in years. ', 'My only regret is I didn\'t call him sooner.', ''],
    name: 'Aaron', meta: '35 \u00b7 Training + Nutrition',
  },
  {
    quote: ['I was a shirt-on-at-the-pool guy for most of my adult life. Connecting all the pieces never seemed to work when I tried on my own. Getting a coach changed everything. ', 'Down 42 lbs', ', stronger, and I actually enjoy the food I get to eat. This isn\'t bland chicken and rice — it\'s a plan built for my life.'],
    name: 'Nate', meta: '41 \u00b7 Training + Nutrition',
  },
];

const Results = () => {
  const [active, setActive] = React.useState(0);
  const [paused, setPaused] = React.useState(false);
  const count = TESTIMONIALS.length;

  React.useEffect(() => {
    if (paused) return;
    const id = setInterval(() => setActive(a => (a + 1) % count), 6000);
    return () => clearInterval(id);
  }, [paused, count]);

  const go = (i) => setActive((i + count) % count);

  return (
    <section id="results">
      <div className="wrap">
        <div className="eyebrow">Results</div>
        <h2 className="h-section" style={{ marginTop: 12, maxWidth: 800 }}>Earned, not given.</h2>
        <div className="rule" />

        <div
          style={{
            marginTop: 56, background: 'var(--bg-wash)', border: '1px solid var(--border)', borderRadius: 6,
            padding: 64, position: 'relative', minHeight: 320,
            display: 'flex', flexDirection: 'column', justifyContent: 'center',
          }}
          onMouseEnter={() => setPaused(true)}
          onMouseLeave={() => setPaused(false)}
        >
          <div style={{ fontFamily: 'var(--font-display)', fontSize: 96, color: 'var(--accent)', lineHeight: 0.8, marginBottom: 12, opacity: 0.3 }}>"</div>

          <div style={{ display: 'grid' }}>
            {TESTIMONIALS.map((t, i) => (
              <blockquote
                key={i}
                aria-hidden={i !== active}
                style={{
                  margin: 0, fontFamily: 'var(--font-headline)', fontWeight: 500,
                  fontSize: 32, lineHeight: 1.25, color: 'var(--fg)', letterSpacing: '0.01em',
                  textTransform: 'uppercase', maxWidth: '26ch',
                  gridArea: '1 / 1',
                  opacity: i === active ? 1 : 0,
                  transition: 'opacity 500ms cubic-bezier(.16,1,.3,1)',
                  pointerEvents: i === active ? 'auto' : 'none',
                }}
              >
                {t.quote.length === 3
                  ? <>{t.quote[0]}<em style={{ color: 'var(--accent)', fontStyle: 'normal' }}>{t.quote[1]}</em>{t.quote[2]}</>
                  : t.quote[0]}
              </blockquote>
            ))}
          </div>

          <div style={{ marginTop: 32, display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 16, flexWrap: 'wrap' }}>
            <div>
              <div style={{ fontSize: 14, fontWeight: 600, color: 'var(--fg)' }}>{TESTIMONIALS[active].name}</div>
              <div style={{ fontSize: 12, color: 'var(--fg-3)' }}>{TESTIMONIALS[active].meta}</div>
            </div>

            {/* Controls — dots + arrows */}
            <div style={{ display: 'flex', alignItems: 'center', gap: 18 }}>
              <div style={{ display: 'flex', gap: 8 }}>
                {TESTIMONIALS.map((_, i) => (
                  <button
                    key={i}
                    onClick={() => go(i)}
                    aria-label={`Testimonial ${i + 1}`}
                    style={{
                      width: i === active ? 22 : 8, height: 8, borderRadius: 4, border: 0, padding: 0, cursor: 'pointer',
                      background: i === active ? 'var(--accent)' : 'var(--border-strong)',
                      transition: 'all 300ms cubic-bezier(.16,1,.3,1)',
                    }}
                  />
                ))}
              </div>
              <div style={{ display: 'flex', gap: 8 }}>
                <button onClick={() => go(active - 1)} aria-label="Previous" style={{ background: 'transparent', border: '1px solid var(--border-strong)', borderRadius: 4, padding: 7, cursor: 'pointer', display: 'flex', color: 'var(--fg)' }}>
                  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round"><polyline points="15 18 9 12 15 6"/></svg>
                </button>
                <button onClick={() => go(active + 1)} aria-label="Next" style={{ background: 'transparent', border: '1px solid var(--border-strong)', borderRadius: 4, padding: 7, cursor: 'pointer', display: 'flex', color: 'var(--fg)' }}>
                  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round"><polyline points="9 18 15 12 9 6"/></svg>
                </button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
};

// ---------- Apply CTA ----------
const ApplyCTA = () => (
  <section id="apply" className="bg-dark" style={{ padding: '128px 0' }}>
    <div className="wrap" style={{ textAlign: 'center' }}>
      <div className="eyebrow" style={{ color: 'var(--rxr-sapphire-tint)' }}>Apply</div>
      <h2 className="h-display" style={{ color: '#fff', marginTop: 18, fontSize: 'clamp(48px, 8vw, 96px)' }}>
        Your best physique<br />is still ahead of you.
      </h2>
      <div style={{ width: 64, height: 2, background: 'var(--accent)', margin: '32px auto 0' }} />
      <p style={{ fontSize: 18, color: 'rgba(255,255,255,0.7)', marginTop: 32, maxWidth: '56ch', marginLeft: 'auto', marginRight: 'auto' }}>
        Applications open monthly. Contest Prep caps at 12 spots. If we're a fit, we'll know in thirty minutes.
      </p>
      <a href="#apply" className="btn btn-primary" style={{ marginTop: 40, padding: '18px 32px', fontSize: 14 }}>
        Apply for Coaching <Icon name="arrow-right" size={16} color="white" />
      </a>
    </div>
  </section>
);

// ---------- Footer ----------
const Footer = () => (
  <footer style={{ background: '#0a0d10', color: 'rgba(255,255,255,0.7)', padding: '64px 0 32px' }}>
    <div className="wrap">
      <div className="m-2 m-gap" style={{ display: 'grid', gridTemplateColumns: '1.4fr 1fr 1fr 1fr', gap: 48 }}>
        <div>
          <img src="./assets/logo-mark-mono.svg" width="64" height="64" />
          <p style={{ fontSize: 13, marginTop: 18, lineHeight: 1.6, maxWidth: '32ch' }}>
            Online coaching for men 30 and up. Training, nutrition, and Men&apos;s Physique prep, whether you&apos;re chasing your first real physique or your first stage.
          </p>
        </div>
        {[
          ['Coaching', ['Method', 'Services', 'Pricing', 'Apply']],
          ['Resources', ['FAQ', 'Field Notes', 'Free Macro Guide', '3-Week Reset']],
          ['Company', ['About Jason', 'Results', 'Contact']],
        ].map(([t, items]) => (
          <div key={t}>
            <div style={{ fontSize: 10, fontWeight: 600, letterSpacing: '0.22em', textTransform: 'uppercase', color: 'rgba(255,255,255,0.5)' }}>{t}</div>
            <ul style={{ listStyle: 'none', padding: 0, margin: '20px 0 0', display: 'flex', flexDirection: 'column', gap: 12 }}>
              {items.map(i => {
                const href = i === 'Contact' ? '#contact' : i === 'Apply' ? '#apply' : '#';
                return <li key={i}><a href={href} style={{ color: 'rgba(255,255,255,0.85)', fontSize: 14, textDecoration: 'none' }}>{i}</a></li>;
              })}
            </ul>
          </div>
        ))}
      </div>
      <div style={{
        marginTop: 64, paddingTop: 24, borderTop: '1px solid rgba(255,255,255,0.1)',
        display: 'flex', justifyContent: 'space-between', alignItems: 'center', fontSize: 12, color: 'rgba(255,255,255,0.4)',
      }}>
        <div style={{ display: 'flex', gap: 24, alignItems: 'center', flexWrap: 'wrap' }}>
          <span>&copy; 2026 Rep By Rep, LLC · repxrep.fit</span>
          <a href="/privacy-policy" style={{ color: 'rgba(255,255,255,0.4)', textDecoration: 'none', transition: 'color 150ms' }}
            onMouseEnter={e => e.currentTarget.style.color = 'rgba(255,255,255,0.75)'}
            onMouseLeave={e => e.currentTarget.style.color = 'rgba(255,255,255,0.4)'}>Privacy Policy</a>
        </div>
        <div style={{ letterSpacing: '0.32em', fontWeight: 600 }}>EARNED EVERY DAY</div>
      </div>
    </div>
  </footer>
);

Object.assign(window, { Nav, Hero, Process, Services, CoachBio, Results, ApplyCTA, Footer });
