import glob

for file in ['index.html', 'about.html']:
    with open(file, 'r', encoding='utf-8') as f:
        content = f.read()

    # We want to replace the Unsplash image with the video tag, and update the href
    old_img = '<img src="https://images.unsplash.com/photo-1519817650390-64a93db51149?w=400&q=80&auto=format&fit=crop" style="width: 100%; height: 100%; object-fit: cover;" alt="Video Thumbnail">'
    new_vid = '<video src="assets/videos/hero-bg.mp4" style="width: 100%; height: 100%; object-fit: cover;" autoplay loop muted playsinline></video>'
    
    content = content.replace(old_img, new_vid)
    
    # Also update the href to point to the video
    old_href = '<a href="about.html" style="position: absolute; inset: 0;'
    new_href = '<a href="assets/videos/hero-bg.mp4" target="_blank" style="position: absolute; inset: 0;'
    
    content = content.replace(old_href, new_href)

    with open(file, 'w', encoding='utf-8') as f:
        f.write(content)

print("Updated video in index.html and about.html")
