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

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

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

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

a {
text-decoration: none;
}

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

button {
cursor: pointer;
font-family: inherit;
}

/* ---- Mob container ---- */
.container {
max-width: 320px;
padding: 0 16px;
margin: 0 auto;
}

@media screen and (min-width: 768px) {
.container {
max-width: 768px;
}
}

@media screen and (min-width: 1158px) {
.container {
max-width: 1158px;
padding-left: 15px;
padding-right: 15px;
}
}

/* ------ MOB HEADER ------ */
.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;
}

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

.header-logo-span {
font-weight: 700;
font-size: 18px;
line-height: 1.17;
letter-spacing: 0.03em;
text-transform: uppercase;
color: #2e2f42;
}

.page-nav,
.contacts {
display: none;
}

.burger-menu-btn {
background-color: transparent;
border: none;
padding: 0;
line-height: 0;
}

.burger-menu-icon {
display: block;
fill: #2f2f37;
}

/* --- TABLET HEADER (768px+) --- */
@media screen and (min-width: 768px) {
.burger-menu-btn {
display: none;
}

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

.header-logo {
padding: 24px 0;
margin-right: 120px;
}

.contacts {
font-style: normal;
margin-left: auto;
}

.page-nav,
.contacts {
display: block;
}

.header-link {
font-weight: 500;
font-size: 16px;
line-height: 1.5;
letter-spacing: 0.02em;
color: #2e2f42;
display: block;
padding: 24px 0;
position: relative;
transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.contacts-list {
display: flex;
flex-direction: column;
gap: 12px;
}

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

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

.contacts-item-link {
display: block;
font-size: 12px;
line-height: 1.17;
letter-spacing: 0.04em;
color: #434455;
transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
}

/* --- DESKTOP HEADER (1158px+) --- */
@media screen and (min-width: 1158px) {
.header-logo {
margin-right: 76px;
}

.contacts-list {
flex-direction: row;
align-items: center;
gap: 40px;
}

.contacts-item-link {
padding: 24px 0;
font-size: 16px;
line-height: 1.5;
letter-spacing: 0.02em;
}

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

/* ---- MOB HERO ---- */
.hero {
background-color: #2e2f42;
background-image:
linear-gradient(rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)),
url("../images/hero-bg-mob1x.jpg");
background-repeat: no-repeat;
background-position: center;
background-size: cover;
max-width: 320px;
margin: 0 auto;
padding: 72px 0;
}

@media (min-resolution: 192dpi) {
.hero {
background-image:
linear-gradient(rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)),
url("../images/hero-bg-mob2x.jpg");
}
}

.hero-title {
font-weight: 700;
font-size: 36px;
line-height: 1.11;
letter-spacing: 0.02em;
text-align: center;
color: #fff;
max-width: 216px;
margin: 0 auto 72px auto;
}

.hero-button {
display: block;
margin: 0 auto;
padding: 16px 32px;
border: none;
border-radius: 4px;
color: #ffffff;
background-color: #4d5ae5;
font-weight: 500;
font-size: 16px;
line-height: 1.5;
letter-spacing: 0.04em;
min-width: 169px;
height: 56px;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.15);
transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

@media screen and (min-width: 768px) {
.hero {
max-width: 768px;
padding: 112px 0;
background-image:
linear-gradient(rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)),
url("../images/hero-bg-tablet1x.jpg");
}

@media (min-resolution: 192dpi) {
.hero {
background-image:
linear-gradient(rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)),
url("../images/hero-bg-tablet2x.jpg");
}
}

.hero-title {
font-size: 56px;
line-height: 1.07;
max-width: 496px;
margin-bottom: 36px;
}
}

@media screen and (min-width: 1158px) {
.hero {
max-width: 1440px;
padding: 188px 0;
background-image:
linear-gradient(rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)),
url("../images/hero-bg-desktop1x.jpg");
}

@media (min-resolution: 192dpi) {
.hero {
background-image:
linear-gradient(rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)),
url("../images/hero-bg-desktop2x.jpg");
}
}

.hero-title {
margin-bottom: 48px;
}
}

/* ---- MOB FEATURES ---- */
.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 {
padding: 96px 0;
}

.features-list {
display: flex;
flex-direction: column;
gap: 72px;
}

/* Hidden on mobile & tablet — overridden at desktop */
.features-icon-wrap {
display: none;
}

.features-subtitles {
font-weight: 700;
font-size: 36px;
line-height: 1.11;
letter-spacing: 0.02em;
text-align: center;
color: #2e2f42;
margin-bottom: 8px;
}

/* FIX 3: Added font-size, line-height, letter-spacing */
.features-item-text {
font-weight: 500;
font-size: 16px;
line-height: 1.5;
letter-spacing: 0.02em;
color: #434455;
}

@media screen and (min-width: 768px) {
.features-list {
flex-direction: row;
flex-wrap: wrap;
column-gap: 24px;
row-gap: 72px;
}

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

.features-subtitles {
text-align: left;
}
}

@media screen and (min-width: 1158px) {
.features {
padding: 120px 0;
}

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

.features-list {
gap: 24px;
}

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

.features-subtitles {
font-weight: 500;
font-size: 20px;
line-height: 1.2;
}

.features-item-text {
font-weight: 400;
}
}

/* ------- MOB TEAM ------ */
.team {
background-color: #f4f4fd;
padding: 96px 0;
}

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

.team-list {
display: flex;
flex-direction: column;
align-items: center;
gap: 72px;
}

.team-item {
background-color: #ffffff;
border-radius: 0px 0px 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);
}

/* --- TABLET TEAM (768px+) --- */
@media screen and (min-width: 768px) {
  .team-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 64px 24px;
  }

  .team-item {
    width: 264px;
  }
}

/* --- DESKTOP TEAM (1158px+) --- */
@media screen and (min-width: 1158px) {
  .team {
    padding: 120px 0;
  }

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

/* --- SHARED TEAM STYLES --- */
.team-member-text {
  padding: 32px 16px;
  text-align: center;
}

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

.team-role-text {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
  margin-bottom: 8px;
}

.social-icons-list {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}

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

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

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

.team-icon {
  fill: #f4f4fd;
  width: 16px;
  height: 16px;
}

/* ---- MOB PORTFOLIO ---- */
.section-portfolio {
padding: 96px 0;
}

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

.portfolio-list {
display: flex;
flex-direction: column;
gap: 48px;
padding: 0;
margin: 0;
list-style: none;
}

.portfolio-card {
width: 100%;
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);
transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-img-thumb {
position: relative;
overflow: hidden;
}

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

.portfolio-card:hover .portfolio-overley-description {
transform: translateY(0);
}

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

@media screen and (min-width: 768px) {
.portfolio-list {
flex-direction: row;
flex-wrap: wrap;
column-gap: 24px;
row-gap: 72px;
}

.portfolio-card {
width: calc((100% - 24px) / 2);
}
}

@media screen and (min-width: 1158px) {
.section-portfolio {
padding: 120px 0;
}

.portfolio-list {
column-gap: 24px;
row-gap: 48px;
}

.portfolio-card {
width: calc((100% - 48px) / 3);
box-shadow: none;
}

/* FIX 2: Added hover shadow for desktop */
.portfolio-card:hover {
box-shadow:
0px 2px 1px 0px rgba(46, 47, 66, 0.08),
0px 1px 1px 0px rgba(46, 47, 66, 0.16),
0px 1px 6px 0px rgba(46, 47, 66, 0.08);
}
}

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

.footer-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 72px;
}

/* Logo+text column: centered on mobile */
.footer-column-wrap {
text-align: center;
}

/* FIX 1: Added margin-bottom to base (mobile) styles */
.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;
}

.footer-logo-span {
color: #f4f4fd;
}

.footer-text {
font-weight: 400;
font-size: 16px;
line-height: 1.5;
letter-spacing: 0.02em;
color: #f4f4fd;
max-width: 264px;
text-align: left;
}

.footer-description,
.footer-subscribe-title {
font-weight: 500;
font-size: 16px;
line-height: 1.5;
letter-spacing: 0.02em;
color: #fff;
margin-bottom: 16px;
text-align: center;
}

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

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

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

.footer-icon {
fill: #f4f4fd;
}

.footer-subscribe {
width: 100%;
}

.footer-form {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
}

.footer-input {
width: 288px;
height: 40px;
border: 1px solid #ffffff;
background-color: transparent;
border-radius: 4px;
padding-left: 16px;
color: #ffffff;
font-size: 12px;
line-height: 2;
letter-spacing: 0.04em;
outline: none;
}

.footer-input::placeholder {
font-weight: 400;
font-size: 12px;
line-height: 2;
letter-spacing: 0.04em;
color: #fff;
}

.footer-subs-btn {
min-width: 165px;
height: 40px;
border-radius: 4px;
background-color: #4d5ae5;
color: #fff;
font-weight: 500;
font-size: 16px;
border: none;
margin: 0;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
line-height: 1.5;
transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-subs-icon {
fill: #ffffff;
margin-left: 16px;
}

/* ----- TABLET FOOTER (768px+) ----- */
@media screen and (min-width: 768px) {
.footer-container {
padding-left: 16px;
padding-right: 16px;
width: 584px;
margin: 0 auto;
flex-direction: row;
flex-wrap: wrap;
align-items: baseline;
gap: 72px 24px;
}

.footer-column-wrap {
text-align: left;
}

.footer-logo {
margin-bottom: 16px;
padding: 0;
}

.footer-description,
.footer-subscribe-title {
text-align: left;
}

.footer-form {
flex-direction: row;
width: 100%;
gap: 24px;
}

.footer-input {
width: 264px;
}
}

/* --- DESKTOP FOOTER (1158px+) --- */
@media screen and (min-width: 1158px) {
.footer {
padding: 100px 0;
}

.footer-container {
width: 1158px;
padding-left: 15px;
padding-right: 15px;
margin: 0 auto;
flex-wrap: nowrap;
gap: 0;
}

.footer-column-wrap:first-child {
margin-right: 120px;
}

.footer-column-wrap:nth-child(2) {
margin-right: 80px;
}

.footer-logo {
margin-bottom: 16px;
padding: 0;
}

.footer-text {
width: 264px;
}

.footer-subscribe {
margin-left: auto;
}
}

/* ------ MODAL WINDOW ------ */
.backdrop {
background-color: rgba(46, 47, 66, 0.4);
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
pointer-events: none;
visibility: hidden;
transition:
opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
visibility 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.backdrop.is-open {
opacity: 1;
pointer-events: auto;
visibility: visible;
}

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

.modal {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(0.9);
width: calc(100% - 32px);
max-width: 288px;
min-height: 584px;
background-color: #fcfcfc;
box-shadow:
0px 1px 1px rgba(0, 0, 0, 0.14),
0px 1px 3px rgba(0, 0, 0, 0.12),
0px 2px 1px rgba(0, 0, 0, 0.2);
border-radius: 4px;
padding: 72px 16px 24px 16px;
transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-btn {
position: absolute;
top: 24px;
right: 24px;
width: 24px;
height: 24px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background-color: #e7e9fc;
border: 1px solid rgba(0, 0, 0, 0.1);
padding: 0;
cursor: pointer;
transition:
background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-btn:hover,
.modal-close-btn:focus {
background-color: #404bbf;
border: none;
}

.close-icon {
fill: #2e2f42;
transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-btn:hover .close-icon,
.modal-close-btn:focus .close-icon {
fill: #ffffff;
}

.modal-input {
width: 100%;
height: 40px;
border: 1px solid rgba(46, 47, 66, 0.4);
border-radius: 4px;
padding-left: 38px;
background-color: transparent;
outline: transparent;
transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-input:focus {
border-color: #4d5ae5;
}

.modal-input:focus + .input-icon {
fill: #4d5ae5;
}

.input-icon {
position: absolute;
left: 16px;
top: 50%;
transform: translateY(-50%);
fill: #2e2f42;
transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-policy-label {
display: flex;
align-items: center;
font-size: 12px;
line-height: 1.17;
letter-spacing: 0.04em;
color: #8e8f99;
}

.modal-privacy-link {
color: #4d5ae5;
text-decoration: underline;
}

.custom-checkbox-icon {
flex-shrink: 0;
width: 16px;
height: 16px;
margin-right: 8px;
border: 1px solid rgba(46, 47, 66, 0.4);
border-radius: 2px;
display: inline-flex;
align-items: center;
justify-content: center;
background-color: transparent;
fill: transparent;
transition:
background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-icon {
fill: transparent;
transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-checkbox:checked + .modal-policy-label .custom-checkbox-icon {
background-color: #404bbf;
border: none;
fill: #f4f4fd;
}

.modal-checkbox:checked + .modal-policy-label .checkbox-icon {
fill: #f4f4fd;
}

.modal-title {
font-weight: 500;
font-size: 16px;
line-height: 1.5;
letter-spacing: 0.02em;
text-align: center;
color: #2e2f42;
margin-bottom: 16px;
}

.form-field {
margin-bottom: 8px;
}

.modal-label {
display: block;
font-size: 12px;
line-height: 1.17;
letter-spacing: 0.04em;
color: #8e8f99;
margin-bottom: 4px;
}

.modal-icon-wrap {
position: relative;
}

.modal-comment {
display: block;
width: 100%;
height: 120px;
resize: none;
font-size: 12px;
line-height: 1.17;
letter-spacing: 0.04em;
color: rgba(46, 47, 66, 0.4);
border: 1px solid rgba(46, 47, 66, 0.4);
border-radius: 4px;
background-color: transparent;
padding: 8px 16px;
outline: transparent;
transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-comment:focus {
border-color: #4d5ae5;
}

.modal-checkbox-wrap {
margin-bottom: 24px;
}

.modal-submit-btn {
display: block;
margin: 0 auto;
min-width: 169px;
height: 56px;
background-color: #4d5ae5;
border: none;
border-radius: 4px;
color: #fff;
cursor: pointer;
font-weight: 500;
line-height: 1.5;
letter-spacing: 0.04em;
transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-submit-btn:hover,
.modal-submit-btn:focus {
background-color: #404bbf;
}

.modal-checkbox:focus + .modal-policy-label .custom-checkbox-icon {
border-color: #4d5ae5;
}

@media screen and (min-width: 768px) {
.modal {
max-width: 408px;
width: 408px;
padding: 72px 24px 24px 24px;
}
}

@media screen and (min-width: 1158px) {
.modal {
max-width: 408px;
}
}

/* ---- Mobile Menu ---- */
.mobile-menu {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #fff;
opacity: 0;
visibility: hidden;
pointer-events: none;
transition:
opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
visibility 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.is-open {
opacity: 1;
visibility: visible;
pointer-events: auto;
}

@media screen and (min-width: 768px) {
.mobile-menu {
display: none;
}
}

.mobile-menu-container {
position: relative;
display: flex;
flex-direction: column;
height: 100%;
padding-top: 72px;
padding-bottom: 40px;
}

.mob-nav {
margin-bottom: auto;
}

.mob-contacts-wrap {
margin-top: auto;
}

.close-icon-btn {
position: absolute;
top: 24px;
right: 24px;
width: 24px;
height: 24px;
border-radius: 50%;
background-color: #e7e9fc;
border: 1px solid rgba(0, 0, 0, 0.1);
display: flex;
align-items: center;
justify-content: center;
padding: 0;
cursor: pointer;
transition:
background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.close-icon-btn:hover,
.close-icon-btn:focus {
background-color: #404bbf;
border: none;
}

.close-icon-btn:hover .menu-close-icon,
.close-icon-btn:focus .menu-close-icon {
fill: #fff;
}

.menu-close-icon {
fill: #2e2f42;
transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.mob-nav-list {
display: flex;
flex-direction: column;
gap: 40px;
}

.mob-nav-link {
font-weight: 700;
font-size: 36px;
line-height: 1.11;
color: #2e2f42;
text-decoration: none;
}

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

.mobile-contacts-list {
display: flex;
flex-direction: column;
gap: 24px;
margin-bottom: 48px;
}

.mobile-contacts-link {
font-style: normal;
font-weight: 500;
font-size: 20px;
line-height: 1.2;
color: #434455;
text-decoration: none;
}

.mobile-contacts-link.accent {
color: #4d5ae5;
}

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

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

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

.mobile-social-icon {
fill: #f4f4fd;
}