@font-face {
  font-style: normal;
  font-weight: 400;
  font-family: "Gasoek One";

  font-display: swap;
  src: url("../assets/fonts/gasoek-one-regular.woff2") format(woff2),
  url("../assets/fonts/gasoek-one-regular.woff") format(woff);
}

:root {
  --font: -apple-system, BlinkMacSystemFont, "San Francisco", "Helvetica Neue", "Helvetica", "Ubuntu", "Roboto", "Noto", "Segoe UI", "Arial", sans-serif;

  --border: rgba(0, 0, 0, 0.12);

  --black: #000000;
  --gradient: linear-gradient(0deg, rgba(0, 0, 0, 0.65), transparent 55%);
  --light-grey: #d1d1d1;
  --nero: #292929;
  --whisper: #eeeeee;
  --white: #ffffff;
  --white-smoke: #f2f2f2;
}

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

html {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 100%;
  margin: 0;

  font-size: 14px;
  font-family: var(--font);

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

img {
  display: block;
}

.no-scroll {
  overflow: hidden;
}

.visually-hidden {
  position: absolute;

  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;

  white-space: nowrap;

  border: 0;

  clip: rect(0 0 0 0);
  clip-path: inset(100%);
}

.button {
  background-color: transparent;
  background-repeat: no-repeat;
  border: none;
  cursor: pointer;
  opacity: 0.4;
}

.button:hover {
  opacity: 1;
}

.main {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 65px;
}

.is-loading.main {
  align-items: center;

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

.is-error.main {
  align-items: center;

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

.background {
  background: var(--gradient);
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;

  background-color: white;
  box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.08);
}

.header__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
  padding-top: 10px;
  padding-right: 20px;
  padding-bottom: 10px;
  padding-left: 20px;

  column-gap: 10px;
}

.header__logo {
  display: block;

  text-decoration: none;
}

.header__search {
  position: relative;

  display: flex;
  align-items: center;
  width: 60%;
  padding: 0 20px;

  column-gap: 10px;

  background-color: var(--whisper);
  border-radius: 24px;
}

.header__search:has(.header__search-input:focus-visible) {
  background-color: transparent;
  outline: 1px solid var(--light-grey);
}

.header__search-input {
  flex-grow: 1;
  width: 100%;
  padding: 0;
  padding: 13px 0;

  font-size: 16px;
  line-height: 0.6;

  background-color: transparent;
  border: none;

  appearance: none;
}

.header__search-input::placeholder {
  opacity: 1;
}

.header__search-input:focus-visible {
  outline: none;
}

.header__search-button {
  width: 20px;
  height: 20px;

  background-image: url("../assets/svg/search-icon.svg");
  background-size: 20px 20px;
}

.header__search-reset {
  display: none;
  width: 24px;
  height: 24px;

  background-image: url("../assets/svg/cross.svg");
  background-size: 24px 24px;
}

.is-full + .header__search-reset {
  display: flex;
}

.is-loading .gallery {
  display: none;
}

.is-error .gallery {
  display: none;
}

.gallery {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  justify-content: center;
  max-width: 1336px;
  margin: 0 auto;
}

.gallery__intro {
  display: flex;
  align-items: end;
  padding: 30px 20px;

  column-gap: 20px;

  row-gap: 20px;
}

.gallery__headline {
  display: grid;
  flex-grow: 1;

  row-gap: 5px;
}

.gallery__bottom {
  display: flex;

  column-gap: 20px;

  row-gap: 20px;
}

.gallery__title {
  margin: 0 0 15px;

  font-size: 40px;
}

.gallery__description {
  max-width: 490px;
  margin: 0;

  font-size: 18px;
}

.gallery__text {
  margin: 0;

  font-size: 16px;

  opacity: 0.3;
}

.gallery__stats {
  display: grid;
  width: 300px;
  height: 300px;
  padding: 20px;

  background-image: url("../assets/svg/stats-up.svg");
  background-repeat: no-repeat;
  background-size: 100%;
  border-radius: 8px;
  outline: 1px solid var(--border);

  row-gap: 10px;
}

.gallery__stats-title {
  margin: 0;
}

.gallery__stats-list {
  display: grid;
  align-content: space-between;
  padding: 0;

  list-style: none;
  text-align: end;
}

.gallery__stats-count {
  margin-left: 5px;

  font-weight: 700;
  font-size: 23px;
}

.gallery__random {
  position: relative;

  width: 300px;
  height: 300px;
  overflow: hidden;

  border-radius: 8px;
}

.gallery__random-sign,
.gallery__sign {
  position: absolute;
  bottom: 0;

  display: flex;
  align-items: end;
  width: 100%;
  height: 100%;
  padding: 20px;
}

.gallery__sign {
  justify-content: space-between;

  column-gap: 20px;

  opacity: 0;
}

.gallery__random-contributor {
  font-size: 16px;
  color: var(--white);
}

.gallery__contributor,
.modal__contributor {
  display: flex;
  align-items: center;

  column-gap: 10px;
}

.gallery__contributor-img,
.modal__contributor-img {
  display: block;

  border-radius: 50%;
}

.gallery__contributor-name {
  font-size: 18px;
  color: var(--white);
}

.gallery__random-image {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.gallery__list {
  margin: 0;
  padding: 0 20px 40px;

  list-style: none;
  columns: 3 300px;
  column-gap: 20px;
}

.gallery__item {
  position: relative;

  margin-bottom: 20px;

  cursor: pointer;
}

.gallery__item:hover .gallery__sign {
  opacity: 1;

  transition: all 0.5s ease-out;
}

.gallery__image {
  width: 100%;
  height: 100%;
}

.button-shadow {
  background-color: transparent;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.error {
  display: none;
}

.is-error .error {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 500px;
  padding: 20px;

  text-align: center;
  color: var(--white-smoke);

  row-gap: 20px;
}

.error__title {
  position: absolute;
  bottom: calc(100% - 30px);

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;

  font-size: 5em;
  line-height: 1em;
  font-family: "Gasoek One", sans-serif;
  column-gap: 15px;

  opacity: 0.2;
}

.error__description {
  font-size: 18px;
}

.error__reload {
  position: absolute;
  top: calc(100% + 1px);

  width: 40px;
  height: 40px;

  background-color: transparent;
  background-image: url("../assets/svg/reload.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 30px 30px;
  border: none;
  cursor: pointer;
}

.loader {
  display: none;
}

.is-loading .loader {
  position: relative;

  display: flex;
  justify-content: space-between;
  width: 108px;
}

.is-error .loader {
  display: none;
}

.loader::after,
.loader::before {
  content: "";

  display: inline-block;
  width: 48px;
  height: 48px;

  background-color: #ffffff;
  background-image: url("../assets/svg/circle.svg");
  background-repeat: no-repeat;
  background-size: 30px 30px;
  border-radius: 50%;

  animation: eyeMove 10s infinite, blink 10s infinite;
}

@keyframes eyeMove {
  0%,
  10% {
    background-position: 9px 9px;
  }
  13%,
  40% {
    background-position: -10px 9px;
  }
  43%,
  70% {
    background-position: 27px 9px;
  }
  73%,
  90% {
    background-position: 9px 22px;
  }
  93%,
  100% {
    background-position: 9px 9px;
  }
}

.loader-more {
  display: none;
  align-self: center;
  width: 36px;
  height: 36px;

  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: transparent;
  border-radius: 50%;

  animation: spin89345 1s linear infinite;
}

.is-loading-more .loader-more {
  display: block;
}

@keyframes spin89345 {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes blink {
  0%,
  10%,
  12%,
  20%,
  22%,
  40%,
  42%,
  60%,
  62%,
  70%,
  72%,
  90%,
  92%,
  98%,
  100% {
    height: 48px;
  }
  11%,
  21%,
  41%,
  61%,
  71%,
  91%,
  99% {
    height: 18px;
  }
}

.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 15;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  transform: scale(1.1);
  visibility: hidden;
  opacity: 0;

  transition: opacity 0.7s cubic-bezier(0.61, 1, 0.88, 1), transform 0.7s cubic-bezier(0.61, 1, 0.88, 1), visibility 0.7s cubic-bezier(0.61, 1, 0.88, 1);

  pointer-events: none;

  -ms-overflow-style: none;
  scrollbar-width: none;
}

.modal.is-active {
  transform: scale(1);
  visibility: visible;
  opacity: 1;

  transition: opacity 0.7s cubic-bezier(0.61, 1, 0.88, 1), transform 0.7s cubic-bezier(0.61, 1, 0.88, 1);

  pointer-events: auto;
}

.modal__wrapper {
  position: relative;

  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100%;
  padding: 60px 20px 69px;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  background-color: var(--nero);
  visibility: hidden;
  opacity: 0;

  transition: opacity 0.7s cubic-bezier(0.61, 1, 0.88, 1), visibility 0.7s cubic-bezier(0.61, 1, 0.88, 1);
}

.is-active .modal__overlay {
  visibility: visible;
  cursor: pointer;
  opacity: 0.6;
}

.modal__content {
  z-index: 20;

  display: grid;
  width: 100%;
  min-width: 240px;
  max-width: 900px;
  overflow: hidden;

  background-color: var(--white);
  border-radius: 9px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.modal__control {
  position: absolute;
  top: 10px;
  right: 10px;

  width: 30px;
  height: 30px;

  background-color: transparent;
  background-image: url("../assets/svg/close.svg");
  background-repeat: no-repeat;
  background-size: 30px 30px;
  border: none;
  cursor: pointer;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  padding: 10px;
}

.modal__contributor {
  display: flex;
}

.modal__contributor-name {
  font-size: 18px;
  color: var(--black);
}

.modal__image-box {
  width: 100%;

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

.modal__image {
  width: 100%;
  height: 100%;
  max-height: 700px;

  object-fit: contain;
}

.modal__statistics-box {
  display: flex;
  justify-content: space-between;
  padding: 10px;
}

.modal__statistics-wrapper {
  display: grid;

  row-gap: 5px;
}

.modal__statistics-title {
  font-size: 16px;

  opacity: 0.6;
}

.modal__statistics-count {
  font-weight: 800;
  font-size: 16px;
}

.modal__button-download {
  position: relative;

  width: 40px;
  height: 32px;

  background: linear-gradient(180deg, transparent 50%, rgba(10, 20, 30, 0.06)), hsla(0, 0%, 96%, 0.98);
  border: 1px solid var(--nero);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.modal__button-download::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;

  width: 20px;
  height: 20px;

  background-image: url("../assets/svg/arrow-down.svg");
  background-repeat: no-repeat;
  background-size: 20px 20px;
  transform: translate(-50%, -50%);
}

.modal__button-download:hover {
  background: linear-gradient(180deg, transparent 50%, rgba(10, 20, 30, 0.06)), var(--white);
  border-color: transparent;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.2);

  transition-duration: 1s;
}

@media (max-width: 985px) {
  .gallery__stats {
    display: none;
  }
}

@media (max-width: 640px) {
  .gallery__random {
    display: none;
  }
}

@media (max-width: 550px) {
  .header__container {
    flex-direction: column;
    align-items: flex-start;

    row-gap: 15px;
  }

  .header__search {
    width: 100%;
  }

  .gallery__list {
    padding: 0 0 20px;
  }

  .gallery__item {
    margin: 0;
  }

  .gallery__sign {
    position: static;

    align-items: center;

    background: none;
    opacity: 1;
  }

  .gallery__contributor-name {
    color: var(--black);
  }

  .gallery__button-download {
    border: 1px solid var(--black);
  }

  .modal__image {
    object-fit: fill;
  }

  .modal__statistics-box {
    display: grid;

    row-gap: 5px;
  }

  .modal__statistics-wrapper {
    display: flex;

    column-gap: 5px;
  }
}
