* {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  text-decoration: none;
  list-style: none;
  box-sizing: border-box;
}

:root {
  --color-primary: #7562e0;
  --color-primary-variant: rgba(102, 0, 255, 0.2);
  --color-white: #fff;
  --color-light: #f5f5f5;
  --color-black: #0f0f1b;
  --color-dark: #4b4a53;

  --container-width-lg: 82%;
  --container-width-md: 90%;
  --container-width-sm: 92%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  color: var(--color-dark);
  line-height: 1.7;
}

h1,
h2,
h3,
h4,
h5 {
  color: var(--color-black);
}

h1 {
  font-size: 4.4rem;
  line-height: 1.1;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.6rem;
}

h4 {
  font-size: 1.4rem;
}

h5 {
  font-size: 1rem;
}

.lead {
  width: 63%;
  line-height: 1.5;
  margin: 0 auto 3rem;
  text-align: center;
}

img {
  width: 100%;
  object-fit: cover;
}

.container {
  width: var(--container-width-lg);
  max-width: 1800px;
  margin: 0 auto;
}

section {
  padding: 6rem 0;
  margin: 5rem 0;
}

.btn {
  background: var(--color-black);
  color: var(--color-white);
  display: inline-block;
  width: fit-content;
  padding: 0.8rem 1.6rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 400ms ease;
}

.btn:hover {
  background: var(--color-light);
  color: var(--color-black);
}

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

.btn-primary:hover {
  border-color: var(--color-primary);
  background: var(--color-light);
  color: var(--color-primary);
}

.btn-lg {
  padding: 1.1rem 2rem;
  font-size: 1.2rem;
}

/* =================== NAVBAR ================== */
nav {
  width: 100vw;
  height: 5rem;
  display: grid;
  place-items: center;
  position: fixed;
  z-index: 2;
}

/* changes navbar styles on window scroll using javascript */
.window-scroll {
  background: var(--color-black);
  box-shadow: 0 1.5rem 1.5rem rgba(36, 0, 64, 0.2);
}

.window-scroll a {
  color: var(--color-white);
}

.window-scroll .nav__logo h3 {
  color: var(--color-white);
}

nav a {
  color: var(--color-black);
  font-size: 0.9rem;
  transition: all 400ms ease;
}

nav a:hover {
  color: var(--color-primary);
}

.nav__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* open and close buttons for tablets and phones */
nav button {
  display: none;
}

.nav__menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4rem;
}

/* ===================== HEADER ========================== */
header {
  height: calc(100vh - 5rem);
  position: relative;
  top: 5rem;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.header__container {
  display: grid;
  grid-template-columns: 40% 60%;
  height: 100%;
}

.header__left {
  display: flex;
  align-items: center;
  height: 100%;
}

.header__left h3 {
  color: var(--color-primary);
  margin-bottom: 0.6rem;
}

.header__left p {
  margin: 1.2rem 0 2rem;
}

.header__right {
  position: relative;
  height: 100%;
}

.header__socials {
  position: absolute;
  right: 0;
  bottom: 8rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  font-size: 1.2rem;
}

.header__socials a {
  color: var(--color-white);
  transition: all 400ms ease;
}

.header__socials a:hover {
  color: var(--color-black);
}

.header__right-bg {
  width: 70rem;
  height: 70rem;
  border-radius: 50%;
  background: var(--color-primary);
  position: absolute;
  right: -30rem;
  bottom: -30rem;
}

.header__image {
  width: 82%;
  position: absolute;
  bottom: -1rem;
  z-index: 1;
}

/* ================= COMPANIES ============== */
section#companies {
  position: relative;
  top: 5rem;
  padding: 0;
  background: var(--color-light);
  margin: 0;
}

.companies__container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2rem;
  align-items: center;
}

.companies__container span {
  padding: 2.4rem;
}

/* ================= SERVICES ============== */
section#services {
  margin-top: 8rem;
}

.services__container {
  display: grid;
  grid-template-columns: 25% auto;
  gap: 2rem;
}

.services__left {
  background: var(--color-primary);
  padding: 2rem;
  color: var(--color-light);
}

.services__left h1 {
  font-size: 7rem;
  font-weight: 600;
  color: var(--color-white);
}

.services__left h4 {
  line-height: 1.4;
  font-weight: 600;
  color: var(--color-white);
}

.services__right h2 {
  margin-bottom: 2rem;
}

.services__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.services__card {
  background: var(--color-light);
  padding: 4rem 2rem;
  cursor: default;
  transition: all 400ms ease;
}

.services__card:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.services__card:hover * {
  color: var(--color-white);
  transition: all 400ms ease;
}

.services__card-icon {
  font-size: 2rem;
}

.services__card h5 {
  margin: 1rem 0;
}

.services__card:hover a {
  margin-left: 1rem;
}

/* ================= PORTFOLIO ============== */
#portfolio {
  background: var(--color-light);
}

.portfolio__head {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
}

.portfolio__head h3 {
  width: 25%;
}

.portfolio__head-right {
  width: 49%;
}
.portfolio__head-right a {
  margin-top: 1.4rem;
  display: inline-block;
  color: var(--color-primary);
  transition: all 400ms ease;
}

.portfolio__head-right a:hover {
  margin-left: 1rem;
}

.portfolio__projects {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.portfolio__project {
  display: flex;
  flex-direction: column;
  align-items: space-between;
  gap: 1rem;
}

.portfolio__project-image {
  height: 20rem;
  display: block;
  border: 1rem solid var(--color-white);
  overflow: hidden;
  box-shadow: 0 0 1.6rem var(--color-primary-variant);
  transition: all 400ms ease;
}

.portfolio__project-image:hover {
  box-shadow: none;
}

.portfolio__project-image img {
  transform: 0;
  transition: all 12s ease;
}

.portfolio__cta {
  display: flex;
  gap: 1rem;
}

/* 18rem because project image height is 20rem + 1rem of border top and bottom */
.portfolio__project-image:hover img {
  transform: translateY(calc(-100% + 18rem));
}

/* ================= TESTIMONIALS ============== */
#testimonials h2 {
  text-align: center;
}

.testimonials__container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.testimonial {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  background: var(--color-light);
  padding: 3rem;
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: all 400ms ease;
}

.testimonial:hover {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 3rem 2rem var(--color-primary-variant);
  z-index: 1;
}

.avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  overflow: hidden;
  display: block;
}

.testimonial__client {
  display: flex;
  gap: 1rem;
}

/* ================= CONTACT ============== */
#contact {
  background: var(--color-primary);
  color: var(--color-white);
  margin: 0;
}

.contact__container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8rem;
  font-size: 0.9rem;
}

.contact__container h2 {
  color: var(--color-white);
}

.contact__container p {
  margin: 1rem 0 2rem;
}

.contact__socials {
  display: flex;
  gap: 1rem;
}

.contact__socials a {
  color: var(--color-white);
  font-size: 1.3rem;
  transition: all 400ms ease;
}

.contact__socials a:hover {
  color: var(--color-black);
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

form input,
textarea {
  padding: 1rem;
}

footer {
  text-align: center;
  background: var(--color-primary);
  padding: 1.2rem 0;
  color: var(--color-white);
  border-top: 1px solid var(--color-black);
}

/* =================== MEDIA QUERIES (TABLETS) =================== */
@media screen and (max-width: 1024px) {
  h1 {
    font-size: 3.6rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  .container {
    width: var(--container-width-md);
  }

  .lead {
    margin-top: 0.6rem;
  }

  /* ============== NAVBAR ============== */
  nav {
    background: var(--color-black);
  }

  .nav__container {
    position: relative;
    width: 100vw;
  }

  .nav__logo h3 {
    color: var(--color-white);
    margin-left: 2rem;
  }

  .nav__menu {
    position: fixed;
    top: 5rem;
    right: 0;
    height: fit-content;
    width: 18rem;
    flex-direction: column;
    gap: 0;
    z-index: 3;
    display: none;
    perspective: 400px;
  }

  .nav__menu li {
    width: 100%;
    height: 5.4rem;
    opacity: 0;
    animation: flipNavItem 200ms 0s ease forwards;
    transform-origin: top;
  }

  .nav__menu li:nth-child(2) {
    animation-delay: 100ms;
  }
  .nav__menu li:nth-child(3) {
    animation-delay: 200ms;
  }
  .nav__menu li:nth-child(4) {
    animation-delay: 300ms;
  }
  .nav__menu li:nth-child(5) {
    animation-delay: 400ms;
  }

  @keyframes flipNavItem {
    from {
      transform: rotateX(90deg);
    }

    to {
      transform: rotateX(0deg);
      opacity: 1;
    }
  }

  .nav__menu li a {
    background: var(--color-primary);
    box-shadow: -2rem 2rem 2rem rgba(0, 0, 0, 0.2);
    color: var(--color-white);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav__menu li a:hover {
    background: var(--color-light);
    color: var(--color-black);
  }

  nav button {
    display: inline-block;
    margin-right: 1.4rem;
    background: transparent;
    color: var(--color-white);
    cursor: pointer;
    font-size: 2.4rem;
  }

  nav button#close-menu-btn {
    display: none;
  }

  /* ============== HEADER ============== */
  header {
    height: 100%;
    padding: 14rem 0 0;
  }

  .header__container {
    align-items: flex-end;
    height: 100%;
  }

  .header__left {
    margin-bottom: 6rem;
  }

  .header__right {
    align-self: flex-end;
    height: 100%;
  }

  .header__right-bg {
    width: 30rem;
    height: 30rem;
    right: 50%;
    bottom: 50%;
    transform: translate(50%, 50%);
  }

  .header__image {
    bottom: -1rem;
    width: 100%;
  }

  .header__socials {
    bottom: 4rem;
  }

  .header__socials a {
    color: var(--color-primary);
  }

  /* ============== COMPANIES ============== */
  .companies__container {
    gap: 0;
  }

  .companies__container span {
    padding: 1.5rem;
  }

  /* ============== SERVICES ============== */
  .services__container {
    grid-template-columns: 1fr;
  }

  .services__left {
    display: none;
  }

  .services__cards {
    gap: 1rem;
  }
  /* ============== PORTFOLIO ============== */
  .portfolio__head h3 {
    width: 40%;
  }

  .portfolio__head-right {
    width: auto;
  }

  /* ============== TESTIMONIALS ============== */
  .testimonials__container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* ============== CONTACT ============== */
  .contact__container {
    gap: 2rem;
  }

  .contact__socials a {
    font-size: 1.7rem;
  }
}

/* ============ MEDIA QUERIES (PHONES) ============== */
@media screen and (max-width: 600px) {
  .container {
    width: var(--container-width-sm);
  }

  section {
    padding: 4rem 0;
    margin: 4rem 0;
  }

  h1 {
    font-size: 2.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  .btn-lg {
    font-size: 1rem;
  }

  .lead {
    width: var(--container-width-sm);
  }

  /* ================= NAVBAR ============== */
  nav button {
    margin: 0;
    font-size: 1.9rem;
  }

  .nav__logo h3 {
    margin-left: 4px;
  }

  /* ================= HEADER ============== */
  header {
    height: 100vh;
    padding: 0;
  }

  .header__container {
    grid-template-columns: 1fr;
    margin-top: 4.4rem;
    gap: 0;
  }

  .header__left {
    text-align: center;
    margin-bottom: 2rem;
  }

  .header__left p {
    margin: 0.5rem 0 1.2rem;
  }

  .header__image {
    position: relative;
    top: -2rem;
  }

  .header__right-bg {
    bottom: 36%;
  }

  .header__socials {
    position: absolute;
    z-index: 1;
    bottom: 11rem;
  }

  .header__socials a {
    color: var(--color-white);
  }

  /* ================= COMPANIES ============== */
  .companies__container {
    grid-template-columns: repeat(3, 1fr);
  }

  .companies__container span {
    height: 5rem;
    display: grid;
    place-items: center;
  }

  /* ================= SERVICES ============== */
  .services__cards {
    grid-template-columns: 1fr;
  }

  /* ================= PORTFOLIO ============== */
  .portfolio__head {
    flex-direction: column;
    gap: 1fr;
  }

  .portfolio__head h3,
  .portfolio__head-right {
    width: var(--container-width-sm);
  }

  .portfolio__projects {
    grid-template-columns: 1fr;
  }

  .portfolio__cta {
    justify-content: center;
  }

  /* ================= TESTIMONIALS ============== */
  .testimonial {
    padding: 1rem;
  }

  /* ================= CONTACT ============== */
  .contact__container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .contact__socials {
    justify-content: center;
  }
}
