// Four hero treatments for RangehandIQ.
// Shared system: warm paper, bark ink, oxblood accent, sage support.
// Sans = Geist; editorial italic = Instrument Serif; data = Geist Mono.

// Brand palette — pulled from the logo (oxblood Rangehand, slate IQ, copper mountains).
const RANCH_TOKENS = {
  paper: 'oklch(0.945 0.018 75)',
  paperSoft: 'oklch(0.965 0.012 75)',
  paperWarm: 'oklch(0.92 0.022 70)',
  ink: 'oklch(0.22 0.020 55)',         // dark cow silhouette
  inkSoft: 'oklch(0.42 0.022 60)',
  inkMute: 'oklch(0.55 0.018 70)',
  brandRed: 'oklch(0.44 0.115 28)',    // "Rangehand" oxblood
  brandRedDark: 'oklch(0.36 0.110 28)',
  brandSlate: 'oklch(0.55 0.040 235)', // "IQ" slate blue
  brandCopper: 'oklch(0.63 0.125 55)', // mountain copper
  brandTan: 'oklch(0.58 0.060 75)',    // tagline gold
  hair: 'oklch(0.86 0.015 75)',
  hairStrong: 'oklch(0.78 0.018 75)',
};

const sansStack = '"Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif';
const serifStack = '"Instrument Serif", "Source Serif 4", Georgia, serif';
const monoStack  = '"Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace';

// ─────────────────────────────────────────────────────────────────────────
// Shared bits

// Typographic wordmark in brand colors. The full pictorial logo (cow + calf
// + copper mountains) is used as a featured element below; nav uses just the
// type so it stays clean at small sizes.
function Wordmark({ inverted = false, size = 17, letterSpacing = '-0.005em' }) {
  const red   = inverted ? 'oklch(0.72 0.115 28)'  : RANCH_TOKENS.brandRed;
  const slate = inverted ? 'oklch(0.78 0.060 235)' : RANCH_TOKENS.brandSlate;
  return (
    <div style={{
      display: 'flex', alignItems: 'baseline',
      fontFamily: sansStack, fontSize: size,
      letterSpacing, lineHeight: 1, fontWeight: 600,
    }}>
      <span style={{ color: red }}>Rangehand</span>
      <span style={{ color: slate }}>IQ</span>
    </div>
  );
}

// Full logo lockup (image). The logo files have baked-in backgrounds, so we
// rely on blend modes: multiply drops the light cream BG onto our paper, and
// the dark version sits on its own brown plate as a stamp on photo overlays.
function LogoLockup({ inverted = false, height = 96 }) {
  const src = inverted ? 'img/logo-dark.png' : 'img/logo-light.png';
  return (
    <img src={src} alt="RangehandIQ — Built for the Ranches That Built the West"
      style={{ height, width: 'auto', display: 'block' }} />
  );
}

function NavLink({ children, color = RANCH_TOKENS.ink, opacity = 0.78 }) {
  return (
    <a href="#" style={{
      fontFamily: sansStack, fontSize: 13, fontWeight: 450,
      color, textDecoration: 'none', letterSpacing: '0.01em',
      opacity, transition: 'opacity .15s',
    }}>{children}</a>
  );
}

// Nav: links are {label, href}. The last item is the primary "Request access"
// CTA (rendered as a pill). In private beta we link only to in-page anchors —
// no page-level routes exist yet, so any item without an href is skipped.
const DEFAULT_NAV_ITEMS = [
  { label: 'How it works', href: '#features' },
  { label: 'The report',   href: '#report'   },
  { label: 'About',        href: '#founder'  },
  { label: 'Request access', href: '#early-access' },
];

function Nav({ inverted = false, items = DEFAULT_NAV_ITEMS, lockupHeight = 56 }) {
  const c = inverted ? RANCH_TOKENS.paper : RANCH_TOKENS.ink;
  const links = items.slice(0, -1);
  const cta = items[items.length - 1];
  return (
    <nav style={{
      display: 'flex', alignItems: 'center', justifyContent: 'space-between',
      padding: '20px 56px', position: 'relative', zIndex: 2,
    }}>
      <LogoLockup inverted={inverted} height={lockupHeight} />
      <div style={{ display: 'flex', alignItems: 'center', gap: 36 }}>
        {links.map((it) => (
          <a key={it.label} href={it.href} style={{
            fontFamily: sansStack, fontSize: 13, fontWeight: 500,
            color: c, textDecoration: 'none', letterSpacing: '0.002em',
          }}>{it.label}</a>
        ))}
        <a href={cta.href} style={{
          fontFamily: sansStack, fontSize: 13, fontWeight: 500,
          color: c, textDecoration: 'none',
          padding: '8px 16px',
          border: `1px solid ${inverted ? 'rgba(241,233,212,.5)' : RANCH_TOKENS.hairStrong}`,
          borderRadius: 999,
        }}>{cta.label}</a>
      </div>
    </nav>
  );
}

function PrimaryCTA({ children = 'See a sample report', size = 'lg' }) {
  const pad = size === 'lg' ? '14px 24px' : '10px 18px';
  const fs = size === 'lg' ? 14 : 13;
  return (
    <a href="#" style={{
      display: 'inline-flex', alignItems: 'center', gap: 10,
      fontFamily: sansStack, fontSize: fs, fontWeight: 500,
      color: RANCH_TOKENS.paper, background: RANCH_TOKENS.brandRed,
      textDecoration: 'none', letterSpacing: '0.005em',
      padding: pad, borderRadius: 2,
    }}>
      {children}
      <span style={{ fontSize: 16, lineHeight: 1, marginTop: -1 }}>→</span>
    </a>
  );
}

function SecondaryCTA({ children = 'Talk to us', color = RANCH_TOKENS.ink, size = 'lg' }) {
  const pad = size === 'lg' ? '14px 22px' : '10px 16px';
  const fs = size === 'lg' ? 14 : 13;
  return (
    <a href="#" style={{
      display: 'inline-flex', alignItems: 'center', gap: 8,
      fontFamily: sansStack, fontSize: fs, fontWeight: 500,
      color, textDecoration: 'none',
      padding: pad, borderRadius: 2,
      borderBottom: `1px solid ${color}`,
      paddingBottom: size === 'lg' ? 13 : 9,
    }}>
      {children}
    </a>
  );
}

function Eyebrow({ children, color = RANCH_TOKENS.inkMute, mark = true }) {
  return (
    <div style={{
      display: 'flex', alignItems: 'center', gap: 12,
      fontFamily: monoStack, fontSize: 11, fontWeight: 400,
      color, letterSpacing: '0.16em', textTransform: 'uppercase',
    }}>
      {mark && <span style={{
        width: 18, height: 1, background: color, opacity: 0.6,
      }} />}
      {children}
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────
// HERO 1 — Full-bleed pasture, immersive

function Hero1() {
  return (
    <div data-screen-label="01 Full-bleed" style={{
      width: '100%', height: '100%', position: 'relative',
      background: RANCH_TOKENS.ink, overflow: 'hidden',
      fontFamily: sansStack,
    }}>
      <img src="img/cattle-drive.jpg" alt="" style={{
        position: 'absolute', inset: 0, width: '100%', height: '100%',
        objectFit: 'cover', objectPosition: 'center 32%',
      }} />
      {/* Warm dark gradient on the left for legibility */}
      <div style={{
        position: 'absolute', inset: 0,
        background: 'linear-gradient(95deg, rgba(28,22,16,.78) 0%, rgba(28,22,16,.55) 38%, rgba(28,22,16,.15) 60%, rgba(28,22,16,0) 80%)',
      }} />
      {/* Subtle vignette */}
      <div style={{
        position: 'absolute', inset: 0,
        background: 'linear-gradient(180deg, rgba(28,22,16,.35) 0%, rgba(28,22,16,0) 22%, rgba(28,22,16,0) 70%, rgba(28,22,16,.45) 100%)',
      }} />

      <div style={{ position: 'relative', zIndex: 1 }}>
        <Nav inverted />
      </div>

      <div style={{
        position: 'absolute', left: 56, right: 56, bottom: 56,
        display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between', gap: 80,
        zIndex: 1,
      }}>
        <div style={{ maxWidth: 720 }}>
          <Eyebrow color="rgba(241,233,212,.7)">Built for the ranches that built the West</Eyebrow>
          <h1 style={{
            margin: '24px 0 0',
            fontFamily: sansStack, fontWeight: 400,
            fontSize: 76, lineHeight: 1.02, letterSpacing: '-0.025em',
            color: RANCH_TOKENS.paper,
          }}>
            The financial advisor<br />
            every big ranch has.<br />
            <span style={{ fontFamily: serifStack, fontStyle: 'italic', fontWeight: 400 }}>
              Now built for yours.
            </span>
          </h1>
          <p style={{
            margin: '32px 0 0', maxWidth: 600,
            fontFamily: sansStack, fontSize: 22, lineHeight: 1.42,
            color: 'rgba(241,233,212,.88)', fontWeight: 350, letterSpacing: '-0.005em',
          }}>
            Your ranch's financial advisor &mdash; connected to your books, fluent in cattle.
          </p>
          <div style={{ display: 'flex', alignItems: 'center', gap: 8, marginTop: 40 }}>
            <PrimaryCTA>See a sample report</PrimaryCTA>
            <SecondaryCTA color={RANCH_TOKENS.paper}>Talk to us</SecondaryCTA>
          </div>
        </div>

        {/* Right anchor: location stamp */}
        <div style={{
          color: 'rgba(241,233,212,.65)', textAlign: 'right',
          fontFamily: monoStack, fontSize: 11, letterSpacing: '0.12em',
          textTransform: 'uppercase', lineHeight: 1.7,
          flex: '0 0 auto',
        }}>
          41.8754° N<br />113.2944° W<br />
          <span style={{ opacity: 0.5 }}>Elev. 5,331 ft</span>
        </div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────
// HERO 2 — Editorial split (text left, photo right)

function Hero2() {
  return (
    <div data-screen-label="02 Editorial split" style={{
      width: '100%', height: '100%', display: 'flex',
      background: RANCH_TOKENS.paper, fontFamily: sansStack,
    }}>
      <div style={{
        flex: '1 1 58%', display: 'flex', flexDirection: 'column',
        padding: '0', position: 'relative',
      }}>
        <Nav />

        <div style={{ flex: 1, display: 'flex', flexDirection: 'column', justifyContent: 'center', padding: '0 80px 56px' }}>
          <Eyebrow>Built for the ranches that built the West</Eyebrow>
          <h1 style={{
            margin: '28px 0 0', maxWidth: 680,
            fontFamily: sansStack, fontWeight: 400,
            fontSize: 64, lineHeight: 1.04, letterSpacing: '-0.024em',
            color: RANCH_TOKENS.ink, textWrap: 'pretty',
          }}>
            The financial advisor every big ranch has.{' '}
            <span style={{ fontFamily: serifStack, fontStyle: 'italic', fontWeight: 400, color: RANCH_TOKENS.rust }}>
              Now built for yours.
            </span>
          </h1>

          <div style={{
            display: 'grid', gridTemplateColumns: '120px 1fr',
            gap: 32, marginTop: 40, maxWidth: 600,
          }}>
            <div style={{
              fontFamily: monoStack, fontSize: 11,
              color: RANCH_TOKENS.inkMute, letterSpacing: '0.14em',
              textTransform: 'uppercase', paddingTop: 6,
              borderTop: `1px solid ${RANCH_TOKENS.hair}`,
            }}>
              Sub-head
            </div>
            <p style={{
              margin: 0, fontFamily: sansStack, fontSize: 21,
              lineHeight: 1.4, color: RANCH_TOKENS.inkSoft, fontWeight: 350,
              letterSpacing: '-0.005em',
              borderTop: `1px solid ${RANCH_TOKENS.hair}`, paddingTop: 16,
            }}>
              Your ranch's financial advisor — connected to your books, fluent in cattle.
            </p>
          </div>

          <div style={{ display: 'flex', alignItems: 'center', gap: 4, marginTop: 44 }}>
            <PrimaryCTA>See a sample report</PrimaryCTA>
            <SecondaryCTA>Talk to us</SecondaryCTA>
          </div>

          <div style={{
            marginTop: 56, display: 'flex', gap: 32, alignItems: 'center',
            fontFamily: monoStack, fontSize: 11, color: RANCH_TOKENS.inkMute,
            letterSpacing: '0.12em', textTransform: 'uppercase',
          }}>
            <span>$595 / yr</span>
            <span style={{ opacity: 0.4 }}>·</span>
            <span>30-day trial</span>
            <span style={{ opacity: 0.4 }}>·</span>
            <span>No card to start</span>
          </div>
        </div>
      </div>

      <div style={{
        flex: '1 1 42%', position: 'relative', overflow: 'hidden',
        background: RANCH_TOKENS.paperWarm,
      }}>
        <PhotoPlaceholder
          tone="warm"
          caption="Black cattle in corral"
          sub="Portrait · working scene · dust + wood rails"
        />
        <div style={{
          position: 'absolute', left: 24, right: 24, bottom: 24,
          display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end',
          fontFamily: monoStack, fontSize: 10,
          color: 'rgba(241,233,212,.85)', letterSpacing: '0.16em',
          textTransform: 'uppercase',
        }}>
          <span style={{
            background: 'rgba(28,22,16,.55)', backdropFilter: 'blur(4px)',
            padding: '8px 12px', borderRadius: 1,
          }}>Park Valley · Box Elder Co. · UT</span>
          <span style={{ opacity: .8 }}>$595 / yr — 30-day trial</span>
        </div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────
// HERO 3 — Horizon plate (austere, gallery-style)

function Hero3() {
  return (
    <div data-screen-label="03 Horizon plate" style={{
      width: '100%', height: '100%',
      background: RANCH_TOKENS.paperSoft, fontFamily: sansStack,
      display: 'flex', flexDirection: 'column',
    }}>
      <Nav />

      <div style={{
        flex: 1, padding: '12px 80px 56px',
        display: 'flex', flexDirection: 'column',
      }}>
        <div style={{
          display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between',
          paddingBottom: 24, gap: 60,
        }}>
          <h1 style={{
            margin: 0, maxWidth: 920,
            fontFamily: sansStack, fontWeight: 400,
            fontSize: 80, lineHeight: 0.98, letterSpacing: '-0.028em',
            color: RANCH_TOKENS.ink,
          }}>
            The financial advisor every big ranch has.
            <br />
            <span style={{ fontFamily: serifStack, fontStyle: 'italic', fontWeight: 400, color: RANCH_TOKENS.rust }}>
              Now built for yours.
            </span>
          </h1>
          <div style={{
            flex: '0 0 auto', textAlign: 'right',
            fontFamily: monoStack, fontSize: 11, color: RANCH_TOKENS.inkMute,
            letterSpacing: '0.14em', textTransform: 'uppercase', lineHeight: 1.8,
          }}>
            Issue No. 01<br />
            <span style={{ color: RANCH_TOKENS.ink }}>Spring 2026</span>
          </div>
        </div>

        {/* The plate — wide horizon photo */}
        <div style={{
          flex: 1, position: 'relative', overflow: 'hidden',
          minHeight: 280,
          boxShadow: '0 1px 0 rgba(0,0,0,.04), 0 24px 60px -30px rgba(28,22,16,.35)',
        }}>
          <img src="img/cattle-drive.jpg" alt="" style={{
            position: 'absolute', inset: 0, width: '100%', height: '100%',
            objectFit: 'cover', objectPosition: 'center 38%',
          }} />
        </div>

        <div style={{
          display: 'grid', gridTemplateColumns: '1.4fr 1fr 1fr 1fr',
          gap: 48, paddingTop: 28, alignItems: 'flex-start',
        }}>
          <div>
            <p style={{
              margin: 0, fontFamily: sansStack, fontSize: 19,
              lineHeight: 1.4, color: RANCH_TOKENS.inkSoft, fontWeight: 350,
              letterSpacing: '-0.005em',
              maxWidth: 460,
            }}>
              Your ranch's financial advisor — connected to your books, fluent in cattle.
            </p>
            <div style={{ display: 'flex', alignItems: 'center', gap: 4, marginTop: 24 }}>
              <PrimaryCTA size="md">See a sample report</PrimaryCTA>
              <SecondaryCTA size="md">Talk to us</SecondaryCTA>
            </div>
          </div>
          {[
            ['Built for', 'Cow-calf · 250–1,000 hd'],
            ['Region', 'ID · UT · WY · MT · NV · CO'],
            ['Subscription', '$595 / year'],
          ].map(([k, v]) => (
            <div key={k} style={{
              borderTop: `1px solid ${RANCH_TOKENS.hairStrong}`, paddingTop: 12,
            }}>
              <div style={{
                fontFamily: monoStack, fontSize: 10,
                color: RANCH_TOKENS.inkMute, letterSpacing: '0.16em',
                textTransform: 'uppercase', marginBottom: 8,
              }}>{k}</div>
              <div style={{
                fontFamily: sansStack, fontSize: 15, fontWeight: 500,
                color: RANCH_TOKENS.ink, letterSpacing: '-0.005em',
              }}>{v}</div>
            </div>
          ))}
        </div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────
// HERO 4 — Type-driven (no overlay photo, ledger-utility)

function Hero4() {
  return (
    <div data-screen-label="04 Type-driven" style={{
      width: '100%', height: '100%',
      background: RANCH_TOKENS.paper, fontFamily: sansStack,
      display: 'flex', flexDirection: 'column', position: 'relative',
    }}>
      <Nav />

      <div style={{
        flex: 1, padding: '32px 80px 0',
        display: 'flex', flexDirection: 'column',
      }}>
        <div style={{
          display: 'flex', justifyContent: 'space-between',
          fontFamily: monoStack, fontSize: 11, color: RANCH_TOKENS.inkMute,
          letterSpacing: '0.14em', textTransform: 'uppercase',
          paddingBottom: 28, borderBottom: `1px solid ${RANCH_TOKENS.hairStrong}`,
        }}>
          <span>Cow-calf · 250–1,000 head</span>
          <span>ID · UT · WY · MT · NV · CO</span>
          <span>Est. Park Valley, UT</span>
          <span>$595 / yr</span>
        </div>

        <h1 style={{
          margin: '52px 0 0',
          fontFamily: sansStack, fontWeight: 400,
          fontSize: 124, lineHeight: 0.92, letterSpacing: '-0.038em',
          color: RANCH_TOKENS.ink, textWrap: 'balance',
        }}>
          The financial advisor<br />
          every big ranch has.<br />
          <span style={{
            fontFamily: serifStack, fontStyle: 'italic', fontWeight: 400,
            color: RANCH_TOKENS.brandRed, letterSpacing: '-0.025em',
          }}>
            Now built for yours.
          </span>
        </h1>

        <div style={{
          marginTop: 28, display: 'flex', alignItems: 'center', gap: 16,
          fontFamily: serifStack, fontSize: 22, fontStyle: 'italic',
          color: RANCH_TOKENS.brandTan,
        }}>
          <span style={{ width: 28, height: 1, background: RANCH_TOKENS.brandTan, opacity: .6 }} />
          Your banker wants reports. Your ranch runs on instinct. RangehandIQ speaks both.
        </div>

        <div style={{
          marginTop: 48, display: 'flex', alignItems: 'flex-end',
          justifyContent: 'space-between', gap: 60,
        }}>
          <p style={{
            margin: 0, maxWidth: 560,
            fontFamily: sansStack, fontSize: 21, lineHeight: 1.4,
            color: RANCH_TOKENS.inkSoft, fontWeight: 350, letterSpacing: '-0.005em',
          }}>
            Your ranch's financial advisor &mdash; connected to your books, fluent in cattle.
          </p>
          <div style={{ display: 'flex', alignItems: 'center', gap: 4, flexShrink: 0 }}>
            <PrimaryCTA>See a sample report</PrimaryCTA>
            <SecondaryCTA>Talk to us</SecondaryCTA>
          </div>
        </div>

        {/* Photo strip — small, captioned, ledger-style */}
        <div style={{
          marginTop: 'auto', paddingTop: 40,
          display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 12,
        }}>
          {[
            ['real', 'img/cattle-drive.jpg', '01 — Trailing the herd', 'On sage'],
            ['sage', null,                  '02 — Herd at water',     'Stock pond'],
            ['cool', null,                  '03 — Working cattle',    'In the corral'],
            ['warm', null,                  '04 — Calving pasture',   'Spring grass'],
          ].map(([kind, src, cap, sub]) => (
            <figure key={cap} style={{ margin: 0 }}>
              <div style={{
                aspectRatio: '4 / 3', position: 'relative', overflow: 'hidden',
                background: RANCH_TOKENS.paperWarm,
              }}>
                {kind === 'real'
                  ? <img src={src} alt="" style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover' }} />
                  : <PhotoPlaceholder tone={kind} caption={cap.split('— ')[1]} sub={sub} />}
              </div>
              <figcaption style={{
                marginTop: 8, paddingBottom: 16,
                fontFamily: monoStack, fontSize: 10,
                color: RANCH_TOKENS.inkMute, letterSpacing: '0.14em',
                textTransform: 'uppercase',
              }}>{cap}</figcaption>
            </figure>
          ))}
        </div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────
// Photo placeholder — used until real cattle imagery is dropped in.
// Subtle diagonal stripes in warm earth tones, mono caption explaining
// what shot belongs there. NOT decorative — informative.
function PhotoPlaceholder({ caption, sub, tone = 'warm', objectPosition }) {
  const palettes = {
    warm:  ['oklch(0.55 0.06 50)',  'oklch(0.48 0.05 45)'],   // dust + earth
    cool:  ['oklch(0.62 0.04 230)', 'oklch(0.55 0.04 230)'],  // sky + sage shadow
    sage:  ['oklch(0.58 0.04 110)', 'oklch(0.50 0.04 110)'],
    night: ['oklch(0.32 0.030 50)', 'oklch(0.24 0.025 50)'],
  };
  const [a, b] = palettes[tone] || palettes.warm;
  return (
    <div style={{
      position: 'absolute', inset: 0, overflow: 'hidden',
      background: `repeating-linear-gradient(135deg, ${a} 0 22px, ${b} 22px 44px)`,
    }}>
      <div style={{
        position: 'absolute', inset: 0,
        background: 'radial-gradient(ellipse at 50% 60%, rgba(0,0,0,0) 0%, rgba(0,0,0,.18) 100%)',
      }} />
      <div style={{
        position: 'absolute', left: '50%', top: '50%',
        transform: 'translate(-50%, -50%)', textAlign: 'center',
        fontFamily: monoStack, color: 'rgba(248,242,225,.92)',
        letterSpacing: '0.16em', textTransform: 'uppercase',
        padding: '14px 18px',
        background: 'rgba(28,22,16,.45)', backdropFilter: 'blur(2px)',
        borderRadius: 1,
      }}>
        <div style={{ fontSize: 11, fontWeight: 500 }}>Photo placeholder</div>
        <div style={{ fontSize: 13, fontWeight: 500, marginTop: 6, letterSpacing: '0.08em' }}>{caption}</div>
        {sub && <div style={{ fontSize: 10, opacity: .7, marginTop: 6, letterSpacing: '0.14em' }}>{sub}</div>}
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────
// HERO 3 — Variations on the horizon plate
// User selected: Hero 3 as direction. Plate = calving pasture (placeholder
// where image is missing). Mark = "Now in private beta". Ledger row stays.
// CTA copy = "Request access" / "Talk to us".
// Four directions exploring: photo, headline treatment, layout, color register.
// ─────────────────────────────────────────────────────────────────────────

// Shared bits

function BetaMark({ tone = 'paper' }) {
  const c = tone === 'paper' ? RANCH_TOKENS.inkMute : 'oklch(0.78 0.020 70)';
  const dot = RANCH_TOKENS.brandRed;
  return (
    <div style={{
      display: 'inline-flex', alignItems: 'center', gap: 10,
      fontFamily: monoStack, fontSize: 11,
      color: c, letterSpacing: '0.16em', textTransform: 'uppercase',
    }}>
      <span style={{
        display: 'inline-block', width: 7, height: 7, borderRadius: 999,
        background: dot, boxShadow: `0 0 0 3px ${dot}22`,
      }} />
      Now in private beta
    </div>
  );
}

function Plate({ src, position = 'center 50%', children, minHeight = 280, ratio }) {
  return (
    <div style={{
      flex: ratio == null ? 1 : 'unset',
      flexBasis: ratio,
      position: 'relative', overflow: 'hidden',
      minHeight,
      boxShadow: '0 1px 0 rgba(0,0,0,.04), 0 24px 60px -30px rgba(28,22,16,.35)',
      background: RANCH_TOKENS.paperWarm,
    }}>
      {src
        ? <img src={src} alt="" style={{
            position: 'absolute', inset: 0, width: '100%', height: '100%',
            objectFit: 'cover', objectPosition: position,
          }} />
        : children}
    </div>
  );
}

function LedgerCell({ k, v, color = RANCH_TOKENS.ink, mute = RANCH_TOKENS.inkMute, hair = RANCH_TOKENS.hairStrong }) {
  return (
    <div style={{ borderTop: `1px solid ${hair}`, paddingTop: 12 }}>
      <div style={{
        fontFamily: monoStack, fontSize: 10,
        color: mute, letterSpacing: '0.16em',
        textTransform: 'uppercase', marginBottom: 8,
      }}>{k}</div>
      <div style={{
        fontFamily: sansStack, fontSize: 15, fontWeight: 500,
        color, letterSpacing: '-0.005em',
      }}>{v}</div>
    </div>
  );
}

const LEDGER = [
  ['Built for', 'Cow-calf · 250–1,000 hd'],
  ['Standards', 'FFSC-aligned · lender-ready'],
  ['Beta pricing', '$595 / year'],
];

// ─────────────────────────────────────────────────────────────────────────
// 3A — Refined baseline. Sans + serif-italic. Calving plate (placeholder).

function Hero3A() {
  return (
    <div data-screen-label="3A Refined baseline" style={{
      width: '100%', height: '100%',
      background: RANCH_TOKENS.paperSoft, fontFamily: sansStack,
      display: 'flex', flexDirection: 'column',
    }}>
      <Nav />
      <div style={{ flex: 1, padding: '12px 80px 56px', display: 'flex', flexDirection: 'column' }}>
        <div style={{
          display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between',
          paddingBottom: 24, gap: 60,
        }}>
          <h1 style={{
            margin: 0, maxWidth: 920,
            fontFamily: sansStack, fontWeight: 400,
            fontSize: 80, lineHeight: 0.98, letterSpacing: '-0.028em',
            color: RANCH_TOKENS.ink,
          }}>
            The financial advisor every big ranch has.<br />
            <span style={{ fontFamily: serifStack, fontStyle: 'italic', fontWeight: 400, color: RANCH_TOKENS.brandRed }}>
              Now built for yours.
            </span>
          </h1>
          <div style={{ flex: '0 0 auto', textAlign: 'right' }}>
            <BetaMark />
          </div>
        </div>
        <Plate src="img/rider-herd-pasture.jpg" position="center 58%" />
        <div style={{
          display: 'grid', gridTemplateColumns: '1.4fr 1fr 1fr 1fr',
          gap: 48, paddingTop: 28, alignItems: 'flex-start',
        }}>
          <div>
            <p style={{
              margin: 0, maxWidth: 460,
              fontFamily: sansStack, fontSize: 19, lineHeight: 1.4,
              color: RANCH_TOKENS.inkSoft, fontWeight: 350, letterSpacing: '-0.005em',
            }}>
              Your ranch's financial advisor — connected to your books, fluent in cattle.
            </p>
            <div style={{ display: 'flex', alignItems: 'center', gap: 4, marginTop: 24 }}>
              <PrimaryCTA size="md">Request access</PrimaryCTA>
              <SecondaryCTA size="md">Talk to us</SecondaryCTA>
            </div>
          </div>
          {LEDGER.map(([k, v]) => <LedgerCell key={k} k={k} v={v} />)}
        </div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────
// 3B — All-sans, larger headline, color-shift only. Riders / winter sage.

function Hero3B() {
  return (
    <div data-screen-label="3B All-sans, larger" style={{
      width: '100%', height: '100%',
      background: RANCH_TOKENS.paperSoft, fontFamily: sansStack,
      display: 'flex', flexDirection: 'column',
    }}>
      <Nav />
      <div style={{ flex: 1, padding: '8px 80px 52px', display: 'flex', flexDirection: 'column' }}>
        <div style={{
          display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between',
          paddingBottom: 20, gap: 60,
        }}>
          <h1 style={{
            margin: 0, maxWidth: 1100,
            fontFamily: sansStack, fontWeight: 400,
            fontSize: 96, lineHeight: 0.94, letterSpacing: '-0.034em',
            color: RANCH_TOKENS.ink,
          }}>
            The financial advisor<br />
            every big ranch has.<br />
            <span style={{ color: RANCH_TOKENS.brandRed, fontWeight: 400 }}>
              Now built for yours.
            </span>
          </h1>
          <div style={{ flex: '0 0 auto', textAlign: 'right', paddingTop: 12 }}>
            <BetaMark />
          </div>
        </div>
        <Plate src="img/riders-sage-winter.jpg" position="center 60%" minHeight={240} />
        <div style={{
          display: 'grid', gridTemplateColumns: '1.4fr 1fr 1fr 1fr',
          gap: 48, paddingTop: 24, alignItems: 'flex-start',
        }}>
          <div>
            <p style={{
              margin: 0, maxWidth: 460,
              fontFamily: sansStack, fontSize: 19, lineHeight: 1.4,
              color: RANCH_TOKENS.inkSoft, fontWeight: 350, letterSpacing: '-0.005em',
            }}>
              Your ranch's financial advisor — connected to your books, fluent in cattle.
            </p>
            <div style={{ display: 'flex', alignItems: 'center', gap: 4, marginTop: 22 }}>
              <PrimaryCTA size="md">Request access</PrimaryCTA>
              <SecondaryCTA size="md">Talk to us</SecondaryCTA>
            </div>
          </div>
          {LEDGER.map(([k, v]) => <LedgerCell key={k} k={k} v={v} />)}
        </div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────
// 3C — Centered classical. Mark left, location right, headline centered,
// plate below, ledger split 4-up, sub + CTAs centered below the ledger.

function Hero3C() {
  return (
    <div data-screen-label="3C Centered classical" style={{
      width: '100%', height: '100%',
      background: RANCH_TOKENS.paperSoft, fontFamily: sansStack,
      display: 'flex', flexDirection: 'column',
    }}>
      <Nav />
      <div style={{ flex: 1, padding: '4px 80px 44px', display: 'flex', flexDirection: 'column' }}>
        <div style={{
          display: 'flex', alignItems: 'center', justifyContent: 'space-between',
          paddingBottom: 18,
        }}>
          <BetaMark />
          <div style={{
            fontFamily: monoStack, fontSize: 11,
            color: RANCH_TOKENS.inkMute, letterSpacing: '0.16em', textTransform: 'uppercase',
          }}>Park Valley · Box Elder Co. · UT</div>
        </div>
        <h1 style={{
          margin: '4px 0 22px', textAlign: 'center', textWrap: 'balance',
          fontFamily: sansStack, fontWeight: 400,
          fontSize: 76, lineHeight: 1.0, letterSpacing: '-0.028em',
          color: RANCH_TOKENS.ink,
        }}>
          The financial advisor every big ranch has.{' '}
          <span style={{ fontFamily: serifStack, fontStyle: 'italic', color: RANCH_TOKENS.brandRed, whiteSpace: 'nowrap' }}>
            Now built for yours.
          </span>
        </h1>
        <Plate src="img/riders-corral-fall.jpg" position="center 40%" minHeight={240} />
        <div style={{
          display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)',
          gap: 56, paddingTop: 24, alignItems: 'flex-start',
        }}>
          {LEDGER.map(([k, v]) => <LedgerCell key={k} k={k} v={v} />)}
        </div>
        <div style={{
          display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 4,
          marginTop: 20,
        }}>
          <PrimaryCTA size="md">Request access</PrimaryCTA>
          <SecondaryCTA size="md">Talk to us</SecondaryCTA>
        </div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────
// 3D — Dark band. Type + plate up top on paper; ledger + sub + CTAs reverse
// onto a bark band along the bottom — visually anchors the page in earth.

function Hero3D() {
  const dark = 'oklch(0.22 0.020 50)';
  const darkHair = 'oklch(0.32 0.020 55)';
  const darkInk = 'oklch(0.94 0.018 75)';
  const darkMute = 'oklch(0.70 0.020 70)';
  return (
    <div data-screen-label="3D Dark band" style={{
      width: '100%', height: '100%',
      background: RANCH_TOKENS.paperSoft, fontFamily: sansStack,
      display: 'flex', flexDirection: 'column',
    }}>
      <Nav />
      <div style={{ flex: 1, padding: '10px 80px 0', display: 'flex', flexDirection: 'column' }}>
        <div style={{
          display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between',
          paddingBottom: 22, gap: 60,
        }}>
          <h1 style={{
            margin: 0, maxWidth: 940,
            fontFamily: sansStack, fontWeight: 400,
            fontSize: 78, lineHeight: 0.98, letterSpacing: '-0.028em',
            color: RANCH_TOKENS.ink,
          }}>
            The financial advisor every big ranch has.<br />
            <span style={{ fontFamily: serifStack, fontStyle: 'italic', fontWeight: 400, color: RANCH_TOKENS.brandRed }}>
              Now built for yours.
            </span>
          </h1>
          <div style={{ flex: '0 0 auto', textAlign: 'right' }}>
            <BetaMark />
          </div>
        </div>
        <Plate src="img/roper-corral.jpg" position="center 55%" minHeight={220} />
      </div>
      <div style={{
        background: dark, color: darkInk,
        padding: '32px 80px 36px',
        display: 'grid', gridTemplateColumns: '1.4fr 1fr 1fr 1fr',
        gap: 48, alignItems: 'flex-start',
      }}>
        <div>
          <p style={{
            margin: 0, maxWidth: 480,
            fontFamily: sansStack, fontSize: 19, lineHeight: 1.4,
            color: darkInk, fontWeight: 350, letterSpacing: '-0.005em',
          }}>
            The financial package your lender already wants. Built on FFSC standards, generated from the books you already keep.
          </p>
          <div style={{ display: 'flex', alignItems: 'center', gap: 4, marginTop: 22 }}>
            <PrimaryCTA size="md">Request access</PrimaryCTA>
            <a href="#" style={{
              display: 'inline-flex', alignItems: 'center', gap: 8,
              fontFamily: sansStack, fontSize: 13, fontWeight: 500,
              color: darkInk, textDecoration: 'none',
              padding: '10px 16px 9px', borderRadius: 2,
              borderBottom: `1px solid ${darkInk}`,
            }}>Talk to us</a>
          </div>
          <p style={{
            margin: '18px 0 0', maxWidth: 480,
            fontFamily: monoStack, fontSize: 10,
            color: darkMute, letterSpacing: '0.06em',
            lineHeight: 1.5,
          }}>
            Financial intelligence software. RangehandIQ is not a registered investment advisor and does not provide investment advice.
          </p>
        </div>
        {LEDGER.map(([k, v]) => (
          <LedgerCell key={k} k={k} v={v} color={darkInk} mute={darkMute} hair={darkHair} />
        ))}
      </div>
    </div>
  );
}

Object.assign(window, { Hero1, Hero2, Hero3, Hero4, Hero3A, Hero3B, Hero3C, Hero3D, PhotoPlaceholder, RANCH_TOKENS });
