// =============================================================
// Design Brains — Home Page
// =============================================================

function HomePage() {
  return (
    <div className="page-enter">
      <Hero />
      <LogoMarquee />
      <ServicesOverview />
      <WhyUs />
      <TechStack />
      <Process />
      <Showcase />
      <Testimonials />
      <FAQPreview />
    </div>
  );
}

// -------- Hero --------
function Hero() {
  return (
    <section style={{ paddingTop: 160, paddingBottom: 100, position: "relative", overflow: "hidden" }}>
      <HeroBackground />
      <div className="container" style={{ position: "relative", zIndex: 2 }}>
        <Reveal>
          <div className="eyebrow" style={{ marginBottom: 28 }}>
            Digital studio · Bogra, Bangladesh
          </div>
        </Reveal>
        <Reveal delay={80}>
          <h1 className="h-display" style={{ maxWidth: 1100, marginBottom: 32 }}>
            Smart digital experiences<br/>
            for ambitious teams<span style={{ color: "var(--brand)" }}>.</span>
          </h1>
        </Reveal>
        <Reveal delay={160}>
          <p className="lead" style={{ fontSize: 20, maxWidth: 620, marginBottom: 40 }}>
            We design, build, and automate — websites, mobile apps, and the AI that runs quietly behind them. Less template. More taste.
          </p>
        </Reveal>
        <Reveal delay={220}>
          <div style={{ display: "flex", gap: 12, flexWrap: "wrap", marginBottom: 80 }}>
            <Button to="/quote">Get a quote <span className="arrow">→</span></Button>
            <Button variant="ghost" to="/contact">Book a consultation</Button>
          </div>
        </Reveal>
        <Reveal delay={300}>
          <HeroStats />
        </Reveal>
      </div>
    </section>
  );
}

function HeroBackground() {
  return (
    <div aria-hidden style={{ position: "absolute", inset: 0, pointerEvents: "none", zIndex: 1, overflow: "hidden" }}>
      {/* Big half-disc echo of the logo's B-mark, drifting in from the right */}
      <svg className="hero-disc" width="900" height="900" viewBox="0 0 900 900" style={{ position: "absolute", right: "-220px", top: "-40px", opacity: 0.85 }}>
        <defs>
          <linearGradient id="hero-disc-grad" x1="0" y1="0" x2="1" y2="1">
            <stop offset="0" stopColor="var(--brand)" stopOpacity="0.18"/>
            <stop offset="1" stopColor="var(--brand)" stopOpacity="0"/>
          </linearGradient>
        </defs>
        <path d="M 450 50 A 400 400 0 0 1 450 850 L 450 50 Z" fill="url(#hero-disc-grad)"/>
        <circle cx="720" cy="720" r="60" fill="var(--brand)" opacity="0.18"/>
      </svg>

      {/* Concentric rings — slowly counter-rotating, with traveling dots on each */}
      <div className="hero-rings-wrap" style={{ position: "absolute", right: "5%", top: "20%", width: 600, height: 600, opacity: 0.85 }}>
        <svg className="hero-rings spin-cw-slow" width="600" height="600" viewBox="0 0 600 600" style={{ position: "absolute", inset: 0 }}>
          <circle cx="300" cy="300" r="100" fill="none" stroke="var(--brand)" strokeWidth="1" opacity="0.45"/>
          {/* Traveler on inner ring */}
          <circle cx="300" cy="200" r="7" fill="var(--brand)" style={{filter: "drop-shadow(0 0 12px var(--brand-glow))"}}/>
        </svg>
        <svg className="hero-rings spin-ccw-slower" width="600" height="600" viewBox="0 0 600 600" style={{ position: "absolute", inset: 0 }}>
          <circle cx="300" cy="300" r="180" fill="none" stroke="var(--brand)" strokeWidth="1" strokeDasharray="2 6" opacity="0.32"/>
          {/* Traveler on middle ring */}
          <circle cx="480" cy="300" r="6" fill="var(--brand)" opacity="0.9" style={{filter: "drop-shadow(0 0 10px var(--brand-glow))"}}/>
        </svg>
        <svg className="hero-rings spin-cw-slowest" width="600" height="600" viewBox="0 0 600 600" style={{ position: "absolute", inset: 0 }}>
          <circle cx="300" cy="300" r="260" fill="none" stroke="var(--brand)" strokeWidth="1" opacity="0.18"/>
          {/* Traveler on outer ring */}
          <circle cx="300" cy="40" r="5" fill="var(--brand)" opacity="0.85" style={{filter: "drop-shadow(0 0 8px var(--brand-glow))"}}/>
        </svg>
        {/* Pulse waves emanating from center */}
        <svg width="600" height="600" viewBox="0 0 600 600" style={{ position: "absolute", inset: 0 }}>
          <circle className="pulse pulse-1" cx="300" cy="300" r="60" fill="none" stroke="var(--brand)" strokeWidth="1.2"/>
          <circle className="pulse pulse-2" cx="300" cy="300" r="60" fill="none" stroke="var(--brand)" strokeWidth="1.2"/>
        </svg>
      </div>

      {/* Subtle grid */}
      <svg width="100%" height="100%" style={{ position: "absolute", inset: 0, opacity: 0.5 }}>
        <defs>
          <linearGradient id="grid-fade" x1="0" y1="0" x2="0" y2="1">
            <stop offset="0" stopColor="rgba(15,18,12,0.08)"/>
            <stop offset="1" stopColor="rgba(15,18,12,0)"/>
          </linearGradient>
          <pattern id="grid" width="64" height="64" patternUnits="userSpaceOnUse">
            <path d="M 64 0 L 0 0 0 64" fill="none" stroke="url(#grid-fade)" strokeWidth="1"/>
          </pattern>
        </defs>
        <rect width="100%" height="100%" fill="url(#grid)"/>
      </svg>

      {/* Floating dot — inspired by the logo's period */}
      <div className="float-dot" style={{
        position: "absolute",
        right: "12%", top: "58%",
        width: 22, height: 22, borderRadius: "50%",
        background: "var(--brand)",
        boxShadow: "0 0 60px var(--brand-glow), 0 0 120px var(--brand-glow)",
      }}/>
      <div className="float-dot float-dot-2" style={{
        position: "absolute",
        left: "45%", top: "82%",
        width: 10, height: 10, borderRadius: "50%",
        background: "var(--brand)",
        opacity: 0.7,
      }}/>

      <style>{`
        @keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
        @keyframes float-2 { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-12px) translateX(8px); } }
        @keyframes drift-in { from { transform: translateX(80px); opacity: 0; } to { transform: translateX(0); opacity: 0.85; } }
        @keyframes spin-cw  { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
        @keyframes spin-ccw { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
        @keyframes pulse-out { 0% { r: 60; opacity: 0.45; } 100% { r: 280; opacity: 0; } }

        .float-dot { animation: float 6s ease-in-out infinite; }
        .float-dot-2 { animation: float-2 8s ease-in-out infinite; }
        .hero-disc { animation: drift-in 1.2s var(--ease) both; }

        .hero-rings { transform-origin: center; transform-box: fill-box; }
        .spin-cw-slow    { animation: spin-cw 12s linear infinite; }
        .spin-ccw-slower { animation: spin-ccw 18s linear infinite; }
        .spin-cw-slowest { animation: spin-cw 26s linear infinite; }

        .pulse { transform-origin: 300px 300px; animation: pulse-out 4s ease-out infinite; }
        .pulse-2 { animation-delay: 2s; }

        @media (prefers-reduced-motion: reduce) {
          .float-dot, .float-dot-2, .hero-disc, .hero-rings, .pulse { animation: none !important; }
        }
      `}</style>
    </div>
  );
}

function HeroStats() {
  const stats = [
    ["120+", "Projects shipped"],
    ["8 yrs", "Building digital"],
    ["24 hrs", "Avg. quote time"],
    ["12", "Time zones served"],
  ];
  return (
    <div style={{
      display: "grid",
      gridTemplateColumns: "repeat(4, 1fr)",
      gap: 1,
      background: "var(--border)",
      border: "1px solid var(--border)",
      overflow: "hidden",
      width: "100%",
    }} className="hero-stats">
      {stats.map(([n, l]) => (
        <div key={l} style={{ background: "var(--bg)", padding: "36px 32px", minHeight: 160, display: "flex", flexDirection: "column", justifyContent: "flex-end" }}>
          <div className="font-display" style={{ fontSize: 56, fontWeight: 600, letterSpacing: "-0.035em", marginBottom: 10, lineHeight: 1 }}>{n}</div>
          <div style={{ color: "var(--muted)", fontSize: 13, fontFamily: "JetBrains Mono, monospace", letterSpacing: "0.02em" }}>{l}</div>
        </div>
      ))}
      <style>{`
        @media (max-width: 720px) {
          .hero-stats { grid-template-columns: 1fr 1fr !important; }
        }
      `}</style>
    </div>
  );
}

// -------- Logo marquee --------
function LogoMarquee() {
  const items = ["NORTHWIND", "Helix Labs", "Aperture", "Tiger Pay", "VERDANT", "Studio Kōan", "Maple & Co", "Cobalt", "Hexa Group", "Riverline"];
  return (
    <section style={{ padding: "40px 0", borderTop: "1px solid var(--border)", borderBottom: "1px solid var(--border)" }}>
      <div className="container" style={{ display: "flex", alignItems: "center", gap: 32, flexWrap: "wrap" }}>
        <div style={{ flex: 1, overflow: "hidden", maskImage: "linear-gradient(to right, transparent, #000 10%, #000 90%, transparent)" }}>
          <div className="marquee">
            {[...items, ...items].map((b, i) => (
              <span key={i} style={{ fontFamily: "DM Sans", fontSize: 22, fontWeight: 600, color: "var(--fg-2)", opacity: 0.6, whiteSpace: "nowrap", letterSpacing: "-0.02em" }}>{b}</span>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
}

// -------- Services Overview --------
function ServicesOverview() {
  const list = [SERVICES.web, SERVICES.app, SERVICES.ai];
  return (
    <section>
      <div className="container">
        <SectionHeader
          eyebrow="What we do"
          title="Three disciplines. One studio."
          subtitle="We're small on purpose. The same people who scope your project are the ones building it — and you'll know them by name."
        />
        <div className="services-grid" style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 0 }}>
          {list.map((s, i) => (
            <Reveal key={s.slug} delay={i * 80}>
              <Link to={`/services/${s.slug}`}>
                <div className="card card-glow" style={{ height: "100%", minHeight: 440, display: "flex", flexDirection: "column", justifyContent: "space-between", borderRadius: 0, marginLeft: i === 0 ? 0 : -1 }}>
                  <div>
                    <ServiceIcon kind={s.icon} />
                    <div style={{ marginTop: 24, fontFamily: "JetBrains Mono, monospace", fontSize: 12, color: "var(--muted)", letterSpacing: "0.12em" }}>
                      0{i + 1} / {String(list.length).padStart(2, "0")}
                    </div>
                    <h3 className="font-display" style={{ fontSize: 28, marginTop: 8, marginBottom: 12, letterSpacing: "-0.02em" }}>{s.name}</h3>
                    <p style={{ color: "var(--fg-2)", fontSize: 15, lineHeight: 1.5 }}>{s.description}</p>
                  </div>
                  <div style={{ marginTop: 28, display: "flex", flexDirection: "column", gap: 8 }}>
                    {s.subServices.slice(0, 3).map((sub) => (
                      <div key={sub.slug} style={{ fontSize: 13, color: "var(--muted)", fontFamily: "JetBrains Mono, monospace" }}>
                        → {sub.name}
                      </div>
                    ))}
                    <div style={{ marginTop: 16, color: "var(--brand)", fontSize: 14, fontWeight: 600 }}>
                      Explore service →
                    </div>
                  </div>
                </div>
              </Link>
            </Reveal>
          ))}
        </div>
        <style>{`
          @media (max-width: 880px) {
            .services-grid { grid-template-columns: 1fr !important; }
          }
        `}</style>
      </div>
    </section>
  );
}

// -------- Why Us --------
function WhyUs() {
  const reasons = [
    { n: "01", t: "Senior team, no hand-offs", d: "The designer who pitched you also pushes the code. No layered subcontractors." },
    { n: "02", t: "Brutally clear scopes", d: "Fixed-price phases with line-item deliverables. You'll never wonder what you're paying for." },
    { n: "03", t: "Ship every week", d: "We commit to a weekly demo. Momentum compounds — and so does feedback." },
    { n: "04", t: "Built to be handed off", d: "Code, content, and AI workflows your team can extend without us. We hate vendor lock-in too." },
  ];
  return (
    <section style={{ background: "var(--bg-2)", borderTop: "1px solid var(--border)", borderBottom: "1px solid var(--border)" }}>
      <div className="container">
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 80, alignItems: "start" }} className="why-grid">
          <Reveal>
            <div style={{ position: "sticky", top: 120 }}>
              <div className="eyebrow" style={{ marginBottom: 20 }}>Why Design Brains</div>
              <h2 className="h-section" style={{ marginBottom: 24 }}>
                Boutique by choice.<br/>
                <span style={{ color: "var(--brand)" }}>Senior</span> by design.
              </h2>
              <p className="lead" style={{ marginBottom: 32 }}>
                We've seen what happens when agencies scale headcount instead of taste. We're not interested. We keep the team small, the standard high, and the work in our own hands.
              </p>
              <Button variant="ghost" to="/about">More about us →</Button>
            </div>
          </Reveal>
          <div style={{ display: "flex", flexDirection: "column", gap: 16 }}>
            {reasons.map((r, i) => (
              <Reveal key={r.n} delay={i * 60}>
                <div className="card card-glow">
                  <div style={{ display: "flex", gap: 24, alignItems: "flex-start" }}>
                    <div className="font-mono" style={{ fontSize: 13, color: "var(--brand)", paddingTop: 4 }}>{r.n}</div>
                    <div>
                      <h3 className="h-card" style={{ marginBottom: 10 }}>{r.t}</h3>
                      <p style={{ color: "var(--fg-2)", margin: 0 }}>{r.d}</p>
                    </div>
                  </div>
                </div>
              </Reveal>
            ))}
          </div>
        </div>
        <style>{`
          @media (max-width: 880px) {
            .why-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
            .why-grid > div:first-child > div { position: static !important; }
          }
        `}</style>
      </div>
    </section>
  );
}

// -------- Tech --------
function TechStack() {
  const groups = [
    { label: "Frontend", items: ["React", "Next.js", "Astro", "Vue", "Svelte", "Tailwind", "Framer Motion"] },
    { label: "Mobile", items: ["Swift", "Kotlin", "React Native", "Flutter", "Expo"] },
    { label: "Backend", items: ["Node.js", "Python", "Postgres", "Supabase", "Firebase", "Redis"] },
    { label: "AI", items: ["OpenAI", "Anthropic", "LangChain", "n8n", "Pinecone", "Make", "Zapier"] },
    { label: "Ops", items: ["Vercel", "AWS", "Cloudflare", "Sentry", "Linear", "Figma"] },
  ];
  return (
    <section>
      <div className="container">
        <SectionHeader
          eyebrow="Tooling"
          title="A modern stack we know inside-out."
          subtitle="We're not religious about tools — but we are opinionated. These are the ones we reach for first because they earn their keep."
        />
        <div style={{ display: "flex", flexDirection: "column", gap: 0 }}>
          {groups.map((g, i) => (
            <Reveal key={g.label} delay={i * 50}>
              <div style={{
                display: "grid",
                gridTemplateColumns: "180px 1fr",
                gap: 32,
                padding: "28px 0",
                borderTop: "1px solid var(--border)",
                alignItems: "center",
              }} className="tech-row">
                <div className="font-mono" style={{ color: "var(--muted)", fontSize: 13, letterSpacing: "0.12em", textTransform: "uppercase" }}>
                  {g.label}
                </div>
                <div style={{ display: "flex", flexWrap: "wrap", gap: 10 }}>
                  {g.items.map((it) => (
                    <span key={it} className="chip">{it}</span>
                  ))}
                </div>
              </div>
            </Reveal>
          ))}
          <div style={{ borderTop: "1px solid var(--border)" }}/>
        </div>
        <style>{`
          @media (max-width: 720px) {
            .tech-row { grid-template-columns: 1fr !important; gap: 12px !important; }
          }
        `}</style>
      </div>
    </section>
  );
}

// -------- Process --------
function Process() {
  const steps = [
    { n: "01", t: "Discover", d: "We sit with you, your team, and your data. By the end of week one we know what success looks like — and we've written it down." },
    { n: "02", t: "Design", d: "Wireframes, prototypes, and a brand-aligned visual direction. You see real screens, not mood boards." },
    { n: "03", t: "Build", d: "Weekly demos, transparent Linear board, daily Slack. You're never wondering where the project is." },
    { n: "04", t: "Launch", d: "QA, performance audits, content load, and a clean launch checklist. Then we're on standby for the first 30 days." },
    { n: "05", t: "Iterate", d: "Once it's live, the real work starts. We measure, learn, and ship improvements on a steady cadence." },
  ];
  return (
    <section style={{ position: "relative" }}>
      <div className="container">
        <SectionHeader
          eyebrow="How we work"
          title="A process that respects your time."
          subtitle="No mysterious black box. Every project follows the same five phases — so you always know what's happening this week and what's next."
        />
        <div style={{ display: "grid", gridTemplateColumns: "repeat(5, 1fr)", gap: 0 }} className="process-grid">
          {steps.map((s, i) => (
            <Reveal key={s.n} delay={i * 70}>
              <div className="card" style={{ height: "100%", minHeight: 320, display: "flex", flexDirection: "column", justifyContent: "space-between", borderRadius: 0, marginLeft: i === 0 ? 0 : -1 }}>
                <div>
                  <div style={{
                    width: 44, height: 44, borderRadius: 12,
                    background: "var(--brand-faint)", border: "1px solid rgba(108,191,0,0.2)",
                    display: "grid", placeItems: "center",
                    color: "var(--brand)", fontFamily: "JetBrains Mono, monospace", fontSize: 13, fontWeight: 600,
                    marginBottom: 24,
                  }}>{s.n}</div>
                  <h3 className="font-display" style={{ fontSize: 22, marginBottom: 12 }}>{s.t}</h3>
                  <p style={{ color: "var(--fg-2)", fontSize: 14, lineHeight: 1.55 }}>{s.d}</p>
                </div>
              </div>
            </Reveal>
          ))}
        </div>
        <style>{`
          @media (max-width: 1100px) { .process-grid { grid-template-columns: repeat(2, 1fr) !important; } }
          @media (max-width: 600px) { .process-grid { grid-template-columns: 1fr !important; } }
        `}</style>
      </div>
    </section>
  );
}

// -------- Showcase --------
function Showcase() {
  const projects = [
    { tag: "WEB · E-COM", title: "Verdant Botanicals", subtitle: "Headless Shopify storefront for a plant subscription. +38% AOV in 90 days.", color: "#1A2E1A" },
    { tag: "APP · iOS", title: "Tigerline Banking", subtitle: "Consumer iOS app for a digital-first bank serving 50k+ Bangladeshi customers.", color: "#241B0D" },
    { tag: "AI · OPS", title: "Northwind Support", subtitle: "Tier-1 AI triage that handles 71% of tickets without a human reading them.", color: "#1A1F2E" },
    { tag: "WEB · SAAS", title: "Helix Labs", subtitle: "Marketing site + customer portal for a Series B observability platform.", color: "#2E1A2C" },
  ];
  return (
    <section>
      <div className="container">
        <SectionHeader
          eyebrow="Selected work"
          title="Recent projects we're proud of."
          subtitle="A small slice of what we've shipped this year. Names and numbers shared with permission — happy to walk you through any of them on a call."
        />
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 24 }} className="showcase-grid">
          {projects.map((p, i) => (
            <Reveal key={p.title} delay={i * 60}>
              <div className="card card-glow" style={{ padding: 0, overflow: "hidden", cursor: "pointer" }}>
                <div style={{
                  height: 280,
                  background: `linear-gradient(135deg, ${p.color}, var(--bg))`,
                  position: "relative",
                  display: "grid",
                  placeItems: "center",
                  borderBottom: "1px solid var(--border)",
                }}>
                  <ShowcaseGraphic i={i} />
                  <div className="chip" style={{ position: "absolute", top: 20, left: 20, background: "rgba(0,0,0,0.5)" }}>{p.tag}</div>
                </div>
                <div style={{ padding: 28 }}>
                  <h3 className="h-card" style={{ marginBottom: 8 }}>{p.title}</h3>
                  <p style={{ color: "var(--fg-2)", margin: 0, fontSize: 15 }}>{p.subtitle}</p>
                </div>
              </div>
            </Reveal>
          ))}
        </div>
        <style>{`
          @media (max-width: 880px) { .showcase-grid { grid-template-columns: 1fr !important; } }
        `}</style>
      </div>
    </section>
  );
}

function ShowcaseGraphic({ i }) {
  // Abstract placeholder graphics — different per index
  const variants = [
    <svg key="0" width="180" height="180" viewBox="0 0 180 180" fill="none">
      <circle cx="90" cy="90" r="60" stroke="var(--brand)" strokeWidth="1.5" opacity="0.4"/>
      <circle cx="90" cy="90" r="40" stroke="var(--brand)" strokeWidth="1.5" opacity="0.6"/>
      <circle cx="90" cy="90" r="20" fill="var(--brand)"/>
    </svg>,
    <svg key="1" width="180" height="180" viewBox="0 0 180 180" fill="none">
      <rect x="40" y="20" width="100" height="140" rx="14" stroke="var(--brand)" strokeWidth="1.5"/>
      <rect x="60" y="50" width="60" height="6" rx="3" fill="var(--brand)" opacity="0.8"/>
      <rect x="60" y="64" width="40" height="6" rx="3" fill="var(--brand)" opacity="0.4"/>
      <rect x="60" y="100" width="60" height="40" rx="8" fill="var(--brand)" opacity="0.2"/>
    </svg>,
    <svg key="2" width="180" height="180" viewBox="0 0 180 180" fill="none">
      <path d="M30 90 L70 90 L90 60 L110 120 L130 90 L150 90" stroke="var(--brand)" strokeWidth="2" fill="none"/>
      <circle cx="90" cy="60" r="4" fill="var(--brand)"/>
      <circle cx="110" cy="120" r="4" fill="var(--brand)"/>
      <circle cx="30" cy="90" r="4" fill="var(--brand)"/>
      <circle cx="150" cy="90" r="4" fill="var(--brand)"/>
    </svg>,
    <svg key="3" width="180" height="180" viewBox="0 0 180 180" fill="none">
      <rect x="20" y="30" width="140" height="120" rx="8" stroke="var(--brand)" strokeWidth="1.5" opacity="0.5"/>
      <rect x="40" y="50" width="40" height="80" rx="4" fill="var(--brand)" opacity="0.3"/>
      <rect x="90" y="50" width="60" height="36" rx="4" fill="var(--brand)" opacity="0.6"/>
      <rect x="90" y="94" width="60" height="36" rx="4" fill="var(--brand)" opacity="0.2"/>
    </svg>,
  ];
  return variants[i % variants.length];
}

// -------- Testimonials --------
function Testimonials() {
  const items = [
    { q: "We've used three agencies before Design Brains. None of them shipped on time, on scope, and on budget. These folks did all three.", a: "Ayesha Karim", r: "VP Product, Tigerline" },
    { q: "The AI triage they built handles 70% of our support volume now. Our queue went from anxiety-inducing to boring. I'll take boring.", a: "Marcus Wynn", r: "Head of Ops, Northwind" },
    { q: "They turned a mood board into a brand we now hear our customers use back to us. Worth every taka.", a: "Tahmid Chowdhury", r: "Founder, Verdant" },
  ];
  return (
    <section>
      <div className="container">
        <SectionHeader
          eyebrow="From the team"
          title="What clients tell us after launch."
          subtitle="We won't pretend every project is glassy-smooth — but we will tell you what we did when it wasn't. These are unedited quotes from kickoff retros."
        />
        <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 20 }} className="test-grid">
          {items.map((it, i) => (
            <Reveal key={i} delay={i * 60}>
              <div className="card" style={{ display: "flex", flexDirection: "column", gap: 24, height: "100%" }}>
                <div className="font-mono" style={{ fontSize: 32, color: "var(--brand)", lineHeight: 0.5 }}>"</div>
                <p style={{ fontFamily: "DM Sans", fontSize: 19, lineHeight: 1.4, letterSpacing: "-0.01em", margin: 0, flex: 1 }}>
                  {it.q}
                </p>
                <div style={{ borderTop: "1px solid var(--border)", paddingTop: 20, display: "flex", alignItems: "center", gap: 12 }}>
                  <div style={{
                    width: 40, height: 40, borderRadius: "50%",
                    background: "linear-gradient(135deg, var(--brand), #2A4A0E)",
                    display: "grid", placeItems: "center",
                    color: "#0A0C09", fontWeight: 700, fontSize: 14,
                  }}>{it.a.split(" ").map(s => s[0]).join("")}</div>
                  <div>
                    <div style={{ fontWeight: 600, fontSize: 14 }}>{it.a}</div>
                    <div style={{ fontSize: 12, color: "var(--muted)" }}>{it.r}</div>
                  </div>
                </div>
              </div>
            </Reveal>
          ))}
        </div>
        <style>{`
          @media (max-width: 880px) { .test-grid { grid-template-columns: 1fr !important; } }
        `}</style>
      </div>
    </section>
  );
}

// -------- FAQ Preview --------
function FAQPreview() {
  const items = [
    { q: "How long does a typical project take?", a: "Marketing sites: 3–6 weeks. Web/mobile apps: 8–16 weeks. AI automations: 2–8 weeks depending on scope. We'll give you a phase-by-phase calendar before you sign anything." },
    { q: "What's the engagement model?", a: "Fixed-price phases for delivery, optional monthly care plan after launch. We don't do open-ended hourly billing — it's bad for both of us." },
    { q: "Will my team be able to maintain what you build?", a: "Yes. We hand off documentation, recorded walkthroughs, and a 30-day support window. No vendor lock-in — ever." },
  ];
  const [open, setOpen] = useState(0);
  return (
    <section style={{ background: "var(--bg-2)", borderTop: "1px solid var(--border)", borderBottom: "1px solid var(--border)" }}>
      <div className="container">
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1.4fr", gap: 64, alignItems: "start" }} className="faq-prev">
          <Reveal>
            <div>
              <div className="eyebrow" style={{ marginBottom: 20 }}>FAQ</div>
              <h2 className="h-section" style={{ marginBottom: 24 }}>The questions<br/>everyone asks first.</h2>
              <p className="lead" style={{ marginBottom: 32 }}>
                Quick answers below. The full list lives on the FAQ page — and if yours isn't there, we'll answer it personally.
              </p>
              <Button variant="ghost" to="/faq">All FAQs →</Button>
            </div>
          </Reveal>
          <div>
            {items.map((it, i) => (
              <Reveal key={i} delay={i * 60}>
                <div
                  onClick={() => setOpen(open === i ? -1 : i)}
                  style={{
                    borderTop: "1px solid var(--border)",
                    padding: "24px 0",
                    cursor: "pointer",
                  }}
                >
                  <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", gap: 24 }}>
                    <h3 className="font-display" style={{ fontSize: 20, fontWeight: 600 }}>{it.q}</h3>
                    <div style={{
                      width: 32, height: 32, borderRadius: "50%",
                      border: "1px solid var(--border-strong)",
                      display: "grid", placeItems: "center",
                      transition: "all 0.3s var(--ease)",
                      color: open === i ? "var(--brand)" : "var(--fg-2)",
                      transform: open === i ? "rotate(45deg)" : "none",
                      flexShrink: 0,
                    }}>+</div>
                  </div>
                  <div style={{
                    overflow: "hidden",
                    maxHeight: open === i ? 200 : 0,
                    transition: "max-height 0.4s var(--ease), margin-top 0.4s var(--ease)",
                    marginTop: open === i ? 16 : 0,
                  }}>
                    <p style={{ color: "var(--fg-2)", margin: 0, maxWidth: 600 }}>{it.a}</p>
                  </div>
                </div>
              </Reveal>
            ))}
            <div style={{ borderTop: "1px solid var(--border)" }}/>
          </div>
        </div>
        <style>{`
          @media (max-width: 880px) { .faq-prev { grid-template-columns: 1fr !important; gap: 32px !important; } }
        `}</style>
      </div>
    </section>
  );
}

window.HomePage = HomePage;
