:root {
  --title-text-color: rgba(33, 33, 33, 1);
  --lead-text-color: #757575;
  --accent-color: #2196f3;
  --primary-white-color: #ffffff;
  --secondary-background-color: #f5f4fa;
  --background-color: #2f303a;
  --background-button: #188ce8;
  --footer-text-color: rgba(255, 255, 255, 0.6);
  --card-shadow: 0px 1px 3px rgba(0, 0, 0, 0.12), 0px 1px 1px rgba(0, 0, 0, 0.14),
    0px 2px 1px rgba(0, 0, 0, 0.2);
  --card-shadow-portfolio: rgba(238, 238, 238, 1);
  --button-shadow: 0px 3px 1px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.08),
    0px 2px 2px rgba(0, 0, 0, 0.12);
  --icon-color: rgba(175, 177, 184, 1);
  --portfolio-shadow: 0px 1px 1px rgba(0, 0, 0, 0.12), 0px 4px 4px rgba(0, 0, 0, 0.06),
    1px 4px 6px rgba(0, 0, 0, 0.16);
  --timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  --effect-duration: 250ms;
}

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

ul,
ol {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
}

img {
  display: block;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.link {
  text-decoration: none;
}

body {
  margin: 0;
  background-color: var(--primary-white-color);
  color: var(--title-text-color);

  font-family: Roboto, sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.14;
  letter-spacing: 0.03em;
}

/* Utilities  */

.container {
  width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

.section {
  padding-top: 94px;
  padding-bottom: 94px;
}

.visually-hidden {
  position: absolute;
  clip: rect(0 0 0 0);
  width: 1px;
  height: 1px;
  margin: -1px;
}

/* Logo */

.accent {
  color: var(--accent-color);
}

.logo {
  margin-right: 93px;

  color: var(--title-text-color);
  font-family: Raleway;

  font-size: 26px;
  line-height: 1.19;
  text-decoration: none;
}

/* Site nav */

.main-nav,
.site-nav,
.auth-nav {
  display: flex;
  align-items: center;
}

.auth-nav {
  margin-left: auto;
}

.header {
  border: 1px solid #ececec;
}

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

.header-item {
  position: relative;
}

.header-item:not(:last-child) {
  margin-right: 50px;
}

.site-nav .link {
  display: inline-block;
  padding-top: 32px;
  padding-bottom: 32px;

  color: var(--title-text-color);

  letter-spacing: 0.02em;
  text-decoration: none;

  transition: color var(--effect-duration) var(--timing-function);
}

.site-nav .link:hover,
.site-nav .link:focus {
  color: var(--accent-color);
}

.site-nav .link.current {
  color: var(--accent-color);
}

.auth-nav {
  color: var(--lead-text-color);
}

.auth-list:hover,
.auth-list:focus {
  color: var(--accent-color);
}

.auth-list {
  display: flex;
  align-items: center;
  color: inherit;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding-top: 32px;
  padding-bottom: 32px;

  transition: color var(--effect-duration) var(--timing-function);
}

.contact-icons {
  fill: currentColor;
  margin-right: 10px;
}

.current-page {
  color: var(--accent-color);
}

.current-page::after {
  position: absolute;
  content: '';
  display: block;
  width: 100%;
  height: 4px;
  background-color: var(--accent-color);
  border-radius: 2px;
  bottom: -1px;
}

/* Hero */

.hero-section {
  margin-left: auto;
  margin-right: auto;
  max-width: 1600px;
  min-height: 600px;
  background-repeat: no-repeat;
  background-position: center;
  background-image: linear-gradient(rgba(47, 48, 58, 0.4), rgba(47, 48, 58, 0.4)),
    url('../images/hero/bg.jpg');
  background-color: #c4c4c4;
}

.hero-align {
  margin-left: auto;
  margin-right: auto;
  width: 696px;
  padding-top: 200px;
  padding-bottom: 200px;
  text-align: center;
}

.hero-title {
  margin-top: 0;
  margin-bottom: 30px;

  color: var(--primary-white-color);

  font-weight: 900;
  font-size: 44px;
  line-height: 1.36;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Button */

.button {
  color: var(--primary-white-color);
  background-color: var(--accent-color);

  border: none;
  border-radius: 4px;
  padding: 10px 32px;

  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.87;
  letter-spacing: 0.06em;

  transition: background-color var(--effect-duration) var(--timing-function);
}

.button-hero:hover,
.button-hero:focus {
  background-color: var(--background-button);
}

.button-nav {
  display: flex;
  justify-content: center;
  margin-bottom: 50px;
}

.button-align {
  margin-right: 8px;
}

.button-align:last-of-type {
  margin-right: 0;
}

.button-nav .link:hover,
.button-nav .link:focus {
  color: var(--primary-white-color);
  background-color: var(--accent-color);
}

.portfolio-button {
  color: var(--title-text-color);
  background-color: var(--secondary-background-color);

  font-weight: 500;
  font-size: 16px;
  line-height: 1.63;
  letter-spacing: 0.03em;
  cursor: pointer;
  font-family: inherit;
  border: none;
  border-radius: 4px;
  padding: 6px 22px;

  transition: color var(--effect-duration) var(--timing-function),
    background-color var(--effect-duration) var(--timing-function),
    box-shadow var(--effect-duration) var(--timing-function);
}

.portfolio-button:hover,
.portfolio-button:focus,
.portfolio-button:active {
  color: var(--primary-white-color);
  background-color: var(--accent-color);
  box-shadow: var(--button-shadow);
}

.button-current {
  color: var(--primary-white-color);
  background-color: var(--accent-color);
}

/* Features */

.features-list {
  display: flex;
  flex-wrap: wrap;
  margin-left: -30px;
}

.features-item {
  display: block;
  flex-basis: calc((100% - 120px) / 4);
  margin-left: 30px;
}

.features-title {
  margin-top: 0;
  margin-bottom: 10px;

  font-weight: 700;
  font-size: 14px;
  line-height: 1.14;
  text-transform: uppercase;
}

.features-description {
  margin-bottom: 0;

  color: var(--lead-text-color);

  font-weight: 400;
  font-size: 14px;
  line-height: 1.71;
}

.features-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 120px;
  background: var(--secondary-background-color);
  border-radius: 4px;
  text-align: center;
  margin-bottom: 30px;
}

/* Work */

.work-section {
  padding-top: 0;
}

.section-title {
  margin-top: 0;
  margin-bottom: 50px;

  font-size: 36px;
  line-height: 1.16;
  text-align: center;
}

.work-list {
  display: flex;
  flex-wrap: wrap;
  margin-left: -30px;
  margin-top: -30px;
}

.work-item {
  position: relative;
  flex-basis: calc((100% - 90px) / 3);
  margin-left: 30px;
  margin-top: 30px;
}

.work-name {
  position: absolute;
  width: 370px;
  height: 70px;
  background-color: rgba(47, 48, 58, 0.8);
  left: 0;
  bottom: 0;
  text-align: center;
  padding-top: 27px;
}

.work-name-title {
  color: var(--primary-white-color);
  margin-top: 0;
  margin-bottom: 0;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.14;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Team section */

.team-section {
  background-color: var(--secondary-background-color);
}

.team-list {
  display: flex;
  flex-wrap: wrap;
  margin-right: calc(-1 * 30px);
}

.team-item {
  flex-basis: calc((100% - 120px) / 4);
  margin-right: 30px;
  background-color: var(--primary-white-color);
  box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.12), 0px 1px 1px rgba(0, 0, 0, 0.14),
    0px 2px 1px rgba(0, 0, 0, 0.2);
  border-radius: 0px 0px 4px 4px;
}

.team-border {
  display: block;
  text-align: center;
  padding: 30px 0;
  box-shadow: var(--card-shadow);
  border-radius: 4px;
}

.team-title {
  margin-bottom: 10px;

  font-weight: 500;
  font-size: 16px;
  line-height: 1.18;
  text-align: center;
}

.team-description {
  text-align: center;
  margin-top: 0px;
  margin-bottom: 16px;
}

.icon-block {
  display: flex;
  justify-content: center;
}

.icon-block-container {
  width: 44px;
  height: 44px;
}

.icon-block-container:not(:last-child) {
  margin-right: 10px;
}

.team-block-icon {
  color: var(--icon-color);
  display: inline-block;
  border-radius: 50%;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;

  transition: background-color var(--effect-duration) var(--timing-function),
    color var(--effect-duration) var(--timing-function);
}

.team-block-icon:hover,
.team-block-icon:focus {
  color: var(--primary-white-color);
  background-color: var(--accent-color);
}

.team-icon {
  fill: currentColor;
  align-self: center;
}

/* Clients */

.clients-list {
  display: flex;
  flex-wrap: wrap;
  margin-right: calc(-1 * 30px);
}

.clients-item {
  flex-basis: calc(100% / 6 - 30px);
  margin-right: 30px;
}

.client-logo {
  fill: currentColor;
}

.client-link {
  color: var(--icon-color);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 170px;
  height: 92px;
  border: 1px solid var(--icon-color);
  border-radius: 4px;

  transition: color var(--effect-duration) var(--timing-function),
    border var(--effect-duration) var(--timing-function);
}

.client-link:hover,
.client-link:focus {
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

/* Footer */

.footer-section {
  padding-top: 60px;
  padding-bottom: 60px;

  background-color: var(--background-color);
}

.footer-logo {
  color: var(--primary-white-color);

  display: inline-block;
  margin-bottom: 20px;
  margin-right: 0;
}

.adress-info,
.contacts {
  color: var(--primary-white-color);

  font-weight: 400;
  font-size: 14px;
  line-height: 1.71;
  font-style: normal;
  text-decoration: none;
}

.contacts-align {
  display: block;
  margin-top: 9px;
}

.contacts {
  color: var(--footer-text-color);
}

.footer-blocks {
  display: flex;
  align-items: baseline;
}

.footer-contacts {
  margin-right: 70px;
}

.footer-join {
  color: var(--primary-white-color);
}

.join-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.14;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: 0;
  margin-bottom: 20px;
}

.join-link {
  display: inline-block;
  color: var(--primary-white-color);
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;

  transition: background-color var(--effect-duration) var(--timing-function);
}

.join-link:hover,
.join-link:focus {
  background-color: var(--accent-color);
}

.join-icons {
  display: flex;
  justify-content: center;
}

.join-icon-container {
  width: 44px;
  height: 44px;
}

.join-icon-container:not(:last-child) {
  margin-right: 10px;
}

.join-icon {
  fill: currentColor;
  align-self: center;
}

/* Projects */

.projects {
  display: flex;
  flex-wrap: wrap;
  margin-left: -30px;
  margin-top: -30px;
}

.projects-item {
  flex-basis: calc((100% - 90px) / 3);
  margin-left: 30px;
  margin-top: 30px;
}

.projects-title {
  text-decoration: none;
  color: inherit;
}

.projects-name {
  margin-bottom: 4px;

  font-weight: 700;
  font-size: 18px;
  line-height: 2;
  letter-spacing: 0.06em;
}

.projects-description,
.team-description {
  color: var(--lead-text-color);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.88;
  letter-spacing: 0.03em;
}

.projects-border {
  padding: 20px 24px;
  border-right: 1px solid var(--card-shadow-portfolio);
  border-left: 1px solid var(--card-shadow-portfolio);
  border-bottom: 1px solid var(--card-shadow-portfolio);
}

.project-bg {
  display: inline-block;
}

.project-bg:hover,
.project-bg:focus {
  box-shadow: var(--portfolio-shadow);
}

.description {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(33, 150, 243, 0.9);
  color: var(--primary-white-color);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.56;
  letter-spacing: 0.03em;
  margin: 0;
  padding: 62px 24px;
  overflow: auto;

  transition: transform var(--effect-duration) var(--timing-function);
}

.description-list {
  position: relative;
  overflow: hidden;
}

.description-wrapper:hover .description,
.description-wrapper:focus .description {
  transform: translateY(-100%);
}

/* Modals */

.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.2);
  opacity: 1;
  transition: opacity 500ms var(--timing-function);
}

.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal {
  position: absolute;
  width: 528px;
  height: 581px;
  background-color: var(--primary-white-color);
  box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.12), 0px 1px 1px rgba(0, 0, 0, 0.14),
    0px 2px 1px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);

  transition: transform 500ms var(--timing-function), visibility 500ms var(--timing-function);
}

.backdrop.is-hidden .modal {
  transform: translate(-50%, -50%) scale(0.5);
}

.close {
  position: absolute;
  background-color: transparent;
  height: 30px;
  top: 8px;
  right: 8px;
  border: none;
  cursor: pointer;
  padding: 0;
}
