:root {
  --primary-font: "Roboto", sans-serif;
  --primary-color: #434455;
  --secondary-font: "Raleway", sans-serif;
  --secondary-color: #2e2f42;
  --logo-color: #4d5ae5;
  --card-background: #ffffff;
  --background-color: #ffffff;
  --footer-text: #f4f4fd;
  --link-hover: #404bbf;
  --border-color: #e7e9fc;
}

/* Box model */

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

/* Global styles */

body {
  font-family: var(--primary-font);
  color: var(--primary-color);
  background-color: var(--background-color);
}

/* reset */

.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;
}

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

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

a {
  text-decoration: none;
}

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

/* Container */

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

/* Section */

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

/* logo */

.logo {
  font-family: var(--secondary-font);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.17;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--logo-color);
}

.logo-part {
  color: var(--secondary-color);
}

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

/* Header */

.page-header {
  border-bottom: 1px solid var(--border-color);
  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);
}

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

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

.header-logo {
  margin-right: 76px;
}

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

.nav-link {
  display: block;
  padding-top: 24px;
  padding-bottom: 24px;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--secondary-color);
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Active nav link with ::after underline pseudo-element */

.nav-link.active {
  position: relative;
  color: var(--link-hover);
}

.nav-link.active::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 4px;
  background-color: var(--link-hover);
  border-radius: 2px;
}

.contacts {
  font-style: normal;
}

.contacts-list {
  display: flex;
  gap: 40px;
}

.contacts-link {
  display: block;
  padding-top: 24px;
  padding-bottom: 24px;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--primary-color);
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.contacts-link:hover,
.contacts-link:focus {
  color: var(--link-hover);
}

/* Hero section */

.hero {
  background-color: var(--secondary-color);
  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-position: center;
  background-size: cover;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 188px;
  padding-bottom: 188px;
  text-align: center;
}

.hero-title {
  max-width: 496px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 48px;
  font-size: 56px;
  line-height: 1.07;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.hero-btn {
  display: block;
  margin-left: auto;
  margin-right: auto;
  min-width: 169px;
  padding-top: 16px;
  padding-bottom: 16px;
  padding-left: 32px;
  padding-right: 32px;
  border: 0;
  border-radius: 4px;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #ffffff;
  background-color: var(--logo-color);
  cursor: pointer;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Features section */

.features-list {
  display: flex;
  gap: 24px;
}

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

/* Features icon wrapper */

.features-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 112px;
  background-color: var(--footer-text);
  border: 1px solid #8e8f99;
  border-radius: 4px;
  margin-bottom: 8px;
}

.features-title {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--secondary-color);
}

.features-text {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* Our Team section */

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

.team .section-title {
  margin-bottom: 72px;
}

.team-list {
  display: flex;
  gap: 24px;
}

.team-item {
  width: calc((100% - 3 * 24px) / 4);
  background-color: var(--card-background);
  border-radius: 0 0 4px 4px;
  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);
}

.team-info {
  padding-top: 32px;
  padding-bottom: 32px;
}

.section-title {
  font-size: 36px;
  line-height: 1.11;
  letter-spacing: 0.02em;
  color: var(--secondary-color);
  text-align: center;
  text-transform: capitalize;
}

.team-name {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--secondary-color);
  text-align: center;
}

.team-position {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: center;
  margin-bottom: 8px;
}

/* Team social links */

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

.team-socials {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding-top: 8px;
}

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

.team-social-link:hover,
.team-social-link:focus {
  background-color: var(--link-hover);
}

.team-social-icon {
  fill: var(--footer-text);
}

/* Our Portfolio section */

.portfolio .section-title {
  margin-bottom: 72px;
}

.portfolio-list {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 24px;
}

.portfolio-item {
  width: calc((100% - 2 * 24px) / 3);
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover,
.portfolio-item:focus {
  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);
  cursor: pointer;
}

/* Portfolio image wrapper — needed for overlay */

.portfolio-image-wrapper {
  position: relative;
  overflow: hidden;
}

/* Portfolio overlay — slides up from bottom on hover */

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

.portfolio-item:hover .portfolio-overlay {
  transform: translateY(0);
}

.portfolio-info {
  padding-top: 32px;
  padding-bottom: 32px;
  padding-left: 16px;
  padding-right: 16px;
  border: 1px solid var(--border-color);
  border-top: 0;
}

.portfolio-name {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--secondary-color);
}

.portfolio-type {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* Footer */

.footer {
  background-color: var(--secondary-color);
  padding-top: 100px;
  padding-bottom: 100px;
}

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

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

.footer-logo {
  display: inline-block;
  margin-bottom: 16px;
}

.footer-text {
  max-width: 264px;
  color: var(--footer-text);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* Footer social links */

.footer-social-item {
  width: 40px;
  height: 40px;
}

.footer-socials-text {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #ffffff;
  margin-bottom: 16px;
}

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

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

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

.footer-social-icon {
  fill: var(--footer-text);
}
