// Hero section — pixel-faithful to the Canva mock
// I-beam text cursor: vertical bar + small horizontal serifs, sits on top of fill
function Bracket({ color = "#0A0A0A", side }) {
  return (
    <svg viewBox="0 0 14 80" preserveAspectRatio="none"
    style={{
      position: "absolute",
      top: "-6%", height: "112%",
      [side]: "-0.12em",
      width: "0.24em",
      pointerEvents: "none"
    }}>
      <rect x="6" y="4" width="2" height="72" fill={color} />
      <rect x="0" y="2" width="14" height="2.5" fill={color} />
      <rect x="0" y="75.5" width="14" height="2.5" fill={color} />
    </svg>);

}

// Highlighted phrase: colored fill with I-beam markers ON TOP at each end
function HiBox({ children, bg, color = "#fff", italic = false }) {
  return (
    <span data-hibox={bg} style={{
        position: "relative",
        display: "inline-block",
        lineHeight: 1,
        whiteSpace: "nowrap",
        background: bg,
        color,
        fontStyle: italic ? "italic" : "normal",
        margin: "0 0.18em",
        padding: "3.52px 19.36px 10px"
      }}>
      <Bracket side="left" />
      {children}
      <Bracket side="right" />
    </span>);

}

/* 3D-ish blob (puffy plus / star) drawn as SVG so we don't need raster assets */
function Blob3D({ color, accent, size = 90, style, className }) {
  return (
    <svg viewBox="0 0 200 200" width={size} height={size} style={style} className={className}>
      <defs>
        <radialGradient id={"g-" + color.replace("#", "")} cx="35%" cy="30%" r="80%">
          <stop offset="0%" stopColor="#fff" stopOpacity="0.9" />
          <stop offset="35%" stopColor={color} />
          <stop offset="100%" stopColor={accent} />
        </radialGradient>
      </defs>
      {/* puffy 4-petal cross */}
      <g fill={`url(#g-${color.replace("#", "")})`}>
        <ellipse cx="100" cy="55" rx="38" ry="50" />
        <ellipse cx="100" cy="145" rx="38" ry="50" />
        <ellipse cx="55" cy="100" rx="50" ry="38" />
        <ellipse cx="145" cy="100" rx="50" ry="38" />
        <circle cx="100" cy="100" r="44" />
      </g>
      {/* highlight */}
      <ellipse cx="80" cy="80" rx="14" ry="10" fill="rgba(255,255,255,0.55)" />
    </svg>);

}

/* Polaroid frame: white border 8px on sides/top, 28px bottom, light shadow,
   tiny radius, fixed rotation per instance. Image keeps natural aspect:
   fixed height (180px), width auto. */
function PolaroidFrame({ src, rotate = 0 }) {
  return (
    <figure style={{
      background: "#fff",
      padding: "8px 8px 28px 8px",
      boxSizing: "content-box",
      borderRadius: 4,
      boxShadow: "0 1px 2px rgba(0,0,0,0.06), 0 8px 18px -8px rgba(0,0,0,0.22)",
      transform: `rotate(${rotate}deg)`,
      margin: 0,
      flex: "0 0 auto"
    }}>
      <img src={src} alt=""
        style={{
          height: 180,
          width: "auto",
          display: "block",
          userSelect: "none",
          pointerEvents: "none"
        }}
        draggable={false}
        loading="lazy" />
    </figure>);

}

/* Three independent horizontal marquee rows, each looping right → left.
   Asymmetric image distribution between rows; per-image fixed rotation.
   Hover anywhere on the wrapper pauses all three tracks together. */
const MARQUEE_ROW_1 = [
"assets/media/marquee/m1.webp",
"assets/techy/marquee/t3.webp",
"assets/media/marquee/m5.webp",
"assets/techy/marquee/t11.webp",
"assets/media/marquee/m8.webp",
"assets/media/marquee/m13.webp",
"assets/techy/marquee/t5.webp",
"assets/media/marquee/m11.webp",
"assets/techy/marquee/t14.webp"];


const MARQUEE_ROW_2 = [
"assets/techy/marquee/t1.webp",
"assets/media/marquee/m2.webp",
"assets/techy/marquee/t9.webp",
"assets/media/marquee/m4.webp",
"assets/techy/marquee/t6.webp",
"assets/media/marquee/m14.webp",
"assets/techy/marquee/t7.webp",
"assets/media/marquee/m9.webp"];


const MARQUEE_ROW_3 = [
"assets/media/marquee/m3.webp",
"assets/techy/marquee/t2.webp",
"assets/techy/marquee/t13.webp",
"assets/media/marquee/m6.webp",
"assets/techy/marquee/t10.webp",
"assets/media/marquee/m12.webp",
"assets/techy/marquee/t8.webp",
"assets/techy/marquee/t4.webp",
"assets/techy/marquee/t12.webp"];


// Per-image fixed rotations between -5° and +5°, deterministic per row.
const ROTS_1 = [-3, 2, -4, 1, 4, -2, 3, -1, 5];
const ROTS_2 = [3, -2, 4, -1, 2, -5, 1, -3];
const ROTS_3 = [-4, 3, -1, 5, -3, 2, -2, 4, -5];

function MarqueeRow({ images, rots, duration, className }) {
  // Duplicate the set twice; animating to translateX(-50%) lands on the
  // exact same pixel as 0 → seamless infinite loop with variable widths.
  const doubled = [...images, ...images];
  return (
    <div className={`hmq-row ${className}`}>
      <div className="hmq-track" style={{ animationDuration: `${duration}s` }}>
        {doubled.map((src, i) =>
        <PolaroidFrame
          key={i}
          src={src}
          rotate={rots[i % rots.length]} />

        )}
      </div>
    </div>);

}

function PolaroidMarquee() {
  return (
    <div className="hmq-wrap">
      <MarqueeRow images={MARQUEE_ROW_1} rots={ROTS_1} duration={60} className="hmq-row-1" />
      <MarqueeRow images={MARQUEE_ROW_2} rots={ROTS_2} duration={80} className="hmq-row-2" />
      <MarqueeRow images={MARQUEE_ROW_3} rots={ROTS_3} duration={50} className="hmq-row-3" />
    </div>);

}

/* ─────────────────────────────────────────────────────────────────────────
   HERO VISUAL — three swappable variants that sit between the title and the
   "Siamo un media digitale" subtitle. Selectable via Tweaks (heroVariant).
   ───────────────────────────────────────────────────────────────────────── */

/* Variant B: BRAND TRIO
   2 oversized polaroid-style cards for Economico / Techy, each with
   the 3D brand artwork + a colored glow puddle underneath and a handwritten
   caption. Lifts on hover. */
const BRAND_TRIO = [
  { name: "Economico", art: "assets/media/card-economico.webp", glow: "assets/media/glow-yellow.webp", tint: "#F0B83A", rotate: -5 },
  { name: "Techy",     art: "assets/media/card-techy.webp",     glow: "assets/media/glow-pink.webp",   tint: "#E94B7A", rotate: 3  }
];

function BrandCard({ name, art, glow, tint, rotate }) {
  const [hovered, setHovered] = React.useState(false);
  return (
    <figure
      onMouseEnter={() => setHovered(true)}
      onMouseLeave={() => setHovered(false)}
      style={{
        position: "relative",
        flex: "0 1 280px",
        maxWidth: 320,
        margin: 0,
        background: "#fff",
        padding: "14px 14px 36px",
        borderRadius: 6,
        boxShadow: hovered
          ? "0 2px 4px rgba(0,0,0,0.08), 0 30px 50px -18px rgba(0,0,0,0.28)"
          : "0 1px 2px rgba(0,0,0,0.06), 0 14px 28px -12px rgba(0,0,0,0.22)",
        transform: `rotate(${rotate}deg) translateY(${hovered ? "-8px" : "0"})`,
        transition: "transform 320ms cubic-bezier(.2,.7,.2,1), box-shadow 320ms",
        zIndex: hovered ? 3 : 1
      }}>
      {/* glow puddle behind the artwork */}
      <div style={{
        position: "absolute",
        inset: "10% 8% 22% 8%",
        background: `radial-gradient(60% 60% at 50% 60%, ${tint}88, ${tint}00 70%)`,
        filter: "blur(14px)",
        zIndex: 0,
        pointerEvents: "none"
      }} />
      <div style={{
        position: "relative",
        aspectRatio: "1 / 1",
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        zIndex: 1
      }}>
        <img src={art} alt={name}
          draggable={false}
          style={{
            width: "100%",
            height: "100%",
            objectFit: "contain",
            filter: hovered ? `drop-shadow(0 16px 22px ${tint}55)` : `drop-shadow(0 10px 16px ${tint}33)`,
            transition: "filter 320ms"
          }} />
      </div>
      <figcaption style={{
        position: "absolute",
        left: 0, right: 0, bottom: 8,
        textAlign: "center",
        fontFamily: "'Caveat', 'Bradley Hand', cursive",
        fontSize: 22,
        color: "#222",
        letterSpacing: "0.01em"
      }}>{name}</figcaption>
    </figure>);

}

function BrandTrio() {
  return (
    <div style={{
      display: "flex",
      justifyContent: "center",
      alignItems: "center",
      gap: "clamp(10px, 2vw, 28px)",
      flexWrap: "wrap",
      padding: "clamp(16px, 3vw, 32px) clamp(8px, 4vw, 32px) 8px"
    }}>
      {BRAND_TRIO.map((b) => <BrandCard key={b.name} {...b} />)}
    </div>);

}

/* Variant C: STICKER TABLEAU
   Static curated arrangement of ~9 polaroids + a few floating 3D blobs.
   Items are absolutely-positioned within a fixed-height stage; subtle
   per-item hover lift. */
const TABLEAU = [
  { src: "assets/media/marquee/m1.webp",   x: "4%",  y: "38%", rot: -8,  h: 150, z: 2 },
  { src: "assets/techy/marquee/t3.webp",   x: "14%", y: "8%",  rot: 4,   h: 165, z: 3 },
  { src: "assets/media/marquee/m5.webp",   x: "26%", y: "52%", rot: -3,  h: 175, z: 4 },
  { src: "assets/techy/marquee/t11.webp",  x: "36%", y: "14%", rot: 6,   h: 160, z: 3 },
  { src: "assets/media/marquee/m8.webp",   x: "48%", y: "48%", rot: -5,  h: 180, z: 5 },
  { src: "assets/techy/marquee/t5.webp",   x: "60%", y: "6%",  rot: 3,   h: 165, z: 3 },
  { src: "assets/media/marquee/m13.webp",  x: "72%", y: "40%", rot: -2,  h: 170, z: 4 },
  { src: "assets/techy/marquee/t14.webp",  x: "82%", y: "10%", rot: 7,   h: 155, z: 2 },
  { src: "assets/media/marquee/m11.webp",  x: "88%", y: "54%", rot: -6,  h: 145, z: 2 }
];

function TableauItem({ src, x, y, rot, h, z }) {
  const [hov, setHov] = React.useState(false);
  return (
    <figure
      onMouseEnter={() => setHov(true)}
      onMouseLeave={() => setHov(false)}
      style={{
        position: "absolute",
        left: x, top: y,
        transform: `translate(-50%, 0) rotate(${rot}deg) ${hov ? "scale(1.06)" : "scale(1)"}`,
        transformOrigin: "center center",
        transition: "transform 280ms cubic-bezier(.2,.7,.2,1), box-shadow 280ms",
        zIndex: hov ? 20 : z,
        margin: 0,
        background: "#fff",
        padding: "6px 6px 22px",
        borderRadius: 3,
        boxShadow: hov
          ? "0 3px 6px rgba(0,0,0,0.1), 0 24px 36px -14px rgba(0,0,0,0.32)"
          : "0 1px 2px rgba(0,0,0,0.06), 0 8px 18px -8px rgba(0,0,0,0.22)"
      }}>
      <img src={src} alt=""
        draggable={false}
        loading="lazy"
        style={{ height: h, width: "auto", display: "block", userSelect: "none", pointerEvents: "none" }} />
    </figure>);

}

function PolaroidTableau() {
  return (
    <div style={{
      position: "relative",
      width: "100%",
      maxWidth: 1200,
      marginInline: "auto",
      height: "clamp(320px, 36vw, 420px)",
      padding: "0 clamp(8px, 2vw, 24px)"
    }}>
      {/* floating accent blobs woven into the composition */}
      <Blob3D color="#FFD17A" accent="#E0A93C" size={70}
        style={{ position: "absolute", left: "22%", top: "-6%", zIndex: 10,
          filter: "drop-shadow(0 10px 18px rgba(220,170,60,0.35))" }} />
      <Blob3D color="#FFA8C8" accent="#E94B7A" size={56}
        style={{ position: "absolute", right: "30%", bottom: "-2%", zIndex: 10,
          filter: "drop-shadow(0 10px 18px rgba(233,75,122,0.35))" }} />
      <Blob3D color="#FFB89A" accent="#E5552C" size={60}
        style={{ position: "absolute", left: "54%", top: "-4%", zIndex: 10,
          filter: "drop-shadow(0 10px 18px rgba(229,85,44,0.35))" }} />
      {TABLEAU.map((it, i) => <TableauItem key={i} {...it} />)}
    </div>);

}

/* Switcher */
function HeroVisual({ variant }) {
  if (variant === "trio")    return <BrandTrio />;
  if (variant === "tableau") return <PolaroidTableau />;
  return <PolaroidMarquee />;
}

/* ─────────────────────────────────────────────────────────────────────────
   HERO FAN — horizontal row of identically-sized cards rotated around Y
   in 3D perspective to form a smile arc. Outer cards turn inward (face
   the centre); the center card faces straight at the viewer. Outer cards
   bleed past the viewport edges. Subtle directional shading enhances 3D.
   ───────────────────────────────────────────────────────────────────────── */
const FAN_SOURCES = [
  "assets/media/marquee/m1.webp",
  "assets/techy/marquee/t3.webp",
  "assets/media/marquee/m5.webp",
  "assets/techy/marquee/t11.webp",
  "assets/media/marquee/m8.webp",
  "assets/techy/marquee/t14.webp",
  "assets/media/marquee/m13.webp"
];

function FanCard({ src, t }) {
  // Discrete steps based on |t|: center=0, 2nd-from-center≈0.33, 3rd≈0.67, edge=1
  const a = Math.abs(t);
  // Rotation magnitude
  const rot = a < 0.1 ? 0 : a < 0.5 ? 28 : a < 0.9 ? 45 : 60;
  // Sign: left cards (t<0) rotate one way to face centre, right cards the other
  const angle = -Math.sign(t) * rot;
  // Slight scale-down toward edges so outer cards read as smaller/farther
  const scale = a < 0.1 ? 1 : a < 0.5 ? 0.97 : a < 0.9 ? 0.93 : 0.88;
  // Brightness: centre full, laterals dimmed, extremes more
  const brightness = a < 0.1 ? 1 : a < 0.9 ? 0.85 : 0.7;
  const [hov, setHov] = React.useState(false);
  const transform = hov
    ? `rotateY(0deg) translateZ(60px) scale(1.05)`
    : `rotateY(${angle}deg) scale(${scale})`;
  return (
    <div
      onMouseEnter={() => setHov(true)}
      onMouseLeave={() => setHov(false)}
      style={{
        position: "relative",
        width: "clamp(180px, 16vw, 240px)",
        aspectRatio: "4 / 5",
        marginLeft: "clamp(-44px, -3.4vw, -24px)",
        transform,
        transformOrigin: "center center",
        transition: "transform 420ms cubic-bezier(.2,.7,.2,1), filter 420ms",
        borderRadius: 16,
        overflow: "hidden",
        background: "#111",
        filter: hov ? "brightness(1)" : `brightness(${brightness})`,
        zIndex: hov ? 50 : 10 - Math.round(a * 5),
        cursor: "pointer",
        flex: "0 0 auto"
      }}>
      <img src={src} alt="" draggable={false}
        style={{
          width: "100%", height: "100%", objectFit: "cover", display: "block"
        }} />
    </div>);

}

function HeroFanCards() {
  const n = FAN_SOURCES.length;
  const mid = (n - 1) / 2;
  return (
    <div style={{
      position: "relative",
      width: "100vw",
      marginLeft: "calc(50% - 50vw)",
      height: "clamp(300px, 28vw, 380px)",
      marginTop: "clamp(8px, 2vw, 24px)",
      perspective: "1200px",
      display: "flex",
      justifyContent: "center",
      alignItems: "center",
      overflow: "hidden"
    }}>
      <div style={{
        display: "flex",
        justifyContent: "center",
        alignItems: "center",
        transformStyle: "preserve-3d"
      }}>
        {FAN_SOURCES.map((src, i) => {
          const t = (i - mid) / mid;
          return <FanCard key={i} src={src} t={t} />;
        })}
      </div>
    </div>);

}

/* Painted scenes — illustrative, no external assets */
function ScenePink() {
  return (
    <div style={{ position: "absolute", inset: 0,
      background: "radial-gradient(70% 50% at 50% 35%, #FFD8E8 0%, #E5B5D6 35%, #6B2A4A 100%)" }}>
      <div style={{ position: "absolute", inset: "30% 10% 10%",
        background: "radial-gradient(60% 60% at 50% 0%, rgba(255,200,220,0.9), transparent 70%)",
        filter: "blur(6px)" }} />
      <svg viewBox="0 0 100 80" preserveAspectRatio="none" style={{ position: "absolute", inset: 0, width: "100%", height: "100%" }}>
        {Array.from({ length: 80 }).map((_, i) =>
        <circle key={i} cx={Math.random() * 100} cy={20 + Math.random() * 60}
        r={0.3 + Math.random() * 0.7} fill={["#fff", "#FFD8E8", "#FFC0DA"][i % 3]} opacity={0.4 + Math.random() * 0.5} />
        )}
      </svg>
    </div>);

}
function SceneCube() {
  return (
    <div style={{ position: "absolute", inset: 0, background: "#0A0F1F" }}>
      <div style={{ position: "absolute", inset: 0,
        background: "radial-gradient(40% 30% at 50% 65%, #FF7A3C 0%, transparent 60%)" }} />
      {/* cube */}
      <div style={{
        position: "absolute", left: "50%", top: "42%", width: "38%", aspectRatio: "1/1",
        transform: "translate(-50%,-50%) rotate(28deg) skew(-8deg, 4deg)",
        background: "linear-gradient(135deg, #6BB8FF 0%, #2A5BFF 45%, #0A1F66 100%)",
        boxShadow: "0 0 40px rgba(80,140,255,0.55), inset 0 0 30px rgba(255,255,255,0.4)",
        border: "1px solid rgba(255,255,255,0.35)"
      }} />
      <div style={{ position: "absolute", left: 0, right: 0, bottom: 0, height: "30%",
        background: "linear-gradient(0deg, rgba(0,0,0,0.6), transparent)" }} />
    </div>);

}
function SceneCity() {
  // top-down city of cube buildings
  return (
    <div style={{ position: "absolute", inset: 0,
      background: "linear-gradient(180deg, #F1ECDF 0%, #E5DBC7 100%)" }}>
      <div style={{ position: "absolute", inset: 0, display: "grid",
        gridTemplateColumns: "repeat(8, 1fr)", gridTemplateRows: "repeat(6, 1fr)", gap: 2, padding: 6 }}>
        {Array.from({ length: 48 }).map((_, i) => {
          const colors = ["#3F4B2E", "#6B7B4A", "#D7843E", "#E5A86A", "#A8623A", "#1E2418", "#8FA46C", "#C8842D"];
          const c = colors[i % colors.length];
          const tall = Math.random() > 0.6;
          return (
            <div key={i} style={{
              background: c,
              boxShadow: tall ? `inset -3px -6px 0 rgba(0,0,0,0.25), 2px 4px 0 rgba(0,0,0,0.15)` :
              `inset -2px -3px 0 rgba(0,0,0,0.2)`,
              transform: `scale(${0.8 + Math.random() * 0.2})`
            }} />);

        })}
      </div>
      <div style={{ position: "absolute", inset: 0,
        background: "radial-gradient(120% 120% at 50% 50%, transparent 40%, rgba(0,0,0,0.25) 100%)" }} />
    </div>);

}
function ScenePhone() {
  return (
    <div style={{ position: "absolute", inset: 0,
      background: "linear-gradient(135deg, #C24A2C 0%, #6B1A0E 100%)" }}>
      {/* phone slab */}
      <div style={{
        position: "absolute", right: "-8%", bottom: "-10%",
        width: "75%", aspectRatio: "9/19",
        background: "linear-gradient(135deg, #1A1A1A 0%, #0A0A0A 100%)",
        borderRadius: 24, transform: "rotate(-22deg)",
        border: "3px solid #2A2A2A",
        boxShadow: "-12px -8px 30px rgba(255,80,40,0.4)"
      }}>
        <div style={{ position: "absolute", left: "50%", top: 14, width: "38%", height: 6, transform: "translateX(-50%)", background: "#000", borderRadius: 3 }} />
      </div>
      {/* light streaks */}
      <svg viewBox="0 0 100 80" preserveAspectRatio="none" style={{ position: "absolute", inset: 0, width: "100%", height: "100%" }}>
        {[
        ["#FF7A2C", 8, 60, 70, 30],
        ["#5BD6FF", 4, 70, 60, 18],
        ["#FF3D6E", 14, 50, 62, 36]].
        map(([c, x1, y1, x2, y2], i) =>
        <path key={i} d={`M${x1} ${y1} Q ${(x1 + x2) / 2} ${y1 - 15}, ${x2} ${y2}`}
        stroke={c} strokeWidth="1.4" fill="none" opacity="0.85"
        style={{ filter: "drop-shadow(0 0 2px " + c + ")" }} />
        )}
      </svg>
    </div>);

}

function HeroSection({ navigate }) {
  return (
    <section style={{
      position: "relative",
      paddingTop: "clamp(64px, 9vw, 130px)",
      paddingBottom: "clamp(56px, 7vw, 100px)",
      background: "#f6f6f6",
      overflow: "hidden"
    }}>
      {/* Floating 3D blobs */}
      <Blob3D color="#A8B6F5" accent="#5C72D9" size={130} className="hero-blob hero-blob-1"
      style={{ position: "absolute", top: "7%", left: "12%", filter: "drop-shadow(0 14px 24px rgba(80,90,180,0.3))" }} />
      <Blob3D color="#FFB89A" accent="#E07A4E" size={150} className="hero-blob hero-blob-2"
      style={{ position: "absolute", top: "18%", right: "6%", filter: "drop-shadow(0 14px 24px rgba(220,120,80,0.3))" }} />
      <Blob3D color="#A6E3D0" accent="#5BAE94" size={95} className="hero-blob hero-blob-3"
      style={{ position: "absolute", top: "56%", left: "3%", filter: "drop-shadow(0 14px 24px rgba(80,180,150,0.3))" }} />

      <div className="container" style={{ position: "relative", zIndex: 2, textAlign: "center" }}>
        {/* Title */}
        <h1 className="hero-title" style={{
          fontFamily: "var(--font-display)",

          fontSize: "clamp(38px, 6.4vw, 88px)",
          lineHeight: 1.08,
          letterSpacing: "-0.025em",

          textWrap: "balance",
          maxWidth: 1100,
          marginInline: "auto", margin: "0px 14px", fontWeight: "800"
        }}>
          Creiamo contenuti che la gente{" "}
          <HiBox bg="#E94B2C">sceglie di guardare.</HiBox>
          <br />
          Anche per il tuo brand.
        </h1>

        {/* Subtitle two-liner */}
        <div style={{
          marginTop: "clamp(60px, 8vw, 110px)",
          display: "flex", flexDirection: "column", alignItems: "center",
          gap: "clamp(14px, 1.6vw, 22px)"
        }}>
          <div style={{
            fontFamily: "var(--font-display)", fontWeight: 700,
            fontSize: "clamp(22px, 2.6vw, 36px)", letterSpacing: "-0.02em",
            display: "inline-flex", alignItems: "center", gap: "0.35em", lineHeight: 1.1
          }}>
            Siamo un <HiBox bg="#3FB28E" italic>media digitale.</HiBox>
          </div>
          <div style={{
            fontFamily: "var(--font-display)", fontWeight: 700,
            fontSize: "clamp(22px, 2.6vw, 36px)", letterSpacing: "-0.02em",
            display: "inline-flex", alignItems: "center", gap: "0.35em", lineHeight: 1.1
          }}>
            Ma anche un <HiBox bg="#5C6CE0" italic>content studio.</HiBox>
          </div>
          <p style={{
            marginTop: 14,
            fontSize: "clamp(13px, 1vw, 15px)",
            fontWeight: 600, color: "#0A0A0A"
          }}>
            Perché fare contenuti è il nostro pane quotidiano.
          </p>
        </div>

        {/* CTA buttons (kept from previous build) */}
        <div style={{ display: "flex", gap: 14, marginTop: 40, flexWrap: "wrap", justifyContent: "center" }}>
          <a
            className="btn"
            href="#media"
            onClick={(e) => { e.preventDefault(); navigate("media"); }}
            style={{ borderColor: "rgb(18, 62, 48)", borderRadius: "999px 999px 999px 0px", backgroundColor: "#fff", color: "#0A0A0A", transition: "background 200ms, color 200ms, border-color 200ms" }}
            onMouseEnter={(e) => { e.currentTarget.style.background = "#3FB28E"; e.currentTarget.style.color = "#fff"; e.currentTarget.style.borderColor = "#3FB28E"; }}
            onMouseLeave={(e) => { e.currentTarget.style.background = "#fff"; e.currentTarget.style.color = "#0A0A0A"; e.currentTarget.style.borderColor = "rgb(18, 62, 48)"; }}>
            Scopri i nostri Media <ArrowRight />
          </a>
          <a
            className="btn btn-ghost"
            href="#agency"
            onClick={(e) => { e.preventDefault(); navigate("agency"); }}
            style={{ borderRadius: "999px 999px 999px 0px", backgroundColor: "#fff", color: "#0A0A0A", transition: "background 200ms, color 200ms, border-color 200ms" }}
            onMouseEnter={(e) => { e.currentTarget.style.background = "#3B5BFF"; e.currentTarget.style.color = "#fff"; e.currentTarget.style.borderColor = "#3B5BFF"; }}
            onMouseLeave={(e) => { e.currentTarget.style.background = "#fff"; e.currentTarget.style.color = "#0A0A0A"; e.currentTarget.style.borderColor = ""; }}>
            Scopri la nostra Agency <ArrowRight />
          </a>
        </div>
      </div>

      <style>{`
        /* Horizontal polaroid marquee — 3 rows.
           Each .hmq-track contains the image set duplicated 2x; animating to
           translateX(-50%) lands the second half exactly where the first one
           started — seamless infinite loop regardless of variable widths. */
        .hmq-wrap {
          position: relative;
          width: 100%;
          overflow: hidden;
          display: flex;
          flex-direction: column;
          gap: 8px;
          /* Horizontal fade: white → transparent on first/last 80px of each row */
          -webkit-mask-image: linear-gradient(
            to right,
            transparent 0,
            #000 80px,
            #000 calc(100% - 80px),
            transparent 100%
          );
                  mask-image: linear-gradient(
            to right,
            transparent 0,
            #000 80px,
            #000 calc(100% - 80px),
            transparent 100%
          );
        }
        .hmq-row {
          position: relative;
          width: 100%;
          overflow: hidden;
          /* Tall enough for the 216px polaroid + rotation slack */
          height: 250px;
          display: flex;
          align-items: center;
        }
        .hmq-track {
          display: flex;
          flex-wrap: nowrap;
          gap: 12px;
          width: max-content;
          will-change: transform;
          animation-name: hmq-scroll;
          animation-timing-function: linear;
          animation-iteration-count: infinite;
          padding: 0 6px; /* breathing room so first/last polaroids are not flush with fade */
        }
        @keyframes hmq-scroll {
          from { transform: translate3d(0, 0, 0); }
          to   { transform: translate3d(-50%, 0, 0); }
        }
        /* Hover anywhere on the wrapper pauses all three tracks together */
        .hmq-wrap:hover .hmq-track { animation-play-state: paused; }
        @media (prefers-reduced-motion: reduce) {
          .hmq-track { animation: none !important; }
        }
        /* MOBILE: porta i blob decorativi ai bordi (parzialmente fuori) e piu' piccoli,
           cosi' restano "ai lati" e non finiscono dietro il testo dell'hero. */
        @media (max-width: 640px) {
          .hero-blob-1 { top: 0% !important; left: -10% !important; width: 64px !important; height: 64px !important; }
          .hero-blob-2 { top: 4% !important; right: -12% !important; width: 78px !important; height: 78px !important; }
          .hero-blob-3 { top: 58% !important; left: -9% !important; width: 56px !important; height: 56px !important; }
          /* piu' larghezza al titolo + box highlight piu' compatto: cosi' il rettangolo ci sta e si centra */
          .hero-title { margin-left: 0 !important; margin-right: 0 !important; }
          .hero-title [data-hibox] { padding-left: 12px !important; padding-right: 12px !important; }
        }
      `}</style>
    </section>);

}

window.HeroSection = HeroSection;