:root {
  --brand-color: #2196f3;
  --dark-color: #212121;
  --soft-border: #e5e7eb;
}

html {
  overflow-x: hidden;
}

body {
  min-width: 320px;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

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

.container,
.container-footer {
  width: min(100% - 30px, 1200px);
  max-width: 1200px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  min-height: 80px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--soft-border);
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.header > .header__container,
.header > .container {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  align-items: center;
  column-gap: 34px;
  width: min(100% - 30px, 1200px);
  min-height: 80px;
  margin: 0 auto;
}

.header .logo {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  margin: 0;
  font-size: 26px;
  line-height: 1;
  white-space: nowrap;
}

.header .nav {
  justify-self: start;
  width: auto;
}

.header .nav__list {
  display: flex;
  align-items: center;
  gap: 42px;
  margin: 0;
  padding: 0;
}

.header .nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 80px;
  padding: 0;
  font-weight: 500;
  letter-spacing: 0;
}

.header .nav__link::after {
  bottom: 20px;
}

.header .nav__link:hover,
.header .nav__link:focus,
.header .nav__link--current {
  color: var(--brand-color);
}

.header .header__list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.header .header__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: auto;
  padding: 0;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  transition: color 250ms ease, transform 250ms ease;
}

.header .header__link:hover,
.header .header__link:focus {
  color: var(--brand-color);
  transform: translateY(-1px);
}

.header .header__link svg {
  flex: 0 0 auto;
  fill: currentColor;
}

.header .nav__btn {
  display: none;
}

.hero {
  overflow: hidden;
  height: auto;
  min-height: clamp(560px, 72svh, 720px);
  max-width: none;
  background-position: center;
  background-size: cover;
}

.hero__container {
  width: 100%;
  min-height: clamp(560px, 72svh, 720px);
  padding: 72px 16px;
  box-sizing: border-box;
}

.hero__title {
  width: min(100%, 760px);
  max-width: calc(100vw - 32px);
  letter-spacing: 0;
  line-height: 1.22;
  overflow-wrap: break-word;
}

.hero__btn {
  max-width: calc(100vw - 48px);
}

.features__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
  align-items: stretch;
}

.features__item {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 24px 22px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
  transition: transform 250ms ease, border-color 250ms ease, box-shadow 250ms ease;
}

.features__item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid transparent;
  border-radius: inherit;
  transition: border-color 250ms ease;
}

.features__item:hover,
.features__item:focus-within {
  transform: translateY(-8px);
  border-color: rgba(33, 150, 243, 0.4);
  box-shadow: 0 26px 54px rgba(33, 150, 243, 0.18);
}

.features__item:hover::after,
.features__item:focus-within::after {
  border-color: rgba(33, 150, 243, 0.2);
}

.features__icon-box {
  width: 100%;
  min-height: 120px;
  margin-bottom: 22px;
  border-radius: 8px;
  transition: background-color 250ms ease, transform 250ms ease;
}

.features__item:hover .features__icon-box,
.features__item:focus-within .features__icon-box {
  background-color: #eaf4ff;
  transform: translateY(-3px);
}

.features__icon {
  transition: transform 250ms ease, fill 250ms ease;
}

.features__item:hover .features__icon,
.features__item:focus-within .features__icon {
  fill: var(--brand-color);
  transform: scale(1.08);
}

.features__subtitle {
  margin-bottom: 10px;
  transition: color 250ms ease;
}

.features__item:hover .features__subtitle,
.features__item:focus-within .features__subtitle {
  color: var(--brand-color);
}

.features__text {
  margin: 0;
  transition: color 250ms ease;
}

.features__item:hover .features__text,
.features__item:focus-within .features__text {
  color: #334155;
}

.filters {
  padding: 48px 0 60px;
}

.images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  margin: 0;
  padding: 0;
}

.images__box {
  width: 100%;
  overflow: hidden;
  background: #ffffff;
}

.images__boxoverlay {
  aspect-ratio: 370 / 294;
  background: #f5f7fb;
}

.images__boxoverlay img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.images__designation {
  min-height: 110px;
}

footer {
  background: #2f303a;
}

.container-footer {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 570px);
  gap: 48px;
  align-items: start;
  padding: 56px 0;
}

.footer__subscription-wrap,
.footer-social {
  margin: 0;
}

.subscription-form {
  display: flex;
  gap: 12px;
  align-items: center;
}

.subscription-form__input {
  flex: 1 1 auto;
  min-width: 0;
}

.subscription-form__btn {
  flex: 0 0 auto;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100dvh;
  padding: 20px 15px;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: rgba(15, 23, 42, 0.55);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity 250ms ease, visibility 250ms ease;
}

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

.modal {
  position: relative;
  width: min(100%, 528px);
  max-width: calc(100vw - 30px);
  height: auto;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 40px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.form {
  width: 100%;
}

.form__title {
  display: block;
  margin-bottom: 28px;
  text-align: center;
  overflow-wrap: break-word;
}

.form__fieldset {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form__fieldset .form__input,
.form__inmput--comment {
  display: block;
  max-width: 100%;
  box-sizing: border-box;
}

.checkbox-container {
  width: 100%;
  gap: 8px;
  justify-content: flex-start;
  align-items: flex-start;
  box-sizing: border-box;
}

.checkbox-container input {
  flex: 0 0 16px;
  margin-top: 4px;
}

.checkbox-container span {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.checkbox__color {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media screen and (max-width: 1199px) {
  .container,
  .container-footer {
    width: min(100% - 30px, 768px);
  }

  .header > .header__container,
  .header > .container {
    grid-template-columns: 160px 1fr auto;
    column-gap: 24px;
    width: min(100% - 30px, 768px);
  }

  .header .nav__list {
    gap: 32px;
  }

  .header .header__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .features__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    min-height: 620px;
  }

  .hero__container {
    min-height: 620px;
    padding: 84px 18px;
  }

  .hero__title {
    width: min(100%, 680px);
    font-size: 34px;
  }

  .images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .container-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .subscription-form {
    width: min(100%, 570px);
  }
}

@media screen and (max-width: 767px) {
  .container,
  .container-footer {
    width: min(100% - 30px, 480px);
  }

  .header {
    min-height: 116px;
  }

  .header > .header__container,
  .header > .container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
    width: calc(100vw - 30px) !important;
    max-width: 480px !important;
    min-height: 116px;
    margin: 0 auto !important;
  }

  .header .logo {
    font-size: 24px;
  }

  .header .header__list {
    display: none;
  }

  .header .nav {
    display: block;
    width: 100%;
  }

  .header .nav__list {
    display: flex;
    gap: 22px;
    width: 100%;
  }

  .header .nav__link {
    min-height: 28px;
    font-size: 14px;
  }

  .header .nav__link::after {
    bottom: -8px;
  }

  .header .nav__btn {
    display: none !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 13px;
    right: 15px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--dark-color);
    z-index: 25;
  }

  .header .nav__btn::before,
  .header .nav__btn::after {
    content: none;
  }

  .nav__btn-lines,
  .nav__btn-lines::before,
  .nav__btn-lines::after {
    position: absolute;
    left: 50%;
    width: 24px;
    height: 2px;
    border-radius: 999px;
    background: #111827;
    transform: translateX(-50%);
  }

  .nav__btn-lines {
    top: 21px;
  }

  .nav__btn-lines::before,
  .nav__btn-lines::after {
    content: "";
  }

  .nav__btn-lines::before {
    top: -8px;
  }

  .nav__btn-lines::after {
    top: 8px;
  }

  .header .nav__btn svg {
    opacity: 0;
  }

  .hero__container {
    min-height: 520px;
    padding: 58px 16px;
  }

  .hero {
    min-height: 520px;
    background-position: center top;
  }

  .hero__title {
    width: min(100%, 270px);
    font-size: 21px;
    line-height: 1.26;
  }

  .features__list {
    grid-template-columns: 1fr;
  }

  .features__item {
    min-height: auto;
  }

  .filters {
    padding: 34px 0 48px;
  }

  .images {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .images__designation {
    min-height: auto;
    padding: 20px;
  }

  .images__title {
    font-size: 18px;
    line-height: 1.25;
  }

  .images__overlay > p {
    padding: 20px;
    font-size: 16px;
    line-height: 1.5;
  }

  .container-footer {
    padding: 44px 0;
    gap: 34px;
  }

  .subscription-form {
    flex-direction: column;
    width: 100%;
  }

  .subscription-form__input,
  .subscription-form__btn {
    width: 100%;
    max-width: 450px;
  }

  .backdrop {
    align-items: flex-start;
    padding: 16px 15px;
  }

  .modal {
    width: min(320px, calc(100vw - 48px)) !important;
    max-width: calc(100vw - 48px);
    max-height: calc(100dvh - 32px);
    padding: 38px 14px 28px;
  }

  .form__title {
    font-size: 18px;
    line-height: 1.35;
  }

  .form__fieldset .form__input {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    padding-left: 34px;
  }

  .form__inmput--comment {
    width: 100%;
    max-width: 100%;
    padding: 12px;
  }

  .form-button {
    max-width: 100%;
  }

  .checkbox-container {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    font-size: 11px;
    line-height: 1.45;
  }
}
