/* global React */
const { useState, useEffect, useRef } = React;

//// ── Linary "l." mark ─────────────────────────────────────────
function LinaryMark({ size = 32, color }) {
  return (
    <svg width={size} height={size * (775 / 600)} viewBox="0 0 600 775" fill="none" xmlns="http://www.w3.org/2000/svg" style={{ display: 'block' }}>
      <path
        fill={color || 'currentColor'}
        d="M 330.48,637.00 C 330.54,705.75 386.24,761.62 455.11,761.63 523.87,761.62 579.74,705.74 579.74,637.00 579.74,568.06 523.95,512.37 455.11,512.37 386.17,512.37 330.43,568.07 330.48,637.00 Z M 20.00,13.00 C 20.00,13.00 270.00,13.00 270.00,13.00 270.00,13.00 271.00,625.00 271.00,625.00 271.00,693.00 293.38,731.25 329.95,762.04 329.95,762.04 253.00,762.00 253.00,762.00 124.33,762.00 20.00,657.67 20.00,529.00 20.00,529.00 20.00,13.00 20.00,13.00 Z"
      />
    </svg>
  );
}

// ── Linary wordmark ─────────────────────────────────────────
// Inline-SVG component: schakelt automatisch mee met thema via currentColor.
// Een <img src="wordmark_v2.svg"> kán de fill niet overschrijven — daarom hier inline.
function LinaryWordmark({ size = 60, color = 'currentColor', style, className, ...rest }) {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 1024 512"
      className={className}
      style={{ height: size, width: 'auto', display: 'block', color, ...style }}
      role="img"
      aria-label="Linary"
      {...rest}
    >
      <path
        fill="currentColor"
        fillRule="evenodd"
        d="M 257.41,162.70 C 257.41,155.10 259.95,148.70 265.05,143.50 270.15,138.30 276.90,135.70 285.30,135.70 293.70,135.70 300.45,138.30 305.55,143.50 310.65,148.70 313.20,155.10 313.20,162.70 313.20,170.30 310.65,176.70 305.55,181.91 300.45,187.11 293.70,189.70 285.30,189.70 276.90,189.70 270.15,187.11 265.05,181.91 259.95,176.70 257.41,170.30 257.41,162.70 Z M 310.80,348.70 C 308.60,349.10 305.35,349.64 301.05,350.34 296.74,351.05 292.39,351.41 288.00,351.41 283.60,351.41 279.66,351.10 276.16,350.50 272.66,349.89 269.70,348.70 267.30,346.91 264.90,345.11 263.05,342.66 261.75,339.56 260.45,336.46 259.80,332.41 259.80,327.41 259.80,327.41 259.80,205.30 259.80,205.30 261.99,204.90 265.24,204.36 269.55,203.66 273.85,202.95 278.20,202.59 282.59,202.59 287.00,202.59 290.95,202.90 294.45,203.50 297.95,204.11 300.90,205.31 303.30,207.11 305.70,208.90 307.55,211.35 308.84,214.45 310.14,217.55 310.80,221.59 310.80,226.59 310.80,226.59 310.80,348.70 310.80,348.70 Z M 436.00,256.59 C 436.00,250.40 434.25,245.85 430.75,242.95 427.25,240.05 422.50,238.59 416.50,238.59 412.50,238.59 408.55,239.09 404.64,240.09 400.74,241.09 397.39,242.59 394.59,244.59 394.59,244.59 394.59,348.70 394.59,348.70 392.59,349.29 389.44,349.89 385.14,350.50 380.85,351.10 376.40,351.41 371.80,351.41 367.40,351.41 363.45,351.10 359.95,350.50 356.45,349.89 353.50,348.70 351.09,346.91 348.70,345.11 346.85,342.66 345.55,339.56 344.24,336.46 343.59,332.41 343.59,327.41 343.59,327.41 343.59,237.41 343.59,237.41 343.59,232.00 344.74,227.60 347.05,224.20 349.35,220.80 352.50,217.70 356.50,214.91 363.30,210.11 371.85,206.20 382.14,203.20 392.44,200.20 403.89,198.70 416.50,198.70 439.10,198.70 456.50,203.66 468.70,213.56 480.90,223.46 487.00,237.20 487.00,254.80 487.00,254.80 487.00,348.70 487.00,348.70 485.00,349.29 481.85,349.89 477.55,350.50 473.24,351.10 468.80,351.41 464.20,351.41 459.80,351.41 455.84,351.10 452.34,350.50 448.84,349.89 445.89,348.70 443.50,346.91 441.10,345.11 439.25,342.66 437.95,339.56 436.65,336.46 436.00,332.41 436.00,327.41 436.00,327.41 436.00,256.59 436.00,256.59 Z M 581.00,316.59 C 584.39,316.59 588.14,316.25 592.25,315.55 596.35,314.85 599.41,313.90 601.41,312.70 601.41,312.70 601.41,288.70 601.41,288.70 601.41,288.70 579.80,290.50 579.80,290.50 574.20,290.90 569.60,292.09 566.00,294.09 562.39,296.09 560.59,299.09 560.59,303.09 560.59,307.09 562.14,310.34 565.25,312.84 568.35,315.34 573.60,316.59 581.00,316.59 Z M 578.59,198.70 C 589.39,198.70 599.24,199.80 608.14,202.00 617.05,204.20 624.65,207.55 630.95,212.05 637.25,216.55 642.10,222.25 645.50,229.16 648.89,236.05 650.59,244.20 650.59,253.59 650.59,253.59 650.59,320.80 650.59,320.80 650.59,326.00 649.14,330.25 646.25,333.55 643.35,336.85 639.91,339.70 635.91,342.09 622.91,349.89 604.60,353.80 581.00,353.80 570.39,353.80 560.84,352.80 552.34,350.80 543.84,348.80 536.54,345.80 530.44,341.80 524.34,337.80 519.64,332.70 516.34,326.50 513.05,320.30 511.41,313.11 511.41,304.91 511.41,291.11 515.50,280.51 523.70,273.11 531.90,265.70 544.60,261.10 561.80,259.30 561.80,259.30 601.09,255.09 601.09,255.09 601.09,255.09 601.09,253.00 601.09,253.00 601.09,247.20 598.54,243.05 593.44,240.55 588.34,238.05 581.00,236.80 571.41,236.80 563.80,236.80 556.40,237.60 549.20,239.20 542.00,240.80 535.50,242.80 529.70,245.20 527.10,243.40 524.89,240.65 523.09,236.95 521.30,233.26 520.41,229.41 520.41,225.41 520.41,220.20 521.66,216.05 524.16,212.95 526.66,209.85 530.50,207.20 535.70,205.00 541.50,202.80 548.35,201.20 556.25,200.20 564.14,199.20 571.59,198.70 578.59,198.70 Z M 732.59,348.70 C 730.59,349.29 727.44,349.89 723.14,350.50 718.85,351.10 714.40,351.41 709.80,351.41 705.40,351.41 701.45,351.10 697.95,350.50 694.45,349.89 691.50,348.70 689.09,346.91 686.70,345.11 684.85,342.66 683.55,339.56 682.24,336.46 681.59,332.41 681.59,327.41 681.59,327.41 681.59,237.41 681.59,237.41 681.59,232.80 682.44,228.85 684.14,225.55 685.85,222.25 688.30,219.30 691.50,216.70 694.70,214.10 698.64,211.75 703.34,209.66 708.05,207.55 713.10,205.70 718.50,204.11 723.89,202.51 729.49,201.26 735.30,200.36 741.10,199.45 746.90,199.00 752.70,199.00 762.30,199.00 769.89,200.85 775.50,204.55 781.10,208.25 783.91,214.30 783.91,222.70 783.91,225.51 783.50,228.26 782.70,230.95 781.90,233.65 780.90,236.10 779.70,238.30 775.50,238.30 771.20,238.50 766.80,238.91 762.40,239.30 758.10,239.90 753.89,240.70 749.69,241.51 745.74,242.36 742.05,243.25 738.35,244.15 735.20,245.20 732.59,246.41 732.59,246.41 732.59,348.70 732.59,348.70 Z M 832.41,311.80 C 830.20,306.80 827.84,301.20 825.34,295.00 822.84,288.80 820.24,281.70 817.55,273.70 814.85,265.70 812.05,256.55 809.14,246.25 806.24,235.95 803.20,224.10 800.00,210.70 802.80,207.90 806.55,205.45 811.25,203.36 815.95,201.26 821.10,200.20 826.70,200.20 833.70,200.20 839.50,201.66 844.09,204.56 848.70,207.46 852.10,212.91 854.30,220.91 854.30,220.91 878.00,303.41 878.00,303.41 878.00,303.41 879.20,303.41 879.20,303.41 881.60,296.61 883.95,289.20 886.25,281.20 888.55,273.20 890.80,264.95 893.00,256.45 895.20,247.95 897.24,239.45 899.14,230.95 901.05,222.45 902.70,214.11 904.09,205.91 911.30,202.11 919.20,200.20 927.80,200.20 934.80,200.20 940.59,201.70 945.19,204.70 949.79,207.70 952.09,212.90 952.09,220.30 952.09,225.70 951.39,231.96 950.00,239.06 948.60,246.16 946.75,253.70 944.45,261.70 942.15,269.70 939.45,277.95 936.34,286.45 933.25,294.95 930.00,303.30 926.59,311.50 923.20,319.70 919.70,327.45 916.09,334.75 912.50,342.05 909.00,348.61 905.59,354.41 900.00,364.20 894.80,372.19 890.00,378.39 885.20,384.60 880.59,389.45 876.19,392.95 871.79,396.45 867.39,398.85 863.00,400.14 858.60,401.44 854.00,402.09 849.20,402.09 840.80,402.09 833.99,399.59 828.80,394.59 823.60,389.59 820.50,383.09 819.50,375.09 825.89,370.09 832.29,364.54 838.69,358.44 845.09,352.34 850.89,346.10 856.09,339.70 852.70,338.70 849.05,336.36 845.14,332.66 841.24,328.95 837.00,322.00 832.41,311.80 Z M 49.34,94.84 C 49.34,94.84 134.46,94.84 134.46,94.84 134.46,94.84 134.80,303.46 134.80,303.46 134.80,326.64 142.42,339.68 154.87,350.17 154.87,350.17 128.67,350.16 128.67,350.16 84.86,350.16 49.34,314.59 49.34,270.73 49.34,270.73 49.34,94.84 49.34,94.84 Z M 155.05,307.55 C 155.07,330.98 174.03,350.03 197.48,350.03 220.89,350.03 239.91,330.98 239.91,307.55 239.91,284.05 220.92,265.07 197.48,265.07 174.01,265.07 155.03,284.05 155.05,307.55 Z"
      />
    </svg>
  );
}

// ── Reveal hook ─────────────────────────────────────────────
function 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');
        } else if (e.boundingClientRect.top > 0) {
          e.target.classList.remove('in');
        }
      });
    }, { threshold: 0.12, rootMargin: '0px 0px -60px 0px' });
    el.querySelectorAll('.reveal').forEach((n) => io.observe(n));
    return () => io.disconnect();
  }, []);
  return ref;
}

// ── Soft organic blob (random-shaped) ───────────────────────
// Pre-defined organic blob paths — hand-tuned, not random.
const BLOB_PATHS = [
  'M160,40 C220,30 280,80 290,150 C300,220 250,280 180,295 C110,310 40,260 30,190 C20,120 100,50 160,40 Z',
  'M200,30 C270,40 320,110 310,180 C300,250 230,300 160,290 C90,280 40,210 50,140 C60,70 130,20 200,30 Z',
  'M170,20 C240,20 310,80 305,160 C300,240 230,300 150,295 C70,290 20,220 25,140 C30,60 100,20 170,20 Z',
  'M180,40 C260,30 310,100 300,180 C290,260 220,310 140,295 C60,280 30,200 50,130 C70,60 110,50 180,40 Z',
];

function Blob({ shape = 0, color, size = 320, style, className = '' }) {
  return (
    <svg
      width={size} height={size} viewBox="0 0 320 320"
      style={style} className={className} aria-hidden="true"
    >
      <path d={BLOB_PATHS[shape % BLOB_PATHS.length]} fill={color} />
    </svg>
  );
}

// Field of drifting blobs scoped to a scene
function BlobField({ items }) {
  return (
    <div className="blob-field">
      {items.map((b, i) => (
        <div
          key={i}
          className={b.anim || 'drift-a'}
          style={{
            position: 'absolute',
            top: b.top, left: b.left, right: b.right, bottom: b.bottom,
            opacity: b.opacity ?? 1,
            filter: b.blur ? `blur(${b.blur}px)` : undefined,
          }}
        >
          <Blob shape={b.shape ?? i} color={b.color} size={b.size ?? 320} />
        </div>
      ))}
    </div>
  );
}

// ── Nav ─────────────────────────────────────────────────────
// Favicon (LinaryMark) verschijnt links pas wanneer de hero-wordmark
// voorbij de header is gescrold — zelfde gedrag als v1.
function Nav() {
  const [scrolled, setScrolled] = useState(false);
  const [showMark, setShowMark] = useState(false);
  const [lang, setLang] = useState('NL');
  const [langOpen, setLangOpen] = useState(false);
  const langRef = useRef(null);

  useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 12);
    window.addEventListener('scroll', onScroll);
    return () => window.removeEventListener('scroll', onScroll);
  }, []);

  useEffect(() => {
    const heroWordmark = document.querySelector('#top .reveal');
    if (!heroWordmark) return;
    const io = new IntersectionObserver(
      ([entry]) => setShowMark(!entry.isIntersecting),
      { rootMargin: '-80px 0px 0px 0px', threshold: 0 }
    );
    io.observe(heroWordmark);
    return () => io.disconnect();
  }, []);

  useEffect(() => {
    const onClick = (e) => { if (langRef.current && !langRef.current.contains(e.target)) setLangOpen(false); };
    document.addEventListener('mousedown', onClick);
    return () => document.removeEventListener('mousedown', onClick);
  }, []);

  const langs = [
    { code: 'NL', label: 'Nederlands' },
    { code: 'EN', label: 'English' },
    { code: 'DE', label: 'Deutsch' },
    { code: 'ES', label: 'Español' },
    { code: 'FR', label: 'Français' },
  ];

  const headerStyle = {
    position: 'fixed',
    top: 0,
    left: 0,
    right: 0,
    zIndex: 50,
    padding: scrolled ? '10px 0' : '20px 0',
    backdropFilter: scrolled ? 'blur(18px) saturate(140%)' : 'none',
    background: scrolled ? 'color-mix(in srgb, var(--cream) 80%, transparent)' : 'transparent',
    borderBottom: scrolled ? '1px solid var(--line)' : '1px solid transparent',
    transition: 'all 0.3s ease',
  };

  const containerStyle = {
    display: 'grid',
    gridTemplateColumns: '1fr auto 1fr',
    alignItems: 'center',
  };
  const navHiddenStyle = `
    @media (max-width: 900px) {
      .nav-header-grid { grid-template-columns: 1fr auto !important; }
      .nav-header-grid > .nav-spacer { display: none !important; }
    }
  `;

  const markLinkStyle = {
    position: 'absolute',
    left: 16,
    top: '50%',
    display: 'flex',
    alignItems: 'center',
    gap: 10,
    textDecoration: 'none',
    color: 'var(--ink)',
    opacity: showMark ? 1 : 0,
    transform: showMark ? 'translateY(-50%)' : 'translateY(calc(-50% - 4px))',
    pointerEvents: showMark ? 'auto' : 'none',
    transition: 'opacity 0.4s ease, transform 0.4s ease',
  };

  return (
    <header style={headerStyle}>
      <div className="container nav-header-grid" style={containerStyle}>
        <a href="#top" aria-label="Naar boven" style={markLinkStyle}>
          <LinaryMark size={28} color="var(--clay-deep)" />
        </a>
        <div className="nav-spacer" />
        <nav className="nav-links" style={{ display: 'flex', alignItems: 'center', gap: 36, justifyContent: 'center' }}>
          <a href="#meet" className="nav-link">Meet Linary</a>
          <a href="#features" className="nav-link">Functies</a>
          <a href="#luna" className="nav-link">Luna AI</a>
          <a href="#pricing" className="nav-link">Prijzen</a>
          <a href="#faq" className="nav-link">FAQ</a>
        </nav>
        <div style={{ display: 'flex', alignItems: 'center', gap: 12, justifyContent: 'flex-end' }}>
          <div ref={langRef} style={{ position: 'relative' }} className="lang-switcher">
            <button
              onClick={() => setLangOpen(o => !o)}
              aria-label="Kies taal"
              style={{
                height: 38, padding: '0 14px', borderRadius: 999,
                border: '1px solid var(--line-strong)',
                background: 'transparent', cursor: 'pointer',
                display: 'flex', alignItems: 'center', gap: 8, color: 'var(--ink)',
                font: 'inherit', fontSize: 13, fontWeight: 700, letterSpacing: '0.04em',
                transition: 'background 0.2s ease',
              }}
              onMouseEnter={(e) => { e.currentTarget.style.background = 'var(--cream-2)'; }}
              onMouseLeave={(e) => { e.currentTarget.style.background = 'transparent'; }}
            >
              <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round">
                <circle cx="12" cy="12" r="9"/>
                <path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/>
              </svg>
              {lang}
              <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" style={{ transform: langOpen ? 'rotate(180deg)' : 'rotate(0)', transition: 'transform 0.2s ease' }}>
                <path d="M6 9l6 6 6-6"/>
              </svg>
            </button>
            {langOpen && (
              <div style={{
                position: 'absolute', top: 'calc(100% + 8px)', right: 0,
                background: 'var(--cream)', border: '1px solid var(--line-strong)',
                borderRadius: 14, padding: 6, minWidth: 180,
                boxShadow: 'var(--shadow-md)', zIndex: 100,
              }}>
                {langs.map((l) => (
                  <button
                    key={l.code}
                    onClick={() => { setLang(l.code); setLangOpen(false); }}
                    style={{
                      width: '100%', textAlign: 'left',
                      padding: '10px 12px', borderRadius: 10,
                      border: 'none', background: lang === l.code ? 'var(--cream-2)' : 'transparent',
                      cursor: 'pointer', color: 'var(--ink)',
                      font: 'inherit', fontSize: 14, fontWeight: lang === l.code ? 700 : 400,
                      display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 10,
                      transition: 'background 0.15s ease',
                    }}
                    onMouseEnter={(e) => { if (lang !== l.code) e.currentTarget.style.background = 'var(--cream-2)'; }}
                    onMouseLeave={(e) => { if (lang !== l.code) e.currentTarget.style.background = 'transparent'; }}
                  >
                    <span>{l.label}</span>
                    <span style={{ fontSize: 11, color: 'var(--soft)', fontWeight: 700, letterSpacing: '0.04em' }}>{l.code}</span>
                  </button>
                ))}
              </div>
            )}
          </div>
          <a href="#download" className="btn btn-primary btn-sm" style={{ fontWeight: '400', backgroundColor: 'var(--ink)' }}>Probeer gratis</a>
        </div>
      </div>
      <style>{`
        .nav-link {
          font-family: 'Kollektif', sans-serif;
          font-weight: 400; font-size: 15px;
          color: var(--soft); text-decoration: none;
          transition: color 0.2s ease;
        }
        .nav-link:hover { color: var(--ink); }
        @media (max-width: 900px) { .nav-links { display: none !important; } }
        ${navHiddenStyle}
      `}</style>
    </header>
  );
}

// ── Phone frame ─────────────────────────────────────────────
// Aspect ratio matcht moderne iPhones (iPhone 15/16 Pro: 393×852pt = 0.461).
// Hoogte = breedte / 0.461, dus 305 × 661 ≈ correct.
function PhoneFrame({ children, scale = 1, tilt = '0deg' }) {
  return (
    <div style={{
      width: 320 * scale, height: 661 * scale,
      borderRadius: 56 * scale, background: '#1a1410',
      padding: 11 * scale,
      boxShadow: '0 60px 120px -30px rgba(62,42,28,0.45), 0 0 0 1.5px rgba(0,0,0,0.5), inset 0 0 0 2px rgba(255,255,255,0.04)',
      position: 'relative',
      transform: `rotate(${tilt})`,
    }}>
      <div style={{
        width: '100%', height: '100%',
        borderRadius: 46 * scale,
        background: 'var(--cream)',
        overflow: 'hidden',
        position: 'relative',
      }}>
        <div style={{
          position: 'absolute', top: 8 * scale, left: '50%', transform: 'translateX(-50%)',
          width: 100 * scale, height: 28 * scale,
          background: '#1a1410', borderRadius: 999, zIndex: 10,
        }} />
        {children}
      </div>
    </div>
  );
}

// ── Mock: Today screen ──────────────────────────────────────
// Toont een screenshot van de echte home_screen.dart i.p.v. een nagebouwde mock,
// zodat de hero exact synchroon loopt met de werkelijke app-UI.
// Screenshot moet content-only zijn (geen iOS status bar, geen device frame) —
// PhoneFrame tekent zelf de notch en de buitenrand.
function PhoneTodayScreen() {
  return (
    <div style={{ position: 'absolute', inset: 0, overflow: 'hidden' }}>
      <img
        src="assets/images/home_screenshot.png"
        alt="Linary home screen"
        draggable={false}
        style={{
          position: 'absolute',
          inset: 0,
          width: '100%',
          height: '100%',
          objectFit: 'cover',
          objectPosition: 'top center',
          display: 'block',
          userSelect: 'none',
          WebkitUserDrag: 'none',
        }}
      />
    </div>
  );
}

// ── Mock: Composer screen (writing in progress) ─────────────
// Toont een screenshot van de echte editor_screen.dart i.p.v. een nagebouwde mock,
// zodat de Meet-sectie exact synchroon loopt met de werkelijke app-UI.
// Screenshot moet content-only zijn (geen iOS status bar, geen device frame) —
// PhoneFrame tekent zelf de notch en de buitenrand.
function PhoneComposerScreen() {
  return (
    <div style={{ position: 'absolute', inset: 0, overflow: 'hidden' }}>
      <img
        src="assets/images/editor_screenshot.png"
        alt="Linary editor screen"
        draggable={false}
        style={{
          position: 'absolute',
          inset: 0,
          width: '100%',
          height: '100%',
          objectFit: 'cover',
          objectPosition: 'top center',
          display: 'block',
          userSelect: 'none',
          WebkitUserDrag: 'none',
        }}
      />
    </div>
  );
}

// ── Mock: Stats screen ──────────────────────────────────────
function PhoneStatsScreen() {
  const days = [1, 2, 1, 0, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2];
  return (
    <div style={{ position: 'absolute', inset: 0, paddingTop: 50, color: 'var(--ink)', fontFamily: 'Kollektif', background: 'var(--cream)' }}>
      <div style={{ padding: '8px 22px 0' }}>
        <div style={{ fontSize: 11, color: 'var(--soft)', letterSpacing: '0.14em', textTransform: 'uppercase', fontWeight: 700 }}>Mei 2026</div>
        <div style={{ fontSize: 26, fontWeight: 700, letterSpacing: '-0.02em', marginTop: 2 }}>Jouw maand</div>
      </div>

      <div style={{ margin: '14px 18px 0', display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }}>
        {[
          { l: 'Entries', v: '38' },
          { l: 'Streak', v: '14d' },
        ].map((c, i) => (
          <div key={i} style={{ background: i === 0 ? 'var(--peach)' : 'var(--cream-2)', borderRadius: 18, padding: 12 }}>
            <div style={{ fontSize: 9, color: 'var(--soft)', letterSpacing: '0.14em', textTransform: 'uppercase', fontWeight: 700 }}>{c.l}</div>
            <div style={{ fontSize: 28, fontWeight: 700, letterSpacing: '-0.02em', marginTop: 4 }}>{c.v}</div>
          </div>
        ))}
      </div>

      <div style={{ margin: '12px 18px 0', background: 'var(--cream-2)', borderRadius: 18, padding: 14 }}>
        <div style={{ fontSize: 10, color: 'var(--soft)', letterSpacing: '0.14em', textTransform: 'uppercase', fontWeight: 700, marginBottom: 12 }}>Activiteit</div>
        <div style={{ display: 'flex', alignItems: 'flex-end', gap: 3, height: 80 }}>
          {days.map((v, i) => (
            <div key={i} style={{
              flex: 1, height: v === 0 ? 4 : `${v / 2 * 100}%`,
              background: v === 0 ? 'var(--line-strong)' : 'var(--clay)',
              borderRadius: 3,
            }} />
          ))}
        </div>
      </div>

      <div style={{ margin: '12px 18px 0', background: 'var(--cream-2)', borderRadius: 18, padding: 14 }}>
        <div style={{ fontSize: 10, color: 'var(--soft)', letterSpacing: '0.14em', textTransform: 'uppercase', fontWeight: 700, marginBottom: 10 }}>Stemming</div>
        {[
          { n: 'Rustig', v: 11, c: 'var(--clay)' },
          { n: 'Blij', v: 9, c: 'var(--peach-deep)' },
          { n: 'Moe', v: 6, c: 'var(--peach)' },
        ].map((m, i) => (
          <div key={i} style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 6 }}>
            <span style={{ width: 8, height: 8, borderRadius: 999, background: m.c }} />
            <span style={{ fontSize: 12, fontWeight: 700, flex: 1 }}>{m.n}</span>
            <span style={{ fontSize: 11, color: 'var(--soft)' }}>{m.v}×</span>
          </div>
        ))}
      </div>
    </div>
  );
}

Object.assign(window, {
  LinaryMark, LinaryWordmark, Nav, PhoneFrame, PhoneTodayScreen, PhoneComposerScreen, PhoneStatsScreen, useReveal, Blob, BlobField,
});