@import url('animations.css');
@import url('fonts.css');
@import url('normalize.css');
@import url('variables.css');

/* General styles */
html {
  font-size: var(--font-size);
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: 0.3s ease-in-out;
  font-family: 'Lora';
}

main {
  height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.hidden {
    display: none;
}

.layout {
    animation: fadeIn 0.6s ease-in-out;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
}

img {
  width: 100%;
  height: 100%;
}

.imageContainer {
  position: relative;
  width: 20rem;

  &::before {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 10px;
    right: 10px;
    background-color: var(--accent-color);
    z-index: -1;
    transition: 0.3s ease-in-out;
    animation: slideAskew 0.6s ease-out;
  }
}

.textContainer {
  display: flex;
  flex-direction: column;

  @media (hover: hover) {
    & .movingContainer:hover .moving {
      animation-duration: 0.2s;
    }
  }

  & .moving {
    display: inline-block;
    animation: wave 1s step-start infinite forwards;

    &:nth-of-type(1) {
      animation-delay: calc(1 * 0.05s);
    }

    &:nth-of-type(2) {
      animation-delay: calc(2 * 0.05s);
    }

    &:nth-of-type(3) {
      animation-delay: calc(3 * 0.05s);
    }

    &:nth-of-type(4) {
      animation-delay: calc(4 * 0.05s);
    }

    &:nth-of-type(5) {
      animation-delay: calc(5 * 0.05s);
    }

    &:nth-of-type(6) {
      animation-delay: calc(6 * 0.05s);
    }
  }

  & section {
    margin-top: 2rem;
  }

  & p:not(:first-of-type) {
    margin-top: 0.25rem;
  }

  & a {
    display: inline-block;
    position: relative;

    &::before {
      content: "";
      display: block;
      position: absolute;
      width: 100%;
      height: 2px;
      bottom: -5px;
      right: 0;
      background-color: var(--accent-color);
      transform: scaleX(0);
      transform-origin: left;
      transition: transform 0.15s ease-in-out;
    }

    @media (hover: hover) {
      &:hover::before {
        transform: scaleX(1);
        transform-origin: right;
      }
    }
  }

  & nav a::before {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: calc(100% - 8px);
    top: 8px;
    right: 0;
    background-color: var(--accent-color);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.15s ease-in-out;
  }
}

nav {
  margin-top: 1.5rem;
  & a {
    position: relative;
  }
}

.themeSelectionContainer {
  width: 5rem;
  transition: width ease-in-out 0.15s;

  &:nth-of-type(2) {
    display: none;
  }

  & .themeRange {
    width: 100%;
  }


  & .colorThemeOptions {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  & .sizeThemeOptions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    &  span:nth-child(1) {
      &:nth-child(1) {
        font-size: 0.75rem;
      }
      
      &:nth-child(2) {
        font-size: 0.875rem;
      }
      
      &:nth-child(3) {
        font-size: 1rem;
      }
    }
  }
}

footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 20px;

  &::-webkit-slider-runnable-track {
    background-color: var(--accent-color);
    height: 0.2rem;
    border-radius: 0.1rem;
  }

  &::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -6px;
    border-radius: 0.45rem;
    background-color: var(--text-color);
    height: 0.9rem;
    width: 0.9rem;
  }

  &::-moz-range-track {
    background-color: var(--accent-color);
    height: 0.2rem;
    border-radius: 0.1rem;
  }

  &::-moz-range-thumb {
    border: none;
    border-radius: 0.45rem;
    background-color: var(--text-color);
    height: 0.9rem;
    width: 0.9rem;
  }
}

@media (max-width:961px) {
  :root {
    --font-size: var(--small-font-size);
  }

  main {
    max-width: -webkit-fill-available;
    max-height: -webkit-fill-available;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .imageContainer {
    width: 15rem;
    margin: 0 auto;
  }

  .textContainer {
    z-index: 2;
  }

  footer {
    margin-top: 3rem;
  }

  .themeSelectionContainer:nth-of-type(2) {
    display: block;
  }
}
