// Shared content for both directions. Original copy — do not source from outside.

// Shared responsive hook. Returns the current viewport width and re-renders
// on resize/orientation change so components can branch on breakpoint.
// Used by direction-a.jsx, case-study.jsx and blog.jsx.
window.useViewport = function useViewport() {
  const read = () =>
    (typeof window !== "undefined" ? window.innerWidth : 1280);
  const [w, setW] = React.useState(read);
  React.useEffect(() => {
    let raf = 0;
    const onResize = () => {
      cancelAnimationFrame(raf);
      raf = requestAnimationFrame(() => setW(read()));
    };
    window.addEventListener("resize", onResize);
    window.addEventListener("orientationchange", onResize);
    return () => {
      cancelAnimationFrame(raf);
      window.removeEventListener("resize", onResize);
      window.removeEventListener("orientationchange", onResize);
    };
  }, []);
  // mobile: phones (≤640) · compact: small tablets / large phones (≤900)
  return { w, isMobile: w <= 640, isCompact: w <= 900 };
};

window.RAHIM_DATA = {
  name: "Abdul Rahim",
  short: "Rahim",
  role: "Websites, mobile apps & AI assistants — built with AI",
  city: "Abu Dhabi, UAE",
  email: "hello@rahim.ae",
  email_prefix: "hello",
  email_domain: "rahim.ae",

  hero_a_pre: "Hello — I'm Rahim,",
  hero_a_main: "I use AI to build websites, mobile apps and assistants that actually work.",
  hero_a_sub: "Independent builder in Abu Dhabi. I use Claude, Gemini and ChatGPT to ship fast, well-made websites, mobile apps, AI agents and CRMs for founders and small teams.",

  hero_b_kicker: "RAHIM / EST. 2019",
  hero_b_main: "WEBSITES,\nMOBILE APPS,\nAI ASSISTANTS.",
  hero_b_sub: "Independent builder out of Abu Dhabi. I use Claude, Gemini and ChatGPT to ship websites, apps and assistants for founders and small teams.",

  services: [
    { n: "01", k: "Websites",          d: "Fast, modern websites that look great, load quickly and rank well on Google. Built with AI, finished by hand." },
    { n: "02", k: "Mobile Apps",       d: "iOS and Android apps for startups and small businesses. Clean design, real users, ready for the App Store." },
    { n: "03", k: "AI Assistants",     d: "Chatbots and assistants for your website, WhatsApp or team — answering questions, booking calls, helping customers." },
    { n: "04", k: "AI Agents & CRMs",  d: "Smart CRMs and agents that draft replies, follow up with leads and handle the busywork so your team can sell." },
    { n: "05", k: "Automation & SEO",  d: "Connect your tools, automate the boring stuff, and get found on Google. One simple plan, clear results." },
  ],

  projects: [
    {
      id: "ixana",
      title: "Website rebuild",
      client: "ixana.ai",
      year: "2026",
      tag: "Marketing site",
      blurb: "A new home for an AI infra startup heading into Series A. Redesign, build, and a 41% lift in trial signups in the first quarter.",
      tone: ["#9D7BFF", "#1A1430"],
      image: "assets/ixana-full.jpg",
      scroll: true,
      href: "pages/ixana.html",
      sector: "AI infrastructure",
      role_did: "Design, build, copy",
      stack: ["Next.js", "Sanity", "Tailwind", "Claude"],
      timeline: "6 weeks",
      result: "+41% trial signups, Q1 post-launch",
      summary: "Ixana is an AI infrastructure company building Wi-R — a wire-like wireless protocol for the AI era. Heading into a Series A round, they needed a site that explained a deeply technical product without burying the lede.",
      challenge: "The previous site was an investor deck dressed as a homepage. Engineers, partners and journalists all landed on the same page and bounced. The team needed three audiences to feel spoken to, without three sites.",
      approach: "We rewrote the homepage around one sentence — 'a second nervous system for physical AI' — and layered three context lanes underneath: technology, products, applications. Built in Next.js, content in Sanity so the team can ship updates without me.",
    },
    {
      id: "anoha",
      title: "Marketing site & brand",
      client: "Anoha",
      year: "2026",
      tag: "Marketing site",
      blurb: "A trusted-partner site for an oilfield services firm operating across 30+ countries. Editorial photography, leadership profiles, and a clean lifecycle narrative for procurement teams.",
      tone: ["#3A6FAA", "#0E1A2C"],
      image: "assets/anoha-full.png",
      scroll: true,
      href: "pages/anoha.html",
      sector: "Oilfield services",
      role_did: "Site design & build, brand refresh",
      stack: ["Next.js", "MDX", "Tailwind", "Cloudinary"],
      timeline: "5 weeks",
      result: "2× procurement inquiries in first quarter",
      summary: "Anoha provides drilling, completion and lifecycle services to operators across 30+ countries. Their old site looked like every other oilfield services vendor — they wanted to feel like a partner, not a catalogue.",
      challenge: "Procurement teams skim. Leadership profiles, certifications, country presence and case studies all needed to be one click away — without the homepage becoming a wall of text.",
      approach: "An editorial layout with strong typography and original photography. A short value proposition above the fold, then a horizontal lifecycle narrative from exploration to abandonment, with country and capability filters underneath.",
    },
    {
      id: "leatherzone",
      title: "Studio site & lookbook",
      client: "Leather Zone",
      year: "2025",
      tag: "Craft · Workshop",
      blurb: "Two decades of leather repair, upholstery and marine joinery handled by the same Al Quoz workshop. Site, photography direction, and a WhatsApp-first inquiry flow.",
      tone: ["#C68B5C", "#1A1108"],
      image: "assets/leatherzone-full.png",
      scroll: true,
      href: "pages/leatherzone.html",
      sector: "Craft · workshop",
      role_did: "Site, photography direction",
      stack: ["Astro", "Tailwind", "WhatsApp Business"],
      timeline: "3 weeks",
      result: "+3× weekly WhatsApp inquiries",
      summary: "Leather Zone is a twenty-year-old leather workshop in Al Quoz, Dubai. Sofas, car interiors, yachts, bags — if it's leather, they fix it. Their existing site was a hidden Facebook page.",
      challenge: "Most customers find them by word of mouth and message on WhatsApp. We needed a site that respected that flow — not a contact form, not a quote builder, just confidence + a 'message us' button.",
      approach: "A short, photo-led marketing site with the work front and centre. Every service block ends in a WhatsApp deep link prefilled with the right enquiry. Built in Astro for speed; the whole site is under 80KB on first load.",
    },
    {
      id: "fold",
      title: "Reidis Interactive",
      client: "reidis.com",
      year: "2024",
      tag: "Co-founder · Studio",
      blurb: "The site for the studio I co-founded. Case-study format, custom CMS, doubled inbound qualified leads after launch.",
      tone: ["#E8DFC8", "#171410"],
      href: "pages/reidis.html",
      sector: "Software studio",
      role_did: "Co-founder, design lead",
      stack: ["Next.js", "Custom CMS", "Vercel"],
      timeline: "Ongoing",
      result: "2× qualified inbound leads post-launch",
      summary: "Reidis Interactive is the small product studio I co-founded. We build software for early-stage clients — usually a marketing site plus a working MVP, shipped in a quarter.",
      challenge: "Studio sites all look the same: bold serif headline, three case studies, a contact form. We wanted ours to feel like a portfolio of products, not a portfolio of pages.",
      approach: "A case-study-first homepage where the first thing you see is a working product, not a marketing pitch. Each case study links to a live demo. Custom CMS so the team can publish without engineering.",
    },
    {
      id: "archive",
      title: "Personal archive",
      client: "archive.rahim.ae",
      year: "ongoing",
      tag: "Side project",
      blurb: "A long-form writing archive — every post I've published since 2017, redesigned with proper typography and full-text search.",
      tone: ["#7A93B8", "#0E141B"],
      href: "pages/archive.html",
      sector: "Side project",
      role_did: "Everything",
      stack: ["Astro", "MDX", "Pagefind"],
      timeline: "Ongoing",
      result: "Searchable archive of 80+ posts",
      summary: "A long-form writing archive. Every post I've published since 2017, in one place, with proper typography and a search box that actually works.",
      challenge: "I'd written for five different blogs and Medium across nine years. Half the posts had broken images, the other half had no canonical URL. SEO was a mess.",
      approach: "Migrated everything to MDX, rewrote image paths, added Pagefind for full-text search, and set up canonical redirects. The result is a slow, deliberate reading site I actually want to maintain.",
    },
  ],

  writing: [
    { slug: "slow-web-design",       date: "May 2026", title: "Notes on slow web design",                  tag: "Craft",     read: "8 min" },
    { slug: "portfolio-is-a-product",date: "Mar 2026", title: "Your portfolio is a product, treat it as one", tag: "Career",    read: "6 min" },
    { slug: "marketing-for-engineers",date:"Feb 2026", title: "Marketing for engineers who hate marketing",    tag: "Marketing", read: "11 min" },
    { slug: "rebuilding-rahim-ae",   date: "Dec 2025", title: "On rebuilding rahim.ae for the fifth time",     tag: "Meta",      read: "5 min" },
    { slug: "boring-seo",            date: "Oct 2025", title: "The case for boring SEO",                       tag: "SEO",       read: "9 min" },
  ],

  testimonials: [
    {
      q: "Rahim shipped the marketing site in three weeks and didn't ask us a single dumb question. Our trial signups went up 41% the quarter after launch.",
      who: "Maya Khan",
      role: "Co-founder, ixana.ai",
    },
    {
      q: "Half developer, half marketer, fully obsessed with the work. The rare freelancer you keep on retainer because you can't afford not to.",
      who: "Daniyal Rao",
      role: "CEO, Reidis Interactive",
    },
    {
      q: "He thinks like an editor and codes like an engineer. Our site reads better and ranks better — both, somehow, at the same time.",
      who: "Sara Nasir",
      role: "Founder, Plaintext Studio",
    },
  ],

  about: {
    p1: "I'm Rahim — an independent builder based in Abu Dhabi. I use AI to design and ship websites, mobile apps and assistants for founders and small teams who want to move fast without hiring an agency.",
    p2: "I work with Claude, Gemini and ChatGPT every day. That means projects that used to take three months take three weeks — and you still get something that looks and feels handcrafted.",
    p3: "Currently taking on two new projects per quarter. Best fit: founders launching something new, small businesses upgrading their website, or teams adding AI to how they already work.",
    stats: [
      { n: "60+", k: "Projects shipped" },
      { n: "6yr", k: "Independent" },
      { n: "3",   k: "AI models I build on" },
      { n: "2",   k: "Open slots" },
    ],
  },
};
