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

:root {
  --primary-color: rgb(216, 73, 139);
  --button-color: #ffed00;
  --button-dark: #ccba00;
  --text-color: #ffffff;

  font-size: calc(1em * 0.625);
  box-sizing: border-box;
  scroll-behavior: smooth;
}

*,
*::after,
*::before {
  box-sizing: inherit;
}

/* Remove default padding */
ul,
ol {
  padding: 0;
}

/* Remove default margin */
body,
h1,
h2,
p,
figure,
figcaption {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a {
  text-decoration-skip-ink: auto;
  text-decoration: none;
  color: inherit;
}

/* Make images easier to work with */
img {
  max-width: 100%;
  min-width: 0;
  display: block;
}

label,
img,
picture {
  user-select: none;
}

[hidden] {
  display: none;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #eee;
  clip: auto !important;
  clip-path: none;
  color: #444;
  display: block;
  font-size: 1em;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

body {
  position: relative;

  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  justify-content: start;

  font-size: 1.6em;
  scroll-behavior: smooth;
  text-rendering: optimizeSpeed;
  line-height: 1.5;

  background-color: var(--primary-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;
  height: 100dvh;
  max-height: 100dvh;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  padding: 0;
  overflow: hidden;

  & header {
    max-width: 100rem;
    padding: 1rem 0 0;

    flex: 0 1 auto;

    & h1 {
      & img {
        width: 100%;
        min-width: 0;
      }
    }
  }

  & main {
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;

    flex: 1 1 auto;

    height: auto;
    width: 100%;

    & nav.links-grid {
      --nav-grid-padding: 0 2rem;
      --link-image-side: 11rem;

      display: grid;
      grid-template-columns: repeat(4, 1fr);
      grid-template-rows: 20rem 25rem;
      align-items: center;
      justify-items: center;

      width: 100%;
      max-width: 140rem;
      padding: var(--nav-grid-padding);

      & .social-link {
        position: relative;
        display: block;
        padding: 0.5rem 0.5rem 1rem;
        width: fit-content;

        &:hover {
          transform: scale(1.04);

          &::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 1rem;
            right: 1rem;
            border-bottom: 0.2rem solid var(--button-color);
          }
        }

        & img {
          width: var(--link-image-side);
          height: var(--link-image-side);
          object-fit: contain;
          filter: drop-shadow(0.2rem 0.2rem 0.3rem rgba(0, 0, 0, 0.2));
        }

        &:nth-child(1) {
          justify-self: center;
          align-self: end;
        }

        &:nth-child(2) {
          justify-self: center;
          align-self: center;
        }

        &:nth-child(3) {
          justify-self: center;
          align-self: end;
        }

        &:nth-child(4) {
          justify-self: center;
          align-self: center;
        }

        &:nth-child(5) {
          justify-self: start;
          align-self: end;
        }

        &:nth-child(6) {
          justify-self: center;
          align-self: center;
        }

        &:nth-child(7) {
          justify-self: end;
          align-self: end;
        }

        &:nth-child(8) {
          justify-self: end;
          align-self: start;
        }
      }
    }
  }

  /* Small screen Responsiveness */
  @media (max-width: 1024px) and (orientation: portrait) {
    & main nav.links-grid {
      --link-image-side: 9rem;
      grid-template-rows: 20rem 20rem;
    }
  }

  /* Small screen Responsiveness */
  @media (max-width: 1024px) and (orientation: landscape) {
    & header {
      max-width: 90dvw;
      padding: 0;
    }

    & main nav.links-grid {
      --link-image-side: 6rem;
      --nav-grid-padding: 0 5rem;
      grid-template-rows: 10rem 10rem;
    }
  }

  /* Mobile Responsiveness */
  @media (max-width: 768px) and (orientation: portrait) {
    & header {
      /* margin-bottom: 0.5rem; */
    }

    & main nav.links-grid {
      --nav-grid-padding: 0 2rem;
      --link-image-side: 7rem;
    }
  }

  /* Small Mobile */
  @media (max-width: 650px) and (orientation: portrait) {
    & main nav.links-grid {
      --nav-grid-padding: 0 5rem;
      --link-image-side: 7.5rem;

      grid-template-columns: repeat(2, 1fr);
      grid-template-rows: repeat(2, 10rem) repeat(2, 15rem);

      & > .social-link:nth-child(1) {
        justify-self: start;
        align-self: center;
      }

      & > .social-link:nth-child(2) {
        justify-self: start;
        align-self: start;
      }

      & > .social-link:nth-child(3) {
        justify-self: end;
        align-self: center;
      }

      & > .social-link:nth-child(4) {
        justify-self: end;
        align-self: start;
      }

      & > .social-link:nth-child(5) {
        justify-self: start;
        align-self: center;
      }

      & > .social-link:nth-child(6) {
        justify-self: start;
        align-self: end;
      }

      & > .social-link:nth-child(7) {
        justify-self: center;
        align-self: center;
      }

      & > .social-link:nth-child(8) {
        justify-self: end;
        align-self: end;
      }
    }
  }

  /* very Small Mobile */
  @media (max-width: 400px) {
    & main nav.links-grid {
      --nav-grid-padding: 0 5rem;
      --link-image-side: 6rem;

      grid-template-rows: repeat(2, 10rem) repeat(2, 15rem);
    }
  }
}
