import { cssVars } from '@/lib/cssVars';

/** Words rise out of clipped lines via CSS; the text is plain HTML and visible without it. */
export function HeroHeadline({ title }: { title: string }) {
  return (
    <h1
      id="hero-title"
      className="tracked relative -mt-[5%] text-balance text-[clamp(3.25rem,15.5vw,5.5rem)] font-medium uppercase leading-[0.98] tracking-[-0.01em] md:-mt-[6%] md:whitespace-nowrap md:text-[clamp(3.5rem,7.6vw,8rem)]"
    >
      {title.split(' ').map((word, index) => (
        <span key={index}>
          {index > 0 && ' '}
          <span className="mask-word">
            <span className="word" style={cssVars({ '--i': index })}>
              {word}
            </span>
          </span>
        </span>
      ))}
    </h1>
  );
}
