import type { Metadata } from 'next';
import Image from 'next/image';
import Link from 'next/link';
import { notFound } from 'next/navigation';
import Bot from 'lucide-react/dist/esm/icons/bot';
import Truck from 'lucide-react/dist/esm/icons/truck';
import Sparkles from 'lucide-react/dist/esm/icons/sparkles';
import CircleUserRound from 'lucide-react/dist/esm/icons/circle-user-round';
import Cog from 'lucide-react/dist/esm/icons/cog';
import Compass from 'lucide-react/dist/esm/icons/compass';
import Cpu from 'lucide-react/dist/esm/icons/cpu';
import ScanLine from 'lucide-react/dist/esm/icons/scan-line';
import Search from 'lucide-react/dist/esm/icons/search';
import Layers from 'lucide-react/dist/esm/icons/layers';
import Bell from 'lucide-react/dist/esm/icons/bell';
import UtensilsCrossed from 'lucide-react/dist/esm/icons/utensils-crossed';
import ChevronRight from 'lucide-react/dist/esm/icons/chevron-right';
import ArrowRight from 'lucide-react/dist/esm/icons/arrow-right';
import Check from 'lucide-react/dist/esm/icons/check';
import MapPin from 'lucide-react/dist/esm/icons/map-pin';
import Headphones from 'lucide-react/dist/esm/icons/headphones';
import PlayCircle from 'lucide-react/dist/esm/icons/play-circle';
import { Navbar } from '@/components/Navbar';
import { FooterAndContact } from '@/components/FooterAndContact';
import { MotionSection } from '@/components/ui/MotionSection';
import { CTAButton } from '@/components/ui/CTAButton';
import { INDUSTRIES, getIndustryBySlug } from '@/data/industries';
import { INDUSTRY_PAGES, type IndustrySolution } from '@/data/industry-pages';

type Params = { slug: string };

const ICONS: Record<IndustrySolution['iconKey'], React.ComponentType<{ size?: number; strokeWidth?: number }>> = {
  service: Bell,
  delivery: Truck,
  cleaning: Sparkles,
  humanoid: CircleUserRound,
  quadruped: Bot,
  sensor: ScanLine,
  inspect: Search,
  platform: Cpu,
  guide: Compass,
  queue: Layers,
  host: CircleUserRound,
  tray: UtensilsCrossed,
};

export function generateStaticParams() {
  return INDUSTRIES.map((i) => ({ slug: i.slug }));
}

export async function generateMetadata({ params }: { params: Promise<Params> }): Promise<Metadata> {
  const { slug } = await params;
  const industry = getIndustryBySlug(slug);
  if (!industry) return {};
  const content = INDUSTRY_PAGES[industry.id];
  if (!content) return {};
  const url = `/industries/${industry.slug}/`;
  return {
    title: content.seoTitle,
    description: content.seoDescription,
    alternates: { canonical: url },
    openGraph: { title: content.seoTitle, description: content.seoDescription, url, type: 'website' },
    twitter: { card: 'summary_large_image', title: content.seoTitle, description: content.seoDescription },
  };
}

const TRUST_DEFAULT = [
  { icon: MapPin, label: 'UAE-ready', sub: 'Deployment across the UAE' },
  { icon: Headphones, label: 'Dubai support', sub: 'Local robotics team' },
  { icon: Bot, label: 'Robot families', sub: 'Pudu + Unitree' },
  { icon: PlayCircle, label: 'Demo available', sub: 'Showroom or on-site' },
];

export default async function IndustryDetailPage({ params }: { params: Promise<Params> }) {
  const { slug } = await params;
  const industry = getIndustryBySlug(slug);
  if (!industry) notFound();
  const content = INDUSTRY_PAGES[industry.id];
  if (!content) notFound();

  const accent = industry.accent;
  const ctaTitle = content.ctaTitle ?? 'Find the right robot for your venue.';
  const ctaBody =
    content.ctaBody ??
    'Tell us about your space, workflow, and goals. Our Dubai team will recommend the best-fit robotics solution and arrange a live demo or quotation.';

  return (
    <>
      <Navbar />

      <main className="ip-main">
        <div className="container-wide ip-stack">
          {/* BREADCRUMBS */}
          <nav aria-label="Breadcrumb" className="ip-breadcrumbs">
            <ol>
              <li><Link href="/">Home</Link></li>
              <li aria-hidden><ChevronRight size={12} /></li>
              <li><Link href="/industries/">Industries</Link></li>
              <li aria-hidden><ChevronRight size={12} /></li>
              <li aria-current="page">{industry.name}</li>
            </ol>
          </nav>

          {/* HERO */}
          <MotionSection>
            <section className="ip-hero" style={{ ['--acc' as string]: accent }}>
              <div className="ip-hero-glow" aria-hidden />
              <div className="ip-hero-glow-b" aria-hidden />
              <div className="ip-hero-grid" aria-hidden />

              <div className="ip-hero-inner">
                <div className="ip-hero-copy">
                  <span className="eyebrow ip-hero-eyebrow">
                    <span className="ip-dot" />
                    Industry Solution · {industry.name}
                  </span>
                  <h1 className="ip-hero-title">
                    <span className="text-gradient">{content.heroTitle}</span>
                  </h1>
                  <p className="ip-hero-sub">{content.heroSubtitle}</p>

                  {content.heroTags && content.heroTags.length > 0 && (
                    <ul className="ip-hero-tags" role="list">
                      {content.heroTags.map((t) => (
                        <li key={t} className="ip-hero-tag">{t}</li>
                      ))}
                    </ul>
                  )}

                  <div className="ip-hero-actions">
                    <CTAButton href="/book-demo/" variant="primary" size="lg" arrow="up-right">
                      Book a Demo
                    </CTAButton>
                    <CTAButton href="/contact/" variant="secondary" size="lg" arrow="right">
                      Talk to Our Team
                    </CTAButton>
                  </div>
                </div>

                {/* Right visual: industry hero image */}
                <aside className="ip-hero-visual">
                  <Image
                    src={industry.image}
                    alt={industry.imageAlt}
                    fill
                    sizes="(max-width: 920px) 100vw, 520px"
                    className="ip-hero-visual-img"
                    style={{ objectFit: 'cover', objectPosition: 'center' }}
                    priority
                  />
                  <span className="ip-hero-visual-overlay" aria-hidden />
                  <div className="ip-hero-visual-meta">
                    <span className="ip-mono ip-live">
                      <span className="ip-live-dot" />Available · UAE
                    </span>
                    <span className="ip-mono">Dubai Showroom · Live Demo</span>
                  </div>
                </aside>
              </div>
            </section>
          </MotionSection>

          {/* TRUST ROW */}
          <MotionSection>
            <ul className="ip-trust" role="list">
              {TRUST_DEFAULT.map((t) => {
                const Icon = t.icon;
                return (
                  <li key={t.label} className="ip-trust-card">
                    <span className="ip-trust-icon"><Icon size={14} strokeWidth={1.7} /></span>
                    <div>
                      <span className="ip-trust-label">{t.label}</span>
                      <span className="ip-trust-sub">{t.sub}</span>
                    </div>
                  </li>
                );
              })}
            </ul>
          </MotionSection>

          {/* PROOF POINTS */}
          {content.proofPoints && content.proofPoints.length > 0 && (
            <MotionSection>
              <ul className="ip-proof" role="list" style={{ ['--acc' as string]: accent }}>
                {content.proofPoints.map((p) => (
                  <li key={p.label} className="ip-proof-card">
                    <span className="ip-proof-value">{p.value}</span>
                    <span className="ip-proof-label">{p.label}</span>
                  </li>
                ))}
              </ul>
            </MotionSection>
          )}

          {/* PROBLEM */}
          <MotionSection>
            <section className="ip-block">
              <header className="ip-block-head">
                <span className="eyebrow">The challenge</span>
                <h2 className="ip-block-title">Where today’s operations break down.</h2>
              </header>
              <ul className="ip-problems" role="list">
                {content.problemPoints.map((p, i) => (
                  <li key={i} className="ip-problem">
                    <span className="ip-problem-num">{String(i + 1).padStart(2, '0')}</span>
                    <p>{p}</p>
                  </li>
                ))}
              </ul>
            </section>
          </MotionSection>

          {/* SOLUTIONS */}
          <MotionSection>
            <section className="ip-block" style={{ ['--acc' as string]: accent }}>
              <header className="ip-block-head">
                <span className="eyebrow">Recommended robot solutions</span>
                <h2 className="ip-block-title">The right robot families for {industry.name.toLowerCase()}.</h2>
              </header>
              <div className="ip-solutions">
                {content.solutions.map((s, i) => {
                  const Icon = ICONS[s.iconKey] ?? Cog;
                  return (
                    <article key={i} className="ip-solution">
                      <span className="ip-solution-icon" aria-hidden>
                        <Icon size={20} strokeWidth={1.6} />
                      </span>
                      <h3>{s.title}</h3>
                      <p>{s.body}</p>
                      {s.suitableFor && s.suitableFor.length > 0 && (
                        <div className="ip-solution-tags">
                          <span className="ip-tag-label">Suitable for</span>
                          <ul role="list">
                            {s.suitableFor.map((t) => (
                              <li key={t}>{t}</li>
                            ))}
                          </ul>
                        </div>
                      )}
                    </article>
                  );
                })}
              </div>
            </section>
          </MotionSection>

          {/* USE CASES */}
          <MotionSection>
            <section className="ip-block">
              <header className="ip-block-head">
                <span className="eyebrow">Use cases</span>
                <h2 className="ip-block-title">Where these robots earn their keep.</h2>
              </header>
              <ul className="ip-usecases" role="list">
                {content.useCases.map((u, i) => (
                  <li key={i} className="ip-usecase">
                    <span className="ip-usecase-num">{String(i + 1).padStart(2, '0')}</span>
                    <span>{u}</span>
                  </li>
                ))}
              </ul>
            </section>
          </MotionSection>

          {/* BENEFITS */}
          <MotionSection>
            <section className="ip-block">
              <header className="ip-block-head">
                <span className="eyebrow">Business benefits</span>
                <h2 className="ip-block-title">What this changes for your operation.</h2>
              </header>
              <div className="ip-benefits">
                {content.benefits.map((b, i) => (
                  <div key={i} className="ip-benefit">
                    <span className="ip-benefit-check"><Check size={12} strokeWidth={2.4} /></span>
                    <h3>{b.title}</h3>
                    <p>{b.body}</p>
                  </div>
                ))}
              </div>
            </section>
          </MotionSection>

          {/* GALLERY */}
          {content.gallery && content.gallery.length > 0 && (
            <MotionSection>
              <section className="ip-block" style={{ ['--acc' as string]: accent }}>
                <header className="ip-block-head">
                  <span className="eyebrow">In the field</span>
                  <h2 className="ip-block-title">Robots and deployments for this sector.</h2>
                </header>
                <div className="ip-gallery">
                  {content.gallery.map((g, i) => (
                    <figure key={i} className={`ip-gallery-card${i === 0 ? ' ip-gallery-card-lg' : ''}`}>
                      <div className="ip-gallery-imgwrap">
                        <Image
                          src={g.src}
                          alt={g.alt}
                          fill
                          sizes="(max-width: 720px) 100vw, (max-width: 1100px) 50vw, 33vw"
                          style={{ objectFit: 'cover', objectPosition: 'center' }}
                        />
                        {g.credit && <span className="ip-gallery-credit">{g.credit}</span>}
                      </div>
                      {g.caption && <figcaption className="ip-gallery-cap">{g.caption}</figcaption>}
                    </figure>
                  ))}
                </div>
              </section>
            </MotionSection>
          )}

          {/* CASE HIGHLIGHTS */}
          {content.caseHighlights && content.caseHighlights.length > 0 && (
            <MotionSection>
              <section className="ip-block" style={{ ['--acc' as string]: accent }}>
                <header className="ip-block-head">
                  <span className="eyebrow">Field-proven</span>
                  <h2 className="ip-block-title">Where these robots are already deployed.</h2>
                </header>
                <div className="ip-cases">
                  {content.caseHighlights.map((c, i) => (
                    <article key={i} className="ip-case">
                      <span className="ip-case-brand">{c.brand}</span>
                      <h3>{c.title}</h3>
                      <p>{c.body}</p>
                    </article>
                  ))}
                </div>
              </section>
            </MotionSection>
          )}

          {/* SUGGESTED ROBOTS */}
          <MotionSection>
            <section className="ip-block" style={{ ['--acc' as string]: accent }}>
              <header className="ip-block-head">
                <span className="eyebrow">Suggested robots</span>
                <h2 className="ip-block-title">Brands and families we deploy for this sector.</h2>
              </header>
              <div className="ip-robots">
                {content.suggestedRobots.map((r, i) => (
                  <article key={i} className="ip-robot">
                    <div className="ip-robot-head">
                      <span className="ip-robot-brand">{r.brand}</span>
                      <span className="ip-robot-arrow"><ArrowRight size={14} strokeWidth={1.8} /></span>
                    </div>
                    <h3>{r.family}</h3>
                    <p>{r.body}</p>
                    {r.chips && r.chips.length > 0 && (
                      <ul className="ip-robot-chips" role="list">
                        {r.chips.map((c) => (
                          <li key={c}>{c}</li>
                        ))}
                      </ul>
                    )}
                    <Link href="/robots/" className="ip-robot-link">
                      Browse robots <ArrowRight size={13} strokeWidth={2} />
                    </Link>
                  </article>
                ))}
              </div>
            </section>
          </MotionSection>

          {/* CTA */}
          <MotionSection>
            <section className="ip-cta">
              <div className="ip-cta-glow" aria-hidden />
              <div className="ip-cta-grid" aria-hidden />
              <div className="ip-cta-inner">
                <div className="ip-cta-text">
                  <span className="eyebrow">Next step</span>
                  <h2 className="ip-cta-title">{ctaTitle}</h2>
                  <p>{ctaBody}</p>
                </div>
                <div className="ip-cta-actions">
                  <CTAButton href="/book-demo/" variant="primary" size="lg" arrow="up-right">
                    Book a Live Demo
                  </CTAButton>
                  <CTAButton href="/contact/" variant="secondary" size="lg" arrow="right">
                    Request UAE Quotation
                  </CTAButton>
                  <CTAButton
                    href="https://wa.me/971500000000"
                    external
                    variant="ghost"
                    size="lg"
                    arrow="up-right"
                    ariaLabel="Chat with YS Lootah Robotics on WhatsApp"
                  >
                    WhatsApp Us
                  </CTAButton>
                </div>
              </div>
            </section>
          </MotionSection>
        </div>
      </main>

      <FooterAndContact />

      <style>{`
        .ip-main {
          padding-top: clamp(5rem, 9vw, 7rem);
          padding-bottom: clamp(2rem, 5vw, 4rem);
        }
        .ip-stack {
          display: flex;
          flex-direction: column;
          gap: clamp(2.5rem, 5vw, 4.25rem);
          scroll-margin-top: clamp(80px, 12vh, 120px);
        }

        /* BREADCRUMBS */
        .ip-breadcrumbs ol {
          list-style: none;
          margin: 0;
          padding: 0;
          display: flex;
          flex-wrap: wrap;
          align-items: center;
          gap: 0.5rem;
          font-size: 0.7rem;
          letter-spacing: 0.18em;
          text-transform: uppercase;
          color: #8891C7;
        }
        .ip-breadcrumbs a { color: #8891C7; text-decoration: none; transition: color 0.25s; }
        .ip-breadcrumbs a:hover { color: #FFFFFF; }
        .ip-breadcrumbs li[aria-current="page"] { color: #FFFFFF; }
        .ip-breadcrumbs li[aria-hidden] { display: inline-flex; align-items: center; color: #4a4f63; }

        /* HERO */
        .ip-hero {
          position: relative;
          overflow: hidden;
          border-radius: 26px;
          border: 1px solid rgba(74, 102, 216, 0.20);
          background:
            radial-gradient(ellipse 70% 100% at 0% 0%, rgba(58, 85, 196, 0.20), transparent 55%),
            radial-gradient(ellipse 60% 80% at 100% 100%, rgba(136, 145, 199, 0.16), transparent 60%),
            linear-gradient(135deg, rgba(14, 13, 22, 0.95), rgba(6, 6, 10, 0.97));
          box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
        }
        .ip-hero-glow {
          position: absolute; width: 540px; height: 540px; border-radius: 999px;
          top: -200px; right: -160px;
          background: radial-gradient(circle, color-mix(in srgb, var(--acc) 38%, transparent), transparent 70%);
          filter: blur(110px); opacity: 0.6; pointer-events: none;
        }
        .ip-hero-glow-b {
          position: absolute; width: 460px; height: 460px; border-radius: 999px;
          bottom: -200px; left: -150px;
          background: radial-gradient(circle, rgba(74, 102, 216, 0.32), transparent 70%);
          filter: blur(110px); opacity: 0.5; pointer-events: none;
        }
        .ip-hero-grid {
          position: absolute; inset: 0;
          background:
            linear-gradient(rgba(74, 102, 216, 0.05) 1px, transparent 1px),
            linear-gradient(90deg, rgba(74, 102, 216, 0.05) 1px, transparent 1px);
          background-size: 56px 56px;
          mask-image: radial-gradient(ellipse 70% 90% at 30% 40%, #000 25%, transparent 80%);
          -webkit-mask-image: radial-gradient(ellipse 70% 90% at 30% 40%, #000 25%, transparent 80%);
          pointer-events: none;
        }
        .ip-hero-inner {
          position: relative; z-index: 1;
          display: grid; grid-template-columns: minmax(0, 1fr);
          gap: clamp(1.5rem, 3vw, 2.75rem);
          padding: clamp(1.8rem, 4vw, 3.2rem);
          align-items: center;
        }
        .ip-hero-copy { display: flex; flex-direction: column; gap: 1rem; max-width: 640px; min-width: 0; }
        .ip-hero-eyebrow {
          display: inline-flex; align-items: center; gap: 0.55rem;
          width: fit-content;
        }
        .ip-dot {
          width: 7px; height: 7px; border-radius: 999px; background: #DEE0F0;
          box-shadow: 0 0 14px rgba(222, 224, 240, 0.85);
        }
        .ip-hero-title {
          margin: 0;
          font-size: clamp(2rem, 5vw, 3.2rem);
          line-height: 1.05; font-weight: 300; letter-spacing: -0.03em; color: #FFFFFF;
        }
        .ip-hero-title .text-gradient { font-weight: 500; }
        .ip-hero-sub {
          margin: 0; color: #DEE0F0;
          font-size: clamp(0.95rem, 1.8vw, 1.1rem); line-height: 1.65; max-width: 560px;
        }
        .ip-hero-tags {
          list-style: none; margin: 0.25rem 0 0; padding: 0;
          display: flex; flex-wrap: wrap; gap: 0.4rem;
        }
        .ip-hero-tag {
          display: inline-flex; align-items: center; gap: 0.3rem;
          padding: 0.35rem 0.65rem;
          border-radius: 999px;
          border: 1px solid rgba(120, 140, 255, 0.28);
          background: rgba(58, 85, 196, 0.12);
          color: #DEE0F0;
          font-size: 0.72rem;
          font-weight: 600;
          letter-spacing: 0.02em;
        }
        .ip-hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }

        /* HERO RIGHT VISUAL — industry image */
        .ip-hero-visual {
          position: relative;
          display: block;
          width: 100%;
          aspect-ratio: 4 / 3;
          border-radius: 20px;
          overflow: hidden;
          border: 1px solid color-mix(in srgb, var(--acc) 35%, rgba(74, 102, 216, 0.20));
          background: #0a0a0e;
          box-shadow:
            0 22px 60px rgba(0, 0, 0, 0.55),
            inset 0 1px 0 rgba(255, 255, 255, 0.05),
            0 0 28px color-mix(in srgb, var(--acc) 12%, transparent);
        }
        .ip-hero-visual :global(.ip-hero-visual-img) {
          transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
          filter: saturate(0.95) brightness(0.88);
        }
        .ip-hero-visual:hover :global(.ip-hero-visual-img) {
          transform: scale(1.04);
        }
        .ip-hero-visual-overlay {
          position: absolute;
          inset: 0;
          background:
            linear-gradient(180deg, rgba(10, 10, 14, 0.15) 0%, rgba(10, 10, 14, 0.05) 35%, rgba(10, 10, 14, 0.80) 100%),
            radial-gradient(ellipse 100% 70% at 100% 0%, color-mix(in srgb, var(--acc) 18%, transparent), transparent 65%);
          pointer-events: none;
        }
        .ip-hero-visual-meta {
          position: absolute;
          left: 0;
          right: 0;
          bottom: 0;
          z-index: 2;
          display: flex;
          flex-wrap: wrap;
          align-items: center;
          justify-content: space-between;
          gap: 0.6rem;
          padding: 0.9rem 1.05rem;
          border-top: 1px solid rgba(222, 224, 240, 0.10);
          background: linear-gradient(180deg, rgba(10, 10, 14, 0.0), rgba(10, 10, 14, 0.55));
          backdrop-filter: blur(6px);
          -webkit-backdrop-filter: blur(6px);
        }
        .ip-mono {
          font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
          font-size: 0.6rem; letter-spacing: 0.3em; font-weight: 800; color: #DEE0F0;
        }
        .ip-live { color: #7FD6D0; display: inline-flex; align-items: center; gap: 0.4rem; }
        .ip-live-dot {
          width: 7px; height: 7px; border-radius: 999px; background: #7FD6D0;
          box-shadow: 0 0 10px rgba(127, 214, 208, 0.7);
        }

        @media (min-width: 920px) {
          .ip-hero-inner { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
          .ip-hero-visual { aspect-ratio: 5 / 6; max-width: 460px; margin-left: auto; }
        }
        @media (prefers-reduced-motion: reduce) {
          .ip-hero-visual :global(.ip-hero-visual-img) { transition: none !important; }
          .ip-hero-visual:hover :global(.ip-hero-visual-img) { transform: none; }
        }

        /* TRUST ROW */
        .ip-trust {
          list-style: none; margin: 0; padding: 0;
          display: grid;
          grid-template-columns: repeat(2, minmax(0, 1fr));
          gap: 0.6rem;
        }
        .ip-trust-card {
          display: grid;
          grid-template-columns: auto minmax(0, 1fr);
          gap: 0.75rem;
          padding: 0.85rem 1rem;
          border-radius: 14px;
          border: 1px solid rgba(120, 140, 255, 0.22);
          background: linear-gradient(135deg, rgba(80, 110, 255, 0.10), rgba(255, 255, 255, 0.03));
          align-items: center;
        }
        .ip-trust-icon {
          display: inline-flex; align-items: center; justify-content: center;
          width: 32px; height: 32px; border-radius: 10px;
          color: #DEE0F0;
          background: rgba(74, 102, 216, 0.18);
          border: 1px solid rgba(74, 102, 216, 0.45);
        }
        .ip-trust-label {
          display: block;
          font-size: 0.78rem; font-weight: 600; color: #FFFFFF;
          letter-spacing: -0.005em;
        }
        .ip-trust-sub {
          display: block; font-size: 0.7rem; color: #8891C7; margin-top: 0.1rem;
        }
        @media (min-width: 820px) {
          .ip-trust { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; }
        }

        /* PROOF POINTS */
        .ip-proof {
          list-style: none; margin: 0; padding: 0;
          display: grid;
          grid-template-columns: repeat(2, minmax(0, 1fr));
          gap: 0.6rem;
        }
        .ip-proof-card {
          position: relative;
          display: flex; flex-direction: column; gap: 0.25rem;
          padding: 0.95rem 1rem;
          border-radius: 16px;
          border: 1px solid color-mix(in srgb, var(--acc) 28%, rgba(120, 140, 255, 0.18));
          background:
            radial-gradient(ellipse 70% 100% at 100% 0%, color-mix(in srgb, var(--acc) 14%, transparent), transparent 65%),
            linear-gradient(135deg, rgba(80, 110, 255, 0.10), rgba(255, 255, 255, 0.03));
          overflow: hidden;
          transition: border-color 0.3s, transform 0.3s;
        }
        .ip-proof-card:hover {
          transform: translateY(-2px);
          border-color: color-mix(in srgb, var(--acc) 55%, rgba(120, 140, 255, 0.35));
        }
        .ip-proof-value {
          font-size: clamp(1.15rem, 3vw, 1.7rem);
          font-weight: 600;
          letter-spacing: -0.025em;
          line-height: 1;
          background: linear-gradient(180deg, #FFFFFF, color-mix(in srgb, var(--acc) 65%, #B5BDDB));
          -webkit-background-clip: text;
          background-clip: text;
          color: transparent;
        }
        .ip-proof-label {
          font-size: 0.6rem;
          letter-spacing: 0.2em;
          text-transform: uppercase;
          font-weight: 700;
          color: #A6B2D8;
        }
        @media (min-width: 720px) {
          .ip-proof { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
        }

        /* GALLERY */
        .ip-gallery {
          display: grid;
          grid-template-columns: minmax(0, 1fr);
          gap: 0.9rem;
        }
        @media (min-width: 640px) { .ip-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
        @media (min-width: 1100px) { .ip-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
        .ip-gallery-card {
          display: flex; flex-direction: column; gap: 0.55rem;
          border-radius: 18px;
          overflow: hidden;
        }
        .ip-gallery-imgwrap {
          position: relative;
          width: 100%;
          aspect-ratio: 4 / 3;
          border-radius: 16px;
          overflow: hidden;
          background:
            radial-gradient(ellipse 70% 50% at 50% 60%, color-mix(in srgb, var(--acc) 18%, transparent) 0%, transparent 65%),
            linear-gradient(180deg, rgba(28, 27, 33, 0.78), rgba(8, 8, 10, 0.95));
          border: 1px solid rgba(222, 224, 240, 0.10);
          box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
          transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
        }
        .ip-gallery-card:hover .ip-gallery-imgwrap {
          transform: translateY(-3px);
          border-color: color-mix(in srgb, var(--acc) 45%, rgba(120, 140, 255, 0.28));
          box-shadow: 0 22px 46px rgba(0, 0, 0, 0.55), 0 0 26px color-mix(in srgb, var(--acc) 18%, transparent);
        }
        .ip-gallery-credit {
          position: absolute;
          top: 0.55rem;
          right: 0.55rem;
          padding: 0.22rem 0.55rem;
          border-radius: 999px;
          background: rgba(8, 8, 12, 0.72);
          border: 1px solid rgba(222, 224, 240, 0.18);
          backdrop-filter: blur(8px);
          color: #DEE0F0;
          font-size: 0.56rem;
          letter-spacing: 0.22em;
          text-transform: uppercase;
          font-weight: 800;
        }
        .ip-gallery-cap {
          margin: 0;
          padding: 0 0.15rem;
          color: #C9CCDE;
          font-size: 0.82rem;
          line-height: 1.5;
        }
        @media (min-width: 1100px) {
          .ip-gallery-card-lg { grid-column: span 1; }
        }

        /* CASE HIGHLIGHTS */
        .ip-cases {
          display: grid;
          grid-template-columns: minmax(0, 1fr);
          gap: 0.9rem;
        }
        @media (min-width: 720px) { .ip-cases { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
        @media (min-width: 1100px) { .ip-cases { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
        .ip-case {
          display: flex; flex-direction: column; gap: 0.55rem;
          padding: 1.15rem 1.2rem 1.2rem;
          border-radius: 18px;
          border: 1px solid rgba(222, 224, 240, 0.10);
          background:
            radial-gradient(ellipse 75% 50% at 100% 0%, color-mix(in srgb, var(--acc) 14%, transparent), transparent 60%),
            linear-gradient(180deg, rgba(22, 21, 30, 0.9), rgba(10, 10, 14, 0.96));
          transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
        }
        .ip-case:hover {
          transform: translateY(-3px);
          border-color: rgba(74, 102, 216, 0.42);
          box-shadow: 0 18px 38px rgba(0, 0, 0, 0.5);
        }
        .ip-case-brand {
          align-self: flex-start;
          font-size: 0.6rem;
          letter-spacing: 0.28em;
          text-transform: uppercase;
          font-weight: 800;
          color: color-mix(in srgb, var(--acc) 72%, white);
          padding: 0.3rem 0.55rem;
          border-radius: 999px;
          border: 1px solid color-mix(in srgb, var(--acc) 35%, transparent);
          background: color-mix(in srgb, var(--acc) 10%, rgba(14, 13, 18, 0.55));
        }
        .ip-case h3 {
          margin: 0; font-size: 1.02rem; font-weight: 600;
          color: #FFFFFF; letter-spacing: -0.005em;
        }
        .ip-case p { margin: 0; color: #C9CCDE; font-size: 0.88rem; line-height: 1.55; }

        /* BLOCKS */
        .ip-block { display: flex; flex-direction: column; gap: clamp(1.2rem, 2.2vw, 1.75rem); }
        .ip-block-head { display: flex; flex-direction: column; gap: 0.55rem; max-width: 760px; }
        .ip-block-title {
          margin: 0;
          font-size: clamp(1.55rem, 3vw, 2.1rem);
          font-weight: 400; letter-spacing: -0.02em; color: #FFFFFF; line-height: 1.15;
        }

        /* PROBLEM */
        .ip-problems {
          list-style: none; margin: 0; padding: 0;
          display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem;
        }
        @media (min-width: 720px) {
          .ip-problems { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
        }
        .ip-problem {
          display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.85rem;
          padding: 1.05rem 1.15rem;
          border-radius: 16px;
          border: 1px solid rgba(222, 224, 240, 0.08);
          background: linear-gradient(135deg, rgba(20, 19, 26, 0.78), rgba(10, 10, 14, 0.94));
          transition: border-color 0.3s, transform 0.3s;
        }
        .ip-problem:hover { border-color: rgba(74, 102, 216, 0.32); transform: translateY(-2px); }
        .ip-problem-num {
          font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
          font-size: 0.7rem; letter-spacing: 0.22em; font-weight: 800;
          color: #8891C7; padding-top: 0.15rem;
        }
        .ip-problem p { margin: 0; color: #DEE0F0; font-size: 0.92rem; line-height: 1.55; }

        /* SOLUTIONS */
        .ip-solutions {
          display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem;
        }
        @media (min-width: 640px) { .ip-solutions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
        @media (min-width: 1200px) { .ip-solutions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
        .ip-solution {
          display: flex; flex-direction: column; gap: 0.65rem;
          padding: 1.2rem 1.2rem 1.25rem;
          border-radius: 18px;
          border: 1px solid rgba(222, 224, 240, 0.10);
          background:
            radial-gradient(ellipse 80% 60% at 100% 0%, color-mix(in srgb, var(--acc) 16%, transparent), transparent 60%),
            linear-gradient(180deg, rgba(22, 21, 30, 0.9), rgba(10, 10, 14, 0.96));
          transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
        }
        .ip-solution:hover {
          transform: translateY(-3px);
          border-color: rgba(74, 102, 216, 0.42);
          box-shadow: 0 18px 38px rgba(0, 0, 0, 0.5), 0 0 24px rgba(58, 85, 196, 0.18);
        }
        .ip-solution-icon {
          display: inline-flex; align-items: center; justify-content: center;
          width: 40px; height: 40px; border-radius: 12px;
          color: color-mix(in srgb, var(--acc) 82%, white);
          border: 1px solid color-mix(in srgb, var(--acc) 35%, transparent);
          background: color-mix(in srgb, var(--acc) 12%, rgba(14, 13, 18, 0.6));
        }
        .ip-solution h3 {
          margin: 0; font-size: 1.02rem; font-weight: 600;
          color: #FFFFFF; letter-spacing: -0.005em;
        }
        .ip-solution p { margin: 0; color: #C9CCDE; font-size: 0.86rem; line-height: 1.55; flex: 1; }
        .ip-solution-tags {
          display: flex; flex-direction: column; gap: 0.4rem;
          padding-top: 0.7rem; border-top: 1px solid rgba(222, 224, 240, 0.07);
        }
        .ip-tag-label {
          font-size: 0.55rem; letter-spacing: 0.24em; text-transform: uppercase;
          font-weight: 800; color: #8891C7;
        }
        .ip-solution-tags ul {
          list-style: none; margin: 0; padding: 0;
          display: flex; flex-wrap: wrap; gap: 0.3rem;
        }
        .ip-solution-tags li {
          font-size: 0.7rem; font-weight: 600; color: #DEE0F0;
          padding: 0.2rem 0.55rem;
          border-radius: 999px;
          border: 1px solid rgba(222, 224, 240, 0.10);
          background: rgba(20, 19, 26, 0.65);
        }

        /* USE CASES */
        .ip-usecases {
          list-style: none; margin: 0; padding: 0;
          display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.65rem;
        }
        @media (min-width: 640px) { .ip-usecases { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; } }
        @media (min-width: 1000px) { .ip-usecases { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
        .ip-usecase {
          display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.8rem;
          align-items: center;
          padding: 0.95rem 1.05rem;
          border-radius: 14px;
          border: 1px solid rgba(222, 224, 240, 0.08);
          background: linear-gradient(135deg, rgba(18, 18, 26, 0.78), rgba(8, 8, 12, 0.92));
          color: #DEE0F0; font-size: 0.92rem; line-height: 1.45;
          transition: border-color 0.3s, transform 0.3s;
        }
        .ip-usecase:hover { border-color: rgba(74, 102, 216, 0.35); transform: translateX(2px); }
        .ip-usecase-num {
          font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
          font-size: 0.7rem; letter-spacing: 0.18em; font-weight: 800; color: #8891C7;
        }

        /* BENEFITS */
        .ip-benefits {
          display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.85rem;
        }
        @media (min-width: 640px) { .ip-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
        @media (min-width: 1100px) { .ip-benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
        .ip-benefit {
          position: relative;
          padding: 1.15rem 1.2rem 1.1rem;
          border-radius: 16px;
          border: 1px solid rgba(222, 224, 240, 0.08);
          background: linear-gradient(135deg, rgba(20, 19, 26, 0.82), rgba(10, 10, 14, 0.94));
          transition: border-color 0.3s, transform 0.3s;
        }
        .ip-benefit:hover { border-color: rgba(74, 102, 216, 0.32); transform: translateY(-2px); }
        .ip-benefit-check {
          display: inline-flex; align-items: center; justify-content: center;
          width: 22px; height: 22px; border-radius: 999px;
          background: rgba(127, 214, 208, 0.18);
          border: 1px solid rgba(127, 214, 208, 0.4);
          color: #7FD6D0;
          margin-bottom: 0.55rem;
        }
        .ip-benefit h3 {
          margin: 0 0 0.35rem; font-size: 0.98rem; font-weight: 600; color: #FFFFFF;
        }
        .ip-benefit p { margin: 0; color: #C9CCDE; font-size: 0.86rem; line-height: 1.5; }

        /* SUGGESTED ROBOTS */
        .ip-robots {
          display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem;
        }
        @media (min-width: 720px) { .ip-robots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
        @media (min-width: 1100px) { .ip-robots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
        .ip-robot {
          display: flex; flex-direction: column; gap: 0.55rem;
          padding: 1.2rem 1.25rem 1.2rem;
          border-radius: 18px;
          border: 1px solid rgba(74, 102, 216, 0.24);
          background:
            radial-gradient(ellipse 80% 60% at 100% 0%, color-mix(in srgb, var(--acc) 20%, transparent), transparent 60%),
            linear-gradient(180deg, rgba(22, 21, 30, 0.92), rgba(10, 10, 14, 0.96));
          transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
        }
        .ip-robot:hover {
          transform: translateY(-3px);
          border-color: rgba(74, 102, 216, 0.5);
          box-shadow: 0 22px 44px rgba(0, 0, 0, 0.55), 0 0 28px rgba(58, 85, 196, 0.22);
        }
        .ip-robot-head {
          display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
        }
        .ip-robot-brand {
          font-size: 0.6rem; letter-spacing: 0.3em; text-transform: uppercase;
          font-weight: 800; color: color-mix(in srgb, var(--acc) 72%, white);
        }
        .ip-robot-arrow {
          display: inline-flex; align-items: center; justify-content: center;
          width: 26px; height: 26px; border-radius: 999px;
          color: #DEE0F0;
          border: 1px solid rgba(222, 224, 240, 0.14);
          background: rgba(14, 13, 18, 0.6);
        }
        .ip-robot h3 { margin: 0; font-size: 1.08rem; font-weight: 600; color: #FFFFFF; }
        .ip-robot p { margin: 0; color: #C9CCDE; font-size: 0.88rem; line-height: 1.55; flex: 1; }
        .ip-robot-chips {
          list-style: none; margin: 0; padding: 0;
          display: flex; flex-wrap: wrap; gap: 0.3rem;
          padding-top: 0.4rem;
        }
        .ip-robot-chips li {
          font-size: 0.66rem;
          letter-spacing: 0.14em;
          text-transform: uppercase;
          font-weight: 700;
          padding: 0.25rem 0.55rem;
          border-radius: 999px;
          border: 1px solid color-mix(in srgb, var(--acc) 30%, transparent);
          background: color-mix(in srgb, var(--acc) 10%, rgba(14, 13, 18, 0.55));
          color: #DEE0F0;
        }
        .ip-robot-link {
          display: inline-flex; align-items: center; gap: 0.45rem;
          margin-top: 0.55rem; padding-top: 0.7rem;
          border-top: 1px solid rgba(222, 224, 240, 0.07);
          font-size: 0.8rem; font-weight: 600; color: #DEE0F0;
          text-decoration: none;
          transition: color 0.25s, gap 0.25s;
        }
        .ip-robot-link:hover { color: #FFFFFF; gap: 0.7rem; }

        /* CTA */
        .ip-cta {
          position: relative; overflow: hidden;
          border-radius: 26px;
          border: 1px solid rgba(74, 102, 216, 0.26);
          background:
            radial-gradient(ellipse 60% 100% at 100% 0%, rgba(58, 85, 196, 0.22), transparent 60%),
            linear-gradient(135deg, rgba(18, 16, 28, 0.95), rgba(8, 8, 12, 0.97));
          box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
        }
        .ip-cta-glow {
          position: absolute; width: 480px; height: 480px; border-radius: 999px;
          top: -160px; left: -160px;
          background: radial-gradient(circle, rgba(74, 102, 216, 0.45), transparent 70%);
          filter: blur(100px); opacity: 0.55; pointer-events: none;
        }
        .ip-cta-grid {
          position: absolute; inset: 0;
          background:
            linear-gradient(rgba(74, 102, 216, 0.05) 1px, transparent 1px),
            linear-gradient(90deg, rgba(74, 102, 216, 0.05) 1px, transparent 1px);
          background-size: 56px 56px;
          mask-image: radial-gradient(ellipse 60% 90% at 70% 50%, #000 25%, transparent 80%);
          -webkit-mask-image: radial-gradient(ellipse 60% 90% at 70% 50%, #000 25%, transparent 80%);
          pointer-events: none;
        }
        .ip-cta-inner {
          position: relative; z-index: 1;
          display: grid; grid-template-columns: minmax(0, 1fr);
          gap: clamp(1.3rem, 3vw, 2rem);
          padding: clamp(1.7rem, 3.6vw, 2.7rem);
          align-items: center;
        }
        @media (min-width: 900px) {
          .ip-cta-inner { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
        }
        .ip-cta-text { display: flex; flex-direction: column; gap: 0.65rem; max-width: 560px; }
        .ip-cta-title {
          margin: 0;
          font-size: clamp(1.65rem, 3vw, 2.25rem);
          font-weight: 400; letter-spacing: -0.02em; color: #FFFFFF; line-height: 1.1;
        }
        .ip-cta-text p { margin: 0; color: #DEE0F0; font-size: 0.95rem; line-height: 1.65; }
        .ip-cta-actions {
          display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: flex-start;
        }
        @media (min-width: 900px) {
          .ip-cta-actions { justify-content: flex-end; }
        }
        @media (max-width: 520px) {
          .ip-cta-actions .cta-btn { width: 100%; justify-content: space-between; }
          .ip-hero-actions .cta-btn { width: 100%; justify-content: space-between; }
        }
      `}</style>
    </>
  );
}
