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

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

function Direction1() {
  const isMobile = useIsMobile();
  const [eraIdx, setEraIdx] = React.useState(0);
  const [formOpen, setFormOpen] = React.useState(false);
  const [soonOpen, setSoonOpen] = React.useState(false);
  const audioRef = React.useRef(null);
  const [soundOn, setSoundOn] = React.useState(true);
  React.useEffect(() => {
    const a = audioRef.current;
    if (!a) return;
    a.volume = 0.45;
    a.muted = false;
    let unlocked = false;
    const unlock = () => {
      if (unlocked) return;
      unlocked = true;
      a.muted = false;
      a.play().then(() => setSoundOn(true)).catch(() => {});
    };
    a.play().then(() => setSoundOn(true)).catch(() => {
      // Autoplay blocked — wait for ANY user signal
      a.muted = true;
      setSoundOn(false);
      const events = ['pointerdown', 'pointermove', 'keydown', 'scroll', 'touchstart', 'wheel'];
      const handler = () => {
        events.forEach(ev => window.removeEventListener(ev, handler, true));
        unlock();
      };
      events.forEach(ev => window.addEventListener(ev, handler, { capture: true, passive: true }));
    });
  }, []);
  // Pause background music when the tab/app is hidden, resume when visible (if it was on).
  // visibilitychange is the only event we trust — pagehide/blur/focus can fire during page load
  // and would interrupt the initial autoplay sequence.
  React.useEffect(() => {
    const onVisibility = () => {
      const a = audioRef.current;
      if (!a) return;
      if (document.hidden) {
        try { a.pause(); } catch (_) {}
      } else if (soundOn) {
        try { a.play().catch(() => {}); } catch (_) {}
      }
    };
    document.addEventListener('visibilitychange', onVisibility);
    return () => document.removeEventListener('visibilitychange', onVisibility);
  }, [soundOn]);

  const toggleSound = () => {
    const a = audioRef.current;
    if (!a) return;
    if (a.paused || a.muted) {
      a.muted = false;
      a.volume = 0.45;
      a.play().catch(() => {});
      setSoundOn(true);
    } else {
      a.muted = true;
      setSoundOn(false);
    }
  };
  const WA_NUMBER = '4915775234901';
  const eras = ['titanic', 'ww2', 'renaissance', 'western'];
  const ERA_VIDEOS = {
    titanic: 'https://zbvtwa21cszzjg90.public.blob.vercel-storage.com/reel/Titanic_Teaser.mp4',
    ww2: 'https://zbvtwa21cszzjg90.public.blob.vercel-storage.com/reel/ww2_2.mp4',
    renaissance: 'https://zbvtwa21cszzjg90.public.blob.vercel-storage.com/reel/monalisa.mp4',
    western: 'https://zbvtwa21cszzjg90.public.blob.vercel-storage.com/reel/western.mp4',
  };
  const [durations, setDurations] = React.useState({});
  const videoRefs = React.useRef({});
  React.useEffect(() => {
    // play the active video from the start, pause others
    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',
  };

  return (
    <div style={{ background: C.bg, color: C.fg, fontFamily: C.sans, minHeight: '100%', overflow: 'hidden' }}>
      <audio ref={audioRef} src="uploads/Mossy Window.mp3" loop autoPlay preload="auto" />
      {/* NAV */}
      <nav style={{ position: 'absolute', top: 0, left: 0, right: 0, zIndex: 20, display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: isMobile ? '16px 18px' : '28px 56px', gap: 8 }}>
        <div style={{ display: 'flex', alignItems: 'baseline', gap: 12, minWidth: 0, flexShrink: 1 }}>
          <span style={{ fontFamily: C.serif, fontSize: isMobile ? 15 : 22, fontStyle: 'italic', letterSpacing: -0.5, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{isMobile ? 'Lebenswerk.film' : 'Lebenswerke als bewegte Filme'}</span>
        </div>
        <div style={{ display: 'flex', gap: isMobile ? 8 : 14, alignItems: 'center', flexShrink: 0 }}>
          <button onClick={toggleSound} aria-label={soundOn ? 'Ton aus' : 'Ton an'} title={soundOn ? 'Ton aus' : 'Ton an'} style={{ width: isMobile ? 34 : 38, height: isMobile ? 34 : 38, border: `1px solid ${soundOn ? C.accent : C.line}`, display: 'flex', alignItems: 'center', justifyContent: 'center', color: C.accent, background: 'transparent', cursor: 'pointer', padding: 0, position: 'relative', transition: 'border-color 0.25s ease' }}>
            {soundOn ? (
              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
                <path d="M11 5L6 9H2v6h4l5 4V5z"/>
                <path d="M15.5 8.5a5 5 0 010 7"/>
                <path d="M19 5a9 9 0 010 14"/>
              </svg>
            ) : (
              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
                <path d="M11 5L6 9H2v6h4l5 4V5z"/>
                <line x1="22" y1="9" x2="16" y2="15"/>
                <line x1="16" y1="9" x2="22" y2="15"/>
              </svg>
            )}
            {soundOn && <span style={{ position: 'absolute', top: 4, right: 4, width: 5, height: 5, borderRadius: '50%', background: C.accent, boxShadow: `0 0 8px ${C.accent}` }} />}
          </button>
          {!isMobile && (
            <>
              <a href="https://wa.me/" 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>
              <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>
            </>
          )}
          <button onClick={() => setFormOpen(true)} style={{ background: C.fg, color: C.bg, border: 'none', padding: isMobile ? '7px 12px' : '10px 18px', fontSize: isMobile ? 10 : 12, letterSpacing: 1.4, fontWeight: 600, cursor: 'pointer', whiteSpace: 'nowrap' }}>{isMobile ? 'ANFRAGEN' : 'JETZT ANFRAGEN'}</button>
        </div>
      </nav>

      {/* HERO REEL */}
      <section style={{ position: 'relative', height: isMobile ? '100svh' : 900, minHeight: isMobile ? 620 : 900, overflow: 'hidden' }}>
        <video
          src="https://media.larsreese.com/lebenswerk/loppheader.mp4"
          autoPlay muted loop playsInline
          preload="auto"
          style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover', display: 'block', transform: 'scale(1.02)' }}
        />
        {/* gradient scrim bottom + left */}
        <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.65) 0%, rgba(10,8,7,0.05) 35%, 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: isMobile ? 20 : 56, right: isMobile ? 20 : 56, 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 }}>
            DAS PERFEKTE GESCHENK
          </div>
          <h1 style={{
            fontFamily: C.serif,
            fontSize: isMobile ? 52 : 128, lineHeight: 0.94, fontWeight: 300,
            letterSpacing: isMobile ? -1.2 : -3, margin: 0, maxWidth: 1200,
            textWrap: 'balance',
          }}>
            Erinnerungen,<br /><em style={{ fontStyle: 'italic', color: C.accent }}>die bewegen.</em>
          </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 }}>
            Wir machen Fotos lebendig — und Leben <em style={{ color: C.accent, fontStyle: 'normal', fontWeight: 500 }}>unvergesslich</em>.{!isMobile && <br />}
            {' '}Ein Film, der ein ganzes Leben würdigt. Ein Geschenk, das Ihre Familie für Generationen weitergibt.
          </p>

          <div style={{ display: 'flex', gap: isMobile ? 10 : 16, marginTop: isMobile ? 24 : 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 }}>
              JETZT ANFRAGEN
              <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/" 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>
        </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: 'center', gap: isMobile ? 14 : 40, flexWrap: 'wrap', textAlign: 'center' }}>
          <div style={{ fontFamily: C.mono, fontSize: 10, letterSpacing: 2, color: C.dim, flexShrink: 0, width: isMobile ? '100%' : 'auto', marginBottom: isMobile ? 4 : 0 }}>DAS PERFEKTE GESCHENK FÜR</div>
          {['Geburtstage', 'Jubiläen', 'Firmengeschichte', 'Trauerfeier'].map((l) => (
            <div key={l} style={{ fontFamily: C.serif, fontSize: isMobile ? 15 : 18, letterSpacing: 0.5, opacity: 0.7, fontStyle: 'italic' }}>{l}</div>
          ))}
        </div>
      </section>

      {/* BEFORE / AFTER SPLIT */}
      <section style={{ padding: isMobile ? '72px 20px' : '140px 56px' }}>
        <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : '1fr 1fr', gap: isMobile ? 32 : 80, alignItems: 'center' }}>
          <div>
            <div style={{ fontFamily: C.mono, fontSize: isMobile ? 10 : 11, letterSpacing: isMobile ? 2 : 3, color: C.accent, marginBottom: isMobile ? 14 : 20 }}>DIE METHODE</div>
            <h2 style={{ fontFamily: C.serif, fontSize: isMobile ? 32 : 72, lineHeight: isMobile ? 1.06 : 1, fontWeight: 300, letterSpacing: isMobile ? -0.6 : -1.5, margin: 0 }}>
              Aus einem verblichenen Foto wird eine <em style={{ color: C.accent }}>lebendige Erinnerung.</em>
            </h2>
            <p style={{ fontSize: isMobile ? 15 : 18, lineHeight: 1.6, color: 'rgba(244,237,224,0.75)', maxWidth: 520, marginTop: isMobile ? 18 : 32, fontWeight: 300 }}>
              In mehreren Schritten restauriere, koloriere und animiere ich vergessene Momente.
            </p>
          </div>
          <BeforeAfterSlider />
        </div>
      </section>

      {/* BANNER */}
      <section style={{ padding: isMobile ? '0 20px 36px' : '0 56px 60px' }}>
        <div style={{ width: '100%', aspectRatio: '1000 / 462', backgroundImage: 'url(uploads/banner-lebenswerk.jpg)', backgroundSize: 'cover', backgroundPosition: 'center', border: `1px solid ${C.line}` }} />
      </section>

      {/* CASE STUDIES GRID */}
      <section style={{ padding: isMobile ? '32px 20px 72px' : '60px 56px 140px' }}>
        <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: isMobile ? 32 : 56, fontWeight: 300, letterSpacing: isMobile ? -0.6 : -1, margin: 0 }}>Ausgewählte Arbeiten</h2>
          <button onClick={() => setSoonOpen(true)} style={{ fontFamily: C.mono, fontSize: isMobile ? 10 : 11, letterSpacing: 2, color: C.accent, textDecoration: 'none', background: 'transparent', border: 'none', cursor: 'pointer', padding: 0 }}>{isMobile ? 'MEHR AUF INSTAGRAM →' : 'MEHR PROJEKTE AUF 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="Goldene Hochzeit — Familie M." client="Privat" year="2026" big img="uploads/wedding.jpg" />
          <CaseCard era="wwi"       title="Erste Tage — Familie H." client="Privat" year="2026" big img="uploads/baby-sm.jpg" />
          <CaseCard era="medieval"  title="Weihnachten bei Oma — Familie K." client="Privat" year="2026" big img="uploads/weihnachten-sm.jpg" />
        </div>
      </section>

      {/* PRICING */}
      <section style={{ padding: isMobile ? '24px 20px 72px' : '40px 56px 140px' }}>
        <div style={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between', marginBottom: isMobile ? 28 : 48, gap: 24, flexWrap: 'wrap' }}>
          <div>
            <div style={{ fontFamily: C.mono, fontSize: isMobile ? 10 : 11, letterSpacing: isMobile ? 2 : 3, color: C.accent, marginBottom: isMobile ? 12 : 16 }}>PAKETE</div>
            <h2 style={{ fontFamily: C.serif, fontSize: isMobile ? 32 : 56, fontWeight: 300, letterSpacing: isMobile ? -0.6 : -1, margin: 0, lineHeight: isMobile ? 1.06 : 1 }}>Drei Wege, ein <em style={{ color: C.accent }}>Lebenswerk</em> zu würdigen.</h2>
          </div>
          <div style={{ fontFamily: C.mono, fontSize: 11, letterSpacing: 2, color: C.dim, maxWidth: 280 }} />
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : 'repeat(3, 1fr)', gap: isMobile ? 16 : 20, alignItems: 'stretch' }}>
          <PriceCard
            C={C} onCta={() => setFormOpen(true)}
            tier="KLEIN"
            price="€1.290"
            minutes="3"
            images="15"
            tagline="Für persönliche Anlässe und als Geschenk zum Geburtstag, zur Goldenen Hochzeit oder zur Trauerfeier. Der kompakte Lebenswerkfilm — verdichtet, persönlich, kraftvoll."
            features={[
              'Bildrestaurierung',
              'Cineastische Filmsequenz, 3 Minuten',
              'Komponierter Soundtrack',
              'Eine Revision inklusive',
              'Auf Wunsch mit Narration in einer Sprache Ihrer Wahl',
              'Lieferzeit: 5 Werktage',
            ]}
          />
          <PriceCard
            C={C} onCta={() => setFormOpen(true)}
            featured
            tier="STANDARD"
            badge="MEISTGEWÄHLT"
            price="€1.890"
            minutes="6"
            images="30"
            tagline="Das vollständige Lebenswerkfilm-Erlebnis. Genug Raum, um die wichtigsten Stationen eines Lebens zu würdigen — Kindheit, Jugend, Familie, prägende Momente. Der Film, den Sie bei der Geburtstagsfeier zeigen und Ihre Enkel in fünfzig Jahren noch ansehen werden."
            features={[
              'Bildrestaurierung',
              'Cineastische Filmsequenz, 6 Minuten',
              'Komponierter Soundtrack',
              'Eine Revision inklusive',
              'Auf Wunsch mit Narration in einer Sprache Ihrer Wahl',
              'Lieferzeit: 5 Werktage',
            ]}
          />
          <PriceCard
            C={C} onCta={() => setFormOpen(true)}
            tier="PREMIUM"
            price="€2.890"
            minutes="10"
            images="50"
            tagline="Für ganze Familienstammbäume oder ideal für Firmengeschichten. Der ausführliche Film, der mehrere Generationen, Wegmarken und Kapitel in einem Werk zusammenführt — das Geschenk für Familien und Unternehmen, die ihre Geschichte vollständig festhalten wollen."
            features={[
              'Bildrestaurierung',
              'Cineastische Filmsequenz, 10 Minuten',
              'Komponierter Soundtrack',
              'Eine Revision inklusive',
              'Auf Wunsch mit Narration in einer Sprache Ihrer Wahl',
              'Lieferzeit: 8 Werktage',
            ]}
          />
        </div>
        <div style={{ marginTop: 28, fontFamily: C.mono, fontSize: 11, letterSpacing: 2, color: C.dim, textAlign: 'center' }}>
          24H / 48H LIEFERZEIT GEGEN AUFPREIS MÖGLICH
        </div>
      </section>

      {/* ABOUT */}
      <section style={{ padding: isMobile ? '64px 20px' : '120px 56px', borderTop: `1px solid ${C.line}`, background: '#0c0a08' }}>
        <div style={{ display: 'grid', gridTemplateColumns: isMobile ? '1fr' : '5fr 7fr', gap: isMobile ? 32 : 80, alignItems: 'center', maxWidth: 1400, margin: '0 auto' }}>
          <div style={{ position: 'relative', aspectRatio: '4/5', background: '#1a1612', border: `1px solid ${C.line}`, overflow: 'hidden' }}>
            <div style={{ position: 'absolute', inset: 0, backgroundImage: 'url(uploads/lars2-sm.jpg)', backgroundSize: 'cover', backgroundPosition: 'center top', filter: 'saturate(0.95) contrast(1.02)' }} />
            <div style={{ position: 'absolute', left: 0, right: 0, bottom: 0, padding: '16px 20px', background: 'linear-gradient(180deg, rgba(10,8,7,0) 0%, rgba(10,8,7,0.85) 100%)', fontFamily: C.mono, fontSize: 10, letterSpacing: 2, color: 'rgba(244,237,224,0.85)' }}>
              LARS REESE · MÜNCHEN
            </div>
            <span style={{ position: 'absolute', top: -1, left: -1, width: 16, height: 16, borderTop: `1px solid ${C.accent}`, borderLeft: `1px solid ${C.accent}` }} />
            <span style={{ position: 'absolute', top: -1, right: -1, width: 16, height: 16, borderTop: `1px solid ${C.accent}`, borderRight: `1px solid ${C.accent}` }} />
            <span style={{ position: 'absolute', bottom: -1, left: -1, width: 16, height: 16, borderBottom: `1px solid ${C.accent}`, borderLeft: `1px solid ${C.accent}` }} />
            <span style={{ position: 'absolute', bottom: -1, right: -1, width: 16, height: 16, borderBottom: `1px solid ${C.accent}`, borderRight: `1px solid ${C.accent}` }} />
          </div>
          <div>
            <div style={{ fontFamily: C.mono, fontSize: isMobile ? 10 : 11, letterSpacing: isMobile ? 2 : 3, color: C.accent, marginBottom: isMobile ? 14 : 20 }}>IHR RESTAURATOR</div>
            <h2 style={{ fontFamily: C.serif, fontSize: isMobile ? 32 : 60, fontWeight: 300, letterSpacing: isMobile ? -0.6 : -1.5, margin: isMobile ? '0 0 22px' : '0 0 32px', lineHeight: 1.05 }}>
              Kein Massenprodukt — <em style={{ color: C.accent }}>handgefertigtes Erzählhandwerk.</em>
            </h2>
            <p style={{ fontFamily: C.serif, fontSize: isMobile ? 16 : 19, lineHeight: 1.7, color: 'rgba(244,237,224,0.82)', margin: '0 0 18px', textWrap: 'pretty' }}>
              Mein Name ist Lars Reese. Seit über 20 Jahren erzähle ich als Dokumentarfilmer Geschichten — für internationales Fernsehen und Streamingdienste, von historischen Reportagen bis zu intimen Porträts.
            </p>
            <p style={{ fontFamily: C.serif, fontSize: isMobile ? 16 : 19, lineHeight: 1.7, color: 'rgba(244,237,224,0.82)', margin: '0 0 18px', textWrap: 'pretty' }}>
              Vom Branchenmagazin <em>medium</em> wurde ich unter die Top 30 Talente Deutschlands gewählt. Was ich hier mache, ist kein automatisierter Service: Jeder Lebenswerkfilm entsteht in meinem Studio — Bild für Bild, Stimme für Stimme, mit der gleichen Sorgfalt, mit der ich auch sendefähige Dokumentationen produziere.
            </p>
            <p style={{ fontFamily: C.serif, fontSize: isMobile ? 16 : 19, fontStyle: 'italic', lineHeight: 1.7, color: C.fg, margin: 0, textWrap: 'pretty' }}>
              Ihre kostbarsten Fotos sind hier in guten Händen.
            </p>
            <div style={{ display: 'flex', gap: isMobile ? 18 : 32, marginTop: isMobile ? 28 : 44, paddingTop: isMobile ? 24 : 32, borderTop: `1px solid ${C.line}`, flexWrap: 'wrap' }}>
              <div>
                <div style={{ fontFamily: C.serif, fontSize: isMobile ? 28 : 36, fontWeight: 300, letterSpacing: -0.5, color: C.accent, lineHeight: 1 }}>20+</div>
                <div style={{ fontFamily: C.mono, fontSize: isMobile ? 9 : 10, letterSpacing: 2, color: C.dim, marginTop: 8 }}>JAHRE ERFAHRUNG</div>
              </div>
              <div>
                <div style={{ fontFamily: C.serif, fontSize: isMobile ? 28 : 36, fontWeight: 300, letterSpacing: -0.5, color: C.accent, lineHeight: 1 }}>Top 30</div>
                <div style={{ fontFamily: C.mono, fontSize: isMobile ? 9 : 10, letterSpacing: 2, color: C.dim, marginTop: 8 }}>TALENTE DEUTSCHLAND</div>
              </div>
              <div>
                <div style={{ fontFamily: C.serif, fontSize: isMobile ? 28 : 36, fontWeight: 300, letterSpacing: -0.5, color: C.accent, lineHeight: 1 }}>International</div>
                <div style={{ fontFamily: C.mono, fontSize: isMobile ? 9 : 10, letterSpacing: 2, color: C.dim, marginTop: 8 }}>TV & STREAMING</div>
              </div>
            </div>
          </div>
        </div>
      </section>

      {/* FINAL CTA */}
      <section style={{ position: 'relative', minHeight: isMobile ? 480 : 640, overflow: 'hidden', borderTop: `1px solid ${C.line}` }}>
        <div style={{ position: 'absolute', inset: 0, backgroundImage: 'url(https://zbvtwa21cszzjg90.public.blob.vercel-storage.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 ? '72px 20px' : 56, minHeight: isMobile ? 480 : 640 }}>
          <div style={{ fontFamily: C.mono, fontSize: isMobile ? 10 : 11, letterSpacing: isMobile ? 2 : 3, color: C.accent, marginBottom: isMobile ? 14 : 24 }}>JETZT ANFRAGEN</div>
          <h2 style={{ fontFamily: C.serif, fontSize: isMobile ? 38 : 104, fontWeight: 300, letterSpacing: isMobile ? -0.8 : -2.5, margin: 0, lineHeight: 0.98, maxWidth: 1200 }}>
            Welches Lebenswerk<br /><em style={{ color: C.accent }}>möchten Sie würdigen?</em>
          </h2>
          <div style={{ display: 'flex', gap: isMobile ? 10 : 16, marginTop: isMobile ? 26 : 48, alignItems: 'center', flexWrap: 'wrap', justifyContent: 'center' }}>
            <a href="https://wa.me/" target="_blank" rel="noopener" style={{ background: C.accent, color: '#1a1208', border: 'none', padding: isMobile ? '14px 24px' : '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' : 'AUF WHATSAPP SCHREIBEN'}
            </a>
            <div style={{ display: 'flex', gap: 10, marginLeft: 4 }}>
              <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: 12, borderTop: `1px solid ${C.line}`, flexWrap: 'wrap', flexDirection: isMobile ? 'column' : 'row' }}>
        <span>© LARS REESE</span>
        <span style={{ opacity: 0.85 }}>HISTORISCHE REKONSTRUKTION</span>
        <span style={{ display: 'flex', gap: 18 }}>
          <a href="Impressum.html" style={{ color: C.dim }}>IMPRESSUM</a>
        </span>
      </footer>
      {formOpen && <StartProjectModal onClose={() => setFormOpen(false)} waNumber={WA_NUMBER} C={C} />}
      {soonOpen && (
        <div onClick={() => setSoonOpen(false)} style={{ position: 'fixed', inset: 0, background: 'rgba(10,8,7,0.85)', backdropFilter: 'blur(6px)', zIndex: 100, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 24, animation: 'fadeIn 0.2s ease' }}>
          <div onClick={(e) => e.stopPropagation()} style={{ position: 'relative', background: '#14110d', border: `1px solid ${C.line}`, padding: '56px 64px', textAlign: 'center', maxWidth: 440 }}>
            <button onClick={() => setSoonOpen(false)} aria-label="Schließen" 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: 40, fontWeight: 300, letterSpacing: -1, margin: 0, color: C.fg }}>Bald verfügbar.</h3>
          </div>
        </div>
      )}
    </div>
  );
}

function StartProjectModal({ onClose, waNumber, C }) {
  const isMobile = useIsMobile();
  const [name, setName] = React.useState('');
  const [org, setOrg] = React.useState('');
  const [contact, setContact] = React.useState('');
  const [msg, setMsg] = React.useState('');
  const [status, setStatus] = React.useState('idle'); // idle | sending | sent | error
  const canSend = name.trim() && contact.trim() && msg.trim();
  const send = async (e) => {
    e.preventDefault();
    if (!canSend || status === 'sending') return;
    setStatus('sending');
    try {
      const res = await fetch('https://formsubmit.co/ajax/work@larsreese.de', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
        body: JSON.stringify({
          _subject: `Lebenswerk · neue Anfrage von ${name}`,
          _captcha: 'false',
          _template: 'table',
          Name: name,
          Organisation: org || '—',
          Kontakt: contact,
          Nachricht: msg,
        }),
      });
      if (!res.ok) throw new Error('send failed');
      setStatus('sent');
    } catch (_) {
      setStatus('error');
    }
  };
  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="Schließen" 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 }}>LEBENSWERK LEBENDIG MACHEN</div>
        <h3 style={{ fontFamily: C.serif, fontSize: isMobile ? 26 : 36, fontWeight: 300, letterSpacing: -0.8, margin: 0, lineHeight: 1.05 }}>
          Erzählen Sie von den Erinnerungen, die Sie <em style={{ color: C.accent }}>unvergesslich</em> machen wollen.
        </h3>
        <p style={{ fontSize: 13, color: C.dim, lineHeight: 1.5, marginTop: 12, marginBottom: 28, fontWeight: 300 }}>
          Hinterlassen Sie Ihre Kontaktdaten und ein paar Zeilen. Antwort meist innerhalb eines Tages.
        </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="Ihr Name" autoFocus />
          </div>
          <div>
            <label style={labelStyle}>INSTITUTION ODER UNTERNEHMEN</label>
            <input style={inputStyle} value={org} onChange={(e) => setOrg(e.target.value)} placeholder="Optional" />
          </div>
          <div>
            <label style={labelStyle}>E-MAIL ODER TELEFON</label>
            <input style={inputStyle} value={contact} onChange={(e) => setContact(e.target.value)} placeholder="Wie kann ich Sie erreichen?" />
          </div>
          <div>
            <label style={labelStyle}>NACHRICHT</label>
            <textarea style={{ ...inputStyle, resize: 'vertical', minHeight: 80, fontFamily: C.sans }} value={msg} onChange={(e) => setMsg(e.target.value)} placeholder="Ein paar Sätze zu Ihrem Vorhaben…" />
          </div>
        </div>
        {status === 'sent' ? (
          <div style={{ marginTop: 32, padding: '20px 18px', border: `1px solid ${C.accent}`, background: 'rgba(232,161,86,0.08)', textAlign: 'center' }}>
            <div style={{ fontFamily: C.serif, fontSize: 20, color: C.fg, marginBottom: 8 }}>Vielen Dank.</div>
            <div style={{ fontFamily: C.sans, fontSize: 13, color: 'rgba(244,237,224,0.75)', lineHeight: 1.5 }}>Ihre Nachricht ist eingegangen. Ich melde mich in der Regel innerhalb eines Tages.</div>
            <button type="button" onClick={onClose} style={{ marginTop: 18, background: 'transparent', color: C.accent, border: `1px solid ${C.accent}`, padding: '10px 22px', fontFamily: C.mono, fontSize: 11, letterSpacing: 2, fontWeight: 700, cursor: 'pointer' }}>SCHLIESSEN</button>
          </div>
        ) : (
          <>
            <button type="submit" disabled={!canSend || status === 'sending'} style={{ marginTop: 32, width: '100%', background: canSend && status !== 'sending' ? C.accent : 'rgba(232,161,86,0.25)', color: '#1a1208', border: 'none', padding: '18px 24px', fontSize: 13, fontWeight: 700, letterSpacing: 1.5, cursor: canSend && status !== 'sending' ? 'pointer' : 'not-allowed', display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 12 }}>
              {status === 'sending' ? 'WIRD GESENDET…' : 'SENDEN'}
            </button>
            {status === 'error' && (
              <div style={{ marginTop: 14, fontFamily: C.mono, fontSize: 11, letterSpacing: 1.4, color: '#e58572', textAlign: 'center' }}>
                Senden fehlgeschlagen — bitte direkt per E-Mail an work@larsreese.de.
              </div>
            )}
          </>
        )}
      </form>
    </div>
  );
}

function BeforeAfterSlider() {
  const isMobile = useIsMobile();
  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: '4/3', width: '100%', overflow: 'hidden', cursor: 'ew-resize', userSelect: 'none', touchAction: 'none' }}
         onPointerDown={(e) => { dragging.current = true; const r = ref.current.getBoundingClientRect(); setPct(Math.max(0, Math.min(100, ((e.clientX - r.left) / r.width) * 100))); }}>
      <div style={{ position: 'absolute', inset: 0, backgroundImage: 'url(uploads/after2-sm.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>REKONSTRUKTION</span>
      </div>
      <div style={{ position: 'absolute', inset: 0, clipPath: `inset(0 ${100 - pct}% 0 0)`, backgroundImage: 'url(uploads/before2-sm.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>QUELLE</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, img }) {
  const isMobile = useIsMobile();
  const [hover, setHover] = React.useState(false);
  return (
    <div 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 ? 'scale(1.04)' : 'scale(1)', transition: 'transform 0.8s ease' }}>
        {img ? (
          <div style={{ width: '100%', height: '100%', backgroundImage: `url(${img})`, backgroundSize: 'cover', backgroundPosition: 'center', filter: hover ? 'none' : 'saturate(0.8) contrast(1.04)' }} />
        ) : video ? (
          <video src={video} autoPlay muted loop playsInline
                 style={{ width: '100%', height: '100%', objectFit: 'cover', display: 'block', filter: hover ? 'none' : 'saturate(0.75) contrast(1.05)' }} />
        ) : (
          <EraPlaceholder era={era} mode={hover ? 'photoreal' : 'archival'} showStamp={false} />
        )}
      </div>
      <div style={{ position: 'absolute', inset: 0, background: 'linear-gradient(180deg, rgba(10,8,7,0) 40%, rgba(10,8,7,0.9) 100%)' }} />
      <div style={{ position: 'absolute', bottom: 0, left: 0, right: 0, padding: isMobile ? 20 : 28, color: '#f4ede0' }}>
        <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>
      <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>
    </div>
  );
}

function PriceCard({ C, tier, price, minutes, images, tagline, features, badge, featured, onCta }) {
  const isMobile = useIsMobile();
  const [hover, setHover] = React.useState(false);
  const bg = featured ? '#1a1208' : '#100c08';
  const border = featured ? C.accent : (hover ? 'rgba(232,161,86,0.45)' : C.line);
  return (
    <div
      onMouseEnter={() => setHover(true)}
      onMouseLeave={() => setHover(false)}
      style={{
        position: 'relative',
        background: bg,
        border: `1px solid ${border}`,
        padding: isMobile ? '32px 24px 28px' : '40px 36px 36px',
        display: 'flex',
        flexDirection: 'column',
        transform: hover ? 'translateY(-6px)' : 'translateY(0)',
        boxShadow: hover ? '0 30px 60px rgba(0,0,0,0.5)' : (featured ? '0 12px 32px rgba(0,0,0,0.35)' : 'none'),
        transition: 'transform 0.45s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.45s ease, border-color 0.3s ease',
      }}
    >
      {/* corner ticks */}
      <span style={{ position: 'absolute', top: -1, left: -1, width: 14, height: 14, borderTop: `1px solid ${C.accent}`, borderLeft: `1px solid ${C.accent}`, opacity: featured || hover ? 1 : 0.35, transition: 'opacity 0.3s' }} />
      <span style={{ position: 'absolute', top: -1, right: -1, width: 14, height: 14, borderTop: `1px solid ${C.accent}`, borderRight: `1px solid ${C.accent}`, opacity: featured || hover ? 1 : 0.35, transition: 'opacity 0.3s' }} />
      <span style={{ position: 'absolute', bottom: -1, left: -1, width: 14, height: 14, borderBottom: `1px solid ${C.accent}`, borderLeft: `1px solid ${C.accent}`, opacity: featured || hover ? 1 : 0.35, transition: 'opacity 0.3s' }} />
      <span style={{ position: 'absolute', bottom: -1, right: -1, width: 14, height: 14, borderBottom: `1px solid ${C.accent}`, borderRight: `1px solid ${C.accent}`, opacity: featured || hover ? 1 : 0.35, transition: 'opacity 0.3s' }} />

      {badge && (
        <div style={{ position: 'absolute', top: -11, left: 36, background: C.accent, color: '#1a1208', fontFamily: C.mono, fontSize: 10, letterSpacing: 2, padding: '5px 10px', fontWeight: 700 }}>
          {badge}
        </div>
      )}

      <div style={{ fontFamily: C.mono, fontSize: 11, letterSpacing: 3, color: C.accent, marginBottom: 24 }}>{tier}</div>

      <div style={{ display: 'flex', alignItems: 'baseline', gap: 10, marginBottom: isMobile ? 22 : 28 }}>
        <div style={{ fontFamily: C.serif, fontSize: isMobile ? 44 : 56, fontWeight: 300, letterSpacing: -1.5, lineHeight: 1, color: C.fg }}>{price}</div>
      </div>

      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 0, marginBottom: isMobile ? 22 : 26, borderTop: `1px solid ${C.line}`, borderBottom: `1px solid ${C.line}` }}>
        <div style={{ padding: '16px 0', borderRight: `1px solid ${C.line}` }}>
          <div style={{ fontFamily: C.serif, fontSize: isMobile ? 36 : 44, fontWeight: 300, letterSpacing: -1, lineHeight: 1, color: C.fg }}>
            {minutes}<span style={{ fontSize: isMobile ? 18 : 22, color: C.accent, marginLeft: 4 }}>′</span>
          </div>
          <div style={{ fontFamily: C.mono, fontSize: 10, letterSpacing: 2, color: C.dim, marginTop: 6 }}>MINUTEN</div>
        </div>
        <div style={{ padding: '16px 0 16px 18px' }}>
          <div style={{ fontFamily: C.serif, fontSize: isMobile ? 36 : 44, fontWeight: 300, letterSpacing: -1, lineHeight: 1, color: C.fg }}>
            {images}
          </div>
          <div style={{ fontFamily: C.mono, fontSize: 10, letterSpacing: 2, color: C.dim, marginTop: 6 }}>BILDER</div>
        </div>
      </div>

      <p style={{ fontFamily: C.serif, fontSize: isMobile ? 14 : 15, fontStyle: 'italic', lineHeight: 1.55, color: 'rgba(244,237,224,0.78)', margin: '0 0 24px', textWrap: 'pretty' }}>{tagline}</p>

      <ul style={{ listStyle: 'none', padding: 0, margin: '0 0 36px', display: 'flex', flexDirection: 'column', gap: 0, flex: 1 }}>
        {features.map((f, i) => (
          <li key={i}
              style={{
                fontFamily: C.sans, fontSize: 13.5, color: 'rgba(244,237,224,0.88)',
                padding: '11px 0', borderBottom: '1px solid rgba(244,237,224,0.06)',
                display: 'flex', alignItems: 'flex-start', gap: 12,
                transform: hover ? 'translateX(2px)' : 'translateX(0)',
                transition: `transform 0.4s cubic-bezier(0.2,0.8,0.2,1) ${i * 35}ms, color 0.3s`,
              }}>
            <span style={{ color: C.accent, fontFamily: C.mono, fontSize: 11, lineHeight: 1.6, flexShrink: 0, marginTop: 1 }}>—</span>
            <span>{f}</span>
          </li>
        ))}
      </ul>

      <button
        onClick={onCta}
        style={{
          background: featured ? C.accent : 'transparent',
          color: featured ? '#1a1208' : C.fg,
          border: featured ? 'none' : `1px solid ${hover ? C.accent : 'rgba(244,237,224,0.3)'}`,
          padding: '16px 24px',
          fontFamily: C.mono, fontSize: 11, letterSpacing: 2, fontWeight: 700,
          cursor: 'pointer', textTransform: 'uppercase',
          display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 12,
          transition: 'all 0.3s ease',
        }}
        onMouseEnter={(e) => {
          if (!featured) { e.currentTarget.style.background = C.accent; e.currentTarget.style.color = '#1a1208'; }
        }}
        onMouseLeave={(e) => {
          if (!featured) { e.currentTarget.style.background = 'transparent'; e.currentTarget.style.color = C.fg; }
        }}
      >
        <span>Anfragen</span>
        <span style={{ transform: hover ? 'translateX(4px)' : 'translateX(0)', transition: 'transform 0.4s' }}>→</span>
      </button>
    </div>
  );
}

Object.assign(window, { Direction1 });
