import fs from 'fs';
import path from 'path';

const dir = 'src/components';
const files = fs.readdirSync(dir).filter(f => f.endsWith('.tsx'));

for (const file of files) {
  if (file === 'HeroSection.tsx') continue;
  
  const filePath = path.join(dir, file);
  let content = fs.readFileSync(filePath, 'utf8');
  let original = content;

  // For main H2s
  content = content.replaceAll('text-4xl md:text-5xl font-bold', 'text-5xl md:text-6xl font-bold py-2 leading-[1.3] pb-4');
  
  // For smaller H2s/H3s
  content = content.replaceAll('text-lg font-bold text-foreground mb-2', 'text-2xl py-2 leading-relaxed font-bold text-foreground mb-1');
  content = content.replaceAll('text-xl font-bold text-foreground mb-6', 'text-3xl py-2 leading-relaxed font-bold text-foreground mb-4');
  content = content.replaceAll('text-lg font-bold text-foreground mb-1', 'text-2xl py-2 leading-relaxed font-bold text-foreground mb-1');
  content = content.replaceAll('text-xl font-bold text-foreground mb-4', 'text-3xl py-2 leading-relaxed font-bold text-foreground mb-2');
  content = content.replaceAll('text-2xl font-bold text-foreground mb-2', 'text-3xl py-2 leading-relaxed font-bold text-foreground mb-2');
  
  // Footer H3/H4
  content = content.replaceAll('text-2xl font-bold mb-3', 'text-4xl py-2 leading-relaxed font-bold mb-2');
  content = content.replaceAll('text-lg font-semibold mb-3', 'text-2xl py-2 leading-relaxed font-semibold mb-2');
  
  // Navbar 
  content = content.replaceAll('text-3xl font-display font-medium', 'text-4xl py-2 leading-relaxed font-display font-medium');

  if (original !== content) {
    fs.writeFileSync(filePath, content);
    console.log(`Updated sizes in ${file}`);
  }
}
