// Second vehicle — a SOLD collector car demonstrating the full
// acquisition → ownership → restoration → sale → transfer lifecycle.
// 1967 Ferrari 275 GTB/4 "Alloy Berlinetta". Demo data, realistic shape.

const VEHICLE_FERRARI = {
  id: 'ferrari-275',
  hero: (typeof window !== 'undefined' && window.__resources && window.__resources.heroFerrari) || 'images/ferrari-275-gtb4.jpeg',
  heroTone: 'dark',
  lastUpdated: 'Sep 12, 2024',

  // Identity
  year: 1967,
  make: 'Ferrari',
  model: '275 GTB/4',
  trim: 'Berlinetta · Alloy',
  nickname: 'The Maranello Four-Cam',
  vin: '09437',
  plate: 'EXPORTED · CH',
  color: 'Verde Pino / Nero',
  mileage: 13240,
  ownership: { since: 'February 2016', years: 8, months: 6, total: '8 years, 6 months' },

  // Status
  status: 'Sold',
  statusOptions: ['Active', 'In Restoration', 'Needs Service', 'In Storage', 'Transporting', 'For Sale', 'Sold'],

  // Location (final — left the collection)
  location: {
    name: 'Geneva Freeport',
    city: 'Geneva, CH',
    movedDate: 'Sep 12, 2024',
    climate: 'Delivered to new owner · in bond',
    other: [],
  },

  // ── SALE & OWNERSHIP TRANSFER (the new feature) ──
  sale: {
    date: 'August 16, 2024',
    price: 3_750_000,
    method: 'Auction',
    venue: 'Gooding & Company · Pebble Beach',
    lotNote: 'Cover lot 042 · hammer + premium',
    buyerType: 'Collection',
    buyerName: 'Private European Collection',
    buyerVia: 'Acquired through broker (name withheld)',
    buyerLocation: 'Geneva, Switzerland',
    transferDate: 'August 20, 2024',
    deliveryDate: 'September 12, 2024',
    transport: 'Ocean freight · enclosed container',
    transportLeg2: 'Enclosed truck · port → freeport',
    shipper: 'Cosdel International Logistics',
    tracking: 'COSU-7741920',
    deliveryConfirmed: true,
    deliveryConfirmedDate: 'Sep 12, 2024 · 14:20 CET',
    steps: [
      { label: 'Sale agreed',        date: 'Aug 16, 2024', done: true,  note: 'Hammer fell at Pebble Beach' },
      { label: 'Funds cleared',      date: 'Aug 19, 2024', done: true,  note: 'Escrow via Gooding & Co.' },
      { label: 'Title transferred',  date: 'Aug 20, 2024', done: true,  note: 'Export documentation filed' },
      { label: 'Collected for transport', date: 'Aug 28, 2024', done: true, note: 'Enclosed truck → Port of Oakland' },
      { label: 'Ocean freight',      date: 'Sep 2–10, 2024', done: true, note: 'Container COSU-7741920 · Oakland → Genoa' },
      { label: 'Delivered & confirmed', date: 'Sep 12, 2024', done: true, note: 'Geneva Freeport · buyer signed' },
    ],
  },

  // ── COST OF OWNERSHIP / ROI ──
  costs: {
    purchase:    2_900_000,
    maintenance:    84_000,
    restoration:   310_000,
    storage:        96_000,
    insurance:     128_000,
    totalInvested: 3_518_000,
    salePrice:   3_750_000,
    grossGain:     850_000,   // sale − purchase
    grossPct:         29.3,
    netGain:       232_000,   // sale − total invested
    netPct:            6.6,
    heldYears:           8,
  },

  // ── VALUE HISTORY ──
  value: {
    sold: true,
    current: 3_500_000,        // last pre-sale estimate
    purchased: 2_900_000,
    purchasedAt: "RM Sotheby's · Monterey",
    purchasedDate: 'February 2016',
    salePrice: 3_750_000,
    deltaTotal: 850_000,
    deltaPct: 29.3,
    appraisals: [
      { date: 'Aug 2024', source: 'Sold · Gooding & Co.',     value: 3_750_000 },
      { date: 'May 2024', source: 'Hagerty appraisal',        value: 3_500_000 },
      { date: 'Nov 2022', source: 'Classiche re-cert uplift', value: 3_400_000 },
      { date: 'Jan 2022', source: 'Cavallino appraisal',      value: 3_300_000 },
      { date: 'Jun 2020', source: 'Market estimate',          value: 2_980_000 },
      { date: 'Sep 2018', source: "RM estimate",              value: 3_050_000 },
      { date: 'Feb 2016', source: 'Purchase price',           value: 2_900_000 },
    ],
    investments: [
      { label: 'Engine-out rebuild (Classiche-spec)', cost: 168_000 },
      { label: 'Bare-metal respray · Verde Pino',    cost: 74_000 },
      { label: 'Interior re-trim · Connolly hides',   cost: 38_000 },
      { label: 'Brightwork & chrome',                 cost: 18_000 },
      { label: 'Ferrari Classiche certification',     cost: 12_000 },
    ],
  },

  // ── ATTENTION (archival — none active) ──
  attention: [],

  // ── HEALTH (final condition at sale) ──
  health: [
    { group: 'Engine',        status: 'Concours',  note: '3.3L Colombo V12 · 4-cam · matching', icon: 'spark' },
    { group: 'Transmission',  status: 'Concours',  note: '5-spd transaxle · matching',          icon: 'gauge' },
    { group: 'Suspension',    status: 'Excellent', note: 'Rebuilt during restoration',          icon: 'wrench' },
    { group: 'Paint',         status: 'Concours',  note: 'Bare-metal Verde Pino · 2021',          icon: 'spark' },
    { group: 'Interior',      status: 'Concours',  note: 'Connolly Nero re-trim',                icon: 'archive' },
    { group: 'Documentation', status: 'Complete',  note: 'Classiche Red Book · build sheet',     icon: 'certificate' },
  ],

  // ── OWNERSHIP CHAIN ──
  ownership_chain: [
    { from: '2024', to: 'present', owner: 'Private European Collection', where: 'Geneva, CH',  note: 'Acquired at Gooding Pebble Beach · via broker', kind: 'collection', current: true },
    { from: '2016', to: '2024',    owner: 'You',                         where: 'Carmel, CA',   note: 'Ferrari Classiche certified · concours rotation · sold 2024', kind: 'self' },
    { from: '1989', to: '2016',    owner: 'Sundstrand Collection',       where: 'Greenwich, CT', note: 'Long-term static display · ~1,200 mi added',  kind: 'collection' },
    { from: '1972', to: '1989',    owner: 'Jean-Pierre Rousseau',        where: 'Paris, FR',    note: 'Touring use · Rallye historique entrant',     kind: 'private' },
    { from: '1967', to: '1972',    owner: 'G. Marelli (Industria Marelli)', where: 'Milano, IT', note: 'First owner · ordered new via Crepaldi',     kind: 'private' },
    { from: '1967', to: '1967',    owner: 'Carrozzeria Scaglietti',      where: 'Modena, IT',   note: 'Alloy body · delivered to Ferrari S.p.A.',    kind: 'factory' },
  ],

  provenance: {
    matchingVin: true,
    originalEngine: true,
    originalTrans: true,
    awards: [
      { event: 'Cavallino Classic',                  placement: 'Platinum · 97.5 pts', year: 2019 },
      { event: "Pebble Beach Concours d'Elegance",   placement: '2nd in Class',        year: 2021 },
      { event: "Concorso d'Eleganza Villa d'Este",   placement: 'Invited',             year: 2022 },
    ],
    auctions: [
      { house: "RM Sotheby's · Monterey",   year: 2016, result: 'Acquired', value: 2_900_000 },
      { house: 'Gooding & Co. · Pebble Beach', year: 2024, result: 'Sold',  value: 3_750_000 },
    ],
    media: [
      { title: 'Cavallino Magazine',                  ref: 'No. 248 — featured profile' },
      { title: '"Ferrari 275: The Berlinetta Era"',   ref: 'Hardcover — illustrated' },
      { title: 'Gooding & Co. 2024 Catalogue',        ref: 'Cover lot' },
    ],
    significance: [
      'One of ~280 four-cam 275 GTB/4 examples; rare alloy-body spec',
      'Ferrari Classiche Red Book certified — matching numbers throughout',
      'Period Rallye history including a 1974 Tour Auto entry',
    ],
    docs: ['Build sheet', 'Ferrari Classiche Red Book', 'Window sticker (repro)', "Owner's manual & pouch", 'Tool roll & jack', 'Period photography'],
  },

  // ── TIMELINE ──
  timeline: [
    { date: 'Sep 12, 2024', type: 'Transport',   title: 'Delivered to Geneva Freeport',
      mileage: 13240, vendor: 'Cosdel International', cost: 18_400,
      note: 'Ocean freight enclosed container · delivery confirmed by buyer', attachments: 3 },
    { date: 'Aug 20, 2024', type: 'Ownership',    title: 'Title transferred to buyer',
      mileage: 13240, vendor: 'Gooding & Co. escrow', cost: null,
      note: 'Funds cleared · export documentation filed', attachments: 2 },
    { date: 'Aug 16, 2024', type: 'Sale',         title: 'Sold — Gooding & Co., Pebble Beach',
      mileage: 13240, vendor: 'Gooding & Company', cost: 3_750_000,
      note: 'Cover lot 042 · hammer plus premium', attachments: 6 },
    { date: 'May 2, 2024',  type: 'Appraisal',    title: 'Pre-sale appraisal',
      mileage: 13210, vendor: 'Hagerty', cost: null,
      note: 'Agreed value $3,500,000 USD', attachments: 1 },
    { date: 'Jun 18, 2023', type: 'Concours',     title: 'Cavallino Classic — Platinum',
      mileage: 12980, vendor: 'Cavallino', cost: null,
      note: 'Platinum award · 97.5 points', attachments: 4 },
    { date: 'Nov 2, 2022',  type: 'Restoration',  title: 'Ferrari Classiche certification',
      mileage: 12760, vendor: 'Ferrari Classiche · Maranello', cost: 12_000,
      note: 'Red Book issued · matching numbers confirmed', attachments: 5 },
    { date: '2019 — 2021',  type: 'Restoration',  title: 'Engine-out rebuild & bare-metal respray',
      mileage: 12500, vendor: 'GTO Engineering · UK', cost: 298_000,
      note: 'Colombo V12 rebuilt · Verde Pino respray · Connolly re-trim', attachments: 8 },
    { date: 'Feb 27, 2016', type: 'Acquisition',  title: "Purchased — RM Sotheby's Monterey",
      mileage: 12010, vendor: "RM Sotheby's", cost: 2_900_000,
      note: 'Acquired from the Sundstrand Collection', attachments: 10 },
  ],

  // ── SERVICE ──
  service: [
    { date: 'Apr 2024', item: 'Pre-sale recommissioning', mileage: 13205, vendor: 'GTO Engineering', cost: 9_800,  next: '—' },
    { date: 'Jun 2023', item: 'Concours detail & fluids',  mileage: 12980, vendor: 'Ferrari Classiche', cost: 4_200, next: '—' },
    { date: 'Mar 2022', item: 'Annual service',            mileage: 12740, vendor: 'GTO Engineering', cost: 6_400,  next: 'Mar 2023' },
    { date: 'Sep 2021', item: 'Post-restoration shakedown',mileage: 12560, vendor: 'GTO Engineering', cost: 12_800, next: '—' },
    { date: 'May 2018', item: 'Carburettor sync & tune',   mileage: 12300, vendor: 'GTO Engineering', cost: 3_900,  next: '—' },
  ],

  // ── PARTS ──
  parts: [
    { name: 'Borrani wire wheels',     spec: 'RW3801 · set of 5',      type: 'Original', installed: '2021', supplier: 'Ruote Borrani',     warranty: '—',       cost: 22_000 },
    { name: 'Pirelli Cinturato CN72',  spec: '205VR14 · set',          type: 'OEM-spec', installed: '2021', supplier: 'Longstone Tyres',   warranty: '2031',    cost: 2_400 },
    { name: 'Weber 40 DCN/9 carbs',    spec: 'Triple · rebuilt',       type: 'OEM',      installed: '2020', supplier: 'GTO Engineering',   warranty: '—',       cost: 14_500 },
    { name: 'Connolly Vaumol hides',   spec: 'Nero · full re-trim',    type: 'Original', installed: '2021', supplier: 'Connolly',          warranty: '—',       cost: 16_800 },
    { name: 'ANSA exhaust system',     spec: 'Correct-pattern',        type: 'OEM-spec', installed: '2020', supplier: 'Superformance',     warranty: '—',       cost: 4_600 },
  ],

  // ── DOCUMENT VAULT ──
  documents: [
    { category: 'Sale & Transfer', items: [
      { name: 'Gooding & Co. bill of sale',   date: 'Aug 2024', kind: 'pdf',   pages: 3 },
      { name: 'Export declaration (CBP)',     date: 'Aug 2024', kind: 'pdf',   pages: 4 },
      { name: 'Ocean freight bill of lading', date: 'Sep 2024', kind: 'pdf',   pages: 2 },
      { name: 'Delivery confirmation',        date: 'Sep 2024', kind: 'pdf',   pages: 1 },
    ]},
    { category: 'Provenance', items: [
      { name: 'Ferrari Classiche Red Book',   date: 'Nov 2022', kind: 'pdf',   pages: 16, archival: true },
      { name: 'Original build sheet',         date: '1967',     kind: 'pdf',   pages: 2,  archival: true },
      { name: 'Period photography',           date: '1967–1989', kind: 'image', pages: 38, archival: true },
    ]},
    { category: 'Restoration', items: [
      { name: 'GTO Engineering full report',  date: '2021',     kind: 'pdf',   pages: 84 },
      { name: 'Engine rebuild photo set',     date: '2020',     kind: 'image', pages: 220 },
    ]},
    { category: 'Service Records', items: [
      { name: 'Continuous service history',   date: '2016–2024', kind: 'pdf',  pages: 32 },
    ]},
    { category: 'Insurance', items: [
      { name: 'Hagerty agreed-value policy',  date: 'Nov 2023', kind: 'pdf',   pages: 8, expires: 'Nov 2024' },
      { name: 'Hagerty appraisal',            date: 'May 2024', kind: 'pdf',   pages: 14 },
    ]},
    { category: 'Acquisition', items: [
      { name: "RM Sotheby's invoice",         date: 'Feb 2016', kind: 'pdf',   pages: 2 },
      { name: 'Pre-purchase inspection',      date: 'Jan 2016', kind: 'pdf',   pages: 26 },
    ]},
  ],
};

Object.assign(window, { VEHICLE_FERRARI });
