:root {
  --color-primary: #8a4224;
  --color-light: #fbfaf8;
  --color-dark: #333;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  font-size: 16px;
  color: #333;
  background: url(../img/home-middle-banner.jpeg) no-repeat center center fixed;
  background-size: cover;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: 0;
  font-weight: 400;
  line-height: 1;
}

h1 {
  font-size: 6.25em;
}

h2 {
  font-size: 4.6875em;
}

h3 {
  font-size: 2.6875em;
  line-height: 1.2;
}

h4 {
  font-size: 1.875em;
  line-height: 1.3;
}

h5 {
  font-size: 1.5625em;
  line-height: 1.4;
}

h6 {
  font-size: 1.25em;
  line-height: 1.4;
}

p {
  margin: 15px 0;
  font-size: 1.25em;
  font-weight: 400;
}

ul,
ol {
  margin-top: 0;
  margin-bottom: 0;
}

li {
  margin-bottom: .25rem
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5em 20px;
}

a {
  text-decoration: none;
  color: var(--color-light);
}

a:hover {
  text-decoration: underline;
}

.header {
  background-color: var(--color-primary);
  position: relative;
  z-index: 3;
}

.nav.container {
  padding: 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
}

.nav__list {
  display: flex;
  gap: 30px;
  font-size: 20px;
}

.nav__list li {
  list-style: none;
}

.nav__contacts {
  text-align: right;
  display: flex;
  justify-content: flex-end;
}

.nav__list a {
  position: relative;
}

.nav__list a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  border-bottom: 1px solid var(--color-light);
  box-shadow: inset 0px -1px 0px 0px var(--color-light);
  transition: all 0.3s ease;
  pointer-events: none;
}

.nav__list a:hover {
  text-decoration: none;
}

.nav__list a:hover::after {
  opacity: 0.8;
}

.nav__phone {
  font-size: 20px;
}

.nav__phone a:hover {
  text-decoration: none;
}

.nav__social {
  margin-left: 30px;
}

.nav__social a {
  transition: all 0.3s ease;
  margin-left: 10px;
  opacity: 1;
}

.nav__social a:hover {
  opacity: 0.8;
  text-decoration: none;
}

.menu-burger {
  display: none;
  position: relative;
  flex-shrink: 0;
  width: 28px;
  height: 20px;
  padding: 0;
  border: none;
  background-color: transparent;
  outline: none;
  transform: rotate(0deg);
  transition: transform .5s ease-in-out;
  cursor: pointer;
  z-index: 999;
}

.menu-burger-line {
  height: 2px;
  display: block;
  position: absolute;
  width: 100%;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
  background-color: var(--color-light);
}

.menu-burger span:nth-child(1) {
  top: 0px;
}

.menu-burger-opened span:nth-child(1),
.menu-burger-opened span:nth-child(4) {
  top: 6px;
}

.menu-burger span:nth-child(2),
.menu-burger span:nth-child(3) {
  top: 7px;
}

.menu-burger span:nth-child(4) {
  top: 14px;
}


.menu-burger-opened span:nth-child(2) {
  transform: rotate(45deg);
}

.menu-burger-opened span:nth-child(3) {
  transform: rotate(-45deg);
}

.menu-burger-opened span:nth-child(4) {
  width: 0 !important;
  right: 50%;
}

.menu-burger-opened span:nth-child(1) {
  top: 8px;
  width: 0%;
  left: 50%;
}

.menu-burger span:nth-child(1) {
  top: 0px;
}

.menu-burger-opened span:nth-child(4) {
  top: 8px;
  width: 0%;
  left: 50%;
}

.menu-burger__small span:nth-child(4) {
  top: 12px;
}

.title {
  font-family: Georgia, 'Times New Roman', Times, serif;
}

.main {
  position: relative;
  overflow: hidden;
  height: 70vh;
  background-image: url(../img/home-top-banner.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: top center;
}

.main .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  height: 100%;
  align-items: center;
  color: var(--color-primary);
}

.main__title {
  font-size: 90px;
  font-size: clamp(24px, 6vh, 90px);
  line-height: clamp(24px, 6vh, 90px);
  font-weight: normal;
  display: block;
}

.main__subtitle {
  font-size: clamp(18px, 3vh, 38px);
  line-height: clamp(18px, 3vh, 38px);
  font-weight: normal;
  margin-top: 20px;
  display: block;
}

.main__represent {
  width: 50%;
  padding-left: 30px;
}

.main__photo {
  max-width: 50%;
  max-height: 100%;
}

.main__represent button {
  margin-top: 30px;
  width: auto;
}

.animated {
  opacity: 0;
  position: relative;
  animation-duration: 1s;
  animation-delay: 0.5s;
  animation-fill-mode: forwards;
}

.animated.appearY {
  animation-name: appearY;
}

.animated.appearX {
  animation-name: appearX;
}

@keyframes appearY {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes appearX {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.about {
  background: var(--color-primary);
  color: var(--color-light);
}


#about-photo-grid {
  grid-area: span 1 / span 1 / span 1 / span 1;
  align-self: start;
}

#about-photo-grid-first-photo {
  grid-area: 1 / 1 / 2 / 3;
  justify-self: end;
}

#about-photo-grid-second-photo {
  place-self: start end;
}

#about-photo-grid-third-photo {
  justify-self: end;
}

#about-content-group {
  align-self: stretch;
}

.content-group {
  z-index: 1;
  grid-column-gap: 1.25em;
  grid-row-gap: 1.25em;
  text-wrap: balance;
  flex-flow: column wrap;
  justify-content: flex-start;
  align-items: stretch;
  display: flex;
  position: relative;
}

.collage-image.medium {
  border-radius: 3.5em 3.5em 1000px 1000px;
  width: 14.0625em;
  height: 14.0625em;
}

.collage-image.small {
  border-radius: 1000px 5em 5em 1000px;
  width: 10.625em;
  height: 10.625em;
}

.feature-wrap {
  z-index: 0;
  justify-content: center;
  align-items: center;
  display: flex;
  position: relative
}

.feature-wrap.collage-grid {
  grid-column-gap: 1.5625em;
  grid-row-gap: 1.5625em;
  grid-template-rows: auto;
  grid-template-columns: 1fr auto;
  grid-auto-columns: 1fr;
  display: grid
}

.collage-image.large {
  background-color: var(--tan-green);
  border-radius: 1000% 1000% 15em 15em;
  width: 25em;
  height: 28.125em;
}

.collage-image {
  z-index: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.section-content.large-left {
  grid-template-columns: 1.5fr 1fr;
}

.section-content {
  grid-column-gap: 3em;
  grid-row-gap: 5em;
  grid-template-rows: auto;
  grid-template-columns: 1fr 1fr;
  grid-auto-columns: 1fr;
  place-content: start flex-start;
  align-items: center;
  width: 100%;
  display: grid;
}

.gallery-cell {
  width: 100%;
  height: 800px;
  margin-right: 10px;
}

.gallery-cell img {
  width: 100%;
}

.dots {
  flex: 1;
  border-bottom: 1px dotted #bbb;
  margin: 0 8px;
  height: 1em;
}

#certificates .title {
  margin-bottom: 1em;
}

.card {
  padding: 1rem 1.5rem;
  background: rgba(251, 250, 248, 0.8);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card h3 {
  font-size: 1.5em;
  margin-bottom: 15px;
}

.card li {
  list-style: none;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

#services {
  background: #8b4224;
}

#services .title {
  color: var(--color-light);
}

#work-photo {
  grid-area: span 1 / span 1 / span 1 / span 1;
}

.feature-wrap.rounded-right.div-square {
  height: 100%;
}

.feature-wrap.rounded-right {
  border-radius: 18em 10000px 10000px 18em;
  margin-left: -5rem;
  overflow: hidden;
}

.div-square {
  position: relative;
}

.feature-image {
  z-index: 0;
  object-fit: cover;
  width: 100%;
  max-width: 100%;
  height: 100%;
  inset: 0%;
}

.content-group.spread-vertical {
  justify-content: space-between;
}

#services .section-content {
  margin-top: 30px;
}

.price-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.price-item {
  padding: 24px 0;
  border-bottom: 1px solid #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.duration {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
}

.service {
  font-size: 20px;
}

.price {
  font-size: 28px;
  white-space: nowrap;
}

#prices,
#certificates {
  background: var(--color-light);
}

.methods {
  margin-top: 50px;
}

.method {
  margin: 3em 1em;
}

.method h4 {
  font-weight: bold;
  border-bottom: 1px solid #333;
  padding-bottom: 0.5em;
}

.contact-form {
  display: flex;
  justify-content: space-around;
  margin-top: 60px;
  gap: 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 0, 0, 0.8);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -25px;
  margin-top: -25px;
}

.contact-form.loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 1;
}

.contact-form.loading .spinner {
  display: block;
}

dialog {
  margin: auto;
  border: medium;
  border-radius: 12px;
  max-width: 400px;
  box-shadow: rgba(0, 0, 0, 0.15) 0px 10px 25px;
  position: fixed;
  padding: 24px;
  text-align: center;
  transform: translate(-50%, -50%);
}

dialog[open] {
  animation: slideUp 0.3s ease-out;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.contact-form input {
  border: 1px solid #bbb;
  border-radius: 5px;
  padding: 10px;
  display: block;
  width: 100%;
  height: 56px;
  font-size: 1.1em;
  font-weight: 400;
}

.contacts {
  padding: 3em;
  width: 70%;
  margin: 8em auto;
  position: relative;
}

.contacts .title {
  font-size: 2.6875em;
  font-weight: 400;
  text-align: center;
}

.contact-form__elem {
  width: 33%;
}

.button {
  border: none;
  display: block;
  width: 100%;
  height: 56px;
  font-size: 1.1em;
  font-weight: 400;
  border-radius: 5px;
  background: #8b4224;
  color: var(--color-light);
  transition: all 0.3s ease;
  opacity: 1;
  padding: 0 30px;
}

.button:hover {
  cursor: pointer;
  opacity: 0.8;
}

footer {
  background: var(--color-light);
}

@media (max-width: 1024px) {
  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 3rem;
  }

  h4 {
    font-size: 1.5rem;
  }

  .main {
    height: auto;
    padding: 4em 0;
  }

  .contact-form {
    flex-direction: column;
  }

  .contact-form__elem {
    width: 100%;
  }

  .contacts {
    width: 90%;
    margin: 4em auto;
    padding: 2em;
  }
}

.overlay {
  position: fixed;
  inset: 0;
  transition: all 0.3s ease-in-out;
  background: #000;
  opacity: .6;
  z-index: 1;
  cursor: pointer;
  display: none;
}

.overlay-opened {
  display: block;
}

@media (max-width: 768px) {
  h1 {
    font-size: 36px;
  }

  .price-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .price {
    font-size: 22px;
  }

  .main__photo {
    max-width: 70%;
  }

  .main__represent {
    width: auto;
  }

  .section-content,
  .about__container {
    display: block;
  }

  .nav__list {
    margin-bottom: 20px;
    display: block;
    text-align: center;
  }

  .nav__contacts {
    text-align: center;
    display: block;
    padding-bottom: 20px;
  }

  .nav__social {
    margin: 15px 0 0 0;
  }

  p {
    font-size: 1em;
  }

  .feature-image {
    margin-bottom: 20px;
    height: 600px;
  }

  .feature-wrap.collage-grid {
    grid-template-columns: 0fr auto;
  }

  #about-photo-grid-second-photo {
    place-self: start;
  }

  .gallery-cell {
    height: 500px;
  }

  .menu-burger {
    display: block;
  }

  .nav.container {
    padding: 15px;
  }

  .nav-container {
    position: fixed;
    right: 0;
    top: 0;
    left: 0;
    transition: all 0.3s ease;
    z-index: 2;
    background: var(--color-primary);
    transform: translateY(-100%);
  }

  .nav-container-opened {
    top: 50px;
    transform: translateY(0);
  }

  .header {
    position: fixed;
    width: 100%;
  }

  .main__represent {
    padding: 0;
  }


  .collage-image.large {
    width: 80vw;
    height: 80vw;
  }

  .collage-image.small {
    width: 37vw;
    height: 37vw;
  }

  .collage-image.medium {
    width: 50vw;
    height: 50vw;
  }
}

@media (max-width: 425px) {
  .container {
    padding: 2em 15px;
  }

  .nav {
    padding: 15px;
  }

  h2,
  .contacts .title {
    font-size: 2rem;
  }

  .main__title {
    font-size: 2.25rem;
    line-height: 2.25rem;
  }

  .main__subtitle {
    font-size: 1.25rem;
    line-height: 1.25rem;
  }

  .main__photo {
    max-width: 85%;
  }

  .main {
    padding-bottom: 0;
  }

  .price-item {
    padding: 10px 0;
  }

  .button {
    padding: 0 20px;
    height: 50px;
  }

  .gallery-cell {
    height: 250px;
  }

  .card {
    padding: 1em;
  }

  .method {
    margin: 0;
  }

  .service,
  .price {
    font-size: 16px;
  }

  .contact-form {
    margin-top: 30px;
  }
}