// Content layer: the shipped content, the React context, and fetch + merge.
// DHEEMI_DEFAULT is a complete copy of what the site ships with. If /api/content
// is slow or down, the site renders identically from it. Keep it in sync with
// the shape the renderers and the admin expect.
//
// Loaded by index.html, project.html AND admin/index.html, so nothing in here may
// depend on lib.jsx or sections.jsx.

/* ------------------------------ default content ------------------------------ */
window.DHEEMI_SCHEMA = 2;

window.DHEEMI_DEFAULT = {
  // The site document is versioned. A saved document from an older design has a
  // different shape entirely, so readers ignore it instead of half-merging it.
  schema: 2,
  meta: {
    title: "Dheemi Studio · Design, content and code from Malé",
    description: "Dheemi is a small studio in Malé. We make brand identities, websites and apps for businesses in the Maldives.",
  },
  nav: {
    cta: "Start a project",
    links: [
      { id: "work", label: "Work" },
      { id: "services", label: "Services" },
      { id: "studio", label: "Studio" },
      { id: "contact", label: "Contact" },
    ],
  },
  hero: {
    headline: "Design, content and code from one studio in Malé.",
    lead: "We make brand identities, websites and apps for businesses in the Maldives. One small team, from the first sketch to launch day.",
    ctaPrimary: "Start a project",
    ctaSecondary: "See the work",
    // slugs shown in the reel under the headline. Empty means the first six.
    reel: ["cora-vida", "healthcare-solutions", "pelago", "mr-delivery", "clean-force", "atoll-career"],
  },
  work: {
    heading: "Some of our work",
    lead: "Brands, websites and apps for businesses across the Maldives, from clinics and couriers to a seaweed farm.",
  },
  statement: {
    before: "One studio",
    after: "from the logo to the launch.",
    sub: "Design, writing and development sit at the same desk, so nothing gets lost between them.",
  },
  services: {
    heading: "What we make",
    lead: "Four kinds of work, often for the same client.",
    items: [
      {
        title: "Brand identity",
        body: "Logos, colour and type, with guidelines your team can follow without us in the room.",
        includes: ["Logo design", "Brand guidelines", "Stationery and uniforms", "Signage and print"],
        project: "pelago",
      },
      {
        title: "Websites",
        body: "Sites we design, write and build ourselves, then keep running after launch.",
        includes: ["Design and build", "Content management", "Hosting or handover", "Search basics"],
        project: "cora-vida",
      },
      {
        title: "Apps and web apps",
        body: "Booking, ordering and recruitment tools that businesses run their day on.",
        includes: ["Product design", "Web apps", "Mobile apps", "Dashboards and admin"],
        project: "atoll-career",
      },
      {
        title: "Content and social",
        body: "Posts, ads and short videos that keep a brand in front of the people it serves.",
        includes: ["Social media management", "Campaigns and web ads", "Photo and video", "Monthly calendars"],
        project: "healthcare-solutions",
      },
    ],
  },
  clients: {
    heading: "Who we work with",
    lead: "Healthcare, recruitment, logistics, hospitality, food and farming, mostly in Malé and Hulhumalé.",
    // extra names without a project page. { name, logo } or plain strings.
    items: [],
  },
  studio: {
    heading: "A small studio in Malé",
    body: "Dheemi is a small team of designers and developers. You talk to the people doing the work, from the first call to the handover, and we stay on after launch.",
    points: [
      { title: "One team", body: "Design, content and code under one roof, so the brand, the site and the posts match." },
      { title: "Plain process", body: "A short brief, a fixed scope, a first draft within two weeks, then rounds until it is right." },
      { title: "Local", body: "Based in Malé and working across the Maldives, in Dhivehi and English." },
      { title: "After launch", body: "We can host, update and look after what we build, or hand it over to your own accounts. Either way, you are never left with a site nobody can edit." },
    ],
    team: [],
  },
  contact: {
    heading: "Start a project",
    lead: "Fill in the letter and we will reply within one working day.",
    email: "hello@dheemi.mv",
    services: ["A brand identity", "A website", "An app", "Social content", "Something else"],
    timing: ["This month", "In the next few months", "Whenever suits"],
    success: "We will reply within one working day.",
  },
  footer: {
    address: "Dheemi Studio LLP · Malé, Maldives",
    social: [
      { label: "Instagram", href: "https://instagram.com/dheemi.mv" },
      { label: "LinkedIn", href: "https://www.linkedin.com/company/dheemi" },
    ],
    copyright: "© 2026 Dheemi Studio LLP",
  },
};

/* ------------------------------ default projects ----------------------------
   Real client work. Each row mirrors a row in the `projects` table:
     title, type (what we made), year, sector, summary, tagline, overview,
     cover_url, logo_url, gallery [{url, caption, w, h, kind}],
     deliverables [string], facts [{label, value}], link_url, link_label.  */
// BEGIN GENERATED PROJECTS
window.DHEEMI_PROJECTS = [
  {
    "slug": "caretrust",
    "title": "Care Trust",
    "type": "Website and patient platform",
    "year": "2026",
    "sector": "Healthcare",
    "summary": "Website, live queue board and staff admin for a multispecialty clinic in Hulhumalé.",
    "overview": "We designed and built the website for Care Trust, a multispecialty clinic in Hulhumalé. Patients can browse specialties, doctors and health packages, check the live queue room by room, and order from the clinic shop. Behind it sits a staff admin for content, doctor schedules and appointment requests. The site runs on the clinic's own server and went live in October 2026.",
    "cover_url": "/assets/work/caretrust/cover.webp",
    "cover_w": 2400,
    "cover_h": 1452,
    "logo_url": "/assets/work/caretrust/logo.svg",
    "deliverables": [
      "Website design and build",
      "Staff admin and content management",
      "Live queue board",
      "Appointment requests",
      "Patient portal",
      "Online shop"
    ],
    "gallery": [
      {
        "url": "/assets/work/caretrust/01-specialties.webp",
        "caption": "Specialties section, desktop",
        "w": 2400,
        "h": 1317,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/caretrust/02-facilities.webp",
        "caption": "Facilities gallery, desktop",
        "w": 2358,
        "h": 2400,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/caretrust/03-doctors.webp",
        "caption": "Doctors page, desktop",
        "w": 2400,
        "h": 1467,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/caretrust/04-live-queue.webp",
        "caption": "Live queue board, desktop",
        "w": 2400,
        "h": 1567,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/caretrust/05-mobile-home.webp",
        "caption": "Homepage on mobile",
        "w": 780,
        "h": 1472,
        "kind": "website-mobile"
      },
      {
        "url": "/assets/work/caretrust/06-mobile-facilities.webp",
        "caption": "Facilities on mobile",
        "w": 780,
        "h": 1688,
        "kind": "website-mobile"
      }
    ],
    "facts": [],
    "link_url": "https://caretrust.mv",
    "link_label": "Visit the live site",
    "sort": 0
  },
  {
    "slug": "clean-force",
    "title": "Clean Force",
    "type": "Website, online booking and staff admin",
    "year": "2026",
    "sector": "Home services",
    "summary": "Booking website, customer portal and staff admin for a cleaning company in Malé.",
    "overview": "We designed and built the website, online booking and staff admin for Clean Force, a Maldivian-owned cleaning company working in Malé, Hulhumalé and Vilimalé. Customers see every price up front, pick a free two-hour window and track their booking without calling. Staff run bookings, the weekly schedule, crews, quotes, invoices and sales from one admin. The site went live in November 2026.",
    "cover_url": "/assets/work/clean-force/cover.webp",
    "cover_w": 2400,
    "cover_h": 1500,
    "logo_url": "/assets/work/clean-force/logo.svg",
    "deliverables": [
      "Website design and development",
      "Online booking with fixed prices and live free times",
      "Customer accounts and booking tracking",
      "Public schedule page",
      "Staff admin for bookings, schedule, crews, quotes, invoices and sales",
      "Light and dark mode"
    ],
    "gallery": [
      {
        "url": "/assets/work/clean-force/01-pricing.webp",
        "caption": "Price picker, desktop",
        "w": 2400,
        "h": 1152,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/clean-force/02-past-jobs.webp",
        "caption": "Past jobs, filmed on real cleans",
        "w": 2400,
        "h": 1387,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/clean-force/03-home-mobile.webp",
        "caption": "Homepage on mobile",
        "w": 780,
        "h": 1688,
        "kind": "website-mobile"
      },
      {
        "url": "/assets/work/clean-force/04-booking-mobile.webp",
        "caption": "Booking flow on mobile",
        "w": 780,
        "h": 1688,
        "kind": "website-mobile"
      },
      {
        "url": "/assets/work/clean-force/05-staff-admin.webp",
        "caption": "Staff admin, weekly schedule, demo data",
        "w": 2400,
        "h": 1500,
        "kind": "app"
      }
    ],
    "facts": [],
    "link_url": "https://cleanforcemv.com",
    "link_label": "Visit the live site",
    "sort": 1
  },
  {
    "slug": "mr-delivery",
    "title": "Mr. Delivery Man",
    "type": "Web app design and development",
    "year": "2026",
    "sector": "Logistics",
    "summary": "Customer website, ordering, tracking, office portal and driver console for a delivery service in Malé.",
    "overview": "Mr. Delivery Man picks up, shops and delivers across Malé, Hulhumalé, the airport and Vilimalé. We designed and built the software behind it as one web app: a customer site with ordering and tracking, a portal for business accounts, a driver console and an office portal for pricing, dispatch and payments. It runs in the browser on any phone or computer, so customers and riders have nothing to install.",
    "cover_url": "/assets/work/mr-delivery/cover.webp",
    "cover_w": 2400,
    "cover_h": 1500,
    "logo_url": "/assets/work/mr-delivery/logo.svg",
    "deliverables": [
      "Customer website",
      "Delivery request and payment flow",
      "Order tracking",
      "Business portal",
      "Driver console",
      "Office portal"
    ],
    "gallery": [
      {
        "url": "/assets/work/mr-delivery/01-services.webp",
        "caption": "Services, desktop",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/mr-delivery/02-shop-and-deliver.webp",
        "caption": "Shop and deliver banner",
        "w": 2400,
        "h": 899,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/mr-delivery/03-request-form.webp",
        "caption": "Request a delivery, desktop",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/mr-delivery/04-home-mobile.webp",
        "caption": "Homepage on mobile",
        "w": 780,
        "h": 1688,
        "kind": "website-mobile"
      },
      {
        "url": "/assets/work/mr-delivery/05-office-live-map.webp",
        "caption": "Office portal live map, demo data",
        "w": 2400,
        "h": 1500,
        "kind": "app"
      },
      {
        "url": "/assets/work/mr-delivery/06-driver-console-mobile.webp",
        "caption": "Driver console on mobile, demo data",
        "w": 780,
        "h": 1688,
        "kind": "app"
      }
    ],
    "facts": [],
    "link_url": "https://mrdeliveryman.com",
    "link_label": "Visit the live site",
    "sort": 2
  },
  {
    "slug": "cora-vida",
    "title": "Coravida",
    "type": "Website and branding",
    "year": "2026",
    "sector": "Tourism",
    "summary": "Brand guidelines and a four-language charter website for a private yacht operator in Malé.",
    "overview": "Coravida runs private charters out of Hulhumalé Marina, with Tiffany Blanc 14 as its flagship. We wrote the brand guidelines, covering colour, type and how the logo is used. We then built the website around the client's own drone and on-board footage, in English, Russian, Chinese and German. It has an excursion guide, an availability calendar that feeds into enquiries, and an admin the office uses to edit the site.",
    "cover_url": "/assets/work/cora-vida/cover.webp",
    "cover_w": 2400,
    "cover_h": 1434,
    "logo_url": "/assets/work/cora-vida/logo.webp",
    "deliverables": [
      "Brand guidelines",
      "Website in four languages",
      "Excursion pages and availability calendar",
      "Enquiry flow",
      "Content admin"
    ],
    "gallery": [
      {
        "url": "/assets/work/cora-vida/01-charters-desktop.webp",
        "caption": "Charters section on the homepage",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/cora-vida/02-gallery-desktop.webp",
        "caption": "Gallery, desktop",
        "w": 2400,
        "h": 1667,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/cora-vida/03-availability-desktop.webp",
        "caption": "Availability calendar on the excursions page",
        "w": 2400,
        "h": 1900,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/cora-vida/04-home-mobile.webp",
        "caption": "Homepage on mobile",
        "w": 780,
        "h": 1688,
        "kind": "website-mobile"
      },
      {
        "url": "/assets/work/cora-vida/06-colour.webp",
        "caption": "Colour palette",
        "w": 2400,
        "h": 1697,
        "kind": "brand"
      }
    ],
    "facts": [],
    "link_url": "https://coravida.vercel.app/",
    "link_label": "Visit the live site",
    "sort": 3
  },
  {
    "slug": "atoll-career",
    "title": "Atoll Career",
    "type": "Web platform and social media",
    "year": "2026",
    "sector": "Recruitment",
    "summary": "Job board, hiring workspace and social posts for a recruitment platform in the Maldives.",
    "overview": "Atoll Career is a recruitment platform for the Maldives. It connects job seekers with employers checked against records from MIRA, the national tax authority. We designed and built the whole web app: a public job board and employer directory, a free portal for job seekers, a workspace where employers post roles and review applicants, and an admin backend for the Atoll Career team. We also designed the LinkedIn launch teasers and a series of social media posts.",
    "cover_url": "/assets/work/atoll-career/cover.webp",
    "cover_w": 2400,
    "cover_h": 1338,
    "logo_url": "/assets/work/atoll-career/logo.webp",
    "deliverables": [
      "Public job board and employer directory",
      "Job seeker portal",
      "Employer hiring workspace",
      "Admin backend",
      "Social media posts",
      "LinkedIn launch teasers"
    ],
    "gallery": [
      {
        "url": "/assets/work/atoll-career/01-how-it-works.webp",
        "caption": "How it works section, desktop",
        "w": 2400,
        "h": 1634,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/atoll-career/02-for-employers.webp",
        "caption": "For employers page",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/atoll-career/03-sign-in.webp",
        "caption": "Sign in screen",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/atoll-career/04-mobile-home.webp",
        "caption": "Homepage on mobile",
        "w": 780,
        "h": 1686,
        "kind": "website-mobile"
      },
      {
        "url": "/assets/work/atoll-career/05-launch-teaser-post.webp",
        "caption": "Launch teaser post for LinkedIn",
        "w": 1080,
        "h": 1350,
        "kind": "social"
      },
      {
        "url": "/assets/work/atoll-career/06-hiring-landscape-post.webp",
        "caption": "Social post, hiring landscape series",
        "w": 1080,
        "h": 1350,
        "kind": "social"
      }
    ],
    "facts": [],
    "link_url": "https://atollcareer.com",
    "link_label": "Visit the live site",
    "sort": 4
  },
  {
    "slug": "pelago",
    "title": "Pelago",
    "type": "Brand identity and website concept",
    "year": "2026",
    "sector": "Family entertainment",
    "summary": "Brand identity, venue marks and a website concept for a family entertainment floor in Hulhumalé.",
    "overview": "Pelago is a family entertainment floor on Level 2 of The Promenade in Hulhumalé, home to six venues. We drew the logo as a diving mask with the reef inside and gave each venue its own mark and colour. Our guidelines hold them together, from signs and kiosks to social templates. We also built a website concept that treats the page as a dive, from the beach down to the arcade at 18 m.",
    "cover_url": "/assets/work/pelago/cover.webp",
    "cover_w": 2400,
    "cover_h": 1500,
    "logo_url": "/assets/work/pelago/logo.svg",
    "deliverables": [
      "Logo and wordmark, in six colourways",
      "Six venue marks and app tiles",
      "Colour and type system",
      "Signature graphic",
      "Brand guidelines and guidelines supplement",
      "Signage, wayfinding and floor directory",
      "Kiosk standards",
      "Social, business card and stationery templates",
      "Website concept"
    ],
    "gallery": [
      {
        "url": "/assets/work/pelago/01-brand-idea.webp",
        "caption": "The idea: the sea, seen through a mask",
        "w": 2400,
        "h": 1697,
        "kind": "brand"
      },
      {
        "url": "/assets/work/pelago/02-venue-marks.webp",
        "caption": "Marks for the six venues on the floor",
        "w": 2400,
        "h": 1697,
        "kind": "brand"
      },
      {
        "url": "/assets/work/pelago/03-signature-graphic.webp",
        "caption": "Signature graphic, the mask seen from above",
        "w": 2400,
        "h": 1697,
        "kind": "brand"
      },
      {
        "url": "/assets/work/pelago/04-brand-in-use.webp",
        "caption": "Entrance wall, gift card and floor directory",
        "w": 2400,
        "h": 1697,
        "kind": "brand"
      },
      {
        "url": "/assets/work/pelago/05-website-floor-map.webp",
        "caption": "Website concept, interactive floor map",
        "w": 2400,
        "h": 1697,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/pelago/06-website-pixel-reef.webp",
        "caption": "Website concept, Pixel Reef arcade",
        "w": 2400,
        "h": 1697,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/pelago/07-website-mobile.webp",
        "caption": "Open now, on mobile",
        "w": 780,
        "h": 1688,
        "kind": "website-mobile"
      }
    ],
    "facts": [],
    "link_url": "",
    "link_label": "",
    "sort": 5
  },
  {
    "slug": "healthcare-solutions",
    "title": "Healthcare Solutions",
    "type": "Website, content admin and brand collateral",
    "year": "2026",
    "sector": "Medical assistance",
    "summary": "Website, content admin, social posts and business cards for a Maldivian medical claims company.",
    "overview": "Healthcare Solutions sits between international insurers and Maldivian hospitals, so a traveller who falls ill is admitted without paying a deposit. We designed and built their website, with pages for services, the claims process, the partner network and insights. Every word on the site can be edited from an admin, and the enquiry forms save to a database. We also made their social media posts, business cards, a LinkedIn banner, an app icon and a short brand video.",
    "cover_url": "/assets/work/healthcare-solutions/cover.webp",
    "cover_w": 2400,
    "cover_h": 1290,
    "logo_url": "/assets/work/healthcare-solutions/logo.svg",
    "deliverables": [
      "Marketing website, seven pages",
      "Content admin for every page",
      "Enquiry forms",
      "Scroll-driven story sequence on the homepage",
      "Social media posts",
      "Business cards",
      "LinkedIn banner",
      "App icon",
      "Brand video"
    ],
    "gallery": [
      {
        "url": "/assets/work/healthcare-solutions/01-story-sequence.webp",
        "caption": "Scroll story on the homepage",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/healthcare-solutions/02-services.webp",
        "caption": "Services, desktop",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/healthcare-solutions/03-claims-process.webp",
        "caption": "Claims process page",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/healthcare-solutions/04-homepage-mobile.webp",
        "caption": "Homepage on mobile",
        "w": 780,
        "h": 1688,
        "kind": "website-mobile"
      },
      {
        "url": "/assets/work/healthcare-solutions/05-social-post.webp",
        "caption": "Social post",
        "w": 1080,
        "h": 1350,
        "kind": "social"
      },
      {
        "url": "/assets/work/healthcare-solutions/06-business-card.webp",
        "caption": "Business card, back",
        "w": 2400,
        "h": 1372,
        "kind": "print"
      }
    ],
    "facts": [],
    "link_url": "https://www.healthcaresolutionsmaldives.com",
    "link_label": "Visit the live site",
    "sort": 6
  },
  {
    "slug": "meat-the-butcher",
    "title": "Meat the Butcher",
    "type": "E-commerce website and social media",
    "year": "2026",
    "sector": "Food retail",
    "summary": "Online shop, admin console and social media for a halal butcher in Malé and Hulhumalé.",
    "overview": "We designed and built the online shop for Meat the Butcher, a halal butcher with shops in Malé and Hulhumalé. Every cut shows its country of origin, an interactive cow and sheep chart shows which cuts come from which part of the animal, and checkout offers delivery, pickup or a boat drop-off at one of seven harbours. The shop runs its orders from an admin console we built alongside it. We also built a page for their steakhouse, The Butchers Block, with its menu, and made social media posts for both brands.",
    "cover_url": "/assets/work/meat-the-butcher/cover.webp",
    "cover_w": 2400,
    "cover_h": 1440,
    "logo_url": "/assets/work/meat-the-butcher/logo.svg",
    "deliverables": [
      "E-commerce website",
      "Product catalogue with origin labels",
      "Interactive cut chart",
      "Checkout with delivery, pickup and boat drop-off",
      "Admin console",
      "Steakhouse page and menu",
      "Social media posts"
    ],
    "gallery": [
      {
        "url": "/assets/work/meat-the-butcher/01-cut-map.webp",
        "caption": "Interactive cut chart",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/meat-the-butcher/06-social-post-steakhouse.webp",
        "caption": "Social post for the steakhouse",
        "w": 1080,
        "h": 1350,
        "kind": "social"
      }
    ],
    "facts": [],
    "link_url": "https://meat-the-butcher-web.vercel.app",
    "link_label": "Visit the live site",
    "sort": 7
  },
  {
    "slug": "floating-acres",
    "title": "Floating Acres",
    "type": "Website",
    "year": "2025",
    "sector": "Aquaculture",
    "summary": "Website for Floating Acres, the first commercial seaweed farm in the Maldives.",
    "overview": "We designed the website for Floating Acres, the first commercial seaweed cultivator in the Maldives. The farm grows Eucheuma cottoni in the lagoons of Fehendhoo, Baa Atoll, and sun dries it for export. The site has four pages: home, product, about and contact. It is built around the farm's own underwater and drying rack photography.",
    "cover_url": "/assets/work/floating-acres/cover.webp",
    "cover_w": 2400,
    "cover_h": 1464,
    "logo_url": "/assets/work/floating-acres/logo.svg",
    "deliverables": [
      "Website design",
      "Website build on Wix",
      "Mobile layouts"
    ],
    "gallery": [
      {
        "url": "/assets/work/floating-acres/02-home-origin.webp",
        "caption": "Seaweed explainer and farm location, desktop",
        "w": 2400,
        "h": 1522,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/floating-acres/04-about-page.webp",
        "caption": "About page, desktop",
        "w": 2400,
        "h": 1119,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/floating-acres/05-home-mobile.webp",
        "caption": "Homepage on mobile",
        "w": 780,
        "h": 1688,
        "kind": "website-mobile"
      },
      {
        "url": "/assets/work/floating-acres/06-product-mobile.webp",
        "caption": "Product page on mobile",
        "w": 780,
        "h": 1688,
        "kind": "website-mobile"
      }
    ],
    "facts": [],
    "link_url": "https://www.floatingacres.com",
    "link_label": "Visit the live site",
    "sort": 8
  },
  {
    "slug": "gts-maldives",
    "title": "GTS Maldives",
    "type": "Website design and development",
    "year": "2026",
    "sector": "Hospitality equipment",
    "summary": "Website for a resort equipment supplier in the Maldives, with products, clients and case studies.",
    "overview": "We designed and built the website for GTS, a Malé company that has supplied kitchen, laundry and refrigeration equipment to Maldivian resorts since 2004. The site groups their range by category and lists the supplier brands under each one. It also shows the resorts they have equipped and gives six installations a case study page each. It is a plain static site with no framework, set up for search from the start.",
    "cover_url": "/assets/work/gts-maldives/cover.webp",
    "cover_w": 2400,
    "cover_h": 1500,
    "logo_url": "/assets/work/gts-maldives/logo.svg",
    "deliverables": [
      "Website design",
      "Front-end development",
      "Product catalogue by category with supplier brand chips",
      "Client portfolio of resort properties",
      "Project case study pages",
      "Mobile layout",
      "Technical SEO setup"
    ],
    "gallery": [
      {
        "url": "/assets/work/gts-maldives/01-products.webp",
        "caption": "Products and supplier brands",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/gts-maldives/03-clients.webp",
        "caption": "Resort client portfolio",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/gts-maldives/04-case-studies.webp",
        "caption": "Case studies index",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/gts-maldives/05-case-study-page.webp",
        "caption": "Case study page, Jumeirah Vittaveli",
        "w": 2400,
        "h": 1500,
        "kind": "website-desktop"
      },
      {
        "url": "/assets/work/gts-maldives/06-mobile-home.webp",
        "caption": "Homepage on mobile",
        "w": 780,
        "h": 1688,
        "kind": "website-mobile"
      }
    ],
    "facts": [],
    "link_url": "https://gts.com.mv",
    "link_label": "Visit the live site",
    "sort": 9
  }
];
// END GENERATED PROJECTS

/* ------------------------------ normalisers ---------------------------------
   Shared by the site and the admin. They accept every shape that has ever been
   saved, so an old row never throws.                                          */

window.normProject = function (p, i) {
  const o = p && typeof p === "object" ? p : {};
  const gallery = Array.isArray(o.gallery) ? o.gallery : [];
  return {
    id: o.id,
    slug: String(o.slug || ""),
    title: String(o.title || ""),
    type: String(o.type || ""),
    year: String(o.year || ""),
    sector: String(o.sector || ""),
    summary: String(o.summary || ""),
    tagline: String(o.tagline || ""),
    overview: String(o.overview || ""),
    cover_url: String(o.cover_url || ""),
    cover_w: +o.cover_w || 0,
    cover_h: +o.cover_h || 0,
    logo_url: String(o.logo_url || ""),
    link_url: String(o.link_url || ""),
    link_label: String(o.link_label || ""),
    deliverables: Array.isArray(o.deliverables) ? o.deliverables.map(String).filter(Boolean) : [],
    facts: (Array.isArray(o.facts) ? o.facts : [])
      .map((f) => (f && typeof f === "object" ? { label: String(f.label || f.k || ""), value: String(f.value || f.v || "") } : null))
      .filter((f) => f && f.label && f.value && !/^result$/i.test(f.label)),
    gallery: gallery
      .map((g) => (typeof g === "string" ? { url: g } : g || {}))
      .filter((g) => g.url)
      .map((g) => ({ url: String(g.url), caption: String(g.caption || ""), w: +g.w || 0, h: +g.h || 0, kind: String(g.kind || "") })),
    sort: typeof o.sort === "number" ? o.sort : i || 0,
  };
};

window.isCurrentProject = function (p) {
  return !!(p && p.slug && p.title && p.cover_url && p.cover_w > 0);
};

// clients: plain strings (older saves) or { name, logo }
window.normClients = function (items) {
  if (!Array.isArray(items)) return [];
  return items
    .map((c) => {
      if (typeof c === "string") return { name: c, logo: "" };
      const o = c && typeof c === "object" ? c : {};
      return { name: String(o.name || ""), logo: String(o.logo || "") };
    })
    .filter((c) => c.name);
};

// team roster: { name, role, photo }
window.normTeam = function (items) {
  if (!Array.isArray(items)) return [];
  return items
    .map((m) => {
      if (typeof m === "string") return { name: m, role: "", photo: "" };
      const o = m && typeof m === "object" ? m : {};
      return { name: String(o.name || ""), role: String(o.role || ""), photo: String(o.photo || "") };
    })
    .filter((m) => m.name);
};

// "para one\n\npara two" -> ["para one", "para two"]
window.paragraphs = function (text) {
  return String(text == null ? "" : text).split(/\n{2,}/).map((p) => p.trim()).filter(Boolean);
};

/* ------------------------------ context + merge ------------------------------ */
window.DEFAULT_CONTENT = Object.assign({}, window.DHEEMI_DEFAULT, {
  projects: window.DHEEMI_PROJECTS.map(window.normProject),
});
window.ContentContext = React.createContext(window.DEFAULT_CONTENT);
window.useContent = function () { return React.useContext(window.ContentContext); };

function dhDeepMerge(base, over) {
  if (Array.isArray(over) || typeof over !== "object" || over === null) return over;
  const out = Array.isArray(base) ? base.slice() : Object.assign({}, base);
  for (const k of Object.keys(over)) {
    const b = base ? base[k] : undefined;
    const o = over[k];
    if (o == null) continue;
    if (b !== undefined && b !== null && (Array.isArray(b) !== Array.isArray(o) || (typeof b === "object") !== (typeof o === "object"))) continue;
    out[k] = (b && typeof b === "object" && !Array.isArray(b) && o && typeof o === "object" && !Array.isArray(o))
      ? dhDeepMerge(b, o) : o;
  }
  return out;
}
window.dhDeepMerge = dhDeepMerge;

// Only a document saved by this design (schema 2) is merged. Anything older is
// the previous site's copy and would put the wrong words in the new layout.
window.siteDocIsCurrent = function (doc) {
  return !!(doc && typeof doc === "object" && doc.schema === window.DHEEMI_SCHEMA);
};

window.mergeContent = function (fetched) {
  const site = fetched && window.siteDocIsCurrent(fetched.site) ? fetched.site : {};
  const merged = dhDeepMerge(window.DHEEMI_DEFAULT, site);
  merged.schema = window.DHEEMI_SCHEMA;
  // Projects from the database replace the defaults only when they are this
  // design's rows: a cover with its measured size (cover_w), which the admin
  // records on upload. Rows from the previous site have neither, and would
  // otherwise replace real work with placeholders.
  const rows = fetched && Array.isArray(fetched.projects) ? fetched.projects.map(window.normProject) : [];
  const real = rows.filter(window.isCurrentProject);
  merged.projects = real.length ? real : window.DEFAULT_CONTENT.projects;
  return merged;
};

window.applyMeta = function (meta) {
  if (!meta) return;
  if (meta.title) document.title = meta.title;
  const set = (sel, val) => { if (!val) return; const m = document.querySelector(sel); if (m) m.setAttribute("content", val); };
  set('meta[name="description"]', meta.description);
  set('meta[property="og:description"]', meta.description);
};

/* ------------------- project prefetch + first-frame handoff -----------------
   The home page already holds every field the project opener needs, so
   /work/<slug> never opens on a spinner. Hovering a card warms the request and
   stashes the card in sessionStorage (there is no router, so nothing survives
   the navigation in memory).                                                 */
window.__dhProj = window.__dhProj || {};

window.dhPrefetchProject = function (slug, card) {
  if (!slug) return;
  if (card) { try { sessionStorage.setItem("dhc:" + slug, JSON.stringify(card)); } catch (e) {} }
  if (window.__dhProj[slug]) return;
  window.__dhProj[slug] = fetch("/api/project?slug=" + encodeURIComponent(slug))
    .then((r) => (r.ok ? r.json() : null))
    .catch(() => null);
};

window.dhSeedProject = function (slug) {
  try {
    const s = sessionStorage.getItem("dhc:" + slug);
    if (!s) return null;
    const c = JSON.parse(s);
    return c && c.title ? window.normProject(c) : null;
  } catch (e) { return null; }
};

// "a\nb" -> ["a", <br/>, "b"]
window.brk = function (s) {
  const parts = String(s == null ? "" : s).split("\n");
  const out = [];
  parts.forEach((p, i) => { if (i) out.push(<br key={"b" + i} />); out.push(p); });
  return out;
};
