@layer normalize, reset, defaults;

/* Fonts */

@font-face {
  font-display: swap;
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  src: url("/assets/fonts/poppins-400.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  src: url("/assets/fonts/poppins-500.woff2") format("woff2");
}

@layer reset {
  *,
  *:before,
  *:after {
    box-sizing: border-box;
  }
  html {
    scroll-behavior: smooth;
  }
  img {
    max-width: 100%;
    display: block;
    height: auto;
  }
  :where(h1, h2, h3, h4, h5, h6) {
    margin: 0;
    text-wrap: balance;
  }
  p,
  li {
    text-wrap: pretty;
    margin: 0;
  }
}

@layer defaults {
  :root {
    --brand-primary: #012d45;
    --brand-secondary: #fb7a10;
    --text-body: #333;
    --bg-body: #eee;
    --base: #f7f7f7;

    --space-4xs: clamp(0.33rem, calc(-0.04vw + 0.34rem), 0.31rem);
    --space-3xs: clamp(0.41rem, calc(0.05vw + 0.39rem), 0.44rem);
    --space-2xs: clamp(0.51rem, calc(0.21vw + 0.45rem), 0.62rem);
    --space-xs: clamp(0.64rem, calc(0.46vw + 0.5rem), 0.88rem);
    --space-s: clamp(0.8rem, calc(0.85vw + 0.55rem), 1.24rem);
    --space-m: clamp(1rem, calc(1.45vw + 0.57rem), 1.75rem);
    --space-l: clamp(1.25rem, calc(2.37vw + 0.54rem), 2.47rem);
    --space-xl: clamp(1.56rem, calc(3.75vw + 0.44rem), 3.5rem);
    --space-2xl: clamp(1.95rem, calc(5.8vw + 0.22rem), 4.95rem);
    --space-3xl: clamp(2.44rem, calc(8.82vw + -0.19rem), 7rem);
    --space-4xl: clamp(3.05rem, calc(13.25vw + -0.91rem), 9.89rem);
    --text-xs: clamp(0.79rem, calc(-0.3vw + 0.88rem), 0.63rem);
    --text-s: clamp(0.89rem, calc(-0.09vw + 0.92rem), 0.84rem);
    --text-m: clamp(1rem, 0.913rem + 0.2899vw, 1.125rem);
    --text-l: clamp(1.125rem, 1.038rem + 0.2899vw, 1.25rem);
    --text-xl: clamp(1.125rem, 1.038rem + 0.2899vw, 1.25rem);
    --text-2xl: clamp(1.5rem, 1.1522rem + 1.1594vw, 2rem);
    --text-3xl: clamp(2.8125rem, 1.9864rem + 2.7536vw, 4rem);
    --text-4xl: clamp(5rem, 2.9565rem + 6.8116vw, 7.9375rem);
  }

  body {
    font-family: "Poppins", sans-serif;
    font-size: var(--text-m);
    line-height: 1.5;
    background-color: var(--bg-body);
    color: var(--text-body);

    height: 100svh;
    min-height: fit-content;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  header,
  main,
  footer {
    width: 100%;
  }

  :where(h1, h2, h3, h4, h5, h6) {
    line-height: 1.2;
    color: var(--brand-primary);
    letter-spacing: -0.025em;
  }

  * + p {
    margin-top: 1em;
  }

  a:not(.button) {
    color: var(--brand-secondary);
    text-underline-offset: 2px;

    &:is(:hover, :focus-visible) {
      color: var(--brand-primary);
    }
  }

  .button {
    text-decoration: none;
    color: currentColor;
    display: inline-flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.7em 1.3em;
    border-radius: 0.5em;
    background-color: var(--btn-bg, var(--base));
    color: var(--btn-color, var(--bg-body));
    transition: all 0.2s ease;

    &:is(:hover, :focus-visible) {
      background-color: hsl(from var(--btn-bg) h s calc(l - 15));
      color: var(--btn-color-hover, var(--bg-body));
    }
  }

  .button[data-variant="primary"] {
    --btn-bg: var(--brand-primary);
    --btn-color: var(--bg-body);
  }

  .button[data-variant="secondary"] {
    --btn-bg: var(--brand-secondary);
    --btn-color: var(--bg-body);
  }

  .button svg {
    height: 1em;
    width: auto;
  }

  section {
    width: 100%;
    padding: var(--space-4xl) var(--space-l);
  }

  .wrapper {
    width: min(1170px, 100%);
    margin-inline: auto;
  }

  h1 {
    font-size: var(--text-4xl);
    line-height: 1.15;
  }
  h2 {
    font-size: var(--text-3xl);
    line-height: 1.2;
  }
  h3 {
    font-size: var(--text-2xl);
    line-height: 1.3;
  }
}

/* Header */

.header {
  padding-block: var(--space-s);
}

.header__logo {
  width: clamp(18.75rem, 14.4022rem + 14.4928vw, 25rem);
}

/* Main */

.hero {
  padding-top: var(--space-3xl);
}

.hero__heading {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-xl);
}

.hero__content ul {
  margin-block: 0.75em 0;
  display: grid;
  gap: 0.5em;
  padding-left: max(1.5em, var(--space-l));
}

.hero__content li::marker {
  color: var(--brand-secondary);
}

.hero__button {
  margin-top: 1.5em;
}

/* Footer */

.footer {
  padding-block: var(--space-m);
}

.footer__wrapper {
  display: flex;
  gap: var(--space-l);
  justify-content: space-between;
  align-items: center;
}

.footer__wrapper p {
  margin: 0;
}

@media (max-width: 767px) {
  .footer__wrapper {
    flex-direction: column;
  }

  .footer__wrapper p {
    text-align: center;
    text-wrap: balance;
  }
}
