// ─────────────────────────────────────────────────────────────
// Extra data — for discovery, joining, viral leaves, DMs.
// Sits alongside ForestData.jsx (which contains YOUR_FORESTS,
// PHILOSOPHY_ROOTS, etc).
// ─────────────────────────────────────────────────────────────


// ─── Discovery: public forests beyond the user's own ───
// Sized to demonstrate that the directory is genuinely large; we always
// expose a paginated subset, never the whole list.

const DISCOVER_TOPICS = [
  { id: 't_local',   label: 'Local',      hint: 'within ~3 mi' },
  { id: 't_book',    label: 'Books',      hint: 'reading rooms' },
  { id: 't_tech',    label: 'Tech',       hint: 'craft & work' },
  { id: 't_outdoor', label: 'Outdoors',   hint: 'trails, miles' },
  { id: 't_food',    label: 'Food',       hint: 'recipes & seats' },
  { id: 't_music',   label: 'Music',      hint: 'venues + listening' },
  { id: 't_civic',   label: 'Civic',      hint: 'where you live' },
  { id: 't_art',     label: 'Art',        hint: 'studios + shows' },
];

const DISCOVER_FORESTS = [
  // Open — single-tap join
  { id: 'd1', name: 'Long-distance Cycling', topic: 't_outdoor', members: 412,  growing: 11, activeNow: 7,
    kind: 'public', join: 'open', blurb: 'open to anyone with two wheels and a long road.',
    distanceMi: 0.4, mutualFolk: 2, signal: 'rising' },
  { id: 'd2', name: 'Slow Cooking', topic: 't_food', members: 1_840, growing: 24, activeNow: 18,
    kind: 'public', join: 'open', blurb: 'recipes, kitchens, weekend pots.',
    distanceMi: 1.1, mutualFolk: 4, signal: 'steady' },
  { id: 'd3', name: 'Mission Bay Walks', topic: 't_local', members: 96,  growing: 3,  activeNow: 1,
    kind: 'public', join: 'open', blurb: 'pace, paths, the weather as it happens.',
    distanceMi: 0.2, mutualFolk: 0, signal: 'quiet' },

  // Moderated — request to join
  { id: 'd4', name: 'Software & Web', topic: 't_tech', members: 2_104, growing: 41, activeNow: 28,
    kind: 'public', join: 'moderated', blurb: 'verified developers and engineers.',
    distanceMi: null, mutualFolk: 6, signal: 'rising' },
  { id: 'd5', name: 'Indie Film', topic: 't_art', members: 432, growing: 9, activeNow: 4,
    kind: 'invite', join: 'moderated', blurb: 'screenings, scripts, half-formed reviews. referral preferred.',
    distanceMi: null, mutualFolk: 1, signal: 'steady' },
  { id: 'd6', name: 'Civic Notes · SF', topic: 't_civic', members: 712, growing: 7, activeNow: 3,
    kind: 'public', join: 'moderated', blurb: 'planning, housing, the long view.',
    distanceMi: 1.4, mutualFolk: 2, signal: 'quiet' },

  // Invite-only — referral required
  { id: 'd7', name: 'Listening Room', topic: 't_music', members: 84,  growing: 2,  activeNow: 1,
    kind: 'invite', join: 'referral', blurb: 'one record a week. introductions only.',
    distanceMi: null, mutualFolk: 0, signal: 'quiet' },
];

const DISCOVER_COUNT_TOTAL = 12_482;  // for "X more forests" display


// ─── Viral leaves — for the reddit-style separate view ───
// A "leaf" is a deep reply; "viral" means high velocity (leaves/hour over
// the last ~6h normalized to forest size). Each entry carries enough
// context to be readable out of its forest.

const VIRAL_LEAVES = [
  {
    id: 'v1',
    forest: 'Philosophy', kind: 'public',
    rootHandle: 'acorn-37',
    rootSnippet: 'Is there such a thing as a moral fact, or is morality always relative to the thinker?',
    branchHandle: 'leaf-902', branchAge: '4m',
    branch: 'Same was true of physical claims before we agreed on measurement. Doesn\'t mean they aren\'t facts.',
    branches: 11, leaves: 38, sunlight: 142, velocity: '+38/h',
    depth: 2, signal: 'hot',
  },
  {
    id: 'v2',
    forest: 'BART Riders', kind: 'public',
    rootHandle: 'commute-bri',
    rootSnippet: 'Anyone else notice the 16th-St platform has gotten quieter since the new signs?',
    branchHandle: 'fern-12', branchAge: '11m',
    branch: 'I think the new wayfinding pulls the morning crowd to the rear cars. The platform feels emptied because we\'re now distributed along the train.',
    branches: 4, leaves: 21, sunlight: 87, velocity: '+22/h',
    depth: 1, signal: 'rising',
  },
  {
    id: 'v3',
    forest: 'Slow Reading', kind: 'invite',
    rootHandle: 'birch-7',
    rootSnippet: 'On chapter 4 of Middlemarch — Dorothea\'s house, the cold. Anyone want to land on a Sunday?',
    branchHandle: 'oakling', branchAge: '19m',
    branch: 'I read it last week. Eliot doesn\'t describe the cold so much as the way the house refuses to warm Dorothea. There\'s a difference.',
    branches: 2, leaves: 14, sunlight: 64, velocity: '+14/h',
    depth: 1, signal: 'rising',
  },
  {
    id: 'v4',
    forest: 'SF', kind: 'public',
    rootHandle: 'tulip-aa',
    rootSnippet: 'The Mission has been beautiful this week. Light on the murals around 6pm.',
    branchHandle: 'marina_k', branchAge: '34m',
    branch: 'It\'s the angle. May light hits the Balmy Alley faces broadside for about 40 minutes. Best photographed on the east-facing wall.',
    branches: 1, leaves: 9, sunlight: 51, velocity: '+9/h',
    depth: 1, signal: 'steady',
  },
  {
    id: 'v5',
    forest: 'Philosophy', kind: 'public',
    rootHandle: 'samh',
    rootSnippet: 'What if "free will" is just the residue we leave when we stop watching ourselves choose?',
    branchHandle: 'fern-12', branchAge: '52m',
    branch: 'You\'re sneaking a self-model into the description of the self. The watcher and the chooser collapse if you let them.',
    branches: 6, leaves: 18, sunlight: 47, velocity: '+7/h',
    depth: 2, signal: 'steady',
  },
  {
    id: 'v6',
    forest: 'Indie Film', kind: 'invite',
    rootHandle: 'oakling',
    rootSnippet: 'Saw a 90-minute documentary about a man who paints fences. It was perfect.',
    branchHandle: 'samh', branchAge: '1h',
    branch: 'Was it Boniface? I keep getting recommendations for that one. Curious whether the slowness lands or feels withheld.',
    branches: 0, leaves: 5, sunlight: 22, velocity: '+5/h',
    depth: 1, signal: 'quiet',
  },
];


// ─── DM threads — for the Folk + DM integration variants ───
// One thread per Folk handle. Most recent message bubbles up into
// the profile preview.

const DM_THREADS = {
  marina_k: {
    handle: 'marina_k',
    unread: 3,
    lastSenderIsThem: true,
    lastAge: '14m',
    preview: 'Maecenas tempus, tellus eget condimentum rhoncus — but also, do you want to grab coffee Saturday?',
    messages: [
      { id: 'm1', who: 'you',  age: '1d',  body: 'How did the talk go on Friday?' },
      { id: 'm2', who: 'them', age: '23h', body: 'Better than I expected. They were a kinder room than I\'d feared.' },
      { id: 'm3', who: 'you',  age: '22h', body: 'You always say that and it always lands. Stop pre-mourning your own talks.' },
      { id: 'm4', who: 'them', age: '14m', body: 'Maecenas tempus, tellus eget condimentum rhoncus — but also, do you want to grab coffee Saturday?' },
    ],
  },
  samh: {
    handle: 'samh',
    unread: 0,
    lastSenderIsThem: false,
    lastAge: '2h',
    preview: 'I planted a root in Philosophy that I think you\'ll like.',
    messages: [
      { id: 'm1', who: 'them', age: '6h', body: 'Are you reading anything you\'d branch on?' },
      { id: 'm2', who: 'you',  age: '5h', body: 'Re-reading Parfit. Slowly.' },
      { id: 'm3', who: 'them', age: '4h', body: 'You know I\'ll bite at that.' },
      { id: 'm4', who: 'you',  age: '2h', body: 'I planted a root in Philosophy that I think you\'ll like.' },
    ],
  },
  'leaf-902': {
    handle: 'leaf-902',
    unread: 1,
    lastSenderIsThem: true,
    lastAge: '5h',
    preview: 'Re your branch — I want to push back on the cultural-divergence point.',
    messages: [
      { id: 'm1', who: 'them', age: '5h', body: 'Re your branch — I want to push back on the cultural-divergence point. Most of those examples are about measurement, not values.' },
    ],
  },
  'oakling': {
    handle: 'oakling',
    unread: 0,
    lastSenderIsThem: false,
    lastAge: '2d',
    preview: 'Thanks for the Middlemarch nudge — picked it up.',
    messages: [
      { id: 'm1', who: 'them', age: '3d', body: 'You\'re reading slow lately?' },
      { id: 'm2', who: 'you',  age: '2d', body: 'Thanks for the Middlemarch nudge — picked it up.' },
    ],
  },
};


// ─── Members of a forest, for the join/preview screens ───
const PHILOSOPHY_MEMBERS_PREVIEW = [
  { handle: 'acorn-37',  rel: 'friend' },
  { handle: 'fern-12',   rel: 'stranger' },
  { handle: 'samh',      rel: 'friend' },
  { handle: 'oakling',   rel: 'acquaintance' },
  { handle: 'birch-7',   rel: 'friend' },
  { handle: 'tulip-aa',  rel: 'stranger' },
  { handle: 'marina_k',  rel: 'acquaintance' },
];


// ─── Topic vibes — used by create-forest visualization ───
const FOREST_VIBES = [
  { id: 'study',   label: 'Study Hall',   serif: 'quiet, slow, deep',  hue: '#5E8048' },
  { id: 'plaza',   label: 'Plaza',        serif: 'busy, public, bright', hue: '#D4960C' },
  { id: 'salon',   label: 'Salon',        serif: 'small, sharp, opinionated', hue: '#A8C5A0' },
  { id: 'campfire',label: 'Campfire',     serif: 'warm, slow, returning', hue: '#7A4F2D' },
];


Object.assign(window, {
  DISCOVER_TOPICS, DISCOVER_FORESTS, DISCOVER_COUNT_TOTAL,
  VIRAL_LEAVES, DM_THREADS, PHILOSOPHY_MEMBERS_PREVIEW, FOREST_VIBES,
});
