:root {
  --iris: #4d5ae5;
  --ocean: #404bbf;
  --navy-blue: #2e2f42;
  --green: #31d0aa;
  --slate: #434455;
  --light-slate: #8e8f99;
  --cornflower: #e7e9fc;
  --cloud: #f4f4fd;
  --navy-blue-modal: rgba(46, 47, 66, 0.4);
  --grey: rgba(46, 47, 66, 0.7);
  --white: #fff;
  --dairy: #fcfcfc;
  --font-family: "Roboto", sans-serif;
  --second-family: "Raleway", sans-serif;
  --primary: #4d5ae5;
  --icon-color: #f4f4fd;
  --color-border-default: #eff0f5;
  --color-text-label: #e9e9ea;
  --color-border-focus: #f2f4f5;
  --color-checkbox-bg-checked: #2e2f42;
  --color-checkbox-fill-checked: #2e2f42;
  --color-text-link: #4d5ae5;
  --color-btn-bg: #ffffff;
  --text-dark: #2e2f42;
  --muted: #8e8f99;
  --iris: #4d5ae5;
  --ocean: #404bbf;
  --cloud: #f4f4fd;
}

/* Reset and base styles */

body {
  font-family: var(--font-family);
  color: var(--slate);
  background-color: var(--white);
  margin: 0;
}

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

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

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

button {
  cursor: pointer;
  border: none;
}

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

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

.section {
  padding: 120px 0;
}

.header {
  border-bottom: 1px solid #e7e9fc; /* B13 - нижня рамка хедера */
  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; /* B10 - Flexbox для горизонтального розташування */
  justify-content: space-between;
  align-items: center;
}

.navigation {
  display: flex;
  align-items: center;
}

.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;
  margin-right: 76px;
}

.logo-accent {
  color: #2e2f42;
}

.nav-list {
  margin: 0;
  list-style: none;
  display: flex;
  gap: 40px;
}

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

.nav-link.current {
  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:hover,
.nav-link:focus {
  color: #404bbf;
}

.address {
  font-style: normal;
}

.address-list {
  margin: 0;
  list-style: none;
  display: flex;
  gap: 40px;
}

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

.address-link:hover,
.address-link:focus {
  color: #404bbf;
}
/* Hero-section */
.hero-section {
  background-color: #2e2f42;
  text-align: center;
  padding: 188px 0;
  margin-left: auto;
  margin-right: auto;
}

.hero-section {
  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;
  align-items: center;
  text-align: center;
  background-repeat: no-repeat;
  max-width: 1440px;
  background-color: #2e2f42;
  min-height: 600px;
  padding: 188px 0;
}

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

.hero-button {
  display: block;
  background-color: #4d5ae5;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #ffffff;
  border: none;
  cursor: pointer;
  margin-left: auto;
  margin-right: auto;
  border-radius: 4px;
  padding: 16px 32px; /* B4 - внутрішні поля */
  min-width: 169px;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Features-section */

.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 {
  display: flex;
  gap: 24px;
}

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

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

.features-icon {
  fill: currentColor;
}

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

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

/* Team section styles */
.team-section {
  background-color: #f4f4fd;
}

.team-title {
  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;
  gap: 24px;
}

.team-item {
  background-color: #ffffff;
  text-align: center;
  border-radius: 0px 0px 4px 4px;
  width: calc((100% - 72px) / 4);
  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-content {
  padding: 32px 0; /* B4 - внутрішні поля */
}

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

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

/* Social icons */
.social-list {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.social-link {
  width: 40px;
  height: 40px;
  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);
}

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

.social-icon {
  fill: #f4f4fd;
}

/* Portfolio-section */

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

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

.portfolio-item {
  background-color: #ffffff;
  overflow: hidden;
  width: calc((100% - 48px) / 3);
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

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

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

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

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

.portfolio-content {
  padding: 32px 16px; /* B4 - внутрішні поля */
  border: 1px solid #e7e9fc;
  border-top: none;
}

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

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

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

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

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

.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;
  display: inline-block;
  margin-bottom: 16px;
}

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

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

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

.footer-social-title {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--white);
  margin-bottom: 16px;
}

.footer-social-list {
  display: flex;
  gap: 16px;
  justify-content: center;
}

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

.footer-social-link {
  width: 100%;
  height: 100%;
  background-color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  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(--icon-color);
}

.subscribe-wrapper {
  display: flex;
  flex-direction: column;
  margin-left: 80px;
}

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

.subscribe-form {
  display: flex;
  align-items: center;
  gap: 24px; /* відстань між інпутом і кнопкою */
}

.subscribe-input {
  width: 264px;
  height: 40px;
  border: 1px solid #ffffff;
  background-color: transparent;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.04em;
  padding-left: 16px;
  color: #ffffff;
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.subscribe-input::placeholder {
  color: #ffffff;
}

.subscribe-button {
  min-width: 165px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #ffffff;
  cursor: pointer;
  background-color: #4d5ae5;
  border: none;
  border-radius: 4px;
  padding: 8px 24px;
}

.subscribe-icon {
  margin-left: 16px;
}

/* ===== Backdrop ===== */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(46, 47, 66, 0.4);
  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);
}

/* Показ модалки */
.backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ===== Modal ===== */
.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-height: 584px;
  background: #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;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  padding: 72px 24px 24px 24px;
  width: 408px;
}

/* ===== Close Button ===== */
.modal__close {
  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__icon-close {
  width: 8px;
  height: 8px;
  fill: currentColor;
  color: #2e2f42;
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover & Focus на кнопці */
.modal__close:hover,
.modal__close:focus {
  background-color: #404bbf;
  border: none;
  outline: none;
}

.modal__close:hover .modal__icon-close,
.modal__close:focus .modal__icon-close {
  fill: #ffffff;
}

/* Інпут — зміна рамки при фокусі */
.modal__input:focus {
  border-color: #4d5ae5;
}

/* ===== Description (paragraph) ===== */
.modal__description {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  letter-spacing: 0.02em;
  color: var(--text-dark);
  margin-bottom: 16px;
}

/* ===== Form Groups ===== */
.modal__group {
  margin-bottom: 8px;
}
.modal__group--textarea {
  margin-bottom: 16px;
}

/* Labels */
.modal__label {
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: var(--light-slate);
  display: block;
  margin-bottom: 4px;
}

/* Input Wrapper */
.modal__input-wrapper {
  position: relative;
}

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

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

/* Input Icon (left) */
.modal__icon-input {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
  fill: rgba(46, 47, 66, 0.4);
  pointer-events: none;
}

/* Change icon color on input focus */
.modal__input:focus + .modal__icon-input {
  fill: var(--iris);
}

/* Textarea */
.modal__textarea {
  width: 100%;
  height: 120px;
  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;
  resize: none;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== Checkbox ===== */
.checkbox-group {
  margin-bottom: 24px; /* 24px */
  display: flex;
  align-items: center;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.checkbox-label {
  align-items: center;
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: var(--muted); /* #8e8f99 */
  user-select: none;
  cursor: pointer;
}

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

.checkbox-icon {
  width: 10px;
  height: 8px;
  fill: transparent;
}

/* Checked state */
#user-privacy:checked + .checkbox-label .checkbox-span {
  background-color: #404bbf;
  border: none;
  fill: #f4f4fd;
}

#user-privacy:checked + .checkbox-label .checkbox-icon {
  fill: var(--cloud);
}

/* Privacy link */
.privacy-link {
  color: var(--iris);
  text-decoration: none;
  margin-left: 4px;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.privacy-link:hover,
.privacy-link:focus {
  text-decoration: underline;
  outline: none;
}

/* ===== Submit Button ===== */
.modal-form-btn {
  display: block;
  min-width: 169px;
  height: 56px;
  margin: 0 auto;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #ffffff;
  cursor: pointer;
  background-color: var(--iris);
  border: none;
  border-radius: 4px;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-form-btn:hover,
.modal-form-btn:focus {
  background-color: var(--ocean);
  outline: none;
}
