// Direction 1 — Cinematic Monolith
// Display serif (Fraunces) + clean sans (Inter). Charcoal base, deep teal accent,
// large breathing room. The hero is a single monolithic word with a slow
// flickering cursor; the icon mark drifts in space behind it.

window.DirectionCinematic = function DirectionCinematic() {
  const [scrollY, setScrollY] = React.useState(0);
  const [winW, setWinW] = React.useState(window.innerWidth);
  const ref = React.useRef(null);
  const mobile = winW < 768;

  React.useEffect(() => {
    const onResize = () => setWinW(window.innerWidth);
    window.addEventListener('resize', onResize);
    return () => window.removeEventListener('resize', onResize);
  }, []);

  React.useEffect(() => {
    const el = ref.current;
    if (!el) return;
    const onScroll = () => setScrollY(el.scrollTop);
    el.addEventListener('scroll', onScroll, { passive: true });
    return () => el.removeEventListener('scroll', onScroll);
  }, []);

  const C = window.SYNALITH_COPY;
  const teal = '#5FD4D9';
  const tealDeep = '#1F8A92';
  const orange = '#F17750';
  const ink = '#0B0E10';

  return (
    <div ref={ref} style={{
      width: '100%', height: '100%', overflowY: 'auto', overflowX: 'hidden',
      background: ink, color: '#E8E5DE',
      fontFamily: '"Inter", -apple-system, system-ui, sans-serif',
      fontFeatureSettings: '"ss01"',
    }}>
      {/* ─── Nav ─── */}
      <nav style={{
        position: 'sticky', top: 0, zIndex: 10,
        display: 'flex', alignItems: 'center', justifyContent: 'space-between',
        padding: mobile ? '16px 20px' : '24px 56px',
        background: `linear-gradient(to bottom, ${ink} 60%, transparent)`,
        borderBottom: scrollY > 40 ? '1px solid rgba(255,255,255,0.06)' : '1px solid transparent',
        transition: 'border-color 0.3s',
      }}>
        <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
          <img src="assets/mark.png?v=5" alt="" style={{ width: 30, height: 30, objectFit: 'contain' }} />
          <span style={{
            fontFamily: '"Michroma", "Eurostile", sans-serif',
            fontWeight: 400, fontSize: mobile ? 12 : 14, letterSpacing: '0.16em',
            color: '#F4F1EA',
          }}>SYNALITH</span>
        </div>
        <div style={{ display: 'flex', gap: mobile ? 18 : 36, fontSize: mobile ? 10 : 12, letterSpacing: '0.18em', textTransform: 'uppercase', color: 'rgba(232,229,222,0.5)' }}>
          <a href="#about" style={navLinkStyle}>Studio</a>
          <a href="#work" style={navLinkStyle}>Work</a>
          <a href="#values" style={navLinkStyle}>Philosophy</a>
        </div>
      </nav>

      {/* ─── Hero ─── */}
      <section style={{ position: 'relative', minHeight: mobile ? 'auto' : 'calc(100% - 80px)', padding: mobile ? '60px 20px 80px' : '120px 56px 160px', overflow: 'hidden' }}>
        {/* Vector backdrop — atmospheric isometric geometry echoing the logo DNA */}
        <HeroBackdrop scrollY={scrollY} teal={teal} tealDeep={tealDeep} orange={orange} mobile={mobile} />
        {/* Atmospheric haze */}
        <div style={{
          position: 'absolute', inset: 0, pointerEvents: 'none',
          background: `radial-gradient(ellipse at 70% 40%, rgba(95,212,217,0.08), transparent 60%)`,
        }} />

        <div style={{ position: 'relative', maxWidth: 980 }}>
          <div style={{
            fontSize: 11, letterSpacing: '0.32em', textTransform: 'uppercase',
            color: teal, marginBottom: 40,
            display: 'flex', alignItems: 'center', gap: 14,
          }}>
            <span style={{ width: 28, height: 1, background: teal }} />
            Independent · Est. 2026
          </div>

          <h1 style={{
            fontFamily: '"Fraunces", serif',
            fontWeight: 300,
            fontSize: 'clamp(64px, 9vw, 132px)',
            lineHeight: 0.95,
            letterSpacing: '-0.03em',
            margin: '0 0 48px',
            color: '#F4F1EA',
            fontVariationSettings: '"opsz" 144, "SOFT" 30',
          }}>
            Worlds carved
            <br />
            <span style={{ fontStyle: 'italic', fontWeight: 300, color: teal }}>from intention</span>
            <span style={{
              display: 'inline-block', width: '0.08em', height: '0.85em',
              background: teal, marginLeft: '0.08em', verticalAlign: '-0.05em',
              animation: 'syn-blink 1.4s steps(2) infinite',
            }} />
          </h1>

          <p style={{
            fontSize: mobile ? 17 : 22, lineHeight: 1.55, maxWidth: 620,
            color: 'rgba(232,229,222,0.78)', fontWeight: 300,
            margin: 0,
          }}>
            {C.mission}
          </p>
        </div>

        {/* Scroll cue */}
        <div style={{
          position: 'absolute', bottom: mobile ? 24 : 48, left: mobile ? 20 : 56,
          fontSize: 10, letterSpacing: '0.3em', textTransform: 'uppercase',
          color: 'rgba(232,229,222,0.4)',
          display: 'flex', alignItems: 'center', gap: 12,
        }}>
          <span style={{
            width: 1, height: 32, background: 'rgba(232,229,222,0.3)',
            animation: 'syn-pulse 2.4s ease-in-out infinite',
          }} />
          Scroll
        </div>
      </section>

      {/* ─── About ─── */}
      <section id="about" style={{ padding: mobile ? '48px 20px' : '140px 56px', borderTop: '1px solid rgba(255,255,255,0.06)' }}>
        <div style={{ display: 'grid', gridTemplateColumns: mobile ? '1fr' : '180px 1fr', gap: mobile ? 20 : 80, maxWidth: 1100 }}>
          <div style={sectionLabel(teal)}>
            <span style={{ width: 20, height: 1, background: teal, display: 'inline-block', marginRight: 10, verticalAlign: 'middle' }} />
            01 — Studio
          </div>
          <div>
            <h2 style={{
              fontFamily: '"Fraunces", serif', fontWeight: 300,
              fontSize: mobile ? 30 : 44, lineHeight: 1.15, margin: mobile ? '0 0 32px' : '0 0 56px',
              letterSpacing: '-0.02em', color: '#F4F1EA',
              maxWidth: 760, textWrap: 'pretty',
            }}>
              We are a small studio. We mean to stay that way.
            </h2>
            <div style={{ display: 'grid', gap: 28, fontSize: mobile ? 16 : 19, lineHeight: 1.7, color: 'rgba(232,229,222,0.78)', fontWeight: 300, maxWidth: 680 }}>
              {C.about.map((p, i) => <p key={i} style={{ margin: 0, textWrap: 'pretty' }}>{p}</p>)}
            </div>
          </div>
        </div>
      </section>

      {/* ─── Work / Coming Soon ─── */}
      <section id="work" style={{ padding: mobile ? '48px 20px' : '160px 56px', borderTop: '1px solid rgba(255,255,255,0.06)', position: 'relative', overflow: 'hidden' }}>
        {/* Soft vector glow + drifting mark */}
        <div aria-hidden="true" style={{
          position: 'absolute', inset: 0, pointerEvents: 'none',
          background: `radial-gradient(ellipse at 50% 40%, ${teal}10 0%, transparent 55%)`,
        }} />
        <svg aria-hidden="true" viewBox="0 0 600 600" style={{
          position: 'absolute', left: '50%', top: '46%',
          transform: 'translate(-50%, -50%)', width: mobile ? 280 : 460, height: mobile ? 280 : 460,
          opacity: 0.6, pointerEvents: 'none',
        }}>
          <g stroke={teal} strokeOpacity="0.22" strokeWidth="0.8" fill="none">
            <path d="M 300 80 L 480 180 L 480 380 L 300 480 L 120 380 L 120 180 Z" />
            <path d="M 300 80 L 300 280 L 120 380" />
            <path d="M 300 280 L 480 180" />
          </g>
          <g stroke={teal} strokeOpacity="0.4" strokeWidth="0.8" fill="none">
            <path d="M 300 160 L 420 226 L 420 346 L 300 410 L 180 346 L 180 226 Z" />
          </g>
          <circle cx="300" cy="280" r="3" fill={teal} />
          <circle cx="300" cy="280" r="22" stroke={teal} strokeOpacity="0.35" strokeWidth="0.6" fill="none" />
          <circle cx="300" cy="280" r="56" stroke={teal} strokeOpacity="0.18" strokeWidth="0.5" fill="none" />
        </svg>

        <div style={{ position: 'relative', maxWidth: 1100, margin: '0 auto', textAlign: 'center' }}>
          <div style={{
            display: 'inline-flex', alignItems: 'center', gap: 14,
            fontSize: 11, letterSpacing: '0.32em', textTransform: 'uppercase',
            color: teal, marginBottom: mobile ? 28 : 48,
          }}>
            <span style={{ width: 24, height: 1, background: teal }} />
            02 — In motion
            <span style={{ width: 24, height: 1, background: teal }} />
          </div>

          <h2 style={{
            fontFamily: '"Fraunces", serif', fontWeight: 300,
            fontSize: 'clamp(52px, 7vw, 104px)', lineHeight: 1,
            letterSpacing: '-0.03em',
            margin: mobile ? '0 0 32px' : '0 0 56px', color: '#F4F1EA',
            fontVariationSettings: '"opsz" 144, "SOFT" 30',
          }}>
            Something is<br />
            <span style={{ fontStyle: 'italic', color: teal }}>taking shape.</span>
          </h2>

          <p style={{
            fontSize: mobile ? 17 : 21, lineHeight: 1.55, maxWidth: 580,
            color: 'rgba(232,229,222,0.72)', fontWeight: 300,
            margin: mobile ? '0 auto 40px' : '0 auto 64px', textWrap: 'pretty',
          }}>
            We are quietly at work on our first projects. When they are ready to be seen, you'll find them here — not a moment before.
          </p>

          {/* Status row */}
          <div style={{
            display: 'inline-flex', alignItems: 'center', gap: mobile ? 16 : 32,
            padding: mobile ? '12px 20px' : '16px 28px',
            border: `1px solid ${teal}40`, borderRadius: 999,
            background: 'rgba(95,212,217,0.04)',
            fontSize: 12, letterSpacing: '0.2em', textTransform: 'uppercase',
            color: 'rgba(232,229,222,0.7)',
          }}>
            <span style={{ display: 'inline-flex', alignItems: 'center', gap: 10 }}>
              <span style={{
                width: 8, height: 8, borderRadius: '50%',
                background: teal, boxShadow: `0 0 12px ${teal}`,
                animation: 'syn-pulse 2s ease-in-out infinite',
              }} />
              In development
            </span>
            <span style={{ width: 1, height: 14, background: 'rgba(232,229,222,0.2)' }} />
            <span style={{ color: 'rgba(232,229,222,0.55)' }}>Reveal · soon</span>
          </div>
        </div>
      </section>

      {/* ─── Values ─── */}
      <section id="values" style={{ padding: mobile ? '48px 20px' : '140px 56px', borderTop: '1px solid rgba(255,255,255,0.06)' }}>
        <div style={{ display: 'grid', gridTemplateColumns: mobile ? '1fr' : '180px 1fr', gap: mobile ? 20 : 80, maxWidth: 1100, marginBottom: mobile ? 32 : 80 }}>
          <div style={sectionLabel(teal)}>
            <span style={{ width: 20, height: 1, background: teal, display: 'inline-block', marginRight: 10, verticalAlign: 'middle' }} />
            03 — Philosophy
          </div>
          <h2 style={{
            fontFamily: '"Fraunces", serif', fontWeight: 300,
            fontSize: mobile ? 30 : 44, lineHeight: 1.15, margin: 0,
            letterSpacing: '-0.02em', color: '#F4F1EA',
          }}>
            Three ideas we keep returning to.
          </h2>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: mobile ? '1fr' : 'repeat(3, 1fr)', gap: mobile ? 32 : 56, maxWidth: 1280 }}>
          {C.pillars.map((v) => (
            <div key={v.n}>
              <div style={{
                fontFamily: '"Fraunces", serif', fontStyle: 'italic',
                fontSize: mobile ? 40 : 56, color: teal, fontWeight: 300, marginBottom: mobile ? 12 : 24, lineHeight: 1,
              }}>{v.n}</div>
              <h3 style={{
                fontFamily: '"Fraunces", serif', fontWeight: 400,
                fontSize: 26, margin: '0 0 16px', color: '#F4F1EA',
                letterSpacing: '-0.01em',
              }}>{v.title}</h3>
              <p style={{
                fontSize: 16, lineHeight: 1.65, color: 'rgba(232,229,222,0.65)',
                fontWeight: 300, margin: 0, textWrap: 'pretty',
              }}>{v.body}</p>
            </div>
          ))}
        </div>
      </section>

      {/* ─── Footer ─── */}
      <footer style={{
        padding: mobile ? '40px 20px 32px' : '64px 56px 40px', borderTop: '1px solid rgba(255,255,255,0.06)',
        display: 'flex', justifyContent: 'space-between', alignItems: mobile ? 'flex-start' : 'center',
        flexDirection: mobile ? 'column' : 'row',
        fontSize: 12, color: 'rgba(232,229,222,0.4)', letterSpacing: '0.04em',
        flexWrap: 'wrap', gap: mobile ? 16 : 24,
      }}>
        <div style={{ display: 'flex', alignItems: 'center', gap: 12, flexWrap: 'wrap' }}>
          <img src="assets/mark.png?v=5" alt="" style={{ width: 22, height: 22, objectFit: 'contain', opacity: 0.75 }} />
          <span style={{ fontFamily: '"Michroma", "Eurostile", sans-serif', letterSpacing: '0.14em', fontSize: 11 }}>SYNALITH</span>
          <span style={{ marginLeft: mobile ? 0 : 16, color: 'rgba(232,229,222,0.3)' }}>© 2026 — All things considered.</span>
          <span style={{ marginLeft: 4, color: 'rgba(232,229,222,0.3)' }}>·</span>
          <a href="mailto:support@synalith.com" className="has-hover" style={{ color: 'rgba(232,229,222,0.55)', textDecoration: 'none', letterSpacing: '0.04em' }}>support@synalith.com</a>
        </div>
        {/* <div style={{ display: 'flex', gap: 24, textTransform: 'uppercase', letterSpacing: '0.18em' }}>
          <a href="#" className="has-hover" style={navLinkStyle}>Bluesky</a>
          <a href="#" className="has-hover" style={navLinkStyle}>Mastodon</a>
          <a href="#" className="has-hover" style={navLinkStyle}>RSS</a>
        </div> */}
      </footer>

      <style>{`
        @keyframes syn-blink { 0%, 50% { opacity: 1 } 50.01%, 100% { opacity: 0 } }
        @keyframes syn-pulse { 0%, 100% { opacity: 0.3 } 50% { opacity: 0.9 } }
        a:hover { color: #5FD4D9 !important; }
      `}</style>
    </div>
  );
};

const navLinkStyle = {
  color: 'inherit', textDecoration: 'none',
  transition: 'color 0.2s',
};

const sectionLabel = (teal) => ({
  fontSize: 11, letterSpacing: '0.28em', textTransform: 'uppercase',
  color: teal, fontWeight: 500, paddingTop: 14,
});

function ProjectCard({ p, i, teal, tealDeep }) {
  const [hover, setHover] = React.useState(false);
  return (
    <div onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)}
         style={{
           position: 'relative', aspectRatio: '3 / 4',
           background: `linear-gradient(165deg, #11171a 0%, #0a0d0f 100%)`,
           border: '1px solid rgba(255,255,255,0.06)',
           padding: 32, display: 'flex', flexDirection: 'column',
           justifyContent: 'space-between',
           overflow: 'hidden', cursor: 'pointer',
           transition: 'transform 0.6s cubic-bezier(0.2,0.7,0.2,1), border-color 0.3s',
           transform: hover ? 'translateY(-6px)' : 'translateY(0)',
           borderColor: hover ? `${teal}40` : 'rgba(255,255,255,0.06)',
         }}>
      {/* Procedural backdrop — different per card */}
      <ProjectBackdrop seed={i} teal={teal} tealDeep={tealDeep} hover={hover} />

      <div style={{ position: 'relative' }}>
        <div style={{
          fontFamily: '"Fraunces", serif', fontStyle: 'italic',
          fontSize: 14, color: 'rgba(232,229,222,0.4)', letterSpacing: '0.06em',
        }}>Project</div>
        <div style={{
          fontFamily: '"Fraunces", serif', fontWeight: 300,
          fontSize: 84, lineHeight: 1, color: '#F4F1EA',
          letterSpacing: '-0.04em', marginTop: 4,
        }}>{p.id}</div>
      </div>

      <div style={{ position: 'relative' }}>
        <div style={{
          fontSize: 11, letterSpacing: '0.22em', textTransform: 'uppercase',
          color: 'rgba(232,229,222,0.55)', marginBottom: 14,
        }}>{p.tag}</div>
        <div style={{
          display: 'flex', alignItems: 'center', justifyContent: 'space-between',
          paddingTop: 14, borderTop: '1px solid rgba(255,255,255,0.08)',
        }}>
          <span style={{ fontSize: 13, color: teal, fontFamily: '"Fraunces", serif', fontStyle: 'italic' }}>
            {p.state}
          </span>
          <span style={{
            fontSize: 11, letterSpacing: '0.2em', textTransform: 'uppercase',
            color: 'rgba(232,229,222,0.4)',
            transform: hover ? 'translateX(4px)' : 'translateX(0)',
            transition: 'transform 0.3s',
          }}>More soon →</span>
        </div>
      </div>
    </div>
  );
}

function ProjectBackdrop({ seed, teal, tealDeep, hover }) {
  // Three different abstract treatments — same DNA, different geometry
  if (seed === 0) {
    return (
      <svg style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', opacity: hover ? 0.6 : 0.35, transition: 'opacity 0.6s' }}
           viewBox="0 0 300 400" preserveAspectRatio="xMidYMid slice">
        <defs>
          <radialGradient id={`pg0`} cx="0.5" cy="0.4">
            <stop offset="0%" stopColor={teal} stopOpacity="0.35" />
            <stop offset="100%" stopColor={teal} stopOpacity="0" />
          </radialGradient>
        </defs>
        <rect width="300" height="400" fill={`url(#pg0)`} />
        {Array.from({ length: 14 }).map((_, i) => (
          <line key={i} x1={0} y1={120 + i * 16} x2={300} y2={140 + i * 16} stroke={teal} strokeOpacity={0.15 - i * 0.008} strokeWidth="0.5" />
        ))}
      </svg>
    );
  }
  if (seed === 1) {
    return (
      <svg style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', opacity: hover ? 0.7 : 0.4, transition: 'opacity 0.6s' }}
           viewBox="0 0 300 400">
        {Array.from({ length: 6 }).map((_, i) => (
          <circle key={i} cx={150} cy={200} r={40 + i * 28} stroke={teal} strokeOpacity={0.18 - i * 0.025} strokeWidth="0.5" fill="none" />
        ))}
        <circle cx={150} cy={200} r={6} fill={teal} opacity="0.6" />
      </svg>
    );
  }
  return (
    <svg style={{ position: 'absolute', inset: 0, width: '100%', height: '100%', opacity: hover ? 0.6 : 0.3, transition: 'opacity 0.6s' }}
         viewBox="0 0 300 400">
      {Array.from({ length: 30 }).map((_, i) => {
        const x = (i * 37) % 300;
        const y = (i * 53 + 50) % 400;
        return <rect key={i} x={x} y={y} width="2" height="2" fill={teal} opacity={0.2 + (i % 5) * 0.1} />;
      })}
      <path d="M 30 350 Q 150 100, 270 280" stroke={teal} strokeOpacity="0.3" strokeWidth="0.5" fill="none" />
    </svg>
  );
}

// Scattered signal nodes around the isometric monument — core + 8 satellites
const NODES = [
  { x: 450, y: 405 }, // 0: core (matches anchor circle)
  { x: 180, y: 200 },
  { x: 720, y: 180 },
  { x: 760, y: 440 },
  { x: 620, y: 680 },
  { x: 280, y: 700 },
  { x: 100, y: 480 },
  { x: 340, y: 140 },
  { x: 560, y: 120 },
];

// ─── Hero backdrop — vector isometric geometry, no bitmap ───
function HeroBackdrop({ scrollY, teal, tealDeep, orange = '#F17750', mobile }) {
  // A loose abstract isometric monument: stacked prisms, drifting hex grid,
  // and a constellation of points. All vector, all crisp at any size.
  const py = scrollY * 0.18;
  const px = Math.sin(scrollY * 0.005) * 8;

  // ─── Random-walking satellite on the outer prism's edges ───
  // The satellite slowly traverses the edges of the isometric wireframe,
  // picking a random adjacent vertex at each junction.
  const VERTS = React.useMemo(() => ([
    { x: 450, y:  80 }, // 0  top
    { x: 760, y: 240 }, // 1  top-right
    { x: 760, y: 560 }, // 2  bottom-right
    { x: 450, y: 720 }, // 3  bottom
    { x: 140, y: 560 }, // 4  bottom-left
    { x: 140, y: 240 }, // 5  top-left
    { x: 450, y: 400 }, // 6  inner front corner
  ]), []);
  // Adjacency: hexagonal silhouette + 3 isometric inner edges
  const ADJ = React.useMemo(() => ([
    [1, 5, 6],     // 0 → TR, TL, inner
    [0, 2, 6],     // 1 → top, BR, inner
    [1, 3],        // 2 → TR, bottom
    [2, 4, 6],     // 3 → BR, BL, inner   (alternate inner edge for variety)
    [3, 5, 6],     // 4 → bottom, TL, inner
    [0, 4],        // 5 → top, BL
    [0, 1, 3, 4],  // 6 → top, TR, bottom, BL
  ]), []);

  const satRef = React.useRef(null);

  React.useEffect(() => {
    const g = satRef.current;
    if (!g) return;
    const circles = g.querySelectorAll('circle');

    let raf;
    let from = 0, to = ADJ[0][Math.floor(Math.random() * ADJ[0].length)];
    let startedAt = performance.now();
    const speedPxPerMs = 0.045; // slightly slower for smoother feel
    const dist = (a, b) => Math.hypot(b.x - a.x, b.y - a.y);
    let duration = dist(VERTS[from], VERTS[to]) / speedPxPerMs;
    let pauseUntil = 0;

    const pickNext = () => {
      const options = ADJ[to].filter(v => v !== from);
      const choices = options.length ? options : ADJ[to];
      from = to;
      to = choices[Math.floor(Math.random() * choices.length)];
      startedAt = performance.now();
      duration = dist(VERTS[from], VERTS[to]) / speedPxPerMs;
    };

    // Smooth ease — slow out of vertices, gentle cruise, slow into next
    const ease = (t) => t < 0.5
      ? 4 * t * t * t
      : 1 - Math.pow(-2 * t + 2, 3) / 2;

    const tick = (now) => {
      if (now < pauseUntil) {
        raf = requestAnimationFrame(tick);
        return;
      }
      const t = Math.min(1, (now - startedAt) / duration);
      const eased = ease(t);
      const a = VERTS[from], b = VERTS[to];
      const x = a.x + (b.x - a.x) * eased;
      const y = a.y + (b.y - a.y) * eased;

      // Direct DOM update — no React re-render
      circles.forEach(c => { c.setAttribute('cx', x); c.setAttribute('cy', y); });

      if (t >= 1) {
        pauseUntil = now + 200 + Math.random() * 600; // shorter pauses
        pickNext();
      }
      raf = requestAnimationFrame(tick);
    };
    raf = requestAnimationFrame(tick);
    return () => cancelAnimationFrame(raf);
  }, [VERTS, ADJ]);

  return (
    <div aria-hidden="true" style={{
      position: 'absolute', inset: 0, pointerEvents: 'none', overflow: 'hidden',
    }}>
      {/* Hex grid wash, drifts on scroll */}
      <svg viewBox="0 0 1280 1100" preserveAspectRatio="xMidYMid slice"
           style={{
             position: 'absolute', inset: 0, width: '100%', height: '100%',
             transform: `translate(${px}px, ${-py * 0.4}px)`,
             transition: 'transform 0.6s cubic-bezier(0.2,0.7,0.2,1)',
             opacity: 0.55,
           }}>
        <defs>
          <pattern id="syn-hex" x="0" y="0" width="80" height="69.28" patternUnits="userSpaceOnUse">
            <path d="M 40 0 L 80 23.09 L 80 46.19 L 40 69.28 L 0 46.19 L 0 23.09 Z"
                  fill="none" stroke={teal} strokeOpacity="0.08" strokeWidth="0.8" />
          </pattern>
          <radialGradient id="syn-fade" cx="0.7" cy="0.42" r="0.55">
            <stop offset="0%" stopColor="#000" stopOpacity="0" />
            <stop offset="100%" stopColor="#0B0E10" stopOpacity="1" />
          </radialGradient>
        </defs>
        <rect width="1280" height="1100" fill="url(#syn-hex)" />
        <rect width="1280" height="1100" fill="url(#syn-fade)" />
      </svg>

      {/* Monument — three nested isometric prisms, parallax */}
      <svg viewBox="0 0 900 900" preserveAspectRatio="xMidYMid meet"
           style={{
             position: 'absolute', right: mobile ? '-40%' : -120, top: mobile ? '10%' : 40,
             width: mobile ? '140%' : 920, height: mobile ? '80%' : 920,
             transform: `translateY(${py}px) rotate(-4deg)`,
             transition: 'transform 0.6s cubic-bezier(0.2,0.7,0.2,1)',
             opacity: 0.85,
           }}>
        <defs>
          <linearGradient id="syn-prism-a" x1="0" x2="1" y1="0" y2="1">
            <stop offset="0%" stopColor={teal} stopOpacity="0.32" />
            <stop offset="100%" stopColor={teal} stopOpacity="0" />
          </linearGradient>
          <linearGradient id="syn-prism-b" x1="0" x2="0" y1="0" y2="1">
            <stop offset="0%" stopColor={tealDeep} stopOpacity="0.4" />
            <stop offset="100%" stopColor={tealDeep} stopOpacity="0.02" />
          </linearGradient>
          <linearGradient id="syn-prism-c" x1="1" x2="0" y1="0" y2="1">
            <stop offset="0%" stopColor={teal} stopOpacity="0.18" />
            <stop offset="100%" stopColor={teal} stopOpacity="0" />
          </linearGradient>
        </defs>

        {/* Outer prism — wireframe */}
        <g stroke={teal} strokeOpacity="0.22" strokeWidth="0.8" fill="none">
          <path d="M 450 80 L 760 240 L 760 560 L 450 720 L 140 560 L 140 240 Z" />
          <path d="M 450 80 L 450 400 L 140 560" />
          <path d="M 450 400 L 760 240" />
          <path d="M 450 400 L 450 720" />
        </g>

        {/* Middle prism — filled faces */}
        <g>
          <path d="M 450 180 L 660 290 L 660 510 L 450 620 L 240 510 L 240 290 Z"
                fill="url(#syn-prism-a)" stroke={teal} strokeOpacity="0.4" strokeWidth="0.8" />
          {/* Left face shading */}
          <path d="M 450 180 L 450 400 L 240 510 L 240 290 Z" fill="url(#syn-prism-b)" />
          {/* Right face highlight */}
          <path d="M 450 180 L 660 290 L 660 510 L 450 400 Z" fill="url(#syn-prism-c)" />
          {/* Inner edges */}
          <path d="M 450 180 L 450 400 L 240 510" stroke={teal} strokeOpacity="0.5" strokeWidth="0.8" fill="none" />
          <path d="M 450 400 L 660 290" stroke={teal} strokeOpacity="0.4" strokeWidth="0.8" fill="none" />
        </g>

        {/* Inner core — warm orange accent (the heart) */}
        <g>
          <path d="M 450 270 L 580 340 L 580 470 L 450 540 L 320 470 L 320 340 Z"
                fill={orange} fillOpacity="0.22" stroke={orange} strokeOpacity="0.55" strokeWidth="1" />
          <path d="M 450 270 L 450 405 L 320 470" stroke={orange} strokeOpacity="0.5" strokeWidth="0.8" fill="none" />
          <path d="M 450 405 L 580 340" stroke={orange} strokeOpacity="0.45" strokeWidth="0.8" fill="none" />
        </g>

        {/* Anchor — small fixed point at the heart */}
        <circle cx="450" cy="405" r="2.5" fill={orange} opacity="0.9" />
        <circle cx="450" cy="405" r="22" stroke={orange} strokeOpacity="0.45" strokeWidth="0.6" fill="none" />

        {/* Static halos */}
        <circle cx="450" cy="405" r="84" stroke={teal} strokeOpacity="0.14" strokeWidth="0.5" fill="none" />
        <circle cx="450" cy="405" r="120" stroke={teal} strokeOpacity="0.08" strokeWidth="0.5" fill="none" />

        {/* Distant scattered points — mixed warm/cool signal nodes */}
        {NODES.slice(1).map((n, i) => {
          const isOrange = [1, 3, 5, 7].includes(i + 1) === false;  // alternate
          const colors = ['teal', 'orange', 'teal', 'orange', 'teal', 'orange', 'teal', 'teal'];
          const c = colors[i] === 'orange' ? orange : teal;
          const r = [1.5, 1.2, 2, 1.3, 1, 0.9, 1.1, 1.4][i];
          return (
            <circle key={i} cx={n.x} cy={n.y} r={r} fill={c} opacity={0.45 + (i % 3) * 0.15} />
          );
        })}

        {/* Network lines — every node tied to the core, faint */}
        <g strokeWidth="0.5" strokeDasharray="2 4" fill="none">
          {NODES.slice(1).map((n, i) => {
            const isWarm = i % 3 === 0;
            return (
              <line key={i} x1={NODES[0].x} y1={NODES[0].y} x2={n.x} y2={n.y}
                    stroke={isWarm ? orange : teal}
                    strokeOpacity={isWarm ? 0.14 : 0.09} />
            );
          })}
        </g>

        {/* Random-walking satellite — travels along the network lines */}
        <g ref={satRef}>
          {/* soft glow halo */}
          <circle cx={VERTS[0].x} cy={VERTS[0].y} r="9" fill={orange} opacity="0.08" />
          <circle cx={VERTS[0].x} cy={VERTS[0].y} r="5" fill={orange} opacity="0.22" />
          {/* core dot */}
          <circle cx={VERTS[0].x} cy={VERTS[0].y} r="3" fill={orange} />
        </g>
      </svg>

      {/* Cool teal glow — top right */}
      <div style={{
        position: 'absolute', right: '-10%', top: '-5%',
        width: 700, height: 700, borderRadius: '50%',
        background: `radial-gradient(circle, ${teal}26 0%, ${teal}08 35%, transparent 65%)`,
        filter: 'blur(40px)', pointerEvents: 'none',
      }} />

      {/* Warm orange glow — bottom left, opposing the cool */}
      <div style={{
        position: 'absolute', left: '-12%', bottom: '-15%',
        width: 720, height: 720, borderRadius: '50%',
        background: `radial-gradient(circle, ${orange}24 0%, ${orange}0A 30%, transparent 60%)`,
        filter: 'blur(60px)', pointerEvents: 'none',
      }} />

      {/* Subtle warm haze drifting up from horizon */}
      <div style={{
        position: 'absolute', left: '20%', bottom: 0,
        width: '60%', height: 380,
        background: `radial-gradient(ellipse at 50% 100%, ${orange}1A 0%, transparent 70%)`,
        filter: 'blur(30px)', pointerEvents: 'none',
      }} />
    </div>
  );
}
