// Hero — open composition. No box. Drawing bleeds out, with motion lines + slow drift.
function Hero({ onCTA }) {
  return (
    <section className="gjf-hero" id="our-architecture">
      {/* Open backdrop: kinetic horizon + diagonal sightlines (no container) */}
      <div className="gjf-hero-bg" aria-hidden="true">
        <HeroBackdrop />
      </div>

      <div className="gjf-hero-inner">
        <div className="gjf-hero-copy">
          <span className="gjf-eyebrow">Architecting Enforceable Justice</span>
          <h1 className="gjf-hero-title">From symbolic aspiration to <em>enforceable reality</em></h1>
          <div className="gjf-hero-rule" />
          <p className="gjf-hero-sub">
            Global Justice Foundations builds the architecture that turns
            rights from words on paper into protection people can enforce.
          </p>
          <div className="gjf-hero-ctas">
            <a href="our-work.html" className="gjf-btn gjf-btn-primary" onClick={(e) => { if (onCTA) { e.preventDefault(); onCTA("architecture"); } }}>
              Explore the Architecture
            </a>
            <a href="pillars.html" className="gjf-btn gjf-btn-secondary" onClick={(e) => { if (onCTA) { e.preventDefault(); onCTA("pillars"); } }}>
              View the Five Pillars
            </a>
          </div>
        </div>

        {/* Right-side architectural drawing — no frame, bleeds into the page */}
        <div className="gjf-hero-art" aria-hidden="true">
          <BlueprintCourthouse />
        </div>
      </div>
    </section>
  );
}

/* ──────────────────────────────────────────────────────────────────────
   HeroBackdrop — full-bleed canvas of straight lines that suggests motion
   without becoming literal. Diagonal sightlines + horizon + drifting tick
   marks. Animated via CSS (gjf-drift, gjf-rise) defined in styles.css.
   ────────────────────────────────────────────────────────────────────── */
function HeroBackdrop() {
  return (
    <svg viewBox="0 0 1600 720" preserveAspectRatio="xMidYMid slice"
         style={{position:"absolute", inset:0, width:"100%", height:"100%"}}>
      <defs>
        <linearGradient id="gjf-fade-r" x1="0" y1="0" x2="1" y2="0">
          <stop offset="0%"   stopColor="#C6A45A" stopOpacity="0"/>
          <stop offset="40%"  stopColor="#C6A45A" stopOpacity=".55"/>
          <stop offset="100%" stopColor="#C6A45A" stopOpacity="0"/>
        </linearGradient>
        <linearGradient id="gjf-fade-l" x1="1" y1="0" x2="0" y2="0">
          <stop offset="0%"   stopColor="#1B2A4E" stopOpacity="0"/>
          <stop offset="50%"  stopColor="#1B2A4E" stopOpacity=".35"/>
          <stop offset="100%" stopColor="#1B2A4E" stopOpacity="0"/>
        </linearGradient>
      </defs>

      {/* Diagonal sightlines — converge from off-canvas, suggest forward motion */}
      <g className="gjf-hero-sightlines">
        <line x1="-100" y1="720" x2="1700" y2="40"   stroke="url(#gjf-fade-r)" strokeWidth="1"/>
        <line x1="-100" y1="640" x2="1700" y2="120"  stroke="url(#gjf-fade-r)" strokeWidth=".7" opacity=".6"/>
        <line x1="-100" y1="560" x2="1700" y2="200"  stroke="url(#gjf-fade-l)" strokeWidth=".5" opacity=".5"/>
      </g>

      {/* Long horizon — a single gold hairline that drifts laterally */}
      <g className="gjf-hero-horizon">
        <line x1="-200" y1="540" x2="1800" y2="540" stroke="#C6A45A" strokeWidth=".6" opacity=".55"/>
        <line x1="-200" y1="540" x2="1800" y2="540" stroke="#1B2A4E" strokeWidth=".4" strokeDasharray="2 14" opacity=".5"/>
      </g>

      {/* Tick markers along the horizon — small but moving (rise + fade) */}
      <g className="gjf-hero-ticks">
        {[120, 240, 360, 480, 600, 760, 900, 1040, 1180, 1320, 1460].map((x, i) => (
          <line key={i} x1={x} y1="540" x2={x} y2="528"
                stroke="#C6A45A" strokeWidth=".7" opacity=".7"
                style={{animationDelay: `${(i % 6) * 0.6}s`}}/>
        ))}
      </g>

      {/* Vertical surveyor's lines — quietly ascending */}
      <g className="gjf-hero-rises">
        <line x1="80"   y1="720" x2="80"   y2="540" stroke="#1B2A4E" strokeWidth=".5" opacity=".4"/>
        <line x1="1520" y1="720" x2="1520" y2="540" stroke="#1B2A4E" strokeWidth=".5" opacity=".4"/>
      </g>
    </svg>
  );
}

/* ──────────────────────────────────────────────────────────────────────
   BlueprintCourthouse — same architectural language, but reorchestrated:
   • lifts off the page (no frame)
   • added long sightlines that exit the artwork
   • subtle "construction line" rises (CSS animated) for living quality
   ────────────────────────────────────────────────────────────────────── */
function BlueprintCourthouse() {
  return (
    <svg viewBox="0 0 700 520" fill="none" preserveAspectRatio="xMidYMid meet">
      {/* Concentric standards rings — slow rotate */}
      <g className="gjf-hero-rings" style={{transformOrigin:"360px 260px"}}>
        <circle cx="360" cy="260" r="195" stroke="#C6A45A" strokeWidth=".6" opacity=".55"/>
        <circle cx="360" cy="260" r="230" stroke="#8AA3B5" strokeWidth=".5" opacity=".5" strokeDasharray="3 4"/>
        <circle cx="360" cy="260" r="155" stroke="#8AA3B5" strokeWidth=".5" opacity=".4"/>
      </g>

      {/* Long horizon that exits the artwork on both sides — visual continuity with the page */}
      <line x1="-40" y1="380" x2="740" y2="380" stroke="#071C2E" strokeWidth=".7" opacity=".7"/>
      <line x1="-40" y1="380" x2="740" y2="380" stroke="#C6A45A" strokeWidth=".4" strokeDasharray="2 6" opacity=".6"/>

      {/* Steps */}
      {[...Array(7)].map((_, i) => (
        <line key={i} x1={240 - i*4} y1={380 + i*4} x2={480 + i*4} y2={380 + i*4}
              stroke="#071C2E" strokeWidth=".7" opacity=".75"/>
      ))}

      {/* Stylobate */}
      <rect x="230" y="335" width="260" height="45" stroke="#071C2E" strokeWidth=".8" fill="none"/>

      {/* Columns */}
      {[260, 295, 330, 360, 390, 425, 455].map((x, i) => (
        <g key={i}>
          <line x1={x}   y1="200" x2={x}   y2="335" stroke="#071C2E" strokeWidth=".8"/>
          <line x1={x+8} y1="200" x2={x+8} y2="335" stroke="#071C2E" strokeWidth=".8"/>
          <rect x={x-1} y="328" width="11" height="7" stroke="#071C2E" strokeWidth=".7" fill="none"/>
          <rect x={x-1} y="200" width="11" height="6" stroke="#071C2E" strokeWidth=".7" fill="none"/>
        </g>
      ))}

      {/* Entablature + Pediment */}
      <rect x="225" y="184" width="270" height="18" stroke="#071C2E" strokeWidth=".8" fill="none"/>
      <path d="M225 184 L360 122 L495 184 Z" stroke="#071C2E" strokeWidth=".9" fill="none"/>
      <line x1="275" y1="184" x2="360" y2="143" stroke="#071C2E" strokeWidth=".5" opacity=".6"/>
      <line x1="360" y1="143" x2="445" y2="184" stroke="#071C2E" strokeWidth=".5" opacity=".6"/>

      {/* Construction-line rises — animated draw-on (kinetic but disciplined) */}
      <g className="gjf-hero-construction">
        <line x1="120" y1="520" x2="120" y2="200" stroke="#C6A45A" strokeWidth=".5" opacity=".5"/>
        <line x1="600" y1="520" x2="600" y2="200" stroke="#C6A45A" strokeWidth=".5" opacity=".5"/>
        <line x1="120" y1="200" x2="600" y2="200" stroke="#C6A45A" strokeWidth=".5" strokeDasharray="2 6" opacity=".5"/>
        <line x1="120" y1="122" x2="600" y2="122" stroke="#C6A45A" strokeWidth=".5" strokeDasharray="2 6" opacity=".4"/>
      </g>

      {/* Diagonal kinetic streaks — long straight lines that exit the frame */}
      <g className="gjf-hero-streaks">
        <line x1="-80"  y1="500" x2="780" y2="60"  stroke="#C6A45A" strokeWidth=".4" opacity=".5"/>
        <line x1="-80"  y1="430" x2="780" y2="-10" stroke="#C6A45A" strokeWidth=".3" opacity=".35"/>
        <line x1="-80"  y1="560" x2="780" y2="120" stroke="#1B2A4E" strokeWidth=".3" opacity=".4"/>
      </g>

      {/* Cardinal accent dots — pulsing softly */}
      <g className="gjf-hero-dots">
        <circle cx="360" cy="122" r="3.5" fill="#C6A45A"/>
        <circle cx="555" cy="260" r="3"   fill="#C6A45A"/>
        <circle cx="165" cy="260" r="3"   fill="#C6A45A"/>
        <circle cx="360" cy="450" r="3"   fill="#C6A45A"/>
      </g>

      {/* Annotation marks — exiting the artwork */}
      <line x1="555" y1="122" x2="640" y2="92" stroke="#C6A45A" strokeWidth=".5" opacity=".6"/>
      <circle cx="640" cy="92" r="6" stroke="#C6A45A" strokeWidth=".6" fill="none" opacity=".7"/>
      <line x1="165" y1="450" x2="80" y2="478" stroke="#C6A45A" strokeWidth=".5" opacity=".6"/>
      <circle cx="80" cy="478" r="6" stroke="#C6A45A" strokeWidth=".6" fill="none" opacity=".7"/>
    </svg>
  );
}
window.GJF_Hero = Hero;
