// hifi-hero-abstracts.jsx — abstract hero illustration alternatives
// Three options, all in the same fresh-green tonal range, more abstract /
// graphic than the literal mountain landscape.

// ───────────────────────────────────────────────────────────
// Option 1 — "Sunrise Arcs"
// Concentric arcs rising from a horizon, with a soft sun and a thin path.
// Reads as: 朝日・始まり・前へ進む
// ───────────────────────────────────────────────────────────
function HeroArcs({ width = 560, height = 480 }) {
  return (
    <svg viewBox="0 0 560 480" width={width} height={height}
      style={{ display: 'block', maxWidth: '100%', height: 'auto' }} aria-hidden="true">
      <defs>
        <linearGradient id="arcs-sky" x1="0" y1="0" x2="0" y2="1">
          <stop offset="0" stopColor="#f6faf2" />
          <stop offset="1" stopColor="#e8f1e1" />
        </linearGradient>
        <radialGradient id="arcs-sun" cx=".5" cy=".5" r=".5">
          <stop offset="0" stopColor="#fff3c8" />
          <stop offset=".55" stopColor="#ffe8a5" stopOpacity=".7" />
          <stop offset="1" stopColor="#ffe8a5" stopOpacity="0" />
        </radialGradient>
      </defs>

      {/* canvas */}
      <rect x="0" y="0" width="560" height="480" rx="28" fill="url(#arcs-sky)" />

      {/* sun halo */}
      <circle cx="280" cy="340" r="200" fill="url(#arcs-sun)" />

      {/* arcs — each a half-ring growing outward */}
      {[
        { r: 60,  fill: '#306b3a', op: 1 },
        { r: 100, fill: '#467548', op: .85 },
        { r: 150, fill: '#6b9461', op: .7 },
        { r: 210, fill: '#a8c39e', op: .55 },
        { r: 280, fill: '#cfe0c8', op: .55 },
      ].map((a, i) => (
        <path key={i}
          d={`M ${280 - a.r} 340 A ${a.r} ${a.r} 0 0 1 ${280 + a.r} 340 Z`}
          fill={a.fill} opacity={a.op}
        />
      ))}

      {/* sun disc on top */}
      <circle cx="280" cy="340" r="34" fill="#f7e3a4" />
      <circle cx="280" cy="340" r="34" fill="none" stroke="#caa978" strokeWidth="1.2" opacity=".4" />

      {/* horizon line */}
      <line x1="40" y1="340" x2="520" y2="340" stroke="#306b3a" strokeWidth="1.5" opacity=".4" strokeDasharray="3 6" />

      {/* small dots — "stars" or seeds in the sky */}
      <g fill="#306b3a" opacity=".5">
        <circle cx="110" cy="100" r="2.5" />
        <circle cx="180" cy="70" r="2" />
        <circle cx="430" cy="90" r="2.5" />
        <circle cx="500" cy="160" r="2" />
        <circle cx="80" cy="200" r="2" />
      </g>

      {/* a single floating leaf */}
      <g transform="translate(420,180) rotate(-22)">
        <path d="M 0 0 Q 14 -8 28 0 Q 14 12 0 0 Z" fill="#7ab26a" />
        <path d="M 0 0 L 28 0" stroke="#306b3a" strokeWidth="1" opacity=".6" />
      </g>

      {/* soft frame */}
      <rect x="0.5" y="0.5" width="559" height="479" rx="28" fill="none" stroke="rgba(48,107,58,.08)" />
    </svg>
  );
}

// ───────────────────────────────────────────────────────────
// Option 2 — "Soft Shapes"
// Overlapping organic blobs in green tones, with a small accent dot.
// Reads as: 重なり・つながり・やわらかさ
// ───────────────────────────────────────────────────────────
function HeroShapes({ width = 560, height = 480 }) {
  return (
    <svg viewBox="0 0 560 480" width={width} height={height}
      style={{ display: 'block', maxWidth: '100%', height: 'auto' }} aria-hidden="true">
      <defs>
        <linearGradient id="sh-bg" x1="0" y1="0" x2="1" y2="1">
          <stop offset="0" stopColor="#f6faf2" />
          <stop offset="1" stopColor="#ecf4e5" />
        </linearGradient>
        <linearGradient id="sh-a" x1="0" y1="0" x2="0" y2="1">
          <stop offset="0" stopColor="#a8c39e" />
          <stop offset="1" stopColor="#7da670" />
        </linearGradient>
        <linearGradient id="sh-b" x1="0" y1="0" x2="0" y2="1">
          <stop offset="0" stopColor="#6b9461" />
          <stop offset="1" stopColor="#467548" />
        </linearGradient>
        <linearGradient id="sh-c" x1="0" y1="0" x2="0" y2="1">
          <stop offset="0" stopColor="#cfe0c8" />
          <stop offset="1" stopColor="#b9cdb4" />
        </linearGradient>
      </defs>

      <rect x="0" y="0" width="560" height="480" rx="28" fill="url(#sh-bg)" />

      {/* large back blob */}
      <path
        d="M 120 110
           C 220 60, 360 80, 420 170
           C 480 260, 460 380, 360 410
           C 240 440, 110 400, 70 300
           C 35 215, 60 145, 120 110 Z"
        fill="url(#sh-a)"
      />

      {/* mid blob */}
      <path
        d="M 340 80
           C 430 90, 500 170, 480 260
           C 460 340, 380 360, 320 320
           C 260 280, 270 180, 320 110
           C 326 100, 333 90, 340 80 Z"
        fill="url(#sh-b)"
        opacity=".88"
      />

      {/* front pale blob */}
      <path
        d="M 90 270
           C 170 230, 270 250, 320 320
           C 350 380, 290 430, 200 420
           C 110 410, 50 360, 70 310
           C 75 295, 82 282, 90 270 Z"
        fill="url(#sh-c)"
        opacity=".95"
      />

      {/* accent yellow disc */}
      <circle cx="420" cy="150" r="22" fill="#f7e3a4" />
      <circle cx="420" cy="150" r="22" fill="none" stroke="#caa978" strokeWidth="1" opacity=".5" />

      {/* tiny accent dot */}
      <circle cx="160" cy="180" r="6" fill="#306b3a" />

      {/* thin curve passing through */}
      <path
        d="M 30 380
           Q 180 320 320 380
           T 540 360"
        stroke="#306b3a"
        strokeWidth="1.4"
        fill="none"
        opacity=".55"
        strokeLinecap="round"
        strokeDasharray="1 6"
      />

      {/* sparkle */}
      <path d="M 470 320 l 2 6 l 6 2 l -6 2 l -2 6 l -2 -6 l -6 -2 l 6 -2 z" fill="#7ab26a" opacity=".7" />

      <rect x="0.5" y="0.5" width="559" height="479" rx="28" fill="none" stroke="rgba(48,107,58,.08)" />
    </svg>
  );
}

// ───────────────────────────────────────────────────────────
// Option 3 — "Topo Lines"
// Topographic contour lines, very abstract / geo-data feeling.
// Reads as: 道筋・等高線・テクノロジー × 自然
// ───────────────────────────────────────────────────────────
function HeroTopo({ width = 560, height = 480 }) {
  // Concentric topographic ovals, each slightly offset
  const rings = [
    { rx: 240, ry: 170, cx: 290, cy: 280, sw: 1.6, op: .85, c: '#306b3a' },
    { rx: 210, ry: 145, cx: 290, cy: 278, sw: 1.4, op: .75, c: '#467548' },
    { rx: 180, ry: 122, cx: 288, cy: 275, sw: 1.3, op: .7,  c: '#5a8a55' },
    { rx: 150, ry: 100, cx: 285, cy: 271, sw: 1.2, op: .65, c: '#6b9461' },
    { rx: 120, ry:  80, cx: 281, cy: 266, sw: 1.1, op: .6,  c: '#84a578' },
    { rx:  92, ry:  62, cx: 277, cy: 260, sw: 1.1, op: .55, c: '#a8c39e' },
    { rx:  66, ry:  44, cx: 273, cy: 253, sw: 1,   op: .5,  c: '#bcd8b8' },
    { rx:  42, ry:  28, cx: 269, cy: 245, sw: 1,   op: .5,  c: '#cfe0c8' },
  ];

  return (
    <svg viewBox="0 0 560 480" width={width} height={height}
      style={{ display: 'block', maxWidth: '100%', height: 'auto' }} aria-hidden="true">
      <defs>
        <linearGradient id="topo-bg" x1="0" y1="0" x2="0" y2="1">
          <stop offset="0" stopColor="#f5f8ef" />
          <stop offset="1" stopColor="#e6efe1" />
        </linearGradient>
        <radialGradient id="topo-spot" cx=".5" cy=".4" r=".55">
          <stop offset="0" stopColor="#fff" stopOpacity=".6" />
          <stop offset="1" stopColor="#fff" stopOpacity="0" />
        </radialGradient>
      </defs>

      <rect x="0" y="0" width="560" height="480" rx="28" fill="url(#topo-bg)" />

      {/* soft light blob behind */}
      <ellipse cx="270" cy="240" rx="260" ry="180" fill="url(#topo-spot)" />

      {/* concentric topo lines */}
      {rings.map((r, i) => (
        <ellipse key={i}
          cx={r.cx} cy={r.cy} rx={r.rx} ry={r.ry}
          fill="none"
          stroke={r.c}
          strokeWidth={r.sw}
          opacity={r.op}
        />
      ))}

      {/* peak marker */}
      <circle cx="269" cy="245" r="5" fill="#306b3a" />
      <circle cx="269" cy="245" r="11" fill="none" stroke="#306b3a" strokeWidth="1" opacity=".4" />

      {/* coordinate ticks (top-left) */}
      <g stroke="#306b3a" strokeWidth="1" opacity=".35">
        <line x1="40" y1="50" x2="50" y2="50" />
        <line x1="40" y1="70" x2="46" y2="70" />
        <line x1="40" y1="90" x2="46" y2="90" />
        <line x1="40" y1="110" x2="50" y2="110" />
        <line x1="40" y1="50" x2="40" y2="120" />
      </g>
      <text x="56" y="54" fontFamily="DM Sans, sans-serif" fontSize="9" fill="#306b3a" opacity=".55" letterSpacing="1">
        N · 35.6812°
      </text>
      <text x="56" y="68" fontFamily="DM Sans, sans-serif" fontSize="9" fill="#306b3a" opacity=".55" letterSpacing="1">
        E · 139.7671°
      </text>

      {/* dashed path crossing */}
      <path
        d="M 60 410
           Q 180 340 290 360
           T 520 300"
        stroke="#306b3a"
        strokeWidth="1.4"
        fill="none"
        opacity=".5"
        strokeLinecap="round"
        strokeDasharray="2 6"
      />

      {/* tiny waypoint dots along the path */}
      <g fill="#306b3a">
        <circle cx="120" cy="386" r="2.6" />
        <circle cx="240" cy="354" r="2.6" />
        <circle cx="400" cy="332" r="2.6" />
        <circle cx="490" cy="312" r="2.6" />
      </g>

      {/* accent yellow micro-disc */}
      <circle cx="455" cy="120" r="10" fill="#f7e3a4" />
      <circle cx="455" cy="120" r="20" fill="none" stroke="#caa978" strokeWidth="1" opacity=".4" />

      <rect x="0.5" y="0.5" width="559" height="479" rx="28" fill="none" stroke="rgba(48,107,58,.08)" />
    </svg>
  );
}

// ───────────────────────────────────────────────────────────
// Option 4 — "Two Circles"
// Two overlapping circles. The overlap is the relationship — a small
// dot inside marks the meeting point. Minimal, line-led, lots of breath.
// Reads as: 二者が重なりあう／関係性の中心
// ───────────────────────────────────────────────────────────
function HeroTwoCircles({ width = 560, height = 480 }) {
  return (
    <svg viewBox="0 0 560 480" width={width} height={height}
      style={{ display: 'block', maxWidth: '100%', height: 'auto' }} aria-hidden="true">
      <defs>
        <linearGradient id="tc-bg" x1="0" y1="0" x2="0" y2="1">
          <stop offset="0" stopColor="#f6faf2" />
          <stop offset="1" stopColor="#ecf4e5" />
        </linearGradient>
      </defs>

      <rect x="0" y="0" width="560" height="480" rx="28" fill="url(#tc-bg)" />

      {/* horizon-ish baseline (very faint) */}
      <line x1="60" y1="380" x2="500" y2="380" stroke="#306b3a" strokeWidth="1" opacity=".18" strokeDasharray="2 8" />

      {/* left circle — filled, soft */}
      <circle cx="225" cy="240" r="130" fill="#cfe0c8" opacity=".85" />

      {/* right circle — outline */}
      <circle cx="335" cy="240" r="130" fill="none" stroke="#306b3a" strokeWidth="1.6" />

      {/* lens (overlap) — a slightly deeper green */}
      <path
        d="M 280 130
           A 130 130 0 0 1 280 350
           A 130 130 0 0 1 280 130 Z"
        fill="#7ab26a"
        opacity=".5"
      />

      {/* meeting point */}
      <circle cx="280" cy="240" r="5" fill="#306b3a" />

      {/* tiny labels — anchor each circle without literal words */}
      <circle cx="225" cy="240" r="2.2" fill="#306b3a" opacity=".6" />
      <circle cx="335" cy="240" r="2.2" fill="#306b3a" opacity=".6" />

      {/* a single accent sun-disc, off to the corner */}
      <circle cx="470" cy="100" r="14" fill="#f7e3a4" />
      <circle cx="470" cy="100" r="22" fill="none" stroke="#caa978" strokeWidth="1" opacity=".4" />

      {/* small coordinate ticks (top-left), echoing Topo */}
      <g stroke="#306b3a" strokeWidth="1" opacity=".3">
        <line x1="50" y1="60" x2="60" y2="60" />
        <line x1="50" y1="76" x2="56" y2="76" />
        <line x1="50" y1="92" x2="56" y2="92" />
        <line x1="50" y1="60" x2="50" y2="100" />
      </g>

      <rect x="0.5" y="0.5" width="559" height="479" rx="28" fill="none" stroke="rgba(48,107,58,.08)" />
    </svg>
  );
}

// ───────────────────────────────────────────────────────────
// Option 5 — "Thread"
// Two anchor points connected by a single hand-drawn thread that
// loops and weaves. Animated dash so it feels "being drawn".
// Reads as: 糸を結ぶ・一本ずつ・丁寧に編む
// ───────────────────────────────────────────────────────────
function HeroThread({ width = 560, height = 480, showEcho = true }) {
  // C centered around (290, 240), drawn as a 270° arc opening to the right.
  // 4 anchors sit on the C — visible from the start; the thread passes through
  // each one as it draws.
  const cx = 290, cy = 240, r = 150;
  const anchors = [
    { x: 365, y: 110, fill: '#306b3a' }, // 1. top opening (start)
    { x: 184, y: 134, fill: '#467548' }, // 2. upper-left
    { x: 184, y: 346, fill: '#6b9461' }, // 3. lower-left
    { x: 365, y: 370, fill: '#7ab26a' }, // 4. bottom opening (end)
  ];

  // Main arc — a clean "C" using a single SVG arc command.
  // large-arc-flag=1 (we sweep > 180°), sweep-flag=0 (counter-clockwise on
  // screen, i.e. through the left side).
  const cPath =
    `M ${anchors[0].x} ${anchors[0].y} ` +
    `A ${r} ${r} 0 1 0 ${anchors[3].x} ${anchors[3].y}`;

  // Echo arc — slightly smaller, dashed, sits inside the main C.
  const echoR = r - 14;
  const echoPath =
    `M ${cx + echoR * Math.cos(-Math.PI / 3)} ${cy + echoR * Math.sin(-Math.PI / 3)} ` +
    `A ${echoR} ${echoR} 0 1 0 ` +
    `${cx + echoR * Math.cos(Math.PI / 3)} ${cy + echoR * Math.sin(Math.PI / 3)}`;

  return (
    <svg viewBox="0 0 560 480" width={width} height={height}
      style={{ display: 'block', maxWidth: '100%', height: 'auto' }} aria-hidden="true">
      <defs>
        <linearGradient id="th-bg" x1="0" y1="0" x2="0" y2="1">
          <stop offset="0" stopColor="#f6faf2" />
          <stop offset="1" stopColor="#ecf4e5" />
        </linearGradient>
      </defs>

      <rect x="0" y="0" width="560" height="480" rx="28" fill="url(#th-bg)" />

      {/* echo line — faint, dashed, sits just inside the main C */}
      {showEcho && (
        <path
          d={echoPath}
          fill="none"
          stroke="#7ab26a"
          strokeWidth="1.2"
          strokeLinecap="round"
          opacity=".45"
          strokeDasharray="2 8"
        />
      )}

      {/* main thread — draws on load, traces the C through all 4 anchors */}
      <path
        d={cPath}
        pathLength="1000"
        fill="none"
        stroke="#306b3a"
        strokeWidth="2"
        strokeLinecap="round"
        style={{
          strokeDasharray: 1000,
          strokeDashoffset: 1000,
          animation: 'thread-draw 2.6s .3s cubic-bezier(.22,.61,.36,1) forwards',
        }}
      />

      {/* anchor dots — present from the start */}
      {anchors.map((a, i) => (
        <g key={i}>
          <circle cx={a.x} cy={a.y} r="20" fill="none" stroke={a.fill} strokeWidth="1" opacity=".35" />
          <circle cx={a.x} cy={a.y} r="11" fill={a.fill} />
        </g>
      ))}

      <style>{`
        @keyframes thread-draw {
          to { stroke-dashoffset: 0; }
        }
      `}</style>

      <rect x="0.5" y="0.5" width="559" height="479" rx="28" fill="none" stroke="rgba(48,107,58,.08)" />
    </svg>
  );
}

// ───────────────────────────────────────────────────────────
// Option 6 — "Ripples Meet"
// Two sets of concentric ripples, originating from left and right,
// expanding until they overlap in the middle.
// Reads as: 互いに響き合う・歩み寄り・共鳴
// ───────────────────────────────────────────────────────────
function HeroRipples({ width = 560, height = 480 }) {
  const left = { cx: 160, cy: 260 };
  const right = { cx: 400, cy: 260 };
  const radii = [
    { r: 30,  sw: 1.8, op: .95 },
    { r: 60,  sw: 1.6, op: .8 },
    { r: 95,  sw: 1.4, op: .65 },
    { r: 135, sw: 1.2, op: .5 },
    { r: 180, sw: 1.1, op: .35 },
    { r: 230, sw: 1,   op: .22 },
  ];
  return (
    <svg viewBox="0 0 560 480" width={width} height={height}
      style={{ display: 'block', maxWidth: '100%', height: 'auto' }} aria-hidden="true">
      <defs>
        <linearGradient id="rp-bg" x1="0" y1="0" x2="0" y2="1">
          <stop offset="0" stopColor="#f6faf2" />
          <stop offset="1" stopColor="#ecf4e5" />
        </linearGradient>
        <clipPath id="rp-clip">
          <rect x="0" y="0" width="560" height="480" rx="28" />
        </clipPath>
      </defs>

      <rect x="0" y="0" width="560" height="480" rx="28" fill="url(#rp-bg)" />

      <g clipPath="url(#rp-clip)">
        {/* left ripples */}
        {radii.map((r, i) => (
          <circle key={'l' + i}
            cx={left.cx} cy={left.cy} r={r.r}
            fill="none" stroke="#306b3a" strokeWidth={r.sw} opacity={r.op}
          />
        ))}
        {/* right ripples */}
        {radii.map((r, i) => (
          <circle key={'r' + i}
            cx={right.cx} cy={right.cy} r={r.r}
            fill="none" stroke="#467548" strokeWidth={r.sw} opacity={r.op}
          />
        ))}
      </g>

      {/* anchor dots */}
      <circle cx={left.cx} cy={left.cy} r="6" fill="#306b3a" />
      <circle cx={right.cx} cy={right.cy} r="6" fill="#467548" />

      {/* meeting band — a vertical "where they overlap" hint */}
      <circle cx="280" cy="260" r="4" fill="#7ab26a" />

      {/* horizon */}
      <line x1="40" y1="260" x2="520" y2="260" stroke="#306b3a" strokeWidth="1" opacity=".2" strokeDasharray="2 8" />

      {/* accent sun */}
      <circle cx="280" cy="100" r="14" fill="#f7e3a4" />
      <circle cx="280" cy="100" r="22" fill="none" stroke="#caa978" strokeWidth="1" opacity=".4" />

      <rect x="0.5" y="0.5" width="559" height="479" rx="28" fill="none" stroke="rgba(48,107,58,.08)" />
    </svg>
  );
}

Object.assign(window, { HeroTwoCircles, HeroThread, HeroRipples });
