// Bird data for The Plumage Society
// Original organization name. All bird species are real & in the public domain.

const BIRDS = [
  {
    id: 'cerulean-warbler',
    common: 'Cerulean Warbler',
    latin: 'Setophaga cerulea',
    family: 'Parulidae',
    length: '11–12 cm',
    weight: '8–10 g',
    range: 'Eastern North America → Andean foothills',
    habitat: 'Mature deciduous canopy',
    status: 'Near Threatened',
    statusCode: 'NT',
    trend: '−72% since 1970',
    region: 'Americas',
    diet: 'Insectivore',
    note: 'A canopy specialist whose population has collapsed alongside the loss of contiguous old-growth forest. Males sing from the highest fork of the tallest oak, often invisible from the ground.',
    palette: ['#6e88a8', '#d8e3ec', '#2a3340'],
    plate: 1,
  },
  {
    id: 'california-condor',
    common: 'California Condor',
    latin: 'Gymnogyps californianus',
    family: 'Cathartidae',
    length: '109–140 cm',
    weight: '7–14 kg',
    range: 'California, Arizona, Baja',
    habitat: 'Cliffs, canyons, oak savanna',
    status: 'Critically Endangered',
    statusCode: 'CR',
    trend: '+560 since 1987',
    region: 'Americas',
    diet: 'Carrion',
    note: 'Down to 22 individuals in 1982; every wild condor was captured for an emergency breeding programme. Today over five hundred fly again — the population still numbered, every bird still tagged.',
    palette: ['#2b231d', '#c9a06a', '#efe6d4'],
    plate: 2,
  },
  {
    id: 'kakapo',
    common: 'Kākāpō',
    latin: 'Strigops habroptilus',
    family: 'Strigopidae',
    length: '58–64 cm',
    weight: '0.95–4 kg',
    range: 'Predator-free islands, Aotearoa',
    habitat: 'Temperate rainforest',
    status: 'Critically Endangered',
    statusCode: 'CR',
    trend: '252 individuals',
    region: 'Oceania',
    diet: 'Folivore / Frugivore',
    note: 'The world\'s heaviest parrot, and the only one that cannot fly. Males boom into earthen bowls on summer nights; the sound carries for kilometres across silent valleys.',
    palette: ['#5d6b3a', '#c8c089', '#2d2f1a'],
    plate: 3,
  },
  {
    id: 'rufous-hummingbird',
    common: 'Rufous Hummingbird',
    latin: 'Selasphorus rufus',
    family: 'Trochilidae',
    length: '7–9 cm',
    weight: '2–5 g',
    range: 'Alaska → Mexico (annual)',
    habitat: 'Meadows, forest edges',
    status: 'Near Threatened',
    statusCode: 'NT',
    trend: '−65% since 1970',
    region: 'Americas',
    diet: 'Nectarivore',
    note: 'For its size, the longest migration of any bird on Earth — a four-gram traveller that crosses the continent twice a year, navigating by stars and remembered flowers.',
    palette: ['#c2542a', '#e9c590', '#3a1f12'],
    plate: 4,
  },
  {
    id: 'snowy-owl',
    common: 'Snowy Owl',
    latin: 'Bubo scandiacus',
    family: 'Strigidae',
    length: '52–71 cm',
    weight: '1.6–2.9 kg',
    range: 'Circumpolar Arctic',
    habitat: 'Open tundra',
    status: 'Vulnerable',
    statusCode: 'VU',
    trend: '−30% since 1970',
    region: 'Arctic',
    diet: 'Carnivore',
    note: 'Diurnal among owls. Breeding success follows lemming cycles with strange precision; in irruption years they appear as far south as Bermuda, unmistakable against grey winter fields.',
    palette: ['#e8e4dd', '#7d8086', '#1f2026'],
    plate: 5,
  },
  {
    id: 'african-grey',
    common: 'African Grey Parrot',
    latin: 'Psittacus erithacus',
    family: 'Psittacidae',
    length: '33 cm',
    weight: '400 g',
    range: 'Equatorial Africa',
    habitat: 'Lowland rainforest',
    status: 'Endangered',
    statusCode: 'EN',
    trend: '−79% since 1992',
    region: 'Africa',
    diet: 'Frugivore',
    note: 'Among the most cognitively complex non-human animals studied. Wild populations have collapsed from cage-bird trapping; in some range states the species is now functionally extinct.',
    palette: ['#9a9a9a', '#c44141', '#1f1f1f'],
    plate: 6,
  },
  {
    id: 'philippine-eagle',
    common: 'Philippine Eagle',
    latin: 'Pithecophaga jefferyi',
    family: 'Accipitridae',
    length: '86–102 cm',
    weight: '4–8 kg',
    range: 'Philippine archipelago',
    habitat: 'Primary dipterocarp forest',
    status: 'Critically Endangered',
    statusCode: 'CR',
    trend: '~400 pairs',
    region: 'Asia',
    diet: 'Apex predator',
    note: 'Pair-bonded for life. A breeding pair requires up to 130 km² of intact forest; the Philippines retains less than seven percent of its original cover.',
    palette: ['#6b5132', '#e2d3b3', '#1d1610'],
    plate: 7,
  },
  {
    id: 'common-loon',
    common: 'Common Loon',
    latin: 'Gavia immer',
    family: 'Gaviidae',
    length: '66–91 cm',
    weight: '2.2–7.6 kg',
    range: 'Northern lakes, N. America',
    habitat: 'Clear glacial lakes',
    status: 'Least Concern',
    statusCode: 'LC',
    trend: 'Stable',
    region: 'Americas',
    diet: 'Piscivore',
    note: 'Solid bones rather than the hollow ones of most birds — denser than water, built for the dive. Lake acidification and shoreline development press on otherwise stable populations.',
    palette: ['#1a2030', '#e8eef2', '#6b7785'],
    plate: 8,
  },
  {
    id: 'european-roller',
    common: 'European Roller',
    latin: 'Coracias garrulus',
    family: 'Coraciidae',
    length: '29–32 cm',
    weight: '127–160 g',
    range: 'Europe, W. Asia → Africa',
    habitat: 'Open wooded steppe',
    status: 'Least Concern',
    statusCode: 'LC',
    trend: 'Recovering (EU)',
    region: 'Europe',
    diet: 'Insectivore',
    note: 'Named for the male\'s tumbling display flight. Once locally extinct across northern Europe, now recolonising abandoned orchards and field margins where pesticide use has eased.',
    palette: ['#2a6da3', '#d4a661', '#0f1f33'],
    plate: 9,
  },
  {
    id: 'spoon-billed-sandpiper',
    common: 'Spoon-billed Sandpiper',
    latin: 'Calidris pygmaea',
    family: 'Scolopacidae',
    length: '14–16 cm',
    weight: '29–34 g',
    range: 'Chukotka → SE Asia',
    habitat: 'Tidal mudflat',
    status: 'Critically Endangered',
    statusCode: 'CR',
    trend: '~210 pairs',
    region: 'Asia',
    diet: 'Insectivore',
    note: 'Fewer than five hundred individuals remain. Headstart programmes hand-rear chicks past the most vulnerable weeks; each season\'s clutch is documented bird by bird.',
    palette: ['#a8967a', '#efe7d4', '#2e2516'],
    plate: 10,
  },
  {
    id: 'wandering-albatross',
    common: 'Wandering Albatross',
    latin: 'Diomedea exulans',
    family: 'Diomedeidae',
    length: '107–135 cm',
    weight: '6–12 kg',
    range: 'Southern Ocean (circumpolar)',
    habitat: 'Open pelagic ocean',
    status: 'Vulnerable',
    statusCode: 'VU',
    trend: '−30% since 1980',
    region: 'Oceania',
    diet: 'Piscivore / Squid',
    note: 'The largest wingspan of any living bird — up to 3.5 metres. Longline fisheries are the single largest source of mortality; an estimated 100,000 albatrosses die on hooks each year.',
    palette: ['#cdd1d6', '#3b4655', '#0e1218'],
    plate: 11,
  },
  {
    id: 'piping-plover',
    common: 'Piping Plover',
    latin: 'Charadrius melodus',
    family: 'Charadriidae',
    length: '17 cm',
    weight: '43–63 g',
    range: 'Atlantic & Great Plains beaches',
    habitat: 'Dry sand, gravel shore',
    status: 'Near Threatened',
    statusCode: 'NT',
    trend: 'Recovering',
    region: 'Americas',
    diet: 'Insectivore',
    note: 'Nests in scrapes on bare beach. Volunteer wardens fence each nest from foot traffic; recovery has come bird by bird, beach by beach, summer by summer.',
    palette: ['#e8e0cf', '#c87a3e', '#2a2218'],
    plate: 12,
  },
];

const STATUS_ORDER = ['LC', 'NT', 'VU', 'EN', 'CR'];
const STATUS_LABEL = {
  LC: 'Least Concern',
  NT: 'Near Threatened',
  VU: 'Vulnerable',
  EN: 'Endangered',
  CR: 'Critically Endangered',
};
const STATUS_TONE = {
  LC: '#7a8a5a',
  NT: '#c19a3e',
  VU: '#c87a3e',
  EN: '#b35030',
  CR: '#8a2820',
};
const REGIONS = ['Americas', 'Europe', 'Africa', 'Asia', 'Oceania', 'Arctic'];

Object.assign(window, { BIRDS, STATUS_ORDER, STATUS_LABEL, STATUS_TONE, REGIONS });
