// Sacred Roux logo — uses the actual logo PNG as the mark.
// Full mandala: assets/sacred-roux-logo.png

function SRLogoMark({ size = 56, style }) {
  return (
    <img
      src="assets/sacred-roux-logo.png"
      alt="Sacred Roux"
      width={size} height={size}
      style={{ display: 'block', ...style }}
    />
  );
}

function SRLogoLockup({ color = 'currentColor', orientation = 'horizontal', size = 'md' }) {
  const scale = size === 'sm' ? 0.75 : size === 'lg' ? 1.25 : 1;
  if (orientation === 'stacked') {
    return (
      <div style={{ color, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 14 * scale }}>
        <SRLogoMark size={72 * scale} />
        <div style={{ textAlign: 'center' }}>
          <div style={{ fontFamily: 'var(--d2-display)', fontSize: 30 * scale, letterSpacing: '0.02em', lineHeight: 1, fontWeight: 500 }}>
            Sacred Roux
          </div>
          <div style={{ fontFamily: 'var(--d2-mono)', fontSize: 9 * scale, letterSpacing: '0.4em', textTransform: 'uppercase', opacity: 0.7, marginTop: 8 }}>
            Est · Cane River
          </div>
        </div>
      </div>
    );
  }
  return (
    <div style={{ color, display: 'flex', alignItems: 'center', gap: 14 * scale }}>
      <SRLogoMark size={54 * scale} />
      <div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
        <div style={{ fontFamily: 'var(--d2-display)', fontSize: 24 * scale, letterSpacing: '0.04em', fontWeight: 500, lineHeight: 1 }}>
          Sacred Roux
        </div>
        <div style={{ fontFamily: 'var(--d2-mono)', fontSize: 9 * scale, letterSpacing: '0.4em', textTransform: 'uppercase', opacity: 0.7 }}>
          Est · Cane River
        </div>
      </div>
    </div>
  );
}

// Motifs abstracted from the logo, for page decoration

// Flower of Life rosette — infinite-repeat vesica lattice
function FlowerOfLife({ size = 300, rings = 3, stroke = 0.6, style }) {
  const r = 20;
  const circles = [{ x: 0, y: 0 }];
  for (let ring = 1; ring <= rings; ring++) {
    for (let i = 0; i < 6 * ring; i++) {
      const angle = (i / (6 * ring)) * Math.PI * 2;
      const dist = ring * r * Math.sqrt(3);
      // actual hex lattice:
    }
  }
  // proper hex packing for flower of life
  const hex = [];
  for (let q = -rings; q <= rings; q++) {
    for (let rr = -rings; rr <= rings; rr++) {
      if (Math.abs(q + rr) > rings) continue;
      const x = r * (q + rr / 2) * Math.sqrt(3);
      const y = r * rr * 1.5;
      hex.push({ x, y });
    }
  }
  const vb = (rings + 1) * r * 2;
  return (
    <svg viewBox={`${-vb} ${-vb} ${vb * 2} ${vb * 2}`} width={size} height={size} style={style}
      fill="none" stroke="currentColor" strokeWidth={stroke}>
      {hex.map((c, i) => (
        <circle key={i} cx={c.x} cy={c.y} r={r} />
      ))}
      <circle cx="0" cy="0" r={rings * r * 1.6} strokeWidth={stroke * 1.5} />
    </svg>
  );
}

// Pot + spiral-steam silhouette — the central figure abstracted
function PotSpiral({ size = 200, style }) {
  return (
    <svg viewBox="0 0 100 140" width={size} height={size * 1.4} style={style}
      fill="none" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round">
      {/* pot body */}
      <path d="M25 95 C 25 115, 35 128, 50 128 C 65 128, 75 115, 75 95 Z" strokeWidth="1.5" />
      {/* pot rim */}
      <path d="M22 94 L 78 94" strokeWidth="2" />
      {/* concentric ripples inside rim */}
      <ellipse cx="50" cy="95" rx="24" ry="3" strokeWidth="0.7" />
      <ellipse cx="50" cy="95" rx="18" ry="2.2" strokeWidth="0.6" />
      <ellipse cx="50" cy="95" rx="12" ry="1.6" strokeWidth="0.5" />
      <ellipse cx="50" cy="95" rx="6" ry="0.8" strokeWidth="0.5" />
      {/* decorative band on pot */}
      <path d="M30 106 L 70 106" strokeWidth="0.5" strokeDasharray="2 2" />
      {/* rising spiral / steam */}
      <path d="M50 92 C 50 80, 54 74, 56 70 C 58 66, 56 62, 52 62 C 48 62, 46 66, 48 70 C 50 74, 54 76, 56 72"
        strokeWidth="1.2" />
      <path d="M50 62 C 50 54, 46 48, 44 42 C 42 36, 46 32, 50 32 C 54 32, 58 36, 56 42 C 54 48, 50 54, 50 62"
        strokeWidth="1.2" />
      {/* small circle/eye at top */}
      <circle cx="50" cy="26" r="2" strokeWidth="1" />
      <circle cx="50" cy="26" r="4" strokeWidth="0.5" />
      {/* triangular peak behind */}
      <path d="M50 20 L 62 8 L 38 8 Z" strokeWidth="0.8" opacity="0.5" />
    </svg>
  );
}

// Vesica petal — the lens shape that builds flower-of-life
function Vesica({ size = 80, style }) {
  return (
    <svg viewBox="-50 -30 100 60" width={size} height={size * 0.6} style={style}
      fill="none" stroke="currentColor" strokeWidth="0.8">
      <path d="M -25 0 A 25 25 0 0 1 25 0 A 25 25 0 0 1 -25 0 Z" />
    </svg>
  );
}

// Small ornament — three vesicas arranged as a trefoil (used as margin dividers)
function Trefoil({ size = 40, style }) {
  return (
    <svg viewBox="-30 -30 60 60" width={size} height={size} style={style}
      fill="none" stroke="currentColor" strokeWidth="0.8">
      <g>
        <path d="M 0 -10 A 12 12 0 0 1 10 7 A 12 12 0 0 1 -10 7 A 12 12 0 0 1 0 -10 Z" opacity="0.3" />
        <circle cx="0" cy="-6" r="6" />
        <circle cx="-5" cy="3" r="6" />
        <circle cx="5" cy="3" r="6" />
      </g>
    </svg>
  );
}

Object.assign(window, { SRLogoMark, SRLogoLockup, FlowerOfLife, PotSpiral, Vesica, Trefoil });
