/* Fonts */
@font-face {
  font-family: "TTHovesPro";
  src: url("assets/fonts/TTHovesProItalic/font.woff2") format("woff2"),
    url("assets/fonts/TTHovesProItalic/font.woff") format("woff");
  font-style: italic;
}

@font-face {
  font-family: "TTHovesPro";
  src: url("assets/fonts/TTHovesProMedium/font.woff2") format("woff2"),
    url("assets/fonts/TTHovesProMedium/font.woff") format("woff");
  font-weight: 500;
}

@font-face {
  font-family: "TTHovesPro";
  src: url("assets/fonts/TTHovesProRegular/font.woff2") format("woff2"),
    url("assets/fonts/TTHovesProRegular/font.woff") format("woff");
  font-weight: normal;
}
@font-face {
  font-family: "TTHovesPro";
  src: url("assets/fonts/TTHovesProExtraBold/font.woff2") format("woff2"),
    url("assets/fonts/TTHovesProExtraBold/font.woff") format("woff");
  font-weight: 800;
}
@font-face {
  font-family: "TTHovesPro";
  src: url("assets/fonts/TTHovesProLight/font.woff2") format("woff2"),
    url("assets/fonts/TTHovesProLight/font.woff") format("woff");
  font-weight: 300;
}
@font-face {
  font-family: "TTHovesPro";
  src: url("assets/fonts/TTHovesProDemiBold/font.woff2") format("woff2"),
    url("assets/fonts/TTHovesProDemiBold/font.woff") format("woff");
  font-weight: 600;
}
@font-face {
  font-family: "TTHovesPro";
  src: url("assets/fonts/TTHovesProBold/font.woff2") format("woff2"),
    url("assets/fonts/TTHovesProBold/font.woff") format("woff");
  font-weight: bold;
}

:root {
  --contact-subtitle-color: #6d6d6d;
  --neutral-color: #898989;
  --card-bg-color: #f2f2f2;
  --primary-color: #e0fe60;

  --heading-font-size: 2.125rem;

  --padding-inline: 1.25rem;
  --content-max-width: 1300px;
  --breakout-max-width: 1600px;

  --menu-animation-timing: 200ms ease-in-out;
  --hamburger-gap: 4px;
  --hamburger-height: calc(2px * 3 + var(--hamburger-gap) * 2);

  --progress-bar-width: 0%;

  --link-button__icon-size: 53px;
}

/* Reset browser styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

html {
  font-family: "TTHovesPro", sans-serif;
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;

  scroll-behavior: smooth;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;

  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  row-gap: 5rem;
  padding-bottom: 5rem;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure {
  margin: 0;
  overflow-wrap: break-word;
}

p {
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: 2rem;
  text-wrap: balance;
  line-height: 1.1;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;

  &:hover,
  &:focus {
    text-decoration: underline;
  }
}

.link-button__layout a {
  text-decoration: none;
}

:target {
  scroll-margin-block: 5ex;
}

/* Links styles in header and footer reset */
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.875rem;
}

nav a {
  font-weight: 500;
}

/* Header */
.header {
  position: relative;
  padding-block: 0.75rem;
  margin-block-end: 3rem;
  z-index: 10;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--progress-bar-width);
  border-bottom: 10px solid var(--primary-color);
  transition: width 0.1s ease-out;
  z-index: 100;
}

.header__layout {
  display: flex;
  align-items: center;
  justify-content: end;
}

.header-logo {
  position: absolute;
  left: 0;
  top: 76px;
  z-index: 10;
  width: auto;
  height: 57px;
}

.nav__layout--mobile {
  display: flex;
  gap: 2px;
}

.menu-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.125rem;
  width: 50px;
  height: 50px;
  border-radius: 100px;
  outline: 1px solid #000;
}

.hamburger-btn {
  --square-root-of-two: 1.41421356237;
  --x-width: calc(var(--hamburger-height) * var(--square-root-of-two));

  flex-direction: column;
  gap: var(--hamburger-gap);
  background-color: #fff;
  border: 0;
  padding: 0;
  outline: 1px solid rgba(0, 0, 0, 0.4);

  cursor: pointer;

  &:focus-visible {
    outline: 2px solid blue;
  }

  & span {
    display: block;

    width: 18px;
    height: 2px;
    background: #000;
    transform-origin: center;
    transition: all var(--menu-animation-timing);
  }

  &.active span:first-child {
    width: var(--x-width);
    transform: rotate(45deg) translate(5px, 4px);
  }

  &.active span:nth-child(2) {
    opacity: 0;
    width: 0;
  }

  &.active span:last-child {
    width: var(--x-width);
    transform: rotate(-45deg) translate(4px, -4px);
  }
}

.skip-nav-link {
  background-color: #000;
  position: absolute;
  color: #fff;
  padding: 0.5rem 1.5rem;
  transform: translateY(-120%);
  transition: transform 300ms ease-in;
  z-index: 2000;

  &:focus {
    transform: translateY(30%);
  }
}

/* Main layout */
.content-grid {
  --breakout-size: calc(
    (var(--breakout-max-width) - var(--content-max-width)) / 2
  );

  display: grid;
  grid-template-columns:
    [full-width-start] minmax(var(--padding-inline), 1fr)
    [breakout-start] minmax(0, var(--breakout-size))
    [content-start] min(
      100% - (var(--padding-inline) * 2),
      var(--content-max-width)
    )
    [content-end]
    minmax(0, var(--breakout-size)) [breakout-end]
    minmax(var(--padding-inline), 1fr) [full-width-end];

  container-type: inline-size;
}

.content-grid > :not(.breakout, .full-width),
.full-width > :not(.breakout, .full-width) {
  grid-column: content;
}

.content-grid > .breakout {
  grid-column: breakout;
}

.content-grid > .full-width {
  grid-column: full-width;

  display: grid;
  grid-template-columns: inherit;
}

/* Hero content */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2.375rem;

  & h1 {
    line-height: 1;
  }
}

.hero-text {
  display: flex;
  flex-direction: column;

  gap: 1.25rem;
}

.hero-img--mobile {
  margin-block-end: -3.75rem;
}

/* Section layout */
.section-grid {
  display: grid;

  gap: 2rem 3.75rem;
  grid-template-columns: 1fr;

  & h2 {
    font-weight: normal;
  }
}

.section-grid__clients--gap {
  margin-block-end: 2.375rem;
}

.section-heading {
  color: #949494;
}

.section-content__layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  & h3 {
    margin-block-end: 1.25rem;
  }
}

.client-section-content__layout--gap {
  gap: 1.813rem;
}

/* Cards */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.25rem;

  min-width: 325px;

  padding: 1.25rem;
  background-color: var(--card-bg-color);

  & h3 {
    font-weight: 600;
    font-size: 1.375rem;
  }
}

.card:last-child {
  background-color: var(--primary-color);

  & p {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.25;
  }
}

.card-wrapper {
  display: grid;

  grid-template-columns: 1fr;

  row-gap: 2rem;
}

/* Links */
.link-button__layout {
  display: flex;
  width: fit-content;
}

.link-button {
  display: flex;
  align-items: center;
  background-color: transparent;
  font-weight: 500;
  position: relative;
}

.link-button__icon {
  display: flex;
  padding: 1.125rem;
  width: var(--link-button__icon-size);
  height: var(--link-button__icon-size);
  border-radius: 100px;
  transform: translateX(0) translateY(0) scale(1);
  -webkit-transform: translateX(0) translateY(0) scale(1);
  transition: transform 0.20s ease-in-out;
  -webkit-transition: -webkit-transform 0.20s ease-in-out;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.link-button__text {
  display: block;
  position: relative;
  overflow: hidden;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
  padding-left: 1.625rem;
  padding-right: 1.625rem;
  border: 1px solid var(--neutral-color);
  border-radius: 100px;
  transition: padding 0.20s ease-in-out;
  overflow: hidden;
}

/* Text lines */
.link-button__text .text {
  display: block;
  transition: transform 0.20s ease-in-out;
}

/* Start position */
.text--top {
  transform: translateY(0);
}
.text--bottom {
  position: absolute;
  transform: translateY(200%);
}

.link-button__icon--img {
  display: flex;
  overflow: hidden;
}

.link-button__icon--img .icon {
  transition: transform 0.20s ease-in-out;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.link-button__icon--img .icon--right {
  transform: translateX(0);
}

.link-button__icon--img .icon--left {
  transform: translateX(-300%);
}

.link-button__layout:hover .icon--right {
  transform: translateX(200%);
}

.link-button__layout:hover .icon--left {
  transform: translateX(-100%);
}

.link-button__layout:hover .link-button__text {
  padding-right: calc(1.625rem * 2.4);
}

.link-button__layout:hover .text--top,
.link-button__layout:focus .text--top {
  transform: translateY(-200%);
}
.link-button__layout:hover .text--bottom {
  transform: translateY(-100%);
}

.link-button__layout:hover .link-button__icon {
  transform: translateX(calc(-1 * var(--link-button__icon-size))) scale(0.85);
  -webkit-transform: translateX(calc(-1 * var(--link-button__icon-size))) scale(0.85);
}


/* Download section content */
.download__layout {
  position: relative;
  background-color: #212121;

  overflow: hidden;

  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;

  padding-block-start: 8.563rem;
  padding-block-end: 15.438rem;

  & h2 {
    font-weight: 600;
  }

  & span {
    font-size: 1.875rem;
    font-weight: normal;
  }
}

.download-images {
  position: absolute;
}

.download-images--top {
  left: 84px;
  top: -10%;

  width: 144px;
  height: 146px;
  object-fit: cover;

  aspect-ratio: 81 / 38;
}

.download-images--right {
  bottom: 151px;
  right: 0;

  height: 82px;
  min-width: 88px;
  width: fit-content;

  aspect-ratio: 217 / 169;
}

.download-images--bottom {
  bottom: -2%;
  right: 63px;

  height: 106px;
  width: 125px;
}

.download-images--left {
  bottom: 127px;
  left: -26px;

  width: 119px;
  height: 79px;

  aspect-ratio: 107 / 49;
}

/* Contact section content */
.contact-section__layout {
  display: flex;
  flex-direction: column;

  gap: 5rem;
}

.contact-section__item {
  display: flex;
  flex-direction: column;

  gap: 2rem;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-card:not(:last-child) {
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.contact-card img {
  object-fit: cover;
  object-position: center;
}

.contact-card__data {
  display: flex;
  flex-direction: column;

  & h3 {
    font-size: 1rem;
  }
}

.contact-card__subtitle {
  color: var(--contact-subtitle-color);
  margin-bottom: 0.688rem;
}

/* Footer */
.footer {
  background-color: black;

  padding-block-start: 4.25rem;
  padding-block-end: 1.25rem;

  color: var(--neutral-color);
  font-size: 0.813rem;
  font-weight: 500;
}

.footer__layout {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2.5rem;

  flex-shrink: 1;
}

.footer-wrapper__text {
  flex-direction: column-reverse;
  gap: 1rem;
  padding-block-start: 1rem;
}

.footer__svg {
  box-sizing: content-box;
  flex-shrink: 0;
  width: auto;
  height: 57px;
}

.footer-divider {
  margin: 0;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

@layer utilities {
  .bg-color--dark {
    background-color: #000;
  }

  .bg-color--primary {
    background-color: var(--primary-color);
  }
}

/* Responsiveness */
/*
* 48rem = 768px = md
* 64rem = 1024px = lg
* 80rem = 1280px = xl
*/
@container (width < 48rem) {
  .hidden--mobile {
    display: none !important;
  }
}

@container (width >= 48rem) {
  .hidden--desktop {
    display: none !important;
  }

  .section-grid h2 {
    font-size: var(--heading-font-size);
  }

  .card:last-child p {
    font-size: var(--heading-font-size);
  }

  .card-wrapper {
    grid-template-columns: repeat(2, minmax(325px, 1fr));
    column-gap: 2rem;
  }

  .download__layout {
    padding-block-start: 8.188rem;
    padding-block-end: 10.438rem;

    & h2 {
      font-size: 2.5rem;
    }
  }

  .download-images--top {
    left: 200px;
    top: -10px;

    height: 100px;
  }

  .download-images--right {
    top: 57px;
    bottom: unset;

    height: 120px;
  }

  .download-images--bottom {
    right: 130px;
    height: 134px;

    width: 201px;
  }

  .download-images--left {
    bottom: 0;
    left: 0;

    height: 95px;
    width: 143px;
  }

  .contact-card {
    flex-direction: row;
  }

  .contact-card__subtitle {
    margin-bottom: 1rem;
  }

  .footer {
    padding-block-start: 2.75rem;
    padding-block-end: 1.5rem;
  }

  .footer__layout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .footer-wrapper__text {
    flex-direction: inherit;
    gap: inherit;

    padding-right: 13.625rem;
  }

  .footer__svg {
    height: 102px;
  }

  .footer-divider {
    flex: 0 0 100%;
  }
}

@container (width >= 64rem) {
  .card {
    padding: 2.5rem;

    & h3 {
      font-size: var(--heading-font-size);
    }
  }

  .hero {
    grid-template-columns: 1fr 1fr;
    gap: 2.125rem;
    margin-bottom: 0;
  }

  .section-grid:not(:has(.card-wrapper)) {
    grid-template-columns: 343px 1fr;
  }

  .section-grid__clients--gap {
    margin-block-start: -2.125rem;
    margin-block-end: unset;
  }

  .section-content__layout h3 {
    font-size: var(--heading-font-size);
  }

  .contact-section__layout {
    margin-block-start: -4.375rem;
    gap: 6.25rem;
  }
}

@container (width >= 80rem) {
  h1 {
    font-size: 3.125rem;
  }

  .hero {
    grid-template-columns: minmax(740px, 1fr) 1fr;
    gap: 7.125rem;
    margin-bottom: 2.375rem;
  }

  .hero-text {
    padding-block-start: 6.188rem;
  }

  .section-grid {
    grid-template-columns: 343px 1fr;
  }

  .card-wrapper {
    column-gap: 11rem;
  }

  .download__layout h2 {
    font-size: 3.75rem;
  }

  .download-images--top {
    left: 406px;
    top: -29px;

    width: 243px;
    height: 143px;
  }

  .download-images--right {
    top: 58px;
    height: 169px;
  }

  .download-images--bottom {
    right: 431px;
    bottom: -10px;

    width: 266px;
    height: 177px;
  }

  .download-images--left {
    left: 40px;
    bottom: -20px;

    width: 214px;
    height: 142px;
  }
}

@media screen and (width < 48rem) {
  .nav-menu {
    flex-direction: column;
    padding-inline: 1.25rem;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    width: 100%;
    background-color: #fff;
    max-height: 0;
    gap: 0;
    overflow: hidden;
    transition: max-height var(--menu-animation-timing);

    & li {
      padding-block: 2rem;
    }

    & li:not(:last-child) {
      border-bottom: 1px solid rgba(0, 0, 0, 0.4);
    }

    &.active {
      max-height: calc(100vh - 20%);
    }
  }
}

@media screen and (width >= 48rem) {
  .header {
    padding-block: 3.125rem;
  }

  .header-logo {
    top: 106px;
    height: 80px;
  }

  .nav__layout--mobile {
    display: none;
  }
}

@media screen and (width >= 64rem) {
  main {
    row-gap: 10.625rem;
    padding-bottom: 11.5rem;
  }
}

@media screen and (width >= 80rem) {
  .header-logo {
    top: 88px;
    height: unset;
  }
}

/* Legal pages */
.legal-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4rem;

  padding-block-start: 6rem;
  line-height: 1.6;

  & h3 {
    font-size: 1.25rem;
  }

  @container (width < 48rem) {
    & h1 {
      font-size: 2rem;
    }

    & h2 {
      font-size: 1.5rem;
    }
  }
}

.legal-logo {
  height: 100%;
}

.legal-article {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.legal-article.terms {
  & h3 {
    font-size: 1rem;
  }
}

.legal-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.fade-section {
  opacity: 0;
  transform: translateY(100px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-section.visible {
  opacity: 1;
  transform: translateY(0);
}
