/* Base styles */

*,
*::before,
*::after{box-sizing: border-box}

body {
  font-family: "Roboto", sans-serif;
  color: #434455;
  background-color: #ffffff;
  margin: 0;
}

:root {
  --icon-color: #f4f4fd;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin-top: 0;
  margin-bottom: 0;
}

ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

.container {
  max-width: 1158px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 15px 0 15px;
}


/* Header */

.container{
  width: 1158px;
  padding: 0 15px;
  margin: 0 auto;
}

.hero-section {
  background-color: #2e2f42;
  background-image: linear-gradient(rgba(46, 47, 66, 0.7),
          rgba(46, 47, 66, 0.7)),
      url(/images/people-office\ 1.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  max-width: 1440px;
  margin: 0 auto;
  padding: 188px 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.page-header {
  border-bottom: 1px solid #e7e9fc;
  box-shadow: 
    0px 2px 1px rgba(46, 47, 66, 0.08),
    0px 1px 1px rgba(46, 47, 66, 0.16),
    0px 1px 6px rgba(46, 47, 66, 0.08);
}

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

.nav-header {
  display: flex;
  align-items: center;
}

.web-logo {
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.17;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4d5ae5;
  text-decoration: none;
  margin-right: 76px;
  padding: 24px 0;
}

.studio-text {
  color: #2e2f42;
}

.header-list {
  display: flex;
  align-items: center;
  gap: 40px;
}

.header-list li:first-child .nav-link {
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}



.nav-link.current {
  position: relative;
  color: #404bbf; 
}

.nav-link.current::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 4px;
  width: 100%;
  background-color: #404bbf; 
  border-radius: 2px;
}


.nav-link {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #2e2f42;
  text-decoration: none;
  padding: 24px 0;
}

.nav-link:hover,
.nav-link:focus {
  color: #404bbf;
}

.contact-list {
  display: flex;
  gap: 40px;
  padding-left: 0;
  margin: 0;
  font-style: normal;
  list-style: none;
}

.contact-list li:first-child .contact-link {
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-list li:nth-child(2) .contact-link {
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}


.contact-link {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
  text-decoration: none;
}

.contact-link:hover,
.contact-link:focus {
  color: #404bbf;
}

.nav-link,
.contact-link {
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}


/* Hero section */
.hero-section {
  text-align: center;
  background-color: #2e2f42;
  color: #ffffff;
  padding: 188px 0;
  background-image: linear-gradient(rgba(46, 47, 66, 0.7),
                                    rgba(46, 47, 66, 0.7)),
                    url("../images/people-office.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.hero-title {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: 0.02em;
  text-align: center;
  max-width: 496px;
  margin: 0 auto 48px auto;
}

.hero-button {
  display: block;
  margin: auto;
  padding: 16px 32px;
  height: 56px;
  min-width: 169px;
  background-color: var(--primary-accent, #4d5ae5);
  color: #ffffff;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 4px;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-button:hover,
.hero-button:focus {
  background-color: #404bbf;
}

/*Features*/
.features-section {
  background-color: #ffffff;
  color: #2e2f42;
  padding-top: 120px;
  padding-bottom: 120px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.features-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.features-item {
  width: calc((100% - 72px) / 4);
}

.features-image-box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 240px; 
  height: 112px;
  border: 1px solid #8e8f99; 
  border-radius: 4px;
  background-color: #f4f4fd;
  margin-bottom: 8px;
}

.features-image-box .icon {
  width: 64px;
  height: 64px;
}

.features-title {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #2e2f42;
  margin-bottom: 8px;
  text-align: left;
}

.features-text {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
  margin: 0;
  text-align: left;
}


/* SECTION 3 */
.section-three {
  background-color: #f4f4fd;
  padding: 120px 0;
}

.section-three svg {
  fill: var(--icon-color); 
}

.section-title {
  font-size: 36px;
  line-height: 1.11;
  text-align: center;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  color: #2e2f42;
  margin-bottom: 72px;
}

.card-list {
  display: flex;
  gap: 24px;
  padding-left: 0;
  margin: 0;
  list-style: none;
  fill: #f4f4fd
}

.card-item {
  background-color: #ffffff;
  width: calc((100% - 72px) / 4);
  border-radius: 0 0 4px 4px;
}

.card-item:first-child {
  box-shadow: 0px 1px 6px rgba(46, 47, 66, 0.08),
              0px 1px 1px rgba(46, 47, 66, 0.16),
              0px 2px 1px rgba(46, 47, 66, 0.08);
}


.card-content{
  padding: 32px 0 32px 0; 
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-title {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #2e2f42;
  text-align: center;
  margin-bottom: 8px;
}

.card-text {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
  text-align: center;
}

.team-icon-list {
  display: flex;
  justify-content: center;
  gap: 24px; 
  padding: 0;
  margin-top: 16px; 
  list-style: none;
}

.team-icon-list-item {
  display: flex;
}

.team-icons {
  width: 24px;
  height: 24px;
  fill:#f4f4fd;
}

.icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: #4d5ae5;
  border-radius: 50%;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-link:hover,
.icon-link:focus {
  background-color: #404bbf;
}

.team-icons {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}


/* SECTION 4 */

.section-four{
  padding:120px 0 120px 0;
}

.container {
  width: 100%;
  max-width: 1158px;
  margin: 0 auto;
  padding: 0 15px;
}

.project-title{
  font-size: 36px;
  line-height: 1.11;
  text-align: center;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  color: #2e2f42;
  margin-bottom: 72px;
}

.project-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: 48px;

}

.portfolio-top{
  position:relative;
  overflow: hidden;

}

.portfolio-top:hover .overlay-text {
  transform: translateY(0); 
  opacity: 1;
}


.overlay-text{
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: #4d5ae5;
  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #f4f4fd;
  padding: 40px 32px;
}

.project-item {
  width: calc((100% - 48px) / 3);
      transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.project-item:hover {
box-shadow: 0 2px 1px 0 rgba(46, 47, 66, 0.08),
  0 1px 1px 0 rgba(46, 47, 66, 0.16), 0 1px 6px 0 rgba(46, 47, 66, 0.08);
}

.project-item {
  width: calc((100% - 48px) / 3);
  
}

.project-card{
  padding: 32px 16px;
  border: 1px solid #e7e9fc;
  border-top: none;
}

.project-subtitle {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #2e2f42;
  margin-bottom: 8px;
}

.project-text {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
}

.card-list,
.features-list {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding-left: 0;
  margin: 0;
}


/* FOOTER */
.page-footer {
  background-color: #2e2f42;
  padding: 100px 0;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.footer-info {
  margin-right: 120px;
}

.footer-logo {
  display: inline-block;
  margin-bottom: 16px;
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.17;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4d5ae5;
  text-decoration: none;
}

.logo-span {
  color: #f4f4fd;
}

.footer-text {
  max-width: 264px;
  line-height: 1.5;
  color: #f4f4fd;
  letter-spacing: 0.02em;
  margin: 0;
}

.social-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card-social-list-footer {
  gap: 16px;
  display: flex;
}

.card-social-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  fill: #f4f4fd;
}

.team-social {
  width: 40px;
  height: 40px;
}

.social-link-footer {
  background-color: #4d5ae5;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link-footer:hover,
.social-link-footer:focus {
  background-color: #31d0aa;
}


.media-title {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #fff;
  margin-bottom: 16px;
}
