/* Fire Engineering Roadmap - editorial glass layout with active showcase. */

const ROADMAP_STEPS = [
  {
    number: "01",
    title: "Concept Design",
    description: "We align early design intent with fire strategy from the first sketch.",
    image: "assets/beigman/31.png",
    alt: "Concept design table with architectural model, plans and copper strategy lines",
  },
  {
    number: "02",
    title: "Schematic Design",
    description: "We shape compliant pathways before key design decisions become fixed.",
    image: "assets/beigman/32.png",
    alt: "Schematic design workspace with plan overlays and route studies",
  },
  {
    number: "03",
    title: "Design Development",
    description: "We refine performance, coordination and risk as the architecture matures.",
    image: "assets/beigman/33.png",
    alt: "Developed architectural model with coordinated fire engineering layers",
  },
  {
    number: "04",
    title: "Construction Documentation",
    description: "We turn strategy into clear evidence, drawings and approval logic.",
    image: "assets/beigman/34.png",
    alt: "Construction documentation set with measured details and evidence marks",
  },
  {
    number: "05",
    title: "Construction Administration",
    description: "We support delivery so design intent is protected on site.",
    image: "assets/beigman/35.png",
    alt: "Construction administration site review with protected design intent",
  },
  {
    number: "06",
    title: "Defect Liability Period",
    description: "We stay close through completion, defects and final project confidence.",
    image: "assets/beigman/36.png",
    alt: "Completed building handover with final checks and copper-lit certainty",
  },
];

function clampRoadmapIndex(value) {
  const total = ROADMAP_STEPS.length;
  return (value + total) % total;
}

function RoadmapChevron({ direction = "right" }) {
  const path = direction === "left" ? "M15 18l-6-6 6-6" : "M9 6l6 6-6 6";
  return (
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
      <path d={path} />
    </svg>
  );
}

function RoadmapJourneyArrow() {
  return (
    <svg viewBox="0 0 72 12" fill="none" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
      <path d="M1 6h68" />
      <path d="M64 1l5 5-5 5" />
    </svg>
  );
}

function RoadmapPiece({ step, index, active, onSelect }) {
  const shape = index === 0 ? "is-first" : index === ROADMAP_STEPS.length - 1 ? "is-last" : "is-middle";
  const depthSide = index % 2 === 0 ? "tilt-back" : "tilt-front";

  return (
    <button
      type="button"
      className={`roadmap-piece ${shape} ${depthSide} ${active ? "is-active" : ""}`}
      onClick={() => onSelect(index)}
      aria-current={active ? "step" : undefined}
      aria-label={`${step.number}. ${step.title}`}
    >
      <span className="piece-photo" aria-hidden="true">
        <img src={step.image} alt="" loading="eager" decoding="async" />
      </span>
      <span className="piece-sheen" aria-hidden="true" />
      <span className="piece-content">
        <span className="piece-number">{step.number}</span>
        <span className="piece-title">{step.title}</span>
      </span>
    </button>
  );
}

function Process() {
  const sectionRef = React.useRef(null);
  const [activeIndex, setActiveIndex] = React.useState(0);
  const [paused, setPaused] = React.useState(false);
  const [reducedMotion, setReducedMotion] = React.useState(false);
  const [revealed, setRevealed] = React.useState(false);
  const touchStartRef = React.useRef(null);
  const activeStep = ROADMAP_STEPS[activeIndex];

  const goTo = React.useCallback((nextIndex) => {
    setActiveIndex(clampRoadmapIndex(nextIndex));
  }, []);

  const goNext = React.useCallback(() => {
    setActiveIndex((current) => clampRoadmapIndex(current + 1));
  }, []);

  const goPrev = React.useCallback(() => {
    setActiveIndex((current) => clampRoadmapIndex(current - 1));
  }, []);

  React.useEffect(() => {
    const motion = window.matchMedia("(prefers-reduced-motion: reduce)");
    const sync = () => setReducedMotion(motion.matches);
    sync();
    motion.addEventListener("change", sync);
    return () => motion.removeEventListener("change", sync);
  }, []);

  React.useEffect(() => {
    if (paused || reducedMotion) return undefined;
    const timer = window.setInterval(goNext, 6000);
    return () => window.clearInterval(timer);
  }, [goNext, paused, reducedMotion]);

  React.useEffect(() => {
    const id = window.requestAnimationFrame(() => {
      window.__zajRescan?.();
    });
    return () => window.cancelAnimationFrame(id);
  }, []);

  React.useEffect(() => {
    const el = sectionRef.current;
    if (!el) return undefined;
    const observer = new IntersectionObserver(([entry]) => {
      if (entry.isIntersecting) {
        setRevealed(true);
        observer.disconnect();
      }
    }, { threshold: 0.22 });
    observer.observe(el);
    return () => observer.disconnect();
  }, []);

  const handleTouchStart = (event) => {
    touchStartRef.current = event.touches[0].clientX;
    setPaused(true);
  };

  const handleTouchEnd = (event) => {
    const start = touchStartRef.current;
    touchStartRef.current = null;
    setPaused(false);
    if (start == null) return;
    const end = event.changedTouches[0].clientX;
    const delta = end - start;
    if (Math.abs(delta) < 42) return;
    if (delta < 0) goNext();
    else goPrev();
  };

  const progress = ((activeIndex + 1) / ROADMAP_STEPS.length) * 100;

  return (
    <section
      id="process"
      data-screen-label="04 Roadmap"
      ref={sectionRef}
      className={`fire-roadmap-root ${revealed ? "is-revealed" : ""}`}
      aria-labelledby="roadmap-title"
      onMouseEnter={() => setPaused(true)}
      onMouseLeave={() => setPaused(false)}
      onFocus={() => setPaused(true)}
      onBlur={() => setPaused(false)}
    >
      <style>{`
        .fire-roadmap-root {
          --rm-ink: #f4efe8;
          --rm-muted: rgba(244, 239, 232, 0.68);
          --rm-soft: rgba(255, 255, 255, 0.08);
          --rm-copper: #d97a3a;
          --rm-copper-soft: rgba(217, 122, 58, 0.38);
          --rm-copper-bright: #f0ad72;
          --rm-ease: cubic-bezier(0.05, 0.7, 0.1, 1);
          position: relative;
          min-height: 100vh;
          overflow: hidden;
          isolation: isolate;
          color: var(--rm-ink);
          padding: 140px clamp(32px, 6vw, 100px) 120px;
          background:
            radial-gradient(circle at top left, rgba(178, 124, 77, 0.30), transparent 42%),
            radial-gradient(circle at 78% 18%, rgba(30, 79, 102, 0.18), transparent 34%),
            #07111b;
        }
        .fire-roadmap-root::before,
        .fire-roadmap-root::after {
          content: "";
          position: absolute;
          pointer-events: none;
          z-index: 0;
        }
        .fire-roadmap-root::before {
          inset: -18% auto auto -10%;
          width: min(58vw, 760px);
          aspect-ratio: 1;
          border: 1px solid rgba(217, 122, 58, 0.18);
          border-radius: 50%;
          filter: blur(0.2px);
          opacity: 0.62;
        }
        .fire-roadmap-root::after {
          inset: 8% -12% auto auto;
          width: min(54vw, 720px);
          aspect-ratio: 1.35;
          border-top: 1px solid rgba(217, 122, 58, 0.16);
          border-radius: 50%;
          opacity: 0.5;
        }
        .roadmap-haze {
          position: absolute;
          inset: 0;
          z-index: 0;
          pointer-events: none;
          background:
            radial-gradient(ellipse at 22% 14%, rgba(240, 173, 114, 0.18), transparent 36%),
            radial-gradient(ellipse at 52% 60%, rgba(255, 255, 255, 0.045), transparent 42%),
            linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.18) 100%);
        }
        .roadmap-shell {
          position: relative;
          z-index: 2;
          width: min(1500px, 100%);
          margin: 0 auto;
          display: grid;
          gap: clamp(56px, 6vw, 76px);
        }
        .fire-roadmap-root .zaj-mask-v {
          transition-delay: var(--rm-reveal-delay, 0ms);
        }
        .fire-roadmap-root .roadmap-content-card,
        .fire-roadmap-root .roadmap-showcase,
        .fire-roadmap-root .roadmap-timeline {
          transition-delay: var(--rm-reveal-delay, 0ms);
        }
        .fire-roadmap-root.is-revealed .zaj-mask-v {
          clip-path: inset(0 0 0 0);
        }
        .fire-roadmap-root.is-revealed .zaj-rule-grow {
          transform: scaleX(1);
        }
        .fire-roadmap-root.is-revealed .roadmap-content-card,
        .fire-roadmap-root.is-revealed .roadmap-showcase,
        .fire-roadmap-root.is-revealed .roadmap-timeline {
          opacity: 1;
          transform: none;
        }
        .roadmap-hero-grid {
          position: relative;
          display: grid;
          grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
          gap: clamp(28px, 4.6vw, 64px);
          align-items: stretch;
        }
        .roadmap-hero-grid::before {
          content: "";
          position: absolute;
          inset: -18px;
          z-index: -1;
          border-radius: 34px;
          background:
            linear-gradient(115deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.006)),
            radial-gradient(circle at 20% 6%, rgba(240, 173, 114, 0.12), transparent 42%);
          border: 1px solid rgba(255, 255, 255, 0.035);
          pointer-events: none;
        }
        .roadmap-content-card {
          box-sizing: border-box;
          height: clamp(430px, 37vw, 545px);
          display: flex;
          flex-direction: column;
          justify-content: center;
          padding: clamp(34px, 4vw, 58px);
          border: 1px solid rgba(255, 255, 255, 0.105);
          border-radius: 24px;
          background:
            linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018)),
            radial-gradient(circle at 12% 0%, rgba(240, 173, 114, 0.095), transparent 42%),
            rgba(255, 255, 255, 0.022);
          backdrop-filter: blur(16px);
          box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.14),
            inset 0 -1px 0 rgba(255, 255, 255, 0.04),
            0 26px 84px rgba(0, 0, 0, 0.34),
            0 0 76px rgba(217, 122, 58, 0.09);
        }
        .roadmap-eyebrow {
          margin: 0 0 16px;
          color: var(--rm-copper-bright);
          font-family: 'Montserrat', sans-serif;
          font-size: 11px;
          font-weight: 700;
          letter-spacing: 0.34em;
          text-transform: uppercase;
        }
        .roadmap-rule {
          display: block;
          width: 86px;
          height: 1px;
          margin: 0 0 34px;
          background: linear-gradient(90deg, var(--rm-copper), rgba(255, 255, 255, 0.08), transparent);
        }
        .roadmap-rule.zaj-rule-grow {
          width: 86px;
          height: 1px;
          margin: 0 0 34px;
          background: linear-gradient(90deg, var(--rm-copper), rgba(255, 255, 255, 0.08), transparent);
        }
        .roadmap-title {
          max-width: 620px;
          margin: 0;
          font-family: 'Cormorant Garamond', Georgia, serif;
          font-size: clamp(44px, 4.15vw, 60px);
          font-weight: 700;
          line-height: 1;
          letter-spacing: -0.03em;
        }
        .roadmap-title .accent {
          color: var(--rm-copper);
          font-style: normal;
        }
        .roadmap-divider {
          height: 1px;
          width: 100%;
          margin: 32px 0 24px;
          background: rgba(255, 255, 255, 0.12);
        }
        .roadmap-copy-row {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 28px;
          color: var(--rm-muted);
          font-family: 'Inter', system-ui, sans-serif;
          font-size: clamp(0.94rem, 1vw, 1.04rem);
          line-height: 1.6;
        }
        .roadmap-copy-row svg {
          flex: 0 0 72px;
          color: var(--rm-copper-bright);
          opacity: 0.86;
        }
        .roadmap-showcase {
          box-sizing: border-box;
          position: relative;
          margin: 0;
          height: clamp(430px, 37vw, 545px);
          overflow: hidden;
          border-radius: 24px;
          border: 1px solid rgba(255, 255, 255, 0.105);
          background:
            linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018)),
            radial-gradient(circle at 85% 0%, rgba(240, 173, 114, 0.12), transparent 38%),
            rgba(255, 255, 255, 0.025);
          backdrop-filter: blur(12px);
          box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.13),
            inset 0 0 0 1px rgba(240, 173, 114, 0.08),
            0 26px 84px rgba(0, 0, 0, 0.34),
            0 0 76px rgba(217, 122, 58, 0.11);
        }
        .roadmap-showcase::before,
        .roadmap-showcase::after {
          content: "";
          position: absolute;
          inset: 0;
          pointer-events: none;
          z-index: 2;
        }
        .roadmap-showcase::before {
          background:
            linear-gradient(115deg, rgba(255, 255, 255, 0.11), transparent 30%),
            radial-gradient(circle at 82% 18%, rgba(240, 173, 114, 0.22), transparent 34%);
          mix-blend-mode: screen;
        }
        .roadmap-showcase::after {
          border: 1px solid rgba(255, 255, 255, 0.08);
          border-radius: inherit;
          box-shadow: inset 0 0 36px rgba(217, 122, 58, 0.10);
        }
        .roadmap-showcase img {
          display: block;
          width: 100%;
          height: 100%;
          object-fit: cover;
          transform: scale(1.025);
          transition: transform 900ms var(--rm-ease);
        }
        .roadmap-showcase:hover img {
          transform: scale(1.055);
        }
        .showcase-caption {
          position: absolute;
          z-index: 3;
          left: 24px;
          right: 24px;
          bottom: 22px;
          display: flex;
          justify-content: space-between;
          align-items: end;
          gap: 24px;
          color: rgba(244, 239, 232, 0.76);
          font-family: 'Inter', system-ui, sans-serif;
          font-size: 0.9rem;
          padding: 16px 18px;
          border: 1px solid rgba(255, 255, 255, 0.10);
          border-radius: 16px;
          background: rgba(7, 17, 27, 0.34);
          backdrop-filter: blur(12px);
        }
        .showcase-stage {
          color: var(--rm-copper-bright);
          font-family: 'Montserrat', sans-serif;
          font-size: 10px;
          font-weight: 700;
          letter-spacing: 0.26em;
          text-transform: uppercase;
        }
        .roadmap-controls {
          display: inline-flex;
          align-items: center;
          gap: 10px;
        }
        .roadmap-nav {
          display: inline-grid;
          place-items: center;
          width: 42px;
          height: 42px;
          border: 1px solid rgba(240, 173, 114, 0.36);
          border-radius: 999px;
          background: rgba(7, 17, 27, 0.42);
          color: var(--rm-ink);
          cursor: pointer;
          backdrop-filter: blur(10px);
          transition: transform 260ms var(--rm-ease), border-color 260ms ease, background 260ms ease;
        }
        .roadmap-nav svg {
          width: 22px;
          height: 22px;
        }
        .roadmap-nav:hover {
          transform: translateY(-2px);
          border-color: rgba(240, 173, 114, 0.72);
          background: rgba(217, 122, 58, 0.18);
        }
        .roadmap-live {
          position: absolute;
          width: 1px;
          height: 1px;
          overflow: hidden;
          clip: rect(0 0 0 0);
          white-space: nowrap;
        }
        .roadmap-timeline {
          position: relative;
          display: grid;
          gap: 22px;
          touch-action: pan-y;
        }
        .roadmap-process-line {
          position: relative;
          height: 18px;
          display: grid;
          align-items: center;
          padding-inline: 10px;
        }
        .roadmap-process-line::before {
          content: "";
          height: 1px;
          background: linear-gradient(90deg, rgba(240, 173, 114, 0.52), rgba(255, 255, 255, 0.13), rgba(240, 173, 114, 0.18));
        }
        .roadmap-process-line::after {
          content: "";
          position: absolute;
          right: 0;
          top: 50%;
          width: 9px;
          height: 9px;
          border-top: 1px solid rgba(240, 173, 114, 0.74);
          border-right: 1px solid rgba(240, 173, 114, 0.74);
          transform: translateY(-50%) rotate(45deg);
        }
        .roadmap-process-fill {
          position: absolute;
          left: 10px;
          top: 50%;
          height: 1px;
          width: calc(var(--progress) - 20px);
          max-width: calc(100% - 20px);
          background: linear-gradient(90deg, var(--rm-copper), rgba(240, 173, 114, 0.68));
          box-shadow: 0 0 16px rgba(240, 173, 114, 0.36);
          transform: translateY(-50%);
          transition: width 700ms var(--rm-ease);
        }
        .roadmap-rail {
          display: grid;
          grid-template-columns: repeat(6, minmax(0, 1fr));
          gap: clamp(14px, 1.5vw, 22px);
          perspective: 1500px;
          perspective-origin: 50% 30%;
          transform-style: preserve-3d;
        }
        .roadmap-piece {
          position: relative;
          min-width: 0;
          height: clamp(210px, 18vw, 272px);
          padding: 0;
          border: 0;
          border-radius: 8px;
          color: var(--rm-ink);
          background: rgba(255, 255, 255, 0.025);
          cursor: pointer;
          overflow: hidden;
          isolation: isolate;
          transform-style: preserve-3d;
          transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(-4deg) skewX(-5deg);
          transition:
            transform 560ms var(--rm-ease),
            box-shadow 420ms ease,
            border-color 420ms ease;
          box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.08),
            inset 0 0 0 1px rgba(255, 255, 255, 0.08),
            0 22px 46px rgba(0, 0, 0, 0.28);
        }
        .roadmap-piece.tilt-front {
          transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(4deg) skewX(-5deg);
        }
        .roadmap-piece::before {
          content: "";
          position: absolute;
          inset: 0;
          z-index: 3;
          pointer-events: none;
          background:
            linear-gradient(118deg, rgba(255, 255, 255, 0.12), transparent 36%),
            radial-gradient(circle at 22% 14%, rgba(240, 173, 114, 0.10), transparent 30%);
          opacity: 0.56;
        }
        .roadmap-piece.is-active,
        .roadmap-piece:hover,
        .roadmap-piece:focus-visible {
          z-index: 5;
          transform: translate3d(0, -8px, 42px) rotateY(0deg) skewX(-2deg);
          outline: none;
          box-shadow:
            inset 0 1px 0 rgba(255, 244, 232, 0.16),
            inset 0 0 0 1px rgba(240, 173, 114, 0.54),
            0 28px 58px rgba(0, 0, 0, 0.36),
            0 0 36px rgba(217, 122, 58, 0.16);
        }
        .piece-photo {
          position: absolute;
          inset: 0;
          background: #07111b;
        }
        .piece-photo img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          transform: scale(1.04);
          filter: brightness(0.38) saturate(0.86);
          transition: transform 700ms var(--rm-ease), filter 420ms ease;
        }
        .roadmap-piece.is-active .piece-photo img,
        .roadmap-piece:hover .piece-photo img {
          transform: scale(1.08);
          filter: brightness(0.9) saturate(1.02);
        }
        .piece-sheen {
          position: absolute;
          inset: 0;
          z-index: 1;
          background:
            linear-gradient(180deg, rgba(7, 17, 27, 0.12), rgba(7, 17, 27, 0.82)),
            linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 32%, rgba(217, 122, 58, 0.16));
          pointer-events: none;
        }
        .roadmap-piece:not(.is-active) .piece-sheen {
          background:
            linear-gradient(180deg, rgba(7, 17, 27, 0.52), rgba(7, 17, 27, 0.88)),
            linear-gradient(120deg, rgba(255, 255, 255, 0.05), transparent 34%, rgba(217, 122, 58, 0.08));
        }
        .piece-content {
          position: relative;
          z-index: 4;
          height: 100%;
          display: flex;
          flex-direction: column;
          justify-content: flex-end;
          align-items: flex-start;
          gap: 16px;
          padding: clamp(24px, 2.4vw, 34px);
          text-align: left;
          transform: skewX(5deg);
        }
        .piece-number {
          color: var(--rm-copper-bright);
          font-family: 'Cormorant Garamond', Georgia, serif;
          font-size: clamp(2.5rem, 3.7vw, 4.5rem);
          font-weight: 700;
          line-height: 0.82;
        }
        .piece-title {
          max-width: 190px;
          font-family: 'Cormorant Garamond', Georgia, serif;
          font-size: clamp(1.24rem, 1.55vw, 2.05rem);
          font-weight: 700;
          line-height: 1.04;
          letter-spacing: -0.02em;
        }
        .roadmap-live {
          pointer-events: none;
        }
        @media (max-width: 980px) {
          .fire-roadmap-root {
            padding-top: 110px;
          }
          .roadmap-hero-grid {
            grid-template-columns: 1fr;
            gap: 34px;
          }
          .roadmap-content-card {
            height: auto;
          }
          .roadmap-showcase {
            height: auto;
            min-height: 420px;
          }
          .roadmap-rail {
            display: flex;
            justify-content: flex-start;
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            scrollbar-width: none;
            padding: 10px 12px 34px;
            margin-inline: -12px;
          }
          .roadmap-rail::-webkit-scrollbar {
            display: none;
          }
          .roadmap-piece {
            flex: 0 0 min(35vw, 280px);
            scroll-snap-align: center;
          }
        }
        @media (max-width: 820px) {
          .fire-roadmap-root {
            padding: 72px 18px 84px;
          }
          .roadmap-shell {
            gap: 34px;
          }
          .roadmap-content-card {
            padding: 28px;
            border-radius: 18px;
          }
          .roadmap-title {
            font-size: 42px;
            line-height: 1;
          }
          .roadmap-divider {
            margin: 30px 0 22px;
          }
          .roadmap-copy-row {
            align-items: flex-start;
          }
          .roadmap-copy-row svg {
            flex-basis: 54px;
          }
          .roadmap-showcase {
            height: auto;
            min-height: 270px;
            border-radius: 18px;
          }
          .showcase-caption {
            left: 18px;
            right: 18px;
            bottom: 16px;
            align-items: center;
          }
          .roadmap-nav {
            width: 38px;
            height: 38px;
          }
          .roadmap-piece {
            flex: 0 0 min(74vw, 310px);
            height: 360px;
          }
          .piece-number {
            font-size: 3.3rem;
          }
          .piece-title {
            font-size: 2rem;
          }
        }
        @media (prefers-reduced-motion: reduce) {
          .roadmap-showcase img,
          .roadmap-piece,
          .piece-photo img,
          .roadmap-process-fill {
            transition: none !important;
            transform: none !important;
          }
        }
      `}</style>

      <div className="roadmap-haze" aria-hidden="true" />

      <div className="roadmap-shell">
        <div className="roadmap-hero-grid">
          <div className="roadmap-content-card zaj-fade-scale" style={{ "--rm-reveal-delay": "0ms" }}>
            <p className="roadmap-eyebrow zaj-mask-v" style={{ "--rm-reveal-delay": "120ms" }}>Our Roadmap</p>
            <span className="roadmap-rule zaj-rule-grow" style={{ "--rm-reveal-delay": "180ms" }} />
            <h2 className="roadmap-title zaj-mask-v" id="roadmap-title" style={{ "--rm-reveal-delay": "260ms" }}>
              Engineering Roadmap<br />
              from concept design to<br />
              <span className="accent">construction administration.</span>
            </h2>
            <div className="roadmap-divider zaj-rule-grow" aria-hidden="true" style={{ "--rm-reveal-delay": "460ms" }} />
            <div className="roadmap-copy-row zaj-mask-v" style={{ "--rm-reveal-delay": "560ms" }}>
              <span>We walk with you along the journey.</span>
              <RoadmapJourneyArrow />
            </div>
          </div>

          <figure className="roadmap-showcase zaj-fade-scale" style={{ "--rm-reveal-delay": "220ms" }}>
            <img key={activeStep.image} src={activeStep.image} alt={activeStep.alt} loading="eager" decoding="async" />
            <figcaption className="showcase-caption">
              <span>
                <span className="showcase-stage">{activeStep.number} / {activeStep.title}</span>
                <br />
                {activeStep.description}
              </span>
              <span className="roadmap-controls">
                <button type="button" className="roadmap-nav" onClick={goPrev} aria-label="Previous roadmap stage">
                  <RoadmapChevron direction="left" />
                </button>
                <button type="button" className="roadmap-nav" onClick={goNext} aria-label="Next roadmap stage">
                  <RoadmapChevron />
                </button>
              </span>
            </figcaption>
          </figure>
        </div>

        <div
          className="roadmap-timeline zaj-fade-up"
          style={{ "--progress": `${progress}%`, "--rm-reveal-delay": "520ms" }}
          onTouchStart={handleTouchStart}
          onTouchEnd={handleTouchEnd}
        >
          <div className="roadmap-process-line" aria-hidden="true">
            <span className="roadmap-process-fill" />
          </div>
            <div className="roadmap-rail zaj-stagger" aria-label="Fire engineering roadmap stages">
            {ROADMAP_STEPS.map((step, index) => (
              <RoadmapPiece
                key={step.number}
                step={step}
                index={index}
                active={index === activeIndex}
                onSelect={goTo}
              />
            ))}
          </div>
          <span className="roadmap-live" aria-live="polite">
            {activeStep.number}. {activeStep.title}
          </span>
        </div>
      </div>
    </section>
  );
}

Object.assign(window, { Process });
