:root {
  --background-color: hsl(0, 0%, 100%);
  --color-text: hsl(228, 12%, 44%);
  --color-title: black;
  --color-card-bg: hsl(227, 47%, 96%);

  --color-positive: hsl(163, 72%, 41%);
  --color-negative: hsl(356, 69%, 56%);
  --color-js: #f0db4f;
  --color-css: #264de4;
  --color-html: #f06529;
  --color-bg-linear: linear-gradient(to right, #e34c26, #f06529);
}

.dark-mode:root {
  --background-color: hsl(230, 17%, 14%);
  --color-text: hsl(228, 34%, 66%);
  --color-title: white;
  --color-card-bg: hsl(228, 28%, 20%);
}

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

body,
html {
  background-color: var(--background-color);
}

body,
html,
.container {
  transition: background-color 0.2s;
}

body,
html {
  /* height: 100%; */
  width: 100%;
  font-family: "Inter", sans-serif;
}

/* ========================================================================== /
/ GROUP-STYLES  /
/ ========================================================================== */

.body__text,
.toggle__text {
  color: var(--color-text);
}

.toggle__text,
.body__title,
.footer__text .bottom__quantity,
.percentage__text {
  font-weight: bold;
}

/* ========================================================================== /
/ END-GROUP-STYLES /
/ ========================================================================== */

.container {
  height: 100%;
  width: 100%;
  padding: 20px;

  display: flex;
  flex-direction: column;
  align-items: center;

  background-color: var(--background-color);
}

/* ========================================================================== /
/ CONTAINER PROJECTS  /
/ ========================================================================== */

.container__projects {
  width: 100%;
}

.projects__top-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.top-bar__logo {
  font-size: 29px;
  grid-row: 1;
}

.top-bar__counter {
  display: none;
}

.logo--js {
  color: var(--color-js);
}
.logo--html {
  color: var(--color-html);
}
.logo--css {
  color: var(--color-css);
}

.top-bar__title {
  grid-row: 1;
  font-size: 16px;
  color: var(--color-title);
  text-align: end;
}

.top-bar__toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;

  width: 100%;
  grid-column: 1 /-1;

  margin: 10px 0;
}

.toggle__container {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle__input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__input:focus + .toggle__switch {
  box-shadow: 0 0 1px #2196f3;
}

.toggle__switch {
  position: absolute;

  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  cursor: pointer;

  transition: 0.4s;
  border-radius: 34px;
  background-color: #ccc;
}

.toggle__input:checked + .toggle__switch {
  background: linear-gradient(hsl(210, 78%, 56%), hsl(146, 68%, 55%));
}

.toggle__switch:before {
  content: "";
  position: absolute;

  height: 16px;
  width: 16px;
  right: 4px;
  bottom: 4px;

  transition: 0.4s;
  border-radius: 50%;
  background-color: white;
}

.toggle__input:checked + .toggle__switch::before {
  transform: translateX(-26px);
  background-color: var(--background-color);
}

.projects__content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ========================================================================== /
  / CARD /
  / ========================================================================== */

.card__header,
.card__body,
.card__footer {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;

  width: 100%;
  background-color: var(--color-card-bg);
  border-radius: 10px;
  margin-top: 20px;
  max-width: 350px;
  height: 382px;

  padding: 20px;
}

.card::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 6px;
  background: black;
  top: 1px;
  border-top-right-radius: 10px;
  border-top-left-radius: 10px;
  left: 0;
  background: var(--color-bg-linear);
}

.card__header {
  width: 100%;
  justify-content: space-between;
}

.header__image {
  width: 100%;
  height: 183px;
}

.card__body {
  flex-direction: column;
}

.body__title {
  font-size: 19px;
  color: var(--color-title);
  text-align: justify;
  margin-top: 10px;
}

.body__text {
  margin-top: 10px;
  text-align: justify;
  font-size: 12px;
  letter-spacing: 2px;
}

.card__footer {
  width: 100%;
}

.footer__btn-link {
  margin-top: 15px;
  background: var(--color-bg-linear);
  color: white;
  width: inherit;
  border-radius: 4px;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer__image {
  margin-right: 5px;
}

.footer__text--red {
  color: var(--color-negative);
}

.footer__text--green {
  color: var(--color-positive);
}

/* ========================================================================== /
/ END-CARD /
/ ========================================================================== */

/* ========================================================================== /
/ END-CONTAINER PROJECTS/
/ ========================================================================== */

/* ========================================================================== /
/ TABLET/
/ ========================================================================== */

@media screen and (min-width: 730px) and (max-width: 999px) {
  .container {
    padding: 20px 60px;
  }

  .top-bar__logo {
    font-size: 50px;
    grid-row: 1;
  }

  .card {
    max-width: 293px;
    max-height: 382px;
  }

  .projects__content {
    flex-flow: row wrap;
    justify-content: space-between;
  }

  .projects__top-bar {
    flex-direction: row;
    justify-content: space-between;
  }

  .top-bar__title {
    font-size: 26px;
    justify-self: end;
  }
  .toggle__text {
    font-size: 12px;
  }

  .toggle__text {
    margin-right: 10px;
  }

  .top-bar__toggle {
    margin: 0;
    justify-content: flex-end;
  }

  .toggle__container {
    height: 24px;
    width: 48px;
  }

  .toggle__switch:before {
    height: 20px;
    width: 20px;
    right: 3px;
    bottom: 2px;
  }

  .toggle__input:checked + .toggle__switch::before {
    transform: translateX(-22px);
  }
}

/* ========================================================================== /
/ END-TABLET /
/ ========================================================================== */

/* ========================================================================== /
/ DESKTOP /
/ ========================================================================== */

@media screen and (min-width: 1000px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .container {
    padding: 20px 80px;
    max-width: 1200px;
  }

  .top-bar__logo {
    font-size: 50px;
    grid-row: 1;
  }

  .top-bar__counter {
    display: flex;
    width: 230px;
    grid-row: 2;
    grid-column: 1;
    align-self: center;
  }

  .counter__visitors {
    display: flex;
  }

  .top-bar__counter a {
    width: 90px;
  }

  .counter__text {
    display: flex;
    margin-right: 5px;
    color: var(--color-text);
  }

  .card {
    max-width: 300px;
    max-height: 382px;
  }

  .projects__content {
    flex-flow: row wrap;
    column-gap: 70px;
  }

  .projects__top-bar {
    grid-template-rows: 1fr 60px;
    justify-content: space-between;
    align-items: center;
  }

  .top-bar__title {
    font-size: 40px;
  }

  .toggle__text {
    font-size: 12px;
  }

  .toggle__text {
    margin-right: 10px;
  }

  .top-bar__toggle {
    margin: 0;
    justify-content: flex-end;
    grid-row: 2;
  }

  .toggle__container {
    height: 24px;
    width: 48px;
  }

  .toggle__switch:before {
    height: 20px;
    width: 20px;
    right: 3px;
    bottom: 2px;
  }

  .toggle__input:checked + .toggle__switch::before {
    transform: translateX(-22px);
  }
}

/* ========================================================================== /
/ END-DESKTOP /
/ ========================================================================== */
