/* Terms — full Terms of Use, linked from the footer */
const Terms = ({ setRoute }) => {
  const sections = [
    {
      n: '1', t: 'Nature of the Service',
      body: ['Kestrel provides analytical outputs derived from publicly available corporate disclosures using a structured methodology.', 'All outputs are:'],
      list: [
        'interpretative in nature',
        'generated using predefined analytical rules and/or automated systems',
        'based on the source material available at the time of analysis',
        'not statements of fact',
      ],
      after: ['Kestrel does not independently verify the accuracy, completeness, or truthfulness of underlying company disclosures.'],
    },
    {
      n: '2', t: 'No Advice',
      body: ['The Service does not provide:'],
      list: [
        'financial or investment advice',
        'legal or regulatory advice',
        'professional assurance, audit, or verification services',
      ],
      after: ['You must not rely on the Service as the sole basis for any decision, including investment, regulatory, legal, reputational, procurement, or commercial decisions.'],
    },
    {
      n: '3', t: 'Permitted Use',
      body: ['You may use the Service:'],
      list: [
        'for personal use',
        'for internal business, academic, or research purposes',
        'to evaluate the methodology and outputs presented on the platform',
      ],
      after2: ['You agree not to:'],
      list2: [
        'reproduce, redistribute, publish, or sell Kestrel outputs without permission',
        'use outputs in a misleading, defamatory, or unfairly selective manner',
        'present Kestrel outputs as verified facts or formal assurance conclusions',
        'build, train, benchmark, or improve competing systems using Kestrel outputs',
        'scrape, bulk download, reverse engineer, or attempt to extract substantial parts of the dataset',
        'bypass access controls or locked features',
      ],
    },
    {
      n: '4', t: 'Data and Methodology',
      body: [<>All outputs are produced through a structured methodology designed to assess corporate disclosures against specific criteria, including <Term name="shared-value">Shared Value</Term> concepts.</>, 'Results depend on:'],
      list: [
        'the wording and quality of disclosed materials',
        'the availability and clarity of supporting evidence',
        'the limitations of automated and interpretative analysis',
        'the classification rules applied at the time of analysis',
      ],
      after: ['Kestrel may update its methodology, classification rules, data structure, outputs, or presentation format over time.'],
    },
    {
      n: '5', t: 'User Submissions and Feedback',
      body: [
        'If you submit information through the Service, including contact forms, review requests, issue reports, suggested corrections, or expressions of interest, you are responsible for ensuring that the information you provide is accurate and lawful.',
        'By submitting feedback, review requests, suggested corrections, evidence quotes, explanations, or related material, you grant Kestrel permission to review, store, analyse, and use that submission for purposes including:',
      ],
      list: [
        'responding to your request',
        'improving the Service',
        'reviewing contested classifications',
        'maintaining an audit trail',
        'improving the methodology',
        'developing future versions of Kestrel',
      ],
      after: ['Submitting feedback does not guarantee that any output, label, classification, or methodology will be changed.'],
    },
    {
      n: '6', t: 'Data We Record',
      body: [
        'When you use the Service, we may record limited technical and submission data.',
        'This may include:',
      ],
      list: [
        'contact form submissions, including name, email, company, role, subject, and message',
        'review or contest-a-judgement submissions, including passage ID, company, report year, current label, issue type, suggested label, evidence quote, evidence page, explanation, name, email, affiliation, and source URL',
        'Terms of Use acceptance records, including acceptance time, device ID, version accepted, hashed IP address, and user agent',
        'technical metadata, including hashed IP address and browser user agent',
      ],
      after2: ['We use this information to:'],
      list2: [
        'respond to enquiries',
        'manage review requests',
        'evidence acceptance of these Terms',
        'prevent abuse or spam',
        'maintain security and audit records',
        'improve the Service and methodology',
      ],
      after: ['IP addresses are stored in hashed form where practicable. However, technical logs and third-party infrastructure providers may process additional technical information as part of normal website operation.'],
    },
    {
      n: '7', t: 'Data Storage and Third-Party Services',
      body: [
        'Submission and acceptance data may be stored using third-party infrastructure and service providers, including hosting, database, email, analytics, and spreadsheet services.',
        'These may include services used for:',
      ],
      list: [
        'website hosting',
        'serverless functions',
        'key-value storage',
        'Google Sheets record-keeping',
        'email delivery',
        'security logging',
      ],
      after: ['We take reasonable steps to limit access to this data and use it only for the purposes described in these Terms.'],
    },
    {
      n: '8', t: 'No Warranty',
      body: [
        'The Service is provided “as is” and “as available”.',
        'We make no guarantees regarding:',
      ],
      list: [
        'accuracy',
        'completeness',
        'reliability',
        'availability',
        'fitness for purpose',
        'uninterrupted operation',
        'error-free performance',
      ],
    },
    {
      n: '9', t: 'Limitation of Liability',
      body: ['To the fullest extent permitted by law, Kestrel Analytics shall not be liable for any loss or damage arising from:'],
      list: [
        'reliance on outputs',
        'use or inability to use the Service',
        'errors, omissions, or inaccuracies in outputs',
        'decisions made based on the Service',
        'unauthorised use of outputs by third parties',
        'changes to or removal of features',
      ],
      after2: [
        'This includes indirect or consequential losses, including financial loss, commercial loss, reputational damage, loss of opportunity, or loss of data.',
        'Nothing in these Terms excludes liability for:',
      ],
      list2: [
        'death or personal injury caused by negligence',
        'fraud or fraudulent misrepresentation',
        'any liability that cannot be excluded under applicable law',
      ],
    },
    {
      n: '10', t: 'Access and Availability',
      body: ['We may:'],
      list: [
        'restrict, suspend, or withdraw access at any time',
        'modify, lock, or remove features without notice',
        'change the scope, design, methodology, or availability of the Service',
        'refuse or remove submissions that are abusive, unlawful, misleading, or irrelevant',
      ],
      after: ['We do not guarantee that the Service will remain available, free, public, or unchanged.'],
    },
    {
      n: '11', t: 'Accounts and Access Controls',
      body: [
        'If accounts, subscriptions, trials, or gated access features are introduced, you are responsible for keeping your login details secure.',
        'We may suspend, restrict, or terminate accounts or access where we reasonably believe there has been misuse, attempted scraping, breach of these Terms, or activity that may harm the Service or other users.',
      ],
    },
    {
      n: '12', t: 'Intellectual Property',
      body: [
        'Unless otherwise stated, the Service, methodology, design, outputs, classifications, database structure, text, graphics, and other materials are owned by or licensed to Kestrel Analytics.',
        'You may not copy, reproduce, adapt, redistribute, sell, or exploit any substantial part of the Service without prior written permission.',
        'Public corporate disclosures remain the property of their respective owners.',
      ],
    },
    {
      n: '13', t: 'Changes to These Terms',
      body: [
        'We may update these Terms from time to time.',
        'Where we make material changes, we may ask users to accept the updated version before continuing to use the Service.',
        'Continued use of the Service after the Terms are updated constitutes acceptance of the revised Terms.',
      ],
    },
    {
      n: '14', t: 'Governing Law and Jurisdiction',
      body: [
        'These Terms are governed by the laws of England and Wales.',
        'You agree that the courts of England and Wales shall have exclusive jurisdiction over any disputes arising from or relating to your use of the Service.',
      ],
    },
    {
      n: '15', t: 'Acceptance',
      body: [
        'By accessing or continuing to use the Service, you confirm that you accept these Terms of Use.',
      ],
    },
  ];

  const para = { fontSize: 14, lineHeight: '24px', color: 'var(--ink-2)', margin: '0 0 12px' };
  const liStyle = { fontSize: 14, lineHeight: '24px', color: 'var(--ink-2)', marginBottom: 6 };

  return (
    <section className="section first">
      <div className="site-wrap" style={{maxWidth:780}}>
        <EyebrowRow label="Legal"/>
        <h1 style={{fontSize:48,lineHeight:'56px',fontWeight:600,letterSpacing:'-0.02em',marginBottom:16}}>
          Terms of Use
        </h1>
        <div style={{fontSize:13,color:'var(--ink-3)',marginBottom:40}} className="tabular">
          Effective Date: 28th April 2026
        </div>

        {sections.map(s => (
          <div key={s.n} style={{marginBottom:36}}>
            <h3 style={{fontSize:18,lineHeight:'26px',fontWeight:600,color:'var(--ink)',margin:'0 0 12px'}}>
              {s.n}. {s.t}
            </h3>
            {s.body && s.body.map((p,i) => <p key={'b'+i} style={para}>{p}</p>)}
            {s.list && (
              <ul style={{paddingLeft:20,margin:'0 0 12px'}}>
                {s.list.map((li,i) => <li key={'l'+i} style={liStyle}>{li}</li>)}
              </ul>
            )}
            {s.after2 && s.after2.map((p,i) => <p key={'a2'+i} style={para}>{p}</p>)}
            {s.list2 && (
              <ul style={{paddingLeft:20,margin:'0 0 12px'}}>
                {s.list2.map((li,i) => <li key={'l2'+i} style={liStyle}>{li}</li>)}
              </ul>
            )}
            {s.after && s.after.map((p,i) => <p key={'a'+i} style={para}>{p}</p>)}
          </div>
        ))}

        <div style={{marginTop:48,paddingTop:24,borderTop:'1px solid var(--line)'}}>
          <button className="btn btn-text" style={{fontSize:13}} onClick={()=>setRoute({page:'home'})}>
            <Icon name="arrow-right" size={12} style={{marginRight:6,transform:'rotate(180deg)'}}/> Back to home
          </button>
        </div>
      </div>
    </section>
  );
};
window.Terms = Terms;
