// Die Weiberei — page components

const { useState, useEffect, useRef } = React;

// ---------- Hooks ----------
const useReveal = () => {
  const ref = useRef(null);
  useEffect(() => {
    const el = ref.current;
    if (!el) return;
    const io = new IntersectionObserver((entries) => {
      entries.forEach((e) => {
        if (e.isIntersecting) {
          e.target.classList.add('in');
          io.unobserve(e.target);
        }
      });
    }, { threshold: 0.12 });
    io.observe(el);
    return () => io.disconnect();
  }, []);
  return ref;
};

const useCountUp = (target, duration = 1600, suffix = '') => {
  const [val, setVal] = useState(0);
  const ref = useRef(null);
  const started = useRef(false);
  useEffect(() => {
    const el = ref.current;
    if (!el) return;
    const io = new IntersectionObserver((entries) => {
      entries.forEach((e) => {
        if (e.isIntersecting && !started.current) {
          started.current = true;
          const start = performance.now();
          const tick = (t) => {
            const p = Math.min(1, (t - start) / duration);
            const eased = 1 - Math.pow(1 - p, 3);
            setVal(Math.round(target * eased));
            if (p < 1) requestAnimationFrame(tick);
          };
          requestAnimationFrame(tick);
        }
      });
    }, { threshold: 0.4 });
    io.observe(el);
    return () => io.disconnect();
  }, [target, duration]);
  return [val, ref, suffix];
};

// ---------- Nav ----------
const Nav = ({ onOpenInquiry }) => {
  const [scrolled, setScrolled] = useState(false);
  const [menuOpen, setMenuOpen] = useState(false);
  useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 8);
    window.addEventListener('scroll', onScroll, { passive: true });
    return () => window.removeEventListener('scroll', onScroll);
  }, []);
  // Lock body scroll while menu is open
  useEffect(() => {
    document.body.style.overflow = menuOpen ? 'hidden' : '';
    return () => {document.body.style.overflow = '';};
  }, [menuOpen]);

  const links = [
    { label: 'Kursplan', id: 'kursplan' },
    { label: 'Behandlungen', id: 'behandlungen' },
    { label: 'Angebot', id: 'angebot' },
    { label: 'Die Weiber', id: 'weiber' },
    { label: 'Bauchschmiede', id: 'bauchschmiede' },
    { label: 'Einblicke', id: 'einblicke' },
  ];

  return (
    <header style={{
      position: 'sticky', top: 0, zIndex: 1002,
      background: menuOpen ? 'var(--canvas)' : 'rgba(242, 228, 206, 0.85)',
      backdropFilter: menuOpen ? 'none' : 'blur(14px)',
      WebkitBackdropFilter: menuOpen ? 'none' : 'blur(14px)',
      borderBottom: scrolled ? '1px solid var(--sandstone)' : '1px solid transparent',
      transition: 'border-color 200ms var(--ease)'
    }}>
      <div className="container" style={{
        display: 'flex', alignItems: 'center', justifyContent: 'space-between',
        height: 72
      }}>
        <a href="#top" aria-label="Die Weiberei — zur Startseite" style={{
          display: 'inline-flex', alignItems: 'center',
          height: 40,
        }}>
          <img
            src="assets/logo-weiberei.png"
            alt="Die Weiberei"
            style={{
              height: 52, width: 'auto', display: 'block',
              /* Logo originally on light background with full-color script;
                 no filter needed — Canvas is warm off-white already. */
            }}
          />
        </a>
        <nav style={{ alignItems: 'center', gap: 32 }} className="primary-nav">
          {links.map((l) =>
          <a key={l.id} href={'#' + l.id} style={{
            color: 'var(--ink)',
            fontWeight: 500,
            fontSize: 15,
            transition: 'color 180ms var(--ease)'
          }}
          onMouseEnter={(e) => e.currentTarget.style.color = 'var(--heather-plum)'}
          onMouseLeave={(e) => e.currentTarget.style.color = 'var(--ink)'}>
            {l.label}</a>
          )}
        </nav>
        <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
          <button className="btn btn-primary nav-cta-desktop" onClick={onOpenInquiry} style={{ minHeight: 44, padding: '10px 22px', fontSize: 14 }}>
            Anfragen <span style={{ fontSize: 16 }}>→</span>
          </button>
          <button
            type="button"
            className="nav-burger"
            aria-label={menuOpen ? 'Menü schließen' : 'Menü öffnen'}
            aria-expanded={menuOpen}
            onClick={() => setMenuOpen((o) => !o)}
            style={{
              display: 'none',
              width: 44, height: 44, borderRadius: 10,
              background: 'transparent', border: '1px solid rgba(42,34,29,0.18)',
              alignItems: 'center', justifyContent: 'center', cursor: 'pointer'
            }}>
            <span style={{
              position: 'relative', width: 18, height: 12, display: 'inline-block'
            }}>
              <span style={{
                position: 'absolute', left: 0, right: 0, height: 1.5, background: 'var(--ink)',
                top: menuOpen ? 5 : 0, transform: menuOpen ? 'rotate(45deg)' : 'none',
                transition: 'all 220ms var(--ease)'
              }} />
              <span style={{
                position: 'absolute', left: 0, right: 0, height: 1.5, background: 'var(--ink)',
                top: 5, opacity: menuOpen ? 0 : 1, transition: 'opacity 160ms var(--ease)'
              }} />
              <span style={{
                position: 'absolute', left: 0, right: 0, height: 1.5, background: 'var(--ink)',
                top: menuOpen ? 5 : 10, transform: menuOpen ? 'rotate(-45deg)' : 'none',
                transition: 'all 220ms var(--ease)'
              }} />
            </span>
          </button>
        </div>
      </div>

      {/* Mobile drawer */}
      <div
        className="nav-drawer"
        aria-hidden={!menuOpen}
        style={{
          position: 'fixed', inset: '72px 0 0 0', zIndex: 1001,
          background: 'var(--canvas)',
          opacity: menuOpen ? 1 : 0,
          pointerEvents: menuOpen ? 'auto' : 'none',
          transition: 'opacity 220ms var(--ease)',
          display: 'flex', flexDirection: 'column',
          padding: '32px 24px 48px',
          isolation: 'isolate',
          overflowY: 'auto'
        }}>
        <nav style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
          {links.map((l, i) =>
          <a key={l.id}
          href={'#' + l.id}
          onClick={() => setMenuOpen(false)}
          style={{
            fontFamily: 'Fraunces, serif',
            fontSize: 28,
            fontWeight: 500,
            letterSpacing: '-0.01em',
            color: 'var(--ink)',
            padding: '14px 0',
            borderBottom: '1px solid rgba(196, 169, 143, 0.35)',
            transform: menuOpen ? 'translateY(0)' : 'translateY(8px)',
            opacity: menuOpen ? 1 : 0,
            transition: `all 320ms var(--ease) ${i * 40}ms`
          }}>
            {l.label}
          </a>
          )}
        </nav>
        <button
          className="btn btn-primary"
          onClick={() => {setMenuOpen(false);onOpenInquiry?.();}}
          style={{ marginTop: 32, alignSelf: 'flex-start', minHeight: 48, padding: '12px 28px' }}>
          Anfragen <span style={{ fontSize: 16 }}>→</span>
        </button>
      </div>
    </header>);

};

// ---------- Hero ----------
const Hero = ({ onOpenInquiry }) => {
  const ref = useReveal();
  return (
    <section id="top" style={{ paddingTop: 'clamp(56px, 8vw, 104px)', paddingBottom: 'clamp(28px, 4vw, 56px)' }}>
      <div className="container">
        <div ref={ref} className="reveal hero-grid">
          <div className="hero-copy">
            <div className="eyebrow" style={{ marginBottom: 24 }}>Frauenort in München-Pasing · seit 2019</div>
            <h1 style={{
              fontSize: 'clamp(44px, 5.6vw, 76px)',
              lineHeight: 1.05,
              letterSpacing: '-0.02em',
              fontVariationSettings: '"opsz" 144, "SOFT" 50, "WONK" 0',
              marginBottom: 32,
              textWrap: 'balance'
            }}>
              Ein Ort für{' '}
              <em className="bacalisties" style={{
                color: 'var(--heather-plum)',
              }}>dich</em>.
              <br />
              Miteinander.{' '}
              <em className="bacalisties" style={{
                color: 'var(--heather-plum)',
              }}>Füreinander</em>.
            </h1>
            <p className="lead" style={{ maxWidth: 560, marginBottom: 40 }}>
              Die Weiberei begleitet Frauen durch Schwangerschaft, Geburt, Rückbildung,
              Zyklus und Mutterschaft. Hebammen, Yogalehrerinnen, Osteopathinnen und
              Coaches – fachlich fundiert, schwesterlich, miteinander.
            </p>
            <div style={{ display: 'flex', flexWrap: 'wrap', gap: 12 }}>
              <button className="btn btn-primary" onClick={onOpenInquiry}>
                Kurs oder Begleitung anfragen <span>→</span>
              </button>
              <a className="btn btn-secondary" href="#angebot">Angebot ansehen</a>
            </div>
          </div>
          <HeroPortrait />
        </div>
      </div>
    </section>);

};

// ---------- Hero portrait carousel ----------
// Compact stack of overlapping branded cards. Three intimate-gesture vignettes
// (hand-on-belly, two-figures, yoga aufrichtung) cycle every ~5s; the back two
// peek out fanned behind the front. Replace each <PortraitCard svg> with real
// photography by swapping the children for an <img> element.
const PORTRAIT_CARDS = [
{ id: 'hand', label: 'Schwangerschaft', caption: 'Hand auf Bauch' },
{ id: 'kreis', label: 'Frauenkreis', caption: 'Im Gespräch' },
{ id: 'yoga', label: 'Aufrichtung', caption: 'Yoga im Studio' }];


const HeroPortrait = () => {
  const [front, setFront] = React.useState(0);
  const [paused, setPaused] = React.useState(false);
  const [dragDx, setDragDx] = React.useState(0);
  const N = PORTRAIT_CARDS.length;
  const dragRef = React.useRef({ active: false, startX: 0, moved: false, pointerId: 0 });
  const SWIPE_THRESHOLD = 48; // px; below this, snap back

  React.useEffect(() => {
    if (paused) return undefined;
    const t = setInterval(() => setFront((i) => (i + 1) % N), 5000);
    return () => clearInterval(t);
  }, [paused, N]);

  const onPointerDown = (e) => {
    if (e.button !== undefined && e.button !== 0) return;
    dragRef.current = { active: true, startX: e.clientX, moved: false, pointerId: e.pointerId };
    setPaused(true);
    try { e.currentTarget.setPointerCapture(e.pointerId); } catch (_) {}
  };
  const onPointerMove = (e) => {
    if (!dragRef.current.active) return;
    const dx = e.clientX - dragRef.current.startX;
    if (!dragRef.current.moved && Math.abs(dx) > 5) dragRef.current.moved = true;
    setDragDx(dx);
  };
  const onPointerUp = (e) => {
    if (!dragRef.current.active) return;
    const dx = e.clientX - dragRef.current.startX;
    dragRef.current.active = false;
    setDragDx(0);
    if (Math.abs(dx) > SWIPE_THRESHOLD) {
      // Swipe left (dx < 0) → next; swipe right → previous
      setFront(i => (i + (dx < 0 ? 1 : -1) + N) % N);
    }
    try { e.currentTarget.releasePointerCapture(e.pointerId); } catch (_) {}
    if (dragRef.current.moved) {
      // Swallow the click that ends the drag so the card under the cursor
      // doesn't also get tapped to the front
      const swallow = (ev) => { ev.stopPropagation(); ev.preventDefault(); };
      e.currentTarget.addEventListener('click', swallow, { capture: true, once: true });
      setTimeout(() => { dragRef.current.moved = false; }, 0);
    }
    // Resume autoplay shortly after the user lets go
    setTimeout(() => setPaused(false), 300);
  };

  // Stack positions: 0 = front, 1 = mid (right peek), 2 = back (left peek).
  // Rotated/translated so the deck reads as a fanned stack of polaroids.
  const positionFor = (i) => {
    const rel = (i - front + N) % N;
    if (rel === 0) return { z: 3, x: 0, y: 0, rot: -2.5, scale: 1, opacity: 1 };
    if (rel === 1) return { z: 2, x: 36, y: 24, rot: 5, scale: 0.94, opacity: 1 };
    return { z: 1, x: -28, y: 18, rot: -7, scale: 0.9, opacity: 1 };
  };

  // While dragging, slide the front card with the finger and rubber-band
  // fade-in the neighbour from the swipe direction so it feels physical.
  const dragProgress = Math.max(-1, Math.min(1, dragDx / 160));

  return (
    <div className="hero-portrait-stack"
    onMouseEnter={() => setPaused(true)}
    onMouseLeave={() => setPaused(false)}>
      <div
        className="hero-portrait-deck"
        onPointerDown={onPointerDown}
        onPointerMove={onPointerMove}
        onPointerUp={onPointerUp}
        onPointerCancel={onPointerUp}
        style={{
          touchAction: 'pan-y',
          cursor: dragRef.current.active ? 'grabbing' : 'grab',
        }}>
        {PORTRAIT_CARDS.map((c, i) => {
          const p = positionFor(i);
          const isFront = (i - front + N) % N === 0;
          // Apply drag offset to the front card; nudge the neighbours
          // slightly the opposite way so the stack feels physical.
          const dragX = isFront ? dragDx : -dragProgress * 12;
          const dragRot = isFront ? dragProgress * 4 : 0;
          return (
            <button
              key={c.id}
              type="button"
              onClick={() => { if (!dragRef.current.moved) setFront(i); }}
              aria-label={`${c.label} – ${c.caption}`}
              aria-pressed={isFront}
              className="hero-portrait-card"
              style={{
                zIndex: p.z,
                transform: `translate(${p.x + dragX}px, ${p.y}px) rotate(${p.rot + dragRot}deg) scale(${p.scale})`,
                opacity: p.opacity,
                cursor: isFront ? (dragRef.current.active ? 'grabbing' : 'grab') : 'pointer',
                transition: dragRef.current.active ? 'none' : undefined,
                userSelect: 'none',
                WebkitUserSelect: 'none',
              }}>
              <PortraitArt id={c.id} />
              {/* Caption pill — only on front card */}
              {isFront &&
              <span className="hero-portrait-caption">
                  <span className="dot" />
                  {c.label} · {c.caption}
                </span>
              }
            </button>);

        })}
      </div>

      {/* Dot indicators below */}
      <div className="hero-portrait-dots">
        {PORTRAIT_CARDS.map((c, i) =>
        <button key={c.id} type="button"
        onClick={() => setFront(i)}
        aria-label={`Karte ${i + 1}`}
        className={`hero-portrait-dot ${i === front ? 'is-active' : ''}`} />
        )}
      </div>
    </div>);

};

// Three branded vignettes. All share the warm sandstone→heather-plum palette
// so the stack reads as one piece even when fanned.
const PortraitArt = ({ id }) => {
  const common =
  <defs>
      <linearGradient id={`skin-${id}`} x1="0" y1="0" x2="0" y2="1">
        <stop offset="0%" stopColor="#f0d2bb" />
        <stop offset="55%" stopColor="#d9a890" />
        <stop offset="100%" stopColor="#a87063" />
      </linearGradient>
      <linearGradient id={`fabric-${id}`} x1="0" y1="0" x2="1" y2="1">
        <stop offset="0%" stopColor="#f7eadb" stopOpacity="0.92" />
        <stop offset="100%" stopColor="#e6cdb6" stopOpacity="0.7" />
      </linearGradient>
      <radialGradient id={`light-${id}`} cx="0.7" cy="0.25" r="0.85">
        <stop offset="0%" stopColor="#fbe9d6" stopOpacity="0.55" />
        <stop offset="100%" stopColor="#fbe9d6" stopOpacity="0" />
      </radialGradient>
      <filter id={`grain-${id}`} x="0" y="0" width="100%" height="100%">
        <feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" seed={id === 'hand' ? 3 : id === 'kreis' ? 7 : 11} />
        <feColorMatrix values="0 0 0 0 0.18  0 0 0 0 0.13  0 0 0 0 0.11  0 0 0 0.08 0" />
        <feComposite in2="SourceGraphic" operator="in" />
      </filter>
    </defs>;


  const bg =
  <>
      <rect x="0" y="0" width="400" height="500" fill={`url(#light-${id})`} />
    </>;


  const grain = <rect x="0" y="0" width="400" height="500" filter={`url(#grain-${id})`} opacity="0.5" />;

  return (
    <svg viewBox="0 0 400 500" preserveAspectRatio="xMidYMid slice"
    style={{ position: 'absolute', inset: 0, width: '100%', height: '100%' }}
    aria-hidden="true">
      {common}
      {bg}

      {id === 'hand' &&
      <g>
          {/* Seated figure — hand on belly */}
          <path d="M 70 500 C 70 360, 110 240, 175 175 C 215 135, 245 110, 290 110
                   C 340 110, 365 150, 365 210 C 365 280, 345 360, 345 500 Z"



        fill={`url(#skin-${id})`} opacity="0.95" />
          <path d="M 95 500 C 95 410, 130 360, 200 345 C 280 330, 340 360, 360 500 Z"
        fill={`url(#fabric-${id})`} />
          <path d="M 175 360 C 175 305, 230 285, 290 305 C 318 315, 325 345, 320 380
                   C 315 415, 270 425, 225 415 C 195 408, 175 390, 175 360 Z"



        fill={`url(#skin-${id})`} opacity="0.96" />
          <g fill={`url(#skin-${id})`} opacity="0.98">
            <path d="M 215 350 C 210 340, 215 325, 235 322 C 265 318, 290 330, 295 350
                     C 298 365, 285 378, 260 380 C 235 382, 218 372, 215 360 Z" />
          
          
          
            <path d="M 240 322 C 238 308, 244 296, 256 296 C 266 296, 270 308, 268 322 Z" />
            <path d="M 258 320 C 257 304, 264 292, 276 292 C 287 292, 291 306, 288 322 Z" />
            <path d="M 275 322 C 275 308, 282 298, 293 300 C 303 302, 305 314, 301 326 Z" />
            <path d="M 290 326 C 291 316, 297 310, 305 312 C 313 314, 314 322, 310 332 Z" />
            <path d="M 220 358 C 212 364, 208 372, 214 380 C 220 387, 230 384, 234 376 Z" />
          </g>
          <path d="M 245 110 C 240 138, 245 158, 268 165 C 290 172, 310 165, 312 145
                   C 314 128, 305 115, 290 110 Z"



        fill={`url(#skin-${id})`} opacity="0.92" />
          <path d="M 220 90 C 200 105, 188 130, 198 165 C 206 192, 230 198, 248 188
                   C 240 165, 240 140, 252 118 C 246 100, 232 88, 220 90 Z"



        fill="#6b4543" opacity="0.7" />
          <path d="M 280 160 C 305 170, 322 195, 328 230"
        stroke="#fbe9d6" strokeWidth="3" fill="none" opacity="0.45" strokeLinecap="round" />
        </g>
      }

      {id === 'kreis' &&
      <g>
          {/* Two figures leaning toward each other in conversation */}
          {/* Left figure */}
          <path d="M 30 500 C 30 380, 60 280, 110 240 C 140 215, 165 200, 185 215
                   C 200 245, 200 290, 200 360 C 200 410, 195 460, 195 500 Z"



        fill={`url(#skin-${id})`} opacity="0.94" />
          {/* Left head */}
          <path d="M 130 175 C 110 178, 100 200, 108 225 C 116 248, 145 252, 160 240
                   C 175 228, 178 200, 168 185 C 158 172, 145 172, 130 175 Z"



        fill={`url(#skin-${id})`} opacity="0.96" />
          <path d="M 110 168 C 95 175, 88 195, 96 220 C 102 200, 118 188, 138 184
                   C 145 172, 130 165, 110 168 Z"



        fill="#6b4543" opacity="0.72" />

          {/* Right figure */}
          <path d="M 220 215 C 240 200, 268 215, 285 240 C 320 280, 345 380, 365 500 L 230 500
                   C 230 460, 225 410, 225 360 C 225 290, 215 245, 220 215 Z"



        fill={`url(#skin-${id})`} opacity="0.94" />
          {/* Right head, tilted toward the left figure */}
          <path d="M 250 178 C 268 178, 285 195, 282 220 C 278 245, 250 252, 232 240
                   C 218 228, 218 198, 232 185 C 240 178, 245 178, 250 178 Z"



        fill={`url(#skin-${id})`} opacity="0.96" />
          <path d="M 282 175 C 295 178, 305 200, 298 225 C 290 205, 270 192, 252 188
                   C 248 175, 268 168, 282 175 Z"



        fill="#6b4543" opacity="0.72" />

          {/* Soft connection between them — a shared wrap / blanket */}
          <path d="M 90 500 C 90 380, 150 350, 200 350 C 250 350, 310 380, 310 500 Z"
        fill={`url(#fabric-${id})`} />

          {/* Hands meeting / resting in laps */}
          <path d="M 170 360 C 175 350, 195 348, 200 360 C 205 372, 220 372, 225 362
                   C 230 352, 215 348, 200 348 C 185 348, 170 350, 170 360 Z"



        fill={`url(#skin-${id})`} opacity="0.94" />

          {/* Atmosphere — candle glow */}
          <circle cx="200" cy="445" r="14" fill="#fbe9d6" opacity="0.55" />
          <circle cx="200" cy="445" r="6" fill="#fff3df" opacity="0.85" />
        </g>
      }

      {id === 'yoga' &&
      <g>
          {/* Standing/seated figure in tall posture (mountain pose-ish silhouette) */}
          {/* Floor / mat shadow */}
          <ellipse cx="200" cy="475" rx="140" ry="14" fill="#6b4543" opacity="0.18" />

          {/* Long body line — torso reaching upward */}
          <path d="M 165 500 C 160 420, 150 340, 168 250 C 178 195, 200 165, 220 165
                   C 245 165, 260 195, 258 250 C 252 340, 250 420, 245 500 Z"



        fill={`url(#skin-${id})`} opacity="0.95" />

          {/* Head, lifted */}
          <path d="M 195 130 C 178 132, 168 152, 178 178 C 188 200, 220 202, 234 188
                   C 248 174, 248 148, 234 134 C 222 124, 208 124, 195 130 Z"



        fill={`url(#skin-${id})`} opacity="0.96" />
          <path d="M 178 118 C 162 128, 158 148, 168 175 C 172 158, 188 144, 210 138
                   C 218 122, 196 110, 178 118 Z"



        fill="#6b4543" opacity="0.7" />

          {/* Arms reaching up alongside body */}
          <path d="M 168 240 C 145 245, 132 270, 130 320 C 128 355, 138 390, 152 420"
        stroke={`url(#skin-${id})`} strokeWidth="22" fill="none" strokeLinecap="round" opacity="0.95" />
          <path d="M 258 240 C 282 245, 295 270, 298 320 C 300 355, 290 390, 275 420"
        stroke={`url(#skin-${id})`} strokeWidth="22" fill="none" strokeLinecap="round" opacity="0.95" />

          {/* Hands meeting at heart */}
          <path d="M 188 280 C 192 268, 215 268, 220 280 C 225 268, 235 268, 240 280
                   C 240 295, 225 302, 213 300 C 200 298, 188 295, 188 280 Z"



        fill={`url(#skin-${id})`} opacity="0.96" />

          {/* Soft fabric / yoga pants */}
          <path d="M 158 360 C 155 410, 150 460, 152 500 L 252 500 C 254 460, 250 410, 248 360 Z"
        fill={`url(#fabric-${id})`} opacity="0.85" />

          {/* Highlight line down spine */}
          <path d="M 210 200 C 210 270, 210 340, 210 410"
        stroke="#fbe9d6" strokeWidth="2" fill="none" opacity="0.4" strokeLinecap="round" />
        </g>
      }

      {grain}
    </svg>);

};

// ---------- Stats / count-up ----------
const StatItem = ({ target, suffix, label, decimals, isFirst, nowrap }) => {
  const [val, ref] = useCountUp(target, 1800);
  return (
    <div ref={ref} style={{
      paddingLeft: isFirst ? 0 : 'clamp(20px, 3vw, 36px)',
      borderLeft: isFirst ? 'none' : '1px solid rgba(196, 169, 143, 0.35)',
      minWidth: 0
    }}>
      <div style={{
        fontFamily: 'Fraunces, serif',
        fontSize: nowrap ? 'clamp(36px, 4vw, 52px)' : 'clamp(44px, 5.2vw, 64px)',
        fontWeight: 400,
        lineHeight: 1.05,
        letterSpacing: '-0.02em',
        color: 'var(--heather-plum)',
        fontVariationSettings: '"opsz" 144, "SOFT" 50',
        fontVariantNumeric: 'tabular-nums lining-nums',
        marginBottom: 16,
        whiteSpace: nowrap ? 'nowrap' : 'normal'
      }}>
        {decimals ? (val / 10).toFixed(1).replace('.', ',') : val.toLocaleString('de-DE')}{suffix}
      </div>
      <div style={{ fontSize: 15, color: 'var(--ink-70)', maxWidth: 240, lineHeight: 1.5 }}>{label}</div>
    </div>);

};

const Stats = () => {
  const ref = useReveal();
  const headRef = useReveal();
  return (
    <section style={{ padding: '32px 0 80px' }}>
      <div className="container">
        <div ref={headRef} className="reveal" style={{
          display: 'flex',
          alignItems: 'flex-end',
          justifyContent: 'space-between',
          gap: 32,
          marginBottom: 28,
          flexWrap: 'wrap'
        }}>
          <div style={{ maxWidth: 540 }}>
            <span className="eyebrow" style={{ marginBottom: 12 }}>Was die Weiberei trägt</span>
            <h2 style={{
              fontSize: 'clamp(28px, 3.2vw, 40px)',
              lineHeight: 1.15,
              marginTop: 8,
              fontVariationSettings: '"opsz" 96, "SOFT" 50, "WONK" 1'
            }}>
              Sechs Jahre, viele <em className="bacalisties" style={{ color: 'var(--heather-plum)' }}>Hände</em>, ein gemeinsamer Ort.
            </h2>
          </div>
          <p style={{
            fontSize: 14, color: 'var(--ink-50)', maxWidth: 280,
            lineHeight: 1.55, paddingBottom: 6
          }}>
            Stand {new Date().getFullYear()} — Zahlen aus der laufenden Begleitung.
          </p>
        </div>

        <div ref={ref} className="reveal stats-grid" style={{
          background: 'var(--offwhite)',
          borderRadius: 28,
          border: '1px solid rgba(196, 169, 143, 0.35)',
          boxShadow: '0 1px 0 rgba(255,255,255,0.6) inset, 0 12px 40px rgba(42,34,29,0.08), 0 2px 6px rgba(42,34,29,0.04)',
          padding: '52px clamp(28px, 4vw, 56px)',
          display: 'grid',
          gridTemplateColumns: 'repeat(auto-fit, minmax(180px, 1fr))',
          gap: 'clamp(32px, 4vw, 56px)',
          alignItems: 'start',
          position: 'relative'
        }}>
          <StatItem isFirst target={2400} suffix="+" label="Frauen begleitet seit Eröffnung" />
          <StatItem target={18} suffix="" label="Kurse und Formate jede Woche" />
          <StatItem target={12} suffix="" label="Hebammen, Yogalehrerinnen, Osteopathinnen, Coaches" />
          <StatItem nowrap target={6} suffix=" Wochen" label="Bauchschmiede – das Tupler-Protokoll" />
        </div>
      </div>
    </section>);

};

// ---------- Angebot ----------
const Card = ({ tone, eyebrow, title, body, items, badge }) => {
  const ref = useReveal();
  const tones = {
    sandstone: { bg: 'var(--sandstone)', radius: 16 },
    rose: { bg: 'var(--rose-tint)', radius: 24 },
    sage: { bg: 'var(--sage-tint)', radius: 16 },
    canvas: { bg: 'var(--offwhite)', radius: 12, border: '1px solid var(--sandstone)' },
    honey: { bg: 'var(--offwhite)', radius: 16, border: '1px solid var(--honey)' }
  };
  const t = tones[tone] || tones.sandstone;
  return (
    <div ref={ref} className="reveal card-hover" style={{
      background: t.bg,
      borderRadius: t.radius,
      border: t.border || 'none',
      padding: 32,
      boxShadow: 'var(--shadow-xs)',
      transition: 'transform 220ms var(--ease), box-shadow 220ms var(--ease)',
      display: 'flex',
      flexDirection: 'column',
      gap: 16
    }}
    onMouseEnter={(e) => {e.currentTarget.style.transform = 'translateY(-3px)';e.currentTarget.style.boxShadow = 'var(--shadow-md)';}}
    onMouseLeave={(e) => {e.currentTarget.style.transform = 'translateY(0)';e.currentTarget.style.boxShadow = 'var(--shadow-xs)';}}>
      
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 12 }}>
        <div className="eyebrow" style={{ color: 'var(--ink-70)' }}>{eyebrow}</div>
        {badge && <span style={{
          background: 'var(--honey-tint)', color: 'var(--honey-ink)',
          borderRadius: 999, padding: '5px 11px',
          fontSize: 11, fontWeight: 600, letterSpacing: '0.08em', textTransform: 'uppercase'
        }}>{badge}</span>}
      </div>
      <h3 style={{ fontSize: 24, lineHeight: 1.25, fontWeight: 500 }}>{title}</h3>
      <p style={{ color: 'var(--ink-70)', fontSize: 15.5, lineHeight: 1.6 }}>{body}</p>
      <ul style={{ listStyle: 'none', display: 'flex', flexWrap: 'wrap', gap: 8, marginTop: 'auto' }}>
        {items.map((i) =>
        <li key={i} style={{
          background: 'rgba(250,246,241,0.6)',
          border: '1px solid rgba(42,34,29,0.08)',
          borderRadius: 999,
          padding: '5px 11px',
          fontSize: 12.5,
          color: 'var(--ink-70)'
        }}>{i}</li>
        )}
      </ul>
    </div>);

};

const Angebot = () => {
  const ref = useReveal();
  return (
    <section id="angebot" style={{ padding: 'clamp(80px, 12vw, 128px) 0' }}>
      <div className="container">
        <div ref={ref} className="reveal" style={{ maxWidth: 720, marginBottom: 64 }}>
          <div className="eyebrow" style={{ marginBottom: 16 }}>Angebot</div>
          <h2 style={{ fontSize: 'clamp(36px, 5vw, 56px)', lineHeight: 1.1, letterSpacing: '-0.015em', marginBottom: 20 }}>
            Begleitung über alle{' '}
            <em className="bacalisties" style={{ color: 'var(--heather-plum)' }}>Lebensphasen</em>.
          </h2>
          <p className="lead">
            Vom ersten Spüren bis lange nach der Geburt – und durch alles, was Frausein
            sonst noch ausmacht. Kurse, Einzelbegleitung, Frauenkreise.
          </p>
        </div>

        <div style={{
          display: 'grid',
          gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
          gap: 24
        }}>
          <Card tone="sandstone" eyebrow="Hebamme"
          title="Schwangerenbetreuung & Geburtshilfe"
          body="Schwangerenbetreuung, Geburtsvorbereitungskurs, Birth in Balance, Taping, Akupunktur, Wochenbett – fachliche Begleitung von erfahrenen Hebammen."
          items={['Schwangerenbetreuung', 'Geburtsvorbereitungskurs', 'Birth in Balance', 'Taping', 'Akupunktur', 'Optimierung der kindlichen Lage', 'Moxen – BEL', 'häusliche Wochenbettbetreuung', 'Aufarbeitung Geburtserlebnisse']} />

          <Card tone="sage" eyebrow="Schwangerschaft"
          title="Yoga und Geburtsvorbereitung"
          body="Yoga in der Schwangerschaft und Geburtsvorbereitungskurse – körperlich und emotional ankommen, bevor das Kind kommt."
          items={['Yoga in der Schwangerschaft', 'Geburtsvorbereitungskurse']} />

          <Card tone="sandstone" eyebrow="Rückbildung"
          title="Rückbildung & Tupler Technik"
          body="Rückbildung mit oder ohne Kind und das 6-Wochen-Tupler-Protokoll bei Rektusdiastase – sanft kräftigen, was viel geleistet hat."
          items={['Rückbildung mit/ohne Kind', 'Tupler Technik']} />

          <Card tone="rose" eyebrow="Für dich als Frau"
          title="Frauenzirkel & Moonyoga"
          body="Frauenzirkel und Moonyoga – Räume, in denen Frauen sich zeigen, austauschen, in ihre Kraft kommen."
          items={['Frauenzirkel', 'Moonyoga']} />

          <Card tone="honey" eyebrow="Gönn dir was Gutes"
          title="Coaching, Osteopathie & Yoga"
          body="Embodied Mental Coaching, Osteopathie, Darmgesundheit, Breathwork und Yoga-Formate, die dich aus dem Alltag holen."
          items={['embodied mental Coaching', 'Osteopathie', 'Darmgesundheit', 'Breathwork – psychedelic Breath', 'Working Mama-Yoga', 'Mama-Verwöhn Yoga', 'Face-Yoga']} />

          <Card tone="sandstone" eyebrow="Baby- und Kinderkurse"
          title="Musikalische Früherziehung & FenKid"
          body="Musikalische Früherziehung und FenKid – bedürfnisorientierte Kurse für die Zeit mit deinem Kind."
          items={['Musikalische Früherziehung', 'FenKid']} />

        </div>
      </div>
    </section>);

};

// ---------- Bauchschmiede card ----------
const Bauchschmiede = () => {
  const ref = useReveal();
  return (
    <section id="bauchschmiede" style={{ padding: 'clamp(40px, 6vw, 64px) 0 clamp(64px, 10vw, 96px)' }}>
      <div className="container">
        <div ref={ref} className="reveal bauchschmiede-grid" style={{
          background: 'var(--offwhite)',
          border: '1px solid var(--terracotta)',
          borderRadius: 28,
          boxShadow: '0 1px 0 rgba(255,255,255,0.6) inset, 0 12px 40px rgba(42,34,29,0.08)',
          padding: 'clamp(32px, 5vw, 64px)',
          display: 'grid',
          gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))',
          gap: 40,
          alignItems: 'center'
        }}>
          <div>
            <div className="eyebrow" style={{ color: 'var(--terracotta)', marginBottom: 16 }}>VON UNS ENTWICKELT</div>
            <h3 style={{
              fontFamily: 'Fraunces, serif',
              fontSize: 'clamp(32px, 4.5vw, 44px)',
              lineHeight: 1.1,
              letterSpacing: '-0.015em',
              marginBottom: 20,
              fontVariationSettings: '"opsz" 96, "SOFT" 40'
            }}>
              die Bauchschmiede<span style={{ color: 'var(--terracotta)' }}>.</span>
            </h3>
            <p style={{ color: 'var(--ink-70)', fontSize: 17, lineHeight: 1.6, marginBottom: 24, maxWidth: 540 }}>
              Das 6-Wochen-Tupler-Protokoll für Rektusdiastase. ZPP-zertifiziert,
              ca. 150 € Kassenerstattung. Aus der Weiberei heraus geboren – als eigenständiges Programm.
            </p>
            <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8, marginBottom: 28 }}>
              {[
              { t: 'ZPP §20 SGB V', bg: 'var(--sage-tint)', c: 'var(--sage-ink)' },
              { t: 'TUPLER TECHNIQUE®', bg: 'var(--sage-tint)', c: 'var(--sage-ink)' },
              { t: '6 WOCHEN', bg: 'var(--honey-tint)', c: 'var(--honey-ink)' }].
              map((p) =>
              <span key={p.t} style={{
                background: p.bg, color: p.c, borderRadius: 999, padding: '5px 11px',
                fontSize: 11.5, fontWeight: 600, letterSpacing: '0.08em', textTransform: 'uppercase'
              }}>{p.t}</span>
              )}
            </div>
            <a href="#" className="btn" style={{
              background: 'var(--terracotta)', color: 'var(--offwhite)'
            }}
            onMouseEnter={(e) => {e.currentTarget.style.background = '#9E5740';e.currentTarget.style.transform = 'translateY(-2px)';}}
            onMouseLeave={(e) => {e.currentTarget.style.background = 'var(--terracotta)';e.currentTarget.style.transform = 'translateY(0)';}}>
              
              Zur Bauchschmiede <span>→</span>
            </a>
          </div>
          <div className="bauchschmiede-illu"><BauchschmiedeIllustration /></div>
        </div>
      </div>
    </section>);

};

const BauchschmiedeIllustration = () => {
  // Real photo: trainer hands-on guidance on the mat. Studio with terracotta wall —
  // matches the Bauchschmiede accent color, so the image sits naturally in the section.
  return (
    <div style={{
      aspectRatio: '4/3',
      background: 'var(--offwhite)',
      borderRadius: 12,
      position: 'relative',
      overflow: 'hidden',
      border: '1px solid rgba(181,104,74,0.2)',
      boxShadow: '0 18px 48px rgba(42,34,29,0.16)'
    }}>
      <img
        src="assets/bauchschmiede.png"
        alt="Trainerin gibt Hands-on-Anleitung beim Tupler-Protokoll auf der Matte"
        loading="lazy"
        draggable="false"
        style={{
          position: 'absolute', inset: 0,
          width: '100%', height: '100%',
          objectFit: 'cover', objectPosition: 'center',
          display: 'block'
        }} />
      
    </div>);

};

// ---------- Frauenkreis (Zitat / Editorial) ----------
const Frauenkreis = () => {
  const ref = useReveal();
  return (
    <section id="frauenkreis" style={{
      padding: 'clamp(96px, 14vw, 160px) 0',
      position: 'relative',
      overflow: 'hidden'
    }}>
      <div className="container">
        <div ref={ref} className="reveal" style={{ maxWidth: 880, margin: '0 auto', textAlign: 'left' }}>
          <div className="eyebrow" style={{ color: 'var(--rose-dust)', marginBottom: 24 }}>Frauenkreis</div>
          <p style={{
            fontFamily: 'Fraunces, serif',
            fontSize: 'clamp(32px, 4.5vw, 52px)',
            lineHeight: 1.2,
            letterSpacing: '-0.015em',
            color: 'var(--ink)',
            fontVariationSettings: '"opsz" 96, "SOFT" 50, "WONK" 0',
            fontWeight: 400,
            marginBottom: 32,
            textWrap: 'balance'
          }}>
            »Es braucht ein ganzes{' '}
            <em className="bacalisties" style={{ color: 'var(--heather-plum)' }}>Dorf</em>.
            Bei uns sitzen Frauen miteinander im Kreis. Schwangere, Mütter,
            nicht-Mütter, im Zyklus, im Wandel. Ohne Erwartung. Ohne Performance.«
          </p>
          <div style={{ fontSize: 14, color: 'var(--ink-50)', letterSpacing: '0.04em' }}>
            Franzi & Dina, Gründerinnen
          </div>
        </div>
      </div>
    </section>);

};

// ---------- Team ----------
const teamMembers = [
{ name: 'Franziska Helmbrecht', role: 'Hebamme, Gründerin', tags: ['Hebamme', 'Geburtsvorbereitung', 'Wochenbett'], image: 'assets/franzi.png' },
{ name: 'Dina Stöcker', role: 'Sportwissenschaftlerin, Gründerin', tags: ['Rückbildung', 'Tupler', 'Yoga'], image: 'assets/dina.png' }];


const Team = () => {
  const ref = useReveal();
  return (
    <section id="team" style={{ padding: 'clamp(80px, 12vw, 128px) 0' }}>
      <div className="container">
        <div ref={ref} className="reveal" style={{ maxWidth: 720, marginBottom: 56 }}>
          <div className="eyebrow" style={{ marginBottom: 16 }}>Team</div>
          <h2 style={{ fontSize: 'clamp(36px, 5vw, 56px)', lineHeight: 1.1, letterSpacing: '-0.015em' }}>
            Die Frauen, die{' '}
            <em className="bacalisties" style={{ color: 'var(--heather-plum)' }}>halten</em>.
          </h2>
        </div>
        <div style={{
          display: 'grid',
          gridTemplateColumns: 'repeat(auto-fit, minmax(360px, 1fr))',
          gap: 32
        }}>
          {teamMembers.map((m, i) =>
          <TeamCard key={m.name} member={m} index={i} />
          )}
        </div>
      </div>
    </section>);

};

const TeamCard = ({ member, index }) => {
  const ref = useReveal();
  return (
    <div ref={ref} className="reveal" style={{
      background: 'var(--offwhite)',
      border: '1px solid var(--sandstone)',
      borderRadius: 12,
      padding: 28,
      transition: 'transform 220ms var(--ease), box-shadow 220ms var(--ease), border-color 220ms var(--ease)'
    }}
    onMouseEnter={(e) => {e.currentTarget.style.transform = 'translateY(-3px)';e.currentTarget.style.boxShadow = 'var(--shadow-md)';e.currentTarget.style.borderColor = 'var(--heather-plum)';}}
    onMouseLeave={(e) => {e.currentTarget.style.transform = 'translateY(0)';e.currentTarget.style.boxShadow = 'none';e.currentTarget.style.borderColor = 'var(--sandstone)';}}>
      
      <div style={{
        width: '100%', aspectRatio: '4/5',
        background: ['var(--rose-tint)', 'var(--sage-tint)', 'var(--sandstone)', 'var(--heather-subtle)'][index % 4],
        borderRadius: 8, marginBottom: 20,
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        fontFamily: 'Fraunces, serif',
        fontSize: 64,
        color: 'var(--ink)',
        opacity: member.image ? 1 : 0.35,
        fontVariationSettings: '"opsz" 144, "SOFT" 60, "WONK" 1',
        overflow: 'hidden'
      }}>
        {member.image ?
        <img src={member.image} alt={member.name}
        style={{ width: '100%', height: '100%', objectFit: 'cover', objectPosition: 'center top', display: 'block' }} /> :

        member.name.split(' ').map((p) => p[0]).slice(0, 2).join('')
        }
      </div>
      <h4 style={{ fontFamily: 'Fraunces, serif', fontSize: 22, fontWeight: 500, marginBottom: 6 }}>{member.name}</h4>
      <p style={{ color: 'var(--ink-70)', fontSize: 14, marginBottom: 14 }}>{member.role}</p>
      <div style={{ display: 'flex', flexWrap: 'wrap', gap: 6 }}>
        {member.tags.map((t) =>
        <span key={t} style={{
          background: 'var(--heather-subtle)', color: 'var(--heather-hover)',
          borderRadius: 999, padding: '4px 10px',
          fontSize: 11, fontWeight: 600, letterSpacing: '0.06em', textTransform: 'uppercase'
        }}>{t}</span>
        )}
      </div>
    </div>);

};

// ---------- Ort ----------
const Ort = ({ onOpenInquiry }) => {
  const ref = useReveal();
  return (
    <section id="ort" style={{ padding: 'clamp(56px, 8vw, 96px) 0 clamp(80px, 12vw, 128px)' }}>
      <div className="container">
        <div ref={ref} className="reveal" style={{
          display: 'grid',
          gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))',
          gap: 48,
          alignItems: 'center'
        }}>
          <div>
            <div className="eyebrow" style={{ marginBottom: 16 }}>EINBLICKE</div>
            <h2 style={{ fontSize: 'clamp(32px, 4.5vw, 48px)', lineHeight: 1.1, letterSpacing: '-0.015em', marginBottom: 24 }}>
              Bodenseestraße 94,<br />München-Pasing.
            </h2>
            <p className="lead" style={{ marginBottom: 32, maxWidth: 480 }}>
              Heller Holzboden, Pflanzen, Decken, Tee. Ein Raum, in dem
              man ankommen kann – mit Bauch, mit Kind, mit allem, was gerade da ist.
            </p>
            <a className="btn btn-primary" href="Einblicke.html" style={{ textDecoration: 'none' }}>
              Die Weiberei entdecken <span>→</span>
            </a>
          </div>
          <EinblickeCarousel />
        </div>
      </div>
    </section>);

};

// ---------- Einblicke carousel ----------
// Compact photo carousel that gives the "Einblicke" section a face: room, ritual,
// course moments. Auto-advancing crossfade with caption + dot navigation.
// Picsum-seeded so each slide is stable across reloads; swap the src for real
// photography later by replacing the array.
const EINBLICKE_SLIDES = [
{ id: 'studio', label: 'Studio', caption: 'Heller Yoga-Raum mit Holzboden.' },
{ id: 'kreis', label: 'Frauenkreis', caption: 'Im Kreis, im Kerzenschein.' },
{ id: 'tee', label: 'Empfang', caption: 'Tee, Decken, Ankommen.' },
{ id: 'kurs', label: 'Kurs', caption: 'Rückbildung mit Baby.' },
{ id: 'praxis', label: 'Praxis', caption: 'Behandlungsraum für 1:1-Sitzungen.' }];


const EinblickeCarousel = () => {
  const [idx, setIdx] = React.useState(0);
  const [paused, setPaused] = React.useState(false);
  const N = EINBLICKE_SLIDES.length;
  // Swipe state — track touch start, decide direction on end
  const swipeRef = React.useRef({ x: 0, y: 0, active: false });

  React.useEffect(() => {
    if (paused) return undefined;
    const t = setInterval(() => setIdx((i) => (i + 1) % N), 4500);
    return () => clearInterval(t);
  }, [paused, N]);

  const go = (n) => setIdx((n % N + N) % N);

  const onTouchStart = (e) => {
    const t = e.touches[0];
    swipeRef.current = { x: t.clientX, y: t.clientY, active: true };
    setPaused(true);
  };
  const onTouchEnd = (e) => {
    if (!swipeRef.current.active) return;
    const t = e.changedTouches[0];
    const dx = t.clientX - swipeRef.current.x;
    const dy = t.clientY - swipeRef.current.y;
    swipeRef.current.active = false;
    // Horizontal swipe (only if mostly horizontal, > 40px)
    if (Math.abs(dx) > 40 && Math.abs(dx) > Math.abs(dy)) {
      go(idx + (dx < 0 ? 1 : -1));
    }
    setPaused(false);
  };

  return (
    <div
      onMouseEnter={() => setPaused(true)}
      onMouseLeave={() => setPaused(false)}
      onTouchStart={onTouchStart}
      onTouchEnd={onTouchEnd}
      onTouchCancel={onTouchEnd}
      style={{
        position: 'relative',
        aspectRatio: '4/3',
        borderRadius: 12,
        overflow: 'hidden',
        border: '1px solid var(--sandstone)',
        boxShadow: '0 22px 60px rgba(42,34,29,0.18)',
        background: 'var(--sage-tint)',
        touchAction: 'pan-y',
      }}>
      {EINBLICKE_SLIDES.map((s, i) =>
      <img
        key={s.id}
        src={`https://picsum.photos/seed/${encodeURIComponent('weiberei-einblicke-' + s.id)}/800/600`}
        alt={s.caption}
        loading={i === 0 ? 'eager' : 'lazy'}
        style={{
          position: 'absolute', inset: 0,
          width: '100%', height: '100%', objectFit: 'cover',
          opacity: i === idx ? 1 : 0,
          transition: 'opacity 800ms var(--ease)'
        }} />

      )}

      {/* Bottom vignette */}
      <div aria-hidden="true" style={{
        position: 'absolute', inset: 0,
        background: 'linear-gradient(180deg, rgba(42,34,29,0) 50%, rgba(42,34,29,0.55) 100%)',
        pointerEvents: 'none'
      }} />

      {/* Caption + counter */}
      <div style={{
        position: 'absolute', left: 18, right: 18, bottom: 16,
        display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between', gap: 12,
        color: 'var(--offwhite)'
      }}>
        <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
          <span style={{
            alignSelf: 'flex-start',
            background: 'rgba(250,246,241,0.18)',
            border: '1px solid rgba(250,246,241,0.32)',
            backdropFilter: 'blur(8px)', WebkitBackdropFilter: 'blur(8px)',
            color: 'var(--offwhite)',
            fontSize: 10.5, fontWeight: 600, letterSpacing: '0.14em', textTransform: 'uppercase',
            padding: '4px 10px', borderRadius: 999
          }}>{EINBLICKE_SLIDES[idx].label}</span>
          <p style={{
            fontFamily: 'Fraunces, serif',
            fontSize: 'clamp(15px, 1.4vw, 17px)',
            lineHeight: 1.3,
            color: 'var(--offwhite)',
            textShadow: '0 1px 2px rgba(0,0,0,0.25)'
          }}>{EINBLICKE_SLIDES[idx].caption}</p>
        </div>
        <span style={{
          fontFamily: 'Fraunces, serif',
          fontSize: 13,
          color: 'rgba(250,246,241,0.85)'
        }}>{String(idx + 1).padStart(2, '0')}/{String(N).padStart(2, '0')}</span>
      </div>

      {/* Side arrows */}
      {[
      { dir: -1, side: 'left', symbol: '‹' },
      { dir: 1, side: 'right', symbol: '›' }].
      map(({ dir, side, symbol }) =>
      <button key={side} type="button"
      onClick={() => go(idx + dir)}
      aria-label={dir < 0 ? 'Vorheriges Bild' : 'Nächstes Bild'}
      style={{
        position: 'absolute', top: '50%', [side]: 12,
        transform: 'translateY(-50%)',
        width: 36, height: 36, borderRadius: 999,
        background: 'rgba(250,246,241,0.18)',
        border: '1px solid rgba(250,246,241,0.32)',
        backdropFilter: 'blur(8px)', WebkitBackdropFilter: 'blur(8px)',
        color: 'var(--offwhite)', fontSize: 20, lineHeight: 1,
        cursor: 'pointer',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        transition: 'background 160ms var(--ease)'
      }}
      onMouseEnter={(e) => {e.currentTarget.style.background = 'rgba(250,246,241,0.32)';}}
      onMouseLeave={(e) => {e.currentTarget.style.background = 'rgba(250,246,241,0.18)';}}>
        {symbol}</button>
      )}

      {/* Dot indicators */}
      <div style={{
        position: 'absolute', top: 16, right: 16,
        display: 'flex', gap: 6
      }}>
        {EINBLICKE_SLIDES.map((s, i) =>
        <button key={s.id} type="button"
        onClick={() => setIdx(i)}
        aria-label={`Zu Bild ${i + 1}`}
        style={{
          width: i === idx ? 22 : 7, height: 7, borderRadius: 999,
          background: i === idx ? 'var(--offwhite)' : 'rgba(250,246,241,0.45)',
          border: 'none', cursor: 'pointer',
          padding: 0,
          transition: 'all 240ms var(--ease)'
        }} />

        )}
      </div>
    </div>);

};

// ---------- Footer ----------
const Footer = () => {
  return (
    <footer style={{
      padding: '64px 0 32px', position: 'relative', zIndex: 1,
      borderTop: '1px solid rgba(196, 169, 143, 0.35)',
      marginTop: 24
    }}>
      <div className="container">
        <div className="footer-grid" style={{
          display: 'grid',
          gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))',
          gap: 48,
          marginBottom: 48
        }}>
          <div>
            <div style={{
              fontFamily: 'Fraunces, serif', fontSize: 28, fontWeight: 500,
              fontVariationSettings: '"opsz" 96, "SOFT" 50, "WONK" 1', marginBottom: 12,
              color: 'var(--ink)'
            }}>
              die <span className="bacalisties">Weiberei</span><span style={{ color: 'var(--heather-plum)' }}>.</span>
            </div>
            <p style={{ color: 'var(--ink-70)', fontSize: 14, maxWidth: 320 }}>
              Von Weibern für Weiber. Miteinander. Füreinander.
            </p>
          </div>
          <div>
            <div className="eyebrow" style={{ marginBottom: 12 }}>Ort</div>
            <p style={{ fontSize: 14, color: 'var(--ink-70)', lineHeight: 1.7 }}>
              Bodenseestraße 94<br />81243 München-Pasing
            </p>
          </div>
          <div>
            <div className="eyebrow" style={{ marginBottom: 12 }}>Kontakt</div>
            <p style={{ fontSize: 14, color: 'var(--ink-70)', lineHeight: 1.7 }}>
              hallo@dieweiberei.de
            </p>
          </div>
          <div>
            <div className="eyebrow" style={{ marginBottom: 12 }}>Programm</div>
            <p style={{ fontSize: 14, color: 'var(--ink-70)', lineHeight: 1.7 }}>
              die Bauchschmiede →
            </p>
          </div>
        </div>
        <div className="footer-bottom" style={{
          borderTop: '1px solid rgba(196, 169, 143, 0.35)',
          paddingTop: 24,
          fontSize: 12,
          color: 'var(--ink-50)',
          display: 'flex', flexWrap: 'wrap', gap: 24, justifyContent: 'space-between'
        }}>
          <span>© 2026 Die Weiberei</span>
          <span>Impressum · Datenschutz · AGB</span>
        </div>
      </div>
    </footer>);

};

// ---------- Section divider — quiet ornament between sections ----------
const SectionDivider = ({ variant = 'line' }) => {
  if (variant === 'dot') {
    // Just a heather-plum dot, very small
    return (
      <div aria-hidden="true" style={{
        display: 'flex', justifyContent: 'center', alignItems: 'center',
        padding: '8px 0'
      }}>
        <span style={{
          width: 6, height: 6, borderRadius: 999,
          background: 'var(--heather-plum)',
          opacity: 0.45
        }} />
      </div>);

  }
  // Default: hairline + center dot (à la editorial section break)
  return (
    <div aria-hidden="true" className="container" style={{
      padding: '8px 0',
      display: 'flex', alignItems: 'center', justifyContent: 'center',
      gap: 14
    }}>
      <span style={{
        flex: 1, maxWidth: 120,
        height: 1, background: 'rgba(196, 169, 143, 0.45)'
      }} />
      <span style={{
        width: 5, height: 5, borderRadius: 999,
        background: 'var(--heather-plum)', opacity: 0.55
      }} />
      <span style={{
        flex: 1, maxWidth: 120,
        height: 1, background: 'rgba(196, 169, 143, 0.45)'
      }} />
    </div>);

};

Object.assign(window, {
  Nav, Hero, Stats, Angebot, Bauchschmiede, Frauenkreis, Team, Ort, Footer,
  SectionDivider,
  useReveal, useCountUp
});