const { useState, useEffect } = React;

/* --------------------------- primitives --------------------------- */

const Play = ({ size = 14, stroke = 1.5, className = "" }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none"
    stroke="currentColor" strokeWidth={stroke} strokeLinecap="round"
    strokeLinejoin="round" className={className}>
    <polygon points="6 4 20 12 6 20 6 4" />
  </svg>
);

const Arrow = ({ size = 14, className = "" }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none"
    stroke="currentColor" strokeWidth="1.5" strokeLinecap="round"
    strokeLinejoin="round" className={className}>
    <line x1="5" y1="12" x2="19" y2="12" />
    <polyline points="13 6 19 12 13 18" />
  </svg>
);

const ArrowDown = ({ size = 14 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none"
    stroke="currentColor" strokeWidth="1.5" strokeLinecap="round"
    strokeLinejoin="round">
    <line x1="12" y1="5" x2="12" y2="19" />
    <polyline points="6 13 12 19 18 13" />
  </svg>
);

const Check = ({ size = 14 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none"
    stroke="currentColor" strokeWidth="1.8" strokeLinecap="round"
    strokeLinejoin="round">
    <polyline points="20 6 9 17 4 12" />
  </svg>
);

/* scroll helper */
const scrollToContact = (e) => {
  if (e) e.preventDefault();
  const el = document.getElementById("contact");
  if (el) el.scrollIntoView({ behavior: "smooth", block: "start" });
  setTimeout(() => {
    const first = document.querySelector("#contact input[name='name']");
    if (first) first.focus({ preventScroll: true });
  }, 650);
};
const scrollToWork = (e) => {
  if (e) e.preventDefault();
  const el = document.getElementById("work");
  if (el) el.scrollIntoView({ behavior: "smooth", block: "start" });
};
const scrollToId = (id) => (e) => {
  if (e) e.preventDefault();
  const el = document.getElementById(id);
  if (el) el.scrollIntoView({ behavior: "smooth", block: "start" });
};

/* --------------------------- video placeholder --------------------------- */

/* Stills: category-specific line art so tiles read as real project thumbnails, not empty gradients */
const WorkThumbVisual = ({ category, gradient }) => {
  const lime = "rgba(216,255,79,0.5)";
  const ice = "rgba(168,216,240,0.4)";
  const dim = "rgba(245,245,247,0.12)";
  let g = null;
  switch (category) {
    case "MOA Film":
      g = (
        <g fill="none" strokeWidth="1.2" strokeLinecap="round">
          <path d="M60 130 Q100 40 160 90 T260 70" stroke={lime} />
          <path d="M70 140 Q110 50 170 100 T270 80" stroke={ice} opacity="0.85" />
          <circle cx="155" cy="88" r="14" stroke={lime} />
          <circle cx="200" cy="72" r="6" fill={lime} opacity="0.35" />
          <circle cx="120" cy="102" r="5" fill={ice} opacity="0.4" />
          <path d="M230 115 L248 98 M232 98 L248 115" stroke={dim} strokeWidth="0.9" />
        </g>
      );
      break;
    case "Surgical Visualization":
      g = (
        <g fill="none" strokeWidth="1.2" strokeLinecap="round">
          <path d="M90 140 Q140 45 210 55 Q270 65 250 130 Q220 155 160 148 Q100 142 90 140" stroke={lime} />
          <path d="M130 95 L195 88 M145 118 L210 108" stroke={ice} opacity="0.7" />
          <path d="M175 72 L182 125 M198 70 L205 120" stroke={dim} />
          <circle cx="248" cy="62" r="3" fill={lime} opacity="0.5" />
        </g>
      );
      break;
    case "Cellular Animation":
      g = (
        <g fill="none" strokeWidth="1.2" strokeLinecap="round">
          <ellipse cx="160" cy="95" rx="88" ry="52" stroke={lime} opacity="0.85" />
          <ellipse cx="160" cy="95" rx="38" ry="28" stroke={ice} />
          <circle cx="120" cy="88" r="4" fill={ice} opacity="0.45" />
          <circle cx="195" cy="102" r="3.5" fill={lime} opacity="0.4" />
          <circle cx="175" cy="78" r="2.5" fill={lime} opacity="0.35" />
          <path d="M95 115 Q108 108 118 118 M205 78 Q218 70 228 82" stroke={dim} strokeWidth="0.9" />
        </g>
      );
      break;
    case "Device Demo":
      g = (
        <g fill="none" strokeWidth="1.2" strokeLinecap="round">
          <rect x="115" y="65" width="90" height="28" rx="4" stroke={lime} />
          <rect x="128" y="72" width="64" height="14" rx="2" stroke={ice} opacity="0.6" />
          <path d="M205 79 H248 M248 72 V86 M248 79 L262 79" stroke={lime} />
          <path d="M138 93 V118 M152 93 V118 M166 93 V112" stroke={dim} strokeWidth="0.9" />
          <circle cx="262" cy="79" r="5" stroke={ice} />
        </g>
      );
      break;
    case "Medical-Legal":
      g = (
        <g fill="none" strokeWidth="1.2" strokeLinecap="round">
          <path d="M160 48 V135" stroke={dim} />
          <path d="M120 75 H200 M120 95 H200 M120 115 H200" stroke={ice} opacity="0.5" />
          <path d="M100 135 H220" stroke={lime} />
          <circle cx="160" cy="58" r="18" stroke={lime} />
          <path d="M152 58 L158 66 L172 50" stroke={lime} strokeWidth="1.4" />
        </g>
      );
      break;
    case "Patient Education":
      g = (
        <g fill="none" strokeWidth="1.2" strokeLinecap="round">
          <ellipse cx="160" cy="95" rx="52" ry="34" stroke={lime} />
          <circle cx="160" cy="95" r="18" stroke={ice} />
          <circle cx="148" cy="92" r="4" fill={lime} opacity="0.25" />
          <circle cx="174" cy="92" r="4" fill={lime} opacity="0.25" />
          <path d="M145 108 Q160 118 175 108" stroke={ice} opacity="0.7" />
        </g>
      );
      break;
    default:
      g = (
        <g fill="none" stroke={lime} strokeWidth="1.2">
          <circle cx="160" cy="90" r="48" opacity="0.6" />
          <path d="M120 90 H200 M160 50 V130" opacity="0.4" />
        </g>
      );
  }
  return (
    <div className={`relative w-full aspect-[16/9] overflow-hidden ${gradient}`}>
      <div className="grain absolute inset-0 pointer-events-none" />
      <div className="absolute inset-0 pointer-events-none">
        <div className="absolute top-0 left-1/3 w-px h-full bg-white/[0.02]" />
        <div className="absolute top-0 left-2/3 w-px h-full bg-white/[0.02]" />
      </div>
      <div className="absolute inset-0 flex items-center justify-center p-[6%]">
        <svg viewBox="0 0 320 180" className="w-full h-auto max-h-[92%]" aria-hidden style={{ filter: "drop-shadow(0 0 24px rgba(216,255,79,0.08))" }}>
          {g}
        </svg>
      </div>
      <div className="absolute top-3 left-3 w-3 h-3 border-l border-t border-white/10 pointer-events-none" />
      <div className="absolute top-3 right-3 w-3 h-3 border-r border-t border-white/10 pointer-events-none" />
      <div className="absolute bottom-3 left-3 w-3 h-3 border-l border-b border-white/10 pointer-events-none" />
      <div className="absolute bottom-3 right-3 w-3 h-3 border-r border-b border-white/10 pointer-events-none" />
    </div>
  );
};

const VideoPlaceholder = ({ className = "", gradient = "film-grad-1", showPlay = true, tag, duration, onClick }) => (
  <div
    onClick={onClick}
    className={`relative overflow-hidden grain ${gradient} ${className} ${onClick ? "cursor-pointer" : ""}`}
  >
    <div className="absolute inset-0 pointer-events-none">
      <div className="absolute top-0 left-1/3 w-px h-full bg-white/[0.015]"></div>
      <div className="absolute top-0 left-2/3 w-px h-full bg-white/[0.015]"></div>
    </div>
    {tag && (
      <div className="absolute top-4 left-4 right-4 flex items-center justify-between z-10">
        <span className="font-mono text-[10px] smallcaps text-[#8B8F98]">{tag}</span>
        {duration && <span className="font-mono text-[10px] text-[#8B8F98]">{duration}</span>}
      </div>
    )}
    {showPlay && (
      <div className="absolute inset-0 flex items-center justify-center z-10">
        <div className="w-14 h-14 rounded-full border border-[#D8FF4F]/70 flex items-center justify-center group-hover:border-[#D8FF4F] group-hover:bg-[#D8FF4F]/5 transition-all">
          <Play size={14} className="text-[#D8FF4F] translate-x-[1px]" />
        </div>
      </div>
    )}
    <div className="absolute top-3 left-3 w-3 h-3 border-l border-t border-white/10"></div>
    <div className="absolute top-3 right-3 w-3 h-3 border-r border-t border-white/10"></div>
    <div className="absolute bottom-3 left-3 w-3 h-3 border-l border-b border-white/10"></div>
    <div className="absolute bottom-3 right-3 w-3 h-3 border-r border-b border-white/10"></div>
  </div>
);

/* ================================================================== */
/*                              HEADER                                 */
/* ================================================================== */

const Header = () => {
  const [navOpen, setNavOpen] = useState(false);
  const go = (fn) => (e) => {
    fn(e);
    setNavOpen(false);
  };
  return (
    <header className="sticky top-0 z-50 border-b border-[#1D2128]/80 bg-[#070A0D]/75 backdrop-blur-xl backdrop-saturate-150 shadow-[0_4px_32px_rgba(0,0,0,0.45)]">
      <div className="max-w-[1440px] mx-auto px-4 sm:px-6 md:px-8 h-14 sm:h-16 flex items-center justify-between gap-2">
        <a href="#top" onClick={go(scrollToId("top"))} className="flex items-center gap-2 sm:gap-3 min-w-0">
          <div className="w-2 h-2 bg-[#D8FF4F] rounded-sm header-logo-dot shrink-0" />
          <span className="font-mono text-[10px] sm:text-[11px] smallcaps text-[#F5F5F7] truncate">Animated Medical</span>
        </a>
        <nav className="hidden md:flex items-center gap-8 lg:gap-10 font-mono text-[11px] smallcaps text-[#8B8F98]">
          <a href="#work" onClick={scrollToId("work")} className="hover:text-[#F5F5F7] transition">Work</a>
          <a href="#studio" onClick={scrollToId("studio")} className="hover:text-[#F5F5F7] transition">Studio</a>
          <a href="#capabilities" onClick={scrollToId("capabilities")} className="hover:text-[#F5F5F7] transition">Capabilities</a>
        </nav>
        <div className="flex items-center gap-2 sm:gap-4 md:gap-5 shrink-0">
          <span className="font-mono text-[10px] text-[#8B8F98] hidden lg:inline-flex items-center gap-2">
            <span className="w-1.5 h-1.5 rounded-full bg-[#D8FF4F] animate-pulse" />
            Now booking
          </span>
          <a
            href="#contact"
            onClick={go(scrollToContact)}
            className="font-mono text-[10px] sm:text-[11px] smallcaps px-3 sm:px-4 py-1.5 sm:py-2 rounded-full bg-[#D4FF3D] text-[#050608] shadow-[0_0_0_1px_rgba(212,255,61,0.35),0_6px_24px_-4px_rgba(212,255,61,0.35)] hover:bg-[#E5FF6A] hover:shadow-[0_0_0_1px_rgba(232,255,120,0.5),0_8px_28px_-4px_rgba(212,255,61,0.45)] transition"
          >
            Start a project
          </a>
          <button
            type="button"
            className="md:hidden p-2 -mr-1 text-[#8B8F98] hover:text-[#F5F5F7]"
            aria-expanded={navOpen}
            aria-label={navOpen ? "Close menu" : "Open menu"}
            onClick={() => setNavOpen((o) => !o)}
          >
            {navOpen ? "✕" : "≡"}
          </button>
        </div>
      </div>
      {navOpen && (
        <nav className="md:hidden border-t border-[#1D2128] bg-[#0B0E12]/98 px-4 py-4 flex flex-col gap-3 font-mono text-[11px] smallcaps text-[#8B8F98]">
          <a href="#work" onClick={go(scrollToId("work"))} className="py-1 hover:text-[#F5F5F7]">
            Work
          </a>
          <a href="#studio" onClick={go(scrollToId("studio"))} className="py-1 hover:text-[#F5F5F7]">
            Studio
          </a>
          <a href="#capabilities" onClick={go(scrollToId("capabilities"))} className="py-1 hover:text-[#F5F5F7]">
            Capabilities
          </a>
        </nav>
      )}
    </header>
  );
};

/* ================================================================== */
/*                                HERO                                 */
/* ================================================================== */

/* Tier B: atmospheric still (licensed Unsplash) under graded reel */
const HERO_ATMO_STILL =
  "https://images.unsplash.com/photo-1576086213369-97a306d36557?auto=format&fit=crop&w=2000&q=75";

const Hero = () => {
  const [reveal, setReveal] = useState(false);

  useEffect(() => {
    if (typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
      setReveal(true);
      return undefined;
    }
    const id = requestAnimationFrame(() => setReveal(true));
    return () => cancelAnimationFrame(id);
  }, []);

  const delay = (i) => ({ transitionDelay: `${i * 0.07}s` });

  return (
    <section id="top" className={reveal ? "hero-reveal-on-mount" : ""}>
      <div className="max-w-[1440px] mx-auto px-4 sm:px-6 md:px-8 pt-4 sm:pt-8">
        <div className="flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between font-mono text-[10px] smallcaps text-[#8B8F98] mb-4 sm:mb-6">
          <div className="hero-reveal-child flex items-center flex-wrap gap-3 sm:gap-6" style={delay(0)}>
            <span>Reel 2026</span>
            <span className="text-[#3A3E46]">—</span>
            <span>Fourteen films · 02:47</span>
          </div>
          <div className="hero-reveal-child hidden sm:flex items-center gap-4 md:gap-6" style={delay(1)}>
            <span>United States · hybrid studio</span>
            <span className="text-[#3A3E46]">—</span>
            <span>01 / 09</span>
          </div>
        </div>

        <div className="relative group min-h-[min(80svh,560px)] sm:min-h-[600px] md:min-h-[640px]">
          <div
            className="absolute inset-0 z-0 min-h-[min(80svh,560px)] sm:min-h-[600px] md:min-h-[640px] bg-cover bg-center opacity-[0.16] mix-blend-screen pointer-events-none"
            style={{ backgroundImage: `url(${HERO_ATMO_STILL})` }}
            aria-hidden
          />
          <div
            className="absolute inset-0 z-0 min-h-[min(80svh,560px)] sm:min-h-[600px] md:min-h-[640px] bg-gradient-to-t from-[#0B0E12] via-transparent to-[#0B0E12]/20 pointer-events-none"
            aria-hidden
          />

          <div className="relative z-[1] hero-sweep overflow-hidden rounded-sm">
            <div className="absolute inset-0 z-[2] hero-mesh-anim pointer-events-none" aria-hidden />
            <VideoPlaceholder
              className="w-full min-h-[min(80svh,560px)] sm:min-h-[600px] md:min-h-[640px] aspect-[4/3] sm:aspect-video lg:aspect-[21/9] film-hero hero-breath relative z-[1]"
              gradient="film-hero"
              tag="FEATURED · MECHANISM OF ACTION"
              duration="02:47"
            />
          </div>

          <div className="absolute bottom-0 left-0 right-0 p-4 sm:p-8 md:p-10 lg:p-14 pointer-events-none z-[3]">
            <div className="max-w-[880px]">
              <div
                className="hero-reveal-child font-mono text-[10px] smallcaps text-[#8B8F98] mb-8 flex items-center gap-3"
                style={delay(2)}
              >
                <span>Medical Animation Studio</span>
                <span className="text-[#3A3E46]">·</span>
                <span>Est. 2018</span>
              </div>
              <h1 className="font-display tighter text-[2.4rem] min-[400px]:text-[2.75rem] sm:text-5xl md:text-[76px] xl:text-[92px] leading-[0.95] font-medium text-[#F5F5F7] mb-4 sm:mb-6 tracking-[-0.04em]">
                <span className="hero-reveal-child block" style={delay(3)}>We make</span>
                <span className="hero-reveal-child block" style={delay(4)}>invisible biology</span>
                <span className="hero-reveal-child block" style={delay(5)}>visible.</span>
              </h1>
              <p
                className="hero-reveal-child text-[17px] text-[#8B8F98] max-w-[540px] leading-[1.5] mb-10"
                style={delay(6)}
              >
                3D cellular animation, surgical visualization, and mechanism-of-action films for pharma, medical-device, and medical-legal teams.
              </p>
              <div className="flex flex-col sm:flex-row sm:items-center gap-4 sm:gap-8 pointer-events-auto">
                <a
                  href="#work"
                  onClick={scrollToWork}
                  className="hero-reveal-child group/link inline-flex items-center gap-2 text-[#F5F5F7] text-[14px] border-b hairline border-b pb-1 hover:border-[#D8FF4F] hover:text-[#D8FF4F] transition-all duration-300 hover:-translate-y-0.5"
                  style={delay(7)}
                >
                  <span>See the work</span>
                  <Arrow size={14} className="group-hover/link:translate-x-1 transition-transform" />
                </a>
                <a
                  href="#contact"
                  onClick={scrollToContact}
                  className="hero-reveal-child group/link inline-flex items-center gap-2 text-[#F5F5F7] text-[14px] border-b hairline border-b pb-1 hover:border-[#D8FF4F] hover:text-[#D8FF4F] transition-all duration-300 hover:-translate-y-0.5"
                  style={delay(8)}
                >
                  <span>Start a project</span>
                  <Arrow size={14} className="group-hover/link:translate-x-1 transition-transform" />
                </a>
              </div>
            </div>
          </div>

          <div className="absolute top-6 right-6 font-mono text-[10px] text-[#8B8F98] hidden md:flex items-center gap-2 z-[3]">
            <span className="w-1.5 h-1.5 rounded-full bg-[#D8FF4F]"></span>
            Featured reel
          </div>
        </div>

        <div className="flex items-center justify-between font-mono text-[10px] smallcaps text-[#8B8F98] mt-6">
          <span>Scroll</span>
          <div className="flex-1 mx-8 h-px bg-[#1D2128] relative">
            <div className="absolute left-0 top-0 h-px w-[12%] bg-[#D8FF4F]"></div>
          </div>
          <span>Selected Work</span>
        </div>
      </div>
    </section>
  );
};

/* ================================================================== */
/*                         FEATURED CASE STUDY                         */
/* ================================================================== */

const Featured = () => (
  <section className="border-t hairline border-t mt-24">
    <div className="max-w-[1440px] mx-auto px-4 sm:px-6 md:px-8 py-24">
      <div className="flex items-baseline justify-between mb-14">
        <div className="flex items-center gap-6">
          <span className="font-mono text-[10px] smallcaps text-[#D8FF4F]">■</span>
          <span className="font-mono text-[10px] smallcaps text-[#8B8F98]">Case Study / 001</span>
        </div>
        <span className="font-mono text-[10px] smallcaps text-[#8B8F98]">Featured</span>
      </div>

      <div className="grid grid-cols-12 gap-10">
        <div className="col-span-12 md:col-span-7 group cursor-pointer">
          <VideoPlaceholder
            className="w-full aspect-[16/10]"
            gradient="film-grad-2"
            tag="MOA FILM · CARDIO-RENAL"
            duration="02:14"
          />
          <div className="mt-4 flex items-center justify-between font-mono text-[10px] smallcaps text-[#8B8F98]">
            <span>Final cut · 2025</span>
            <span>4K · ProRes 422</span>
          </div>
        </div>

        <div className="col-span-12 md:col-span-5 md:pl-6">
          <dl className="divide-y hairline divide-y font-mono text-[11px]">
            {[
              ["Client", "Under NDA"],
              ["Category", "Mechanism of Action Film"],
              ["Indication", "Heart failure · HFrEF"],
              ["Duration", "02:14"],
              ["Delivery", "4K · 1080p · Social cuts"],
              ["Year", "2025"],
            ].map(([k, v]) => (
              <div key={k} className="flex items-center justify-between py-4">
                <dt className="smallcaps text-[#8B8F98]">{k}</dt>
                <dd className="text-[#F5F5F7]">{v}</dd>
              </div>
            ))}
          </dl>

          <div className="mt-10">
            <h3 className="font-display tight text-2xl sm:text-3xl md:text-[32px] leading-[1.08] font-medium text-[#F5F5F7] mb-4">
              Visualizing a small-molecule binding at the neprilysin active site.
            </h3>
            <p className="text-[15px] text-[#8B8F98] leading-[1.55]">
              A two-minute MOA film resolving a molecular interaction at sub-ångström fidelity — built from cryo-EM data, rendered with custom shader work for a medical-affairs launch at a major cardiology congress.
            </p>
          </div>

          <a href="#contact" onClick={scrollToContact} className="mt-10 inline-flex items-center gap-3 font-mono text-[10px] smallcaps text-[#F5F5F7] hover:text-[#D8FF4F] transition">
            <span className="w-8 h-px bg-current"></span>
            Request the full case
            <Arrow size={12} />
          </a>
        </div>
      </div>

      <div className="mt-20 flex items-center justify-center">
        <a href="#work" onClick={scrollToWork} className="inline-flex items-center gap-3 font-mono text-[11px] smallcaps text-[#8B8F98] hover:text-[#F5F5F7] transition">
          Selected work
          <ArrowDown size={12} />
        </a>
      </div>
    </div>
  </section>
);

/* ================================================================== */
/*                             WORK GRID                               */
/* ================================================================== */

const WORK_TILES = [
  { t: "Nucleotide Release Cascade",   c: "MOA Film",              d: "01:42", y: "2025", g: "film-grad-3" },
  { t: "Posterior Approach · TKA",     c: "Surgical Visualization", d: "03:18", y: "2025", g: "film-grad-4" },
  { t: "IgG1 Antibody Engagement",     c: "Cellular Animation",    d: "02:05", y: "2025", g: "film-grad-5" },
  { t: "Auto-Injector Actuation",      c: "Device Demo",           d: "00:58", y: "2024", g: "film-grad-6" },
  { t: "Mitochondrial Permeability",   c: "Cellular Animation",    d: "01:30", y: "2024", g: "film-grad-7" },
  { t: "Cervical Laminoplasty",        c: "Medical-Legal",         d: "04:22", y: "2024", g: "film-grad-8" },
  { t: "GLP-1 Receptor Dynamics",      c: "MOA Film",              d: "02:40", y: "2024", g: "film-grad-9" },
  { t: "Intravitreal Injection",       c: "Patient Education",     d: "01:14", y: "2023", g: "film-grad-2" },
  { t: "Endovascular Stent Deploy",    c: "Device Demo",           d: "01:55", y: "2023", g: "film-grad-1" },
];

const FILTERS = [
  { label: "All", count: WORK_TILES.length },
  { label: "MOA Film", count: WORK_TILES.filter(w => w.c === "MOA Film").length },
  { label: "Surgical Visualization", count: WORK_TILES.filter(w => w.c === "Surgical Visualization").length },
  { label: "Cellular Animation", count: WORK_TILES.filter(w => w.c === "Cellular Animation").length },
  { label: "Device Demo", count: WORK_TILES.filter(w => w.c === "Device Demo").length },
];

const WorkGrid = () => {
  const [hover, setHover] = useState(false);
  const [filter, setFilter] = useState("All");
  const shown = filter === "All" ? WORK_TILES : WORK_TILES.filter(w => w.c === filter);
  return (
    <section id="work" className="border-t hairline border-t">
      <div className="max-w-[1440px] mx-auto px-4 sm:px-6 md:px-8 py-24">
        <div className="flex items-end justify-between mb-14 flex-wrap gap-6">
          <div>
            <div className="font-mono text-[10px] smallcaps text-[#8B8F98] mb-4">Index / 002</div>
            <h2 className="font-display tight text-3xl min-[400px]:text-4xl sm:text-5xl md:text-[48px] leading-[1] font-medium text-[#F5F5F7]">
              Selected work, 2023–25.
            </h2>
          </div>
          <div className="flex items-center gap-6 font-mono text-[10px] smallcaps flex-wrap">
            {FILTERS.map(f => (
              <button
                key={f.label}
                onClick={() => setFilter(f.label)}
                className={`transition ${filter === f.label ? "text-[#F5F5F7]" : "text-[#8B8F98] hover:text-[#F5F5F7]"}`}
              >
                {f.label} · {f.count}
              </button>
            ))}
          </div>
        </div>

        <div
          className={`grid grid-cols-1 md:grid-cols-3 gap-6 ${hover ? "grid-hover" : ""}`}
          onMouseEnter={() => setHover(true)}
          onMouseLeave={() => setHover(false)}
        >
          {shown.map((w, i) => (
            <figure
              key={w.t}
              onClick={scrollToContact}
              className="tile-wrap group cursor-pointer border hairline border"
            >
              <WorkThumbVisual category={w.c} gradient={w.g} />
              <figcaption className="px-4 py-4 flex items-center justify-between bg-[#0B0E12]">
                <div>
                  <div className="font-mono text-[10px] smallcaps text-[#8B8F98] mb-1">
                    <span className="font-mono text-[10px] text-[#D8FF4F] mr-2">{String(i+1).padStart(2,"0")}</span>
                    {w.c}
                  </div>
                  <div className="tile-title font-display text-[15px] tight text-[#F5F5F7]">
                    {w.t}
                  </div>
                </div>
                <div className="font-mono text-[10px] text-[#8B8F98] text-right">
                  <div>{w.d}</div>
                  <div className="text-[#5A5E66]">{w.y}</div>
                </div>
              </figcaption>
            </figure>
          ))}
        </div>

        <div className="mt-14 flex items-center justify-between font-mono text-[10px] smallcaps text-[#8B8F98]">
          <span>{shown.length} of {WORK_TILES.length} shown</span>
          <a href="#contact" onClick={scrollToContact} className="inline-flex items-center gap-2 hover:text-[#F5F5F7] transition">
            Request full archive
            <Arrow size={12} />
          </a>
        </div>
      </div>
    </section>
  );
};

/* ================================================================== */
/*                            CAPABILITIES                             */
/* ================================================================== */

const CAPS = [
  ["3D Cellular Animation",         "Sub-cellular, organelle, and molecular-scale visualization built from structural data — PDB, cryo-EM, and peer-reviewed literature."],
  ["Mechanism-of-Action Films",     "Narrative films resolving how a therapy works — from pharmacokinetics to receptor binding — for launch, MSL, and medical-affairs teams."],
  ["Surgical Visualization",        "Procedural animations and operative overviews for device launches, surgeon training, and scientific publications."],
  ["Medical-Legal Animation",       "Court-admissible reconstructions of injury mechanisms and surgical timelines — produced to evidentiary standards."],
  ["Device & Instrument Demos",     "Exploded views, actuation mechanics, and in-situ placement for implants, injectors, catheters, and capital equipment."],
  ["Patient Education",             "Clear, de-jargoned explanations of conditions and treatments for IFU, hospital networks, and DTC campaigns."],
  ["Conference Content",            "Plenary loops, booth reels, and scientific poster films optimized for AHA, ESC, ASCO, ASH, and peer venues."],
  ["Expert Witness Work",           "Direct collaboration with retained experts — engineered to survive Daubert challenge and courtroom scrutiny."],
];

const Capabilities = () => (
  <section id="capabilities" className="border-t hairline border-t">
    <div className="max-w-[1440px] mx-auto px-4 sm:px-6 md:px-8 py-24">
      <div className="grid grid-cols-12 gap-10 mb-16">
        <div className="col-span-12 md:col-span-4">
          <div className="font-mono text-[10px] smallcaps text-[#8B8F98] mb-4">Capabilities / 003</div>
          <h2 className="font-display tight text-3xl min-[400px]:text-4xl sm:text-5xl md:text-[48px] leading-[1] font-medium text-[#F5F5F7]">
            What the studio&nbsp;does.
          </h2>
        </div>
        <div className="col-span-12 md:col-span-6 md:col-start-7 self-end">
          <p className="text-[15px] text-[#8B8F98] leading-[1.55]">
            Eight practice areas, one pipeline. Everything below is produced in-house by board-certified medical illustrators, CG supervisors, and science editors.
          </p>
        </div>
      </div>

      <ul className="border-t hairline border-t">
        {CAPS.map(([title, desc], i) => (
            <li key={title} className="cap-row border-b hairline border-b">
            <div className="grid grid-cols-12 gap-x-4 gap-y-3 md:gap-6 py-6 md:py-7 items-start md:items-center">
              <div className="col-span-12 md:col-span-1 font-mono text-[11px] cap-num text-[#5A5E66]">
                {String(i+1).padStart(2,"0")}
              </div>
              <div className="col-span-12 md:col-span-5">
                <div className="cap-title font-display tight text-2xl sm:text-3xl md:text-[38px] leading-[1.05] text-[#F5F5F7]">
                  {title}
                </div>
              </div>
              <div className="col-span-12 md:col-span-6 cap-desc text-[14px] text-[#8B8F98] leading-[1.5] md:pr-6">
                {desc}
              </div>
            </div>
          </li>
        ))}
      </ul>
    </div>
  </section>
);

/* ================================================================== */
/*                              PROCESS                                */
/* ================================================================== */

const PHASES = [
  {
    n: "Phase 01",
    t: "Brief & Research",
    w: "1–2 weeks",
    b: "Kickoff with medical, regulatory, and creative stakeholders. We read the literature, study the mechanism, and interview your subject-matter experts. Output: a science brief, reference deck, and scoped treatment.",
    d: ["Literature review", "SME interviews", "Reference pass", "Science brief"],
  },
  {
    n: "Phase 02",
    t: "Storyboard & Concept",
    w: "2 weeks",
    b: "Scene-by-scene storyboards, tone boards, and an animatic with scratch narration. Two rounds of revision included. Legal, medical, and regulatory checkpoints scheduled here.",
    d: ["Storyboard", "Animatic", "Style frames", "MLR pre-check"],
  },
  {
    n: "Phase 03",
    t: "3D Production",
    w: "4–8 weeks",
    b: "Molecular builds, simulation, lighting, look-dev, and render. Weekly WIP reviews over Frame.io. Shot-by-shot approvals keep MLR pace with production.",
    d: ["Modeling & rig", "FX / simulation", "Lighting & look-dev", "Render · 4K"],
  },
  {
    n: "Phase 04",
    t: "Delivery & Revisions",
    w: "1 week",
    b: "Color grade, sound design, final mix, and deliverable wrangling — 16:9, 9:16, 1:1, broadcast, and any regulated-market variants required.",
    d: ["Color · sound", "Deliverables", "MLR final", "Archive"],
  },
];

const Process = () => (
  <section id="studio" className="border-t hairline border-t">
    <div className="max-w-[1440px] mx-auto px-4 sm:px-6 md:px-8 py-24">
      <div className="grid grid-cols-12 gap-10 mb-16">
        <div className="col-span-12 md:col-span-5">
          <div className="font-mono text-[10px] smallcaps text-[#8B8F98] mb-4">Process / 004</div>
          <h2 className="font-display tight text-3xl min-[400px]:text-4xl sm:text-5xl md:text-[48px] leading-[1] font-medium text-[#F5F5F7]">
            From cryo-EM<br/>to final cut.
          </h2>
        </div>
        <div className="col-span-12 md:col-span-6 md:col-start-7 self-end">
          <p className="text-[15px] text-[#8B8F98] leading-[1.55]">
            Eight-to-twelve weeks, four phases, no surprises. Every engagement is priced as a fixed scope with defined revision rounds — no hourly billing, no creeping retainers.
          </p>
        </div>
      </div>

      <div className="relative mb-6">
        <div className="h-px bg-[#1D2128] w-full"></div>
        <div className="absolute top-0 left-0 h-px bg-[#D8FF4F] w-[65%]"></div>
        <div className="absolute -top-1 left-[65%] w-2 h-2 rounded-full bg-[#D8FF4F]"></div>
      </div>
      <div className="flex justify-between font-mono text-[10px] text-[#5A5E66] mb-10">
        <span>Week 00</span><span>Week 02</span><span>Week 04</span><span>Week 08</span><span>Week 12</span>
      </div>

      <div className="grid grid-cols-1 md:grid-cols-4 gap-0 border-t hairline border-t">
        {PHASES.map((p, i) => (
          <div key={p.n} className={`p-6 md:p-8 border-b hairline border-b ${i < PHASES.length - 1 ? "md:border-r md:hairline md:border-r" : ""}`}>
            <div className="flex items-baseline justify-between mb-8">
              <span className="font-mono text-[10px] smallcaps text-[#D8FF4F]">{p.n}</span>
              <span className="font-mono text-[10px] text-[#8B8F98]">{p.w}</span>
            </div>
            <h3 className="font-display tight text-[22px] text-[#F5F5F7] mb-4 leading-[1.15]">
              {p.t}
            </h3>
            <p className="text-[13.5px] text-[#8B8F98] leading-[1.55] mb-8">
              {p.b}
            </p>
            <ul className="space-y-2 font-mono text-[10.5px] smallcaps text-[#8B8F98]">
              {p.d.map(x => (
                <li key={x} className="flex items-center gap-3">
                  <span className="w-3 h-px bg-[#3A3E46]"></span>
                  {x}
                </li>
              ))}
            </ul>
          </div>
        ))}
      </div>
    </div>
  </section>
);

/* ================================================================== */
/*                              CLIENTS                                */
/* ================================================================== */

const CLIENT_CATS = [
  "Top-5 global pharmaceutical",
  "Mid-cap biotech",
  "Publicly-held medical device",
  "AmLaw 100 litigation firm",
  "Academic medical center",
  "Surgical robotics company",
  "Diagnostics platform",
  "Specialty pharma",
  "Plaintiff-side legal group",
  "Cardiovascular device maker",
  "Clinical-stage biotech",
  "Radiology imaging network",
];

const Clients = () => (
  <section className="border-t hairline border-t">
    <div className="max-w-[1440px] mx-auto px-4 sm:px-6 md:px-8 py-24">
      <div className="flex items-end justify-between mb-14 flex-wrap gap-4">
        <div>
          <div className="font-mono text-[10px] smallcaps text-[#8B8F98] mb-4">Clients / 005</div>
          <h2 className="font-display tight text-3xl min-[400px]:text-4xl sm:text-5xl md:text-[48px] leading-[1] font-medium text-[#F5F5F7]">
            Trusted by teams<br/>at the bench and the bedside.
          </h2>
        </div>
        <div className="font-mono text-[10px] smallcaps text-[#8B8F98] hidden md:block">
          Over forty engagements · 2018–25
        </div>
      </div>

      <div className="grid grid-cols-2 md:grid-cols-4 border hairline border">
        {CLIENT_CATS.map((c, i) => (
          <div key={c} className={`
            aspect-[3/1] flex items-center justify-center
            border-b hairline border-b ${(i+1) % 4 !== 0 ? "md:border-r md:hairline md:border-r" : ""}
            ${i % 2 !== 0 ? "border-r hairline border-r md:border-r-0" : ""}
            ${i >= CLIENT_CATS.length - 4 ? "md:border-b-0" : ""}
            px-4 py-3
          `}>
            <span className="font-display text-[11px] smallcaps text-[#5A5E66] hover:text-[#8B8F98] transition text-center leading-tight">
              {c}
            </span>
          </div>
        ))}
      </div>

      <div className="mt-6 font-mono text-[10px] smallcaps text-[#5A5E66] text-center">
        Client engagements are typically confidential — specific references available under mutual NDA.
      </div>
    </div>
  </section>
);

/* ================================================================== */
/*                             STUDIO NOTE                             */
/* ================================================================== */

const Signature = () => (
  <svg width="180" height="52" viewBox="0 0 180 52" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden>
    <path d="M6 34 C 14 14, 24 8, 28 22 C 30 30, 22 38, 18 36 C 14 34, 22 24, 30 20 C 38 16, 44 30, 38 36"
      stroke="#F5F5F7" strokeWidth="1.3" strokeLinecap="round" fill="none" opacity="0.9"/>
    <path d="M46 28 C 52 18, 60 18, 60 28 C 60 36, 52 40, 54 32 C 56 24, 66 18, 72 24 C 76 28, 72 36, 68 32"
      stroke="#F5F5F7" strokeWidth="1.3" strokeLinecap="round" fill="none" opacity="0.9"/>
    <path d="M80 22 C 84 30, 82 38, 88 36 C 96 34, 94 18, 100 20 C 106 22, 102 38, 110 34 C 118 30, 116 20, 124 24"
      stroke="#F5F5F7" strokeWidth="1.3" strokeLinecap="round" fill="none" opacity="0.9"/>
    <path d="M128 26 C 134 20, 140 22, 138 30 C 136 38, 146 34, 150 26 C 154 18, 164 22, 162 32"
      stroke="#F5F5F7" strokeWidth="1.3" strokeLinecap="round" fill="none" opacity="0.9"/>
    <path d="M6 44 L 168 44" stroke="#F5F5F7" strokeWidth="0.6" opacity="0.3"/>
  </svg>
);

const StudioNote = () => (
  <section className="border-t hairline border-t">
    <div className="max-w-[1440px] mx-auto px-4 sm:px-6 md:px-8 py-28">
      <div className="grid grid-cols-12 gap-10">
        <div className="col-span-12 md:col-span-2">
          <div className="font-mono text-[10px] smallcaps text-[#8B8F98]">
            Studio note<br/><span className="text-[#5A5E66]">/ 006</span>
          </div>
        </div>
        <div className="col-span-12 md:col-span-9">
          <blockquote className="font-serif-ital text-[1.55rem] min-[400px]:text-3xl sm:text-4xl md:text-[44px] lg:text-[58px] leading-[1.08] text-[#F5F5F7] tight">
            <span className="text-[#D8FF4F] mr-2">“</span>
            Medicine asks patients, juries, and regulators to trust what they cannot see. Our job is to show it — truthfully, and at a resolution the science can stand behind. An animation is never the story; the molecule is.<span className="text-[#D8FF4F] ml-2">”</span>
          </blockquote>

          <div className="mt-14 flex items-end gap-10 flex-wrap">
            <div>
              <Signature />
            </div>
            <div className="pb-1 font-mono text-[11px] smallcaps text-[#8B8F98]">
              <div className="text-[#F5F5F7]">Creative direction</div>
              <div>MSMI, CMI · Founder studio</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>
);

/* ================================================================== */
/*                              CONTACT                                */
/* ================================================================== */

const Field = ({ label, children }) => (
  <label className="block border-b hairline border-b pb-3">
    <div className="font-mono text-[10px] smallcaps text-[#5A5E66] mb-2">{label}</div>
    {children}
  </label>
);

const Contact = () => {
  const [state, setState] = useState("idle"); // idle | submitting | success
  const [form, setForm] = useState({
    name: "", email: "", company: "",
    type: "MOA Film",
    timeline: "8–12 weeks (standard)",
    budget: "$100–250K",
    brief: "",
  });
  const onChange = (k) => (e) => setForm(f => ({ ...f, [k]: e.target.value }));

  const onSubmit = (e) => {
    e.preventDefault();
    if (!form.name || !form.email) return;
    setState("submitting");
    setTimeout(() => setState("success"), 900);
  };
  const reset = () => {
    setState("idle");
    setForm({
      name: "", email: "", company: "",
      type: "MOA Film",
      timeline: "8–12 weeks (standard)",
      budget: "$100–250K",
      brief: "",
    });
  };

  return (
    <section id="contact" className="border-t hairline border-t">
      <div className="max-w-[1440px] mx-auto px-4 sm:px-6 md:px-8 py-24">
        <div className="grid grid-cols-12 gap-10">
          {/* left — form / success */}
          <div className="col-span-12 md:col-span-8">
            <div className="font-mono text-[10px] smallcaps text-[#8B8F98] mb-4">Contact / 007</div>
            <h2 className="font-display tight text-4xl min-[400px]:text-5xl sm:text-6xl md:text-[64px] lg:text-[72px] leading-[1] font-medium text-[#F5F5F7] mb-8 sm:mb-14">
              {state === "success" ? "Brief received." : "Start a project."}
            </h2>

            {state !== "success" ? (
              <form onSubmit={onSubmit} noValidate className="grid grid-cols-12 gap-x-8 gap-y-10">
                <div className="col-span-12 md:col-span-6">
                  <Field label="01 · Name">
                    <input name="name" required type="text" value={form.name} onChange={onChange("name")} placeholder="Full name" className="w-full outline-none bg-transparent py-1"/>
                  </Field>
                </div>
                <div className="col-span-12 md:col-span-6">
                  <Field label="02 · Email">
                    <input name="email" required type="email" value={form.email} onChange={onChange("email")} placeholder="Professional email" className="w-full outline-none bg-transparent py-1"/>
                  </Field>
                </div>
                <div className="col-span-12 md:col-span-6">
                  <Field label="03 · Company">
                    <input name="company" type="text" value={form.company} onChange={onChange("company")} placeholder="Organization" className="w-full outline-none bg-transparent py-1"/>
                  </Field>
                </div>
                <div className="col-span-12 md:col-span-6">
                  <Field label="04 · Project type">
                    <select value={form.type} onChange={onChange("type")} className="w-full outline-none bg-transparent py-1 appearance-none">
                      <option>MOA Film</option>
                      <option>Surgical Visualization</option>
                      <option>Device Demo</option>
                      <option>Medical-Legal</option>
                      <option>Patient Education</option>
                      <option>Other</option>
                    </select>
                  </Field>
                </div>
                <div className="col-span-12 md:col-span-6">
                  <Field label="05 · Timeline">
                    <select value={form.timeline} onChange={onChange("timeline")} className="w-full outline-none bg-transparent py-1 appearance-none">
                      <option>&lt; 8 weeks (rush)</option>
                      <option>8–12 weeks (standard)</option>
                      <option>12–20 weeks</option>
                      <option>Exploratory</option>
                    </select>
                  </Field>
                </div>
                <div className="col-span-12 md:col-span-6">
                  <Field label="06 · Budget range">
                    <select value={form.budget} onChange={onChange("budget")} className="w-full outline-none bg-transparent py-1 appearance-none">
                      <option>$50–100K</option>
                      <option>$100–250K</option>
                      <option>$250–500K</option>
                      <option>$500K +</option>
                      <option>Unsure</option>
                    </select>
                  </Field>
                </div>
                <div className="col-span-12">
                  <Field label="07 · Brief">
                    <textarea rows="3" value={form.brief} onChange={onChange("brief")} placeholder="A few sentences about the science, audience, and use case." className="w-full outline-none bg-transparent py-1 resize-none"></textarea>
                  </Field>
                </div>
                <div className="col-span-12 flex items-center justify-between pt-4 flex-wrap gap-4">
                  <span className="font-mono text-[10px] smallcaps text-[#5A5E66]">
                    Replies within 2 business days · NDA on request
                  </span>
                  <button
                    type="submit"
                    disabled={state === "submitting"}
                    className="font-mono text-[11px] smallcaps px-5 py-3 rounded-full bg-[#D8FF4F] text-[#0B0E12] hover:bg-[#E8FF7A] transition inline-flex items-center gap-3 disabled:opacity-60"
                  >
                    {state === "submitting" ? "Transmitting…" : "Transmit brief"}
                    <Arrow size={12} />
                  </button>
                </div>
              </form>
            ) : (
              <div className="border hairline border p-10 md:p-14">
                <div className="w-12 h-12 rounded-full border border-[#D8FF4F] flex items-center justify-center mb-8 text-[#D8FF4F]">
                  <Check size={20} />
                </div>
                <p className="font-display tight text-[26px] md:text-[30px] leading-[1.2] text-[#F5F5F7] mb-4 max-w-[560px]">
                  Thank you, {form.name.split(" ")[0] || "there"}. Your brief is in the queue.
                </p>
                <p className="text-[15px] text-[#8B8F98] leading-[1.6] max-w-[560px] mb-10">
                  A producer will review it and reply within two business days using the contact details you provided. If your timeline is tighter than that, note it in your brief and we will prioritize accordingly.
                </p>
                <dl className="grid grid-cols-2 gap-6 font-mono text-[11px] max-w-[560px] mb-10">
                  <div>
                    <dt className="smallcaps text-[#5A5E66] mb-1">Project type</dt>
                    <dd className="text-[#F5F5F7]">{form.type}</dd>
                  </div>
                  <div>
                    <dt className="smallcaps text-[#5A5E66] mb-1">Timeline</dt>
                    <dd className="text-[#F5F5F7]">{form.timeline}</dd>
                  </div>
                  <div>
                    <dt className="smallcaps text-[#5A5E66] mb-1">Budget</dt>
                    <dd className="text-[#F5F5F7]">{form.budget}</dd>
                  </div>
                  <div>
                    <dt className="smallcaps text-[#5A5E66] mb-1">Reply to</dt>
                    <dd className="text-[#F5F5F7] break-all">{form.email}</dd>
                  </div>
                </dl>
                <button onClick={reset} className="font-mono text-[10px] smallcaps text-[#8B8F98] hover:text-[#D8FF4F] inline-flex items-center gap-2 transition">
                  Submit another brief
                  <Arrow size={12} />
                </button>
              </div>
            )}
          </div>

          {/* right — studio info */}
          <aside className="col-span-12 md:col-span-4 md:pl-6 md:border-l md:hairline md:border-l">
            <div className="sticky top-24">
              <div className="font-mono text-[10px] smallcaps text-[#D8FF4F] mb-5 flex items-center gap-2">
                <span className="w-1.5 h-1.5 rounded-full bg-[#D8FF4F] animate-pulse"></span>
                Studio · Open
              </div>

              <dl className="font-mono text-[11px] text-[#8B8F98] space-y-5 mb-10">
                <div>
                  <dt className="smallcaps text-[#5A5E66] mb-1">Studio</dt>
                  <dd className="text-[#F5F5F7] leading-[1.5]">
                    By appointment<br/>
                    In-person reviews and remote sessions<br/>
                    United States · Eastern time
                  </dd>
                </div>
                <div>
                  <dt className="smallcaps text-[#5A5E66] mb-1">New work</dt>
                  <dd className="text-[#F5F5F7]">
                    <a href="#contact" onClick={scrollToContact} className="hover:text-[#D8FF4F] transition">
                      Use the project form
                    </a>
                  </dd>
                </div>
                <div>
                  <dt className="smallcaps text-[#5A5E66] mb-1">Press &amp; speaking</dt>
                  <dd className="text-[#F5F5F7]">
                    <a href="#contact" onClick={scrollToContact} className="hover:text-[#D8FF4F] transition">
                      Send a note
                    </a>
                  </dd>
                </div>
                <div>
                  <dt className="smallcaps text-[#5A5E66] mb-1">Hours</dt>
                  <dd className="text-[#F5F5F7]">Mon–Fri · 09:00 — 19:00 ET</dd>
                </div>
              </dl>

              <div className="border-t hairline border-t pt-5">
                <div className="flex items-center justify-between font-mono text-[10px] smallcaps text-[#5A5E66] mb-3">
                  <span>Current capacity</span>
                  <span className="text-[#D8FF4F]">Limited</span>
                </div>
                <div className="load-bar"></div>
                <div className="mt-4 font-mono text-[10px] text-[#5A5E66] leading-[1.55]">
                  Taking on two production engagements and one medical-legal matter per quarter.
                </div>
              </div>
            </div>
          </aside>
        </div>
      </div>
    </section>
  );
};

/* ================================================================== */
/*                               FOOTER                                */
/* ================================================================== */

const Footer = () => (
  <footer className="border-t hairline border-t">
    <div className="max-w-[1440px] mx-auto px-4 sm:px-6 md:px-8 pt-20 pb-10">
      <div className="grid grid-cols-12 gap-10 mb-16">
        <div className="col-span-12 md:col-span-6">
          <h3 className="font-display tight text-4xl min-[400px]:text-5xl sm:text-6xl md:text-[64px] lg:text-[96px] leading-[0.95] font-medium text-[#F5F5F7]">
            Animated<br/>Medical<span className="text-[#D8FF4F]">.</span>
          </h3>
          <div className="mt-8 font-mono text-[10px] smallcaps text-[#8B8F98] max-w-sm leading-[1.7]">
            A medical animation studio producing cinematic 3D work for pharma, medical-device, and medical-legal teams since 2018.
          </div>
        </div>

        <div className="col-span-12 sm:col-span-6 md:col-span-2">
          <div className="font-mono text-[10px] smallcaps text-[#5A5E66] mb-5">Sitemap</div>
          <ul className="space-y-2.5 font-mono text-[11px] smallcaps text-[#F5F5F7]">
            <li><a href="#work" onClick={scrollToId("work")} className="hover:text-[#D8FF4F]">Work</a></li>
            <li><a href="#studio" onClick={scrollToId("studio")} className="hover:text-[#D8FF4F]">Studio</a></li>
            <li><a href="#capabilities" onClick={scrollToId("capabilities")} className="hover:text-[#D8FF4F]">Capabilities</a></li>
            <li><a href="#contact" onClick={scrollToContact} className="hover:text-[#D8FF4F]">Contact</a></li>
          </ul>
        </div>

        <div className="col-span-12 sm:col-span-6 md:col-span-2">
          <div className="font-mono text-[10px] smallcaps text-[#5A5E66] mb-5">Elsewhere</div>
          <ul className="space-y-2.5 font-mono text-[11px] smallcaps text-[#F5F5F7]">
            <li><a href="#contact" onClick={scrollToContact} className="hover:text-[#D8FF4F]">Vimeo</a></li>
            <li><a href="#contact" onClick={scrollToContact} className="hover:text-[#D8FF4F]">LinkedIn</a></li>
            <li><a href="#contact" onClick={scrollToContact} className="hover:text-[#D8FF4F]">Frame.io review</a></li>
          </ul>
        </div>

        <div className="col-span-12 md:col-span-2">
          <div className="font-mono text-[10px] smallcaps text-[#5A5E66] mb-5">Practice</div>
          <ul className="space-y-2.5 font-mono text-[10.5px] text-[#8B8F98]">
            <li>HIPAA · BAA-ready</li>
            <li>MLR-aware workflow</li>
            <li>Daubert-tested</li>
            <li>NDA on request</li>
            <li>W-9 on file</li>
          </ul>
        </div>
      </div>

      <div className="border-t hairline border-t pt-6 flex flex-col md:flex-row items-start md:items-center justify-between gap-4 font-mono text-[10px] text-[#5A5E66]">
        <div className="flex items-center gap-5 flex-wrap">
          <span>© 2018–2026 Animated Medical LLC</span>
          <span>·</span>
          <a href="#contact" onClick={scrollToContact} className="hover:text-[#F5F5F7]">Privacy</a>
          <span>·</span>
          <a href="#contact" onClick={scrollToContact} className="hover:text-[#F5F5F7]">Terms</a>
          <span>·</span>
          <a href="#contact" onClick={scrollToContact} className="hover:text-[#F5F5F7]">Imprint</a>
        </div>
        <div className="flex items-center gap-5">
          <span>United States</span>
          <span className="scan-line w-16 h-px"></span>
          <span>Rendered in sRGB</span>
        </div>
      </div>
    </div>
  </footer>
);

/* ================================================================== */
/*                                APP                                  */
/* ================================================================== */

const App = () => (
    <div className="min-h-screen bg-[#0B0E12] overflow-x-clip">
    <Header />
    <Hero />
    <Featured />
    <WorkGrid />
    <Capabilities />
    <Process />
    <Clients />
    <StudioNote />
    <Contact />
    <Footer />
  </div>
);

ReactDOM.createRoot(document.getElementById("root")).render(<App />);
