/* Alternatifbank case study — banking website redesign.
   Built from the same editorial template as the Stablex V2 case (narrow text
   column, pill section markers, numbered decision tracks, summary card up
   top, "Behind the work" credits close) with its own signature color
   (#420019) and local helper components (AB-prefixed) so nothing here
   collides with case-stablex-v2.jsx's globals.
   No real screenshots exist yet — every [SCREEN: ...] slot from the content
   brief is a labeled placeholder panel, ready to swap for real imagery. */

const AB_DARK = "#420019";      // signature surface — hero, impact, footer, nav dock
const AB_HEAD = "#2A000C";      // heading color on light backgrounds
const AB_ACCENT = "#E8004F";    // bright accent — colored H1 clause, footer "together"
const AB_TINT = "rgba(66,0,25,.06)";   // light tint bg for cards (rgb of AB_DARK)
const AB_ACTIVE = "#6B0F2E";    // active nav-dock pill
const AB_LOGO_SRC =
  (typeof window !== "undefined" && window.__resources && window.__resources.alternatifbankLogo) ||
  "assets/alternatifbank-logo.png";
const AB_FIGMA_URL = "https://www.figma.com/design/1R38GdyM58DMWXjjW280RO/Alternatif-Bank---Tuna?node-id=117-2817&t=nwyni9H4x3eLuoBI-1";
const AB_PROTO_URL = "https://www.figma.com/proto/1R38GdyM58DMWXjjW280RO/Alternatif-Bank---Tuna?node-id=40002244-4041&p=f&viewport=332%2C234%2C0.03&t=oZHPgc6CbUKZCEXH-1&scaling=min-zoom&content-scaling=fixed&starting-point-node-id=40002244%3A4041&show-proto-sidebar=1&page-id=40002244%3A1817";

/* Real page screenshots — swapped in for the matching ABPlaceholder slots */
const AB_SHOT_OLD_HOME = "assets/ab-homepage-vov-hero.png";          // Problem — old homepage
const AB_SHOT_VOV_BANNER = "assets/ab-vov-advantage-banner.png";     // Decision 3 — highlighted savings advantage
const AB_SHOT_CALCULATOR = "assets/ab-rate-calculator.png";          // Decision 2 — rate/loan calculator with inline apply
const AB_SHOT_LOAN_BENEFITS = "assets/ab-loan-benefits-module.png";  // Decision 1 — product highlights with benefits
const AB_SHOT_FINAL_HOME = "assets/ab-final-homepage.png";           // Approach (new homepage) + Final design showcase, desktop
const AB_SHOT_FINAL_HOME_MOBILE = "assets/ab-final-homepage-mobile.png"; // Final design showcase, mobile
const AB_HERO_VIDEO_DESKTOP = "assets/ab-hero-desktop.mp4";          // Summary — hero shot, desktop walkthrough
const AB_HERO_VIDEO_MOBILE = "assets/ab-hero-mobile.mp4";            // Summary — hero shot, mobile walkthrough
const AB_SHOT_COMPONENTS_DESKTOP = "assets/ab-components-desktop.png"; // Final design — components, desktop
const AB_SHOT_COMPONENTS_MOBILE = "assets/ab-components-mobile.png";   // Final design — components, mobile

/* ---------- local building blocks (AB-prefixed to stay collision-free) ---------- */

function ABPill({ children }) {
  return (
    <span className="inline-flex items-center whitespace-nowrap rounded-full border px-3.5 py-1.5 text-[14px] uppercase tracking-[0.18em]"
          style={{ borderColor: "rgba(15,26,22,.25)", color: "rgba(15,26,22,.6)" }}>
      {children}
    </span>
  );
}

function ABSectionNav() {
  const items = [
    ["ab-problem", "Problem"], ["ab-approach", "Approach"], ["ab-solution", "Solution"],
    ["ab-final", "Final design"], ["ab-impact", "Impact"],
  ];
  const [active, setActive] = React.useState("ab-problem");
  const [shown, setShown] = React.useState(false);
  const [navUp, setNavUp] = React.useState(false);
  const lastYRef = React.useRef(0);
  React.useEffect(() => {
    const pick = () => {
      const mid = window.scrollY + window.innerHeight * 0.5;
      let current = items[0][0];
      for (const [id] of items) {
        const el = document.getElementById(id);
        if (el && el.getBoundingClientRect().top + window.scrollY <= mid) current = id;
      }
      setActive(current);
      const y = window.scrollY;
      setShown(y > 40);
      if (y < lastYRef.current - 2) setNavUp(true);
      else if (y > lastYRef.current + 2 || y <= 2) setNavUp(false);
      lastYRef.current = y;
    };
    pick();
    window.addEventListener("scroll", pick, { passive: true });
    window.addEventListener("resize", pick);
    return () => { window.removeEventListener("scroll", pick); window.removeEventListener("resize", pick); };
  }, []);
  const go = (e, id) => {
    e.preventDefault();
    const el = document.getElementById(id);
    if (el) window.scrollTo({ top: el.getBoundingClientRect().top + window.scrollY - 80, behavior: "smooth" });
  };
  return (
    <React.Fragment>
    <nav className="md:hidden fixed left-0 right-0 z-40" style={{ top: navUp ? 64 : 0, opacity: shown ? 1 : 0, transition: "opacity .4s ease, top .3s ease", pointerEvents: shown ? "auto" : "none" }}>
      <div className="flex items-center gap-1 overflow-x-auto px-3 py-2" style={{ background: AB_DARK, borderBottom: "1px solid rgba(255,255,255,0.12)", WebkitOverflowScrolling: "touch" }}>
        {items.map(([id, label]) => {
          const on = active === id;
          return (
            <a key={id} href={`#${id}`} onClick={(e) => go(e, id)}
               className="shrink-0 text-[11px] uppercase tracking-[0.12em] rounded-full px-3.5 py-1.5 whitespace-nowrap"
               style={on ? { background: AB_ACTIVE, color: "#ffffff", fontWeight: 600 } : { color: "rgba(255,255,255,0.55)" }}>
              {label}
            </a>
          );
        })}
      </div>
    </nav>
    <nav className="hidden md:block fixed left-1/2 z-40"
         style={{
           bottom: 24,
           transform: `translateX(-50%) translateY(${shown ? 0 : 28}px)`,
           opacity: shown ? 1 : 0,
           pointerEvents: shown ? "auto" : "none",
           transition: "opacity .5s cubic-bezier(0.16,1,0.3,1), transform .5s cubic-bezier(0.16,1,0.3,1)",
         }}>
      <div className="flex items-center gap-1 rounded-full px-2 py-2"
           style={{ background: AB_DARK, border: "1px solid rgba(255,255,255,0.1)", backdropFilter: "blur(14px)", WebkitBackdropFilter: "blur(14px)", boxShadow: "0 16px 50px -18px rgba(0,0,0,0.9)" }}>
        {items.map(([id, label]) => {
          const on = active === id;
          return (
            <a key={id} href={`#${id}`} onClick={(e) => go(e, id)}
               className="text-[12px] uppercase tracking-[0.14em] rounded-full px-3.5 py-2 transition-all duration-300 whitespace-nowrap"
               style={on ? { background: AB_ACTIVE, color: "#ffffff", fontWeight: 600 } : { color: "rgba(255,255,255,0.5)" }}>
              {label}
            </a>
          );
        })}
      </div>
    </nav>
    </React.Fragment>
  );
}

/* narrow editorial text column */
function ABCol({ children, className = "" }) {
  return <div className={`mx-auto px-6 max-w-[680px] ${className}`}>{children}</div>;
}

/* light striped placeholder for big panels — stands in for real screenshots */
function ABPlaceholder({ label, height = 360 }) {
  return (
    <div className="grid place-items-center"
         style={{ height, backgroundImage: "repeating-linear-gradient(45deg, rgba(15,26,22,.05) 0 10px, transparent 10px 20px)" }}>
      <span className="text-[12px] uppercase tracking-[0.2em] px-4 text-center" style={{ color: "rgba(15,26,22,.5)" }}>{label}</span>
    </div>
  );
}

/* wide tinted panel that breaks out of the text column */
function ABPanel({ children, caption, tint = "#F4F4F5", className = "", maxW = "1080px", border }) {
  return (
    <figure className={`mx-auto px-6 ${className}`} style={{ maxWidth: maxW }}>
      <div className="rounded-2xl overflow-hidden" style={{ background: tint, border: border || undefined }}>
        {children}
      </div>
      {caption && <figcaption className="mt-3 text-[14px]" style={{ color: "rgba(15,26,22,.5)" }}>{caption}</figcaption>}
    </figure>
  );
}

/* numbered decision block — highlight line is optional (not every decision has one) */
function ABDecision({ n, title, body, note, panel, caption, tint, panelMaxW }) {
  return (
    <div className="mt-24 first:mt-16">
      <ABCol>
        <Reveal>
          <h3 className="font-display font-medium text-[24px] md:text-[30px] leading-[1.15] tracking-tight" style={{ color: "#0f1a16" }}>
            <span style={{ color: AB_DARK }}>{n}.</span> <span style={{ color: AB_DARK }}>{title}</span>
          </h3>
        </Reveal>
        <Reveal delay={70}>
          <p className="mt-4 text-[20px] leading-[1.7]" style={{ color: "rgba(15,26,22,.78)" }}>{body}</p>
        </Reveal>
        {note && (
          <Reveal delay={160}>
            <p className="mt-4 text-[16px] leading-[1.6] rounded-lg px-4 py-3 inline-block" style={{ background: "rgba(21,217,151,.1)", color: "rgba(15,26,22,.7)" }}>
              {note}
            </p>
          </Reveal>
        )}
      </ABCol>
      <Reveal delay={120}>
        <ABPanel caption={caption} tint={tint} maxW={panelMaxW || "1080px"} className="mt-10">
          {panel}
        </ABPanel>
      </Reveal>
    </div>
  );
}

/* simple click-to-enlarge lightbox — used for the component-library comparison shots */
function ABLightbox({ images, index, onClose, onNav }) {
  React.useEffect(() => {
    if (index == null) return;
    const onKey = (e) => {
      if (e.key === "Escape") onClose();
      if (e.key === "ArrowRight") onNav(1);
      if (e.key === "ArrowLeft") onNav(-1);
    };
    window.addEventListener("keydown", onKey);
    return () => window.removeEventListener("keydown", onKey);
  }, [index, onClose, onNav]);

  if (index == null) return null;
  const item = images[index];
  return (
    <div className="fixed inset-0 z-[100] flex items-center justify-center p-6" style={{ background: "rgba(10,10,10,.92)" }} onClick={onClose}>
      <button onClick={onClose} aria-label="Close" className="absolute top-6 right-6 text-white/70 hover:text-white text-[28px] leading-none">×</button>
      {images.length > 1 && (
        <button onClick={(e) => { e.stopPropagation(); onNav(-1); }} aria-label="Previous"
                className="absolute left-3 md:left-8 size-11 grid place-items-center rounded-full text-white/70 hover:text-white hover:bg-white/10 text-2xl">‹</button>
      )}
      <img src={item.src} alt={item.alt} onClick={(e) => e.stopPropagation()}
           className="max-w-full max-h-[85vh] object-contain rounded-lg select-none" draggable="false" />
      {images.length > 1 && (
        <button onClick={(e) => { e.stopPropagation(); onNav(1); }} aria-label="Next"
                className="absolute right-3 md:right-8 size-11 grid place-items-center rounded-full text-white/70 hover:text-white hover:bg-white/10 text-2xl">›</button>
      )}
      <div className="absolute bottom-6 left-1/2 -translate-x-1/2 text-white/50 text-[12px] uppercase tracking-[0.18em]">{item.label}</div>
    </div>
  );
}

/* ---------- the page ---------- */

function AlternatifbankCase({ navigate }) {
  const [lightboxIndex, setLightboxIndex] = React.useState(null);
  const componentShots = [
    { src: AB_SHOT_COMPONENTS_DESKTOP, alt: "Component library — desktop", label: "Desktop" },
    { src: AB_SHOT_COMPONENTS_MOBILE, alt: "Component library — mobile", label: "Mobile" },
  ];
  const navLightbox = (dir) => setLightboxIndex((i) => (i + dir + componentShots.length) % componentShots.length);
  return (
    <div className="relative" style={{ background: "#FCFCFC", color: "#0f1a16" }}>
      <ABSectionNav />

      {/* HERO */}
      <header className="relative overflow-hidden" style={{ background: AB_DARK, color: "#fff" }}>
        <div className="mx-auto max-w-[1080px] px-6 pt-36 pb-36">
          <Reveal>
            <div className="text-[14px] uppercase tracking-[0.22em] text-white/45">Alternatifbank — Banking Website</div>
          </Reveal>
          <div className="mt-6 flex items-start justify-between gap-10">
            <div>
              <Reveal delay={40}>
                <a href={AB_PROTO_URL} target="_blank" rel="noopener noreferrer" aria-label="View Alternatifbank prototype" className="md:hidden mb-5 inline-block">
                  <img src={AB_LOGO_SRC} alt="Alternatifbank logo" draggable="false" className="block select-none rounded-2xl" style={{ width: 72, height: 72 }} />
                </a>
              </Reveal>
              <Reveal delay={80}>
                <h1 className="font-display font-medium text-[40px] md:text-[58px] leading-[1.06] tracking-[-0.02em] max-w-[18ch]" style={{ color: "#ffffff" }}>
                  The site was coasting on one great rate. <span style={{ color: AB_ACCENT }}>We turned it into an acquisition engine.</span>
                </h1>
              </Reveal>
            </div>
            <Reveal delay={120}>
              <a href={AB_PROTO_URL} target="_blank" rel="noopener noreferrer" aria-label="View Alternatifbank prototype"
                 className="hidden md:block shrink-0 transition-transform hover:-translate-y-1">
                <img src={AB_LOGO_SRC} alt="Alternatifbank logo" draggable="false"
                     className="block select-none rounded-2xl"
                     style={{ width: 160, height: 160, boxShadow: "0 30px 70px -30px rgba(0,0,0,.7)" }} />
              </a>
            </Reveal>
          </div>
        </div>
      </header>

      {/* SUMMARY */}
      <section id="ab-summary" className="pt-20 pb-24">
        <ABCol>
          <Reveal>
            <div className="rounded-2xl px-7 py-7 md:px-9 md:py-8" style={{ background: AB_TINT }}>
              <div className="text-[14px] uppercase tracking-[0.2em]" style={{ color: "rgba(15,26,22,.5)" }}>Summary</div>
              <p className="mt-4 text-[20px] leading-[1.7]" style={{ color: "rgba(15,26,22,.85)" }}>
                Alternatifbank, the Turkey branch of <strong className="font-bold" style={{ color: "#0f1a16" }}>The Commercial Bank of Qatar</strong>, came
                to us to rebuild their public website, the digital front door for a corporate and retail
                bank. I owned the <strong className="font-bold" style={{ color: "#0f1a16" }}>UX design end to end</strong> and
                directed the <strong className="font-bold" style={{ color: "#0f1a16" }}>UI Designer</strong> working
                under me, steering the process and signing off every final decision.
              </p>
            </div>
          </Reveal>
        </ABCol>
        <Reveal delay={80}>
          <ABPanel className="mt-10" tint="#2B2B2B">
            <div className="flex flex-col sm:flex-row items-center justify-center gap-6 p-6 md:p-10">
              <div className="w-full sm:w-auto" style={{ maxWidth: 610, borderRadius: 16, border: `4px solid ${AB_DARK}`, overflow: "hidden" }}>
                <video src={AB_HERO_VIDEO_DESKTOP} autoPlay muted loop playsInline preload="auto" className="w-full h-auto block" />
              </div>
              <div className="w-full sm:w-auto" style={{ maxWidth: 220, borderRadius: 16, border: `4px solid ${AB_DARK}`, overflow: "hidden" }}>
                <video src={AB_HERO_VIDEO_MOBILE} autoPlay muted loop playsInline preload="auto" className="w-full h-auto block" />
              </div>
            </div>
          </ABPanel>
        </Reveal>
      </section>

      {/* PROBLEM */}
      <section id="ab-problem" className="pb-28">
        <ABCol>
          <Reveal><ABPill>The problem</ABPill></Reveal>
          <Reveal delay={70}>
            <h2 className="mt-6 font-display font-medium text-[28px] md:text-[36px] leading-[1.12] tracking-tight" style={{ color: AB_HEAD }}>
              Three numbers were in the red. One great rate was hiding it.
            </h2>
          </Reveal>
          <Reveal delay={130}>
            <p className="mt-6 text-[20px] leading-[1.7]" style={{ color: "rgba(15,26,22,.78)" }}>
              The business problem was sharp: customer acquisition and loan applications were both
              underperforming. Savings looked healthy, but only because the bank offered one of the most
              competitive rates in the market, and almost all of those applications arrived from Google,
              not from the site itself.
            </p>
          </Reveal>
        </ABCol>
        <Reveal delay={120}>
          <p className="mt-12 mb-3 mx-auto px-6 text-[14px]" style={{ maxWidth: "1080px", color: "rgba(15,26,22,.5)" }}>Old homepage</p>
          <ABPanel tint="#F4F4F5" border="1px solid rgba(15,26,22,.1)">
            <img src={AB_SHOT_OLD_HOME} alt="Old Alternatifbank homepage, products treated equally and buried" draggable="false" className="w-full h-auto block select-none" />
          </ABPanel>
        </Reveal>
      </section>

      {/* APPROACH */}
      <section id="ab-approach" className="py-24" style={{ background: "#F4F4F5" }}>
        <ABCol>
          <Reveal><ABPill>The approach</ABPill></Reveal>
          <Reveal delay={70}>
            <h2 className="mt-6 font-display font-medium text-[28px] md:text-[36px] leading-[1.12] tracking-tight" style={{ color: AB_HEAD }}>
              If one product pulls people in, put it at the front door.
            </h2>
          </Reveal>
          <Reveal delay={130}>
            <p className="mt-6 text-[20px] leading-[1.7]" style={{ color: "rgba(15,26,22,.78)" }}>
              Instead of presenting every product with equal weight, I built the experience around the
              bank&apos;s strongest card. The savings account had been among the top three highest rates
              in Turkey for two years, so I proposed making it the acquisition hook and got the brand on
              board, using the irresistible product to bring people in, then designing clear paths to
              convert them into loan and savings customers. The second principle was just as simple: let
              people act the moment they see their
              number, instead of making them hunt for an application.
            </p>
          </Reveal>
        </ABCol>
        <Reveal delay={150}>
          <ABPanel className="mt-12" tint="#FFFFFF" caption="New homepage.">
            <img src={AB_SHOT_FINAL_HOME} alt="New Alternatifbank homepage" draggable="false" className="w-full h-auto block select-none" />
          </ABPanel>
        </Reveal>
      </section>

      {/* SOLUTION */}
      <section id="ab-solution" className="py-28">
        <ABCol>
          <Reveal><ABPill>The solution</ABPill></Reveal>
          <Reveal delay={70}>
            <h2 className="mt-6 font-display font-medium text-[28px] md:text-[36px] leading-[1.12] tracking-tight" style={{ color: AB_HEAD }}>
              Three moves turned the site into an acquisition engine.
            </h2>
          </Reveal>
        </ABCol>

        <ABDecision
          n="1" title="Lead acquisition with the irresistible product."
          body="I proposed putting the top-rate savings account front and center on the homepage, and got the brand to back turning their strongest number into the site's acquisition hook, so new visitors are pulled in by an offer they can't easily find elsewhere."
          caption="Homepage hero + highlighted savings advantage."
          tint="#FFFFFF"
          panelMaxW="680px"
          panel={<img src={AB_SHOT_LOAN_BENEFITS} alt="Loan product highlight with rate, term and quick-action benefits" draggable="false" className="w-full h-auto block select-none" />}
        />
        <ABDecision
          n="2" title="Turn the calculator into an application."
          body="I designed a rate and loan calculator you can apply directly from, and placed it on both the homepage and the loan page. The moment someone sees their monthly payment or return, the next step is Apply, not Search."
          note="The key shift: the calculator stopped being an information tool and became the start of the application."
          caption="Calculator with inline Apply — homepage and loan page."
          tint="#F4F4F5"
          panel={<img src={AB_SHOT_CALCULATOR} alt="Rate and loan calculator with an inline Apply action" draggable="false" className="w-full h-auto block select-none" />}
        />
        <ABDecision
          n="3" title="Make the products and their advantages impossible to miss."
          body="I gave loans and savings prominent, benefit-led placement on the homepage, so high-intent visitors understand the value and convert on-site instead of bouncing back to search."
          caption="Product highlights with benefits."
          tint="#FFFFFF"
          panel={<img src={AB_SHOT_VOV_BANNER} alt="Highlighted VOV savings advantage banner" draggable="false" className="w-full h-auto block select-none" />}
        />
      </section>

      {/* FINAL DESIGN (incl. design system as sub-section — same shape as the Stablex case) */}
      <section id="ab-final" className="py-28" style={{ background: "#F4F4F5" }}>
        <ABCol className="text-center">
          <Reveal><ABPill>Final design</ABPill></Reveal>
        </ABCol>
        <Reveal delay={90}>
          <ABPanel className="mt-12" tint="#2B2B2B">
            <div className="flex flex-col sm:flex-row items-center justify-center gap-6 p-6 md:p-10">
              <div className="w-full sm:w-auto" style={{ maxWidth: 650, borderRadius: 16, border: `4px solid ${AB_DARK}`, overflow: "hidden" }}>
                <img src={AB_SHOT_FINAL_HOME} alt="Alternatifbank final homepage design — desktop" draggable="false" className="w-full h-auto block select-none" />
              </div>
              <div className="w-full sm:w-auto" style={{ maxWidth: 200, borderRadius: 16, border: `4px solid ${AB_DARK}`, overflow: "hidden" }}>
                <img src={AB_SHOT_FINAL_HOME_MOBILE} alt="Alternatifbank final homepage design — mobile" draggable="false" className="w-full h-auto block select-none" />
              </div>
            </div>
          </ABPanel>
        </Reveal>

        {/* Design system — compact sub-section of Final design */}
        <ABCol className="mt-20">
          <Reveal>
            <h3 className="font-display font-medium text-[22px] md:text-[26px] leading-[1.15] tracking-tight" style={{ color: "#0f1a16" }}>Design system</h3>
          </Reveal>
          <Reveal delay={70}>
            <p className="mt-3 text-[19px] md:text-[20px] leading-[1.55]" style={{ color: "rgba(15,26,22,.5)" }}>
              I designed the UI components and controls that power the whole site: navigation, cards,
              tables, forms, product modules and their states, each responsive across breakpoints and
              aligned to the brand. Every team now builds from the same parts, so the bank stays
              consistent without me in the room.
            </p>
          </Reveal>
          <Reveal delay={100}>
            <div className="mt-6 flex flex-wrap gap-2">
              {["Navigation", "Cards", "Tables", "Forms", "Product Modules", "States", "Responsive"].map((m) => (
                <span key={m} className="inline-flex items-center whitespace-nowrap rounded-full px-3.5 py-1.5 text-[13px]"
                      style={{ background: "rgba(15,26,22,.05)", color: "rgba(15,26,22,.65)" }}>{m}</span>
              ))}
            </div>
          </Reveal>
        </ABCol>

        {/* Visual proof — the dominant element: one component, two breakpoints, one shared card */}
        <Reveal delay={110}>
          <ABPanel className="mt-10" tint="#FFFFFF" caption="Same components, adapted desktop to mobile.">
            <div className="grid grid-cols-1 sm:grid-cols-2">
              <button type="button" onClick={() => setLightboxIndex(0)} aria-label="Open desktop components view full size"
                      className="group relative flex items-center justify-center p-6 md:p-8 sm:border-r cursor-zoom-in" style={{ height: 420, borderColor: "rgba(15,26,22,.08)" }}>
                <span className="absolute left-5 top-5 text-[11px] uppercase tracking-[0.18em] z-10" style={{ color: "rgba(15,26,22,.4)" }}>Desktop</span>
                <img src={AB_SHOT_COMPONENTS_DESKTOP} alt="Component library — desktop" draggable="false" className="max-w-full max-h-full object-contain select-none transition-transform duration-300 group-hover:scale-[1.02]" style={{ borderRadius: 8 }} />
                <span className="absolute inset-0 bg-black/0 group-hover:bg-black/5 transition-colors" />
              </button>
              <button type="button" onClick={() => setLightboxIndex(1)} aria-label="Open mobile components view full size"
                      className="group relative flex items-center justify-center p-6 md:p-8 cursor-zoom-in" style={{ height: 420 }}>
                <span className="absolute right-5 top-5 text-[11px] uppercase tracking-[0.18em] z-10" style={{ color: "rgba(15,26,22,.4)" }}>Mobile</span>
                <img src={AB_SHOT_COMPONENTS_MOBILE} alt="Component library — mobile" draggable="false" className="max-w-full max-h-full object-contain select-none transition-transform duration-300 group-hover:scale-[1.02]" style={{ borderRadius: 8 }} />
                <span className="absolute inset-0 bg-black/0 group-hover:bg-black/5 transition-colors" />
              </button>
            </div>
          </ABPanel>
        </Reveal>

        {/* My influence + quiet link out */}
        <ABCol className="mt-7">
          <Reveal delay={140}>
            <p className="text-[16px] leading-[1.6] rounded-lg px-4 py-3 inline-block" style={{ background: "rgba(21,217,151,.1)", color: "rgba(15,26,22,.7)" }}>
              <span className="uppercase tracking-[0.14em] text-[12px]" style={{ color: AB_DARK }}>My influence · </span>
              My role here was execution of wireframes and direction of UI design. I signed off on every
              screen and interaction that shipped.
            </p>
          </Reveal>
          <Reveal delay={180}>
            <div className="mt-5 flex flex-wrap items-center gap-x-7 gap-y-2 text-[15px]">
              <a href={AB_FIGMA_URL} target="_blank" rel="noopener noreferrer"
                 className="inline-block"
                 style={{ color: "#0E8C63", textDecoration: "underline", textUnderlineOffset: "3px", textDecorationColor: "rgba(14,140,99,.4)" }}>
                View in Figma →
              </a>
              <a href={AB_PROTO_URL} target="_blank" rel="noopener noreferrer"
                 className="inline-block"
                 style={{ color: "#0E8C63", textDecoration: "underline", textUnderlineOffset: "3px", textDecorationColor: "rgba(14,140,99,.4)" }}>
                View prototype →
              </a>
            </div>
          </Reveal>
        </ABCol>
      </section>

      {/* IMPACT */}
      <section id="ab-impact" className="py-28" style={{ background: AB_DARK, color: "#fff" }}>
        <ABCol>
          <Reveal><span className="inline-flex items-center rounded-full border border-white/25 px-3.5 py-1.5 text-[14px] uppercase tracking-[0.18em] text-white/60">Impact</span></Reveal>
          <Reveal delay={70}>
            <p className="mt-6 text-[16px] leading-[1.6] text-white/50 max-w-[56ch]">
              Proposed targets based on the strategy above — the site hasn&apos;t launched yet, so these
              aren&apos;t measured numbers. They&apos;ll be replaced with real results once it&apos;s live.
            </p>
          </Reveal>

          <div className="mt-10 grid grid-cols-1 sm:grid-cols-2 gap-10">
            {[
              ["+30%", "New customer acquisition", "Growth in net-new customers acquired through the web, over the first 6 months."],
              ["+25%", "Loan applications", "Growth in loan applications started and completed on the site, over 6 months."],
            ].map(([num, label, micro]) => (
              <Reveal key={label}>
                <div>
                  <div className="font-display font-normal text-[36px] md:text-[44px] leading-none tracking-tight" style={{ color: AB_ACCENT }}>{num}</div>
                  <div className="mt-3 text-[16px] text-white/85">{label}</div>
                  {micro && <div className="mt-1.5 text-[14px] leading-[1.6] text-white/45">{micro}</div>}
                </div>
              </Reveal>
            ))}
          </div>
        </ABCol>
      </section>

      {/* BEHIND THE WORK */}
      <section className="py-24">
        <ABCol>
          <Reveal>
            <div className="rounded-2xl px-7 py-8 md:px-9" style={{ background: AB_TINT }}>
              <div className="text-[14px] uppercase tracking-[0.2em]" style={{ color: "rgba(15,26,22,.5)" }}>Behind the work</div>
              <div className="mt-6 grid grid-cols-2 md:grid-cols-3 gap-y-6 gap-x-6 text-[16px]">
                <div>
                  <div className="text-[14px] uppercase tracking-[0.14em]" style={{ color: AB_DARK }}>Role</div>
                  <div className="mt-1.5" style={{ color: "rgba(15,26,22,.85)" }}>UX templates, UI component &amp; design control, brand presentations, delivery owner (sign-off on everything shipped)</div>
                </div>
                <div>
                  <div className="text-[14px] uppercase tracking-[0.14em]" style={{ color: AB_DARK }}>Team</div>
                  <div className="mt-1.5" style={{ color: "rgba(15,26,22,.85)" }}>Me (design lead) + 1 Sr. UI Designer</div>
                </div>
                <div>
                  <div className="text-[14px] uppercase tracking-[0.14em]" style={{ color: AB_DARK }}>Timeline</div>
                  <div className="mt-1.5" style={{ color: "rgba(15,26,22,.85)" }}>12 weeks, design</div>
                </div>
              </div>
            </div>
          </Reveal>
        </ABCol>
      </section>

      {/* FOOTER */}
      <section className="py-12" style={{ background: AB_DARK, color: "#fff" }}>
        <Reveal>
          <div className="w-full px-6 md:px-10">
            <div className="grid grid-cols-2 gap-8 md:flex md:items-center md:justify-between md:gap-6">
              <button onClick={() => { navigate("case/sabanci"); window.scrollTo({ top: 0 }); }} className="text-left shrink-0 order-2 md:order-none">
                <div className="text-[12px] uppercase tracking-[0.18em] text-white/45">Previous project</div>
                <div className="mt-1.5 font-display text-[20px] md:text-[22px] text-white">Sabancı University</div>
              </button>
              <div className="flex flex-col items-center text-center gap-2 col-span-2 order-1 md:order-none flex-1">
                <h2 className="font-display font-normal text-[28px] md:text-[48px] leading-[1] tracking-tight">
                  Let's work <span style={{ color: AB_ACCENT }}>together</span><span style={{ color: "rgba(255,255,255,.25)" }}>.</span>
                </h2>
                <a href="mailto:tunaaldemir@gmail.com" className="mt-3 inline-block font-display text-[15px] md:text-[18px] text-white/80 hover:text-white link-underline">
                  tunaaldemir@gmail.com
                </a>
                <a href={/iPhone|iPad|iPod|Android/i.test(navigator.userAgent) ? "tel:+31634483433" : "facetime:+31634483433"}
                   className="inline-block font-display text-[13px] md:text-[15px] text-white/45 hover:text-white/75">
                  +31 06 34 48 34 33
                </a>
                <div className="mt-3 flex items-center gap-3">
                  <a href="https://wa.me/905353130311" target="_blank" rel="noopener noreferrer" aria-label="WhatsApp" className="transition-transform hover:-translate-y-0.5">
                    <svg width="34" height="34" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg">
                      <circle cx="17" cy="17" r="17" fill="#fff"/>
                      <g transform="translate(7 7) scale(0.833)">
                        <path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.149-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.885-9.885 9.885M20.52 3.449C18.24 1.245 15.24 0 12.045 0 5.463 0 .104 5.334.101 11.892c0 2.096.549 4.142 1.595 5.945L0 24l6.335-1.652a12.062 12.062 0 005.71 1.447h.005c6.585 0 11.946-5.335 11.949-11.893a11.821 11.821 0 00-3.484-8.45" fill={AB_DARK}/>
                      </g>
                    </svg>
                  </a>
                  <a href="https://www.linkedin.com/in/tuna-aldemir/" target="_blank" rel="noopener noreferrer" aria-label="LinkedIn" className="transition-transform hover:-translate-y-0.5">
                    <svg width="34" height="34" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg">
                      <circle cx="17" cy="17" r="17" fill="#fff"/>
                      <path d="M12.6 13.2a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm-1.27 1.15h2.53v8.15h-2.53v-8.15Zm4.12 0h2.42v1.11h.04c.34-.62 1.16-1.28 2.39-1.28 2.56 0 3.03 1.64 3.03 3.78v4.54h-2.53v-4.03c0-.96-.02-2.2-1.36-2.2-1.36 0-1.57 1.04-1.57 2.13v4.1h-2.53v-8.15Z" fill={AB_DARK}/>
                    </svg>
                  </a>
                  <a href="assets/Tuna_Aldemir_CV.pdf" target="_blank" rel="noopener noreferrer" aria-label="View CV" className="transition-transform hover:-translate-y-0.5">
                    <span className="grid place-items-center size-[34px] rounded-full" style={{ background: "#fff", color: AB_DARK }}>
                      <span className="font-display font-semibold text-[13px] tracking-tight">CV</span>
                    </span>
                  </a>
                </div>
              </div>
              <button onClick={() => { navigate("case/juzdan"); window.scrollTo({ top: 0 }); }} className="text-right shrink-0 order-3 md:order-none justify-self-end">
                <div className="text-[12px] uppercase tracking-[0.18em] text-white/45">Next project</div>
                <div className="mt-1.5 font-display text-[20px] md:text-[22px] text-white">Juzdan</div>
              </button>
            </div>
          </div>
        </Reveal>
      </section>

      <ABLightbox images={componentShots} index={lightboxIndex} onClose={() => setLightboxIndex(null)} onNav={navLightbox} />
    </div>
  );
}

window.AlternatifbankCase = AlternatifbankCase;
