/* ─── About Page — Grant Purdy bio + Roger Estall + endorsements ─── */
/* Bio draft from build-brief.md. Endorsements from reviews.md (verified). */

const AboutPage = ({ tweaks, onNavigate }) => {
  const isMobile = useMediaQuery(680);

  const s = {
    hero: {
      paddingTop: isMobile ? 'var(--space-8)' : 'var(--space-10)',
      paddingBottom: 'var(--space-7)',
    },
    h1: {
      fontFamily: 'var(--font-serif-display)',
      fontSize: isMobile ? '2rem' : 'clamp(2rem, 4.5vw, 2.75rem)',
      fontWeight: 500,
      lineHeight: 1.15,
      letterSpacing: 'var(--tracking-tight)',
      color: 'var(--fg-primary)',
      margin: '0 0 var(--space-6) 0',
    },
    h2: {
      fontFamily: 'var(--font-serif)',
      fontSize: '1.5rem',
      fontWeight: 500,
      lineHeight: 1.25,
      color: 'var(--fg-primary)',
      margin: '0 0 var(--space-4) 0',
    },
    body: {
      fontFamily: 'var(--font-serif)',
      fontSize: 'var(--text-base)',
      lineHeight: 'var(--leading-relaxed)',
      color: 'var(--fg-primary)',
      margin: '0 0 var(--space-5) 0',
      maxWidth: 'var(--measure)',
      textWrap: 'pretty',
    },
    muted: {
      fontFamily: 'var(--font-serif)',
      fontSize: 'var(--text-base)',
      lineHeight: 'var(--leading-relaxed)',
      color: 'var(--fg-secondary)',
      margin: '0 0 var(--space-5) 0',
      maxWidth: 'var(--measure)',
      textWrap: 'pretty',
    },
    sectionSpacing: {
      paddingTop: isMobile ? 'var(--space-6)' : 'var(--space-8)',
      paddingBottom: isMobile ? 'var(--space-6)' : 'var(--space-8)',
    },
    photoSection: {
      display: 'flex',
      gap: 'var(--space-6)',
      alignItems: 'flex-start',
      flexDirection: isMobile ? 'column' : 'row',
    },
    photo: {
      width: isMobile ? '100px' : '120px',
      height: isMobile ? '100px' : '120px',
      borderRadius: 'var(--radius-md)',
      objectFit: 'cover',
      flexShrink: 0,
      filter: 'grayscale(20%)',
    },
    endorsement: {
      paddingLeft: 'var(--space-5)',
      borderLeft: '2px solid var(--border)',
      marginBottom: 'var(--space-6)',
    },
    quoteText: {
      fontFamily: 'var(--font-serif)',
      fontSize: '16px',
      fontStyle: 'italic',
      lineHeight: 1.65,
      color: 'var(--fg-secondary)',
      margin: '0 0 var(--space-2) 0',
      maxWidth: 'var(--measure)',
    },
    attribution: {
      fontFamily: 'var(--font-serif)',
      fontSize: '13px',
      color: 'var(--fg-tertiary)',
    },
  };

  const endorsements = [
    {
      quote: '\u201CThe two authors of this book have used their decades of experience in advising key decision makers in government and business to provide compelling clarity on how to implement effective decision making in the presence of uncertainty. The book is written to be immediately understood by decision makers at all levels, from the captains of industry to airline pilots facing an emergency.\u201D',
      name: 'John Lark, CPRM, ICD.D',
      role: 'Managing Principal, Coherent Advice; ISO 31000 practitioner',
    },
    {
      quote: '\u201CPurdy and Estall present a \u2018universal model for decision-making\u2019 that Deming fans will appreciate since it hints at the classic PDCA model. The book moves the conversation away from consultant-driven boardroom BS into a more practical, and infinitely more applicable, method that anyone can use.\u201D',
      name: 'Christopher Paris',
      role: 'Founder & VP Operations, Oxebridge',
    },
    {
      quote: '\u201CThe authors deserve accolades for rejecting jargon and writing in plain English with words having their normal meanings. Decisions are not \u2018fire and forget\u2019.\u201D',
      name: 'Warwick Stacey',
      role: 'Former special forces officer',
    },
    {
      quote: '\u201CIn eight brief chapters plus five appendices they show how better decisions can be made using a few key principles and processes.\u201D',
      name: 'Chris Peace',
      role: 'Risk consultant and academic, Victoria University of Wellington',
    },
  ];

  return React.createElement('div', { style: { background: 'var(--bg-primary)' } },
    /* ─── Grant Purdy ─── */
    React.createElement(Section, { style: s.hero },
      React.createElement(Overline, { style: { marginBottom: 'var(--space-4)' } }, 'About'),
      React.createElement('h1', { style: s.h1 }, 'Grant Purdy'),
      React.createElement('div', { style: s.photoSection },
        React.createElement('img', {
          src: 'assets/grant-purdy.jpg',
          alt: 'Photo of Grant Purdy',
          style: s.photo,
          loading: 'lazy',
        }),
        React.createElement('div', null,
          React.createElement('p', { style: s.body },
            'Grant Purdy has spent nearly fifty years helping decision-makers have effective conversations about whether their decisions are providing sufficient certainty that intended outcomes will be achieved\u2009\u2014\u2009work that for most of his career sat under the label of risk management, until he came to believe the label was the wrong frame entirely.'),
          React.createElement('p', { style: s.body },
            'He was a nominated expert to the ISO working group that wrote ', React.createElement('strong', null, 'ISO\u00A031000'), ' (the international standard for risk management) and ', React.createElement('strong', null, 'ISO Guide\u00A073'), ', and provided substantial input to ISO/IEC\u00A031010. He chaired the Australia/New Zealand joint standards committee on risk management for thirteen years and led the Australian delegation to the ISO technical committee that maintains the standard. Before that, he was Group Risk Manager at BHP Billiton, Managing Director of Aon Pacific Risk Management, and held senior roles at Andersen, DNV and IRCA, working across more than twenty-five countries.'),
          React.createElement('p', { style: s.body },
            React.createElement('em', null, 'Deciding'),
            ' (2020), co-authored with Roger Estall, is the book where the two of them set down the alternative they\u2019d spent thirty years building: a five-step method any Decider can apply to any decision, without the risk-management overhead.'),
        ),
      ),
    ),

    React.createElement(Divider),

    /* ─── Roger Estall ─── */
    React.createElement(Section, { style: s.sectionSpacing },
      React.createElement('div', { style: s.photoSection },
        React.createElement('img', {
          src: 'assets/roger-estall.jpg',
          alt: 'Photo of Roger Estall',
          style: s.photo,
          loading: 'lazy',
        }),
        React.createElement('div', null,
          React.createElement('h2', { style: s.h2 }, 'Roger Estall (d.\u00A02023)'),
          React.createElement('p', { style: s.muted },
            'Roger Estall and Grant collaborated for three decades. Roger spent over forty years in assurance and decision-making practice across New Zealand and internationally, including more than two decades in senior management and governance roles at a multinational. Appointed by the New Zealand Government to chair the New Zealand Fire Service Commission and National Rural Fire Authority, he led reforms that significantly reduced annual fire fatalities and pursued the smoke-alarm and fire-sprinkler legislation that Grant credits with saving more lives in New Zealand than any other public-health intervention of his generation.'),
          React.createElement('p', { style: s.muted },
            'He served on twenty-five national and international standards-writing committees over thirty-seven years, covering fire engineering, building controls, aviation firefighting, and what was then called risk management. He was the founding chairman of the New Zealand Society for Risk Management.'),
          React.createElement('p', { style: {
            ...s.body,
            fontStyle: 'italic',
            borderLeft: '2px solid var(--border)',
            paddingLeft: 'var(--space-5)',
            marginTop: 'var(--space-4)',
            color: 'var(--fg-secondary)',
          } },
            '\u201CHe taught me never to compromise on logic and to challenge anything that, quite simply, did not make sense.\u201D'),
          React.createElement('span', { style: {
            fontFamily: 'var(--font-serif)',
            fontSize: '13px',
            color: 'var(--fg-tertiary)',
            display: 'block',
            paddingLeft: 'var(--space-5)',
            marginBottom: 'var(--space-4)',
          } }, '\u2014 Grant Purdy'),
          React.createElement('p', { style: s.muted },
            React.createElement('em', null, 'Deciding'),
            ' (2020) was their last work together. Roger died suddenly on 21 June 2023, while visiting the city he was born, Christchurch.'),
          React.createElement('a', {
            style: {
              fontFamily: 'var(--font-sans)',
              fontSize: '13px',
              fontWeight: 500,
              color: 'var(--accent)',
              textDecoration: 'underline',
              textUnderlineOffset: '0.15em',
              cursor: 'pointer',
            },
            onClick: (e) => { e.preventDefault(); onNavigate && onNavigate('writing/vale-roger-estall'); },
            href: '#',
          }, 'Read Grant\u2019s full tribute \u2192'),
        ),
      ),
    ),

    React.createElement(Divider),

    /* ─── The family-business hook ─── */
    React.createElement(Section, { style: s.sectionSpacing },
      React.createElement('h2', { style: s.h2 }, 'Carrying the method forward'),
      React.createElement('p', { style: s.body },
        'Grant retired from advisory practice in 2024. His son Jo built the Walk so the method wouldn\u2019t retire with him: the book made conversational, in front of the Decider one decision at a time, rather than on the shelf. Grant stands behind it as the method\u2019s surviving co-author. The Walk is the family keeping ',
        React.createElement('em', null, 'Deciding'),
        ' in active use.'),
    ),

    React.createElement(Divider),

    /* ─── Endorsements ─── */
    React.createElement(Section, { style: s.sectionSpacing },
      React.createElement(Overline, { style: { marginBottom: 'var(--space-5)' } }, 'Endorsements'),
      ...endorsements.map((e, i) =>
        React.createElement('div', { key: i, style: s.endorsement },
          React.createElement('p', { style: s.quoteText }, e.quote),
          React.createElement('span', { style: s.attribution }, '\u2014 ', e.name, ', ', e.role),
        )
      ),
    ),
  );
};

window.AboutPage = AboutPage;
