:root {
  --primary: hsl(218, 75%, 20%);
  --white: white;
  --black: black;
  --title: "Poller One", serif;
  --sub: "Pontano Sans", sans-serif;
  --s: calc(1rem + 0.3vw);
  --m: calc(1rem + 1vw);
  --l: calc(2rem + 2vw);
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  font-family: var(--sub);
  overflow-x: clip;
  font-weight: 400;
  position: relative;
}
body {
  overflow-y: clip;
}
::-webkit-scrollbar {
  width: 0;
}

a,
button {
  text-decoration: inherit;
  color: inherit;
  background-color: inherit;
  border: inherit;
}

section,
footer,
header {
  position: relative;
  background-color: var(--white);
}

nav {
  position: relative;
  transition: 0.5s;
  z-index: 1000;
  width: 100%;
  height: 4em;
  background-color: white;
  top: 0;
  position: fixed;
  padding: 1em 0;
  font-size: var(--s);
  text-transform: uppercase;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  .socials {
    font-size: 2em;
    display: flex;
    align-items: center;
    gap: 0.5em;
  }
  .nav-link {
    position: relative;
  }
  .nav-link:hover::before {
    opacity: 1;
    translate: 0;
  }
  .nav-link::before {
    pointer-events: none;
    opacity: 0;
    translate: 0 0.5em;
    transition: 0.2s;
    content: "";
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--black);
    height: 2px;
  }
  .nav-toggle {
    display: none;
    margin: 0.6em 0;
    cursor: pointer;
  }
}

@media (width < 800px) {
  nav {
    overflow: clip !important;
    padding: 1em 2em;
    justify-content: space-between;
    align-items: flex-start;
    .nav-toggle {
      display: initial;
    }
    .nav-link {
      position: absolute;
    }
    .nav-link:nth-of-type(2) {
      top: 50vh;
      left: 50%;
      translate: -50% calc(50% - 4em);
    }
    .nav-link:nth-of-type(3) {
      top: 50vh;
      left: 50%;
      translate: -50% calc(50% - 2em);
    }
    .nav-link:nth-of-type(4) {
      top: 50vh;
      left: 50%;
      translate: -50% 50%;
    }
    .nav-link:nth-of-type(5) {
      top: 50vh;
      left: 50%;
      translate: -50% calc(50% + 2em);
    }
    .nav-link:nth-of-type(6) {
      top: 50vh;
      left: 50%;
      translate: -50% calc(50% + 4em);
    }
  }
}

header {
  position: relative;
  padding-top: 4em;
  font-size: var(--s);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  .content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25em;
  }
  & h1 {
    font-family: var(--title);
  }
  & p {
    margin-left: 5em;
  }
  & a {
    margin-bottom: 2em;
    text-transform: capitalize;
    padding: 0.25em 0.6em;
    border-radius: 1em;
    background-color: var(--black);
    color: var(--white);
    transition: 0.2s;
    border: 2px solid var(--black);
  }
  & a:hover {
    background-color: var(--white);
    color: var(--black);
  }
  & iconify-icon {
    margin-left: 0.5em;
  }
  & img {
    position: absolute;
    width: min(50ch, 90vw);
    bottom: 0;
  }
}

#about {
  padding-top: 10em;
  font-size: var(--s);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4em;
  }
  & h2 {
    text-transform: uppercase;
    font-family: var(--title);
    font-size: var(--m);
  }
  & p {
    margin-top: 0.35em;
    margin-left: 7ch;
    text-align: center;
    line-height: 1.3em;
    width: min(42ch, 80vw);
  }
  .content > div:nth-child(1) {
    margin-left: 30ch;
  }
  .content > div:nth-child(2) {
    margin-right: 30ch;
  }
  & img {
    width: min(50ch, 90vw);
  }
}

.scroll-fade {
  opacity: 0;
  translate: 0 0.5em;
}

.fade {
  animation: fade 0.3s forwards;
}

@keyframes fade {
  0% {
    opacity: 0;
    translate: 0 0.5em;
  }

  100% {
    opacity: 1;
    translate: 0;
  }
}

.scroll-slide-left {
  translate: 120% 0;
}

.scroll-slide-right {
  translate: -120% 0;
}

.slide {
  animation: slide 1s forwards;
}

@keyframes slide {
  100% {
    translate: 0;
  }
}

#services {
  padding-top: 10em;
  font-size: var(--s);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  & img {
    height: min(20ch, 70vw);
  }
  & h3 {
    text-transform: uppercase;
    font-family: var(--title);
    font-size: var(--m);
  }
  & h3 ~ p {
    margin-bottom: 5em;
    margin-top: 0.25em;
    margin-left: 16ch;
    text-transform: uppercase;
  }
  & strong {
    text-transform: uppercase;
    font-family: var(--title);
    font-size: var(--s);
  }
  .container p {
    margin-top: 0.5em;
  }
  .container .service:nth-of-type(odd) {
    text-align: right;
    border-right: 2px solid var(--black);
  }
  .container .service:nth-of-type(even) {
    text-align: left;
    border-left: 2px solid var(--black);
  }
  .service {
    overflow-x: clip;
    padding: 1em;
  }
  .container {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: center;
    gap: 2em;
  }
  .container > .service {
    flex-basis: 100%;
  }
  .service:nth-of-type(1) {
    margin-bottom: -10ch;
    flex-basis: 50%;
  }
  .service:nth-of-type(2) {
    flex-basis: 70%;
  }
  .service:nth-of-type(3) {
    flex-basis: 80%;
  }
  .service:nth-of-type(4) {
    flex-basis: 40%;
  }
  .service:nth-of-type(5) {
    flex-basis: 40%;
  }
  & img:nth-of-type(1) {
    translate: 0 -4em;
  }
  & img:nth-of-type(2) {
    object-fit: contain;
    flex-basis: 40%;
  }
  & img:nth-of-type(3) {
    object-fit: contain;
    flex-basis: 40%;
  }
}

#testimonials {
  position: relative;
  margin-top: 20em;
  margin-bottom: 20em;
  padding-top: 3em;
  font-size: var(--s);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--primary);
  color: var(--white);
  & h4 {
    text-transform: uppercase;
    font-family: var(--title);
    font-size: var(--m);
  }
  & h4 ~ p {
    margin-bottom: 5em;
    margin-top: 0.25em;
    margin-left: 20ch;
    text-transform: uppercase;
  }
  .person {
    font-family: var(--title);
    font-size: var(--s);
    padding: 0.5em 1em;
    margin: 0 1em;
  }
  .testimonial {
    position: relative;
  }
  .testimonial:nth-last-of-type(1) {
    translate: -20ch 0;
  }
  .testimonial:nth-last-of-type(2) {
    text-align: right;
    translate: 15ch 0;
  }
  .testimonial:nth-last-of-type(3) {
    translate: -15ch 0;
  }
  .person ~ p {
    max-width: 50ch;
    background-color: var(--white);
    color: var(--black);
    padding: 1.5em;
    border-radius: 1em;
    margin: 0 1em 3em 1em;
  }
}

.circle {
  clip-path: polygon(0% 20%, 100% 20%, 100% 80%, 0% 80%);

  top: 0;
  z-index: -2;
  translate: 0 -85vw;
  position: absolute;
  width: 150vw;
  height: 150vw;
  overflow: clip;
}
.flip {
  rotate: 180deg;
  bottom: 0;
  top: unset;
  translate: 0 85vw;
}

.wave {
  position: relative;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
}
.wave:before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 200%;
  height: 200%;
  background: black;
  transform: translate(-50%, -75%);
}
.wave:before {
  border-radius: 45%;
  background: rgba(255, 255, 255, 1);
  animation: animate 20s linear infinite;
}

@keyframes animate {
  0% {
    transform: translate(-50%, -75%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -75%) rotate(360deg);
  }
}

#areas {
  font-size: var(--s);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  & h5 {
    text-transform: uppercase;
    font-family: var(--title);
    font-size: var(--m);
  }
  & h5 ~ p {
    margin-bottom: 6em;
    margin-top: 0.25em;
    margin-left: 15ch;
    text-transform: uppercase;
  }
  .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2em;
  }
  .container > div {
    z-index: 2;
    flex-basis: 100%;
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    gap: 2em;
  }
  & a {
    position: relative;
    width: 25ch;
    padding: 0.7em 1em;
    color: var(--white);
    background-color: #cc1717;
  }
  & a:hover::before {
    translate: 0;
  }
  & a::before {
    transition: 0.3s;
    z-index: -1;
    position: absolute;
    content: "";
    top: 0;
    left: 0;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    border: 2px solid hsl(0, 70%, 90%);
    translate: -1em -1em;
  }

  & img {
    margin: 3em 20vw 0;
    width: min(40ch, 80vw);
  }
}

#contact {
  position: relative;
  margin-top: 20em;
  padding-top: 3em;
  font-size: var(--s);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--primary);
  color: var(--white);
  & h6 {
    margin-right: 4ch;
    text-align: center;
    text-transform: uppercase;
    font-family: var(--title);
    font-size: var(--m);
  }
  & h6 ~ p {
    text-align: center;
    margin-bottom: 3em;
    margin-top: 0.25em;
    margin-left: 6ch;
    text-transform: uppercase;
  }
  & form {
    width: min(40ch, 90vw);
    display: flex;
    flex-direction: column;
    margin-bottom: 5em;
  }
  & input,
  textarea {
    width: 100%;
    border-radius: 2em;
    border: none;
    background-color: white;
    padding: 0.7em 1.5em;
    margin-bottom: 1em;
  }
  & textarea {
    border-radius: 1em;
    height: 10em;
    resize: none;
  }
  & input,
  textarea,
  input::placeholder,
  textarea::placeholder {
    font-size: var(--s);
    font-family: var(--sub);
    color: var(--black);
  }
  & label {
    display: none;
  }
  & button {
    font-size: var(--s);
    font-family: var(--sub);
    color: var(--white);
    padding: 0 1.5em;
    text-transform: uppercase;
    align-self: flex-end;
  }
  & button:hover {
    cursor: pointer;
  }
}

@media (width < 1100px) {
  header {
    & p {
      margin: 0;
    }
  }
  #about {
    text-align: center;
    .content > div:nth-child(1) {
      display: flex;
      justify-content: center;
      flex-direction: column;
      align-items: center;
      margin-left: 0;
    }
    .content > div:nth-child(2) {
      display: flex;
      justify-content: center;
      flex-direction: column;
      align-items: center;
      margin-right: 0;
    }
    & p {
      margin-left: 0;
      margin-right: 0;
    }
  }

  #services {
    & h3 ~ p {
      text-align: center;
      margin-left: 0;
    }
    .container {
      flex-direction: column;
    }
    .container > .service:nth-of-type(odd) {
      align-self: flex-end;
      margin: 0 1em;
    }

    .container > .service:nth-of-type(even) {
      align-self: flex-end;
      margin: 0 1em;
    }

    .container > img {
      display: none;
    }
    & br {
      display: none;
    }
  }
  #testimonials {
    margin-top: 10em;
    margin-bottom: 10em;
    & h4 ~ p {
      text-align: center;
      margin-left: 0;
    }
    .testimonial {
      translate: 0 !important;
    }
  }
  #areas {
    .container > div {
      flex-direction: column;
    }
    & h5 ~ p {
      margin-left: 0;
    }
  }
  #contact {
    margin-top: 10em;
    & h6 ~ p {
      margin-left: 0;
    }
    & h6 {
      margin-right: 0;
    }
  }
  footer {
    margin-top: 10em !important;
  }
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    text-align: center;
    padding: 0 3ch;
  }
}

footer {
  margin-top: 20em;
  font-size: var(--s);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .content {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .half {
    height: 10em;
    width: 50vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2em 3em;
    gap: 1.5em;
  }

  .half:nth-of-type(2) {
    text-align: right;
  }
}

@media (width < 800px) {
  footer {
    .content {
      flex-direction: column-reverse;
    }

    .half {
      height: unset;
      width: 100vw;
      text-align: right;
    }
    .half:nth-of-type(1) {
      padding-top: 0;
    }
  }
}

#testimonials-tag,
#areas-tag,
#contact-tag {
  position: absolute;
  top: 0;
  margin-top: -7em;
}
