*,
*::after,
*::before {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

* {
  --clr-primary-900: hsl(240, 11%, 96%);
  --clr-primary-800: hsl(0, 0%, 92%);
  --clr-primary-700: hsl(0, 0%, 87%);
  --clr-primary-600: hsl(240, 0%, 58%);
  --clr-primary-400: hsl(240, 1%, 39%);
  --clr-primary-200: hsl(0, 0%, 19%);
  --clr-primary-100: hsl(0, 0%, 0%);

  --clr-box-shadow: rgba(0, 0, 0, 0.1);
}

i.file-icon {
  background-image: url(images/file.svg);
}

i.video-icon {
  background-image: url(images/video.svg);
}

/* Un-comment for dark mode, however
   the logo doesn't display properly on a dark background */
/* @media (prefers-color-scheme: dark) {
  * {
    --clr-primary-100: hsl(240, 11%, 96%);
    --clr-primary-200: hsl(0, 0%, 92%);
    --clr-primary-400: hsl(0, 0%, 87%);
    --clr-primary-600: hsl(240, 0%, 58%);
    --clr-primary-700: hsl(0, 0%, 15%);
    --clr-primary-800: hsl(0, 0%, 11%);
    --clr-primary-900: hsl(0, 0%, 8%);
  }

  i.file-icon {
    background-image: url(images/file-dark.svg);
  }

  i.video-icon {
    background-image: url(images/video-dark.svg);
  }

  .container {
    background-color: var(--clr-primary-800) !important;
  }

  .header__title img {
    logo isn't visible on a dark background
  }
} 
*/

html {
  font-family: 'Noto Sans', sans-serif;
  color: var(--clr-primary-100);
}

body {
  height: 100svh;
  width: 100svw;
  background-color: var(--clr-primary-900);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.container {
  background-color: var(--clr-primary-900);
  border-radius: 2rem;
  padding: 3rem;
  min-height: 500px;
  max-height: 100svh;
  min-width: 300px;
  max-width: 1110px;
  overflow-y: auto;
  box-shadow: 2px 2px 50px 10px var(--clr-box-shadow);
  opacity: 0;
  animation: fadeInOnLoad forwards ease-in-out 0.8s;
}

.header {
  margin-bottom: 4rem;
}

.header__title {
  --font-size: 2.5rem;
  font-size: var(--font-size);
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  text-transform: uppercase;
  margin-block: 1rem;
}

.header__contact {
  color: var(--clr-primary-400);
}

.header__title img {
  height: calc(var(--font-size) * 1.25);
}

.links--container {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  gap: 2rem;
  flex-wrap: wrap;
}

.links {
  margin-block: 2rem;
}

.links > h2 {
  position: relative;
  padding-left: 0.5rem;
  padding-bottom: 0.8rem;
}

.links > h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 99%;
  height: 2px;
  border-radius: 1px;
  background-color: var(--clr-primary-700);
}

.links__list {
  --animation-delay-base: 0.3s;

  list-style: none;
  height: 400px;
  overflow-y: auto;
  margin-right: 5px;
  overflow-x: hidden;
}

.links__list > a {
  position: relative;
  display: block;
  width: 400px;
  text-decoration: none;
}

.links__list > a > li {
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  transition: background-color 0.1s ease-out;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  gap: 0.8rem;
}

i.file-icon,
i.video-icon {
  min-width: 24px;
  width: 24px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
}

.links__list > a > li > div {
  overflow: hidden;
}

.links__list > a > li > div > * {
  display: block;
  color: var(--clr-primary-200);
  overflow: hidden;
  text-overflow: ellipsis;
  text-wrap: nowrap;
}

.links__list > a > li > div > *:first-child {
  text-decoration: underline;
}

.links__list > a > li > div > *:last-child {
  font-size: 0.8rem;
}

.links__list > a > li:hover,
.links__list > a:focus > li {
  background-color: var(--clr-primary-700);
}

.links__list > a:not(:first-child)::before {
  position: absolute;
  top: -0.5px;
  left: 10%;
  content: '';
  width: 80%;
  background-color: var(--clr-primary-700);
  height: 1px;
  opacity: 0;
  animation: fadeInOnLoad ease-out 0.5s forwards;
}

.links__list > a > li {
  transform: translateY(40px);
  opacity: 0;
  animation: fadeInOnLoad ease-out 0.5s forwards;
  animation-delay: var(--animation-delay-base);
}

.links__list > a:nth-child(1) > li {
  animation-delay: calc(var(--animation-delay-base) + 0.1s);
}

.links__list > a:nth-child(2) > li,
.links__list > a:nth-child(2)::before {
  animation-delay: calc(var(--animation-delay-base) + 0.2s);
}

.links__list > a:nth-child(3) > li,
.links__list > a:nth-child(3)::before {
  animation-delay: calc(var(--animation-delay-base) + 0.3s);
}

.links__list > a:nth-child(4) > li,
.links__list > a:nth-child(4)::before {
  animation-delay: calc(var(--animation-delay-base) + 0.4s);
}

.links__list > a:nth-child(5) > li,
.links__list > a:nth-child(5)::before {
  animation-delay: calc(var(--animation-delay-base) + 0.5s);
}

.links__list > a:nth-child(6) > li,
.links__list > a:nth-child(6)::before {
  animation-delay: calc(var(--animation-delay-base) + 0.6s);
}

.links__list > a:nth-child(7) > li,
.links__list > a:nth-child(7)::before {
  animation-delay: calc(var(--animation-delay-base) + 0.7s);
}

@keyframes fadeInOnLoad {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 500px) {
  .container {
    padding-inline: 1rem;
    border-radius: 0;
  }

  .links__list {
    background-color: var(--clr-primary-800);
    border-radius: 1rem;
    box-shadow: 2px 2px 50px 10px var(--clr-box-shadow);
  }

  .links > h2::after {
    display: none;
  }

  .links__list > a {
    width: 350px;
  }
}
