/* Set base font, text color, and background for the whole page */
body {
    font-family: "Roboto", sans-serif;
    color: #434455;
    background-color: #fff;
}

/* Remove default margin from all headings and paragraphs */
h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin: 0;
}

/* Remove default padding and bullet points from lists */
ul,
ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Remove underline from all links */
a {
    text-decoration: none;
}

/* Make all images block elements to remove spacing below them */
img {
    display: block;
}

/* Set a maximum width and horizontal padding, and center the container */
.container {
    max-width: 1158px;
    padding: 0 15px;
    margin: 0 auto;
}

/* Add a bottom border to the page header */
.page-header {
    border-bottom: 1px solid #e7e9fc;
}

/* Header container with horizontal alignment */
.container-header {
    display: flex;
    align-items: center;
}

/* Navigation bar layout */
.header-nav {
    display: flex;
    align-items: center;
}

/* Logo spacing */
.header-logo {
    padding: 24px 0;
    margin-right: 76px;
}

/* Shared style for both header and footer logos */
.header-logo,
.footer-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;
}

/* Color variation for the dark part of the logo */
.header-logo .studio-black {
    color: #2e2f42;
}

/* Color variation for the white part of the logo in the footer */
.footer-logo .studio-white {
    color: #f4f4fd;
}

/* Horizontal layout and spacing for navigation links */
.nav-list {
    display: flex;
    gap: 40px;
}

/* Style for navigation links */
.nav-link {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #2e2f42;
    padding: 24px 0;
    display: block;
}

/* Hover and focus effects for navigation links */
.nav-link:hover,
.nav-link:focus {
    color: #404bbf;
}

/* Align contact block to the right */
.contacts {
    font-style: normal;
    margin-left: auto;
}

/* Horizontal layout and spacing for contact items */
.contacts-lists {
    display: flex;
    gap: 40px;
}

/* Style for contact links (email and phone) */
.contacts-link {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #434455;
    padding: 24px 0;
    display: block;
}

/* Hover and focus effects for contact links */
.contacts-link:hover,
.contacts-link:focus {
    color: #404bbf;
}

/* Generic section padding */
.section {
    padding: 120px 0;
}

/* Hero section with dark background and custom padding */
.section-title {
    background-color: #2e2f42;
    padding: 188px 0;
}

/* Main title style in the hero section */
.page-title {
    font-weight: 700;
    font-size: 56px;
    line-height: 1.07;
    letter-spacing: 0.02em;
    text-align: center;
    color: #fff;
    margin: 0 auto 48px;
    max-width: 496px;
}

/* Style for the main call-to-action button */
.button {
    background: #4d5ae5;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
    padding: 16px 32px;
    min-width: 169px;
    height: 56px;
    display: block;
    margin: 0 auto;
    border: none;
}

/* Hover and focus effects for the button */
.button:hover,
.button:focus {
    background: #404bbf;
}

/* Utility class to hide elements visually but keep them accessible */
.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;
}

/* Horizontal layout with spacing for the about section */
.about-list {
    display: flex;
    gap: 24px;
}

/* Layout for each about item block */
.about-item {
    width: calc((100% - 72px) / 4);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Light background for the team section */
.section-ourteam {
    background-color: #f4f4fd;
}

/* Shared style for section titles */
.title-about,
.title-ourteam,
.title-portfolio {
    font-weight: 700;
    font-size: 36px;
    line-height: 1.11;
    letter-spacing: 0.02em;
    text-align: center;
    color: #2e2f42;
    text-transform: capitalize;
}

/* Subtitle style for team member names */
.subtitle-ourteam {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-align: center;
    color: #2e2f42;
    margin-bottom: 8px;
}

/* Subtitle style for about and portfolio sections */
.subtitle-about,
.subtitle-portfolio {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #2e2f42;
    margin-bottom: 8px;
}

/* Style for job titles under team member names */
.ourteam-text {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    text-align: center;
    color: #434455;
}

/* Space below the team section title */
.title-ourteam {
    margin-bottom: 72px;
}

/* Horizontal layout for team members */
.ourteam-list {
    display: flex;
    gap: 24px;
}

/* Style for each team member card */
.ourteam-item {
    width: calc((100% - 72px) / 4);
    border-radius: 0 0 4px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff;
}

/* Container for team member text */
.container-team {
    padding: 32px 0;
    display: flex;
    flex-direction: column;
    text-align: center;
}

/* Space below the portfolio title */
.title-portfolio {
    margin-bottom: 72px;
}

/* Responsive grid layout for portfolio items */
.portfolio-list {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    row-gap: 48px;
}

/* Size of each portfolio item */
.portfolio-item {
    width: calc((100% - 48px) / 3);
}

/* Container around portfolio image description */
.container-portfolio {
    padding: 32px 16px;
    border: 1px solid #e7e9fc;
    border-top: none;
}

/* Shared text style for about and portfolio descriptions */
.text-about,
.text-portfolio {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #434455;
}

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

/* Footer logo positioning */
.footer-logo {
    display: inline-block;
    margin-bottom: 16px;
}

/* Footer paragraph text style */
.footer-text {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #f4f4fd;
    max-width: 264px;
}