import type { StaticImageData } from "next/image";
import adLandingMatchCheck from "@/assets/visuals/ad-landing-match-check.jpg";
import dataFlowWhiteboard from "@/assets/visuals/data-flow-whiteboard.jpg";
import diagnosticEveningCheck from "@/assets/visuals/diagnostic-evening-check.jpg";
import emailSequenceReview from "@/assets/visuals/email-sequence-review.jpg";
import mediaBuyerBudgetReview from "@/assets/visuals/media-buyer-budget-review.jpg";
import pageVariantReview from "@/assets/visuals/page-variant-review.jpg";
import productShootStudio from "@/assets/visuals/product-shoot-studio.jpg";
import resourceAiAnswerSources from "@/assets/visuals/resource-ai-answer-sources.jpg";
import resourceAttributionCards from "@/assets/visuals/resource-attribution-cards.jpg";
import resourceCacCohortReview from "@/assets/visuals/resource-cac-cohort-review.jpg";
import resourceExperimentChecklist from "@/assets/visuals/resource-experiment-checklist.jpg";
import resourceMerRoasChart from "@/assets/visuals/resource-mer-roas-chart.jpg";
import resourceSearchAuditClipboard from "@/assets/visuals/resource-search-audit-clipboard.jpg";
import saasPipelineMeeting from "@/assets/visuals/saas-pipeline-meeting.jpg";
import searchIntentPinboard from "@/assets/visuals/search-intent-pinboard.jpg";
import type { VideoVariant } from "@/components/ui/AmbientVideo";
import type { ServiceGlyphKind } from "@/content/home";
import type { BusinessModel, ResourceSlug } from "@/content/types";

/**
 * Photographs and living-photo loops encoded by scripts/optimize-media.mjs from Higgsfield masters.
 * Loops use start frame = end frame and a locked camera; each loop's still photograph is its poster.
 * People shown are generated for illustration and are never presented as Axidys staff.
 * Alt text lives with the copy each photograph illustrates. See docs/06-higgsfield-asset-prompts.md.
 */

export interface Still {
  src: StaticImageData;
  /** Tailwind object-position class, for frames cropped tighter than the photograph. */
  position?: string;
}

/** Home service cards, keyed by module glyph. A module without a still keeps its drawn schematic. */
export const serviceStills: Partial<Record<ServiceGlyphKind, Still>> = {
  allocation: { src: mediaBuyerBudgetReview, position: "object-[center_30%]" },
  search: { src: searchIntentPinboard, position: "object-[center_20%]" },
  experiment: { src: pageVariantReview, position: "object-[center_30%]" },
  message: { src: adLandingMatchCheck, position: "object-[center_20%]" },
  pipeline: { src: dataFlowWhiteboard, position: "object-[center_25%]" },
  loop: { src: emailSequenceReview, position: "object-[center_25%]" },
};

/** Photographs heading the two growth-model panels on the home page. */
export const growthModelStills: Record<BusinessModel, Still> = {
  saas: { src: saasPipelineMeeting },
  ecommerce: { src: productShootStudio, position: "object-[center_35%]" },
};

/** Resource covers on cards and article headers. Decorative: the card title carries the meaning. */
export const resourceStills: Record<ResourceSlug, Still> = {
  "saas-cac-benchmarking-guide": { src: resourceCacCohortReview },
  "mer-vs-roas-guide": { src: resourceMerRoasChart, position: "object-[center_35%]" },
  "landing-page-experiment-checklist": { src: resourceExperimentChecklist },
  "paid-search-account-audit-checklist": { src: resourceSearchAuditClipboard, position: "object-[center_40%]" },
  "attribution-readiness-guide": { src: resourceAttributionCards, position: "object-[center_60%]" },
  "ai-search-visibility-guide": { src: resourceAiAnswerSources, position: "object-[center_45%]" },
};

/** Dark photograph behind the "Not sure where to start?" card in the resources preview. */
export const diagnosticCardStill: Still = { src: diagnosticEveningCheck, position: "object-[75%_center]" };

/** Team review loop in the home "Working together" section: wide frame from md up. */
export const teamReviewWideVideo: VideoVariant[] = [
  {
    minViewport: 0,
    sources: [
      { src: "/media/team-growth-review-loop-1536.webm", type: "video/webm" },
      { src: "/media/team-growth-review-loop-1536.mp4", type: "video/mp4" },
    ],
  },
];

/** 4:3 crop of the team review loop that keeps all three people, for phones. */
export const teamReviewCropVideo: VideoVariant[] = [
  {
    minViewport: 0,
    sources: [
      { src: "/media/team-growth-review-loop-crop-800.webm", type: "video/webm" },
      { src: "/media/team-growth-review-loop-crop-800.mp4", type: "video/mp4" },
    ],
  },
];

export const ctaVideo: VideoVariant[] = [
  {
    minViewport: 1024,
    sources: [
      { src: "/media/strategist-late-review-loop-1536.webm", type: "video/webm" },
      { src: "/media/strategist-late-review-loop-1536.mp4", type: "video/mp4" },
    ],
  },
  {
    minViewport: 0,
    sources: [
      { src: "/media/strategist-late-review-loop-960.webm", type: "video/webm" },
      { src: "/media/strategist-late-review-loop-960.mp4", type: "video/mp4" },
    ],
  },
];
