// Variation A — final
// No em dashes anywhere; service tier cards use placeholder icons.

function ImageSlot({ ratio = "4 / 3", label = "Image placeholder", tone = "amber" }) {
  const palette = tone === "amber" ?
  { bg: "#FFE7C2", border: "#F0C886", fg: "#7A5A1F" } :
  tone === "indigo" ?
  { bg: "#E1E5FF", border: "#B8C0F2", fg: "#3A4499" } :
  { bg: "#F5F6FF", border: "#DDDFEE", fg: "#5A6076" };
  return (
    <div style={{
      aspectRatio: ratio, width: "100%",
      background: palette.bg,
      border: "1.5px dashed " + palette.border,
      borderRadius: 16,
      display: "grid", placeItems: "center",
      color: palette.fg, fontFamily: "Montserrat"
    }}>
      <div style={{ textAlign: "center", padding: 24 }}>
        <div style={{
          fontWeight: 700, fontSize: 18, letterSpacing: "0.14em",
          textTransform: "uppercase", opacity: 0.7, lineHeight: 1.35
        }}>Interactive Visual<br />To Be Added</div>
      </div>
    </div>);
}

// Placeholder icon (generic outline glyph in a chip)
function PlaceholderIcon({ bg, fg, idx, variant }) {
  // bar chart
  const bar = <svg key="b" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke={fg} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><line x1="5" y1="20" x2="5" y2="12" /><line x1="12" y1="20" x2="12" y2="6" /><line x1="19" y1="20" x2="19" y2="14" /></svg>;
  // Accountability set: dashboard, checklist, alert, chart
  const accIcons = [
  // laptop (Lucide)
  <svg key="laptop" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke={fg} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><rect x="2" y="4" width="20" height="13" rx="2"/><path d="M1 21h22"/></svg>,
  // magnifying glass (Lucide)
  <svg key="binoculars" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke={fg} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M10 10h4"/><path d="M19 7V4a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v3"/><path d="M20 21a2 2 0 0 0 2-2v-3.851c0-1.39-2-2.962-2-4.829V8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v11a2 2 0 0 0 2 2z"/><path d="M22 16H2"/><path d="M4 21a2 2 0 0 1-2-2v-3.851c0-1.39 2-2.962 2-4.829V8a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v11a2 2 0 0 1-2 2z"/><path d="M9 7V4a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v3"/></svg>,
  // alert
  <svg key="a" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke={fg} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M10.3 3.3a2 2 0 0 1 3.4 0l8 13.7A2 2 0 0 1 20 20H4a2 2 0 0 1-1.7-3L10.3 3.3z" /><line x1="12" y1="9" x2="12" y2="13" /><line x1="12" y1="17" x2="12" y2="17" /></svg>,
  // chart
  bar];

  const icons = variant === "acc" ? accIcons : [
  // brain (Lucide)
  <svg key="brain" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke={fg} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"/><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"/><path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"/><path d="M17.599 6.5a3 3 0 0 0 .399-1.375"/><path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"/><path d="M3.477 10.896a4 4 0 0 1 .585-.396"/><path d="M19.938 10.5a4 4 0 0 1 .585.396"/><path d="M6 18a4 4 0 0 1-1.967-.516"/><path d="M19.967 17.484A4 4 0 0 1 18 18"/></svg>,
  // mobile phone (Lucide)
  <svg key="phone" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke={fg} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><rect x="5" y="2" width="14" height="20" rx="2"/><line x1="12" y1="18" x2="12.01" y2="18"/></svg>,
  // line graph / trend
  <svg key="graph" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke={fg} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><polyline points="3 17 8 11 13 14 21 6" /><polyline points="17 6 21 6 21 10" /></svg>,
  // layout-dashboard (Lucide)
  <svg key="dashboard" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke={fg} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/></svg>];

  return (
    <div style={{ width: 36, height: 36, borderRadius: 8, background: bg, display: "grid", placeItems: "center", marginBottom: 14 }}>
      {icons[idx % icons.length]}
    </div>);

}

function VarA_Basics() {
  const steps = [
  { n: "01", title: "Engage", body: "A shopper or field rep scans a QR code on your packaging, display, signage, or marketing asset, and lands on dynamic, contextualized content." },
  { n: "02", title: "Evaluate", body: "Every interaction feeds real-time engagement, geo, and execution data back to you, ready to act on." },
  { n: "03", title: "Evolve", body: "Use those signals to refine content, fix execution gaps, and make every next campaign sharper than the last." }];

  return (
    <section data-screen-label="Basics" style={{ padding: "clamp(72px, 10vw, 120px) clamp(20px, 5vw, 64px)", background: "#fff", fontFamily: "Montserrat" }}>
      <div style={{ maxWidth: 1280, margin: "0 auto" }}>
        <div style={{ textAlign: "center", maxWidth: 1100, margin: "0 auto 56px" }}>
          <div style={{ fontWeight: 700, fontSize: 11, letterSpacing: "0.16em", textTransform: "uppercase", color: "#FFB855", marginBottom: 16 }}>How TapScan Works</div>
          <h2 style={{ fontWeight: 900, fontSize: "clamp(28px, 4.5vw, 44px)", lineHeight: 1.15, margin: 0, color: "#212331", letterSpacing: "-0.015em" }}>
            Connect every touchpoint to dynamic content &amp; real-time data<span style={{ color: "#FFB855" }}>.</span>
          </h2>
          <p style={{ fontWeight: 300, fontSize: "clamp(16px, 1.7vw, 19px)", lineHeight: 1.5, color: "#212331", marginTop: 20 }}>
            TapScan turns ordinary marketing assets into measurable, context-aware moments, feeding shoppers what they need and giving you the data to prove what's working.
          </p>
        </div>
        <div className="ts-steps-grid" style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 0, position: "relative" }}>
          {steps.map((s, i) =>
          <div key={i} className="ts-step" style={{
            padding: "0 32px",
            borderLeft: i === 0 ? "none" : "1px solid #DDDFEE"
          }}>
              <div style={{ fontFamily: "Montserrat", fontWeight: 900, fontSize: 56, color: "#FFB855", lineHeight: 1, letterSpacing: "-0.02em", marginBottom: 16 }}>{s.n}</div>
              <h3 style={{ fontWeight: 900, fontSize: 26, margin: 0, color: "#212331", letterSpacing: "-0.01em" }}>{s.title}<span style={{ color: "#FFB855" }}>.</span></h3>
              <p style={{ fontWeight: 400, fontSize: 15, lineHeight: 1.6, color: "#212331", marginTop: 12 }}>{s.body}</p>
            </div>
          )}
        </div>
      </div>
    </section>);
}

function VarA_Experience({ onCaseStudies }) {
  // Placeholder copy until final marketing text lands. Selling-point cards
  // are intentionally numbered so the team can wireframe the section
  // before the real claims are written.
  const tiers = [
  { title: "Drive Smarter Engagement", body: "Deliver relevant product information, offers, education, or campaign content based on the user's real-world context (at point of sale or point of use)." },
  { title: "Remove Friction at the Point of Action", body: "No app downloads. Users scan and engage instantly from packaging, signage, displays, media, or support materials. Data stored on cloud." },
  { title: "Measure What Happens in Market", body: "Track engagement by product, location, language, campaign, time, and channel to understand performance across stores, regions, and audiences." },
  { title: "Turn Engagement Into Intelligence", body: "Use real-world interaction data to optimize campaigns, improve content, support sales teams, and make smarter business decisions." }];

  return (
    <section id="experience" data-screen-label="Experience" style={{ background: "#FFF6EA", padding: "clamp(72px, 10vw, 120px) clamp(20px, 5vw, 64px)", fontFamily: "Montserrat" }}>
      <div style={{ maxWidth: 1180, margin: "0 auto" }}>
        <div className="ts-feature-grid" style={{ display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: "clamp(32px, 5vw, 72px)", alignItems: "center" }}>
          <div>
            <img src="assets/pill-experience.svg" alt="TapScan Experience" style={{ height: 56, display: "block", marginBottom: 24, maxWidth: "100%", filter: "drop-shadow(0 8px 18px rgba(28,34,80,0.22))" }} />
            <h2 style={{ fontWeight: 900, fontSize: "clamp(28px, 4.5vw, 44px)", lineHeight: 1.1, margin: 0, color: "#212331", letterSpacing: "-0.015em" }}>
              <span style={{ fontSize: 40 }}>Influence the Moment. Learn From the Outcome</span><span style={{ color: "#FFB855" }}>.</span>
            </h2>
            <p style={{ fontWeight: 400, lineHeight: 1.6, color: "#212331", marginTop: 20, fontSize: "15px" }}>
              TapScan's platform enables brands and retailers to deliver the right content from every physical touchpoint, adapting experiences by language, product, location, retailer, campaign, time, user need, or stage in the customer journey. From one code, teams can support multilingual audiences, localize content by market or store, guide shoppers and consumers to the right experience, and measure which touchpoints are driving engagement and ROI.
            </p>
            <button onClick={() => onCaseStudies("experience")} className="ts-cta-btn" style={{
              marginTop: 32, fontFamily: "Montserrat", fontWeight: 700, fontSize: 15,
              padding: "16px 28px", borderRadius: 8,
              background: "#FFB855", color: "#1C2250", border: "none", cursor: "pointer",
              display: "inline-flex", alignItems: "center", gap: 10,
            }}
            onMouseEnter={(e) => e.currentTarget.style.background = "#E99623"}
            onMouseLeave={(e) => e.currentTarget.style.background = "#FFB855"}>
              <span>View Experience Case Studies</span>
              <span className="ts-cta-arrow" aria-hidden="true" style={{ display: "inline-flex" }}>
                <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round">
                  <line x1="4" y1="12" x2="20" y2="12" />
                  <polyline points="13 5 20 12 13 19" />
                </svg>
              </span>
            </button>
          </div>
          <div>
            <window.ExperienceViz />
          </div>
        </div>
        <div className="ts-tier-grid" style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 16, marginTop: 64 }}>
          {tiers.map((t, i) =>
          <div key={i} style={{ background: "#fff", borderRadius: 12, padding: 20, border: "1px solid #F9DCB3" }}>
              <PlaceholderIcon bg="#FFE7C2" fg="#7A5A1F" idx={i} />
              <h4 style={{ fontWeight: 900, fontSize: 15, margin: 0, color: "#212331" }}>{t.title}</h4>
              <p style={{ fontWeight: 400, fontSize: 13, lineHeight: 1.55, color: "#444", marginTop: 6 }}>{t.body}</p>
            </div>
          )}
        </div>
      </div>
    </section>);
}

function VarA_Accountability({ onCaseStudies }) {
  // Placeholder copy until final marketing text lands.
  const tiers = [
  { title: "See Every Activation Live", body: "Know where campaigns, displays, signage, and assets are active across every location, without waiting for reports, spreadsheets, or field updates." },
  { title: "Verify Execution with Proof", body: "Capture photo validation, location data, timestamps, and completion records to confirm that every activation happened as intended." },
  { title: "Identify Gaps Before They Cost You", body: "Instantly uncover missing assets, execution failures, compliance issues, and rollout inconsistencies while there’s still time to fix them." },
  { title: "Turn Execution Into ROI Intelligence", body: "Use live execution data to act while programs are in market, improve operational efficiency, reduce waste, and understand which assets, stores, regions, and campaigns drive results." }];

  return (
    <section id="accountability" data-screen-label="Accountability" style={{ background: "#F5F6FF", padding: "clamp(72px, 10vw, 120px) clamp(20px, 5vw, 64px)", fontFamily: "Montserrat" }}>
      <div style={{ maxWidth: 1180, margin: "0 auto" }}>
        <div className="ts-feature-grid" style={{ display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: "clamp(32px, 5vw, 72px)", alignItems: "center" }}>
          <div>
            <img src="assets/pill-accountability.svg" alt="TapScan Accountability" style={{ height: 56, display: "block", marginBottom: 24, maxWidth: "100%", filter: "drop-shadow(0 8px 18px rgba(28,34,80,0.22))" }} />
            <h2 style={{ fontWeight: 900, fontSize: "clamp(28px, 4.5vw, 44px)", lineHeight: 1.1, margin: 0, color: "#212331", letterSpacing: "-0.015em" }}>
              <span style={{ fontSize: 40 }}>Know What’s Happening. See What Needs Action</span><span style={{ color: "#6976E7" }}>.</span>
            </h2>
            <p style={{ fontWeight: 400, lineHeight: 1.6, color: "#212331", marginTop: 20, fontSize: "15px" }}>
              TapScan gives teams real-time visibility across stores, products, assets, service workflows, supply chain touchpoints, and locations. Instead of relying on manual updates, disconnected reports, or assumptions, TapScan creates a digital record of real-world activity so teams can verify execution, track issues, improve traceability, and protect ROI.
            </p>
            <button onClick={() => onCaseStudies("accountability")} className="ts-cta-btn" style={{
              marginTop: 32, fontFamily: "Montserrat", fontWeight: 700, fontSize: 15,
              padding: "16px 28px", borderRadius: 8,
              background: "#2F3886", color: "#fff", border: "none", cursor: "pointer",
              display: "inline-flex", alignItems: "center", gap: 10,
            }}
            onMouseEnter={(e) => e.currentTarget.style.background = "#1C2250"}
            onMouseLeave={(e) => e.currentTarget.style.background = "#2F3886"}>
              <span>View Accountability Case Studies</span>
              <span className="ts-cta-arrow" aria-hidden="true" style={{ display: "inline-flex" }}>
                <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round">
                  <line x1="4" y1="12" x2="20" y2="12" />
                  <polyline points="13 5 20 12 13 19" />
                </svg>
              </span>
            </button>
          </div>
          <div>
            <window.AccountabilityViz />
          </div>
        </div>
        <div className="ts-tier-grid" style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 16, marginTop: 64 }}>
          {tiers.map((t, i) =>
          <div key={i} style={{ background: "#fff", borderRadius: 12, padding: 20, border: "1px solid #DDDFEE" }}>
              <PlaceholderIcon bg="#E1E5FF" fg="#3A4499" idx={i} variant="acc" />
              <h4 style={{ fontWeight: 900, fontSize: 15, lineHeight: 1.2, minHeight: "2.4em", margin: 0, color: "#212331" }}>{t.title.split("|").map((ln, j) => j === 0 ? ln : [<br key={j} />, ln])}</h4>
              <p style={{ fontWeight: 400, fontSize: 13, lineHeight: 1.55, color: "#444", marginTop: 6 }}>{t.body}</p>
            </div>
          )}
        </div>
      </div>
    </section>);
}

function VarA_About() {
  // Three values — each gets a brand-coloured chip and a contrasting icon.
  // Sequence: light brand blue → main brand blue → brand orange.
  const valueChipBg = ["#6976E7", "#2F3886", "#FFB855"];
  // Icon stroke colour per chip — white reads on the blues; the amber chip
  // needs the navy ink so the glyph still has contrast.
  const valueIconStroke = ["#fff", "#fff", "#1C2250"];
  const values = [
  {
    title: "Insight Over Assumption",
    body: "We dig into what's actually happening at the touchpoint, not what people think is happening.",
    icon:
    <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
          <circle cx="11" cy="11" r="7" />
          <line x1="16.5" y1="16.5" x2="21" y2="21" />
          <line x1="11" y1="8" x2="11" y2="14" />
          <line x1="8" y1="11" x2="14" y2="11" />
        </svg>

  },
  {
    title: "Collaboration Drives Results",
    body: "The best work happens when brand, agency, and field teams build on the same shared signal.",
    icon:
    <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
          <circle cx="9" cy="8" r="3" />
          <circle cx="17" cy="9" r="2.5" />
          <path d="M3 20c0-3 3-5 6-5s6 2 6 5" />
          <path d="M15 20c0-2 2-3.5 4-3.5s2.5 1 2.5 1" />
        </svg>

  },
  {
    title: "Always Be Evolving",
    body: "We don't stand still. Every campaign teaches us something, and every next one is sharper for it.",
    icon:
    <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
          <path d="M21 12a9 9 0 1 1-3-6.7" />
          <polyline points="21 4 21 10 15 10" />
        </svg>

  }];


  return (
    <section id="about" data-screen-label="About" style={{ padding: "clamp(72px, 10vw, 120px) clamp(20px, 5vw, 64px)", background: "#fff", fontFamily: "Montserrat" }}>
      <div style={{ maxWidth: 1180, margin: "0 auto" }}>
        <div style={{ maxWidth: 820, margin: "0 auto 56px", textAlign: "center" }}>
          <div style={{ fontWeight: 700, fontSize: 11, letterSpacing: "0.16em", textTransform: "uppercase", color: "#FFB855", marginBottom: 16 }}>Our Story</div>
          <h2 style={{ fontWeight: 900, fontSize: "clamp(28px, 4.5vw, 44px)", lineHeight: 1.1, margin: 0, color: "#212331", letterSpacing: "-0.015em" }}>
            Built by brand experts, backed by experience<span style={{ color: "#FFB855" }}>.</span>
          </h2>
          <p style={{ fontWeight: 400, fontSize: "clamp(15px, 1.5vw, 17px)", lineHeight: 1.65, color: "#212331", marginTop: 24 }}>
            TapScan was founded in 2018 as part of <strong style={{ color: "#2F3886" }}>Ahead of the Curve Group</strong>. Co-founders <strong>Terry Dennis</strong> and <strong>John Snow</strong> are former leaders in brand marketing, design, and global customer packaging, with decades of experience at CPG companies including Nestlé and Unilever.
          </p>
          <p style={{ fontWeight: 400, fontSize: "clamp(15px, 1.5vw, 17px)", lineHeight: 1.65, color: "#212331", marginTop: 16 }}>
            That experience shaped what TapScan is today. We&rsquo;ve built a dedicated team to close the gap brands are facing, turning everyday touchpoints into adaptive experiences and actionable accountability that brand teams can stand behind.
          </p>
        </div>
        <div>
          <h3 style={{ fontWeight: 700, fontSize: "clamp(22px, 2.8vw, 28px)", margin: 0, color: "#212331", textAlign: "center", letterSpacing: "-0.01em" }}>What We Believe In<span style={{ color: "#FFB855" }}>.</span></h3>
          <div className="ts-values-grid" style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 24, marginTop: 40 }}>
            {values.map((v, i) =>
            <div key={i} style={{ background: "#F5F6FF", borderRadius: 16, padding: 32 }}>
                <div style={{ width: 48, height: 48, borderRadius: 10, background: valueChipBg[i], color: valueIconStroke[i], display: "grid", placeItems: "center", marginBottom: 20 }}>{v.icon}</div>
                <h4 style={{ fontWeight: 900, fontSize: 18, margin: 0, color: "#212331" }}>{v.title}<span style={{ color: "#FFB855" }}>.</span></h4>
                <p style={{ fontWeight: 400, fontSize: 14, lineHeight: 1.6, color: "#212331", marginTop: 10 }}>{v.body}</p>
              </div>
            )}
          </div>
          <div style={{ display: "flex", justifyContent: "center", marginTop: 40 }}>
            <style>{`
              /* On-white variant of the primary CTA hover — the standard hover flips
                 to white, which vanishes on this white section. Flip to brand navy instead. */
              .ts-cta-btn-about:hover { background: #2F3886 !important; color: #fff !important; box-shadow: 0 18px 38px rgba(47,56,134,0.28); }
            `}</style>
            <a href="about.html" className="ts-cta-btn ts-cta-btn-about" style={{
                fontFamily: "Montserrat", fontWeight: 700, fontSize: 16,
                padding: "20px 24px", borderRadius: 8,
                background: "#FFB855", color: "#1C2250",
                border: "none", cursor: "pointer", textDecoration: "none",
                display: "inline-flex", alignItems: "center", justifyContent: "center", gap: 10,
              }}>
              <span>Learn More About Us</span>
              <span className="ts-cta-arrow" aria-hidden="true" style={{ display: "inline-flex" }}>
                <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round">
                  <line x1="4" y1="12" x2="20" y2="12" />
                  <polyline points="13 5 20 12 13 19" />
                </svg>
              </span>
            </a>
          </div>
        </div>
      </div>
    </section>);
}

window.VarA_Basics = VarA_Basics;
window.VarA_Experience = VarA_Experience;
window.VarA_Accountability = VarA_Accountability;
window.VarA_About = VarA_About;