// Never Forget — modernized landing using actual app assets

const useReveal = () => {
  React.useEffect(() => {
    const els = document.querySelectorAll(".reveal, .reveal-stagger");
    const obs = new IntersectionObserver((entries) => {
      entries.forEach((e) => {
        if (e.isIntersecting) {
          e.target.classList.add("in");
          obs.unobserve(e.target);
        }
      });
    }, { threshold: 0.12, rootMargin: "0px 0px -60px 0px" });
    els.forEach((el) => obs.observe(el));
    return () => obs.disconnect();
  }, []);
};

// Tilt-on-hover for feature cards
const useTilt = () => {
  React.useEffect(() => {
    const cards = document.querySelectorAll(".feature-card.tilt");
    const handlers = [];
    cards.forEach((card) => {
      const onMove = (e) => {
        const r = card.getBoundingClientRect();
        const px = (e.clientX - r.left) / r.width;
        const py = (e.clientY - r.top) / r.height;
        const rx = (py - 0.5) * -6;
        const ry = (px - 0.5) * 8;
        card.style.transform = `perspective(1000px) rotateX(${rx}deg) rotateY(${ry}deg) translateY(-3px)`;
        card.style.setProperty("--mx", `${px * 100}%`);
        card.style.setProperty("--my", `${py * 100}%`);
      };
      const onLeave = () => {card.style.transform = "";};
      card.addEventListener("mousemove", onMove);
      card.addEventListener("mouseleave", onLeave);
      handlers.push([card, onMove, onLeave]);
    });
    return () => handlers.forEach(([c, m, l]) => {
      c.removeEventListener("mousemove", m);
      c.removeEventListener("mouseleave", l);
    });
  }, []);
};

// Magnetic effect for primary CTAs
const useMagnetic = () => {
  React.useEffect(() => {
    const els = document.querySelectorAll("[data-magnetic]");
    const handlers = [];
    els.forEach((el) => {
      const onMove = (e) => {
        const r = el.getBoundingClientRect();
        const x = e.clientX - r.left - r.width / 2;
        const y = e.clientY - r.top - r.height / 2;
        el.style.transform = `translate(${x * 0.18}px, ${y * 0.22}px)`;
      };
      const onLeave = () => {el.style.transform = "";};
      el.addEventListener("mousemove", onMove);
      el.addEventListener("mouseleave", onLeave);
      handlers.push([el, onMove, onLeave]);
    });
    return () => handlers.forEach(([el, m, l]) => {
      el.removeEventListener("mousemove", m);
      el.removeEventListener("mouseleave", l);
    });
  }, []);
};



// Animated count up
const CountUp = ({ end, duration = 1600, suffix = "", decimals = 0 }) => {
  const [val, setVal] = React.useState(0);
  const ref = React.useRef(null);
  const started = React.useRef(false);
  React.useEffect(() => {
    const el = ref.current;
    if (!el) return;
    const obs = new IntersectionObserver(([entry]) => {
      if (entry.isIntersecting && !started.current) {
        started.current = true;
        let raf, start;
        const tick = (ts) => {
          if (!start) start = ts;
          const t = Math.min((ts - start) / duration, 1);
          const eased = 1 - Math.pow(1 - t, 3);
          setVal(end * eased);
          if (t < 1) raf = requestAnimationFrame(tick);
        };
        raf = requestAnimationFrame(tick);
      }
    }, { threshold: 0.4 });
    obs.observe(el);
    return () => obs.disconnect();
  }, [end, duration]);
  return <span ref={ref} className="bignum">{val.toFixed(decimals)}{suffix}</span>;
};

const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
  "theme": "light"
} /*EDITMODE-END*/;

const App = () => {
  const [tweaks, setTweak] = useTweaks(TWEAK_DEFAULTS);

  React.useEffect(() => {
    document.documentElement.setAttribute("data-theme", tweaks.theme);
  }, [tweaks.theme]);

  useReveal();
  useTilt();
  useMagnetic();

  return (
    <>
      <Nav tweaks={tweaks} setTweak={setTweak} />
      <Hero />
      <Marquee />
      <SetupSection />
      <ScienceSection />
      <ProgressSection />
      <RuleSection />
      <PrivacySection />
      <PremiumSection />
      <CTASection />
      <Footer />

      <TweaksPanel title="Tweaks">
        <TweakSection title="Appearance">
          <TweakRadio
            value={tweaks.theme}
            options={[
            { value: "light", label: "Light" },
            { value: "dark", label: "Dark" }]
            }
            onChange={(v) => setTweak("theme", v)} />
          
        </TweakSection>
      </TweaksPanel>
    </>);

};

const AppleLogo = ({ size = 18, color = "currentColor" }) =>
<svg width={size} height={size * 1.22} viewBox="0 0 384 470" fill={color} aria-hidden="true">
    <path d="M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C61.8 141.6 0 184.3 0 271.4c0 25.8 4.7 52.4 14.1 79.7 12.6 35.8 58 123.6 105.2 122.1 24.7-.6 42.1-17.5 74.3-17.5 31.2 0 47.4 17.5 75 17.5 47.6-.7 88.7-80.5 100.7-116.4-64.2-30.3-50.6-88.7-50.6-88.1zM256.5 100.6c34.1-40.4 31-77.2 30-90.6-30 1.7-64.7 20.4-84.5 43.4-21.8 24.6-34.6 55-31.9 89 32.5 2.5 62.2-14.1 86.4-41.8z" />
  </svg>;


const AppStoreButton = ({ small = false }) =>
<a
  href="https://apps.apple.com/us/app/never-forget-spaced-reminder/id1551467159"
  style={{
    display: "inline-flex",
    alignItems: "center",
    gap: 12,
    padding: small ? "10px 18px 10px 14px" : "12px 22px 12px 18px",
    background: "var(--ink)",
    color: "var(--bg)",
    borderRadius: small ? 12 : 14,
    textDecoration: "none",
    transition: "transform 0.2s, opacity 0.2s"
  }}
  onMouseEnter={(e) => {e.currentTarget.style.transform = "translateY(-2px)";e.currentTarget.style.opacity = "0.92";}}
  onMouseLeave={(e) => {e.currentTarget.style.transform = "";e.currentTarget.style.opacity = "1";}}>
  
    <AppleLogo size={small ? 18 : 22} />
    <div>
      <div style={{ fontSize: small ? 10 : 11, opacity: 0.8, lineHeight: 1, letterSpacing: 0.04, textTransform: "uppercase" }}>Download on the</div>
      <div style={{ fontSize: small ? 16 : 19, fontWeight: 600, lineHeight: 1.1, marginTop: 3, letterSpacing: "-0.01em" }}>App Store</div>
    </div>
  </a>;


const Nav = ({ tweaks, setTweak }) =>
<nav className="nav">
    <div className="shell nav-inner">
      <div className="brand">
        <img className="brand-icon" src="assets/app-icon.png" alt="Never Forget" />
        <span>Never Forget</span>
      </div>
      <div className="nav-links">
        <a href="#science">The science</a>
        <a href="#features">Features</a>
        <a href="#privacy">Privacy</a>
        <a href="#premium">Premium</a>
      </div>
      <div style={{ display: "flex", alignItems: "center", gap: 12 }}>
        <button
        onClick={() => setTweak("theme", tweaks.theme === "light" ? "dark" : "light")}
        aria-label="Toggle theme"
        style={{
          width: 36, height: 36, borderRadius: "50%",
          background: "transparent", border: "1px solid var(--line)",
          cursor: "pointer", display: "grid", placeItems: "center",
          color: "var(--text)", fontSize: 14
        }}>
        
          {tweaks.theme === "light" ? "☾" : "☀"}
        </button>
        <a href="https://apps.apple.com/us/app/never-forget-spaced-reminder/id1551467159" className="nav-cta">
          Get the app
        </a>
      </div>
    </div>
  </nav>;


// Floaters live in the *upper* hero zone only (above the phone screenshot),
// so they don't fight with the in-frame mini cards near hero-ios26.
// Kept to the LEFT/RIGHT wings — the central title column stays clear.
const HERO_FLOATERS = [
  // LEFT column — top to bottom
  { title: "Sapiens · Ch. 7",       meta: "Reviewed · 2d ago",   emoji: "📖", grad: "linear-gradient(135deg, #38B6E6, #1E94C5)", x: "2%",  y: "4%",  delay: 0.2, dur: 13, drift: "a" },
  { title: "Calculus · L'Hôpital",  meta: "Next rep · in 3d",    emoji: "∫",  grad: "linear-gradient(135deg, #6B7CE8, #4D5EC9)", x: "-1%", y: "26%", delay: 1.0, dur: 18, drift: "c" },
  { title: "Lex Fridman #412",      meta: "Reminder · 8 PM",     emoji: "🎙", grad: "linear-gradient(135deg, #2BBFB0, #1F8E82)", x: "3%",  y: "48%", delay: 1.4, dur: 14, drift: "b" },
  { title: "Atomic Habits · Ch. 4", meta: "Reviewed · today",    emoji: "📘", grad: "linear-gradient(135deg, #B19BE0, #8E74C9)", x: "1%",  y: "70%", delay: 1.7, dur: 15, drift: "a" },

  // RIGHT column — top to bottom
  { title: "Stoicism notes",        meta: "Repped · today",      emoji: "🏛", grad: "linear-gradient(135deg, #B19BE0, #8E74C9)", x: "84%", y: "6%",  delay: 0.5, dur: 17, drift: "c" },
  { title: "Spanish — irregulars",  meta: "Next rep · tomorrow", emoji: "🇪🇸", grad: "linear-gradient(135deg, #F2A65A, #D9853E)", x: "82%", y: "28%", delay: 0.8, dur: 15, drift: "b" },
  { title: "Mom's lasagna recipe",  meta: "Next rep · in 5d",    emoji: "🍝", grad: "linear-gradient(135deg, #E26D8E, #B8506E)", x: "84%", y: "50%", delay: 1.2, dur: 16, drift: "a" },
  { title: "Brave New World",       meta: "Reviewed · 1w ago",   emoji: "📚", grad: "linear-gradient(135deg, #38B6E6, #1E94C5)", x: "82%", y: "72%", delay: 1.6, dur: 15, drift: "a" }
];

const HeroFloater = ({ title, meta, emoji, grad, x, y, delay, dur, drift }) =>
  <div
    className={`hero-floater hero-floater-drift-${drift}`}
    style={{
      left: x,
      top: y,
      animationDelay: `${delay}s, ${delay + 0.6}s`,
      animationDuration: `0.9s, ${dur}s`
    }}
    aria-hidden="true">
    <div className="hero-floater-dot" style={{ background: grad }}>{emoji}</div>
    <div className="hero-floater-text">
      <div className="hero-floater-title">{title}</div>
      <div className="hero-floater-meta">{meta}</div>
    </div>
  </div>;

const Hero = () =>
<section style={{ paddingTop: 72, paddingBottom: 48, position: "relative", overflow: "hidden" }}>
    <div className="hero-bg-pro" aria-hidden="true">
      <div className="blob blob-1" />
      <div className="blob blob-2" />
      <div className="blob blob-3" />
    </div>
    <div className="grid-backdrop" aria-hidden="true" />
    <div className="hero-floaters" aria-hidden="true">
      {HERO_FLOATERS.map((f, i) => <HeroFloater key={i} {...f} />)}
    </div>
    <div className="shell" style={{ position: "relative", zIndex: 1 }}>
      <div style={{ display: "flex", flexDirection: "column", alignItems: "center", textAlign: "center", maxWidth: 920, margin: "0 auto" }}>
        <div className="section-eyebrow fadein-up-1" style={{ marginBottom: 24, display: "inline-flex", alignItems: "center", gap: 8 }}>
          <span className="pulse-dot" /> Spaced repetition, reimagined
        </div>
        <h1 className="h-display fadein-up-2" style={{ marginBottom: 24 }}>
          Remember what<br />
          you <span className="gradient-text-anim">don't want to forget.</span>
        </h1>
        <p className="lede fadein-up-3" style={{ marginBottom: 36, fontSize: "clamp(18px, 1.5vw, 22px)" }}>
          A simple, science-backed reminder app for the books, lectures, and ideas that <span className="lede-emph">don't fit in flashcards</span>. Set it once — Never Forget keeps the rhythm.
        </p>
        <div className="fadein-up-4" style={{ display: "flex", gap: 16, alignItems: "center", flexWrap: "wrap", justifyContent: "center", marginBottom: 16 }}>
          <span data-magnetic style={{ display: "inline-block", transition: "transform 0.25s cubic-bezier(.2,.7,.2,1)" }}>
            <AppStoreButton />
          </span>
          <a href="#science" className="btn btn-ghost">See how it works</a>
        </div>
        <div className="fadein-up-5" style={{ display: "flex", gap: 24, alignItems: "center", marginTop: 20, fontSize: 13.5, color: "var(--muted)", flexWrap: "wrap", justifyContent: "center" }}>
          <span>Free to start</span>
          <span style={{ width: 4, height: 4, borderRadius: "50%", background: "var(--muted)" }} />
          <span>No flashcards</span>
          <span style={{ width: 4, height: 4, borderRadius: "50%", background: "var(--muted)" }} />
          <span>30 seconds to set up</span>
        </div>
      </div>

      <div className="reveal hero-stage" style={{ marginTop: 80, display: "flex", justifyContent: "center", position: "relative" }}>
        <div style={{ position: "relative", maxWidth: 836, width: "95%", display: "flex", justifyContent: "center" }}>
          <img
          src="assets/hero-ios26.png"
          alt="Never Forget app on Apple devices showing colorful reminder cards"
          className="screenshot screenshot-float"
          style={{ width: "100%", height: "auto", padding: "0px 0px 30px" }} />
        
          <div className="hero-card hero-card-1 float">
            <div className="dot" style={{ background: "linear-gradient(135deg, #38B6E6, #1E94C5)" }}>📚</div>
            <div>
              <div style={{ fontSize: 11, color: "var(--muted)", fontWeight: 600, letterSpacing: 0.4, textTransform: "uppercase" }}>Reviewed</div>
              <div>Atomic Habits · Ch. 4</div>
            </div>
          </div>
          <div className="hero-card hero-card-2 float">
            <div className="dot" style={{ background: "linear-gradient(135deg, #2BBFB0, #1F8E82)" }}>✓</div>
            <div>
              <div style={{ fontSize: 11, color: "var(--muted)", fontWeight: 600, letterSpacing: 0.4, textTransform: "uppercase" }}>Next rep</div>
              <div>in 3 days</div>
            </div>
          </div>
          <div className="hero-card hero-card-3 float">
            <div className="dot" style={{ background: "linear-gradient(135deg, #B19BE0, #8E74C9)" }}>🔔</div>
            <div>
              <div style={{ fontSize: 11, color: "var(--muted)", fontWeight: 600, letterSpacing: 0.4, textTransform: "uppercase" }}>Reminder</div>
              <div>Today, 7:30 PM</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div className="scroll-cue" aria-hidden="true">
      <span>Scroll</span>
      <span className="line" />
    </div>
  </section>;


const Marquee = () => {
  const items = [
  "Books you read",
  "Lectures you watched",
  "Podcasts you loved",
  "Tweets that stuck",
  "Languages you're learning",
  "Recipes you tried",
  "Ideas you'll need next month",
  "Names you keep forgetting"];

  const all = [...items, ...items];
  return (
    <section style={{ padding: "32px 0 16px", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)", background: "var(--bg-alt)" }}>
      <div style={{ fontSize: 11, color: "var(--muted)", letterSpacing: 1.6, fontWeight: 700, textTransform: "uppercase", textAlign: "center", marginBottom: 18 }}>
        For everything you'd rather not lose
      </div>
      <div className="marquee">
        <div className="marquee-track">
          {all.map((s, i) =>
          <span key={i} className="marquee-item">
              <span className="marquee-dot" />
              {s}
            </span>
          )}
        </div>
      </div>
    </section>);

};

const Star = () =>
<svg width="14" height="14" viewBox="0 0 24 24" fill="var(--blue)">
    <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" />
  </svg>;


const SetupSection = () =>
<section style={{ paddingTop: 96, paddingBottom: 96, position: "relative", overflow: "hidden" }}>
    <div className="shell">
      <div className="reveal setup-grid" style={{ display: "grid", gridTemplateColumns: "1fr 1.05fr", gap: 80, alignItems: "center" }}>
        <div>
          <div className="section-eyebrow">Set it up in seconds</div>
          <h2 className="h-1" style={{ marginBottom: 24 }}>
            One screen.<br />
            <span className="gradient-text">Then it runs itself.</span>
          </h2>
          <p className="lede" style={{ marginBottom: 32 }}>
            Name what you want to remember, pick a color, choose a rhythm — and you're done. Never Forget handles the timing for the next year.
          </p>
          <div style={{ display: "flex", flexDirection: "column", gap: 20 }}>
            <FeatureItem
            title="Anything goes — no flashcards"
            desc="A book, a chapter, a recipe, a lecture, a name. If you can title it, you can rep it." />
          
            <FeatureItem
            title="Pick a schedule, not a system"
            desc="Three built-in rhythms cover most cases. Make your own with Premium." />
          
            <FeatureItem
            title="Color and category to find it later"
            desc="A small touch that pays off when you have hundreds of reps in flight." />
          
          </div>
        </div>

        <div style={{ display: "flex", justifyContent: "center", position: "relative" }}>
          {/* soft halo behind the phone */}
          <div aria-hidden="true" style={{
          position: "absolute", inset: 0,
          background: "radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--blue) 14%, transparent) 0%, transparent 60%)",
          filter: "blur(40px)", pointerEvents: "none"
        }} />
          <img
          src="assets/add-new-review.png"
          alt="New Review screen — title, category, color, schedule, and dates"
          style={{
            position: "relative",
            width: "100%",
            maxWidth: 340,
            height: "auto",
            display: "block",
            filter: "drop-shadow(0 30px 60px rgba(15,30,55,0.22)) drop-shadow(0 10px 20px rgba(15,30,55,0.10))"
          }} />
        
          {/* Floating annotation card — picks up the form's "30 seconds" beat */}
          <div className="setup-annotation" aria-hidden="true">
            <div className="setup-annotation-stopwatch">
              <svg width="16" height="16" viewBox="0 0 24 24" fill="none">
                <circle cx="12" cy="13" r="7.5" stroke="currentColor" strokeWidth="1.7" />
                <path d="M12 13L12 9" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" />
                <path d="M12 13L15 14.5" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" />
                <path d="M10 3.5L14 3.5" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" />
              </svg>
            </div>
            <div>
              <div style={{ fontSize: 11, color: "var(--muted)", fontWeight: 600, letterSpacing: 0.4, textTransform: "uppercase" }}>Avg. setup</div>
              <div style={{ fontSize: 17, fontWeight: 600, color: "var(--text)", letterSpacing: "-0.01em" }}>~30 seconds</div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <style>{`
      @media (max-width: 920px) {
        .setup-grid { grid-template-columns: 1fr !important; gap: 56px !important; }
        .setup-grid > div:first-child { order: 2; }
      }
      .setup-annotation {
        position: absolute;
        top: 18%;
        right: -8px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px 12px 12px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 16px;
        box-shadow: 0 18px 40px -16px rgba(15,30,55,0.20), 0 6px 14px -8px rgba(15,30,55,0.10);
        animation: float 7s ease-in-out infinite;
      }
      .setup-annotation-stopwatch {
        width: 32px; height: 32px; border-radius: 9px;
        background: var(--blue-soft);
        color: var(--blue-darker);
        display: grid; place-items: center;
        flex-shrink: 0;
      }
      @media (max-width: 600px) {
        .setup-annotation { right: 0; top: 8%; padding: 10px 14px 10px 10px; }
      }
    `}</style>
  </section>;


const ScienceSection = () =>
<section id="science" style={{ background: "var(--bg-alt)" }}>
    <div className="shell">
      <div className="reveal">
        <ScienceInteractive />
      </div>
    </div>
  </section>;


const SchedulesSection = () =>
<section id="schedules">
    <div className="shell">
      <div className="reveal" style={{ textAlign: "center", maxWidth: 720, margin: "0 auto 64px" }}>
        <div className="section-eyebrow">Schedules</div>
        <h2 className="h-1" style={{ marginBottom: 20 }}>
          Three rhythms.<br />
          One for every kind of memory.
        </h2>
        <p className="lede" style={{ margin: "0 auto" }}>
          Pick the cadence that matches what you're learning. Never Forget reminds you when it's time to review — you don't need to keep track.
        </p>
      </div>

      <div className="reveal" style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 24 }} className="schedule-grid">
        <ScheduleCard
        imgSrc="assets/schedule-classic.png"
        name="Classic"
        reps="9"
        duration="52 weeks"
        desc="The default. Best for general learning and long-term retention." />
      
        <ScheduleCard
        imgSrc="assets/schedule-fast.png"
        name="Fast"
        reps="7"
        duration="23 weeks"
        desc="For shorter retention windows — projects, talks, coursework."
        premium />
      
        <ScheduleCard
        imgSrc="assets/schedule-superfast.png"
        name="Super-fast"
        reps="8"
        duration="13 weeks"
        desc="Tighter intervals when an exam or interview is around the corner."
        premium />
      
      </div>

      <div className="reveal" style={{ marginTop: 24, textAlign: "center", fontSize: 13.5, color: "var(--muted)" }}>
        Fast & Super-fast schedules are available with Premium. Custom schedules included.
      </div>
    </div>

    {/* Floating bridge fragments — drift from Schedules into the next section */}

    <style>{`
      @media (max-width: 820px) {
        .schedule-grid { grid-template-columns: 1fr !important; }
      }
    `}</style>
  </section>;


// CSS calendar placeholder — drawn in the phone frame for the Calendar view.
// Mirrors the app's color-coded reps. Swap with a real screenshot when one is uploaded.
const DvCalendarMock = () => {
  const days = ["M", "T", "W", "T", "F", "S", "S"];
  // 5 weeks of dot data — color codes match the app's palette
  const weeks = [
    [null, null, null, "purple", null, null, "blue"],
    ["pink", null, null, null, "blue", null, null],
    [null, "purple", null, "blue", null, null, "teal"],
    ["blue", null, "pink", null, null, "purple", null],
    [null, null, "blue", null, "teal", null, null]
  ];
  const colorMap = {
    blue: "#3B82F6",
    pink: "#E26D8E",
    purple: "#B19BE0",
    teal: "#2BBFB0"
  };
  return (
    <div className="dv2-cal">
      <div className="dv2-cal-status" aria-hidden="true">
        <span>9:41</span>
        <span className="dv2-cal-status-right">
          <span className="dv2-cal-bar" /><span className="dv2-cal-bar" /><span className="dv2-cal-bar" />
        </span>
      </div>
      <div className="dv2-cal-head">
        <div className="dv2-cal-title">Never Forget</div>
        <div className="dv2-cal-sub">May 2026</div>
      </div>
      <div className="dv2-cal-toolbar">
        <span className="dv2-cal-chip dv2-cal-chip-active">Month</span>
        <span className="dv2-cal-chip">Week</span>
        <span className="dv2-cal-chip">Agenda</span>
      </div>
      <div className="dv2-cal-grid">
        {days.map((d, i) => <div key={`h${i}`} className="dv2-cal-dh">{d}</div>)}
        {weeks.flatMap((w, wi) => w.map((c, di) => {
          const day = wi * 7 + di + 1;
          const isToday = day === 12;
          return (
            <div key={`${wi}-${di}`} className={`dv2-cal-cell ${isToday ? "is-today" : ""}`}>
              <span className="dv2-cal-num">{day <= 31 ? day : ""}</span>
              {c && <span className="dv2-cal-dot" style={{ background: colorMap[c] }} />}
            </div>
          );
        }))}
      </div>
      <div className="dv2-cal-list">
        <div className="dv2-cal-row">
          <span className="dv2-cal-row-rail" style={{ background: "#3B82F6" }} />
          <div className="dv2-cal-row-text">
            <div className="dv2-cal-row-title">Principles of Economics</div>
            <div className="dv2-cal-row-meta">4:50 PM · Classic</div>
          </div>
        </div>
        <div className="dv2-cal-row">
          <span className="dv2-cal-row-rail" style={{ background: "#B19BE0" }} />
          <div className="dv2-cal-row-text">
            <div className="dv2-cal-row-title">Siu Nim Tao</div>
            <div className="dv2-cal-row-meta">7:00 PM · Classic</div>
          </div>
        </div>
      </div>
    </div>
  );
};

const DV_VIEWS = [
  {
    id: "upcoming",
    label: "Upcoming",
    sub: "On the schedule",
    src: "assets/upcoming.png",
    headline: "Tomorrow, Wednesday, next Monday.",
    body: "Reps grouped by when they're due. Glance once and know what your week looks like — no calendar archaeology.",
    icon: (
      <svg width="18" height="18" viewBox="0 0 24 24" fill="none">
        <path d="M4 6h16M4 12h16M4 18h10" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" />
        <circle cx="2.2" cy="6" r="1.2" fill="currentColor" />
        <circle cx="2.2" cy="12" r="1.2" fill="currentColor" />
        <circle cx="2.2" cy="18" r="1.2" fill="currentColor" />
      </svg>
    ),
    stats: [
      { num: "3", label: "due tomorrow" },
      { num: "11", label: "this week" },
      { num: "47", label: "this month" }
    ],
    pins: [
      { x: "76%", y: "18%", side: "right", emoji: "🗓", label: "Grouped by day", desc: "Tomorrow, This Wednesday, Next Monday — no scrolling required." },
      { x: "10%", y: "53%", side: "left", emoji: "🎨", label: "Color = category", desc: "You set the color when you create the rep. It sticks." },
      { x: "78%", y: "78%", side: "right", emoji: "🔔", label: "Reminder time", desc: "Each rep can have its own time of day." }
    ]
  },
  {
    id: "calendar",
    label: "Calendar",
    sub: "Zoom out",
    mock: true,
    headline: "The whole month, at a glance.",
    body: "Every rep, dropped on the date it's due — color-coded by category. Tap a day to see what's on it. Switch to Week or Agenda when you need a different zoom.",
    icon: (
      <svg width="18" height="18" viewBox="0 0 24 24" fill="none">
        <rect x="3.5" y="5" width="17" height="15" rx="2.5" stroke="currentColor" strokeWidth="1.6" />
        <path d="M3.5 9.5h17" stroke="currentColor" strokeWidth="1.6" />
        <path d="M8 3.5v3M16 3.5v3" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" />
        <circle cx="12" cy="14.5" r="1.4" fill="currentColor" />
      </svg>
    ),
    stats: [
      { num: "Mo", label: "month" },
      { num: "Wk", label: "week" },
      { num: "Ag", label: "agenda" }
    ],
    pins: [
      { x: "78%", y: "26%", side: "right", emoji: "🟦", label: "Color dots", desc: "One dot per rep, in the rep's category color." },
      { x: "10%", y: "44%", side: "left", emoji: "📍", label: "Today is highlighted", desc: "A blue ring keeps your spot when you scroll months." },
      { x: "78%", y: "76%", side: "right", emoji: "🔍", label: "Tap to drill in", desc: "Open any day to see the full list with times." }
    ]
  },
  {
    id: "ongoing",
    label: "Ongoing",
    sub: "By topic",
    src: "assets/ongoing.png",
    headline: "Everything you're still learning.",
    body: "Folded into the categories you set. Open Martial Arts, see Martial Arts. Filter to Overdue, Failed, or Completed when you want a different cut.",
    icon: (
      <svg width="18" height="18" viewBox="0 0 24 24" fill="none">
        <path d="M3 5h7v7H3zM14 5h7v7h-7zM3 16h7v5H3zM14 16h7v5h-7z" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round" />
      </svg>
    ),
    stats: [
      { num: "9", label: "ongoing" },
      { num: "12", label: "categories" },
      { num: "4,031", label: "all-time" }
    ],
    pins: [
      { x: "12%", y: "26%", side: "left", emoji: "🏷", label: "Filter chips", desc: "Overdue, Ongoing, Failed, Completed — toggle a slice of your library." },
      { x: "78%", y: "44%", side: "right", emoji: "📂", label: "Collapsible", desc: "Tap a category to fold it. Big libraries stay readable." },
      { x: "12%", y: "72%", side: "left", emoji: "📊", label: "4,031 tasks", desc: "The total count, always visible up top. No dashboard needed." }
    ]
  }
];

const DV_AUTOPLAY_MS = 6000;

const DailyViewsSection = () => {
  const [activeIdx, setActiveIdx] = React.useState(0);
  const [paused, setPaused] = React.useState(false);
  const [progressKey, setProgressKey] = React.useState(0);
  const sectionRef = React.useRef(null);
  const inViewRef = React.useRef(false);

  // Autoplay — only when in view + not paused
  React.useEffect(() => {
    const el = sectionRef.current;
    if (!el) return;
    const obs = new IntersectionObserver(([entry]) => {
      inViewRef.current = entry.isIntersecting;
    }, { threshold: 0.3 });
    obs.observe(el);
    return () => obs.disconnect();
  }, []);

  React.useEffect(() => {
    if (paused) return;
    const id = setInterval(() => {
      if (inViewRef.current) {
        setActiveIdx((i) => (i + 1) % DV_VIEWS.length);
      }
    }, DV_AUTOPLAY_MS);
    return () => clearInterval(id);
  }, [paused]);

  // Reset progress bar animation each time activeIdx changes
  React.useEffect(() => { setProgressKey((k) => k + 1); }, [activeIdx, paused]);

  const active = DV_VIEWS[activeIdx];
  const setActive = (i) => { setActiveIdx(i); };

  return (
    <section id="daily-views" ref={sectionRef} style={{ paddingTop: 24, paddingBottom: 120 }}>
      <div className="shell">
        <div className="reveal" style={{ textAlign: "center", maxWidth: 720, margin: "0 auto 56px" }}>
          <div className="section-eyebrow">Daily views</div>
          <h2 className="h-1" style={{ marginBottom: 18 }}>
            Three ways to see <span className="gradient-text">your day.</span>
          </h2>
          <p className="lede" style={{ margin: "0 auto" }}>
            What's coming, the whole month, and everything still in flight. Pick the zoom level that fits the moment — Never Forget remembers where you were.
          </p>
        </div>

        <div
          className="dv2 reveal"
          onMouseEnter={() => setPaused(true)}
          onMouseLeave={() => setPaused(false)}>

          {/* LEFT — vertical tab ladder */}
          <div className="dv2-rail">
            {DV_VIEWS.map((v, i) => {
              const isActive = i === activeIdx;
              return (
                <button
                  key={v.id}
                  className={`dv2-tab ${isActive ? "is-active" : ""}`}
                  onClick={() => setActive(i)}
                  aria-pressed={isActive}>
                  <div className="dv2-tab-head">
                    <span className="dv2-tab-icon">{v.icon}</span>
                    <div className="dv2-tab-titles">
                      <span className="dv2-tab-label">{v.label}</span>
                      <span className="dv2-tab-sub">{v.sub}</span>
                    </div>
                    <span className="dv2-tab-num" aria-hidden="true">0{i + 1}</span>
                  </div>

                  <div className="dv2-tab-body">
                    <p className="dv2-tab-headline">{v.headline}</p>
                    <p className="dv2-tab-desc">{v.body}</p>

                    <div className="dv2-tab-stats">
                      {v.stats.map((s, j) => (
                        <div key={j} className="dv2-stat">
                          <div className="dv2-stat-num">{s.num}</div>
                          <div className="dv2-stat-label">{s.label}</div>
                        </div>
                      ))}
                    </div>

                    {isActive && !paused && (
                      <div key={progressKey} className="dv2-progress" aria-hidden="true">
                        <div className="dv2-progress-fill" style={{ animationDuration: `${DV_AUTOPLAY_MS}ms` }} />
                      </div>
                    )}
                  </div>
                </button>
              );
            })}

            <div className="dv2-rail-foot" aria-hidden="true">
              <span className={`dv2-rail-foot-dot ${paused ? "is-paused" : ""}`} />
              {paused ? "Paused — hover off to resume" : "Auto-cycling"}
            </div>
          </div>

          {/* RIGHT — phone stage */}
          <div className="dv2-stage">
            <div className="dv2-stage-glow" aria-hidden="true" />
            <div className="dv2-stage-grid" aria-hidden="true" />

            <div className="dv2-phone">
              {/* Phone bezel */}
              <div className="dv2-phone-screen">
                {DV_VIEWS.map((v, i) => {
                  const isActive = i === activeIdx;
                  if (v.mock) {
                    return (
                      <div
                        key={v.id}
                        className={`dv2-screen dv2-screen-mock ${isActive ? "is-active" : ""}`}
                        aria-hidden={!isActive}>
                        <DvCalendarMock />
                      </div>
                    );
                  }
                  return (
                    <img
                      key={v.id}
                      src={v.src}
                      alt={`${v.label} view`}
                      className={`dv2-screen ${isActive ? "is-active" : ""}`}
                      loading="lazy" />
                  );
                })}
                <div className="dv2-phone-notch" aria-hidden="true" />
              </div>
            </div>

            {/* Floating callouts — re-mount on view change so they animate in */}
            <div key={active.id} className="dv2-pins">
              {active.pins.map((p, i) => (
                <div
                  key={i}
                  className={`dv2-pin dv2-pin-${p.side}`}
                  style={{
                    left: p.x,
                    top: p.y,
                    animationDelay: `${0.2 + i * 0.18}s`
                  }}>
                  <div className="dv2-pin-marker" aria-hidden="true" />
                  <div className="dv2-pin-card">
                    <div className="dv2-pin-emoji">{p.emoji}</div>
                    <div className="dv2-pin-text">
                      <div className="dv2-pin-label">{p.label}</div>
                      <div className="dv2-pin-desc">{p.desc}</div>
                    </div>
                  </div>
                </div>
              ))}
            </div>
          </div>
        </div>
      </div>

      <style>{`
        .dv2 {
          position: relative;
          display: grid;
          grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
          gap: 64px;
          align-items: stretch;
        }

        /* ---------- LEFT RAIL ---------- */
        .dv2-rail {
          display: flex;
          flex-direction: column;
          gap: 14px;
          align-self: center;
        }
        .dv2-tab {
          position: relative;
          display: block;
          width: 100%;
          text-align: left;
          padding: 22px 24px 22px 26px;
          border: 1px solid var(--line);
          background: var(--surface);
          border-radius: 22px;
          cursor: pointer;
          font: inherit;
          color: inherit;
          transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s, background 0.3s;
          overflow: hidden;
        }
        .dv2-tab::before {
          content: "";
          position: absolute;
          left: 0; top: 12px; bottom: 12px;
          width: 3px;
          border-radius: 0 4px 4px 0;
          background: var(--line);
          transition: background 0.4s, width 0.4s;
        }
        .dv2-tab:hover { border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); }
        .dv2-tab.is-active {
          border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
          box-shadow:
            0 24px 48px -28px rgba(15,30,55,0.18),
            0 0 0 1px color-mix(in srgb, var(--blue) 18%, transparent) inset;
          background: linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--blue) 4%, var(--surface)) 100%);
        }
        .dv2-tab.is-active::before {
          width: 4px;
          background: linear-gradient(180deg, var(--blue) 0%, var(--blue-darker) 100%);
        }

        .dv2-tab-head {
          display: flex;
          align-items: center;
          gap: 14px;
        }
        .dv2-tab-icon {
          width: 38px; height: 38px;
          border-radius: 11px;
          background: var(--blue-soft);
          color: var(--blue-darker);
          display: grid; place-items: center;
          flex-shrink: 0;
          transition: background 0.3s, color 0.3s, transform 0.4s;
        }
        .dv2-tab.is-active .dv2-tab-icon {
          background: linear-gradient(160deg, var(--blue) 0%, var(--blue-darker) 100%);
          color: white;
          transform: rotate(-4deg) scale(1.04);
        }
        .dv2-tab-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
        .dv2-tab-label {
          font-size: 17px;
          font-weight: 600;
          letter-spacing: -0.015em;
          color: var(--text);
        }
        .dv2-tab-sub {
          font-size: 12px;
          font-weight: 600;
          letter-spacing: 0.06em;
          text-transform: uppercase;
          color: var(--muted);
        }
        .dv2-tab-num {
          font-size: 12px;
          font-weight: 700;
          color: var(--muted);
          font-variant-numeric: tabular-nums;
          letter-spacing: 0.04em;
          opacity: 0.7;
        }
        .dv2-tab.is-active .dv2-tab-num { color: var(--blue-darker); opacity: 1; }

        .dv2-tab-body {
          display: grid;
          grid-template-rows: 0fr;
          transition: grid-template-rows 0.45s cubic-bezier(.32,.72,0,1);
        }
        .dv2-tab.is-active .dv2-tab-body { grid-template-rows: 1fr; }
        .dv2-tab-body > * { min-height: 0; }
        .dv2-tab-body > p,
        .dv2-tab-body > div { overflow: hidden; }

        .dv2-tab-headline {
          font-size: 16px;
          font-weight: 600;
          letter-spacing: -0.015em;
          color: var(--text);
          margin: 16px 0 6px;
          opacity: 0;
          transform: translateY(-4px);
          transition: opacity 0.4s 0.1s, transform 0.4s 0.1s;
        }
        .dv2-tab-desc {
          font-size: 14.5px;
          color: var(--text-soft);
          line-height: 1.55;
          margin: 0 0 16px;
          opacity: 0;
          transform: translateY(-4px);
          transition: opacity 0.4s 0.16s, transform 0.4s 0.16s;
        }
        .dv2-tab.is-active .dv2-tab-headline,
        .dv2-tab.is-active .dv2-tab-desc { opacity: 1; transform: translateY(0); }

        .dv2-tab-stats {
          display: grid;
          grid-template-columns: repeat(3, 1fr);
          gap: 10px;
          padding-top: 14px;
          border-top: 1px solid var(--line);
          opacity: 0;
          transform: translateY(-4px);
          transition: opacity 0.4s 0.22s, transform 0.4s 0.22s;
        }
        .dv2-tab.is-active .dv2-tab-stats { opacity: 1; transform: translateY(0); }
        .dv2-stat-num {
          font-size: 22px;
          font-weight: 600;
          letter-spacing: -0.025em;
          color: var(--text);
          font-variant-numeric: tabular-nums;
          line-height: 1.1;
        }
        .dv2-stat-label {
          font-size: 11.5px;
          color: var(--muted);
          letter-spacing: 0.02em;
          margin-top: 2px;
        }

        .dv2-progress {
          position: relative;
          margin-top: 14px;
          height: 2px;
          border-radius: 2px;
          background: var(--line);
          overflow: hidden;
        }
        .dv2-progress-fill {
          height: 100%;
          width: 100%;
          background: linear-gradient(90deg, var(--blue) 0%, var(--blue-darker) 100%);
          transform-origin: left center;
          animation: dv2-progress 6s linear forwards;
        }
        @keyframes dv2-progress {
          from { transform: scaleX(0); }
          to   { transform: scaleX(1); }
        }

        .dv2-rail-foot {
          display: inline-flex;
          align-items: center;
          gap: 8px;
          padding: 0 6px;
          margin-top: 6px;
          font-size: 12px;
          color: var(--muted);
          letter-spacing: 0.02em;
        }
        .dv2-rail-foot-dot {
          width: 7px; height: 7px; border-radius: 50%;
          background: var(--blue);
          box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 20%, transparent);
          animation: dv2-foot-pulse 1.6s ease-in-out infinite;
        }
        .dv2-rail-foot-dot.is-paused {
          background: var(--muted);
          box-shadow: none;
          animation: none;
        }
        @keyframes dv2-foot-pulse {
          0%, 100% { opacity: 1; }
          50%      { opacity: 0.4; }
        }

        /* ---------- RIGHT STAGE ---------- */
        .dv2-stage {
          position: relative;
          display: grid;
          place-items: center;
          min-height: 620px;
        }
        .dv2-stage-glow {
          position: absolute;
          inset: 8% 8%;
          background:
            radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--blue) 22%, transparent) 0%, transparent 60%),
            radial-gradient(circle at 70% 80%, color-mix(in srgb, var(--purple) 14%, transparent) 0%, transparent 55%);
          filter: blur(40px);
          pointer-events: none;
          z-index: 0;
        }
        .dv2-stage-grid {
          position: absolute;
          inset: 0;
          background-image:
            radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--text) 8%, transparent) 1px, transparent 0);
          background-size: 24px 24px;
          mask-image: radial-gradient(circle at 50% 50%, black 0%, transparent 70%);
          -webkit-mask-image: radial-gradient(circle at 50% 50%, black 0%, transparent 70%);
          opacity: 0.45;
          pointer-events: none;
          z-index: 0;
        }

        .dv2-phone {
          position: relative;
          z-index: 1;
          width: 320px;
          aspect-ratio: 460 / 956;
          padding: 10px;
          border-radius: 46px;
          background: linear-gradient(160deg, #0F1B2E 0%, #1A2942 100%);
          box-shadow:
            0 40px 80px -30px rgba(15,30,55,0.40),
            0 16px 32px -12px rgba(15,30,55,0.20),
            inset 0 1px 0 rgba(255,255,255,0.10),
            inset 0 0 0 1.5px rgba(255,255,255,0.06);
          animation: dv2-phone-float 7s ease-in-out infinite;
        }
        [data-theme="dark"] .dv2-phone {
          background: linear-gradient(160deg, #1A2942 0%, #0F1B2E 100%);
          box-shadow:
            0 40px 80px -30px rgba(0,0,0,0.6),
            0 16px 32px -12px rgba(0,0,0,0.4),
            inset 0 1px 0 rgba(255,255,255,0.08);
        }
        @keyframes dv2-phone-float {
          0%, 100% { transform: translateY(0); }
          50%      { transform: translateY(-8px); }
        }

        .dv2-phone-screen {
          position: relative;
          width: 100%;
          height: 100%;
          border-radius: 36px;
          overflow: hidden;
          background: white;
        }
        .dv2-phone-notch {
          position: absolute;
          top: 8px;
          left: 50%;
          transform: translateX(-50%);
          width: 92px;
          height: 28px;
          border-radius: 999px;
          background: #0A0F1A;
          z-index: 5;
          pointer-events: none;
        }
        .dv2-screen {
          position: absolute;
          inset: 0;
          width: 100%;
          height: 100%;
          object-fit: cover;
          object-position: top center;
          opacity: 0;
          transform: scale(1.02);
          filter: blur(6px);
          transition:
            opacity 0.6s cubic-bezier(.32,.72,0,1),
            transform 0.7s cubic-bezier(.32,.72,0,1),
            filter 0.5s cubic-bezier(.32,.72,0,1);
        }
        .dv2-screen.is-active {
          opacity: 1;
          transform: scale(1);
          filter: blur(0);
        }
        .dv2-screen-mock {
          background: linear-gradient(180deg, #FFFFFF 0%, #F7F9FC 100%);
        }

        /* ---------- CALENDAR MOCK ---------- */
        .dv2-cal {
          position: absolute;
          inset: 0;
          padding: 38px 18px 18px;
          display: flex;
          flex-direction: column;
          gap: 12px;
          color: #0A1628;
          font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
        }
        .dv2-cal-status {
          position: absolute;
          top: 14px; left: 22px; right: 22px;
          display: flex;
          justify-content: space-between;
          font-size: 11px;
          font-weight: 600;
          color: #0A1628;
        }
        .dv2-cal-status-right { display: inline-flex; gap: 2px; align-items: flex-end; }
        .dv2-cal-bar {
          width: 3px; background: #0A1628; border-radius: 1px;
        }
        .dv2-cal-bar:nth-child(1) { height: 5px; }
        .dv2-cal-bar:nth-child(2) { height: 7px; }
        .dv2-cal-bar:nth-child(3) { height: 9px; }

        .dv2-cal-head {
          padding: 4px 4px 0;
        }
        .dv2-cal-title {
          font-size: 22px;
          font-weight: 700;
          letter-spacing: -0.02em;
          color: #0A1628;
        }
        .dv2-cal-sub {
          font-size: 12px;
          color: #8A95A5;
          margin-top: 2px;
        }
        .dv2-cal-toolbar {
          display: flex;
          gap: 6px;
          padding: 0 4px;
        }
        .dv2-cal-chip {
          font-size: 11px;
          font-weight: 600;
          padding: 5px 10px;
          border-radius: 999px;
          background: #F0F3F7;
          color: #4A5568;
          letter-spacing: 0.01em;
        }
        .dv2-cal-chip-active {
          background: #38B6E6;
          color: white;
        }

        .dv2-cal-grid {
          display: grid;
          grid-template-columns: repeat(7, 1fr);
          gap: 3px;
          padding: 4px;
          background: #FAFBFD;
          border-radius: 12px;
        }
        .dv2-cal-dh {
          font-size: 9.5px;
          font-weight: 700;
          color: #8A95A5;
          text-align: center;
          padding: 4px 0 2px;
          letter-spacing: 0.06em;
        }
        .dv2-cal-cell {
          aspect-ratio: 1 / 1;
          border-radius: 7px;
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          gap: 2px;
          background: white;
          position: relative;
        }
        .dv2-cal-cell.is-today {
          background: #38B6E6;
          color: white;
          box-shadow: 0 4px 10px -4px rgba(56,182,230,0.55);
        }
        .dv2-cal-cell.is-today .dv2-cal-num { color: white; font-weight: 700; }
        .dv2-cal-num {
          font-size: 10.5px;
          color: #1A2942;
          font-variant-numeric: tabular-nums;
          line-height: 1;
        }
        .dv2-cal-dot {
          width: 4px; height: 4px; border-radius: 50%;
        }
        .dv2-cal-cell.is-today .dv2-cal-dot { background: white !important; }

        .dv2-cal-list {
          display: flex;
          flex-direction: column;
          gap: 6px;
          padding: 0 2px;
          margin-top: 2px;
        }
        .dv2-cal-row {
          display: flex;
          align-items: stretch;
          gap: 8px;
          background: white;
          border-radius: 10px;
          padding: 6px 10px 6px 6px;
          box-shadow: 0 2px 8px -4px rgba(15,30,55,0.10);
        }
        .dv2-cal-row-rail { width: 3px; border-radius: 2px; flex-shrink: 0; }
        .dv2-cal-row-title { font-size: 11px; font-weight: 600; color: #0A1628; letter-spacing: -0.01em; }
        .dv2-cal-row-meta { font-size: 9.5px; color: #8A95A5; margin-top: 1px; }

        /* ---------- CALLOUTS ---------- */
        .dv2-pins {
          position: absolute;
          inset: 0;
          pointer-events: none;
          z-index: 3;
        }
        .dv2-pin {
          position: absolute;
          display: flex;
          align-items: center;
          gap: 10px;
          opacity: 0;
          animation: dv2-pin-in 0.6s cubic-bezier(.32,.72,0,1) forwards;
        }
        .dv2-pin-right { transform: translate(0, -50%); flex-direction: row; }
        .dv2-pin-left { transform: translate(-100%, -50%); flex-direction: row-reverse; }

        @keyframes dv2-pin-in {
          from { opacity: 0; transform: translate(var(--from-x, 0), calc(-50% + 8px)) scale(0.96); }
          to   { opacity: 1; transform: translate(0, -50%) scale(1); }
        }
        .dv2-pin-left {
          animation-name: dv2-pin-in-left;
        }
        @keyframes dv2-pin-in-left {
          from { opacity: 0; transform: translate(calc(-100% + 8px), calc(-50% + 8px)) scale(0.96); }
          to   { opacity: 1; transform: translate(-100%, -50%) scale(1); }
        }

        .dv2-pin-marker {
          width: 14px; height: 14px;
          border-radius: 50%;
          background: white;
          border: 3px solid var(--blue);
          box-shadow:
            0 0 0 4px color-mix(in srgb, var(--blue) 25%, transparent),
            0 4px 10px -2px rgba(15,30,55,0.20);
          flex-shrink: 0;
          position: relative;
        }
        .dv2-pin-marker::after {
          content: "";
          position: absolute;
          inset: -3px;
          border-radius: 50%;
          border: 2px solid var(--blue);
          opacity: 0;
          animation: dv2-pin-pulse 2.2s ease-out infinite;
        }
        @keyframes dv2-pin-pulse {
          0%   { transform: scale(0.9); opacity: 0.7; }
          100% { transform: scale(2.2); opacity: 0; }
        }

        .dv2-pin-card {
          background: var(--surface);
          border: 1px solid var(--line);
          border-radius: 14px;
          padding: 10px 14px 11px;
          display: flex;
          align-items: flex-start;
          gap: 10px;
          max-width: 200px;
          box-shadow:
            0 16px 32px -12px rgba(15,30,55,0.18),
            0 6px 14px -8px rgba(15,30,55,0.10);
          backdrop-filter: blur(8px);
        }
        .dv2-pin-emoji {
          font-size: 18px;
          line-height: 1;
          flex-shrink: 0;
          margin-top: 1px;
        }
        .dv2-pin-text { min-width: 0; }
        .dv2-pin-label {
          font-size: 12.5px;
          font-weight: 700;
          color: var(--text);
          letter-spacing: -0.01em;
          margin-bottom: 2px;
        }
        .dv2-pin-desc {
          font-size: 11.5px;
          color: var(--text-soft);
          line-height: 1.4;
        }

        /* ---------- RESPONSIVE ---------- */
        @media (max-width: 980px) {
          .dv2 {
            grid-template-columns: 1fr;
            gap: 48px;
          }
          .dv2-stage { min-height: 560px; order: -1; }
          .dv2-phone { width: 280px; }
        }
        @media (max-width: 640px) {
          .dv2-pin-card { display: none; }
          .dv2-tab { padding: 18px 18px 18px 22px; }
          .dv2-tab-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
          .dv2-stat-num { font-size: 19px; }
        }

        @media (prefers-reduced-motion: reduce) {
          .dv2-screen, .dv2-progress-fill, .dv2-pin, .dv2-phone, .dv2-rail-foot-dot,
          .dv2-pin-marker::after { animation: none !important; transition: none !important; }
        }
      `}</style>
    </section>
  );
};


const ScheduleCard = ({ imgSrc, name, reps, duration, desc, premium }) =>
<div className="feature-card tilt" style={{ padding: 0, overflow: "hidden", display: "flex", flexDirection: "column" }}>
    <div style={{ background: "var(--bg-alt)", padding: "32px 32px 16px", display: "grid", placeItems: "center", aspectRatio: "1 / 0.85", position: "relative", overflow: "hidden" }}>
      <img src={imgSrc} alt={name} className="schedule-img" style={{ width: "78%", height: "auto", position: "relative", zIndex: 1 }} />
    </div>
    <div style={{ padding: "28px 28px 32px" }}>
      <div style={{ display: "flex", alignItems: "center", gap: 10, marginBottom: 8 }}>
        <h3 className="h-3">{name}</h3>
        {premium &&
      <span style={{
        fontSize: 10.5, padding: "3px 9px", borderRadius: 999,
        background: "var(--blue-soft)", color: "var(--blue-darker)",
        fontWeight: 700, letterSpacing: 0.5, textTransform: "uppercase"
      }}>Premium</span>
      }
      </div>
      <div style={{ fontSize: 14, color: "var(--muted)", marginBottom: 14, fontVariantNumeric: "tabular-nums" }}>
        {reps} reps · {duration}
      </div>
      <p style={{ fontSize: 15.5, color: "var(--text-soft)", lineHeight: 1.55 }}>{desc}</p>
    </div>
  </div>;


const ProgressPhoneAnim = () => {
  // Sequence states: 'idle' (dial visible, finger pulsing) -> 'tapping' (finger pressed) -> 'opening' (sheet slides up) -> 'open' (timeline visible) -> 'closing' (sheet slides back down) -> idle
  const [state, setState] = React.useState("idle");
  const containerRef = React.useRef(null);
  const timeoutsRef = React.useRef([]);
  const pausedRef = React.useRef(false);

  // Schedule the loop. Returns a cleanup function.
  const runCycle = React.useCallback(() => {
    const queue = (fn, ms) => {
      const id = setTimeout(fn, ms);
      timeoutsRef.current.push(id);
    };

    // idle for 2s -> tap -> open -> hold -> close -> repeat
    queue(() => {
      if (pausedRef.current) return;
      setState("tapping");
      queue(() => {
        if (pausedRef.current) return;
        setState("opening");
        queue(() => {
          if (pausedRef.current) return;
          setState("open");
          queue(() => {
            if (pausedRef.current) return;
            setState("closing");
            queue(() => {
              if (pausedRef.current) return;
              setState("idle");
              runCycle();
            }, 700);
          }, 3200);
        }, 700);
      }, 350);
    }, 2400);
  }, []);

  // Pause when off-screen
  React.useEffect(() => {
    const el = containerRef.current;
    if (!el) return;
    const obs = new IntersectionObserver(([entry]) => {
      pausedRef.current = !entry.isIntersecting;
      if (entry.isIntersecting && timeoutsRef.current.length === 0) {
        runCycle();
      }
    }, { threshold: 0.15 });
    obs.observe(el);
    return () => obs.disconnect();
  }, [runCycle]);

  // Start cycle on mount, clean up on unmount
  React.useEffect(() => {
    runCycle();
    return () => {
      timeoutsRef.current.forEach(clearTimeout);
      timeoutsRef.current = [];
    };
  }, [runCycle]);

  const handleManualTap = () => {
    if (state !== "idle") return;
    // cancel pending and run immediately
    timeoutsRef.current.forEach(clearTimeout);
    timeoutsRef.current = [];
    setState("tapping");
    setTimeout(() => setState("opening"), 350);
    setTimeout(() => setState("open"), 1050);
    setTimeout(() => setState("closing"), 1050 + 3200);
    setTimeout(() => {
      setState("idle");
      runCycle();
    }, 1050 + 3200 + 700);
  };

  const sheetOpen = state === "open" || state === "opening" || state === "closing";
  const sheetFullyOpen = state === "open";

  return (
    <div
      ref={containerRef}
      onClick={handleManualTap}
      style={{
        position: "relative",
        width: "100%",
        maxWidth: 360,
        cursor: "pointer",
        userSelect: "none"
      }}
      aria-label="Tap the dial to open the full review schedule">

      {/* Phone screen container — uses details.png aspect ratio so the bezel is fully visible */}
      <div
        className="ppa-phone"
        style={{
          position: "relative",
          width: "100%",
          aspectRatio: "2172 / 4590",
          isolation: "isolate",
          filter: "drop-shadow(0 30px 60px rgba(15,30,55,0.25)) drop-shadow(0 10px 20px rgba(15,30,55,0.10))"
        }}>

        {/* Base details screen */}
        <img
          src="assets/details.png"
          alt="Item detail showing progress dial"
          style={{
            position: "absolute",
            inset: 0,
            width: "100%",
            height: "100%",
            objectFit: "contain",
            display: "block"
          }} />


        {/* Inner screen-area mask — clips the sheet to the rounded screen, not over the bezel.
                     The bezel in details.png is ~3% on each side. */}
        <div className="ppa-screen-mask" style={{
          position: "absolute",
          left: "3.2%",
          right: "3.2%",
          top: "1.8%",
          bottom: "1.8%",
          borderRadius: "11.5%/5.5%",
          overflow: "hidden",
          pointerEvents: "none"
        }}>

          {/* Pulse ring around the dial — only when idle.
                       Dial center within the screen area is roughly x=50%, y=37%. */}
          <div
            aria-hidden="true"
            className={`ppa-pulse ${state === "idle" ? "ppa-pulse-on" : ""}`}
            style={{
              position: "absolute",
              left: "50%",
              top: "37%",
              width: "44%",
              aspectRatio: "1 / 1",
              transform: "translate(-50%, -50%)",
              borderRadius: "50%",
              pointerEvents: "none"
            }} />


          {/* Finger / tap indicator */}
          <div
            aria-hidden="true"
            className={`ppa-finger ppa-finger-${state}`}
            style={{
              position: "absolute",
              left: "50%",
              top: "37%",
              width: "16%",
              aspectRatio: "1 / 1",
              transform: "translate(-50%, -50%)",
              pointerEvents: "none"
            }}>

            <div className="ppa-finger-dot" />
          </div>

          {/* Backdrop dim when sheet open */}
          <div
            aria-hidden="true"
            style={{
              position: "absolute",
              inset: 0,
              background: "rgba(0,0,0,0.32)",
              opacity: sheetOpen ? 1 : 0,
              transition: "opacity 0.45s cubic-bezier(.32,.72,0,1)",
              pointerEvents: "none"
            }} />


          {/* Reminder Dates sheet — slides up from bottom within the screen area.
                       reminder-dates.png includes its own status bar + bezel; we crop those off
                       so only the white sheet content (header + timeline) shows. */}
          <div
            aria-hidden={!sheetFullyOpen}
            style={{
              position: "absolute",
              left: 0,
              right: 0,
              bottom: 0,
              height: "92%",
              transform: sheetOpen ? "translateY(0)" : "translateY(100%)",
              transition: "transform 0.55s cubic-bezier(.32,.72,0,1)",
              borderRadius: "22px 22px 0 0",
              overflow: "hidden",
              background: "white",
              boxShadow: sheetOpen ? "0 -20px 50px -10px rgba(0,0,0,0.25)" : "none"
            }}>

            {/* The new reminder-dates.png is pre-cropped to just the sheet content. */}
            <img
              src="assets/reminder-dates.png"
              alt="Reminder Dates timeline of every review"
              style={{
                position: "absolute",
                inset: 0,
                width: "100%",
                height: "100%",
                objectFit: "cover",
                objectPosition: "top center",
                display: "block"
              }} />

            {/* Grabber */}
            <div style={{
              position: "absolute",
              top: 8,
              left: "50%",
              transform: "translateX(-50%)",
              width: 38,
              height: 4,
              borderRadius: 999,
              background: "rgba(0,0,0,0.22)",
              zIndex: 2
            }} />
          </div>
        </div>

      </div>

      {/* Caption beneath */}
      <div style={{
        marginTop: 14,
        textAlign: "center",
        fontSize: 12,
        color: "var(--muted)",
        letterSpacing: 0.4,
        opacity: 0.85
      }}>
        Tap the dial to see the full schedule
      </div>

      <style>{`
        /* Pulse ring */
        .ppa-pulse::before,
        .ppa-pulse::after {
          content: "";
          position: absolute;
          inset: 0;
          border-radius: 50%;
          border: 2px solid var(--blue);
          opacity: 0;
        }
        .ppa-pulse-on::before {
          animation: ppaPulse 2.4s ease-out infinite;
        }
        .ppa-pulse-on::after {
          animation: ppaPulse 2.4s ease-out infinite;
          animation-delay: 1.2s;
        }
        @keyframes ppaPulse {
          0%   { transform: scale(0.65); opacity: 0; }
          15%  { opacity: 0.8; }
          100% { transform: scale(1.15); opacity: 0; }
        }

        /* Finger indicator */
        .ppa-finger-dot {
          width: 100%;
          height: 100%;
          border-radius: 50%;
          background: rgba(255,255,255,0.35);
          border: 2px solid white;
          box-shadow: 0 4px 12px rgba(0,0,0,0.25);
          backdrop-filter: blur(4px);
          -webkit-backdrop-filter: blur(4px);
        }
        .ppa-finger {
          opacity: 0;
          transition: opacity 0.3s, transform 0.18s cubic-bezier(.4,0,.2,1);
          will-change: transform, opacity;
        }
        .ppa-finger-idle {
          opacity: 1;
          animation: ppaFingerBob 2.4s ease-in-out infinite;
        }
        .ppa-finger-tapping {
          opacity: 1;
          transform: translate(-50%, -50%) scale(0.78);
        }
        .ppa-finger-opening,
        .ppa-finger-open,
        .ppa-finger-closing {
          opacity: 0;
        }
        @keyframes ppaFingerBob {
          0%, 100% { transform: translate(-50%, -50%) scale(1); }
          50%      { transform: translate(-50%, -50%) scale(0.92); }
        }

        @media (prefers-reduced-motion: reduce) {
          .ppa-finger,
          .ppa-pulse-on::before,
          .ppa-pulse-on::after { animation: none !important; }
        }
      `}</style>
    </div>);

};


const ProgressSection = () =>
<section id="features" style={{ background: "var(--bg-alt)" }}>
    <div className="shell">
      <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 80, alignItems: "center" }} className="progress-grid">
        <div className="reveal" style={{ display: "flex", justifyContent: "center", position: "relative" }}>
          <ProgressPhoneAnim />
        </div>
        <div className="reveal">
          <div className="section-eyebrow">Track progress</div>
          <h2 className="h-1" style={{ marginBottom: 24 }}>
            From new<br />
            <span className="gradient-text">to known.</span>
          </h2>
          <p className="lede" style={{ marginBottom: 32 }}>
            A dial — not a spreadsheet. One glance tells you how close an idea is to sticking.
          </p>
          <div style={{ display: "flex", flexDirection: "column", gap: 20 }}>
            <FeatureItem
            title="The whole timeline, one tap away"
            desc="Past reps, what's next, and months ahead." />

            <FeatureItem
            title="Revive missed reps"
            desc="Pick the curve back up instead of starting over." />

          </div>
        </div>
      </div>
    </div>

    <style>{`
      @media (max-width: 920px) {
        .progress-grid { grid-template-columns: 1fr !important; gap: 56px !important; }
        .progress-grid > div:first-child { order: 2; }
      }
    `}</style>
  </section>;


const FeatureItem = ({ title, desc }) =>
<div style={{ display: "flex", gap: 16, alignItems: "flex-start" }}>
    <div style={{
    width: 28, height: 28, borderRadius: 8, flexShrink: 0,
    background: "var(--blue-soft)",
    display: "grid", placeItems: "center",
    color: "var(--blue-darker)",
    marginTop: 2
  }}>
      <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
        <path d="M2 7.5L5.5 11L12 3.5" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" />
      </svg>
    </div>
    <div style={{ flex: 1 }}>
      <div style={{ fontSize: 17, fontWeight: 600, color: "var(--text)", marginBottom: 4, letterSpacing: "-0.015em" }}>{title}</div>
      <div style={{ fontSize: 15, color: "var(--text-soft)", lineHeight: 1.55 }}>{desc}</div>
    </div>
  </div>;


const RuleSection = () =>
<section style={{ position: "relative", overflow: "hidden" }}>
    <div className="shell" style={{ position: "relative", zIndex: 1 }}>
      <div className="reveal rule-grid" style={{ display: "grid", gridTemplateColumns: "1fr", gap: 48, alignItems: "center", maxWidth: 760, margin: "0 auto", textAlign: "center" }}>
        <div>
          <div className="section-eyebrow">The 24-hour rule</div>
          <h2 className="h-1" style={{ marginBottom: 24 }}>
            A gentle nudge against<br />
            <span className="gradient-text">"I'll do it later."</span>
          </h2>
          <p className="lede" style={{ marginBottom: 36, maxWidth: 580, marginLeft: "auto", marginRight: "auto" }}>
            When a rep is due, you have 24 hours to mark it complete. Miss the window and it's marked as failed — your streak resets, the curve restarts.
          </p>

          <div className="rule-celebrate">
            <div className="rule-celebrate-sub">Try it — tap the timer before it hits zero.</div>
            <CelebrationButton />
          </div>
        </div>
      </div>
    </div>

    <style>{`
      @media (max-width: 920px) {
        .rule-grid { grid-template-columns: 1fr !important; gap: 56px !important; }
      }
      .rule-celebrate {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 22px 24px 24px;
        border-radius: 22px;
        text-align: left;
        background:
          radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--blue) 12%, transparent) 0%, transparent 60%),
          var(--surface);
        border: 1px solid var(--line);
        box-shadow: 0 18px 40px -22px rgba(15,30,55,0.14);
      }
      .rule-celebrate-sub {
        font-size: 13.5px;
        color: var(--text-soft);
        line-height: 1.45;
        font-style: italic;
      }
    `}</style>
  </section>;


const AnimatedNotifications = () => {
  // Snappy "they just arrived" loop: notifications slide down + fade in,
  // hold briefly, then reset and replay. Independent from the countdown ring.
  const containerRef = React.useRef(null);
  const [cycle, setCycle] = React.useState(0);
  const [started, setStarted] = React.useState(false);

  React.useEffect(() => {
    if (!containerRef.current) return;
    const io = new IntersectionObserver((entries) => {
      if (entries[0].isIntersecting && !started) setStarted(true);
    }, { threshold: 0.4 });
    io.observe(containerRef.current);
    return () => io.disconnect();
  }, [started]);

  React.useEffect(() => {
    if (!started) return;
    const LOOP_MS = 6500;
    const id = setInterval(() => setCycle((c) => c + 1), LOOP_MS);
    return () => clearInterval(id);
  }, [started]);

  const PHONE_W = 320;
  const pill = { width: "84%", left: "8%", height: "auto" };

  return (
    <div
      ref={containerRef}
      style={{
        position: "relative",
        width: "100%",
        maxWidth: PHONE_W,
        display: "block"
      }}>

      <img
        src="assets/notifications-empty.png"
        alt="Lock screen"
        style={{
          width: "100%",
          height: "auto",
          display: "block",
          filter: "saturate(1.35) contrast(1.05)"
        }} />


      <div
        style={{
          position: "absolute",
          left: 0,
          top: "38%",
          width: "100%",
          pointerEvents: "none"
        }}>

        {/* "It's repetition time" arrives first — sits at the bottom */}
        <NotifPill
          key={`older-${cycle}`}
          src="assets/notif-review.png"
          alt="It's repetition time — Reinforce Famous Chess Tactics before it fades"
          style={{ ...pill, top: "13.5%" }}
          delayMs={started ? 200 : 99999} />


        {/* "Review deadline soon" (prefail) drops in second, lands on top */}
        <NotifPill
          key={`newer-${cycle}`}
          src="assets/notif-prefail.png"
          alt="Review deadline soon — 5 hours left to review Spanish 101 before it fails"
          style={{ ...pill, top: "0%" }}
          delayMs={started ? 1500 : 99999} />

      </div>
    </div>);

};

const NotifPill = ({ src, alt, style, delayMs }) => {
  const [visible, setVisible] = React.useState(false);

  React.useEffect(() => {
    if (delayMs > 90000) {
      setVisible(false);
      return;
    }
    setVisible(false);
    const t = setTimeout(() => setVisible(true), delayMs);
    return () => clearTimeout(t);
  }, [delayMs]);

  return (
    <img
      src={src}
      alt={alt}
      style={{
        position: "absolute",
        ...style,
        opacity: visible ? 1 : 0,
        transform: visible ?
        "translateY(0) scale(1)" :
        "translateY(-28px) scale(0.94)",
        filter: visible ?
        "saturate(1.25) contrast(1.03) drop-shadow(0 6px 14px rgba(0,80,180,0.28))" :
        "saturate(1.25) contrast(1.03) drop-shadow(0 0 0 rgba(0,0,0,0))",
        transition:
        "opacity 520ms cubic-bezier(0.22, 1, 0.36, 1), transform 620ms cubic-bezier(0.22, 1.18, 0.36, 1), filter 520ms ease-out"
      }} />);


};

const CountdownRing = () => {
  // Smooth continuous sweep: progress goes 1 -> 0 over CYCLE seconds, then loops.
  const CYCLE = 18; // seconds per full sweep
  const [progress, setProgress] = React.useState(1);
  React.useEffect(() => {
    let raf;
    const start = performance.now();
    const tick = (now) => {
      const elapsed = (now - start) / 1000 % CYCLE;
      setProgress(1 - elapsed / CYCLE);
      raf = requestAnimationFrame(tick);
    };
    raf = requestAnimationFrame(tick);
    return () => cancelAnimationFrame(raf);
  }, []);

  const hours = Math.max(1, Math.ceil(progress * 24));

  const size = 122;
  const stroke = 5;
  const r = (size - stroke) / 2; // fits cleanly inside the SVG
  const c = 2 * Math.PI * r;

  return (
    <div style={{
      position: "absolute",
      top: "62%",
      right: "-30px",
      transform: "translateY(-50%)",
      background: "var(--surface)",
      border: "1px solid var(--line)",
      borderRadius: 22,

      boxShadow: "0 30px 60px -20px rgba(15,30,55,0.20), 0 10px 20px -10px rgba(15,30,55,0.10)",
      width: 160,
      padding: "19px", textAlign: "center", margin: "0px", letterSpacing: "1px"
    }} className="countdown-ring">
      <div style={{ position: "relative", width: size, height: size, margin: "0 auto" }}>
        <svg
          width={size}
          height={size}
          viewBox={`0 0 ${size} ${size}`}
          style={{ display: "block", transform: "rotate(-90deg)" }}>
          <circle cx={size / 2} cy={size / 2} r={r} fill="none" stroke="var(--line)" strokeWidth={stroke} />
          <circle
            cx={size / 2} cy={size / 2} r={r}
            fill="none"
            stroke="var(--blue)"
            strokeWidth={stroke}
            strokeDasharray={c}
            strokeDashoffset={c * (1 - progress)}
            strokeLinecap="round" />
        </svg>
        <div style={{
          position: "absolute",
          inset: 0,
          display: "flex",
          flexDirection: "column",
          alignItems: "center",
          justifyContent: "center",
          gap: 3
        }}>
          <div style={{ fontSize: 9, color: "var(--muted)", letterSpacing: 1.0, fontWeight: 600 }}>TIME LEFT</div>
          <div style={{ fontSize: 35, fontWeight: 700, color: "var(--text)", lineHeight: 1, letterSpacing: "-0.04em", fontVariantNumeric: "tabular-nums" }}>{hours}h</div>
        </div>
      </div>
    </div>);

};

const PrivacySection = () =>
<section id="privacy" style={{ background: "var(--bg-alt)", overflow: "hidden", position: "relative" }}>
    {/* soft ambient glow — same family as hero */}
    <div aria-hidden="true" style={{
    position: "absolute", inset: 0, pointerEvents: "none", overflow: "hidden"
  }}>
      <div style={{
      position: "absolute", top: "-10%", right: "-10%", width: "55%", height: "70%",
      background: "radial-gradient(ellipse at center, rgba(56,182,230,0.12), transparent 60%)",
      filter: "blur(40px)"
    }} />
      <div style={{
      position: "absolute", bottom: "-20%", left: "-10%", width: "45%", height: "70%",
      background: "radial-gradient(ellipse at center, rgba(177,155,224,0.10), transparent 60%)",
      filter: "blur(40px)"
    }} />
    </div>

    <div className="shell" style={{ position: "relative" }}>
      <div className="reveal privacy-grid" style={{ display: "grid", gridTemplateColumns: "1.05fr 1fr", gap: 80, alignItems: "center" }}>
        <div>
          <div className="section-eyebrow" style={{ display: "inline-flex", alignItems: "center", gap: 8 }}>
            <LockIconSmall />
            Privacy by design
          </div>
          <h2 className="h-1" style={{ marginBottom: 24 }}>
            Your memory<br />
            <span className="gradient-text">stays yours.</span>
          </h2>
          <p className="lede" style={{ marginBottom: 16 }}>
            Never Forget is fully native. Everything you write — every note, link, rep, and reminder — lives on your devices and, if you choose, in your private iCloud.
          </p>
          <p className="lede" style={{ marginBottom: 32 }}>
            No accounts. No servers. No third-party SDKs. <strong style={{ color: "var(--text)", fontWeight: 600 }}>We literally cannot read your data.</strong>
          </p>

          <div style={{ display: "flex", gap: 10, flexWrap: "wrap" }}>
            {[
          "No tracking",
          "No analytics SDK",
          "No ads",
          "No account",
          "No cloud servers"].
          map((label) =>
          <span key={label} style={{
            display: "inline-flex", alignItems: "center", gap: 8,
            padding: "8px 14px",
            borderRadius: 999,
            background: "var(--surface)",
            border: "1px solid var(--line)",
            fontSize: 13.5, fontWeight: 500,
            color: "var(--text-soft)",
            letterSpacing: "-0.005em"
          }}>
                <NoIcon />
                {label}
              </span>
          )}
          </div>
        </div>

        <div style={{ display: "flex", justifyContent: "center" }}>
          <PrivacyDiagram />
        </div>
      </div>

      {/* facts row */}
      <div className="reveal privacy-facts" style={{
      marginTop: 80,
      display: "grid",
      gridTemplateColumns: "repeat(3, 1fr)",
      gap: 20
    }}>
        {[
      {
        icon: <DeviceIcon />,
        title: "On-device, by default",
        desc: "Everything you save is stored locally on your device. The app works offline — no network connection is required to use it."
      },
      {
        icon: <ICloudIcon />,
        title: "iCloud sync, end-to-end",
        desc: "Optional sync uses your private CloudKit container. Apple holds the keys; we don't have access. Turn it off any time."
      },
      {
        icon: <ShieldIcon />,
        title: "Zero third-party SDKs",
        desc: "No analytics. No crash reporters. No ads. No trackers. The app makes zero outbound requests in normal use."
      }].
      map((fact, i) =>
      <div key={i} className="feature-card">
            <div style={{
          width: 44, height: 44, borderRadius: 12,
          background: "var(--blue-soft)",
          display: "grid", placeItems: "center",
          color: "var(--blue-darker)",
          marginBottom: 18
        }}>{fact.icon}</div>
            <h3 className="h-3" style={{ fontSize: 19, marginBottom: 8 }}>
              {fact.title}
            </h3>
            <p style={{ fontSize: 14.5, color: "var(--text-soft)", lineHeight: 1.55 }}>
              {fact.desc}
            </p>
          </div>
      )}
      </div>

      <div className="reveal" style={{
      marginTop: 32,
      textAlign: "center",
      fontSize: 13.5,
      color: "var(--muted)"
    }}>
        Verified by Apple's <span style={{ color: "var(--text-soft)", fontWeight: 500 }}>App Privacy</span> label · "Data Not Collected"
      </div>
    </div>

    <style>{`
      @media (max-width: 920px) {
        .privacy-grid { grid-template-columns: 1fr !important; gap: 48px !important; }
      }
      @media (max-width: 820px) {
        .privacy-facts { grid-template-columns: 1fr !important; }
      }
    `}</style>
  </section>;


const NoIcon = () =>
<svg width="13" height="13" viewBox="0 0 14 14" fill="none" aria-hidden="true">
    <circle cx="7" cy="7" r="5.5" stroke="currentColor" strokeWidth="1.4" opacity="0.7" />
    <path d="M3.5 10.5L10.5 3.5" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" opacity="0.7" />
  </svg>;

const LockIconSmall = () =>
<svg width="12" height="12" viewBox="0 0 14 14" fill="none" aria-hidden="true">
    <rect x="2.5" y="6.5" width="9" height="6" rx="1.4" stroke="currentColor" strokeWidth="1.3" />
    <path d="M4.5 6.5V4.5a2.5 2.5 0 0 1 5 0v2" stroke="currentColor" strokeWidth="1.3" strokeLinecap="round" />
  </svg>;

const LockIconTitle = () =>
<span aria-hidden="true" style={{
  display: "inline-grid",
  placeItems: "center",
  width: "1.1em",
  height: "1.1em",
  minWidth: "1.1em",
  borderRadius: 14,
  background: "linear-gradient(165deg, var(--blue) 0%, var(--blue-darker) 100%)",
  boxShadow: "0 14px 28px -10px rgba(56,182,230,0.55), inset 0 -2px 0 rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.25)",
  transform: "translateY(0.04em)"
}}>
    <svg width="60%" height="60%" viewBox="0 0 24 24" fill="none">
      <rect x="5" y="11" width="14" height="9" rx="2.2" fill="white" />
      <path d="M8.2 11V8.5a3.8 3.8 0 0 1 7.6 0V11" stroke="white" strokeWidth="2.2" strokeLinecap="round" fill="none" />
      <circle cx="12" cy="15.2" r="1.3" fill="var(--blue-darker)" />
      <rect x="11.4" y="15.6" width="1.2" height="2.4" rx="0.6" fill="var(--blue-darker)" />
    </svg>
  </span>;

const DeviceIcon = () =>
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" aria-hidden="true">
    <rect x="7" y="2.5" width="10" height="19" rx="2.5" stroke="currentColor" strokeWidth="1.7" />
    <line x1="11" y1="18.5" x2="13" y2="18.5" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" />
  </svg>;

const ICloudIcon = () =>
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" aria-hidden="true">
    <path d="M7 18h10a4 4 0 0 0 0-8c-.21 0-.42.02-.62.05A6 6 0 0 0 5 12.5 4 4 0 0 0 7 18z" stroke="currentColor" strokeWidth="1.7" strokeLinejoin="round" />
    <path d="M10 13.5l1.5 1.5 3-3" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" />
  </svg>;

const ShieldIcon = () =>
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" aria-hidden="true">
    <path d="M12 3l8 3v6c0 4.5-3.4 8.5-8 9-4.6-.5-8-4.5-8-9V6l8-3z" stroke="currentColor" strokeWidth="1.7" strokeLinejoin="round" />
    <path d="M9 12l2.2 2.2L15 10.5" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" />
  </svg>;


const PrivacyDiagram = () => {
  const ledger = [
  { label: "Notes & links", where: "On device", out: false },
  { label: "Rep history", where: "On device", out: false },
  { label: "Reminders", where: "On device", out: false },
  { label: "iCloud sync", where: "End-to-end encrypted", out: false, optional: true },
  { label: "Analytics", where: "Not collected", out: true },
  { label: "Ads / trackers", where: "Not collected", out: true }];


  return (
    <div style={{
      width: "100%",
      maxWidth: 460,
      background: "var(--surface)",
      border: "1px solid var(--line)",
      borderRadius: 24,
      position: "relative",
      overflow: "hidden",
      boxShadow: "0 30px 60px -20px rgba(15,30,55,0.14), 0 10px 20px -10px rgba(15,30,55,0.06)"
    }}>
      {/* Trust rings */}
      <div style={{
        position: "relative",
        height: 200,
        background:
        "radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--blue) 8%, var(--surface)) 0%, var(--surface) 65%)",
        overflow: "hidden"
      }}>
        {/* ring 2 — iCloud */}
        <div style={{
          position: "absolute", left: "50%", top: "55%", transform: "translate(-50%, -50%)",
          width: 180, height: 180, borderRadius: "50%",
          border: "1px dashed color-mix(in srgb, var(--blue) 45%, transparent)"
        }} />
        {/* ring 1 — devices */}
        <div style={{
          position: "absolute", left: "50%", top: "55%", transform: "translate(-50%, -50%)",
          width: 116, height: 116, borderRadius: "50%",
          border: "1px solid color-mix(in srgb, var(--blue) 30%, transparent)",
          background: "color-mix(in srgb, var(--blue) 4%, transparent)"
        }} />

        {/* ring labels */}
        <div style={{
          position: "absolute", left: "50%", top: "calc(55% - 90px)",
          transform: "translate(-50%, -50%)",
          fontSize: 10.5, fontWeight: 700, letterSpacing: 1.2, textTransform: "uppercase",
          color: "var(--blue-darker)",
          background: "var(--surface)", padding: "3px 9px", borderRadius: 6,
          border: "1px solid color-mix(in srgb, var(--blue) 30%, transparent)"
        }}>iCloud · end-to-end</div>

        <div style={{
          position: "absolute", left: "50%", top: "calc(55% - 58px)",
          transform: "translate(-50%, -50%)",
          fontSize: 10.5, fontWeight: 700, letterSpacing: 1.2, textTransform: "uppercase",
          color: "var(--text-soft)",
          background: "var(--surface)", padding: "3px 9px", borderRadius: 6,
          border: "1px solid var(--line)"
        }}>Your devices</div>

        {/* center: you */}
        <div style={{
          position: "absolute", left: "50%", top: "55%", transform: "translate(-50%, -50%)",
          textAlign: "center"
        }}>
          <div style={{
            width: 56, height: 56, borderRadius: "50%",
            background: "linear-gradient(160deg, var(--blue) 0%, var(--blue-darker) 100%)",
            boxShadow: "0 10px 24px -6px rgba(56,182,230,0.55), inset 0 1px 0 rgba(255,255,255,0.3)",
            display: "grid", placeItems: "center",
            margin: "0 auto"
          }}>
            <svg width="22" height="22" viewBox="0 0 24 24" fill="none" aria-hidden="true">
              <rect x="5" y="11" width="14" height="9" rx="2.2" fill="white" />
              <path d="M8.2 11V8.5a3.8 3.8 0 0 1 7.6 0V11" stroke="white" strokeWidth="2.2" strokeLinecap="round" fill="none" />
            </svg>
          </div>
          <div style={{ marginTop: 8, fontSize: 11, fontWeight: 700, color: "var(--text)", letterSpacing: "-0.01em" }}>You</div>
        </div>

        {/* device dots on inner ring */}
        {[
        { angle: -120, label: "iPhone" },
        { angle: -55, label: "iPad" },
        { angle: 60, label: "Mac" }].
        map((d, i) => {
          const r = 58;
          const x = 50 + r / 200 * 100 * Math.cos(d.angle * Math.PI / 180);
          const y = 55 + r / 200 * 100 * Math.sin(d.angle * Math.PI / 180);
          return (
            <div key={i} style={{
              position: "absolute", left: `${x}%`, top: `${y}%`,
              transform: "translate(-50%, -50%)",
              display: "flex", flexDirection: "column", alignItems: "center", gap: 4
            }}>
              <div style={{
                width: 11, height: 11, borderRadius: "50%",
                background: "var(--surface)",
                border: "2px solid var(--blue)",
                boxShadow: "0 2px 6px rgba(56,182,230,0.35)"
              }} />
              <div style={{ fontSize: 11, fontWeight: 600, color: "var(--text)", letterSpacing: "-0.01em" }}>{d.label}</div>
            </div>);

        })}

        {/* outside the rings: blocked outsiders */}
        <div style={{
          position: "absolute", right: 14, top: 14,
          display: "inline-flex", alignItems: "center", gap: 6,
          padding: "5px 10px",
          borderRadius: 999,
          background: "color-mix(in srgb, var(--coral) 10%, transparent)",
          border: "1px solid color-mix(in srgb, var(--coral) 35%, transparent)"
        }}>
          <svg width="11" height="11" viewBox="0 0 16 16" fill="none" aria-hidden="true">
            <circle cx="8" cy="8" r="6.5" stroke="var(--coral)" strokeWidth="1.4" />
            <line x1="3.5" y1="12.5" x2="12.5" y2="3.5" stroke="var(--coral)" strokeWidth="1.4" strokeLinecap="round" />
          </svg>
          <span style={{ fontSize: 10.5, fontWeight: 700, color: "var(--coral)", letterSpacing: 0.4, textTransform: "uppercase" }}>
            Us
          </span>
        </div>
        <div style={{
          position: "absolute", left: 14, bottom: 14,
          display: "inline-flex", alignItems: "center", gap: 6,
          padding: "5px 10px",
          borderRadius: 999,
          background: "color-mix(in srgb, var(--coral) 10%, transparent)",
          border: "1px solid color-mix(in srgb, var(--coral) 35%, transparent)"
        }}>
          <svg width="11" height="11" viewBox="0 0 16 16" fill="none" aria-hidden="true">
            <circle cx="8" cy="8" r="6.5" stroke="var(--coral)" strokeWidth="1.4" />
            <line x1="3.5" y1="12.5" x2="12.5" y2="3.5" stroke="var(--coral)" strokeWidth="1.4" strokeLinecap="round" />
          </svg>
          <span style={{ fontSize: 10.5, fontWeight: 700, color: "var(--coral)", letterSpacing: 0.4, textTransform: "uppercase" }}>
            Trackers
          </span>
        </div>
      </div>

      {/* Ledger */}
      <div style={{ borderTop: "1px solid var(--line)" }}>
        <div style={{
          padding: "10px 20px",
          fontSize: 10.5, fontWeight: 700, letterSpacing: 1.2, textTransform: "uppercase",
          color: "var(--muted)",
          display: "flex", justifyContent: "space-between",
          background: "var(--bg-alt)",
          borderBottom: "1px solid var(--line)"
        }}>
          <span>Data</span>
          <span>Where it lives</span>
        </div>
        <div>
          {ledger.map((row, i) =>
          <div key={i} style={{
            display: "flex", alignItems: "center", justifyContent: "space-between",
            padding: "13px 20px",
            fontSize: 14,
            borderBottom: i < ledger.length - 1 ? "1px solid var(--line-soft)" : "none"
          }}>
              <div style={{ display: "inline-flex", alignItems: "center", gap: 10 }}>
                <span style={{
                width: 20, height: 20, borderRadius: 5,
                background: row.out ?
                "color-mix(in srgb, var(--coral) 14%, transparent)" :
                "color-mix(in srgb, var(--blue) 14%, transparent)",
                display: "grid", placeItems: "center",
                color: row.out ? "var(--coral)" : "var(--blue-darker)"
              }}>
                  {row.out ?
                <svg width="10" height="10" viewBox="0 0 16 16" fill="none" aria-hidden="true">
                      <line x1="4" y1="4" x2="12" y2="12" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" />
                      <line x1="12" y1="4" x2="4" y2="12" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" />
                    </svg> :

                <svg width="11" height="11" viewBox="0 0 16 16" fill="none" aria-hidden="true">
                      <path d="M3 8.5l3.2 3 6.8-7" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" />
                    </svg>
                }
                </span>
                <span style={{ color: "var(--text)", fontWeight: 500, letterSpacing: "-0.01em" }}>
                  {row.label}
                </span>
                {row.optional &&
              <span style={{
                fontSize: 10, fontWeight: 700, letterSpacing: 0.6,
                padding: "2px 6px", borderRadius: 4,
                background: "var(--blue-soft)", color: "var(--blue-darker)",
                textTransform: "uppercase"
              }}>
                    Optional
                  </span>
              }
              </div>
              <span style={{
              fontFamily: "ui-monospace, 'SF Mono', Menlo, monospace",
              fontSize: 12.5,
              color: row.out ? "var(--coral)" : "var(--text)",
              fontWeight: 500
            }}>
                {row.where}
              </span>
            </div>
          )}
        </div>
      </div>
    </div>);

};


const PremiumSection = () =>
<section id="premium" className="premium-section" style={{ background: "linear-gradient(165deg, var(--blue-tint) 0%, var(--bg-alt) 100%)", position: "relative", overflow: "hidden" }}>
    {/* Ambient particle field */}
    <div className="premium-particles" aria-hidden="true">
      {Array.from({ length: 22 }).map((_, i) =>
    <span key={i} className={`premium-particle premium-particle-${i % 4 + 1}`} style={{
      left: `${(i * 4.7 + 3) % 100}%`,
      animationDelay: `${i * 0.7 % 9}s`,
      animationDuration: `${10 + i % 5 * 2}s`
    }} />
    )}
      {/* Soft glow orbs */}
      <div className="premium-orb premium-orb-1" />
      <div className="premium-orb premium-orb-2" />
    </div>

    <div className="shell" style={{ position: "relative", zIndex: 1 }}>
      <div className="reveal premium-grid" style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 80, alignItems: "center" }}>
        <div>
          <div className="section-eyebrow">
            <span className="premium-eyebrow-star" aria-hidden="true">✦</span>
            Premium
          </div>
          <h2 className="h-1" style={{ marginBottom: 24 }}>
            Free forever.<br />
            <span className="gradient-text">More with Premium.</span>
          </h2>
          <p className="lede" style={{ marginBottom: 32 }}>
            Never Forget is free to use forever. Premium unlocks the things power users ask for most — pick monthly, yearly, or a one-time lifetime purchase.
          </p>
          <a href="https://apps.apple.com/us/app/never-forget-spaced-reminder/id1551467159" className="btn btn-primary premium-cta">
            <span className="premium-cta-shine" aria-hidden="true" />
            Try Premium
            <svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M3 7H11M11 7L7 3M11 7L7 11" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" /></svg>
          </a>
        </div>

        <div className="reveal-stagger premium-list" style={{ display: "flex", flexDirection: "column", gap: 1, background: "var(--line)", borderRadius: 20, overflow: "hidden", border: "1px solid var(--line)", boxShadow: "0 30px 60px -30px color-mix(in oklch, var(--blue) 35%, transparent)", marginTop: 40 }}>
          {[
        { kind: "infinity", title: "Unlimited reps", desc: "No cap on how many ideas you track at once." },
        { kind: "bolt", title: "Fast & Super-fast schedules", desc: "Two extra rhythms for shorter retention windows." },
        { kind: "tools", title: "Custom schedules", desc: "Define your own intervals — built for the way you study." },
        { kind: "palette", title: "Theme colors", desc: "Pick the accent that suits your home screen." },
        { kind: "sparkles", title: "All emojis", desc: "Full library to label and find your reps." }].
        map((item, i) =>
        <div key={i} className={`premium-row premium-row-${item.kind}`} style={{ padding: "22px 24px", background: "var(--surface)", display: "flex", justifyContent: "space-between", alignItems: "center", gap: 16, position: "relative", overflow: "hidden" }}>
              <div className="premium-row-sheen" aria-hidden="true" />
              <div style={{ display: "flex", alignItems: "center", gap: 18, position: "relative", zIndex: 1, flex: 1 }}>
                <PremiumIcon kind={item.kind} />
                <div>
                  <div style={{ fontSize: 16, fontWeight: 600, color: "var(--text)", marginBottom: 3, letterSpacing: "-0.015em" }}>{item.title}</div>
                  <div style={{ fontSize: 14, color: "var(--text-soft)" }}>{item.desc}</div>
                </div>
              </div>
              <div className="premium-check" style={{ width: 22, height: 22, borderRadius: "50%", background: "var(--blue)", display: "grid", placeItems: "center", color: "white", flexShrink: 0, position: "relative", zIndex: 1 }}>
                <svg width="11" height="11" viewBox="0 0 14 14" fill="none">
                  <path d="M2 7.5L5.5 11L12 3.5" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" strokeDasharray="14" strokeDashoffset="14" className="premium-check-path" />
                </svg>
              </div>
            </div>
        )}
        </div>
      </div>
    </div>

    <style>{`
      @media (max-width: 920px) {
        .premium-grid { grid-template-columns: 1fr !important; gap: 48px !important; }
      }
    `}</style>
  </section>;

const PremiumIcon = ({ kind }) => {
  const tile = (children, extraClass = "") =>
  <div className={`premium-icon premium-icon-${kind} ${extraClass}`} aria-hidden="true">
      <div className="premium-icon-bg" />
      <div className="premium-icon-ring" />
      <span className="premium-mini-spark premium-mini-spark-1">✦</span>
      <span className="premium-mini-spark premium-mini-spark-2">✦</span>
      <span className="premium-mini-spark premium-mini-spark-3">✦</span>
      {children}
    </div>;

  if (kind === "infinity") {
    return tile(
      <svg className="premium-icon-glyph" width="34" height="34" viewBox="0 0 48 48" fill="none">
        <path className="premium-infinity-path"
        d="M6 24c0-4.4 3.6-8 8-8s5 2 10 8 6 8 10 8 8-3.6 8-8-3.6-8-8-8-5 2-10 8-6 8-10 8-8-3.6-8-8z"
        stroke="url(#prem-grad-1)" strokeWidth="3.2" strokeLinecap="round" />
        <defs>
          <linearGradient id="prem-grad-1" x1="0" y1="0" x2="48" y2="48">
            <stop offset="0" stopColor="var(--blue)" />
            <stop offset="1" stopColor="var(--blue-darker)" />
          </linearGradient>
        </defs>
      </svg>
    );
  }
  if (kind === "bolt") {
    return tile(
      <>
        <svg className="premium-icon-glyph premium-bolt" width="28" height="32" viewBox="0 0 28 32" fill="none">
          <path d="M16 2 L4 18 H12 L10 30 L24 12 H16 L18 2 Z"
          fill="url(#prem-grad-2)" stroke="var(--blue-darker)" strokeWidth="1.2" strokeLinejoin="round" />
          <defs>
            <linearGradient id="prem-grad-2" x1="0" y1="0" x2="0" y2="32">
              <stop offset="0" stopColor="#7BD3F0" />
              <stop offset="1" stopColor="var(--blue-darker)" />
            </linearGradient>
          </defs>
        </svg>
        <span className="premium-bolt-flash" />
      </>
    );
  }
  if (kind === "tools") {
    return tile(
      <svg className="premium-icon-glyph premium-tools" width="32" height="32" viewBox="0 0 48 48" fill="none">
        <g className="premium-tools-gear">
          <circle cx="24" cy="24" r="6.5" stroke="var(--blue-darker)" strokeWidth="2.6" fill="color-mix(in oklch, var(--blue) 18%, transparent)" />
          {Array.from({ length: 8 }).map((_, i) => {
            const a = i * 45 * Math.PI / 180;
            const x1 = 24 + Math.cos(a) * 10.5;
            const y1 = 24 + Math.sin(a) * 10.5;
            const x2 = 24 + Math.cos(a) * 14;
            const y2 = 24 + Math.sin(a) * 14;
            return <line key={i} x1={x1} y1={y1} x2={x2} y2={y2} stroke="var(--blue-darker)" strokeWidth="2.6" strokeLinecap="round" />;
          })}
        </g>
      </svg>
    );
  }
  if (kind === "palette") {
    return tile(
      <svg className="premium-icon-glyph premium-palette" width="34" height="34" viewBox="0 0 48 48" fill="none">
        <path d="M24 6c-10 0-18 7-18 16 0 6 4 10 9 10h3c2 0 3 1 3 3 0 1-1 2-1 3 0 2 2 4 5 4 9 0 17-7 17-17C42 14 34 6 24 6z"
        fill="color-mix(in oklch, var(--blue) 12%, var(--surface))"
        stroke="var(--blue-darker)" strokeWidth="2" />
        <circle className="premium-palette-dot premium-palette-dot-1" cx="14" cy="20" r="3" />
        <circle className="premium-palette-dot premium-palette-dot-2" cx="22" cy="14" r="3" />
        <circle className="premium-palette-dot premium-palette-dot-3" cx="32" cy="16" r="3" />
        <circle className="premium-palette-dot premium-palette-dot-4" cx="36" cy="26" r="3" />
      </svg>
    );
  }
  if (kind === "sparkles") {
    return tile(
      <svg className="premium-icon-glyph premium-sparkles" width="34" height="34" viewBox="0 0 48 48" fill="none">
        <path className="premium-spark-big"
        d="M24 6 L27 18 L39 21 L27 24 L24 36 L21 24 L9 21 L21 18 Z"
        fill="url(#prem-grad-3)" />
        <path className="premium-spark-mid"
        d="M38 30 L39.5 35 L44 36.5 L39.5 38 L38 43 L36.5 38 L32 36.5 L36.5 35 Z"
        fill="var(--blue)" opacity="0.85" />
        <path className="premium-spark-small"
        d="M9 32 L10 35 L13 36 L10 37 L9 40 L8 37 L5 36 L8 35 Z"
        fill="var(--blue-darker)" opacity="0.7" />
        <defs>
          <linearGradient id="prem-grad-3" x1="9" y1="6" x2="39" y2="36">
            <stop offset="0" stopColor="#9DDCEF" />
            <stop offset="1" stopColor="var(--blue-darker)" />
          </linearGradient>
        </defs>
      </svg>
    );
  }
  return tile(null);
};


const RoadmapSection = () => {
  const items = [
  {
    stage: "In progress",
    stageColor: "var(--blue)",
    eta: "Next release",
    icon: <VoiceOverIcon />,
    title: "VoiceOver compatibility",
    desc: "Full screen-reader support so every rep, schedule, and note is reachable without sight. Built with accessibility-first labels and rotor-friendly navigation.",
    bullets: ["Labeled controls end-to-end", "Rotor navigation", "Dynamic Type tested"]
  },
  {
    stage: "Designing",
    stageColor: "#B19BE0",
    eta: "Later this year",
    icon: <SiriIcon />,
    title: "Siri integration",
    desc: "Add a rep with your voice, mark today's review complete, or ask what's due — all without unlocking your phone. App Intents shortcuts you can drop into any automation.",
    bullets: ["\"Add to Never Forget\"", "\"What's due today?\"", "Shortcuts & widgets"]
  },
  {
    stage: "Researching",
    stageColor: "#2BBFB0",
    eta: "Following release",
    icon: <ImagesIcon />,
    title: "Images on reps",
    desc: "Attach a photo, diagram, or screenshot to any reminder. A picture of the chart you read, the page you bookmarked, the face you want to remember.",
    bullets: ["Photo & screenshot attach", "Pinch-to-zoom on review", "On-device — no upload"]
  }];


  return (
    <section style={{ background: "var(--bg-alt)", overflow: "hidden" }}>
      <div className="shell">
        <div className="reveal" style={{ textAlign: "center", maxWidth: 720, margin: "0 auto 64px" }}>
          <div className="section-eyebrow">The roadmap</div>
          <h2 className="h-1" style={{ marginBottom: 16 }}>What's coming next.</h2>
          <p className="lede" style={{ margin: "0 auto" }}>
            We ship slowly and on purpose. Here's what's on the bench right now.
            Have something to add? <a href="mailto:hello@titansboost.app" style={{ color: "var(--blue-darker)", textDecoration: "none", fontWeight: 600 }}>Tell us</a>.
          </p>
        </div>

        <div className="roadmap-track reveal">
          <div className="roadmap-spine" aria-hidden="true" />
          {items.map((item, i) =>
          <RoadmapStop key={i} index={i} {...item} />
          )}
        </div>
      </div>

      <style>{`
        .roadmap-track {
          position: relative;
          display: grid;
          grid-template-columns: repeat(3, 1fr);
          gap: 28px;
          padding-top: 28px;
        }
        .roadmap-spine {
          position: absolute;
          top: 56px;
          left: 8%;
          right: 8%;
          height: 2px;
          background: repeating-linear-gradient(
            to right,
            var(--line) 0 8px,
            transparent 8px 16px
          );
          z-index: 0;
        }
        .roadmap-stop {
          position: relative;
          z-index: 1;
          display: flex;
          flex-direction: column;
          align-items: stretch;
        }
        .roadmap-node {
          width: 56px; height: 56px;
          border-radius: 50%;
          background: var(--surface);
          border: 2px solid var(--line);
          display: grid;
          place-items: center;
          margin: 0 auto 24px;
          color: var(--text);
          position: relative;
          transition: transform 0.3s cubic-bezier(.2,.7,.2,1), border-color 0.3s, box-shadow 0.3s;
        }
        .roadmap-stop:hover .roadmap-node {
          transform: translateY(-3px) scale(1.06);
          border-color: var(--blue);
          box-shadow: 0 12px 28px -10px rgba(56,182,230,0.40);
        }
        .roadmap-node-pulse {
          position: absolute;
          inset: -6px;
          border-radius: 50%;
          border: 2px solid var(--blue);
          opacity: 0;
          animation: roadmapPulse 2.4s ease-out infinite;
        }
        @keyframes roadmapPulse {
          0% { transform: scale(0.9); opacity: 0.6; }
          100% { transform: scale(1.4); opacity: 0; }
        }
        .roadmap-card {
          background: var(--surface);
          border: 1px solid var(--line);
          border-radius: 20px;
          padding: 28px 26px;
          flex: 1;
          display: flex;
          flex-direction: column;
          transition: transform 0.3s cubic-bezier(.2,.7,.2,1), box-shadow 0.3s, border-color 0.3s;
        }
        .roadmap-stop:hover .roadmap-card {
          transform: translateY(-3px);
          box-shadow: 0 24px 48px -24px rgba(15,30,55,0.18);
          border-color: var(--line-strong, var(--line));
        }
        .roadmap-stage {
          display: inline-flex;
          align-items: center;
          gap: 8px;
          font-size: 11px;
          font-weight: 700;
          letter-spacing: 0.08em;
          text-transform: uppercase;
          margin-bottom: 12px;
        }
        .roadmap-stage-dot {
          width: 7px; height: 7px; border-radius: 50%;
        }
        .roadmap-bullets {
          list-style: none;
          display: flex;
          flex-direction: column;
          gap: 8px;
          margin-top: 18px;
          padding-top: 18px;
          border-top: 1px solid var(--line);
        }
        .roadmap-bullet {
          display: flex;
          align-items: center;
          gap: 10px;
          font-size: 13.5px;
          color: var(--text-soft);
        }
        .roadmap-bullet-tick {
          width: 14px; height: 14px;
          border-radius: 50%;
          background: var(--blue-soft);
          color: var(--blue-darker);
          display: grid; place-items: center;
          flex-shrink: 0;
        }
        .roadmap-eta {
          font-size: 12px;
          color: var(--muted);
          font-variant-numeric: tabular-nums;
          margin-left: auto;
          letter-spacing: 0.02em;
        }
        @media (max-width: 820px) {
          .roadmap-track { grid-template-columns: 1fr !important; gap: 20px; }
          .roadmap-spine { display: none; }
          .roadmap-node { margin: 0 0 16px; }
          .roadmap-stop { flex-direction: row; align-items: stretch; gap: 20px; }
          .roadmap-stop > .roadmap-node { flex-shrink: 0; margin: 4px 0 0; }
        }
      `}</style>
    </section>);

};

const RoadmapStop = ({ index, stage, stageColor, eta, icon, title, desc, bullets }) =>
<div className="roadmap-stop">
    <div className="roadmap-node" style={{ color: stageColor }}>
      {index === 0 && <span className="roadmap-node-pulse" style={{ borderColor: stageColor }} />}
      {icon}
    </div>
    <div className="roadmap-card">
      <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 4 }}>
        <span className="roadmap-stage" style={{ color: stageColor }}>
          <span className="roadmap-stage-dot" style={{ background: stageColor }} />
          {stage}
        </span>
        <span className="roadmap-eta">{eta}</span>
      </div>
      <h3 className="h-3" style={{ fontSize: 20, marginBottom: 10, letterSpacing: "-0.02em" }}>{title}</h3>
      <p style={{ fontSize: 14.5, color: "var(--text-soft)", lineHeight: 1.55 }}>{desc}</p>
      <ul className="roadmap-bullets">
        {bullets.map((b, i) =>
      <li key={i} className="roadmap-bullet">
            <span className="roadmap-bullet-tick">
              <svg width="8" height="8" viewBox="0 0 14 14" fill="none">
                <path d="M2 7.5L5.5 11L12 3.5" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" />
              </svg>
            </span>
            {b}
          </li>
      )}
      </ul>
    </div>
  </div>;


const VoiceOverIcon = () =>
<svg width="26" height="26" viewBox="0 0 24 24" fill="none" aria-hidden="true">
    <circle cx="12" cy="12" r="3" stroke="currentColor" strokeWidth="1.7" />
    <path d="M7.5 8a6 6 0 0 0 0 8" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" />
    <path d="M16.5 8a6 6 0 0 1 0 8" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" />
    <path d="M4.5 5a10 10 0 0 0 0 14" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" opacity="0.55" />
    <path d="M19.5 5a10 10 0 0 1 0 14" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" opacity="0.55" />
  </svg>;


const SiriIcon = () =>
<svg width="26" height="26" viewBox="0 0 24 24" fill="none" aria-hidden="true">
    <rect x="9.5" y="3" width="5" height="11" rx="2.5" stroke="currentColor" strokeWidth="1.7" />
    <path d="M5.5 11.5a6.5 6.5 0 0 0 13 0" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" />
    <line x1="12" y1="18" x2="12" y2="21" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" />
    <line x1="9" y1="21" x2="15" y2="21" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" />
  </svg>;


const ImagesIcon = () =>
<svg width="26" height="26" viewBox="0 0 24 24" fill="none" aria-hidden="true">
    <rect x="3" y="5" width="18" height="14" rx="2.5" stroke="currentColor" strokeWidth="1.7" />
    <circle cx="8.5" cy="10" r="1.4" stroke="currentColor" strokeWidth="1.5" />
    <path d="M3.5 17l4.5-4.5 4 4 3-3 5 5" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" />
  </svg>;


const CTASection = () =>
<section style={{ paddingTop: 80, paddingBottom: 80, position: "relative", overflow: "hidden" }}>
    <div className="shell">
      <div className="reveal" style={{
      background: "linear-gradient(135deg, var(--blue) 0%, var(--blue-darker) 100%)",
      borderRadius: 32,
      padding: "72px 48px",
      textAlign: "center",
      color: "white",
      position: "relative",
      overflow: "hidden"
    }}>
        {/* decorative */}
        <div style={{
        position: "absolute",
        top: "-30%",
        right: "-10%",
        width: 400, height: 400,
        borderRadius: "50%",
        background: "radial-gradient(circle, rgba(255,255,255,0.18), transparent 60%)"
      }} />
        <div style={{
        position: "absolute",
        bottom: "-30%",
        left: "-10%",
        width: 400, height: 400,
        borderRadius: "50%",
        background: "radial-gradient(circle, rgba(255,255,255,0.12), transparent 60%)"
      }} />
        <div style={{ position: "relative" }}>
          <h2 className="h-1" style={{ color: "white", marginBottom: 16 }}>
            Start remembering today.
          </h2>
          <p style={{ fontSize: 18, color: "rgba(255,255,255,0.88)", maxWidth: 560, margin: "0 auto 32px", lineHeight: 1.55 }}>
            Free on the App Store. No account, no tracking, no cloud servers. Your reps stay on your devices.
          </p>
          <a
          href="https://apps.apple.com/us/app/never-forget-spaced-reminder/id1551467159"
          style={{
            display: "inline-flex",
            alignItems: "center",
            gap: 12,
            padding: "14px 24px 14px 20px",
            background: "white",
            color: "#0A1628",
            borderRadius: 14,
            textDecoration: "none",
            transition: "transform 0.2s"
          }}
          onMouseEnter={(e) => {e.currentTarget.style.transform = "translateY(-2px)";}}
          onMouseLeave={(e) => {e.currentTarget.style.transform = "";}}>
          
            <AppleLogo size={22} />
            <div>
              <div style={{ fontSize: 11, opacity: 0.7, lineHeight: 1, letterSpacing: 0.04, textTransform: "uppercase" }}>Download on the</div>
              <div style={{ fontSize: 19, fontWeight: 600, lineHeight: 1.1, marginTop: 3, letterSpacing: "-0.01em" }}>App Store</div>
            </div>
          </a>
        </div>
      </div>
    </div>
  </section>;


const Footer = () =>
<footer style={{ borderTop: "1px solid var(--line)", padding: "56px 0 32px", background: "var(--bg)" }}>
    <div className="shell">
      <div style={{ display: "grid", gridTemplateColumns: "2fr 1fr 1fr", gap: 48, marginBottom: 40 }} className="footer-grid">
        <div>
          <div className="brand" style={{ marginBottom: 14 }}>
            <img className="brand-icon" src="assets/app-icon.png" alt="Never Forget" />
            <span style={{ fontSize: 17 }}>Never Forget</span>
          </div>
          <p style={{ fontSize: 14.5, color: "var(--text-soft)", maxWidth: "36ch", lineHeight: 1.55 }}>
            A simple spaced repetition reminder app for those who want to remember newly learned information that doesn't fit in flashcards.
          </p>
        </div>

        <div>
          <div style={{ fontSize: 12, color: "var(--muted)", letterSpacing: 1, textTransform: "uppercase", fontWeight: 700, marginBottom: 14 }}>Product</div>
          <ul style={{ listStyle: "none", display: "flex", flexDirection: "column", gap: 10, fontSize: 14.5 }}>
            <li><a href="#science" style={{ color: "var(--text-soft)", textDecoration: "none" }}>The science</a></li>
            <li><a href="#premium" style={{ color: "var(--text-soft)", textDecoration: "none" }}>Premium</a></li>
          </ul>
        </div>

        <div>
          <div style={{ fontSize: 12, color: "var(--muted)", letterSpacing: 1, textTransform: "uppercase", fontWeight: 700, marginBottom: 14 }}>Company</div>
          <ul style={{ listStyle: "none", display: "flex", flexDirection: "column", gap: 10, fontSize: 14.5 }}>
            <li><a href="privacy.html" style={{ color: "var(--text-soft)", textDecoration: "none" }}>Privacy</a></li>
            <li><a href="terms.html" style={{ color: "var(--text-soft)", textDecoration: "none" }}>Terms</a></li>
            <li><a href="mailto:hello@titansboost.app" style={{ color: "var(--text-soft)", textDecoration: "none" }}>Contact</a></li>
          </ul>
        </div>
      </div>

      <div style={{ paddingTop: 24, borderTop: "1px solid var(--line)", display: "flex", justifyContent: "space-between", flexWrap: "wrap", gap: 12, fontSize: 13, color: "var(--muted)" }}>
        <div>© 2026 Titans Boost Ltd.</div>
        <div>Made with care.</div>
      </div>

      <style>{`
        @media (max-width: 720px) {
          .footer-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
        }
      `}</style>
    </div>
  </footer>;


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