// Direction 1: "THE REEL" — Netflix-documentary cinematic
// Full-bleed autoplaying hero reel; crossfading era panels; bold sans headline.

function useIsMobile() {
  const [isMobile, setIsMobile] = React.useState(false);
  React.useEffect(() => {
    const mq = window.matchMedia('(max-width: 768px)');
    const update = () => setIsMobile(mq.matches);
    update();
    mq.addEventListener('change', update);
    return () => mq.removeEventListener('change', update);
  }, []);
  return isMobile;
}

function Direction1() {
  const isMobile = useIsMobile();
  const [eraIdx, setEraIdx] = React.useState(0);
  const [formOpen, setFormOpen] = React.useState(false);
  const [navOpen, setNavOpen] = React.useState(false);
  const [soonOpen, setSoonOpen] = React.useState(false);
  const [muted, setMuted] = React.useState(true);
  const [scrolled, setScrolled] = React.useState(false);
  React.useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 40);
    onScroll();
    window.addEventListener('scroll', onScroll, { passive: true });
    return () => window.removeEventListener('scroll', onScroll);
  }, []);
  // Keep muted state synced to every hero video without disturbing play/pause
  // (the era switcher above is the single source of truth for what plays).
  React.useEffect(() => {
    Object.values(videoRefs.current).forEach((v) => { if (v) v.muted = muted; });
  }, [muted]);
  const WA_NUMBER = '4915775234901';
  const eras = ['titanic', 'ww2', 'renaissance', 'western'];
  const DISPLAY_LABELS = { titanic: 'Titanic', ww2: 'World War II', renaissance: 'Renaissance', western: 'Old West' };
  const ERA_VIDEOS = {
    titanic: 'https://media.larsreese.com/reel/Titanic_Teaser.mp4',
    ww2: 'https://media.larsreese.com/reel/ww2_2.mp4',
    renaissance: 'https://media.larsreese.com/reel/monalisa.mp4',
    western: 'https://media.larsreese.com/reel/western.mp4',
  };
  const ERA_POSTERS = {
    titanic: 'https://media.larsreese.com/reel/Titanic_Teaser-poster.jpg',
    ww2: 'https://media.larsreese.com/reel/ww2_2-poster.jpg',
    renaissance: 'https://media.larsreese.com/reel/monalisa-poster.jpg',
    western: 'https://media.larsreese.com/reel/western-poster.jpg',
  };
  const [durations, setDurations] = React.useState({});
  const videoRefs = React.useRef({});
  React.useEffect(() => {
    Object.entries(videoRefs.current).forEach(([key, el]) => {
      if (!el) return;
      if (key === eras[eraIdx]) {
        try { el.currentTime = 0; el.play().catch(() => {}); } catch (_) {}
      } else {
        try { el.pause(); } catch (_) {}
      }
    });
    const dur = durations[eras[eraIdx]];
    const ms = dur ? Math.max(3000, Math.round(dur * 1000)) : 15000;
    const t = setTimeout(() => setEraIdx((i) => (i + 1) % eras.length), ms);
    return () => clearTimeout(t);
  }, [eraIdx, durations]);

  const C = {
    bg: '#0a0807',
    fg: '#f4ede0',
    dim: 'rgba(244,237,224,0.6)',
    accent: '#e8a156',
    line: 'rgba(244,237,224,0.12)',
    sans: '"Geist", "Helvetica Neue", system-ui, sans-serif',
    serif: '"Spectral", "Times New Roman", serif',
    mono: '"JetBrains Mono", ui-monospace, monospace',
  };

  // Responsive tokens
  const R = {
    pad: isMobile ? '20px' : '56px',
    padY: isMobile ? '72px' : '140px',
    padYSm: isMobile ? '48px' : '120px',
    h1: isMobile ? 52 : 128,
    h2: isMobile ? 40 : 72,
    h2Lg: isMobile ? 44 : 104,
    h3: isMobile ? 32 : 56,
    heroHeight: isMobile ? '100svh' : 900,
    gap: isMobile ? 28 : 80,
  };

  return (
    <div style={{ background: C.bg, color: C.fg, fontFamily: C.sans, minHeight: '100%', overflow: 'hidden' }}>
      {/* NAV */}
      <nav style={{ position: 'absolute', top: 0, left: 0, right: 0, zIndex: 20, display: 'flex', alignItems: isMobile ? 'flex-start' : 'center', justifyContent: 'space-between', padding: isMobile ? '16px 20px' : '28px 56px' }}>
        <div style={{ display: 'flex', flexDirection: isMobile ? 'column' : 'row', alignItems: isMobile ? 'flex-start' : 'baseline', gap: isMobile ? 10 : 12, minWidth: 0 }}>
          <span style={{ fontFamily: C.serif, fontSize: isMobile ? 18 : 22, fontStyle: 'italic', letterSpacing: -0.5 }}>Lars Reese</span>
          {!isMobile && <span style={{ fontFamily: C.mono, fontSize: 10, letterSpacing: 2, color: C.dim }}>HISTORICAL RECONSTRUCTION</span>}
          {isMobile && (
            <div style={{ display: 'inline-flex', alignItems: 'center', gap: 7, padding: '3px 10px 3px 3px', border: `1px solid ${C.line}`, borderRadius: 999, background: 'rgba(10,8,7,0.55)', backdropFilter: 'blur(6px)' }}>
              <img src="https://media.larsreese.com/badges/medium-top30.jpeg" alt="medium magazin Top 30" width={20} height={20} style={{ borderRadius: '50%', display: 'block' }} />
              <span style={{ fontFamily: C.mono, fontSize: 8, letterSpacing: 1.2, color: C.fg, fontWeight: 500, whiteSpace: 'nowrap' }}>AWARDED TOP 30 TALENTS GERMANY</span>
            </div>
          )}
        </div>
        {/* Top-30 badge — inline with socials on desktop only */}
        {!isMobile && (
          <div style={{ display: 'inline-flex', alignItems: 'center', gap: 8, padding: '4px 12px 4px 4px', border: `1px solid ${C.line}`, borderRadius: 999, background: 'rgba(10,8,7,0.55)', backdropFilter: 'blur(6px)', flexShrink: 0 }}>
            <img src="https://media.larsreese.com/badges/medium-top30.jpeg" alt="medium magazin Top 30" width={26} height={26} style={{ borderRadius: '50%', display: 'block' }} />
            <span style={{ fontFamily: C.mono, fontSize: 10, letterSpacing: 1.4, color: C.fg, fontWeight: 500, whiteSpace: 'nowrap' }}>AWARDED TOP 30 TALENTS GERMANY</span>
          </div>
        )}
        {!isMobile && (
          <div style={{ display: 'flex', gap: 14, alignItems: 'center' }}>
            <a href={`https://wa.me/${WA_NUMBER}`} target="_blank" rel="noopener" aria-label="WhatsApp" style={{ width: 38, height: 38, border: `1px solid ${C.line}`, display: 'flex', alignItems: 'center', justifyContent: 'center', color: C.fg, textDecoration: 'none' }}>
              <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.693.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>
            </a>
            <button onClick={() => setSoonOpen(true)} aria-label="Instagram" style={{ width: 38, height: 38, border: `1px solid ${C.line}`, display: 'flex', alignItems: 'center', justifyContent: 'center', color: C.fg, background: 'transparent', cursor: 'pointer', padding: 0 }}>
              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6"><rect x="3" y="3" width="18" height="18" rx="5"/><circle cx="12" cy="12" r="4"/><circle cx="17.5" cy="6.5" r="1" fill="currentColor"/></svg>
            </button>
            <a href="https://www.linkedin.com/in/l-reese/" target="_blank" rel="noopener" aria-label="LinkedIn" style={{ width: 38, height: 38, border: `1px solid ${C.line}`, display: 'flex', alignItems: 'center', justifyContent: 'center', color: C.fg, textDecoration: 'none' }}>
              <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M4.98 3.5a2.5 2.5 0 11.02 5 2.5 2.5 0 01-.02-5zM3 9h4v12H3V9zm7 0h3.8v1.7h.05c.53-1 1.83-2.05 3.77-2.05C21.4 8.65 22 11 22 14.1V21h-4v-6.1c0-1.45-.03-3.3-2.02-3.3-2.02 0-2.33 1.58-2.33 3.2V21h-4V9z"/></svg>
            </a>
          </div>
        )}
        <button onClick={() => setFormOpen(true)} style={{ background: C.fg, color: C.bg, border: 'none', padding: isMobile ? '8px 14px' : '10px 18px', fontSize: isMobile ? 10 : 12, letterSpacing: 1.5, fontWeight: 600, cursor: 'pointer', whiteSpace: 'nowrap' }}>
          {isMobile ? 'CONTACT' : 'START A PROJECT'}
        </button>
      </nav>

      {/* HERO REEL */}
      <section style={{ position: 'relative', height: R.heroHeight, minHeight: isMobile ? 620 : 900, overflow: 'hidden' }}>
        {eras.map((e, i) => (
          <div key={e} style={{ position: 'absolute', inset: 0, opacity: i === eraIdx ? 1 : 0, transition: 'opacity 1.4s ease', transform: i === eraIdx ? 'scale(1.05)' : 'scale(1)', transitionProperty: 'opacity, transform', transitionDuration: '1.4s, 6s' }}>
            {ERA_VIDEOS[e] ? (
              <video src={ERA_VIDEOS[e]} autoPlay muted playsInline
                poster={ERA_POSTERS[e]}
                preload={i === 0 ? 'auto' : 'metadata'}
                ref={(el) => { videoRefs.current[e] = el; }}
                onLoadedMetadata={(ev) => {
                  const d = ev.currentTarget.duration;
                  setDurations((prev) => (prev[e] === d ? prev : { ...prev, [e]: d }));
                }}
                style={{ width: '100%', height: '100%', objectFit: 'cover', display: 'block' }} />
            ) : (
              <EraPlaceholder era={e} mode="photoreal" showStamp={false} />
            )}
          </div>
        ))}
        <div style={{ position: 'absolute', inset: 0, background: 'linear-gradient(180deg, rgba(10,8,7,0.5) 0%, rgba(10,8,7,0) 30%, rgba(10,8,7,0.3) 60%, rgba(10,8,7,0.95) 100%)', pointerEvents: 'none' }} />
        <div style={{ position: 'absolute', inset: 0, background: isMobile ? 'linear-gradient(180deg, rgba(10,8,7,0.7) 0%, rgba(10,8,7,0.1) 40%, rgba(10,8,7,0.6) 100%)' : 'linear-gradient(90deg, rgba(10,8,7,0.85) 0%, rgba(10,8,7,0.1) 50%, rgba(10,8,7,0) 100%)', pointerEvents: 'none' }} />

        {/* HERO COPY */}
        <div style={{ position: 'absolute', left: R.pad, right: R.pad, bottom: isMobile ? 40 : 120, zIndex: 10 }}>
          <div style={{
            fontFamily: C.mono, fontSize: isMobile ? 10 : 11, letterSpacing: isMobile ? 2 : 3,
            color: C.accent, marginBottom: isMobile ? 14 : 20,
            opacity: isMobile ? (scrolled ? 1 : 0) : 1,
            transform: isMobile ? (scrolled ? 'translateY(0)' : 'translateY(6px)') : 'none',
            transition: 'opacity 0.45s ease, transform 0.45s ease',
            pointerEvents: isMobile && !scrolled ? 'none' : 'auto',
          }}>
            NOW REEL · {DISPLAY_LABELS[eras[eraIdx]].toUpperCase()}
          </div>
          <h1 style={{
            fontFamily: C.serif,
            fontSize: R.h1, lineHeight: 0.94, fontWeight: 300,
            letterSpacing: isMobile ? -1.2 : -3, margin: 0, maxWidth: 1200,
            textWrap: 'balance',
          }}>
            Step into<br /><em style={{ fontStyle: 'italic', color: C.accent }}>every yesterday.</em>
            <span aria-hidden="true" style={{ display: 'inline-flex', verticalAlign: 'middle', marginLeft: isMobile ? 10 : 18, marginBottom: isMobile ? 4 : 10, width: isMobile ? 22 : 32, height: isMobile ? 22 : 32, borderRadius: '50%', border: `1px solid ${C.line}`, alignItems: 'center', justifyContent: 'center', color: C.accent, animation: 'scroll-hint 1.8s ease-in-out infinite' }}>
              <svg width={isMobile ? 10 : 14} height={isMobile ? 10 : 14} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M8 3v10M3 8l5 5 5-5"/></svg>
            </span>
          </h1>
          <p style={{
            fontSize: isMobile ? 15 : 20, lineHeight: 1.5, maxWidth: 620, marginTop: isMobile ? 18 : 32,
            color: 'rgba(244,237,224,0.85)', fontWeight: 300,
            opacity: isMobile ? (scrolled ? 1 : 0) : 1,
            maxHeight: isMobile ? (scrolled ? 400 : 0) : 'none',
            marginTop: isMobile ? (scrolled ? 18 : 0) : 32,
            overflow: 'hidden',
            transform: isMobile ? (scrolled ? 'translateY(0)' : 'translateY(8px)') : 'none',
            transition: 'opacity 0.5s ease, transform 0.5s ease, max-height 0.5s ease, margin-top 0.5s ease',
            pointerEvents: isMobile && !scrolled ? 'none' : 'auto',
          }}>
            I build immersive videos from the fragments history leaves behind — blending historical
            precision with 20 years of experience in documentary filmmaking. For broadcasters, museums,
            and heritage organisations who want audiences to <em style={{ color: C.accent, fontStyle: 'normal', fontWeight: 500 }}>feel</em> the past, not just see it.
          </p>

          <div style={{ display: 'flex', gap: isMobile ? 10 : 16, marginTop: isMobile ? 22 : 44, alignItems: 'center', flexWrap: 'wrap' }}>
            <button onClick={() => setFormOpen(true)} style={{ background: C.accent, color: '#1a1208', border: 'none', padding: isMobile ? '14px 22px' : '18px 32px', fontSize: isMobile ? 12 : 14, fontWeight: 700, letterSpacing: 1.5, cursor: 'pointer', display: 'flex', alignItems: 'center', gap: 12 }}>
              START A PROJECT
              <svg width="16" height="10" viewBox="0 0 16 10" fill="none" stroke="currentColor" strokeWidth="2"><path d="M1 5h14m0 0L11 1m4 4l-4 4"/></svg>
            </button>
            {isMobile && (
              <a href={`https://wa.me/${WA_NUMBER}`} target="_blank" rel="noopener" aria-label="WhatsApp" style={{ width: 44, height: 44, border: `1px solid ${C.line}`, display: 'flex', alignItems: 'center', justifyContent: 'center', color: C.fg, textDecoration: 'none' }}>
                <svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.693.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>
              </a>
            )}
          </div>

          {/* mobile era ticker inline — single row */}
          {isMobile && (
            <div style={{ marginTop: 20, display: 'flex', gap: 4, flexWrap: 'nowrap', overflowX: 'auto', scrollbarWidth: 'none', msOverflowStyle: 'none' }}>
              {eras.map((e, i) => (
                <button key={e} onClick={() => setEraIdx(i)} style={{ background: i === eraIdx ? C.accent : 'transparent', color: i === eraIdx ? '#1a1208' : C.fg, border: `1px solid ${i === eraIdx ? C.accent : C.line}`, padding: '5px 8px', fontFamily: C.mono, fontSize: 9, letterSpacing: 1, fontWeight: 600, cursor: 'pointer', whiteSpace: 'nowrap', flex: '0 0 auto' }}>
                  {DISPLAY_LABELS[e]}
                </button>
              ))}
            </div>
          )}
        </div>

        {/* Sound toggle — icon-only on mobile (top right below nav), labelled pill on desktop (bottom right) */}
        <button
          onClick={() => setMuted((m) => !m)}
          aria-label={muted ? 'Unmute' : 'Mute'}
          style={{
            position: 'absolute', zIndex: 15,
            ...(isMobile
              ? { top: 92, right: 16, width: 40, height: 40, padding: 0, justifyContent: 'center' }
              : { bottom: 36, right: 56, padding: '9px 14px' }
            ),
            display: 'inline-flex', alignItems: 'center', gap: 8,
            border: `1px solid ${C.line}`, borderRadius: 999,
            background: 'rgba(10,8,7,0.6)', backdropFilter: 'blur(8px)',
            color: C.fg, cursor: 'pointer',
            fontFamily: C.mono, fontSize: 10, letterSpacing: 1.5, fontWeight: 600,
            whiteSpace: 'nowrap',
          }}
        >
          {muted ? (
            <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M11 5 6 9H2v6h4l5 4V5z"/><line x1="23" y1="9" x2="17" y2="15"/><line x1="17" y1="9" x2="23" y2="15"/></svg>
          ) : (
            <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M11 5 6 9H2v6h4l5 4V5z"/><path d="M15.54 8.46a5 5 0 0 1 0 7.07"/><path d="M19.07 4.93a10 10 0 0 1 0 14.14"/></svg>
          )}
          {!isMobile && (muted ? 'TAP FOR SOUND' : 'SOUND ON')}
        </button>

        {/* era ticker right — desktop only */}
        {!isMobile && (
          <div style={{ position: 'absolute', right: 56, bottom: 120, zIndex: 10, width: 260 }}>
            {eras.map((e, i) => (
              <div key={e} onClick={() => setEraIdx(i)} style={{ display: 'flex', alignItems: 'center', gap: 12, padding: '10px 0', borderTop: `1px solid ${C.line}`, cursor: 'pointer', opacity: i === eraIdx ? 1 : 0.4, transition: 'opacity 0.3s' }}>
                <span style={{ fontFamily: C.mono, fontSize: 11, color: C.accent, width: 24 }}>{String(i + 1).padStart(2, '0')}</span>
                <span style={{ fontFamily: C.serif, fontSize: 16, flex: 1 }}>{DISPLAY_LABELS[e]}</span>
                <span style={{ fontFamily: C.mono, fontSize: 10, color: C.dim }}>{ERA_PALETTES[e].sub.split(' ')[0].replace('c.', '')}</span>
              </div>
            ))}
            <div style={{ borderTop: `1px solid ${C.line}` }} />
          </div>
        )}
      </section>

      {/* TRUST BAR */}
      <section style={{ padding: isMobile ? '32px 20px' : '56px 56px', borderTop: `1px solid ${C.line}`, borderBottom: `1px solid ${C.line}` }}>
        <div style={{ display: 'flex', alignItems: 'center', justifyContent: isMobile ? 'flex-start' : 'space-between', gap: isMobile ? 16 : 40, flexWrap: 'wrap' }}>
          <div style={{ fontFamily: C.mono, fontSize: 10, letterSpacing: 2, color: C.dim, flexShrink: 0, width: isMobile ? '100%' : 'auto', marginBottom: isMobile ? 8 : 0 }}>TRUSTED BY</div>
          {['ProSiebenSat.1', 'Florida Entertainment', 'promptr', 'scenery.eu', 'Daiichi Sankyo'].map((l) => (
            <div key={l} style={{ fontFamily: C.serif, fontSize: isMobile ? 15 : 18, letterSpacing: 0.5, opacity: 0.55, fontStyle: 'italic' }}>{l}</div>
          ))}
        </div>
      </section>

      {/* CASE STUDIES GRID */}
      <section style={{ padding: isMobile ? '72px 20px' : '140px 56px' }}>
        <div style={{ display: 'flex', flexDirection: isMobile ? 'column' : 'row', alignItems: isMobile ? 'flex-start' : 'baseline', justifyContent: 'space-between', marginBottom: isMobile ? 24 : 48, gap: isMobile ? 12 : 0 }}>
          <h2 style={{ fontFamily: C.serif, fontSize: R.h3, fontWeight: 300, letterSpacing: isMobile ? -0.6 : -1, margin: 0 }}>Selected work</h2>
          <button onClick={() => setSoonOpen(true)} style={{ fontFamily: C.mono, fontSize: isMobile ? 10 : 11, letterSpacing: 2, color: C.accent, background: 'transparent', border: 'none', cursor: 'pointer', padding: 0 }}>{isMobile ? 'MORE ON INSTAGRAM →' : 'MORE CASE STUDIES ON INSTAGRAM →'}</button>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : 'repeat(3, 1fr)', gridAutoRows: isMobile ? '420px' : '520px', gap: isMobile ? 12 : 20 }}>
          <CaseCard era="victorian"    title="The Schiphol Diamond Heist" client="scenery / Videoland" year="2026" big video="https://media.larsreese.com/reel/Diamantenraub.mp4" isMobile={isMobile}
            description="The 2005 Schiphol diamond heist — one of the largest in European history — with almost no surviving footage. Over 20 minutes were reconstructed from scratch: the real locations, the actual protagonists, period-accurate props, woven across multiple timelines — to show what no camera ever captured." />
          <CaseCard era="wwi"           title="Almost History — Series" client="ProSieben / Galileo" year="2025 · 2026" big video="https://media.larsreese.com/reel/almostHistory.mp4" isMobile={isMobile}
            description="A documentary series about the forgotten moments where history almost took a different turn. Each episode reconstructs a small decision, a missed chance, or a quiet invention that came within inches of rewriting the world. Every scene built from primary sources — archival footage, newspaper clippings, patent files, and eyewitness accounts." />
          <CaseCard era="medieval"      title="Dead Honest — Interview Series" client="YouTube" year="2025" big video="https://media.larsreese.com/reel/custer.mp4" isMobile={isMobile}
            description="An interview series where I sit down with historic figures on the last day of their lives. I confront them with five personal items to surface unknown truths. Every scene is reconstructed from primary sources — photographs, sketches, diary entries, and letters." />
        </div>
      </section>

      {/* BEFORE / AFTER SPLIT */}
      <section style={{ padding: isMobile ? '40px 20px 72px' : '60px 56px 140px' }}>
        <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : '1fr 1fr', gap: R.gap, alignItems: 'center' }}>
          <div>
            <div style={{ fontFamily: C.mono, fontSize: isMobile ? 10 : 11, letterSpacing: isMobile ? 2 : 3, color: C.accent, marginBottom: isMobile ? 14 : 20 }}>THE METHOD</div>
            <h2 style={{ fontFamily: C.serif, fontSize: isMobile ? 32 : R.h2, lineHeight: isMobile ? 1.08 : 1, fontWeight: 300, letterSpacing: isMobile ? -0.6 : -1.5, margin: 0 }}>
              One image becomes a{isMobile ? <br /> : ' '}<em style={{ color: C.accent }}>world you can step into.</em>
            </h2>
            <p style={{ fontSize: isMobile ? 15 : 18, lineHeight: 1.6, color: 'rgba(244,237,224,0.75)', maxWidth: 520, marginTop: isMobile ? 20 : 32, fontWeight: 300 }}>
              With historical precision, the world around a single photograph or painting is rebuilt —
              revealing what was never captured, and telling the fascinating stories behind it.
            </p>
            <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr 1fr 1fr' : '1fr 1fr 1fr', gap: 0, marginTop: isMobile ? 36 : 56, borderTop: `1px solid ${C.line}` }}>
              {[
                { n: '240+', l: 'Scenes reconstructed' },
                { n: '90%', prefix: 'up to', l: isMobile ? 'Cheaper than\nclassical prod.' : 'Cheaper than\ntraditional productions' },
                { n: '10×', l: 'Faster delivery' },
              ].map((s) => (
                <div key={s.l} style={{ borderBottom: `1px solid ${C.line}`, borderRight: `1px solid ${C.line}`, padding: isMobile ? '16px 8px 16px 0' : '24px 0' }}>
                  <div style={{ fontFamily: C.serif, fontSize: isMobile ? 28 : 44, fontWeight: 300, lineHeight: 1, display: 'flex', alignItems: 'baseline', gap: 6 }}>
                    {s.prefix && <span style={{ fontFamily: C.mono, fontSize: isMobile ? 9 : 11, letterSpacing: 1.5, color: C.dim, fontWeight: 500 }}>{s.prefix}</span>}
                    <span>{s.n}</span>
                  </div>
                  <div style={{ fontFamily: C.mono, fontSize: isMobile ? 9 : 10, letterSpacing: 1.5, color: C.dim, marginTop: 8, whiteSpace: 'pre-line' }}>{s.l}</div>
                </div>
              ))}
            </div>
          </div>
          <BeforeAfterSlider isMobile={isMobile} />
        </div>
      </section>

      {/* PROCESS STRIP */}
      <section style={{ padding: isMobile ? '64px 20px' : '120px 56px', borderTop: `1px solid ${C.line}`, background: 'linear-gradient(180deg, #0a0807 0%, #14110d 100%)' }}>
        <div style={{ fontFamily: C.mono, fontSize: isMobile ? 10 : 11, letterSpacing: isMobile ? 2 : 3, color: C.accent, marginBottom: isMobile ? 14 : 20 }}>HOW IT WORKS</div>
        <h2 style={{ fontFamily: C.serif, fontSize: isMobile ? 32 : R.h2, lineHeight: isMobile ? 1.08 : 1, fontWeight: 300, letterSpacing: isMobile ? -0.6 : -1.5, margin: 0, maxWidth: 900 }}>
          From one image<br /><em style={{ color: C.accent }}>to an entire film.</em>
        </h2>
        <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : 'repeat(4, 1fr)', gap: isMobile ? 28 : 32, marginTop: isMobile ? 40 : 80 }}>
          {[
            { n: '01', t: 'Archive Dive',   d: 'Source images, maps, diaries, and period catalogues. Historical accuracy is the contract.', img: 'https://media.larsreese.com/stills/process1.png' },
            { n: '02', t: 'Restoration',    d: 'Restore, colorize, and upscale what exists. Then use the material as seed for the storyboard.', img: 'https://media.larsreese.com/stills/process2.png' },
            { n: '03', t: 'Storyboarding',  d: 'Layout the story frame by frame. Extend it to a full world: streets, weather, crowds, faces, inventory.', img: 'https://media.larsreese.com/stills/process3.png' },
            { n: '04', t: 'Cinematography', d: 'Bring the storyboard to life — make the camera film in the built world, in broadcast-ready quality.', img: 'https://media.larsreese.com/stills/process4.png' },
          ].map((s) => (
            <div key={s.n}>
              <div style={{ width: '100%', aspectRatio: '16 / 9', backgroundImage: `url(${s.img})`, backgroundSize: 'cover', backgroundPosition: 'center', marginBottom: isMobile ? 18 : 24, border: `1px solid ${C.line}`, filter: 'grayscale(0.15) contrast(1.02)' }} />
              <div style={{ fontFamily: C.mono, fontSize: isMobile ? 10 : 11, color: C.accent, letterSpacing: 2, marginBottom: isMobile ? 10 : 16 }}>{s.n}</div>
              <div style={{ fontFamily: C.serif, fontSize: isMobile ? 22 : 28, letterSpacing: -0.5, marginBottom: 12, fontWeight: 400 }}>{s.t}</div>
              <p style={{ fontSize: isMobile ? 13 : 14, lineHeight: 1.6, color: 'rgba(244,237,224,0.65)', margin: 0 }}>{s.d}</p>
            </div>
          ))}
        </div>
      </section>

      {/* FINAL CTA */}
      <section style={{ position: 'relative', minHeight: isMobile ? 520 : 640, overflow: 'hidden', borderTop: `1px solid ${C.line}` }}>
        <div style={{ position: 'absolute', inset: 0, backgroundImage: 'url(https://media.larsreese.com/stills/selfie.png)', backgroundSize: 'cover', backgroundPosition: 'center' }} />
        <div style={{ position: 'absolute', inset: 0, background: 'linear-gradient(180deg, rgba(10,8,7,0.6) 0%, rgba(10,8,7,0.95) 100%)' }} />
        <div style={{ position: 'relative', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', textAlign: 'center', padding: isMobile ? '80px 20px' : 56, minHeight: isMobile ? 520 : 640 }}>
          <div style={{ fontFamily: C.mono, fontSize: isMobile ? 10 : 11, letterSpacing: isMobile ? 2 : 3, color: C.accent, marginBottom: isMobile ? 16 : 24 }}>START A PROJECT</div>
          <h2 style={{ fontFamily: C.serif, fontSize: R.h2Lg, fontWeight: 300, letterSpacing: isMobile ? -1 : -2.5, margin: 0, lineHeight: 0.95, maxWidth: 1200 }}>
            What century<br /><em style={{ color: C.accent }}>would you like to walk through?</em>
          </h2>
          <div style={{ display: 'flex', gap: isMobile ? 10 : 16, marginTop: isMobile ? 28 : 48, alignItems: 'center', flexWrap: 'wrap', justifyContent: 'center' }}>
            <a href={`https://wa.me/${WA_NUMBER}`} target="_blank" rel="noopener" style={{ background: C.accent, color: '#1a1208', border: 'none', padding: isMobile ? '14px 22px' : '20px 36px', fontSize: isMobile ? 12 : 14, fontWeight: 700, letterSpacing: 1.5, cursor: 'pointer', textDecoration: 'none', display: 'inline-flex', alignItems: 'center', gap: 10 }}>
              <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.693.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>
              {isMobile ? 'WHATSAPP' : 'TEXT ME ON WHATSAPP'}
            </a>
            <a href="mailto:work@larsreese.de" style={{ background: 'transparent', color: C.fg, border: `1px solid ${C.line}`, padding: isMobile ? '14px 18px' : '20px 28px', fontSize: isMobile ? 12 : 14, fontWeight: 500, letterSpacing: 1, cursor: 'pointer', textDecoration: 'none', wordBreak: 'break-all' }}>{isMobile ? 'EMAIL' : 'work@larsreese.de'}</a>
            <div style={{ display: 'flex', gap: 10, marginLeft: isMobile ? 0 : 4 }}>
              <button onClick={() => setSoonOpen(true)} aria-label="Instagram" style={{ width: isMobile ? 44 : 56, height: isMobile ? 44 : 56, border: `1px solid ${C.line}`, display: 'flex', alignItems: 'center', justifyContent: 'center', color: C.fg, background: 'transparent', cursor: 'pointer', padding: 0 }}>
                <svg width={isMobile ? 16 : 20} height={isMobile ? 16 : 20} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6"><rect x="3" y="3" width="18" height="18" rx="5"/><circle cx="12" cy="12" r="4"/><circle cx="17.5" cy="6.5" r="1" fill="currentColor"/></svg>
              </button>
              <a href="https://www.linkedin.com/in/l-reese/" target="_blank" rel="noopener" aria-label="LinkedIn" style={{ width: isMobile ? 44 : 56, height: isMobile ? 44 : 56, border: `1px solid ${C.line}`, display: 'flex', alignItems: 'center', justifyContent: 'center', color: C.fg, textDecoration: 'none' }}>
                <svg width={isMobile ? 16 : 20} height={isMobile ? 16 : 20} viewBox="0 0 24 24" fill="currentColor"><path d="M4.98 3.5a2.5 2.5 0 11.02 5 2.5 2.5 0 01-.02-5zM3 9h4v12H3V9zm7 0h3.8v1.7h.05c.53-1 1.83-2.05 3.77-2.05C21.4 8.65 22 11 22 14.1V21h-4v-6.1c0-1.45-.03-3.3-2.02-3.3-2.02 0-2.33 1.58-2.33 3.2V21h-4V9z"/></svg>
              </a>
            </div>
          </div>
        </div>
      </section>

      <footer style={{ padding: isMobile ? '24px 20px' : '32px 56px', fontFamily: C.mono, fontSize: 10, letterSpacing: 1.5, color: C.dim, display: 'flex', justifyContent: 'space-between', alignItems: isMobile ? 'flex-start' : 'center', gap: isMobile ? 12 : 24, borderTop: `1px solid ${C.line}`, flexWrap: 'wrap', flexDirection: isMobile ? 'column' : 'row' }}>
        <span>© LARS REESE · MUNICH</span>
        <span style={{ opacity: 0.85 }}>HISTORICAL RECONSTRUCTION</span>
        <span style={{ display: 'flex', gap: 18, flexWrap: 'wrap' }}>
          <a href="Impressum.html" style={{ color: C.dim }}>IMPRESSUM</a>
          <a href="mailto:work@larsreese.de" style={{ color: C.dim }}>WORK@LARSREESE.DE</a>
        </span>
      </footer>
      {formOpen && <StartProjectModal onClose={() => setFormOpen(false)} waNumber={WA_NUMBER} C={C} isMobile={isMobile} />}
      {soonOpen && (
        <div onClick={() => setSoonOpen(false)} style={{ position: 'fixed', inset: 0, background: 'rgba(10,8,7,0.85)', backdropFilter: 'blur(6px)', zIndex: 200, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 24 }}>
          <div onClick={(e) => e.stopPropagation()} style={{ position: 'relative', background: '#14110d', border: `1px solid ${C.line}`, padding: isMobile ? '40px 32px' : '56px 64px', textAlign: 'center', maxWidth: 440, width: '100%' }}>
            <button onClick={() => setSoonOpen(false)} aria-label="Close" style={{ position: 'absolute', top: 14, right: 14, background: 'transparent', border: 'none', color: C.dim, fontSize: 22, cursor: 'pointer', lineHeight: 1 }}>×</button>
            <span style={{ position: 'absolute', top: -1, left: -1, width: 14, height: 14, borderTop: `1px solid ${C.accent}`, borderLeft: `1px solid ${C.accent}` }} />
            <span style={{ position: 'absolute', top: -1, right: -1, width: 14, height: 14, borderTop: `1px solid ${C.accent}`, borderRight: `1px solid ${C.accent}` }} />
            <span style={{ position: 'absolute', bottom: -1, left: -1, width: 14, height: 14, borderBottom: `1px solid ${C.accent}`, borderLeft: `1px solid ${C.accent}` }} />
            <span style={{ position: 'absolute', bottom: -1, right: -1, width: 14, height: 14, borderBottom: `1px solid ${C.accent}`, borderRight: `1px solid ${C.accent}` }} />
            <div style={{ fontFamily: C.mono, fontSize: 11, letterSpacing: 3, color: C.accent, marginBottom: 18 }}>INSTAGRAM</div>
            <h3 style={{ fontFamily: C.serif, fontSize: isMobile ? 32 : 40, fontWeight: 300, letterSpacing: -1, margin: 0, color: C.fg }}>Coming soon.</h3>
          </div>
        </div>
      )}
    </div>
  );
}

function StartProjectModal({ onClose, waNumber, C, isMobile }) {
  const [name, setName] = React.useState('');
  const [org, setOrg] = React.useState('');
  const [contact, setContact] = React.useState('');
  const [msg, setMsg] = React.useState('');
  const canSend = name.trim() && contact.trim() && msg.trim();
  const send = (e) => {
    e.preventDefault();
    if (!canSend) return;
    const text = `Hi Lars,\n\nI'm ${name}${org ? ` from ${org}` : ''}.\nContact: ${contact}\n\n${msg}`;
    const url = `https://wa.me/${waNumber}?text=${encodeURIComponent(text)}`;
    window.open(url, '_blank', 'noopener');
    onClose();
  };
  const inputStyle = { width: '100%', background: 'transparent', border: 'none', borderBottom: `1px solid ${C.line}`, padding: '14px 0', fontSize: 16, fontFamily: C.sans, color: C.fg, outline: 'none', fontWeight: 300 };
  const labelStyle = { fontFamily: C.mono, fontSize: 10, letterSpacing: 2, color: C.dim, display: 'block' };
  return (
    <div onClick={onClose} style={{ position: 'fixed', inset: 0, background: 'rgba(6,5,4,0.88)', backdropFilter: 'blur(8px)', zIndex: 100, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: isMobile ? 12 : 24, overflowY: 'auto' }}>
      <form onClick={(e) => e.stopPropagation()} onSubmit={send} style={{ width: '100%', maxWidth: 520, background: '#14110d', border: `1px solid ${C.line}`, padding: isMobile ? '36px 24px' : '48px 44px', color: C.fg, position: 'relative' }}>
        <button type="button" onClick={onClose} aria-label="Close" style={{ position: 'absolute', top: 16, right: 16, background: 'transparent', border: 'none', color: C.dim, fontSize: 22, cursor: 'pointer', width: 36, height: 36, lineHeight: 1 }}>×</button>
        <div style={{ fontFamily: C.mono, fontSize: 10, letterSpacing: 3, color: C.accent, marginBottom: 16 }}>START A PROJECT</div>
        <h3 style={{ fontFamily: C.serif, fontSize: isMobile ? 28 : 36, fontWeight: 300, letterSpacing: -0.8, margin: 0, lineHeight: 1.05 }}>
          Tell me about <em style={{ color: C.accent }}>your project.</em>
        </h3>
        <p style={{ fontSize: 13, color: C.dim, lineHeight: 1.5, marginTop: 12, marginBottom: 28, fontWeight: 300 }}>
          Leave your details and a short note. I usually reply within a day.
        </p>
        <div style={{ display: 'grid', gap: 20 }}>
          <div>
            <label style={labelStyle}>NAME</label>
            <input style={inputStyle} value={name} onChange={(e) => setName(e.target.value)} placeholder="Your name" autoFocus />
          </div>
          <div>
            <label style={labelStyle}>INSTITUTION OR COMPANY</label>
            <input style={inputStyle} value={org} onChange={(e) => setOrg(e.target.value)} placeholder="Optional" />
          </div>
          <div>
            <label style={labelStyle}>EMAIL OR PHONE</label>
            <input style={inputStyle} value={contact} onChange={(e) => setContact(e.target.value)} placeholder="How should I reach you?" />
          </div>
          <div>
            <label style={labelStyle}>MESSAGE</label>
            <textarea style={{ ...inputStyle, resize: 'vertical', minHeight: 80, fontFamily: C.sans }} value={msg} onChange={(e) => setMsg(e.target.value)} placeholder="A few sentences about what you have in mind…" />
          </div>
        </div>
        <button type="submit" disabled={!canSend} style={{ marginTop: 32, width: '100%', background: canSend ? C.accent : 'rgba(232,161,86,0.25)', color: '#1a1208', border: 'none', padding: '18px 24px', fontSize: 13, fontWeight: 700, letterSpacing: 1.5, cursor: canSend ? 'pointer' : 'not-allowed', display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 12 }}>
          SEND
        </button>
      </form>
    </div>
  );
}

function BeforeAfterSlider({ isMobile }) {
  const [pct, setPct] = React.useState(52);
  const ref = React.useRef(null);
  const dragging = React.useRef(false);
  React.useEffect(() => {
    const move = (e) => {
      if (!dragging.current || !ref.current) return;
      const r = ref.current.getBoundingClientRect();
      const x = ((e.clientX - r.left) / r.width) * 100;
      setPct(Math.max(0, Math.min(100, x)));
    };
    const up = () => (dragging.current = false);
    window.addEventListener('pointermove', move);
    window.addEventListener('pointerup', up);
    return () => { window.removeEventListener('pointermove', move); window.removeEventListener('pointerup', up); };
  }, []);
  return (
    <div ref={ref} style={{ position: 'relative', aspectRatio: isMobile ? '4/3' : '4/5', width: '100%', overflow: 'hidden', cursor: 'ew-resize', userSelect: 'none', touchAction: 'none' }}
         onPointerDown={() => (dragging.current = true)}>
      <div style={{ position: 'absolute', inset: 0, backgroundImage: 'url(uploads/horses1.jpg)', backgroundSize: 'cover', backgroundPosition: 'center' }} />
      <div style={{ position: 'absolute', top: 12, right: 12, fontFamily: '"JetBrains Mono", monospace', fontSize: 9, letterSpacing: 1.5, color: 'rgba(255,245,220,0.85)', display: 'flex', gap: 10, alignItems: 'center' }}>
        <span style={{ width: 6, height: 6, background: '#e8a156', borderRadius: '50%' }} />
        <span>RECONSTRUCTION</span>
      </div>
      <div style={{ position: 'absolute', inset: 0, clipPath: `inset(0 ${100 - pct}% 0 0)`, backgroundImage: 'url(uploads/horses0.jpg)', backgroundSize: 'cover', backgroundPosition: 'center' }} />
      <div style={{ position: 'absolute', top: 12, left: 12, fontFamily: '"JetBrains Mono", monospace', fontSize: 9, letterSpacing: 1.5, color: 'rgba(255,245,220,0.85)', display: 'flex', gap: 10, alignItems: 'center', clipPath: `inset(0 ${100 - pct}% 0 0)` }}>
        <span style={{ width: 6, height: 6, background: 'rgba(255,245,220,0.7)', borderRadius: '50%' }} />
        <span>SOURCE</span>
      </div>
      <div style={{ position: 'absolute', top: 0, bottom: 0, left: `${pct}%`, width: 2, background: '#e8a156', boxShadow: '0 0 20px rgba(232,161,86,0.6)' }}>
        <div style={{ position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%,-50%)', width: 52, height: 52, borderRadius: '50%', background: '#e8a156', color: '#1a1208', display: 'flex', alignItems: 'center', justifyContent: 'center', fontFamily: '"JetBrains Mono", monospace', fontSize: 10, letterSpacing: 1, fontWeight: 700 }}>↔</div>
      </div>
    </div>
  );
}

function CaseCard({ era, title, client, year, span, big, video, isMobile, description }) {
  const [active, setActive] = React.useState(false);
  const [hover, setHover] = React.useState(false);
  const videoRef = React.useRef(null);

  React.useEffect(() => {
    const v = videoRef.current;
    if (!v) return;
    if (active) { try { v.pause(); } catch (_) {} }
    else { try { v.play().catch(() => {}); } catch (_) {} }
  }, [active]);

  return (
    <div
      onClick={() => setActive((a) => !a)}
      onMouseEnter={() => setHover(true)}
      onMouseLeave={() => setHover(false)}
      style={{ gridArea: span, position: 'relative', overflow: 'hidden', cursor: 'pointer', border: '1px solid rgba(244,237,224,0.08)' }}
    >
      <div style={{ position: 'absolute', inset: 0, transform: hover && !active ? 'scale(1.04)' : 'scale(1)', transition: 'transform 0.8s ease, filter 0.6s ease' }}>
        {video ? (
          <video ref={videoRef} src={video} autoPlay muted loop playsInline
                 style={{ width: '100%', height: '100%', objectFit: 'cover', display: 'block', filter: active ? 'grayscale(1) contrast(1.05) brightness(0.55)' : (hover ? 'none' : 'saturate(0.75) contrast(1.05)'), transition: 'filter 0.6s ease' }} />
        ) : (
          <EraPlaceholder era={era} mode={hover ? 'photoreal' : 'archival'} showStamp={false} />
        )}
      </div>

      {/* Gradient: stronger when active so description reads clean */}
      <div style={{ position: 'absolute', inset: 0, background: active ? 'linear-gradient(180deg, rgba(10,8,7,0.7) 0%, rgba(10,8,7,0.92) 100%)' : 'linear-gradient(180deg, rgba(10,8,7,0) 40%, rgba(10,8,7,0.9) 100%)', transition: 'background 0.6s ease' }} />

      {/* Title + client (always visible, shifts up slightly when active) */}
      <div style={{ position: 'absolute', bottom: 0, left: 0, right: 0, padding: isMobile ? 20 : 28, color: '#f4ede0', transition: 'transform 0.5s ease, opacity 0.5s ease', transform: active ? 'translateY(-8px)' : 'translateY(0)' }}>
        <div style={{ fontFamily: '"JetBrains Mono", monospace', fontSize: isMobile ? 9 : 10, letterSpacing: 2, color: '#e8a156', marginBottom: 8 }}>{client.toUpperCase()}</div>
        <div style={{ fontFamily: '"Spectral", serif', fontSize: big ? (isMobile ? 26 : 40) : (isMobile ? 18 : 24), fontWeight: 400, letterSpacing: -0.5, lineHeight: 1.05 }}>{title}</div>
      </div>

      {/* Description overlay (accent colored, appears on tap) */}
      {description && (
        <div
          style={{
            position: 'absolute', inset: 0, padding: isMobile ? '72px 22px 120px' : '88px 32px 160px',
            color: '#e8a156',
            fontFamily: '"Spectral", serif',
            fontSize: isMobile ? 15 : 17, lineHeight: 1.5, fontWeight: 400,
            letterSpacing: -0.1,
            opacity: active ? 1 : 0,
            transform: active ? 'translateY(0)' : 'translateY(10px)',
            transition: 'opacity 0.5s ease, transform 0.5s ease',
            pointerEvents: active ? 'auto' : 'none',
            overflowY: 'auto',
          }}
        >
          {description}
        </div>
      )}

      {/* Year stamp — always top right */}
      <div style={{ position: 'absolute', top: isMobile ? 14 : 20, right: isMobile ? 14 : 20, fontFamily: '"JetBrains Mono", monospace', fontSize: isMobile ? 10 : 11, letterSpacing: 2, color: 'rgba(244,237,224,0.85)', padding: '6px 10px', border: '1px solid rgba(244,237,224,0.3)', fontWeight: 500 }}>
        {year}
      </div>

      {/* Small affordance — "TAP" / "BACK" in top left */}
      <div style={{ position: 'absolute', top: isMobile ? 14 : 20, left: isMobile ? 14 : 20, fontFamily: '"JetBrains Mono", monospace', fontSize: isMobile ? 9 : 10, letterSpacing: 2, color: active ? '#e8a156' : 'rgba(244,237,224,0.55)', padding: '5px 9px', border: `1px solid ${active ? 'rgba(232,161,86,0.55)' : 'rgba(244,237,224,0.18)'}`, fontWeight: 600, transition: 'color 0.3s ease, border-color 0.3s ease' }}>
        {active ? 'CLOSE ×' : 'READ +'}
      </div>
    </div>
  );
}

Object.assign(window, { Direction1 });
