.page {
  /* сохраните в разметке и стилях класс page у тега body. Он удобен, чтобы составлять селекторы для разных цветовых тем. */
  background-image: var(--bg-image);
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

.header {
  position: relative;
  display: grid;
  justify-items: end;
  block-size: 100vh;
  min-block-size: 668px;
  margin-block-end: 30px;
  grid-template-rows: 1fr min-content 1fr;
  padding: 10px;
}

.decorated-zone::after {
  content: "";
  border-inline-end: 1px solid var(--main-corners-color);
  border-block-start: 1px solid var(--main-corners-color);
  width: 25px;
  position: absolute;
  height: 25px;
  right: 10px;
  top: 10px;
}

.decorated-zone::before {
  content: "";
  border-inline-end: 1px solid var(--main-corners-color);
  border-block-start: 1px solid var(--main-corners-color);
  transform: rotate(180deg);
  width: 25px;
  position: absolute;
  height: 25px;
  left: 10px;
  bottom: 10px;
}

.header__title {
  font-size: clamp(7.25rem, 7.0115rem + 1.0178vw, 7.5rem);
  text-shadow: 4px 4px 0px var(--primary-color);
  color: var(--header-logo-color);
  block-size: max-content;
  line-height: 83%;
}

.header__rec {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  position: absolute;
  padding-inline-end: 8px;
  top: 10px;
  right: 10px;
}

.header__rec::before {
  content: "REC";
}

.header__rec::after {
  content: "";
  background-color: var(--primary-color);
  box-shadow: 0px 0px 4px 2px var(--primary-color);
  border-radius: 50%;
  display: block;
  inline-size: 9px;
  block-size: 9px;
}

.header__theme-menu {
  align-self: center;
}

.header__theme-menu-button {
  padding: 4px 13px;
  background-color: transparent;
  border: none;
  text-align: center;
  text-transform: lowercase;
  line-height: 1;
  cursor: pointer;
  color: var(--nav-color);
}

.header__theme-menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header__theme-menu-button_active {
  outline: 1px solid var(--nav-color);
  transition: 0.2s;
  pointer-events: none;
}

.header__theme-menu-button:focus {
  outline: none;
}

.header__theme-menu-button:hover {
  outline: 1px solid var(--nav-hover-color);
}

.header__theme-menu-button:focus-visible {
  border-block-end: 1px solid var(--nav-color);
  outline: none;
}

.header__text {
  align-self: center;
}

.section-block__title {
  margin-block-end: 10px;
}

.section-block__text {
  color: var(--main-text-color);
  line-height: 23.4px;
}

.section-block__text:not(:last-of-type) {
  margin-block-end: 20px;
}

.section-block__link {
  text-shadow: 2px 2px 0px var(--secondary-link-color);
  text-decoration: none;
}

.section-block__link:hover {
  border-block-end: 1px solid var(--primary-link-color);
}

.section-block__link:focus {
  outline: none;
}

.section-block__link:focus-visible {
  outline: 1px solid var(--primary-link-color);
}

.section-gallery {
  display: flex;
  flex-direction: column;
  --section-gap: 10px;
  gap: var(--section-gap);
}

.section-gallery__container {
  display: grid;
  gap: inherit;
}

.section-gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.footer {
  block-size: 100vh;
  display: grid;
  align-items: center;
  position: relative;
  min-block-size: 668px;
  padding: 10px;
}

.footer__title {
  font-size: clamp(7.25rem, 7.0115rem + 1.0178vw, 7.5rem);
  text-shadow: 2px 2px 0px var(--primary-color);
  color: var(--footer-logo-color);
  text-align: center;
  line-height: 83%;
}

.section {
  display: grid;
  gap: var(--section-gap, 20px);
  margin-block-end: var(--section-margin-b-end, 50px);
}

.section__title {
  color: var(--section-heading-color);
  font-size: inherit;
  font-weight: var(--secondary-font-weight, 700);
  line-height: 23.4px;
}

.section-block:not(:last-child) {
  margin-block-end: 20px;
}

.title-decor {
  color: var(--main-heading-color);
  background-color: var(--section-heading-bg-color);
  max-block-size: max-content;
  font-weight: var(--secondary-font-weight, 700);
  line-height: 23.4px;
  font-size: inherit;
}

.section-block h4.title-decor {
  font-weight: inherit;
}

.content {
  margin-block-end: 30px;
  padding: 10px;
}

@media (min-width: 768px) {
  .decorated-zone::after,
  .header__rec {
    right: 20px;
    top: 20px;
  }

  .decorated-zone::before {
    bottom: 20px;
    left: 20px;
  }

  .content {
    margin-block-end: 40px;
  }

  .header,
  .content,
  .footer {
    padding: 20px;
  }

  .header {
    margin-block-end: 40px;
  }

  .header__title {
    justify-self: start;
    margin-inline-start: -20px;
  }

  .header__text {
    max-inline-size: 364px;
  }

  .section {
    grid-template-columns: 1fr 2fr;
    --section-margin-b-end: 80px;
  }

  .section.concentration {
    grid-template-columns: 1fr;
  }

  .concentration .section__title {
    max-inline-size: 236px;
  }

  .section-gallery {
    --section-gap: 20px;
  }

  .section-gallery__container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, min-content);
  }

  .section-gallery__container .section-gallery__img:nth-child(1) {
    grid-column: 1 / 3;
  }

  .section-gallery__container .section-gallery__img:nth-child(2) {
    grid-row: -2 / -4;
    grid-column: 3 / auto;
  }

  .section-gallery__container .section-gallery__img:nth-child(3) {
    grid-row: 2 / 4;
  }

  .section-gallery__container .section-gallery__img:nth-child(5) {
    grid-column: 2 / 4;
  }
}

@media (min-width: 1024px) {
  .header {
    justify-items: center;
  }

  .header__title,
  .footer__title {
    font-size: clamp(7.5rem, 0.5625rem + 14.4531vw, 9.8125rem);
  }

  .header__theme-menu {
    align-self: start;
  }

  .header__theme-menu-list {
    flex-direction: row;
  }

  .header__text {
    max-inline-size: 491px;
  }

  .header__rec,
  .header__text {
    justify-self: end;
  }

  .section {
    grid-template-columns: repeat(3, 1fr);
  }

  .why .section-blocks,
  .advices .section-blocks {
    grid-column: 2 / span 2;
  }

  .concentration .section__title {
    max-inline-size: 315px;
  }

  .section.concentration .section-blocks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--section-gap);
  }
}
