<script>
  import { t } from '$lib/translations';

  const MAIL = 'leo@leomurca.xyz';
  const LINKEDIN = 'https://linkedin.com/in/leonardoamurca';
  const GIT = 'https://git.leomurca.xyz/';
</script>

<section
  id="contact"
  class="contact"
  aria-labelledby="contact-strip-title"
>
  <div class="contact__inner">
    <h2 id="contact-strip-title" class="contact__title">
      {$t('contact.title')}
    </h2>
    <p class="contact__lead">{$t('contact.lead')}</p>

    <a
      class="primary-button contact__cta"
      href={`mailto:${MAIL}?subject=${encodeURIComponent($t('contact.mailSubject'))}`}
      >{$t('contact.cta')}</a
    >

    <p class="contact__links-intro">{$t('contact.linksIntro')}</p>
    <ul class="contact__links">
      <li>
        <a href={`mailto:${MAIL}`} aria-label={$t('footer.emailAria')}
          >{$t('contact.emailLink')}</a
        >
      </li>
      <li>
        <a
          href={LINKEDIN}
          target="_blank"
          rel="noopener noreferrer"
          aria-label={$t('footer.linkedinAria')}>{$t('contact.linkedinLink')}</a
        >
      </li>
      <li>
        <a
          href={GIT}
          target="_blank"
          rel="noopener noreferrer"
          aria-label={$t('footer.gitAria')}>{$t('contact.gitLink')}</a
        >
      </li>
    </ul>
  </div>
</section>

<style>
  .contact {
    scroll-margin-top: 100px;
    margin: 0;
    padding: 72px 80px 80px;
    background: var(--color-dark-background);
    color: #f4f4f5;
  }

  .contact__inner {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
  }

  .contact__title {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #fafafa;
  }

  .contact__lead {
    margin: 0 0 1.75rem;
    font-size: 1.1rem;
    line-height: 1.55;
    color: #a1a1aa;
    max-width: 52ch;
    margin-left: auto;
    margin-right: auto;
  }

  .contact__cta {
    margin-bottom: 2rem;
  }

  .contact__links-intro {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #71717a;
  }

  .contact__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    justify-content: center;
  }

  .contact__links a {
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
  }

  .contact__links a:hover {
    color: #ffb366;
  }

  @media (max-width: 768px) {
    .contact {
      padding: 56px 24px 64px;
    }
  }
</style>
