// Criminal Defense — Nav, Hero, City Switcher, Prosecutor's Edge

const CD_NAV = [
  { type: "link", href: "Criminal Defense.html", label: "Home" },
  { type: "group", label: "Locations", items: [
    { href: "Albuquerque.html", label: "Albuquerque", sub: "Bernalillo · 2nd JDC" },
    { href: "Las Cruces.html",  label: "Las Cruces",  sub: "Doña Ana · 3rd JDC" },
    { href: "Santa Fe.html",    label: "Santa Fe",    sub: "Santa Fe · 1st JDC" }
  ]},
  { type: "group", label: "Practice", items: [
    { href: "DWI.html",        label: "DWI",        sub: "§ 66-8-102 · escalator · MVD" },
    { href: "Expungement.html",label: "Expungement", sub: "§ 29-3A · two tracks" },
    { href: "Penalties.html",  label: "Penalties",  sub: "Sentencing chart" }
  ]},
  { type: "link", href: "Fees.html", label: "Fees" },
  { type: "group", label: "Help", items: [
    { href: "If Arrested.html", label: "If you've been arrested", sub: "What to do right now" },
    { href: "Resources.html",   label: "Resources",                sub: "Public defenders · civil aid" }
  ]}
];

// Flat list for sitemap / mobile drawer
const NAV_FLAT = CD_NAV.flatMap(n => n.type === "group" ? n.items : [n]);

// Desktop dropdown menu — hover + click + keyboard
const NavDropdown = ({ label, items }) => {
  const [open, setOpen] = React.useState(false);
  const ref = React.useRef(null);
  React.useEffect(() => {
    if (!open) return;
    const onDocClick = (e) => { if (!ref.current?.contains(e.target)) setOpen(false); };
    const onEsc = (e) => { if (e.key === "Escape") setOpen(false); };
    document.addEventListener("mousedown", onDocClick);
    document.addEventListener("keydown", onEsc);
    return () => {
      document.removeEventListener("mousedown", onDocClick);
      document.removeEventListener("keydown", onEsc);
    };
  }, [open]);
  return (
    <div ref={ref}
         onMouseEnter={() => setOpen(true)}
         onMouseLeave={() => setOpen(false)}
         style={{ position: "relative" }}>
      <button type="button"
              aria-expanded={open}
              aria-haspopup="menu"
              onClick={() => setOpen(v => !v)}
              style={{
                background: "transparent", border: 0, cursor: "pointer",
                color: "var(--ink)", opacity: open ? 1 : 0.78,
                fontFamily: "inherit", fontSize: 13, padding: "8px 0",
                display: "inline-flex", alignItems: "center", gap: 6,
                transition: "opacity .15s"
              }}>
        {label}
        <svg width="9" height="6" viewBox="0 0 9 6" fill="none" aria-hidden="true"
             style={{ transform: open ? "rotate(180deg)" : "none", transition: "transform .15s" }}>
          <path d="M1 1 L4.5 5 L8 1" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" fill="none"/>
        </svg>
      </button>
      {open && (
        <div role="menu" style={{
          position: "absolute", top: "calc(100% + 6px)", left: "-12px",
          background: "var(--paper)",
          border: "1px solid var(--rule-strong)",
          borderRadius: 10,
          padding: 8, minWidth: 260,
          boxShadow: "0 16px 40px rgba(0,0,0,0.16)",
          zIndex: 100
        }}>
          {items.map(it => (
            <a key={it.href} href={it.href} role="menuitem"
               style={{
                 display: "block", padding: "10px 14px", borderRadius: 6,
                 textDecoration: "none", color: "var(--ink)",
                 transition: "background .12s"
               }}
               onMouseEnter={e => e.currentTarget.style.background = "var(--cream-2)"}
               onMouseLeave={e => e.currentTarget.style.background = "transparent"}>
              <div style={{ fontSize: 14, fontWeight: 500 }}>{it.label}</div>
              {it.sub && <div style={{ fontSize: 11.5, color: "var(--ink-soft)", marginTop: 2, fontFamily: "var(--mono)", letterSpacing: "0.02em" }}>{it.sub}</div>}
            </a>
          ))}
        </div>
      )}
    </div>
  );
};

const useIsMobile = (breakpoint = 900) => {
  const [is, setIs] = React.useState(() => typeof window !== "undefined" && window.matchMedia(`(max-width: ${breakpoint}px)`).matches);
  React.useEffect(() => {
    const mq = window.matchMedia(`(max-width: ${breakpoint}px)`);
    const upd = () => setIs(mq.matches);
    upd();
    mq.addEventListener ? mq.addEventListener("change", upd) : mq.addListener(upd);
    return () => mq.removeEventListener ? mq.removeEventListener("change", upd) : mq.removeListener(upd);
  }, [breakpoint]);
  return is;
};

const CDNav = () => {
  const [open, setOpen] = React.useState(false);
  const isMobile = useIsMobile(900);
  React.useEffect(() => {
    document.body.style.overflow = open ? "hidden" : "";
    const onEsc = (e) => { if (e.key === "Escape") setOpen(false); };
    if (open) window.addEventListener("keydown", onEsc);
    return () => { document.body.style.overflow = ""; window.removeEventListener("keydown", onEsc); };
  }, [open]);
  React.useEffect(() => { if (!isMobile) setOpen(false); }, [isMobile]);

  const togglerStyle = {
    display: "inline-flex", alignItems: "center", gap: 8,
    background: "var(--ink)", color: "var(--cream)",
    border: 0, borderRadius: 8,
    padding: "10px 16px", minHeight: 44, minWidth: 44,
    fontFamily: "var(--mono)", fontSize: 12, letterSpacing: "0.08em", textTransform: "uppercase",
    cursor: "pointer", touchAction: "manipulation",
    WebkitTapHighlightColor: "transparent"
  };

  return (
    <header role="banner" style={{
      position: "sticky", top: 0, zIndex: 50,
      background: "rgba(250,246,236,0.96)", backdropFilter: "blur(12px)",
      borderBottom: "1px solid var(--rule)"
    }}>
      <a href="#main" className="skip-link">Skip to main content</a>
      <div className="container" style={{
        display: "flex", alignItems: "center", justifyContent: "space-between",
        padding: "12px 0", gap: 12
      }}>
        <a href="Criminal Defense.html" style={{ display: "flex", flexShrink: 0 }} aria-label="Land of Enchantment Law — home">
          <LogoHorizontal height={isMobile ? 26 : 32}/>
        </a>

        {/* Desktop nav — JS-gated so it disappears on mobile */}
        {!isMobile && (
          <nav aria-label="Primary" style={{ display: "flex", gap: 22, alignItems: "center", fontSize: 13 }}>
            {CD_NAV.map((n, i) => n.type === "group"
              ? <NavDropdown key={n.label} label={n.label} items={n.items}/>
              : <a key={n.href} href={n.href} className="nav-a">{n.label}</a>
            )}
            <a href="tel:+15055851235" className="btn-primary" aria-label="Call 505-585-1235">
              <svg width="11" height="11" viewBox="0 0 12 12" fill="none" aria-hidden="true" style={{ marginRight: 6 }}>
                <path d="M2 2 Q2 8 10 10 L11 8 L8 7 L7 9 L3 5 L5 4 L4 1 L2 2 Z" fill="currentColor" opacity="0.9"/>
              </svg>
              505.585.1235
            </a>
          </nav>
        )}

        {/* Mobile cluster — Call icon + Menu button */}
        {isMobile && (
          <div style={{ display: "flex", gap: 8, alignItems: "center" }}>
            <a href="tel:+15055851235" aria-label="Call 505-585-1235" style={{
              display: "inline-flex", alignItems: "center", justifyContent: "center",
              background: "var(--sun)", color: "var(--ink)",
              width: 44, height: 44, borderRadius: 8, textDecoration: "none",
              fontWeight: 600,
              WebkitTapHighlightColor: "transparent"
            }}>
              <svg width="18" height="18" viewBox="0 0 18 18" fill="none" aria-hidden="true">
                <path d="M3 3 Q3 12 15 15 L17 12 L13 11 L11 13 L5 7 L7 5 L6 1 L3 3 Z" fill="currentColor"/>
              </svg>
            </a>
            <button type="button"
                    aria-expanded={open} aria-controls="mobile-drawer" aria-label="Open menu"
                    onClick={() => setOpen(true)}
                    style={togglerStyle}>
              <svg width="18" height="14" viewBox="0 0 18 14" fill="none" aria-hidden="true">
                <path d="M1 1h16M1 7h16M1 13h16" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round"/>
              </svg>
              Menu
            </button>
          </div>
        )}
      </div>

      {/* Drawer */}
      {open && isMobile && (
        <div id="mobile-drawer" role="dialog" aria-modal="true" aria-label="Site navigation"
             style={{
               position: "fixed", inset: 0, zIndex: 300,
               background: "var(--paper)",
               padding: "20px 20px 32px",
               display: "flex", flexDirection: "column", gap: 14,
               overflowY: "auto"
             }}>
          <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 4 }}>
            <LogoHorizontal height={28}/>
            <button type="button" aria-label="Close menu" onClick={() => setOpen(false)}
                    style={{
                      display: "inline-flex", alignItems: "center", justifyContent: "center",
                      width: 44, height: 44, borderRadius: 8,
                      background: "var(--ink)", color: "var(--cream)", border: 0,
                      cursor: "pointer", touchAction: "manipulation",
                      WebkitTapHighlightColor: "transparent"
                    }}>
              <svg width="18" height="18" viewBox="0 0 18 18" fill="none" aria-hidden="true">
                <path d="M3 3 L15 15 M15 3 L3 15" stroke="currentColor" strokeWidth="2" strokeLinecap="round"/>
              </svg>
            </button>
          </div>

          {/* Grouped mobile nav with section headers */}
          <nav aria-label="Primary mobile" style={{ marginTop: 4, display: "flex", flexDirection: "column", gap: 18 }}>
            {CD_NAV.map((n, gi) => n.type === "link" ? (
              <a key={n.href} href={n.href} onClick={() => setOpen(false)}
                 style={{
                   fontFamily: "var(--serif)", fontSize: 28, lineHeight: 1.15,
                   color: "var(--ink)", textDecoration: "none",
                   padding: "12px 4px", borderBottom: "1px solid var(--rule)",
                   display: "flex", justifyContent: "space-between", alignItems: "center",
                   minHeight: 56,
                   WebkitTapHighlightColor: "transparent"
                 }}>
                <span>{n.label}</span>
                <svg width="14" height="14" viewBox="0 0 12 12" fill="none" aria-hidden="true">
                  <path d="M2 6 L10 6 M7 3 L10 6 L7 9" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
                </svg>
              </a>
            ) : (
              <div key={n.label}>
                <div style={{
                  fontFamily: "var(--mono)", fontSize: 10, letterSpacing: "0.14em", textTransform: "uppercase",
                  color: "var(--sun-text)", padding: "8px 4px 4px"
                }}>{n.label}</div>
                {n.items.map(it => (
                  <a key={it.href} href={it.href} onClick={() => setOpen(false)}
                     style={{
                       display: "flex", justifyContent: "space-between", alignItems: "baseline", gap: 12,
                       padding: "14px 4px", borderBottom: "1px solid var(--rule)",
                       textDecoration: "none", color: "var(--ink)",
                       minHeight: 56,
                       WebkitTapHighlightColor: "transparent"
                     }}>
                    <span style={{ fontFamily: "var(--serif)", fontSize: 24, lineHeight: 1.15 }}>{it.label}</span>
                    {it.sub && <span style={{ fontSize: 11, fontFamily: "var(--mono)", color: "var(--ink-soft)", letterSpacing: "0.02em", textAlign: "right" }}>{it.sub}</span>}
                  </a>
                ))}
              </div>
            ))}
          </nav>

          <a href="tel:+15055851235" aria-label="Call 505-585-1235"
             style={{
               marginTop: 12,
               display: "inline-flex", alignItems: "center", justifyContent: "center", gap: 10,
               background: "var(--sun)", color: "var(--ink)",
               padding: "16px 24px", borderRadius: 10,
               textDecoration: "none", fontWeight: 600, fontSize: 17,
               minHeight: 56,
               WebkitTapHighlightColor: "transparent"
             }}>
            <svg width="18" height="18" viewBox="0 0 18 18" fill="none" aria-hidden="true">
              <path d="M3 3 Q3 12 15 15 L17 12 L13 11 L11 13 L5 7 L7 5 L6 1 L3 3 Z" fill="currentColor"/>
            </svg>
            Call 505.585.1235
          </a>
          <a href="mailto:office@landofenchantment.law"
             style={{
               display: "inline-flex", alignItems: "center", justifyContent: "center",
               border: "1px solid var(--rule-strong)", color: "var(--ink)",
               padding: "14px 24px", borderRadius: 10,
               textDecoration: "none", fontSize: 15,
               minHeight: 52,
               WebkitTapHighlightColor: "transparent"
             }}>
            office@landofenchantment.law
          </a>
        </div>
      )}
    </header>
  );
};

// City switcher — sits at the top of body
const CitySwitcher = ({ city, setCity }) => (
  <div style={{ background: "var(--cream-2)", borderBottom: "1px solid var(--rule)" }}>
    <div className="container" style={{ padding: "12px 32px", display: "flex", alignItems: "center", gap: 16, flexWrap: "wrap", justifyContent: "space-between" }}>
      <div style={{ display: "flex", alignItems: "center", gap: 10, flexWrap: "wrap" }}>
        <span className="mono-label" style={{ fontSize: 10, opacity: 0.65, marginRight: 6 }}>VIEWING</span>
        <button type="button" className="city-pill" aria-pressed={city === "abq"} onClick={() => setCity("abq")}>
          <span className="dot"/>Albuquerque
        </button>
        <button type="button" className="city-pill" aria-pressed={city === "lc"} onClick={() => setCity("lc")}>
          <span className="dot"/>Las Cruces
        </button>
        <button type="button" className="city-pill" aria-pressed={city === "sf"} onClick={() => setCity("sf")}>
          <span className="dot"/>Santa Fe
        </button>
      </div>
      <div style={{ fontSize: 12, color: "var(--ink-soft)", fontFamily: "var(--mono)", letterSpacing: "0.06em" }}>
        Page details swap to match your district → 
      </div>
    </div>
  </div>
);

const CDHero = ({ city }) => {
  const c = CITIES[city];
  return (
    <section id="top" style={{ padding: "72px 0 64px", borderBottom: "1px solid var(--rule)" }}>
      <div className="container grid-2" style={{ display: "grid", gridTemplateColumns: "1.35fr 1fr", gap: 56, alignItems: "end" }}>
        <div>
          <div className="mono-label" style={{ fontSize: 12, color: "var(--sun)", marginBottom: 24 }}>
            <span className="dot" style={{ marginRight: 10 }}/>CRIMINAL DEFENSE · NEW MEXICO · ALBUQUERQUE · LAS CRUCES · SANTA FE
          </div>
          <h1 className="serif" style={{
            fontSize: "clamp(56px, 7.2vw, 108px)", lineHeight: 1.02, letterSpacing: "-0.02em",
            margin: 0, color: "var(--ink)"
          }}>
            Charged in&nbsp;<em style={{ color: "var(--sun)" }}>New Mexico?</em> A former NM prosecutor, defending you in&nbsp;{c.name}.
          </h1>
          <p className="serif" style={{
            fontSize: 22, lineHeight: 1.45, fontStyle: "italic",
            color: "var(--ink-soft)", margin: "36px 0 32px", maxWidth: 640
          }}>
            Johnn Osborn spent over a decade as an Assistant District Attorney in New Mexico — rising to {c.role} of the {c.roleYears}. He now defends people in the same courthouses, with offices in Albuquerque and Las Cruces and active practice in the 1st JDC (Santa Fe).
          </p>
          <div style={{ display: "flex", gap: 14, flexWrap: "wrap", alignItems: "center" }}>
            <a href="tel:+15055851235" className="btn-primary lg">
              Call 505.585.1235
            </a>
            <a href="mailto:office@landofenchantment.law" className="btn-ghost lg">office@landofenchantment.law</a>
          </div>
          <div style={{ marginTop: 32, display: "flex", gap: 18, fontSize: 13, color: "var(--ink-soft)", flexWrap: "wrap", alignItems: "center" }}>
            <span><strong style={{ color: "var(--ink)" }}>Free consultation</strong></span>
            <span>·</span>
            <span>Arrest emergencies</span>
            <span>·</span>
            <span>Flat-fee + payment plans</span>
            <span>·</span>
            <span>NM &amp; TX licensed</span>
          </div>
        </div>

        {/* Right-side credential panel */}
        <aside style={{
          background: "var(--ink)", color: "var(--cream)",
          padding: "36px 32px", position: "relative"
        }}>
          <div className="mono-label" style={{ fontSize: 10, color: "var(--sun-soft)", marginBottom: 18 }}>THE PROSECUTOR'S EDGE</div>
          <div style={{ display: "grid", gridTemplateColumns: "auto 1fr", gap: "12px 18px", alignItems: "baseline" }}>
            <span className="numeric serif" style={{ fontSize: 42, lineHeight: 1, color: "var(--sun-soft)" }}>11</span>
            <span style={{ fontSize: 13, lineHeight: 1.4 }}>years as an Assistant DA — 1st & 2nd Judicial Districts, 2010–2021</span>
            <span className="numeric serif" style={{ fontSize: 42, lineHeight: 1, color: "var(--sun-soft)" }}>2</span>
            <span style={{ fontSize: 13, lineHeight: 1.4 }}>states licensed — New Mexico and Texas</span>
            <span className="numeric serif" style={{ fontSize: 42, lineHeight: 1, color: "var(--sun-soft)" }}>2</span>
            <span style={{ fontSize: 13, lineHeight: 1.4 }}>NM offices — Albuquerque &amp; Las Cruces</span>
          </div>
          {c.statHero && (
            <>
              <div style={{ height: 1, background: "rgba(245,239,227,0.18)", margin: "24px 0" }}/>
              <div className="mono-label" style={{ fontSize: 10, color: "var(--sun-soft)", marginBottom: 10 }}>{c.name.toUpperCase()} TODAY</div>
              <div style={{ display: "flex", alignItems: "baseline", gap: 14 }}>
                <span className="numeric serif" style={{ fontSize: 56, lineHeight: 1, letterSpacing: "-0.02em", color: "var(--cream)" }}>{c.statHero.k}</span>
                <span style={{ fontSize: 13, lineHeight: 1.35, opacity: 0.85, maxWidth: 200 }}>{c.statHero.v}</span>
              </div>
            </>
          )}
        </aside>
      </div>
    </section>
  );
};

// Lowrider / desert hero band — full-bleed photo with overlaid text card
const LowriderBand = ({
  headline = "From the Sandias to the Organ Mountains.",
  locations = "Offices in Albuquerque and Las Cruces. Active practice in Santa Fe and the 1st JDC.",
  reachLine = "And every county, magistrate court, and back road in between. A statewide New Mexico practice — top to bottom.",
  flatFeeLabel = "Flat-fee services",
  paymentPlansLabel = "Payment plans",
  feesBlurb = "Most matters quoted as a flat fee — you know what you'll pay before we start. Affordable monthly payment plans available so cost isn't the reason you go without a lawyer."
} = {}) => (
  <section aria-label="New Mexico — Land of Enchantment" style={{
    position: "relative", overflow: "hidden",
    minHeight: "min(80vh, 720px)",
    background: "var(--ink-deep)",
    display: "flex", alignItems: "stretch"
  }}>
    {/* Hero photo */}
    <img
      src="assets/lowrider-hero.webp"
      alt="Turquoise classic El Camino in the New Mexico desert — Land of Enchantment Law"
      loading="eager"
      fetchpriority="high"
      style={{
        position: "absolute", inset: 0,
        width: "100%", height: "100%",
        objectFit: "cover",
        objectPosition: "65% 78%",
        display: "block"
      }}
    />
    {/* Readability gradient — darker on left where the text card sits */}
    <div aria-hidden="true" style={{
      position: "absolute", inset: 0,
      background: "linear-gradient(90deg, rgba(19,74,68,0.92) 0%, rgba(19,74,68,0.78) 32%, rgba(19,74,68,0.32) 56%, rgba(19,74,68,0.05) 78%, rgba(19,74,68,0.0) 100%)"
    }}/>
    {/* Bottom fade for type below */}
    <div aria-hidden="true" style={{
      position: "absolute", left: 0, right: 0, bottom: 0, height: "30%",
      background: "linear-gradient(180deg, rgba(19,74,68,0) 0%, rgba(19,74,68,0.55) 100%)"
    }}/>

    {/* Text card */}
    <div className="container" style={{ position: "relative", padding: "80px 32px", display: "grid", gridTemplateColumns: "minmax(0, 560px) 1fr", gap: 40, alignItems: "center", width: "100%" }}>
      <div style={{ color: "var(--cream)" }}>
        <div className="mono-label" style={{ fontSize: 11, color: "var(--sun-soft)", marginBottom: 18 }}>NEW MEXICO · LAND OF ENCHANTMENT</div>
        <h2 className="serif" style={{
          fontSize: "clamp(36px, 5vw, 64px)", margin: "0 0 18px",
          lineHeight: 1.02, letterSpacing: "-0.02em",
          color: "var(--cream)",
          textShadow: "0 2px 24px rgba(0,0,0,0.35)"
        }}>
          {headline}
        </h2>
        <p style={{ fontSize: 17, lineHeight: 1.6, color: "var(--cream)", margin: "0 0 10px", maxWidth: 520, fontWeight: 500, textShadow: "0 1px 12px rgba(0,0,0,0.4)" }}>
          {locations}
        </p>
        <p style={{ fontSize: 15.5, lineHeight: 1.6, color: "rgba(245,239,227,0.88)", margin: "0 0 22px", maxWidth: 520, textShadow: "0 1px 12px rgba(0,0,0,0.4)" }}>
          {reachLine}
        </p>
        <div style={{ display: "flex", gap: 10, flexWrap: "wrap", marginBottom: 14 }}>
          <a href="Fees.html" aria-label="See flat-fee services" style={{
            fontSize: 11, fontFamily: "var(--mono)", letterSpacing: "0.06em", textTransform: "uppercase",
            padding: "8px 14px", borderRadius: 999,
            background: "var(--sun)", color: "var(--ink)", fontWeight: 600,
            textDecoration: "none",
            display: "inline-flex", alignItems: "center", gap: 6,
            transition: "transform .15s, box-shadow .15s",
            WebkitTapHighlightColor: "transparent"
          }}
          onMouseEnter={e => { e.currentTarget.style.transform = "translateY(-1px)"; e.currentTarget.style.boxShadow = "0 6px 18px rgba(0,0,0,0.18)"; }}
          onMouseLeave={e => { e.currentTarget.style.transform = "none"; e.currentTarget.style.boxShadow = "none"; }}>
            {flatFeeLabel}
            <svg width="10" height="10" viewBox="0 0 12 12" fill="none" aria-hidden="true">
              <path d="M2 6 L10 6 M7 3 L10 6 L7 9" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/>
            </svg>
          </a>
          <a href="Fees.html#expungement" aria-label="See payment plan options" style={{
            fontSize: 11, fontFamily: "var(--mono)", letterSpacing: "0.06em", textTransform: "uppercase",
            padding: "8px 14px", borderRadius: 999,
            background: "rgba(245,239,227,0.18)", color: "var(--cream)",
            border: "1px solid rgba(245,239,227,0.4)",
            backdropFilter: "blur(6px)",
            textDecoration: "none",
            display: "inline-flex", alignItems: "center", gap: 6,
            WebkitTapHighlightColor: "transparent"
          }}>
            {paymentPlansLabel}
            <svg width="10" height="10" viewBox="0 0 12 12" fill="none" aria-hidden="true">
              <path d="M2 6 L10 6 M7 3 L10 6 L7 9" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/>
            </svg>
          </a>
        </div>
        <p style={{ fontSize: 13.5, lineHeight: 1.55, color: "rgba(245,239,227,0.82)", margin: 0, maxWidth: 520, textShadow: "0 1px 8px rgba(0,0,0,0.4)" }}>
          {feesBlurb}
        </p>
      </div>
      <div/>
    </div>
  </section>
);

// "Why a former prosecutor" — full section
const ProsecutorEdge = ({ city }) => {
  const c = CITIES[city];
  return (
    <section style={{ padding: "96px 0", background: "var(--paper)" }}>
      <div className="container">
        <div style={{ display: "flex", alignItems: "baseline", gap: 16, marginBottom: 18, flexWrap: "wrap" }}>
          <span className="mono-label" style={{ fontSize: 11, color: "var(--sun)" }}>01 · WHY A FORMER PROSECUTOR</span>
          <h2 className="serif" style={{ fontSize: "clamp(40px, 5vw, 64px)", margin: 0, lineHeight: 1, letterSpacing: "-0.01em" }}>
            The vantage point matters.
          </h2>
        </div>
        <p className="serif" style={{ fontSize: 20, lineHeight: 1.45, fontStyle: "italic", color: "var(--ink-soft)", margin: "0 0 56px", maxWidth: 820 }}>
          Most defense lawyers learned criminal law from the defense side. What they have not done is sit in the prosecutor's office when charging decisions get made. Johnn has.
        </p>

        <div style={{ display: "grid", gridTemplateColumns: "1.05fr 1fr 1fr", gap: 24 }} className="grid-3">
          {[
            { k: "Spots weak charges", v: "He moves to dismiss the inflated counts prosecutors throw in to pump up plea leverage — early, before they shape the offer." },
            { k: "Knows the evidence the State needs", v: "He knows exactly which elements the prosecution has to prove and where the gaps usually live." },
            { k: "Reads the room", v: "He understands which prosecutors negotiate, which won't, what motivates each one. He sat in those rooms for a decade." }
          ].map((b, i) => (
            <div key={i} style={{ background: "var(--cream-2)", padding: "32px 28px", border: "1px solid var(--rule)" }}>
              <div className="mono-label numeric" style={{ fontSize: 10, color: "var(--sun)", marginBottom: 16 }}>0{i + 1}</div>
              <h3 className="serif" style={{ fontSize: 26, margin: "0 0 14px", lineHeight: 1.15 }}>{b.k}</h3>
              <p style={{ fontSize: 14.5, lineHeight: 1.55, color: "var(--ink-soft)", margin: 0 }}>{b.v}</p>
            </div>
          ))}
        </div>

        <div style={{ marginTop: 56, display: "grid", gridTemplateColumns: "0.9fr 1.4fr", gap: 48, alignItems: "stretch" }} className="grid-2">
          {/* Left — portrait card with seal, name, pull quote, credential chips */}
          <div style={{ background: "var(--ink)", color: "var(--cream)", padding: "32px 30px", display: "flex", flexDirection: "column", gap: 22 }}>
            <div style={{ display: "flex", alignItems: "center", gap: 16 }}>
              <LogoSeal size={72} style={{ background: "var(--cream)", borderRadius: "50%", padding: 4 }}/>
              <div>
                <div className="mono-label" style={{ fontSize: 10, color: "var(--sun-soft)", marginBottom: 4 }}>JOHNN OSBORN</div>
                <div className="serif" style={{ fontSize: 22, lineHeight: 1.05, color: "var(--cream)" }}>Founding Attorney</div>
                <div style={{ fontSize: 11, fontFamily: "var(--mono)", letterSpacing: "0.06em", color: "rgba(245,239,227,0.6)", marginTop: 4 }}>NM &amp; TX BAR</div>
              </div>
            </div>

            <div style={{ height: 1, background: "rgba(245,239,227,0.18)" }}/>

            <blockquote style={{ margin: 0, fontFamily: "var(--serif)", fontSize: 22, lineHeight: 1.4, fontStyle: "italic", color: "var(--cream)" }}>
              <span style={{ color: "var(--sun-soft)", fontSize: 36, lineHeight: 0, position: "relative", top: 8, marginRight: 4 }}>“</span>
              I built these cases for the State for eleven years. Now I take them apart for the people they're filed against.
            </blockquote>

            <div style={{ marginTop: "auto" }}>
              <div className="mono-label" style={{ fontSize: 10, color: "var(--sun-soft)", marginBottom: 10 }}>CREDENTIALS</div>
              <div style={{ display: "flex", flexWrap: "wrap", gap: 6 }}>
                {[
                  "Chief Deputy DA · 1st JDA",
                  "Deputy DA · 2nd JDA",
                  "Chair, NM Bar Historical Committee",
                  "Cannabis Law Section (past)",
                  "Bar Ethics Committee (past)",
                  "Criminal Defense Lawyers Assn."
                ].map(c => (
                  <span key={c} style={{
                    fontSize: 11, fontFamily: "var(--mono)", letterSpacing: "0.04em",
                    padding: "5px 10px", borderRadius: 999,
                    border: "1px solid rgba(245,239,227,0.22)",
                    color: "rgba(245,239,227,0.88)"
                  }}>{c}</span>
                ))}
              </div>
            </div>
          </div>

          {/* Right — bio rows */}
          <div style={{ background: "var(--cream-2)", padding: "32px 32px", border: "1px solid var(--rule)" }}>
            <div className="mono-label" style={{ fontSize: 10, color: "var(--sun)", marginBottom: 14 }}>BIO · ELEVEN YEARS INSIDE</div>
            <h3 className="serif" style={{ fontSize: 32, margin: "0 0 24px", lineHeight: 1.05, letterSpacing: "-0.01em" }}>
              Now across the aisle.
            </h3>
            <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 14 }}>
              {[
                ["2010–2021", "Assistant District Attorney, 1st & 2nd Judicial District Attorney's Offices — rising to Chief Deputy DA (1st JDA, Santa Fe) and Deputy DA (2nd JDA, Albuquerque)."],
                ["Now", "Private practice — Land of Enchantment Law. Criminal defense, expungement, NIL, and small-business law across NM."],
                ["Licensure", "New Mexico and Texas. Practice in 1st, 2nd & 3rd JDC, magistrate and metropolitan courts statewide."],
                ["Philosophy", "Championed treatment-focused and diversion-based programs as a senior prosecutor — that perspective on second chances shapes how he handles every case where the right outcome is more than just winning at trial."]
              ].map(([k, v], i) => (
                <li key={i} style={{ display: "grid", gridTemplateColumns: "110px 1fr", gap: 20, paddingBottom: 14, borderBottom: i === 3 ? "none" : "1px solid var(--rule)" }}>
                  <span className="mono-label" style={{ fontSize: 10, color: "var(--sun)", letterSpacing: "0.1em" }}>{k}</span>
                  <span style={{ fontSize: 14.5, lineHeight: 1.55, color: "var(--ink)" }}>{v}</span>
                </li>
              ))}
            </ul>
          </div>
        </div>
      </div>
    </section>
  );
};

// Local hotspots band — varies by city
const LocalLandscape = ({ city }) => {
  const c = CITIES[city];
  return (
    <section style={{ padding: "80px 0", background: "var(--ink)", color: "var(--cream)" }}>
      <div className="container">
        <div style={{ display: "flex", alignItems: "baseline", gap: 16, marginBottom: 36, flexWrap: "wrap" }}>
          <span className="mono-label" style={{ fontSize: 11, color: "var(--sun-soft)" }}>02 · ON THE GROUND · {c.name.toUpperCase()}</span>
          <h2 className="serif" style={{ fontSize: "clamp(36px, 4.5vw, 56px)", margin: 0, lineHeight: 1, letterSpacing: "-0.01em", color: "var(--cream)" }}>
            {c.landscapeH}
          </h2>
        </div>
        <div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 24 }} className="grid-4">
          {c.hot.map((h, i) => (
            <div key={i} style={{ borderLeft: "1px solid rgba(245,239,227,0.25)", paddingLeft: 22 }}>
              <div className="mono-label numeric" style={{ fontSize: 10, color: "var(--sun-soft)", marginBottom: 10 }}>0{i + 1}</div>
              <div className="serif" style={{ fontSize: 22, lineHeight: 1.15, marginBottom: 10, color: "var(--cream)" }}>{h.k}</div>
              <div style={{ fontSize: 13.5, lineHeight: 1.55, opacity: 0.82 }}>{h.v}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
};

Object.assign(window, { CDNav, CitySwitcher, CDHero, LowriderBand, ProsecutorEdge, LocalLandscape });
