// shared.jsx — palette, data, and shared atoms used across all 3 variations.

// ── Palette ─────────────────────────────────────────────────────────────
// Lifted from the Nilar Campus screenshot. Deep plum-black ground with
// violet primary, electric blue secondary, moss/teal accent used sparingly.
const P1686 = {
  bg:        '#08050f',  // deepest plum-black
  bg2:       '#0d0817',  // section alt
  surface:   '#130b22',  // card
  surfaceHi: '#1a1230',  // elev card
  line:      'rgba(244,241,255,0.08)',
  lineHi:    'rgba(244,241,255,0.14)',
  text:      '#f4f1ff',
  muted:     'rgba(244,241,255,0.55)',
  mute2:     'rgba(244,241,255,0.35)',
  violet:    '#8b5cf6',
  violetHi:  '#a98aff',
  blue:      '#6a8aff',
  blueHi:    '#9bb1ff',
  moss:      '#6bbe9c',
};

// ── Holdings data ───────────────────────────────────────────────────────
const HOLDINGS = [
  {
    key: 'nilar',
    name: 'NILAR',
    wordmark: 'NILAR',
    tag: 'The trust layer for NIL.',
    desc: 'Verified-athlete reviews and AI-graded deal safety scoring for the unregulated NIL economy.',
    sector: 'Compliance & Trust',
    stake: '1686 portfolio',
    year: '2023',
    href: 'https://nilartech.com',
  },
  {
    key: 'signaladvisor',
    name: 'SignalAdvisor',
    wordmark: 'SIGNAL/ADVISOR',
    tag: 'Decision intelligence for advisors.',
    desc: 'A working surface for mid-market professional service firms. Research, drafting, and client-ready output in one pane.',
    sector: 'Professional Services',
    stake: '1686 portfolio',
    year: '2024',
    href: '#',
  },
  {
    key: 'boe',
    name: 'BOE',
    wordmark: 'BAG OF ENGINES',
    tag: 'Composable runtime for agentic systems.',
    desc: 'Interoperable model and tool runtime. One contract, every engine, built for teams shipping production agents.',
    sector: 'Developer Infrastructure',
    stake: '1686 portfolio',
    year: '2024',
    href: 'https://boe.higher.archi/',
  },
  {
    key: 'golfouting',
    name: 'GolfOuting',
    wordmark: 'GOLF · OUTING',
    tag: 'The right course for your group.',
    desc: 'A matching platform for group golf events. Organizers submit one request and receive responses from courses sized to their group, date, location, and budget.',
    sector: 'Hospitality',
    stake: '1686 portfolio',
    year: '2025',
    href: 'https://golfouting.vercel.app/',
  },
];

// Leadership — sourced from user. Locations are reasonable defaults;
// happy to correct once confirmed.
const PRINCIPALS = [
  {
    initials: 'HW',
    name: 'Hal Wilkins',
    role: 'CEO & Founder',
    loc: '—',
    bio: 'Thirty-year software veteran. Technical sales leader at FICO and MuleSoft. Founder operator across the portfolio.',
    tags: ['FICO', 'MuleSoft', 'Founder'],
  },
  {
    initials: 'KW',
    name: 'Kamau Washington',
    role: 'CTO',
    loc: '—',
    bio: 'Twenty-five-year software veteran. Principal enterprise software architect at AWS. Prior: FICO, Koch, Georgia-Pacific, Delta.',
    tags: ['AWS', 'FICO', 'Delta'],
  },
  {
    initials: 'DC',
    name: 'Delwayne Compton',
    role: 'VP, Agentic Engineering',
    loc: '—',
    bio: 'Nineteen-year software veteran. Lead engineer across Azure and AWS. Previously Cable One, MuleSoft, and Salesforce.',
    tags: ['AWS', 'Azure', 'Salesforce'],
  },
  {
    initials: 'RR',
    name: 'Randy Reeves',
    role: 'Advisory Board',
    loc: '—',
    bio: 'Retired thirty-year software veteran. Consultant across federal and private sector engagements.',
    tags: ['Advisory', 'Federal', 'Private'],
  },
];

// ── Sector / approach pillars ──────────────────────────────────────────
const PILLARS = [
  {
    n: '01',
    title: 'Long-hold ownership.',
    body: 'We build with operators who think in decades. The horizon is indefinite; the mandate is operating, not flipping.',
  },
  {
    n: '02',
    title: 'Service businesses, modern stack.',
    body: 'We focus where domain depth meets software leverage: advisory, infrastructure, and B2B services.',
  },
  {
    n: '03',
    title: 'Shared back office.',
    body: 'Portfolio companies share finance, recruiting, and engineering primitives so founders compound time.',
  },
];

// ── Tiny atoms ─────────────────────────────────────────────────────────

// Brand wordmark "1686" — used in nav. Variations may render their own.
function Wordmark1686({ size = 22, accent = P1686.violet, color = P1686.text }) {
  return (
    <span style={{ display: 'inline-flex', alignItems: 'baseline', gap: size * 0.25, fontWeight: 600, letterSpacing: -size * 0.02, fontSize: size, color, lineHeight: 1 }}>
      <span>1686</span>
      <span style={{ width: size * 0.18, height: size * 0.18, borderRadius: 99, background: accent, display: 'inline-block', transform: 'translateY(-2px)' }} />
    </span>
  );
}

// Abstract texture card — pure CSS gradient stand-in for real imagery.
// Three styles for variety; chosen by the company "key" so each company
// always renders with the same texture across variations.
function HoldingTexture({ which, style }) {
  const variants = {
    nilar: `
      radial-gradient(140% 90% at 100% 0%, ${P1686.violet}55 0%, transparent 55%),
      radial-gradient(120% 80% at 0% 100%, ${P1686.blue}40 0%, transparent 55%),
      radial-gradient(60% 60% at 50% 60%, #2a1850 0%, ${P1686.bg} 80%)`,
    signaladvisor: `
      linear-gradient(135deg, ${P1686.bg2} 0%, ${P1686.surface} 100%),
      repeating-linear-gradient(90deg, ${P1686.lineHi} 0 1px, transparent 1px 60px)`,
    boe: `
      conic-gradient(from 200deg at 80% 30%, ${P1686.violet}33, ${P1686.blue}33, ${P1686.bg2} 60%),
      radial-gradient(80% 80% at 20% 80%, ${P1686.moss}25 0%, transparent 60%)`,
    golfouting: `
      radial-gradient(80% 80% at 30% 30%, ${P1686.moss}35 0%, transparent 60%),
      radial-gradient(60% 60% at 80% 80%, ${P1686.violet}25 0%, transparent 60%),
      linear-gradient(180deg, ${P1686.bg2}, ${P1686.bg})`,
  };
  return (
    <div style={{
      position: 'relative',
      backgroundImage: variants[which] || variants.nilar,
      backgroundColor: P1686.bg2,
      overflow: 'hidden',
      ...style,
    }}>
      {/* subtle grain */}
      <div style={{
        position: 'absolute', inset: 0, pointerEvents: 'none', opacity: 0.6, mixBlendMode: 'overlay',
        backgroundImage: 'url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'120\' height=\'120\' viewBox=\'0 0 120 120\'><filter id=\'n\'><feTurbulence type=\'fractalNoise\' baseFrequency=\'0.9\' numOctaves=\'2\' stitchTiles=\'stitch\'/></filter><rect width=\'100%\' height=\'100%\' filter=\'url(%23n)\' opacity=\'0.5\'/></svg>")',
      }} />
    </div>
  );
}

// Arrow glyph, used in CTAs.
function Arrow({ size = 14, color = 'currentColor' }) {
  return (
    <svg width={size} height={size} viewBox="0 0 14 14" fill="none" stroke={color} strokeWidth="1.4" strokeLinecap="round">
      <path d="M2 7h10M8 3l4 4-4 4" />
    </svg>
  );
}

// Mono label — used for section eyebrows, status pills.
function MonoLabel({ children, color = P1686.muted, style }) {
  return (
    <span style={{
      fontFamily: '"JetBrains Mono", "Geist Mono", ui-monospace, monospace',
      fontSize: 11, letterSpacing: 0.12, textTransform: 'uppercase',
      color, ...style,
    }}>{children}</span>
  );
}

Object.assign(window, { P1686, HOLDINGS, PRINCIPALS, PILLARS, Wordmark1686, HoldingTexture, Arrow, MonoLabel });
