@import url("https://fonts.googleapis.com/css?family=Raleway&display=swap");
@import url("https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap");

// Variables

$small-screen: 48em !default;
$medium-screen: 62em !default;
$large-screen: 75em !default;
$font-family: "Raleway", sans-serif;
$font-family-numbers: "Josefin Sans", sans-serif;
$font-size-base: 1rem !default;
$font-size-h1: 2rem !default;
$font-weight-strong: 600;
$text-color: #fff !default;
$bg-color: rgba(43, 45, 47, 1);
$card-bg-color: linear-gradient(
  145deg,
  rgba(115, 115, 115, 0.15) 15%,
  rgba(43, 45, 47, 1) 80%
);
$primary-color: #ff073a;

// General

html {
  background: $bg-color;
  color: $text-color;
  font-family: $font-family;
  font-size: $font-size-base;
  font-weight: normal;
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
}

// Typography

h1 {
  font-size: $font-size-h1;
  font-weight: $font-weight-strong;
  line-height: 2rem;
}

p {
  word-spacing: 0.1rem;
}

a {
  color: $primary-color;
  text-decoration: none;

  &:hover {
    color: $text-color;
  }
}

.highlight-title {
  color: $primary-color;
  text-shadow: 0.25rem 0.25rem 0.25rem $primary-color;
}

.highlight-link {
  box-shadow: inset 0 -0.125rem 0 $primary-color;
  box-sizing: border-box;
  color: $primary-color;
  display: inline-block;
  padding: 0.125rem 0.125rem;
  transition: all 0.2s ease-in-out;

  &:hover {
    box-shadow: inset 0 -2rem 0 0 $primary-color;
    color: $text-color;
  }
}

// Layout

.layout {
  margin: 0.5rem;
  max-width: $large-screen;
  padding: 0.5rem 0.5rem;
}

.layout .card {
  background: $card-bg-color;
  border-radius: 2rem;
  margin: 3rem 0;
  padding: 1rem 2rem;
}

.layout .card .title {
  text-align: center;
  position: relative;
}

.layout .card .subtitle {
  text-align: center;
}

.layout .card .description {
  text-align: justify;
}

.neumorphism-button {
  background: linear-gradient(
    145deg,
    rgba(100, 100, 105, 0.15) 15%,
    rgba(33, 33, 33, 0.4) 80%
  );
  box-shadow: -4px -3px 2px 0 rgba(250, 250, 250, 0.13),
    4px 4px 2px 0 rgba(0, 0, 0, 0.4);
}

@mixin neumorphism-button-pressed {
  background: linear-gradient(
    150deg,
    rgba(20, 20, 20, 0.4) 10%,
    rgba(115, 115, 115, 0.15) 80%
  );
  box-shadow: 1px 1px 2px 0 rgba(210, 210, 210, 0.4),
    -1px -1px 2px rgba(0, 0, 0, 0.4), inset 3px 3px 2px 0 rgba(0, 0, 0, 0.4),
    inset -1px -2px 2px rgba(210, 210, 210, 0.4);
}

.neumorphism-card {
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 1),
    inset -2px -2px 4px rgba(99, 99, 99, 1);
}

.neumorphism-card-big {
  box-shadow: 5px 5px 4px #161718, -5px -5px 4px #404346;
}

// Preloader

#preloader {
  align-items: center;
  background: $bg-color;
  display: flex;
  height: 100%;
  justify-content: center;
  left: 0;
  margin: 0.5rem;
  padding: 0.5rem;
  position: absolute;
  right: 0;
  z-index: 999;

  .load {
    height: 6rem;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 6rem;
  }

  .load hr {
    animation: spin 2s ease infinite;
    border: 0;
    height: 40%;
    margin: 0;
    position: absolute;
    width: 40%;
  }

  .load :first-child {
    animation-delay: -1.5s;
    background: $text-color;
  }

  .load :nth-child(2) {
    animation-delay: -1s;
    background: $primary-color;
  }

  .load :nth-child(3) {
    animation-delay: -0.5s;
    background: $text-color;
  }

  .load :last-child {
    background: $primary-color;
  }

  @keyframes spin {
    0%,
    100% {
      transform: translate(0);
    }
    25% {
      transform: translate(160%);
    }
    50% {
      transform: translate(160%, 160%);
    }
    75% {
      transform: translate(0, 160%);
    }
  }
}

// Footer

.footer {
  background: $bg-color;
  color: $text-color;
  margin: 0.5rem;
  padding: 1rem;
  text-align: center;
}

.footer a {
  color: $primary-color;

  &:hover,
  &:focus {
    background: $bg-color;
    color: $text-color;
  }
}

// Landing Page

#landing {
  background: $bg-color;
  color: $text-color;
  display: flex;
  height: 100%;
  margin: 0.5rem;
  padding: 0.5rem;
  text-align: center;
}

.landing-title {
  left: 0;
  margin: 0.5rem;
  padding: 0.5rem;
  position: absolute;
  right: 0;
  top: 40%;
}

.landing-icons {
  display: flex;
  justify-content: center;

  .social-link {
    color: $text-color;
    position: relative;
    height: 3rem;
    line-height: 3rem;
    margin: 0.25rem;
    width: 3rem;

    .circle {
      animation: outWaveOut 1s cubic-bezier(0.42, 0, 0.58, 1) forwards;
      fill: none;
      stroke-dasharray: 40;
      transition: all 0.2s ease-in-out;
    }

    .social {
      font-size: 1.5rem;
      position: absolute;
      top: 0px;
      transition: all 0.5s ease-in-out;
      width: 100%;
    }

    .social-svg {
      fill: white;
    }

    .label {
      display: none;
    }

    &:hover {
      cursor: pointer;

      .circle {
        animation: outWaveIn 1s cubic-bezier(0.42, 0, 0.58, 1) forwards,
          colorBlackIcon 1s linear forwards;
        fill: $text-color;
        fill-opacity: 1;
      }

      .social-svg {
        fill: #000;
      }

      .label {
        display: unset !important;
        position: relative;
        top: -2rem;
      }
    }
  }

  .email:hover {
    .circle {
      animation: outWaveIn 1s cubic-bezier(0.42, 0, 0.58, 1) forwards,
        colorEmail 1s linear forwards;
    }
    .social-svg {
      fill: #d44638;
    }
  }

  .telegram:hover {
    .circle {
      animation: outWaveIn 1s cubic-bezier(0.42, 0, 0.58, 1) forwards,
        colorTelegram 1s linear forwards;
    }
    .social-svg {
      fill: #2aabee;
    }
  }

  .linkedin:hover {
    .circle {
      animation: outWaveIn 1s cubic-bezier(0.42, 0, 0.58, 1) forwards,
        colorLinkedIn 1s linear forwards;
    }
    .social-svg {
      fill: #0072b1;
    }
  }

  .stackoverflow:hover {
    .circle {
      animation: outWaveIn 1s cubic-bezier(0.42, 0, 0.58, 1) forwards,
        colorStackOverflow 1s linear forwards;
    }
    .social-svg {
      fill: #f47f24;
    }
  }

  .twitter:hover {
    .circle {
      animation: outWaveIn 1s cubic-bezier(0.42, 0, 0.58, 1) forwards,
        colorTwitter 1s linear forwards;
    }
    .social-svg {
      fill: #1da1f2;
    }
  }

  .instagram:hover {
    .circle {
      animation: outWaveIn 1s cubic-bezier(0.42, 0, 0.58, 1) forwards,
        colorInstagram 1s linear forwards;
    }
    .social-svg {
      fill: #e1306c;
    }
  }

  .facebook:hover {
    .circle {
      animation: outWaveIn 1s cubic-bezier(0.42, 0, 0.58, 1) forwards,
        colorFacebook 1s linear forwards;
    }
    .social-svg {
      fill: #4267b2;
    }
  }

  @keyframes outWaveIn {
    to {
      stroke-dasharray: 510;
      stroke-width: 0.5rem;
    }
  }

  @keyframes outWaveOut {
    from {
      stroke: $text-color;
      stroke-dasharray: 510;
      stroke-width: 0.5rem;
    }
    to {
      stroke: $text-color;
      stroke-dasharray: 83;
      stroke-width: 0.5rem;
    }
  }

  @keyframes colorBlackIcon {
    to {
      stroke: #000;
    }
  }

  @keyframes colorEmail {
    to {
      stroke: #b23121;
    }
  }

  @keyframes colorTelegram {
    to {
      stroke: #229ed9;
    }
  }

  @keyframes colorLinkedIn {
    to {
      stroke: #005b8e;
    }
  }

  @keyframes colorStackOverflow {
    to {
      stroke: #d96311;
    }
  }

  @keyframes colorTwitter {
    to {
      stroke: #1da1f2;
    }
  }

  @keyframes colorFacebook {
    to {
      stroke: #2f477a;
    }
  }

  @keyframes colorInstagram {
    to {
      stroke: #833ab4;
    }
  }
}

/* Skills Section */

#skills {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;

  div {
    padding: 0.2rem;
    transition: opacity 0.5s;
  }

  div[skill-type="language"] {
    color: #e84a5f;
  }

  div[skill-type="framework"] {
    color: #ff847c;
  }

  div[skill-type="tool"] {
    color: #fecea8;
  }

  div[skill-weight="1"] {
    font-size: 0.75rem;
    line-height: 0.25rem;
  }

  div[skill-weight="2"] {
    font-size: 1.25rem;
    line-height: 0.75rem;
  }

  div[skill-weight="3"] {
    font-size: 1.75rem;
    line-height: 1.25rem;
  }

  div[skill-weight="4"] {
    font-size: 2.25rem;
    line-height: 1.75rem;
  }

  div[skill-weight="5"] {
    font-size: 2.75rem;
    line-height: 2.25rem;
  }

  input[type="radio"] {
    display: none;
  }

  .filter-button {
    display: none;
  }
}

// Timeline Section

.timeline-wrapper {
  .timeline {
    list-style-type: none;
    padding: 0;
    position: relative;
  }

  .timeline:before {
    background: linear-gradient(
      to bottom,
      #f3f3f3 0%,
      #d5d5d5 8%,
      #d5d5d5 92%,
      #f3f3f3 100%
    );
    content: " ";
    height: 100%;
    left: 50%;
    margin-left: -0.0675rem;
    position: absolute;
    width: 0.125rem;
    z-index: -1;
  }

  .timeline li {
    padding: 1rem 0;
  }

  .hexagon {
    background: $primary-color;
    height: 0.5rem;
    left: 0;
    margin-left: auto;
    margin-right: auto;
    position: absolute;
    right: 0;
    top: -0.8rem;
    width: 1rem;
  }

  .hexagon:before,
  .hexagon:after {
    border-left: 2rem solid transparent;
    border-right: 2rem solid transparent;
    border-left-width: 0.5rem;
    border-right-width: 0.5rem;
    content: "";
    left: 0;
    position: absolute;
  }

  .hexagon:before {
    border-bottom: 0.25rem solid $primary-color;
    top: -0.25rem;
  }

  .hexagon:after {
    border-top: 0.25rem solid $primary-color;
    bottom: -0.25rem;
  }

  .flag-wrapper {
    position: relative;
    text-align: center;
  }

  .flag {
    background: $bg-color;
    border-radius: 0.5rem;
    font-weight: $font-weight-strong;
    padding: 0.25rem 0.5rem;

    span {
      position: relative;
      transition: 0.4s;
    }

    span:after {
      content: "\226B";
      color: $primary-color;
      position: absolute;
      opacity: 0;
      right: -1rem;
      transition: 0.4s;
    }

    &:hover span {
      letter-spacing: 0.05rem;
      padding-right: 1.25rem;
    }

    &:hover span:after {
      opacity: 1;
      right: 0;
    }
  }

  .time-wrapper {
    color: $text-color;
    display: block;
    line-height: 0.5rem;
    margin-top: 0.3rem;
  }

  .time {
    background: $bg-color;
    border-radius: 0.5rem;
    display: inline-block;
    padding: .6rem;
  }

  .desc {
    background: $bg-color;
    border-radius: 1rem;
    margin: 1em 0 0 0;
    padding: 0.75em;
    text-align: center;
  }
}

// Projects Card

.project {
  border-radius: 1rem;
  margin: 1rem 0;
  padding: 0.5rem 1rem;
}

.project .name-link-wrapper {
  display: flex;
  justify-content: space-between;
}

.project .name-link-wrapper .links {
  font-size: 1.5rem;
  margin: 1rem 0.5rem;
}

.project-desc {
  line-height: 1rem;
}

.project-stars-forks {
  fill: $text-color;
  font-family: $font-family-numbers;
}

.tag-wrapper {
  margin: 1rem 0 0 0;
}

.tag {
  border-radius: 0.5rem;
  display: inline-block;
  margin-bottom: 0.25rem;
  padding: 0.5rem;
}

// Contact Card

.contact-icons {
  display: flex;
  justify-content: center;

  .social-link {
    position: relative;
    height: 3rem;
    line-height: 3rem;
    margin: 0.25rem;
    text-align: center;
    width: 3rem;

    .social {
      font-size: 1.5rem;
    }

    .social-svg {
      fill: $primary-color;
    }

    &:hover {
      cursor: pointer;
      animation: jump 1s infinite alternate;

      .social-svg {
        fill: $text-color;
      }
    }
  }

  .black:hover {
    .social-svg {
      fill: #000;
    }
  }

  .telegram:hover {
    .social-svg {
      fill: #2aabee;
    }
  }

  .linkedin:hover {
    .social-svg {
      fill: #007bb6;
    }
  }

  .twitter:hover {
    .social-svg {
      fill: #1da1f2;
    }
  }

  .stackoverflow:hover {
    .social-svg {
      fill: #f47f24;
    }
  }

  .instagram:hover {
    .social-svg {
      fill: #c13584;
    }
  }

  .facebook:hover {
    .social-svg {
      fill: #4267b2;
    }
  }
}

// Media Queries

@media only screen and (min-width: $small-screen) {
  .layout {
    margin: 0.5rem auto;
    padding: 2rem 2rem;
  }

  .layout .card .subtitle {
    font-size: 1.25rem;
  }

  .layout .card .description {
    font-size: 1.25rem;
  }

  .landing-title h1 {
    font-size: 3rem;
  }

  .landing-icons .social-link {
    width: 4rem;
    height: 4rem;
    line-height: 4rem;

    .social {
      font-size: 2rem;
    }
  }

  #skills {
    div[skill-weight="1"] {
      font-size: 1rem;
      line-height: 0rem;
    }

    div[skill-weight="2"] {
      font-size: 2rem;
      line-height: 1rem;
    }

    div[skill-weight="3"] {
      font-size: 3rem;
      line-height: 2rem;
    }

    div[skill-weight="4"] {
      font-size: 4rem;
      line-height: 3rem;
    }

    div[skill-weight="5"] {
      font-size: 5rem;
      line-height: 4rem;
    }

    .filter-button {
      border-radius: 0.5rem;
      cursor: pointer;
      display: unset;
      margin: 0 0.5rem 1rem;
      padding: 0.5rem 0.25rem;
      text-align: center;
      width: 21%;

      &:hover {
        letter-spacing: 0.25rem;
      }
    }

    @mixin filter-out {
      height: 0;
      margin: 0;
      opacity: 0;
      padding: 0;
      width: 0;
    }

    input[type="radio"]:checked + .filter-button {
      color: $primary-color;
      font-weight: $font-weight-strong;
      @include neumorphism-button-pressed();
    }

    input[id="language"]:checked ~ div[skill-type="framework"],
    input[id="language"]:checked ~ div[skill-type="tool"] {
      @include filter-out;
    }

    input[id="framework"]:checked ~ div[skill-type="language"],
    input[id="framework"]:checked ~ div[skill-type="tool"] {
      @include filter-out;
    }

    input[id="tool"]:checked ~ div[skill-type="language"],
    input[id="tool"]:checked ~ div[skill-type="framework"] {
      @include filter-out;
    }
  }

  .timeline-wrapper {
    .timeline {
      margin: 0 auto;
      width: 39.25rem;
    }

    .timeline li:after {
      clear: both;
      content: "";
      display: block;
    }

    .direction-l {
      float: left;
      text-align: right;
      width: 18.5rem;

      .hexagon {
        left: auto;
        right: -1.6rem;
        top: 0.4rem;
      }

      .flag-wrapper {
        display: inline-block;
        text-align: right;
      }

      .time-wrapper {
        float: left;
        margin-top: -0.1rem;
      }

      .desc {
        text-align: right;
      }
    }

    .direction-r {
      float: right;
      text-align: left;
      width: 18.5rem;

      .hexagon {
        left: -1.6rem;
        right: auto;
        top: 0.4rem;
      }

      .flag-wrapper {
        display: inline-block;
        text-align: left;
      }

      .time-wrapper {
        float: right;
        margin-top: -0.1rem;
      }

      .desc {
        text-align: left;
      }
    }
  }

  .projects-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    > * {
      width: 44%;
    }
  }

  .contact-icons .social-link {
    width: 4rem;
    height: 4rem;
    line-height: 4rem;

    .social {
      font-size: 2rem;
    }
  }
}

@media only screen and (min-width: $medium-screen) {
  .layout {
    padding: 3rem 3rem;
  }

  .layout .card {
    padding: 1rem 3rem;
  }

  #skills .filter-button {
    width: 21.5%;
  }

  .timeline-wrapper {
    .timeline {
      width: 49rem;
    }

    .direction-l {
      width: 23.35rem;
    }

    .direction-r {
      width: 23.35rem;
    }
  }

  .projects-wrapper {
    > * {
      width: 45%;
    }
  }
}

@media only screen and (min-width: $large-screen) {
  .layout {
    padding: 5rem 5rem;
  }

  #skills .filter-button {
    width: 22%;
  }

  .timeline-wrapper {
    .timeline {
      width: 58rem;
    }

    .direction-l {
      width: 27.9rem;
    }

    .direction-r {
      width: 27.9rem;
    }
  }

  .projects-wrapper {
    > * {
      width: 46%;
    }
  }
}

// Reusable Animations

@keyframes jump {
  0% {
    bottom: 0;
  }
  50% {
    bottom: 0.5rem;
  }
  100% {
    bottom: 0;
  }
}
