import { ArrowRight, Check, ChevronRight, PlayCircle } from 'lucide-react';
import Link from 'next/link';

import { Container } from '@/components/layout/container';
import { HeroVisual } from '@/components/marketing/hero-visual';
import { Reveal } from '@/components/motion/reveal';
import { buttonVariants } from '@/components/ui/button';
import { cn } from '@/lib/utils';

const trust = ['No contracts', 'Pay as you ship', 'Tracking included'] as const;

export function HomeHero() {
  return (
    <section className="relative overflow-hidden pb-14 pt-28 md:pb-24 lg:pt-36">
      <div className="pointer-events-none absolute inset-0 bg-mesh" aria-hidden="true" />
      <div className="pointer-events-none absolute inset-x-0 top-0 h-[85%] bg-grid opacity-80" aria-hidden="true" />
      <Container className="relative grid items-center gap-14 lg:grid-cols-12 lg:gap-8">
        <div className="lg:col-span-6">
          <Reveal index={0}>
            <Link
              href="/features"
              className="group inline-flex items-center gap-2 rounded-pill border border-border bg-surface/80 py-1 pl-1 pr-3 text-small font-medium text-foreground shadow-xs backdrop-blur transition-colors duration-180 hover:border-primary/40"
            >
              <span className="rounded-pill bg-primary px-2 py-0.5 text-[11px] font-bold uppercase tracking-wide text-primary-foreground">New</span>
              Compare couriers in seconds
              <ChevronRight className="h-4 w-4 text-muted-foreground transition-transform duration-180 group-hover:translate-x-0.5" aria-hidden="true" />
            </Link>
          </Reveal>
          <Reveal index={1}>
            <h1 className="mt-6 max-w-[12ch] text-balance font-display text-[2.5rem] font-extrabold leading-[1.08] tracking-[-0.03em] text-foreground sm:max-w-xl md:text-display-xl">
              Ship anywhere at the <span className="text-brand-gradient">best courier rate</span>
            </h1>
          </Reveal>
          <Reveal index={2}>
            <p className="mt-5 max-w-[520px] text-pretty text-[18px] leading-7 text-muted-foreground">
              Compare rates, buy labels and track every parcel from one dashboard. No contracts. Pay as you ship.
            </p>
          </Reveal>
          <Reveal index={3}>
            <div className="mt-8 flex flex-col gap-3 sm:flex-row">
              <Link href="/register" className={cn(buttonVariants({ size: 'lg' }), 'group')}>
                Get started free
                <ArrowRight className="h-4 w-4 transition-transform duration-180 ease-brand group-hover:translate-x-[3px]" aria-hidden="true" />
              </Link>
              <a href="#how-it-works" className={buttonVariants({ variant: 'secondary', size: 'lg' })}>
                <PlayCircle className="h-4 w-4 text-primary" aria-hidden="true" />
                See how it works
              </a>
            </div>
          </Reveal>
          <Reveal index={4}>
            <ul className="mt-7 flex flex-wrap gap-x-6 gap-y-2 text-small text-muted-foreground">
              {trust.map((item) => (
                <li key={item} className="inline-flex items-center gap-1.5">
                  <span className="grid h-4 w-4 place-items-center rounded-full bg-success-soft">
                    <Check className="h-3 w-3 text-success" strokeWidth={3} aria-hidden="true" />
                  </span>
                  {item}
                </li>
              ))}
            </ul>
          </Reveal>
        </div>
        <div className="lg:col-span-6">
          <HeroVisual />
        </div>
      </Container>
    </section>
  );
}
