// refi-scenes.jsx — "Which VA refinance fits the job?" explainer
// Same NMC / Stride video language: navy field, Montserrat + one Playfair italic pivot, mono eyebrows.

const rfP = (st, start, dur = 0.7) => clamp((st - start) / dur, 0, 1);
const rfUp = (p, dist = 24) => ({
  opacity: p,
  transform: `translateY(${(1 - Easing.easeOutCubic(p)) * dist}px)`,
});
const RF_I = ({ children, color }) => (
  <span style={{ fontFamily: FONT_SERIF, fontStyle: 'italic', color: color || BRAND.accent, fontWeight: 500 }}>{children}</span>
);
const RF_CASH = '#F2C66D'; // warm gold for the cash-out path — same L/C feel as the cornflower accent

function RfEyebrow({ children, top = 150, p = 1, left = 0, right = 0, align = 'center' }) {
  return (
    <div style={{
      position: 'absolute', left, right, top, textAlign: align,
      fontFamily: FONT_MONO, fontSize: 22, fontWeight: 500, letterSpacing: '0.3em',
      textTransform: 'uppercase', color: BRAND.accent, ...rfUp(p, 12),
    }}>{children}</div>
  );
}

function RfHeadline({ children, top = 220, size = 96, p = 1, width = 1600 }) {
  return (
    <div style={{
      position: 'absolute', left: (1920 - width) / 2, width, top, textAlign: 'center',
      fontFamily: FONT_DISPLAY, fontSize: size, fontWeight: 500, lineHeight: 1.08,
      letterSpacing: '-0.02em', color: BRAND.cream, textWrap: 'balance', ...rfUp(p),
    }}>{children}</div>
  );
}

function RfGrid({ opacity = 0.05 }) {
  const t = useTime();
  return (
    <div style={{
      position: 'absolute', inset: -80, opacity,
      backgroundImage: `linear-gradient(${BRAND.cream} 1px, transparent 1px), linear-gradient(90deg, ${BRAND.cream} 1px, transparent 1px)`,
      backgroundSize: '80px 80px',
      transform: `translate(${(t * 6) % 80}px, ${(t * 3) % 80}px)`,
    }}/>
  );
}

const RfCheck = ({ color = BRAND.green, size = 34 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" style={{ flexShrink: 0 }}>
    <path d="M5 12.5l4.5 4.5L19 7.5" stroke={color} strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round"/>
  </svg>
);
const RfX = ({ color = '#E0597A', size = 34 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" style={{ flexShrink: 0 }}>
    <path d="M6 6l12 12M18 6L6 18" stroke={color} strokeWidth="2.4" strokeLinecap="round"/>
  </svg>
);

// ── 1 · Hook — two loans, not interchangeable ──────────────────────────────
function RfScene1_Hook() {
  const { localTime: st } = useSprite();
  const split = Easing.easeInOutCubic(rfP(st, 2.6, 1.1));
  const pPills = rfP(st, 1.6, 0.6);
  const neP = rfP(st, 3.5, 0.5);
  const pill = (label, sub, color, dir) => (
    <div style={{
      position: 'absolute', top: 640, left: 960, width: 560, marginLeft: -280,
      transform: `translateX(${dir * split * 360}px) translateY(${(1 - Easing.easeOutCubic(pPills)) * 30}px)`,
      opacity: pPills,
      padding: '34px 40px', borderRadius: 16, boxSizing: 'border-box', textAlign: 'center',
      background: 'rgba(245,241,234,0.05)', border: `1px solid ${color}66`,
      backdropFilter: 'blur(20px)',
    }}>
      <div style={{ fontFamily: FONT_MONO, fontSize: 20, letterSpacing: '0.26em', color, textTransform: 'uppercase' }}>{sub}</div>
      <div style={{ fontFamily: FONT_DISPLAY, fontSize: 64, fontWeight: 700, color: BRAND.cream, letterSpacing: '-0.02em', marginTop: 14 }}>{label}</div>
    </div>
  );
  return (
    <SceneBg gradient>
      <RfGrid opacity={0.06}/>
      <RfEyebrow top={250} p={rfP(st, 0.2)}>— VA home loans · Refinance —</RfEyebrow>
      <RfHeadline top={330} size={104} p={rfP(st, 0.5, 0.8)} width={1500}>
        There are <RF_I>two</RF_I> VA refinances.
      </RfHeadline>
      {pill('VA IRRRL', 'Streamline', BRAND.accent, -1)}
      {pill('VA Cash-out', 'Equity · conversion', RF_CASH, 1)}
      <div style={{
        position: 'absolute', left: 900, width: 120, top: 650, textAlign: 'center',
        fontFamily: FONT_UI, fontSize: 96, fontWeight: 300, color: BRAND.creamDim,
        opacity: neP, transform: `scale(${0.8 + 0.2 * Easing.easeOutBack(neP)})`,
      }}>≠</div>
      <div style={{
        position: 'absolute', left: 0, right: 0, top: 880, textAlign: 'center',
        fontFamily: FONT_MONO, fontSize: 20, letterSpacing: '0.24em', textTransform: 'uppercase',
        color: BRAND.slate, ...rfUp(rfP(st, 4.4, 0.5), 10),
      }}>They are not interchangeable</div>
    </SceneBg>
  );
}

// ── 2 · Decision — two facts pick the loan ─────────────────────────────────
function RfScene2_Decide() {
  const { localTime: st } = useSprite();
  const q1 = rfP(st, 1.8, 0.6);
  const lineB = Easing.easeInOutCubic(rfP(st, 3.6, 0.6));  // to "Yes"
  const q2 = rfP(st, 4.1, 0.6);
  const lineC = Easing.easeInOutCubic(rfP(st, 6.2, 0.9));
  const resIR = rfP(st, 8.9, 0.6);
  const resCO = rfP(st, 13.0, 0.6);
  const lineA = Easing.easeInOutCubic(rfP(st, 14.9, 0.9));  // to "No" (non-VA)
  const noRes = rfP(st, 15.6, 0.6);

  const node = (x, y, w, p, children, style = {}) => (
    <div style={{
      position: 'absolute', left: x - w / 2, top: y, width: w, boxSizing: 'border-box',
      padding: '26px 30px', borderRadius: 14, textAlign: 'center',
      background: 'rgba(245,241,234,0.05)', border: `1px solid ${BRAND.hairline}`,
      fontFamily: FONT_DISPLAY, fontSize: 36, fontWeight: 600, color: BRAND.cream, letterSpacing: '-0.01em',
      ...rfUp(p, 20), ...style,
    }}>{children}</div>
  );
  const tag = (x, y, p, text) => (
    <div style={{ position: 'absolute', left: x - 60, top: y, width: 120, textAlign: 'center',
      fontFamily: FONT_MONO, fontSize: 20, letterSpacing: '0.22em', textTransform: 'uppercase', color: BRAND.slate, opacity: p }}>{text}</div>
  );
  // SVG connectors (1920 canvas coords)
  const path = (d, p, len, color = 'rgba(255,255,255,0.35)') => (
    <path d={d} stroke={color} strokeWidth="2" fill="none" strokeDasharray={len} strokeDashoffset={len * (1 - p)}/>
  );
  const result = (x, y, p, color, k, label, note) => (
    <div style={{
      position: 'absolute', left: x - 220, top: y, width: 440, boxSizing: 'border-box',
      padding: '26px 32px', borderRadius: 14, textAlign: 'center',
      background: `${color}14`, border: `1px solid ${color}88`,
      opacity: p, transform: `scale(${0.9 + 0.1 * Easing.easeOutBack(p)})`,
    }}>
      <div style={{ fontFamily: FONT_MONO, fontSize: 18, letterSpacing: '0.24em', color, textTransform: 'uppercase' }}>{k}</div>
      <div style={{ fontFamily: FONT_DISPLAY, fontSize: 48, fontWeight: 700, color: BRAND.cream, marginTop: 8, letterSpacing: '-0.02em' }}>{label}</div>
      {note && <div style={{ fontFamily: FONT_UI, fontSize: 22, fontWeight: 300, color: BRAND.creamDim, marginTop: 8 }}>{note}</div>}
    </div>
  );

  return (
    <SceneBg gradient>
      <RfGrid opacity={0.035}/>
      <RfEyebrow top={110} p={rfP(st, 0.1)}>— Which one fits the job? —</RfEyebrow>
      <RfHeadline top={170} size={84} p={rfP(st, 0.3)}>Two facts <RF_I>decide</RF_I> it.</RfHeadline>

      <svg width="1920" height="1080" style={{ position: 'absolute', inset: 0 }}>
        {/* Q1 → No (left) */}
        {path('M 960 470 L 960 490 L 480 490 L 480 760', lineA, 800)}
        {/* Q1 → Yes (down) to Q2 */}
        {path('M 960 470 L 960 560', lineB, 110)}
        {/* Q2 → No cash / cash */}
        {path('M 1200 662 L 1200 690 L 1000 690 L 1000 760', lineC, 440)}
        {path('M 1200 662 L 1200 690 L 1460 690 L 1460 760', lineC, 440)}
      </svg>

      {node(960, 368, 640, q1, <>Is your mortgage a <span style={{ color: BRAND.accent }}>VA loan</span>?</>)}
      {tag(560, 440, noRes, 'No')}
      {tag(1020, 495, rfP(st, 3.8, 0.5), 'Yes')}
      {node(1200, 560, 520, q2, <>Do you need <span style={{ color: RF_CASH }}>cash</span>?</>, { left: 1200 - 260 })}
      {tag(1060, 700, resIR, 'No')}
      {tag(1400, 700, resCO, 'Yes')}

      {result(480, 760, noRes, RF_CASH, 'Move into a VA loan', 'Cash-out', 'Cash back optional')}
      {result(1000, 760, resIR, BRAND.accent, 'Lower rate · fixed payment', 'IRRRL')}
      {result(1460, 760, resCO, RF_CASH, 'Turn equity into cash', 'Cash-out')}

      <div style={{ position: 'absolute', left: 0, right: 0, top: 990, textAlign: 'center',
        fontFamily: FONT_UI, fontSize: 24, color: BRAND.slate, ...rfUp(rfP(st, 17.6), 10) }}>
        Buying a home isn’t a refinance — that’s the VA purchase loan.
      </div>
    </SceneBg>
  );
}

// ── Shared product scene (IRRRL / Cash-out) ────────────────────────────────
function RfProductScene({ st, color, eyebrow, title, lede, rows, footer, rowTimes = [2.2, 3.2, 4.2, 5.2], footerAt = 6.6 }) {
  return (
    <SceneBg gradient>
      <div style={{ position: 'absolute', left: 160, top: 220, width: 640 }}>
        <div style={{ fontFamily: FONT_MONO, fontSize: 22, letterSpacing: '0.3em', color, textTransform: 'uppercase', ...rfUp(rfP(st, 0.1), 12) }}>{eyebrow}</div>
        <div style={{ marginTop: 36, fontFamily: FONT_DISPLAY, fontSize: 104, fontWeight: 500, lineHeight: 1.05, letterSpacing: '-0.02em', color: BRAND.cream, textWrap: 'balance', ...rfUp(rfP(st, 0.3)) }}>
          {title}
        </div>
        <div style={{ marginTop: 40, fontFamily: FONT_UI, fontSize: 32, fontWeight: 300, lineHeight: 1.4, color: BRAND.creamDim, textWrap: 'pretty', ...rfUp(rfP(st, 1.2), 16) }}>
          {lede}
        </div>
      </div>
      <div style={{ position: 'absolute', left: 900, right: 160, top: 210 }}>
        {rows.map(([k, v, good], i) => {
          const p = rfP(st, rowTimes[i], 0.6);
          return (
            <div key={k} style={{ display: 'flex', alignItems: 'center', gap: 32, padding: '34px 0', borderTop: `1px solid ${BRAND.hairline}`, ...rfUp(p, 20) }}>
              <div style={{ width: 260, fontFamily: FONT_MONO, fontSize: 20, letterSpacing: '0.2em', color: BRAND.slate, textTransform: 'uppercase' }}>{k}</div>
              {good === true ? <RfCheck/> : good === false ? <RfX/> : <span style={{ width: 34 }}/>}
              <div style={{ flex: 1, fontFamily: FONT_DISPLAY, fontSize: 38, fontWeight: 600, color: BRAND.cream, letterSpacing: '-0.01em' }}>{v}</div>
            </div>
          );
        })}
        <div style={{ borderTop: `1px solid ${BRAND.hairline}` }}/>
      </div>
      {footer && (
        <div style={{ position: 'absolute', left: 900, right: 160, top: 900,
          fontFamily: FONT_SERIF, fontStyle: 'italic', fontSize: 40, color, ...rfUp(rfP(st, footerAt), 12) }}>{footer}</div>
      )}
    </SceneBg>
  );
}

// ── 3 · IRRRL ──────────────────────────────────────────────────────────────
function RfScene3_IRRRL() {
  const { localTime: st } = useSprite();
  return (
    <RfProductScene st={st} color={BRAND.accent}
      eyebrow="— Path 01 · VA IRRRL —"
      title={<>A lower rate, <RF_I>not</RF_I> a check.</>}
      lede="The streamline replaces the VA loan you already have — to cut the rate or swap an adjustable payment for a fixed one."
      rows={[
        ['Current loan', 'Must already be VA', null],
        ['Cash to you', 'Not the purpose', false],
        ['Appraisal', 'Often skipped', true],
        ['Funding fee', '0.5% typical', true],
      ]}
      rowTimes={[4.9, 9.2, 11.7, 13.8]} footerAt={14.8}
      footer="The rate-and-term tool."
    />
  );
}

// ── 4 · Cash-out ───────────────────────────────────────────────────────────
function RfScene4_CashOut() {
  const { localTime: st } = useSprite();
  return (
    <RfProductScene st={st} color={RF_CASH}
      eyebrow="— Path 02 · VA Cash-out —"
      title={<>Use it when the cash has a <RF_I color={RF_CASH}>job.</RF_I></>}
      lede="Pays off the current mortgage and can send you equity at closing — or move a conventional, FHA or USDA loan into a VA loan."
      rows={[
        ['Cash to you', 'Yes — or zero', true],
        ['Current loan', 'VA or non-VA', true],
        ['Appraisal', 'Typically required', null],
        ['Funding fee', '2.15% – 3.3%', null],
      ]}
      rowTimes={[3.4, 5.9, 9.9, 11.3]} footerAt={12.1}
      footer="The equity & conversion tool."
    />
  );
}

// ── 5 · Funding fee on $300,000 ────────────────────────────────────────────
function RfScene5_Fee() {
  const { localTime: st } = useSprite();
  const bars = [
    { k: 'IRRRL', pct: '0.5%', v: 1500, color: BRAND.accent, s: 2.5 },
    { k: 'Cash-out · first use', pct: '2.15%', v: 6450, color: RF_CASH, s: 6.0 },
    { k: 'Cash-out · later use', pct: '3.3%', v: 9900, color: RF_CASH, s: 9.5 },
  ];
  const MAXW = 820;
  return (
    <SceneBg gradient>
      <RfGrid opacity={0.04}/>
      <RfEyebrow p={rfP(st, 0.1)}>— Funding fee · example $300,000 loan —</RfEyebrow>
      <RfHeadline top={220} size={96} p={rfP(st, 0.3)}>The fees are <RF_I>not</RF_I> close.</RfHeadline>
      <div style={{ position: 'absolute', left: 160, right: 160, top: 470 }}>
        {bars.map((b, i) => {
          const p = rfP(st, b.s, 0.5);
          const g = Easing.easeInOutCubic(rfP(st, b.s + 0.2, 1.2));
          const w = (b.v / 9900) * MAXW * g;
          const val = Math.round(b.v * g);
          return (
            <div key={b.k} style={{ display: 'flex', alignItems: 'center', gap: 40, marginBottom: 56, opacity: p }}>
              <div style={{ width: 440, flexShrink: 0 }}>
                <div style={{ fontFamily: FONT_MONO, fontSize: 20, letterSpacing: '0.16em', color: b.color, textTransform: 'uppercase', whiteSpace: 'nowrap' }}>{b.k}</div>
                <div style={{ fontFamily: FONT_UI, fontSize: 28, fontWeight: 300, color: BRAND.creamDim, marginTop: 8 }}>{b.pct} of the loan</div>
              </div>
              <div style={{ position: 'relative', width: MAXW, flexShrink: 0, height: 64, borderRadius: 8, background: 'rgba(255,255,255,0.05)' }}>
                <div style={{ position: 'absolute', left: 0, top: 0, bottom: 0, width: w, borderRadius: 8, background: b.color, opacity: 0.9 }}/>
              </div>
              <div style={{ width: 240, flexShrink: 0, fontFamily: FONT_DISPLAY, fontSize: 56, fontWeight: 800, color: BRAND.cream, letterSpacing: '-0.02em', textAlign: 'right' }}>
                ${val.toLocaleString('en-US')}
              </div>
            </div>
          );
        })}
      </div>
      <div style={{ position: 'absolute', left: 0, right: 0, top: 930, textAlign: 'center',
        fontFamily: FONT_UI, fontSize: 24, color: BRAND.slate, ...rfUp(rfP(st, 11.6), 10) }}>
        Examples, not a quote. Many veterans with VA disability compensation are exempt. Closing costs still apply.
      </div>
    </SceneBg>
  );
}

// ── 6 · Three ways to pick wrong ───────────────────────────────────────────
function RfScene6_Wrong() {
  const { localTime: st } = useSprite();
  const cards = [
    { want: 'Just a lower rate', picked: 'Cash-out', why: 'Appraisal, bigger fee, fuller review — for cash you didn’t ask for.' },
    { want: 'Money for a repair', picked: 'IRRRL', why: 'An IRRRL doesn’t cut a check. It can’t turn into a cash-out midway.' },
    { want: 'Conventional loan', picked: 'Streamline', why: 'Streamline means IRRRL — VA loans only. Cash-out is the way in.' },
  ];
  return (
    <SceneBg gradient>
      <RfEyebrow p={rfP(st, 0.1)}>— Three ways to pick wrong —</RfEyebrow>
      <RfHeadline top={220} size={96} p={rfP(st, 0.3)}>Match the loan to the <RF_I>result.</RF_I></RfHeadline>
      <div style={{ position: 'absolute', left: 160, right: 160, top: 470, display: 'flex', gap: 40 }}>
        {cards.map((c, i) => {
          const s = [0.6, 3.3, 7.3][i];
          const p = rfP(st, s, 0.7);
          const x = rfP(st, s + 0.6, 0.4);
          return (
            <div key={i} style={{
              flex: 1, height: 400, borderRadius: 16, padding: 44, boxSizing: 'border-box',
              background: 'rgba(245,241,234,0.05)', border: `1px solid ${BRAND.hairline}`,
              display: 'flex', flexDirection: 'column', ...rfUp(p, 30),
            }}>
              <div style={{ fontFamily: FONT_MONO, fontSize: 18, letterSpacing: '0.22em', color: BRAND.slate, textTransform: 'uppercase' }}>You want</div>
              <div style={{ fontFamily: FONT_DISPLAY, fontSize: 42, fontWeight: 600, color: BRAND.cream, marginTop: 10, letterSpacing: '-0.01em' }}>{c.want}</div>
              <div style={{ display: 'flex', alignItems: 'center', gap: 14, marginTop: 28 }}>
                <span style={{ opacity: x, transform: `scale(${0.6 + 0.4 * Easing.easeOutBack(x)})`, display: 'flex' }}><RfX size={32}/></span>
                <span style={{ fontFamily: FONT_UI, fontSize: 30, fontWeight: 500, color: '#E0597A',
                  textDecoration: x > 0.5 ? 'line-through' : 'none', textDecorationThickness: 2 }}>You ask for {c.picked}</span>
              </div>
              <div style={{ fontFamily: FONT_UI, fontSize: 25, fontWeight: 300, color: BRAND.creamDim, lineHeight: 1.45, marginTop: 'auto', textWrap: 'pretty' }}>{c.why}</div>
            </div>
          );
        })}
      </div>
    </SceneBg>
  );
}

// ── 7 · How to choose ──────────────────────────────────────────────────────
function RfScene7_Steps() {
  const { localTime: st } = useSprite();
  const steps = [
    ['Name the result you want', 'Lower rate or payment · cash for a specific use · move into a VA loan.'],
    ['Name the mortgage you have', 'Pull the statement. Not a VA loan? Stop considering an IRRRL.'],
    ['Put the funding fee next to the goal', '0.5% vs. 2.15% – 3.3%. An exemption removes the fee, not closing costs.'],
    ['Open the matching guide', 'Run its calculator, then pre-qualify with the mortgage you actually have.'],
  ];
  return (
    <SceneBg gradient>
      <div style={{ position: 'absolute', left: 160, top: 220, width: 580 }}>
        <div style={{ fontFamily: FONT_MONO, fontSize: 22, letterSpacing: '0.3em', color: BRAND.accent, textTransform: 'uppercase', ...rfUp(rfP(st, 0.1), 12) }}>— Four steps —</div>
        <div style={{ marginTop: 40, fontFamily: FONT_DISPLAY, fontSize: 96, fontWeight: 500, lineHeight: 1.08, letterSpacing: '-0.02em', color: BRAND.cream, ...rfUp(rfP(st, 0.3)) }}>
          Choose <RF_I>before</RF_I> you apply.
        </div>
      </div>
      <div style={{ position: 'absolute', left: 840, right: 160, top: 210 }}>
        {steps.map(([t, d], i) => {
          const p = rfP(st, [0.4, 1.5, 3.8, 6.0][i], 0.6);
          return (
            <div key={i} style={{ display: 'flex', gap: 36, padding: '36px 0', borderTop: `1px solid ${BRAND.hairline}`, ...rfUp(p, 20) }}>
              <div style={{ fontFamily: FONT_MONO, fontSize: 26, color: BRAND.accent, width: 50, paddingTop: 6 }}>{String(i + 1).padStart(2, '0')}</div>
              <div>
                <div style={{ fontFamily: FONT_DISPLAY, fontSize: 40, fontWeight: 600, color: BRAND.cream, letterSpacing: '-0.01em' }}>{t}</div>
                <div style={{ fontFamily: FONT_UI, fontSize: 26, fontWeight: 300, color: BRAND.creamDim, marginTop: 8 }}>{d}</div>
              </div>
            </div>
          );
        })}
      </div>
    </SceneBg>
  );
}

function RfEqualHousing() {
  return (
    <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 6, flexShrink: 0, color: BRAND.creamDim }}>
      <svg width="80" height="70" viewBox="0 0 64 56" fill="none">
        <path d="M32 3 L60 25 L54 25 L54 53 L10 53 L10 25 L4 25 Z" stroke="currentColor" strokeWidth="4" strokeLinejoin="miter"/>
        <rect x="20" y="29" width="24" height="5" fill="currentColor"/>
        <rect x="20" y="39" width="24" height="5" fill="currentColor"/>
      </svg>
      <div style={{ fontFamily: FONT_UI, fontSize: 12, fontWeight: 700, letterSpacing: '0.08em', textAlign: 'center', lineHeight: 1.2 }}>
        EQUAL HOUSING<br/>LENDER
      </div>
    </div>
  );
}

// ── 8 · CTA ────────────────────────────────────────────────────────────────
function RfScene8_CTA() {
  const { localTime: st } = useSprite();
  const p0 = rfP(st, 0, 0.6);
  const p1 = rfP(st, 0.3, 0.7);
  const p2 = rfP(st, 1.4, 0.7);
  const p3 = rfP(st, 2.2, 0.7);
  const p4 = rfP(st, 5.2, 0.9);
  const hl = rfP(st, 3.9, 0.5);
  const bell = hl * (1 - hl) * 4;
  return (
    <SceneBg gradient>
      <div style={{
        position: 'absolute', left: '50%', top: 60, width: 140, height: 140, borderRadius: '50%', overflow: 'hidden',
        transform: `translateX(-50%) scale(${0.92 + 0.08 * Easing.easeOutBack(p0)})`, opacity: p0,
        boxShadow: '0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08)',
      }}>
        <img src="assets/logo-mark-cropped.png" alt="National VA Loans" style={{ width: '100%', height: '100%', display: 'block' }}/>
      </div>
      <div style={{
        position: 'absolute', left: 160, width: 1600, top: 240, textAlign: 'center',
        fontFamily: FONT_DISPLAY, fontSize: 112, fontWeight: 500, lineHeight: 1.05, letterSpacing: '-0.03em', color: BRAND.cream, ...rfUp(p1, 20),
      }}>
        Pick the loan<br/>for the <RF_I>job.</RF_I>
      </div>
      <div style={{
        position: 'absolute', left: 260, width: 1400, top: 510, textAlign: 'center',
        fontFamily: FONT_UI, fontSize: 30, fontWeight: 300, color: BRAND.creamDim, opacity: p2,
      }}>
        Bring your current mortgage statement. A VA loan specialist will compare both paths.
      </div>
      <div style={{ position: 'absolute', left: 0, right: 0, top: 600, display: 'flex', justifyContent: 'center', ...rfUp(p3, 24) }}>
        <div style={{
          padding: '28px 56px', background: BRAND.accent, borderRadius: 12, color: BRAND.navyDeep, boxSizing: 'border-box',
          transform: `scale(${1 + 0.04 * bell})`,
          boxShadow: bell > 0 ? `0 0 0 3px rgba(144,200,255,${0.6 * bell})` : 'none',
        }}>
          <div style={{ fontFamily: FONT_MONO, fontSize: 14, letterSpacing: '0.22em', textTransform: 'uppercase', fontWeight: 600, marginBottom: 10 }}>Call now</div>
          <div style={{ fontFamily: FONT_UI, fontSize: 48, fontWeight: 800, letterSpacing: '-0.01em', whiteSpace: 'nowrap', display: 'flex', alignItems: 'center', gap: 18 }}>
            <svg width="38" height="38" viewBox="0 0 24 24" fill="none" style={{ flexShrink: 0 }}>
              <path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.070-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.37 1.9.72 2.81a2 2 0 0 1-.45 2.11L8.09 9.910a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.9.35 1.85.59 2.81.72A2 2 0 0 1 22 16.92z" stroke={BRAND.navyDeep} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
            </svg>
            855-956-4040
          </div>
        </div>
      </div>
      <div style={{
        position: 'absolute', left: '50%', top: 790, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 8,
        transform: `translateX(-50%) translateY(${(1 - Easing.easeOutCubic(p4)) * 12}px)`, opacity: p4,
      }}>
        <div style={{ fontFamily: FONT_MONO, fontSize: 13, letterSpacing: '0.28em', textTransform: 'uppercase', color: BRAND.slate, fontWeight: 500 }}>Powered by</div>
        <img src="assets/stride-bank-logo.png" alt="Stride Bank" style={{ height: 54, width: 'auto', display: 'block', opacity: 0.9 }}/>
      </div>
      <div style={{
        position: 'absolute', left: '50%', bottom: 40, transform: 'translateX(-50%)', width: 1680,
        display: 'flex', alignItems: 'center', gap: 36, opacity: p4,
      }}>
        <RfEqualHousing/>
        <div style={{ flex: 1, fontFamily: FONT_UI, fontSize: 22, fontWeight: 400, lineHeight: 1.5, color: 'rgba(230,235,243,0.82)', textAlign: 'left' }}>
          Pre-qualification is not a commitment to lend. National VA Loans is powered by Stride Bank and is not affiliated with the Department of Veterans Affairs,
          Federal Housing Administration, US Department of Housing and Urban Development, or any government agency.
          All loans are subject to credit approval and property requirements.  ·  Member FDIC  ·  Equal Housing Lender
        </div>
      </div>
    </SceneBg>
  );
}

Object.assign(window, {
  RfScene1_Hook, RfScene2_Decide, RfScene3_IRRRL, RfScene4_CashOut,
  RfScene5_Fee, RfScene6_Wrong, RfScene7_Steps, RfScene8_CTA,
});
