/* Angainor Marketing landing (UI kit). Composes the design-system primitives
   from window.AngainorDesignSystem_56fc16 over warm, editorial layout.
   Exposed as window.AngainorMarketing.Landing */
const NS = window.AngainorDesignSystem_56fc16 || {};
const { Button, Badge, Tag, Toast, Card, LedgerRow, ProvenanceChip, KeyValue, Avatar } = NS;

/* one-time keyframes for ambient float + entrance (upsert so hot-reloads pick up new CSS) */
(function injectMk(){
  if (typeof document === 'undefined') return;
  let s = document.getElementById('mk-css');
  if (!s) { s = document.createElement('style'); s.id = 'mk-css'; document.head.appendChild(s); }
  s.textContent = `
   .mk{ --nav-h:72px; }
   .mk a.nlink{ color:var(--text-secondary); font-size:var(--text-sm); font-weight:var(--fw-medium); letter-spacing:var(--ls-snug); text-decoration:none; transition:color var(--dur-fast) var(--ease-standard); }
   .mk a.nlink:hover{ color:var(--text-primary); }
   .mk-floats{ position:relative; }
   .mk-float{ position:absolute; will-change:transform; }
   @keyframes mk-bob-a{ 0%,100%{ transform:translateY(0) rotate(0deg) } 50%{ transform:translateY(-22px) rotate(-1.4deg) } }
   @keyframes mk-bob-b{ 0%,100%{ transform:translateY(0) rotate(0deg) } 50%{ transform:translateY(18px) rotate(1deg) } }
   @keyframes mk-bob-c{ 0%,100%{ transform:translateY(0) rotate(0deg) } 50%{ transform:translateY(-14px) rotate(1.6deg) } }
   .mk-bob-a{ animation:mk-bob-a 8s var(--ease-in-out) infinite; }
   .mk-bob-b{ animation:mk-bob-b 10s var(--ease-in-out) infinite; }
   .mk-bob-c{ animation:mk-bob-c 7s var(--ease-in-out) infinite; }
   @keyframes mk-rise{ from{ transform:translateY(44px) } to{ transform:translateY(0) } }
   .mk-rise{ animation:mk-rise 0.9s var(--ease-out) both; }
   /* scroll reveals — hidden state only exists under .mk-anim (added by JS), so no-JS/print/export always show content */
   @media (prefers-reduced-motion: no-preference){
     .mk-anim .mk-reveal{ opacity:0; transform:translateY(56px); transition:opacity .95s var(--ease-out), transform .95s var(--ease-out); transition-delay:var(--rv-delay,0ms); will-change:opacity,transform; }
     .mk-anim .mk-reveal--left{ transform:translateX(-72px); }
     .mk-anim .mk-reveal--right{ transform:translateX(72px); }
     .mk-anim .mk-reveal--scale{ transform:scale(.9) translateY(28px); }
     .mk-anim .mk-reveal.is-in{ opacity:1; transform:none; }
   }
   @media print{ .mk-reveal{ opacity:1 !important; transform:none !important; } .mk-word{ opacity:1 !important; } }
   @media (max-width:1100px){ .mk-float.mk-bob-c{ display:none; } }
   .mk-static .mk-bob-a,.mk-static .mk-bob-b,.mk-static .mk-bob-c{ animation:none !important; }
   @media (prefers-reduced-motion: reduce){ .mk-bob-a,.mk-bob-b,.mk-bob-c,.mk-rise{ animation:none !important; } }
   .mk-nav--scrolled{ background:rgba(248,243,234,.82); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); border-bottom:1px solid var(--border-subtle); }

   /* ==========================================================
      Masthead motion (Floema-style): staggered load reveals with
      long expo-out easing, wordmark rises out of a clip mask, the
      mark rises from the fold, tagline fades up last. On scroll
      the mark lags the page (parallax) via the independent
      CSS translate property so it composes with the animations.
      ========================================================== */

   html{ scroll-behavior:smooth; }
   #how-it-works{ scroll-margin-top: calc(var(--nav-h) + 8px); }

   .mk-mast{ height: min(calc(100vh - var(--nav-h)), 920px); }

   @keyframes mk-mast-reveal{ from{ transform:translateY(105%) } to{ transform:none } }
   @keyframes mk-mast-rise{ from{ transform:translateY(14vh) } to{ transform:none } }
   @keyframes mk-fade-up{ from{ opacity:0; transform:translateY(26px) } to{ opacity:1; transform:none } }
   @keyframes mk-arrow-bob{ 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(5px) } }
   .mk-mast-logo{ display:block; width:100%; animation: mk-mast-reveal 1.2s cubic-bezier(0.19,1,0.22,1) .1s both; }
   .mk-mast-mark{ animation: mk-mast-rise 1.35s cubic-bezier(0.19,1,0.22,1) .22s both; }
   .mk-mast-mark-svg{ display:block; width:100%; height:auto; }
   .mk-mast-tag{ animation: mk-fade-up .9s var(--ease-out) .62s both; }
   .mk-mast-tag .ph-arrow-down{ display:inline-block; animation: mk-arrow-bob 2.4s var(--ease-in-out) 2s infinite; }
   @media (prefers-reduced-motion: reduce){
     .mk-mast-logo, .mk-mast-mark, .mk-mast-tag, .mk-mast-tag .ph-arrow-down{ animation:none !important; }
   }


   .mk-split > *, .mk-grid-3 > * { min-width: 0; }
   .mk img { max-width: 100%; }

   /* --- tablet: 3-up becomes 2-up --- */
   @media (max-width: 1024px){
     .mk-grid-3{ grid-template-columns: repeat(2, 1fr) !important; }
   }

   /* --- narrower desktops: bias the mark right so it clears the tagline --- */
   @media (max-width: 1200px) and (min-width: 901px){
     .mk-mast-mark{ left: 24% !important; width: 52vw !important; }
   }

   /* --- narrow: stack everything --- */
   @media (max-width: 900px){
     .mk-split{ grid-template-columns: 1fr !important; gap: 36px !important; }

     /* the masthead is the whole story on mobile: no hero, no CTAs */
     .mk-hero{ display:none !important; }

     .mk-mast{ height:auto; min-height:calc(100vh - var(--nav-h)); min-height:calc(100svh - var(--nav-h)); display:flex; flex-direction:column;
       /* one seamless wash on mobile: the desktop glow's ellipse edges read as smudges on narrow screens */
       background: linear-gradient(180deg, #F8F3EA 0%, #F8F3EA 40%, #F4E3CC 74%, #ECD2AC 100%) !important; }
     /* iOS compositing: the grain's multiply overlay and the mark's filter
        shadow each force layers that break blending over the gradient,
        leaving pale rectangles. Strip both on mobile. */
     .mk-mast.ang-grain::after{ display:none !important; }
     .mk-mast-mark{ filter:none !important; }
     /* Floema mobile composition: wordmark up top with clear side
        margins, the mark's tip just crossing the middle 'a', tagline
        pinned to the bottom left. The mark is static on mobile. */
     .mk-mast-logo-wrap{ position:static !important; width:74vw !important; margin:8vh auto 0 !important; }
     .mk-mast-mark{ position:static !important; width:min(82vw, 560px) !important; margin:calc(-5vw - 9px) auto 56px !important; animation:none !important; }
     .mk-mast-tag{ position:static !important; margin:auto var(--gutter) 40px !important; }

     /* horizontal reveal offsets would push past the viewport edge */
     .mk-anim .mk-reveal--left,
     .mk-anim .mk-reveal--right{ transform: translateY(44px); }

   }

   /* --- short phone viewports (browser bars): compact the masthead
      so the tagline always lands inside the first screen --- */
   @media (max-width: 900px) and (max-height: 700px){
     .mk-mast-logo-wrap{ margin-top: 5vh !important; }
     .mk-mast-mark{ width: min(72vw, 400px) !important; margin-bottom: 44px !important; }
   }

   /* --- phone: single column, roomier editorial rhythm --- */
   @media (max-width: 640px){
     .mk{ --gutter: 24px; --section-y: 96px; }
     .mk-grid-3{ grid-template-columns: 1fr !important; gap: 34px !important; }
     /* dark status-quo items read as a ruled list */
     .mk-grid-sq > * + *{ border-top: 1px solid var(--border-on-dark); padding-top: 30px; }
   }

   @media (max-width: 430px){
     .mk-kv2{ grid-template-columns: 1fr !important; }
     /* stacked full-width buttons */
     .mk-hero-btns, .mk-cta-btns{ flex-direction: column; align-items: stretch; }
     .mk-hero-btns .ang-btn, .mk-cta-btns .ang-btn{ width: 100%; }
   }
  `;
})();

const GUTTER = { paddingLeft: 'var(--gutter)', paddingRight: 'var(--gutter)' };
const CONTAIN = { maxWidth: 'var(--maxw)', marginLeft: 'auto', marginRight: 'auto', ...GUTTER };

function Eyebrow({ children, onDark }) {
  return <div style={{ fontFamily: 'var(--mk-label-font, var(--font-sans))', fontSize: 'var(--text-xs)', fontWeight: 'var(--mk-label-weight, 700)', letterSpacing: 'var(--mk-label-spacing, 0.1em)', textTransform: 'uppercase', color: onDark ? 'var(--mk-accent-on-dark, var(--accent))' : 'var(--text-accent)' }}>{children}</div>;
}

/* ---------------- Masthead (giant wordmark + stone logomark) ---------------- */
function Masthead() {
  return (
    <section className="mk-mast ang-grain" style={{ position: 'relative', background: 'radial-gradient(120% 70% at 50% 104%, rgba(238,196,143,0.85) 0%, rgba(242,222,192,0.35) 40%, rgba(248,243,234,0) 72%), radial-gradient(55% 38% at 50% 102%, rgba(242,85,0,0.12) 0%, rgba(242,85,0,0) 60%), #F8F3EA', overflow: 'hidden' }}>
      <div className="mk-mast-logo-wrap" style={{ position: 'absolute', top: '13%', left: 0, right: 0, margin: '0 auto', width: 'min(76vw, 1200px)', overflow: 'hidden', zIndex: 1 }}>
        <img className="mk-mast-logo" src="assets/img/wordmark-black.png" alt="Angainor" />
      </div>
      <div className="mk-mast-mark" style={{ position: 'absolute', left: 0, right: 0, bottom: 0, margin: '0 auto', width: 'min(46vw, 620px)', zIndex: 2, filter: 'drop-shadow(0 26px 42px rgba(41,35,28,0.24)) drop-shadow(0 5px 12px rgba(41,35,28,0.14))' }}>
        <svg className="mk-mast-mark-svg" viewBox="0 0 240 217" aria-hidden="true">
          <defs>
            <linearGradient id="angStone" x1="0" y1="0" x2="0.25" y2="1">
              <stop offset="0" stopColor="#DCD3C4" />
              <stop offset="0.55" stopColor="#BFB3A0" />
              <stop offset="1" stopColor="#978A75" />
            </linearGradient>
            <filter id="angNoise">
              <feTurbulence type="fractalNoise" baseFrequency="0.75" numOctaves="2" stitchTiles="stitch" result="n" />
              <feColorMatrix in="n" type="matrix" values="0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0.6 0.6 0.6 0 0" result="alphaN" />
              <feComposite in="alphaN" in2="SourceGraphic" operator="in" />
            </filter>
          </defs>
          <path d="M119 0 L0 217 L101 217 L101 158 L139 158 L139 217 L239 217 L180 108 L152 108 L152 59 Z" fill="url(#angStone)" />
          <path d="M119 0 L0 217 L101 217 L101 158 L139 158 L139 217 L239 217 L180 108 L152 108 L152 59 Z" fill="#4A4034" filter="url(#angNoise)" opacity="0.18" />
        </svg>
      </div>
      <div className="mk-mast-tag" style={{ position: 'absolute', left: 'var(--gutter)', bottom: 'clamp(40px, 7vh, 84px)', zIndex: 3, maxWidth: 320 }}>
        <p style={{ fontFamily: 'var(--font-sans)', fontSize: 'var(--text-xl)', fontWeight: 500, lineHeight: 1.32, letterSpacing: 'var(--ls-snug)', color: 'var(--text-primary)', margin: 0 }}>Eliminating data reconstruction in private funds</p>
        <div style={{ height: 1, background: 'var(--border-default)', margin: '20px 0 14px' }} />
        <a href="#how-it-works" style={{ display: 'inline-flex', alignItems: 'center', gap: 8, fontFamily: 'var(--font-sans)', fontSize: 'var(--text-sm)', fontWeight: 500, color: 'var(--text-secondary)', textDecoration: 'none' }}>Here's how we do it <i className="ph ph-arrow-down" style={{ fontSize: 15 }} /></a>
      </div>
    </section>
  );
}

/* ---------------- Nav ---------------- */
function Nav() {
  const [scrolled, setScrolled] = React.useState(false);
  React.useEffect(() => {
    const root = document.querySelector('.mk-scroll') || window;
    const el = document.querySelector('.mk-scroll');
    const onScroll = () => setScrolled((el ? el.scrollTop : window.scrollY) > 12);
    root.addEventListener('scroll', onScroll); onScroll();
    return () => root.removeEventListener('scroll', onScroll);
  }, []);
  return (
    <header className={'mk-nav ' + (scrolled ? 'mk-nav--scrolled' : '')} style={{ position: 'sticky', top: 0, zIndex: 50, height: 'var(--nav-h)', display: 'flex', alignItems: 'center', transition: 'background var(--dur-base), border-color var(--dur-base)' }}>
      <nav className="mk-navbar" style={{ ...CONTAIN, display: 'flex', alignItems: 'center', width: '100%' }}>
        <a href="#" style={{ display: 'flex', alignItems: 'center' }}><img src={window.__resources.comboBlack} alt="Angainor" style={{ height: 22 }} /></a>
      </nav>
    </header>
  );
}

/* ---------------- Hero ---------------- */
function Hero() {
  return (
    <section style={{ position: 'relative', overflow: 'hidden', background: 'var(--mk-hero, linear-gradient(168deg, #F8F3EA 0%, #F4E6D4 46%, #E9C9A6 100%))' }} className="ang-grain mk-hero">
      <div className="mk-hero-grid" style={{ ...CONTAIN, position: 'relative', display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center', paddingTop: 'clamp(56px,8vw,120px)', paddingBottom: 'clamp(56px,8vw,120px)' }}>
        <div className="mk-rise" style={{ position: 'relative', zIndex: 2 }}>
          <h1 style={{ fontFamily: 'var(--font-display)', fontWeight: 400, fontSize: 'var(--display-1)', lineHeight: 1.03, letterSpacing: 'var(--ls-tight)', margin: '20px auto 0', maxWidth: '25ch', textWrap: 'balance', color: 'var(--text-primary)' }}>
            Purpose-built infrastructure for private fund operations.
          </h1>
          <p style={{ fontSize: 'var(--text-md)', lineHeight: 1.6, color: 'var(--text-secondary)', maxWidth: '46ch', margin: '22px auto 0' }}>
            Angainor is redefining fund accounting and administration using a blockchain-based system of record.
          </p>
          <div className="mk-hero-btns" style={{ display: 'flex', gap: 12, justifyContent: 'center', marginTop: 30, flexWrap: 'wrap' }}>
            <Button size="lg" href="mailto:info@angainor.finance?subject=Angainor%20demo%20request&body=Hi%20Aydan%2C%0D%0A%0D%0AI%27d%20like%20to%20book%20a%20demo%20of%20Angainor.%0D%0A">Book a demo</Button>
          </div>
        </div>

      </div>
    </section>
  );
}

/* ---------------- Scroll word-reveal headline (adapted from TextRevealByWord; native scroll math, no framer-motion) ---------------- */
function RevealHeadline({ segments, style }) {
  const ref = React.useRef(null);
  const [p, setP] = React.useState(0);
  React.useEffect(() => {
    if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) { setP(1); return; }
    let raf = 0;
    const onScroll = () => {
      if (raf) return;
      raf = requestAnimationFrame(() => {
        raf = 0;
        const el = ref.current; if (!el) return;
        const r = el.getBoundingClientRect();
        const vh = window.innerHeight;
        setP(Math.min(1, Math.max(0, (vh * 0.92 - r.top) / (vh * 0.5))));
      });
    };
    window.addEventListener('scroll', onScroll, { passive: true });
    onScroll();
    return () => { window.removeEventListener('scroll', onScroll); if (raf) cancelAnimationFrame(raf); };
  }, []);
  const words = [];
  segments.forEach((seg, si) => seg.text.split(' ').forEach((w) => words.push({ w, si })));
  const N = words.length;
  return (
    <h2 ref={ref} style={{ display: 'flex', flexWrap: 'wrap', gap: '0.04em 0.28em', ...style }}>
      {words.map((item, i) => {
        const o = Math.min(1, Math.max(0, p * N - i));
        return <span key={i} className="mk-word" style={{ opacity: 0.16 + 0.84 * o, transition: 'opacity 100ms linear', ...(segments[item.si].style || {}) }}>{item.w}</span>;
      })}
    </h2>
  );
}

/* ---------------- Status quo (dark) ---------------- */
function StatusQuo() {
  return (
    <section className="ang-grain" style={{ background: 'var(--surface-dark)', color: 'var(--text-on-dark)' }}>
      <div style={{ ...CONTAIN, paddingTop: 'var(--section-y)', paddingBottom: 'var(--section-y)' }}>
        <div className="mk-reveal" style={{ maxWidth: 760 }}>
          <Eyebrow onDark>The status quo</Eyebrow>
          <RevealHeadline
            segments={[{ text: 'The fund\u2019s truth is fragmented, so finality must be reconstructed rather than verified.' }]}
            style={{ fontFamily: 'var(--font-display)', fontWeight: 400, fontSize: 'var(--display-2)', lineHeight: 1.08, letterSpacing: 'var(--ls-tight)', margin: '18px 0 0', color: 'var(--text-on-dark)' }}
          />
        </div>
        <div className="mk-grid-3 mk-grid-sq" style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 36, marginTop: 56 }}>
          {[
            ['envelope-simple', 'Email-driven approvals', 'Decisions live in inboxes. Determining the fund\u2019s current state with confidence is slow; tracing how it changed is harder still.'],
            ['table', 'Spreadsheet reconciliation', 'Each party keeps separate records and reconciles them later. Routine processes become tedious data-reconstruction exercises.'],
            ['copy-simple', 'Shadow systems', 'Outsource to an administrator and still run a parallel system to verify the work, or build a large in-house team amid a talent shortage.'],
          ].map(([icon, t, d], i) => (
            <div key={t} className="mk-reveal" style={{ '--rv-delay': (i * 150) + 'ms' }}>
              <div style={{ width: 42, height: 42, borderRadius: 'var(--radius-md)', background: 'rgba(244,235,220,.07)', border: '1px solid var(--border-on-dark)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: 'var(--mk-accent-on-dark, var(--accent))' }}>
                <i className={'ph ph-' + icon} style={{ fontSize: 22 }} />
              </div>
              <h3 style={{ fontFamily: 'var(--font-sans)', fontWeight: 600, fontSize: 'var(--text-md)', color: 'var(--text-on-dark)', margin: '16px 0 7px', letterSpacing: 'var(--ls-snug)' }}>{t}</h3>
              <p style={{ fontSize: 'var(--text-sm)', lineHeight: 1.6, color: 'var(--text-inverse-secondary)', margin: 0 }}>{d}</p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ---------------- How it works ---------------- */
function HowItWorks() {
  const steps = [
    ['01', 'scroll', 'Encode', 'Governing documents and their provisions, including side letters and negotiated exceptions, become executable logic in a permissioned ledger.'],
    ['02', 'lightning', 'Execute', 'Every downstream event is processed against that logic at the moment of execution. One verified state, shared by GP, LPs, counsel, and auditors.'],
    ['03', 'seal-check', 'Verify', 'Proof-of-control records not just what happened, but how: which provision applied, what data was used, who had permission, and what approvals occurred.'],
  ];
  return (
    <section id="how-it-works" style={{ background: 'var(--surface-page)' }}>
      <div style={{ ...CONTAIN, paddingTop: 'var(--section-y)', paddingBottom: 'var(--section-y)' }}>
        <div className="mk-reveal" style={{ maxWidth: 720 }}>
          <Eyebrow>How it works</Eyebrow>
          <RevealHeadline
            segments={[{ text: 'Encode the rules once. Execute against them every time.' }]}
            style={{ fontFamily: 'var(--font-display)', fontWeight: 400, fontSize: 'var(--display-2)', lineHeight: 1.08, letterSpacing: 'var(--ls-tight)', margin: '18px 0 0' }}
          />
        </div>
        <div className="mk-grid-3" style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 24, marginTop: 52 }}>
          {steps.map(([n, icon, t, d], i) => (
            <Card key={n} padding="lg" elevation="sm" className="mk-reveal" style={{ display: 'flex', flexDirection: 'column', gap: 14, '--rv-delay': (i * 150) + 'ms' }}>
              <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
                <span style={{ width: 44, height: 44, borderRadius: 'var(--radius-md)', background: 'var(--accent-soft)', color: 'var(--text-accent)', display: 'flex', alignItems: 'center', justifyContent: 'center' }}><i className={'ph ph-' + icon} style={{ fontSize: 23 }} /></span>
                <span style={{ fontFamily: 'var(--font-mono)', fontSize: 'var(--text-xs)', color: 'var(--text-muted)', letterSpacing: 'var(--ls-wide)' }}>{n}</span>
              </div>
              <h3 style={{ fontFamily: 'var(--font-display)', fontWeight: 400, fontSize: 'var(--text-2xl)', letterSpacing: 'var(--ls-tight)', margin: '4px 0 0' }}>{t}</h3>
              <p style={{ fontSize: 'var(--text-sm)', lineHeight: 1.62, color: 'var(--text-secondary)', margin: 0 }}>{d}</p>
            </Card>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ---------------- Proof of control (dark, cinematic) ---------------- */
function ProofOfControl() {
  return (
    <section className="ang-grain" style={{ background: 'linear-gradient(165deg, #322820 0%, #50331f 64%, #7c3416 130%)', color: 'var(--text-on-dark)' }}>
      <div className="mk-split" style={{ ...CONTAIN, paddingTop: 'var(--section-y)', paddingBottom: 'var(--section-y)', display: 'grid', gridTemplateColumns: '1.1fr 0.9fr', gap: 56, alignItems: 'center' }}>
        <div className="mk-reveal mk-reveal--left">
          <Eyebrow onDark>Proof of control</Eyebrow>
          <RevealHeadline
            segments={[
              { text: 'As execution becomes a commodity, the scarce asset is' },
              { text: 'verification.', style: { fontStyle: 'italic', color: 'var(--mk-accent-on-dark, var(--accent))' } },
            ]}
            style={{ fontFamily: 'var(--font-display)', fontWeight: 400, fontSize: 'var(--display-2)', lineHeight: 1.1, letterSpacing: 'var(--ls-tight)', margin: '18px 0 0', color: 'var(--text-on-dark)' }}
          />
          <p style={{ fontSize: 'var(--text-md)', lineHeight: 1.62, color: 'var(--text-inverse-secondary)', maxWidth: '50ch', margin: '22px 0 0' }}>
            Angainor supplies independent, verifiable evidence of what a system actually did: on what authority, against which rule. That verified ground truth is what lets AI and automation operate on fund data without the reconciliation gaps that stall most pilots today.
          </p>
        </div>
        <Card elevation="float" className="ang-grain mk-reveal mk-reveal--right" style={{ display: 'flex', flexDirection: 'column', gap: 16, '--rv-delay': '180ms' }}>
          <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
            <span style={{ fontFamily: 'var(--font-mono)', fontSize: 'var(--text-xs)', color: 'var(--text-tertiary)', letterSpacing: 'var(--ls-wide)' }}>LE-2026-008142</span>
            <ProvenanceChip status="verified" hash="0x9f3c…a71e" />
          </div>
          <div style={{ height: 1, background: 'var(--border-subtle)' }} />
          <div className="mk-kv2" style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 18 }}>
            <KeyValue label="Provision applied" value="LPA §4.2(b)" icon="scroll" />
            <KeyValue label="Data used" value="14 LP commitments" icon="database" />
            <KeyValue label="Authorized by" value="D. Cole, GP" icon="user-circle" />
            <KeyValue label="Approvals" value="Counsel · Admin" icon="check-circle" />
          </div>
          <div style={{ height: 1, background: 'var(--border-subtle)' }} />
          <KeyValue label="Proof digest" value="0x9f3c4b7e…a71e" mono copyable />
        </Card>
      </div>
    </section>
  );
}

/* ---------------- CTA ---------------- */
function CTA() {
  return (
    <section style={{ background: 'var(--surface-page)' }}>
      <div style={{ ...CONTAIN, paddingTop: 'var(--section-y)', paddingBottom: 'var(--section-y)' }}>
        <div className="ang-grain mk-reveal mk-reveal--scale" style={{ background: 'linear-gradient(150deg, #F4E6D4 0%, #EBCDA8 100%)', borderRadius: 'var(--radius-2xl)', padding: 'clamp(36px,5vw,72px)', textAlign: 'center', border: '1px solid var(--accent-soft-border)' }}>
          <img src={window.__resources.markBlack} alt="" style={{ height: 44, margin: '0 auto 22px' }} />
          <h2 style={{ fontFamily: 'var(--font-display)', fontWeight: 400, fontSize: 'var(--display-1)', lineHeight: 1.04, letterSpacing: 'var(--ls-tight)', margin: 0, maxWidth: '18ch', marginLeft: 'auto', marginRight: 'auto' }}>
            Modernize the layer beneath your fund.
          </h2>
          <p style={{ fontSize: 'var(--text-md)', color: 'var(--text-secondary)', maxWidth: '46ch', margin: '18px auto 0', lineHeight: 1.6 }}>
            Without forcing you to abandon existing systems, change fund economics, or alter capital movement.
          </p>
          <div className="mk-cta-btns" style={{ display: 'flex', gap: 12, justifyContent: 'center', marginTop: 30, flexWrap: 'wrap' }}>
            <Button size="lg" iconEnd="arrow-right" href="mailto:info@angainor.finance?subject=Angainor%20demo%20request&body=Hi%20Aydan%2C%0D%0A%0D%0AI%27d%20like%20to%20book%20a%20demo%20of%20Angainor.%0D%0A">Book a demo</Button>
            <Button size="lg" variant="secondary" href="mailto:info@angainor.finance?subject=Angainor%20inquiry">Talk to the team</Button>
          </div>
        </div>
      </div>
    </section>
  );
}

/* ---------------- Footer ---------------- */
function Footer() {
  return (
    <footer className="ang-grain" style={{ background: 'var(--surface-dark-sunk)', color: 'var(--text-on-dark)' }}>
      <div style={{ ...CONTAIN, paddingTop: 64, paddingBottom: 40 }}>
        <div>
          <img src={window.__resources.comboWhite} alt="Angainor" style={{ height: 24 }} />
          <p style={{ fontSize: 'var(--text-sm)', color: 'var(--text-inverse-secondary)', lineHeight: 1.6, maxWidth: '32ch', margin: '18px 0 0' }}>
            The governed operating substrate beneath the fund: a single verified state every party can rely on.
          </p>
        </div>
        <div style={{ display: 'flex', alignItems: 'center', marginTop: 56, paddingTop: 24, borderTop: '1px solid var(--border-on-dark)' }}>
          <span style={{ fontSize: 'var(--text-xs)', color: 'var(--text-muted)' }}>© 2026 Angainor, Inc. All rights reserved.</span>
        </div>
      </div>
    </footer>
  );
}

function Landing() {
  React.useEffect(() => {
    const root = document.querySelector('.mk');
    if (!root || window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
    root.classList.add('mk-anim');
    const io = new IntersectionObserver((es) => {
      es.forEach((e) => { if (e.isIntersecting) { e.target.classList.add('is-in'); io.unobserve(e.target); } });
    }, { threshold: 0.16, rootMargin: '0px 0px -6% 0px' });
    root.querySelectorAll('.mk-reveal').forEach((el) => io.observe(el));
    // hero parallax — uses the independent `translate` property so it composes with the bob animation's transform
    const layers = [[root.querySelector('.mk-mast-mark'), 0.24], [root.querySelector('.mk-mast-logo-wrap'), 0.10]].filter((l) => l[0]);
    let raf = 0;
    const onScroll = () => {
      if (raf) return;
      raf = requestAnimationFrame(() => {
        raf = 0;
        if (root.closest('.mk-static') || window.innerWidth <= 900) { layers.forEach((l) => { l[0].style.translate = ''; }); return; }
        const y = window.scrollY;
        layers.forEach((l) => { l[0].style.translate = '0 ' + (y * l[1]).toFixed(1) + 'px'; });
      });
    };
    window.addEventListener('scroll', onScroll, { passive: true });
    onScroll();
    return () => { window.removeEventListener('scroll', onScroll); io.disconnect(); if (raf) cancelAnimationFrame(raf); };
  }, []);
  return (
    <div className="mk">
      <Nav />
      <main>
        <Masthead />
        <Hero />
        <StatusQuo />
        <HowItWorks />
        <ProofOfControl />
        <CTA />
      </main>
      <Footer />
    </div>
  );
}

window.AngainorMarketing = { Landing };
